signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JobOperatorImpl { /** * DS injection */
@ Reference ( cardinality = ReferenceCardinality . OPTIONAL , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) protected void setWSBatchAuthService ( WSBatchAuthService bas ) { } } | this . authService = bas ; |
public class EditTextDialogDecorator { /** * Requests the focus and displays the keyboard . */
private void requestFocus ( ) { } } | Window window = getWindow ( ) ; if ( window != null ) { window . setSoftInputMode ( WindowManager . LayoutParams . SOFT_INPUT_STATE_ALWAYS_VISIBLE ) ; } if ( editText != null ) { editText . requestFocus ( ) ; } |
public class IrrelevantFeatureAppenderStream { /** * Constructs the new header according to :
* 1 - The original header
* 2 - The number of numeric and categorical features given by the user . */
private void buildHeader ( ) { } } | ArrayList < Attribute > attributes = new ArrayList < > ( ) ; // copies the original attributes
InstancesHeader originalHeader = originalStream . getHeader ( ) ; for ( int i = 0 ; i < originalHeader . numAttributes ( ) ; i ++ ) { Attribute att = originalHeader . attribute ( i ) ; if ( att != originalHeader . classAttribute ( ) ) { attributes . add ( att ) ; } } // appends the new numeric features
for ( int i = 0 ; i < numNumericFeaturesOption . getValue ( ) ; i ++ ) { Attribute att = new Attribute ( ( "irrelNum" + i ) ) ; attributes . add ( att ) ; } // creates the values for categorical features
ArrayList < String > catVals = new ArrayList < > ( ) ; for ( int i = 0 ; i < numValuesCategoricalFeatureOption . getValue ( ) ; i ++ ) catVals . add ( "v" + i ) ; // appends the new categorical features
for ( int i = 0 ; i < numCategoricalFeaturesOption . getValue ( ) ; i ++ ) { Attribute att = new Attribute ( ( "irrelCat" + i ) , catVals ) ; attributes . add ( att ) ; } // appends the class attribute
if ( originalHeader . classIndex ( ) != - 1 ) { attributes . add ( originalHeader . attribute ( originalHeader . classIndex ( ) ) ) ; } // builds the new header
Instances format = new Instances ( getCLICreationString ( InstanceStream . class ) , attributes , 0 ) ; format . setClassIndex ( attributes . size ( ) - 1 ) ; newHeader = new InstancesHeader ( format ) ; |
public class Functions { /** * Accept a client token to establish a secure communication channel .
* @ param context GSSContext for which a connection has been established to the remote peer
* @ param token the client side token ( client side , as in the token had
* to be bootstrapped by the client and this peer uses that token
* to update the GSSContext )
* @ return a boolean to indicate whether the token was used to successfully
* establish a communication channel */
@ Function public static boolean acceptClientToken ( GSSContext context , byte [ ] token ) { } } | try { if ( ! context . isEstablished ( ) ) { byte [ ] nextToken = context . acceptSecContext ( token , 0 , token . length ) ; return nextToken == null ; } return true ; } catch ( GSSException ex ) { throw new RuntimeException ( "Exception accepting client token" , ex ) ; } |
public class dnsptrrec { /** * Use this API to delete dnsptrrec of given name . */
public static base_response delete ( nitro_service client , String reversedomain ) throws Exception { } } | dnsptrrec deleteresource = new dnsptrrec ( ) ; deleteresource . reversedomain = reversedomain ; return deleteresource . delete_resource ( client ) ; |
public class SmartsAtomAtomMapFilter { /** * Safely access the reaction role of an atom , returns { @ link ReactionRole # None } if null .
* @ param atom atom
* @ return mapidx , None if undefined */
private ReactionRole role ( IAtom atom ) { } } | ReactionRole role = atom . getProperty ( CDKConstants . REACTION_ROLE ) ; if ( role != null ) return role ; return ReactionRole . None ; |
public class StringUtil { /** * do first Letter Upper case
* @ param str String to operate
* @ return uppercase string */
public static String ucFirst ( String str ) { } } | if ( str == null ) return null ; else if ( str . length ( ) <= 1 ) return str . toUpperCase ( ) ; else { return str . substring ( 0 , 1 ) . toUpperCase ( ) + str . substring ( 1 ) ; } |
public class AuthorizationManager { /** * task query / / / / / */
public void configureTaskQuery ( TaskQueryImpl query ) { } } | configureQuery ( query ) ; if ( query . getAuthCheck ( ) . isAuthorizationCheckEnabled ( ) ) { // necessary authorization check when the task is part of
// a running process instance
CompositePermissionCheck permissionCheck = new PermissionCheckBuilder ( ) . disjunctive ( ) . atomicCheck ( TASK , "RES.ID_" , READ ) . atomicCheck ( PROCESS_DEFINITION , "PROCDEF.KEY_" , READ_TASK ) . build ( ) ; addPermissionCheck ( query . getAuthCheck ( ) , permissionCheck ) ; } |
public class CommandButtonLabelInfo { /** * Configures an existing button appropriately based on this label info ' s
* properties .
* @ param button */
public AbstractButton configure ( AbstractButton button ) { } } | Assert . notNull ( button ) ; button . setText ( this . labelInfo . getText ( ) ) ; button . setMnemonic ( this . labelInfo . getMnemonic ( ) ) ; button . setDisplayedMnemonicIndex ( this . labelInfo . getMnemonicIndex ( ) ) ; configureAccelerator ( button , getAccelerator ( ) ) ; return button ; |
public class TwitterStreamImpl { /** * Returns a stream of random sample of all public statuses . The default access level provides a small proportion of the Firehose . The " Gardenhose " access level provides a proportion more suitable for data mining and research applications that desire a larger proportion to be statistically significant sample .
* @ return StatusStream
* @ throws TwitterException when Twitter service or network is unavailable
* @ see twitter4j . StatusStream
* @ see < a href = " https : / / dev . twitter . com / docs / streaming - api / methods " > Streaming API : Methods statuses / sample < / a >
* @ since Twitter4J 2.0.10 */
StatusStream getSampleStream ( ) throws TwitterException { } } | ensureAuthorizationEnabled ( ) ; try { return new StatusStreamImpl ( getDispatcher ( ) , http . get ( conf . getStreamBaseURL ( ) + "statuses/sample.json?" + stallWarningsGetParam , null , auth , null ) , conf ) ; } catch ( IOException e ) { throw new TwitterException ( e ) ; } |
public class GetLogsFromNode { /** * Do the work . */
public void doIt ( ) { } } | if ( nodeidx == - 1 ) { GetLogsTask t = new GetLogsTask ( ) ; t . doIt ( ) ; bytes = t . _bytes ; } else { H2ONode node = H2O . CLOUD . _memary [ nodeidx ] ; GetLogsTask t = new GetLogsTask ( ) ; Log . trace ( "GetLogsTask starting to node " + nodeidx + "..." ) ; // Synchronous RPC call to get ticks from remote ( possibly this ) node .
new RPC < > ( node , t ) . call ( ) . get ( ) ; Log . trace ( "GetLogsTask completed to node " + nodeidx ) ; bytes = t . _bytes ; } |
public class Ameba { /** * < p > main . < / p >
* @ param args an array of { @ link java . lang . String } objects . */
public static void main ( String [ ] args ) { } } | // register shutdown hook
Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( Ameba :: shutdown , "AmebaShutdownHook" ) ) ; List < String > list = Lists . newArrayList ( ) ; String idCommand = "--#" ; int idArgLen = idCommand . length ( ) ; for ( String arg : args ) { if ( arg . startsWith ( idCommand ) ) { String idConf = arg . substring ( idArgLen ) ; if ( StringUtils . isNotBlank ( idConf ) ) { list . add ( idConf ) ; } } } try { bootstrap ( list . toArray ( new String [ list . size ( ) ] ) ) ; } catch ( Throwable e ) { logger . error ( Messages . get ( "info.service.error.startup" ) , e ) ; try { Thread . sleep ( 10000 ) ; } catch ( InterruptedException e1 ) { // no op
} shutdown ( ) ; System . exit ( 500 ) ; } try { Thread . currentThread ( ) . join ( ) ; } catch ( InterruptedException e ) { // no op
} |
public class RequestUtils { /** * Converts request and query parameter into a single map
* @ param exchange The Undertow HttpServerExchange
* @ return A single map contain both request and query parameter */
public static Map < String , String > getRequestParameters ( HttpServerExchange exchange ) { } } | Objects . requireNonNull ( exchange , Required . HTTP_SERVER_EXCHANGE . toString ( ) ) ; final Map < String , String > requestParamater = new HashMap < > ( ) ; final Map < String , Deque < String > > queryParameters = exchange . getQueryParameters ( ) ; queryParameters . putAll ( exchange . getPathParameters ( ) ) ; queryParameters . entrySet ( ) . forEach ( entry -> requestParamater . put ( entry . getKey ( ) , entry . getValue ( ) . element ( ) ) ) ; return requestParamater ; |
public class PatchedBigQueryServicesImpl { /** * Identical to { @ link BackOffUtils # next } but without checked IOException . */
private static boolean nextBackOff ( Sleeper sleeper , BackOff backoff ) throws InterruptedException { } } | try { return BackOffUtils . next ( sleeper , backoff ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } |
public class UserResource { /** * Update a user .
* @ param user user updates
* @ param uriInfo injected
* @ return http 200
* The URI of the updated user will be stated in the Location header */
@ POST @ Path ( "{id}" ) @ RolesAllowed ( { } } | "ROLE_ADMIN" } ) public Response update ( @ PathParam ( "id" ) Long id , @ Context UriInfo uriInfo , @ Context SecurityContext securityContext , DUser user ) { checkNotNull ( id ) ; // Username and email will never be updated , no need to check format
user = userService . update ( id , user , securityContext . isUserInRole ( OAuth2UserResource . ROLE_ADMIN ) ) ; UriBuilder uriBuilder = uriInfo . getBaseUriBuilder ( ) . path ( "api/users" ) . path ( user . getId ( ) . toString ( ) ) ; return Response . ok ( ) . location ( uriBuilder . build ( ) ) . entity ( user . getId ( ) ) . build ( ) ; |
public class IfcBSplineSurfaceWithKnotsImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < String > getVKnotsAsString ( ) { } } | return ( EList < String > ) eGet ( Ifc4Package . Literals . IFC_BSPLINE_SURFACE_WITH_KNOTS__VKNOTS_AS_STRING , true ) ; |
public class EbeanQueryChannelService { /** * Return an object relational query for finding a List , Set , Map or single entity bean .
* @ return the Query . */
@ Override public < T > Query < T > createQuery ( Class < T > entityType , Object queryObject ) { } } | Assert . notNull ( entityType , "entityType must not null" ) ; Assert . notNull ( queryObject , "queryObject must not null" ) ; return query ( entityType , queryObject ) ; |
public class DBColumnPropertySheet { /** * GEN - LAST : event _ tfJavaFieldNameActionPerformed */
private void cmbJavaTypeActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ cmbJavaTypeActionPerformed
{ } } | // GEN - HEADEREND : event _ cmbJavaTypeActionPerformed
// Add your handling code here :
aColumn . setJavaFieldType ( cmbJavaType . getSelectedItem ( ) . toString ( ) ) ; if ( cmbJavaType . getModel ( ) instanceof org . apache . ojb . tools . swing . SortingComboBoxModel ) { org . apache . ojb . tools . swing . SortingComboBoxModel cmbModel = ( org . apache . ojb . tools . swing . SortingComboBoxModel ) this . cmbJavaType . getModel ( ) ; if ( cmbModel . getIndexOf ( cmbJavaType . getSelectedItem ( ) ) == - 1 ) cmbJavaType . addItem ( cmbJavaType . getSelectedItem ( ) ) ; } else if ( cmbJavaType . getModel ( ) instanceof javax . swing . DefaultComboBoxModel ) { javax . swing . DefaultComboBoxModel cmbModel = ( javax . swing . DefaultComboBoxModel ) this . cmbJavaType . getModel ( ) ; if ( cmbModel . getIndexOf ( cmbJavaType . getSelectedItem ( ) ) == - 1 ) cmbJavaType . addItem ( cmbJavaType . getSelectedItem ( ) ) ; } |
public class EmoUriComponent { /** * Contextually encodes the characters of string that are either non - ASCII
* characters or are ASCII characters that must be percent - encoded using the
* UTF - 8 encoding . Percent - encoded characters will be recognized and not
* double encoded .
* @ param s the string to be encoded .
* @ param t the URI component type identifying the ASCII characters that
* must be percent - encoded .
* @ param template true if the encoded string contains URI template variables
* @ return the encoded string . */
public static String contextualEncode ( String s , Type t , boolean template ) { } } | return _encode ( s , t , template , true ) ; |
public class AmazonWorkLinkClient { /** * Describes the identity provider configuration of the specified fleet .
* @ param describeIdentityProviderConfigurationRequest
* @ return Result of the DescribeIdentityProviderConfiguration operation returned by the service .
* @ throws UnauthorizedException
* You are not authorized to perform this action .
* @ throws InternalServerErrorException
* The service is temporarily unavailable .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws ResourceNotFoundException
* The requested resource was not found .
* @ throws TooManyRequestsException
* The number of requests exceeds the limit .
* @ sample AmazonWorkLink . DescribeIdentityProviderConfiguration
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / worklink - 2018-09-25 / DescribeIdentityProviderConfiguration "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeIdentityProviderConfigurationResult describeIdentityProviderConfiguration ( DescribeIdentityProviderConfigurationRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeIdentityProviderConfiguration ( request ) ; |
public class DefaultNamingStrategy { /** * Return the column name or the unqualified property name */
public String logicalColumnName ( String columnName , String propertyName ) { } } | return ! isNullOrEmpty ( columnName ) ? columnName : unqualify ( propertyName ) ; |
public class DataKey { /** * creates a data key with the given name and type . This data
* key allows for null values and sets no default value .
* @ param < T > the type
* @ param name the name of the key that is stored in the xdata file
* @ param dataClass the type ' s class
* @ return */
public static < T > DataKey < T > create ( String name , Class < T > dataClass ) { } } | return create ( name , dataClass , true , null ) ; |
public class CmsCloneModuleThread { /** * Renames the vfs resource bundle files within the target module according to the new module ' s name . < p >
* @ param resources the vfs resource bundle files
* @ param targetModule the target module
* @ param name the package name of the source module
* @ return a list of all xml vfs bundles within the given module
* @ throws CmsException if something gows wrong */
private List < CmsResource > renameXmlVfsBundles ( List < CmsResource > resources , CmsModule targetModule , String name ) throws CmsException { } } | for ( CmsResource res : resources ) { String newName = res . getName ( ) . replaceAll ( name , targetModule . getName ( ) ) ; String targetRootPath = CmsResource . getFolderPath ( res . getRootPath ( ) ) + newName ; if ( ! getCms ( ) . existsResource ( targetRootPath ) ) { getCms ( ) . moveResource ( res . getRootPath ( ) , targetRootPath ) ; } } return resources ; |
public class PermissionUtil { /** * Returns , whether all permissions , which are contained by a specific array , are granted , or
* not .
* @ param context
* The context , which should be used , as an instance of the class { @ link Context } . The
* context may not be null
* @ param permissions
* An array , which contains the permissions , e . g . < code > android . Manifest . permission . CALL _ PHONE < / code > ,
* which should be checked , as a { @ link String } array . The array may not be null
* @ return True , if all given permissions are granted , false otherwise */
public static boolean areAllPermissionsGranted ( @ NonNull final Context context , @ NonNull final String ... permissions ) { } } | Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; Condition . INSTANCE . ensureNotNull ( permissions , "The array may not be null" ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { for ( String permission : permissions ) { if ( ! isPermissionGranted ( context , permission ) ) { return false ; } } } return true ; |
public class DefaultsUpdater { /** * Add the requested post parameters to the Request .
* @ param request Request to add post params to */
private void addPostParams ( final Request request ) { } } | if ( defaults != null ) { request . addPostParam ( "Defaults" , Converter . mapToJson ( defaults ) ) ; } |
public class JBBPUtils { /** * Convert double value into string representation with defined radix
* base .
* @ param doubleValue value to be converted in string
* @ param radix radix base to be used for conversion , must be 10 or 16
* @ return converted value as upper case string
* @ throws IllegalArgumentException for wrong radix base
* @ since 1.4.0 */
public static String double2str ( final double doubleValue , final int radix ) { } } | if ( radix != 10 && radix != 16 ) { throw new IllegalArgumentException ( "Illegal radix [" + radix + ']' ) ; } final String result ; if ( radix == 16 ) { String converted = Double . toHexString ( doubleValue ) ; boolean minus = converted . startsWith ( "-" ) ; if ( minus ) { converted = converted . substring ( 1 ) ; } if ( converted . startsWith ( "0x" ) ) { converted = converted . substring ( 2 ) ; } result = ( minus ? '-' + converted : converted ) . toUpperCase ( Locale . ENGLISH ) ; } else { result = Double . toString ( doubleValue ) ; } return result ; |
public class DateUtil { /** * 计算arg0 - arg1的时间差
* @ param arg0 arg0
* @ param arg1 arg1
* @ param dateUnit 返回结果的单位
* @ return arg0 - arg1的时间差 , 精确到指定的单位 ( field ) , 出错时返回 - 1 */
private static long calc ( Temporal arg0 , Temporal arg1 , DateUnit dateUnit ) { } } | return create ( dateUnit ) . between ( arg1 , arg0 ) ; |
public class ComponentScopeShadow { /** * public Object get ( PageContext pc , String key ) throws PageException { return get ( key ) ; } */
@ Override public Object get ( PageContext pc , Collection . Key key ) throws PageException { } } | return get ( key ) ; |
public class Currency { /** * Returns the ISO 4217 numeric code for this currency object .
* < p > Note : If the ISO 4217 numeric code is not assigned for the currency or
* the currency is unknown , this method returns 0 . < / p >
* @ return The ISO 4217 numeric code of this currency . */
public int getNumericCode ( ) { } } | int result = 0 ; try { UResourceBundle bundle = UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , "currencyNumericCodes" , ICUResourceBundle . ICU_DATA_CLASS_LOADER ) ; UResourceBundle codeMap = bundle . get ( "codeMap" ) ; UResourceBundle numCode = codeMap . get ( subType ) ; result = numCode . getInt ( ) ; } catch ( MissingResourceException e ) { // fall through
} return result ; |
public class ThreadContextManager { /** * Save off the context data for the current thread */
public HashMap < String , Object > saveContextData ( ) { } } | HashMap < String , Object > contextData = new HashMap < String , Object > ( ) ; // Save off the data from the other components we have hooks into
ComponentMetaDataAccessorImpl cmdai = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) ; ComponentMetaData cmd = cmdai . getComponentMetaData ( ) ; if ( cmd != null ) { contextData . put ( ComponentMetaData , cmd ) ; } // Each producer service of the Transfer service is accessed in order to get the thread context data
// The context data is then stored off
Iterator < ITransferContextService > TransferIterator = com . ibm . ws . webcontainer . osgi . WebContainer . getITransferContextServices ( ) ; if ( TransferIterator != null ) { while ( TransferIterator . hasNext ( ) ) { ITransferContextService tcs = TransferIterator . next ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling storeState on: " + tcs ) ; } tcs . storeState ( contextData ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No implmenting services found" ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Saving the context data : " + contextData ) ; } return contextData ; |
public class JCudaDriver { /** * If the given result is different to CUresult . CUDA _ SUCCESS and
* exceptions have been enabled , this method will throw a
* CudaException with an error message that corresponds to the
* given result code . Otherwise , the given result is simply
* returned .
* @ param result The result to check
* @ return The result that was given as the parameter
* @ throws CudaException If exceptions have been enabled and
* the given result code is not CUresult . CUDA _ SUCCESS */
private static int checkResult ( int result ) { } } | if ( exceptionsEnabled && result != CUresult . CUDA_SUCCESS ) { throw new CudaException ( CUresult . stringFor ( result ) ) ; } return result ; |
public class GpxParserTrk { /** * Fires whenever an XML end markup is encountered . It catches attributes of
* trackPoints , trackSegments or routes and saves them in corresponding
* values [ ] .
* @ param uri URI of the local element
* @ param localName Name of the local element ( without prefix )
* @ param qName qName of the local element ( with prefix )
* @ throws SAXException Any SAX exception , possibly wrapping another
* exception */
@ Override public void endElement ( String uri , String localName , String qName ) throws SAXException { } } | super . endElement ( uri , localName , qName ) ; if ( ( getCurrentElement ( ) . equalsIgnoreCase ( GPXTags . TEXT ) ) && ( isPoint ( ) ) ) { getCurrentPoint ( ) . setLinkText ( getContentBuffer ( ) ) ; } else if ( getCurrentElement ( ) . equalsIgnoreCase ( GPXTags . TEXT ) ) { getCurrentLine ( ) . setLinkText ( getContentBuffer ( ) ) ; } |
public class AbstractStrategy { /** * { @ inheritDoc } */
@ Override public void printRanking ( final Long user , final List < Pair < Long , Double > > scoredItems , final PrintStream out , final OUTPUT_FORMAT format ) { } } | final Map < Long , Double > scores = new HashMap < Long , Double > ( ) ; for ( Pair < Long , Double > p : scoredItems ) { scores . put ( p . getFirst ( ) , p . getSecond ( ) ) ; } printRanking ( "" + user , scores , out , format ) ; |
public class KeyVisualization { /** * Compute the size of the clustering .
* @ param c Clustering
* @ return Array storing the depth and the number of leaf nodes . */
protected static < M extends Model > int [ ] findDepth ( Clustering < M > c ) { } } | final Hierarchy < Cluster < M > > hier = c . getClusterHierarchy ( ) ; int [ ] size = { 0 , 0 } ; for ( It < Cluster < M > > iter = c . iterToplevelClusters ( ) ; iter . valid ( ) ; iter . advance ( ) ) { findDepth ( hier , iter . get ( ) , size ) ; } return size ; |
public class ChromosomeMappingTools { /** * Extracts the DNA sequence transcribed from the input genetic coordinates .
* @ param twoBitFacade the facade that provide an access to a 2bit file
* @ param gcp The container with chromosomal positions
* @ return the DNA sequence transcribed from the input genetic coordinates */
public static DNASequence getTranscriptDNASequence ( TwoBitFacade twoBitFacade , GeneChromosomePosition gcp ) throws Exception { } } | return getTranscriptDNASequence ( twoBitFacade , gcp . getChromosome ( ) , gcp . getExonStarts ( ) , gcp . getExonEnds ( ) , gcp . getCdsStart ( ) , gcp . getCdsEnd ( ) , gcp . getOrientation ( ) ) ; |
public class BaseAsyncInterceptor { /** * Invoke the next interceptor , possibly with a new command , and execute an { @ link InvocationCallback }
* after all the interceptors have finished , with or without an exception .
* < p > You need to wrap the result with { @ link # makeStage ( Object ) } if you need to add another handler . < / p > */
public final Object invokeNextAndHandle ( InvocationContext ctx , VisitableCommand command , InvocationFinallyFunction function ) { } } | try { Object rv ; Throwable throwable ; try { if ( nextDDInterceptor != null ) { rv = command . acceptVisitor ( ctx , nextDDInterceptor ) ; } else { rv = nextInterceptor . visitCommand ( ctx , command ) ; } throwable = null ; if ( rv instanceof InvocationStage ) { return ( ( InvocationStage ) rv ) . andHandle ( ctx , command , function ) ; } } catch ( Throwable t ) { rv = null ; throwable = t ; } return function . apply ( ctx , command , rv , throwable ) ; } catch ( Throwable throwable ) { return new SimpleAsyncInvocationStage ( throwable ) ; } |
public class HtmlTool { /** * Wraps elements in HTML with the given HTML .
* @ param content
* HTML content to modify
* @ param selector
* CSS selector for elements to wrap
* @ param wrapHtml
* HTML to use for wrapping the selected elements
* @ param amount
* Maximum number of elements to modify
* @ return HTML content with modified elements . If no elements are found , the original content
* is returned .
* @ since 1.0 */
public String wrap ( String content , String selector , String wrapHtml , int amount ) { } } | Element body = parseContent ( content ) ; List < Element > elements = body . select ( selector ) ; if ( amount >= 0 ) { // limit to the indicated amount
elements = elements . subList ( 0 , Math . min ( amount , elements . size ( ) ) ) ; } if ( elements . size ( ) > 0 ) { for ( Element element : elements ) { element . wrap ( wrapHtml ) ; } return body . html ( ) ; } else { // nothing to update
return content ; } |
public class ESTemplate { /** * 获取es mapping中的属性类型
* @ param mapping mapping配置
* @ param fieldName 属性名
* @ return 类型 */
@ SuppressWarnings ( "unchecked" ) private String getEsType ( ESMapping mapping , String fieldName ) { } } | String key = mapping . get_index ( ) + "-" + mapping . get_type ( ) ; Map < String , String > fieldType = esFieldTypes . get ( key ) ; if ( fieldType == null ) { ImmutableOpenMap < String , MappingMetaData > mappings ; try { mappings = transportClient . admin ( ) . cluster ( ) . prepareState ( ) . execute ( ) . actionGet ( ) . getState ( ) . getMetaData ( ) . getIndices ( ) . get ( mapping . get_index ( ) ) . getMappings ( ) ; } catch ( NullPointerException e ) { throw new IllegalArgumentException ( "Not found the mapping info of index: " + mapping . get_index ( ) ) ; } MappingMetaData mappingMetaData = mappings . get ( mapping . get_type ( ) ) ; if ( mappingMetaData == null ) { throw new IllegalArgumentException ( "Not found the mapping info of index: " + mapping . get_index ( ) ) ; } fieldType = new LinkedHashMap < > ( ) ; Map < String , Object > sourceMap = mappingMetaData . getSourceAsMap ( ) ; Map < String , Object > esMapping = ( Map < String , Object > ) sourceMap . get ( "properties" ) ; for ( Map . Entry < String , Object > entry : esMapping . entrySet ( ) ) { Map < String , Object > value = ( Map < String , Object > ) entry . getValue ( ) ; if ( value . containsKey ( "properties" ) ) { fieldType . put ( entry . getKey ( ) , "object" ) ; } else { fieldType . put ( entry . getKey ( ) , ( String ) value . get ( "type" ) ) ; } } esFieldTypes . put ( key , fieldType ) ; } return fieldType . get ( fieldName ) ; |
public class TaskLog { /** * Wrap a command in a shell to capture debug script ' s
* stdout and stderr to debugout .
* @ param cmd The command and the arguments that should be run
* @ param debugoutFilename The filename that stdout and stderr
* should be saved to .
* @ return the modified command that should be run
* @ throws IOException */
public static List < String > captureDebugOut ( List < String > cmd , File debugoutFilename ) throws IOException { } } | String debugout = FileUtil . makeShellPath ( debugoutFilename ) ; List < String > result = new ArrayList < String > ( 3 ) ; result . add ( bashCommand ) ; result . add ( "-c" ) ; StringBuffer mergedCmd = new StringBuffer ( ) ; mergedCmd . append ( "exec " ) ; boolean isExecutable = true ; for ( String s : cmd ) { if ( isExecutable ) { // the executable name needs to be expressed as a shell path for the
// shell to find it .
mergedCmd . append ( FileUtil . makeShellPath ( new File ( s ) ) ) ; isExecutable = false ; } else { mergedCmd . append ( s ) ; } mergedCmd . append ( " " ) ; } mergedCmd . append ( " < /dev/null " ) ; mergedCmd . append ( " >" ) ; mergedCmd . append ( debugout ) ; mergedCmd . append ( " 2>&1 " ) ; result . add ( mergedCmd . toString ( ) ) ; return result ; |
public class CmsLoginHelper { /** * Returns the locale for the given request . < p >
* @ param req the request
* @ return the locale */
private static Locale getLocaleForRequest ( HttpServletRequest req ) { } } | CmsAcceptLanguageHeaderParser parser = new CmsAcceptLanguageHeaderParser ( req , OpenCms . getWorkplaceManager ( ) . getDefaultLocale ( ) ) ; List < Locale > acceptedLocales = parser . getAcceptedLocales ( ) ; List < Locale > workplaceLocales = OpenCms . getWorkplaceManager ( ) . getLocales ( ) ; Locale locale = OpenCms . getLocaleManager ( ) . getFirstMatchingLocale ( acceptedLocales , workplaceLocales ) ; if ( locale == null ) { // no match found - use OpenCms default locale
locale = OpenCms . getWorkplaceManager ( ) . getDefaultLocale ( ) ; } return locale ; |
public class FlowLogicCondition { /** * - - - - - protected methods - - - - - */
protected static boolean getBoolean ( final Context context , final DataSource source ) throws FlowException { } } | if ( source != null ) { final Object value = source . get ( context ) ; if ( value instanceof Boolean ) { return ( Boolean ) value ; } if ( value instanceof String ) { return Boolean . valueOf ( ( String ) value ) ; } } return false ; |
public class PackageManagerUtils { /** * Checks if the device has a touch screen .
* @ param context the context .
* @ return { @ code true } if the device has a touch screen . */
@ TargetApi ( Build . VERSION_CODES . FROYO ) public static boolean hasTouchScreenFeature ( Context context ) { } } | return hasTouchScreenFeature ( context . getPackageManager ( ) ) ; |
public class EsMarshalling { /** * Unmarshals the given map source into a bean .
* @ param source the source
* @ return the plan version */
public static PlanVersionBean unmarshallPlanVersion ( Map < String , Object > source ) { } } | if ( source == null ) { return null ; } PlanVersionBean bean = new PlanVersionBean ( ) ; bean . setVersion ( asString ( source . get ( "version" ) ) ) ; bean . setStatus ( asEnum ( source . get ( "status" ) , PlanStatus . class ) ) ; bean . setCreatedBy ( asString ( source . get ( "createdBy" ) ) ) ; bean . setCreatedOn ( asDate ( source . get ( "createdOn" ) ) ) ; bean . setModifiedBy ( asString ( source . get ( "modifiedBy" ) ) ) ; bean . setModifiedOn ( asDate ( source . get ( "modifiedOn" ) ) ) ; bean . setLockedOn ( asDate ( source . get ( "lockedOn" ) ) ) ; postMarshall ( bean ) ; return bean ; |
public class ContainerDefinition { /** * The command that is passed to the container . This parameter maps to < code > Cmd < / code > in the < a
* href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section of the
* < a href = " https : / / docs . docker . com / engine / api / v1.35 / " > Docker Remote API < / a > and the < code > COMMAND < / code > parameter
* to < a href = " https : / / docs . docker . com / engine / reference / run / " > docker run < / a > . For more information , see < a
* href = " https : / / docs . docker . com / engine / reference / builder / # cmd "
* > https : / / docs . docker . com / engine / reference / builder / # cmd < / a > . If there are multiple arguments , each argument should
* be a separated string in the array .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCommand ( java . util . Collection ) } or { @ link # withCommand ( java . util . Collection ) } if you want to override
* the existing values .
* @ param command
* The command that is passed to the container . This parameter maps to < code > Cmd < / code > in the < a
* href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section
* of the < a href = " https : / / docs . docker . com / engine / api / v1.35 / " > Docker Remote API < / a > and the
* < code > COMMAND < / code > parameter to < a href = " https : / / docs . docker . com / engine / reference / run / " > docker run < / a > .
* For more information , see < a
* href = " https : / / docs . docker . com / engine / reference / builder / # cmd " > https : / / docs . docker
* . com / engine / reference / builder / # cmd < / a > . If there are multiple arguments , each argument should be a
* separated string in the array .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ContainerDefinition withCommand ( String ... command ) { } } | if ( this . command == null ) { setCommand ( new com . amazonaws . internal . SdkInternalList < String > ( command . length ) ) ; } for ( String ele : command ) { this . command . add ( ele ) ; } return this ; |
public class DescribeReservedCacheNodesResult { /** * A list of reserved cache nodes . Each element in the list contains detailed information about one node .
* @ return A list of reserved cache nodes . Each element in the list contains detailed information about one node . */
public java . util . List < ReservedCacheNode > getReservedCacheNodes ( ) { } } | if ( reservedCacheNodes == null ) { reservedCacheNodes = new com . amazonaws . internal . SdkInternalList < ReservedCacheNode > ( ) ; } return reservedCacheNodes ; |
public class Consumers { /** * Yields all elements of the iterator ( in a map created by the supplier ) .
* @ param < M > the returned map type
* @ param < K > the map key type
* @ param < V > the map value type
* @ param iterator the iterator that will be consumed
* @ param supplier the factory used to get the returned map
* @ return a map filled with iterator values */
public static < M extends Map < K , V > , K , V > M dict ( Iterator < Pair < K , V > > iterator , Supplier < M > supplier ) { } } | final Function < Iterator < Pair < K , V > > , M > consumer = new ConsumeIntoMap < > ( supplier ) ; return consumer . apply ( iterator ) ; |
public class VoldemortBuildAndPushJob { /** * For each node , checks if the store exists and then verifies that the remote schema
* matches the new one . If the remote store doesn ' t exist , it creates it . */
private void verifyOrAddStore ( String clusterURL , String keySchema , String valueSchema ) { } } | String newStoreDefXml = VoldemortUtils . getStoreDefXml ( storeName , props . getInt ( BUILD_REPLICATION_FACTOR , 2 ) , props . getInt ( BUILD_REQUIRED_READS , 1 ) , props . getInt ( BUILD_REQUIRED_WRITES , 1 ) , props . getNullableInt ( BUILD_PREFERRED_READS ) , props . getNullableInt ( BUILD_PREFERRED_WRITES ) , props . getString ( PUSH_FORCE_SCHEMA_KEY , keySchema ) , props . getString ( PUSH_FORCE_SCHEMA_VALUE , valueSchema ) , description , owners ) ; log . info ( "Verifying store against cluster URL: " + clusterURL + "\n" + newStoreDefXml . toString ( ) ) ; StoreDefinition newStoreDef = VoldemortUtils . getStoreDef ( newStoreDefXml ) ; try { adminClientPerCluster . get ( clusterURL ) . storeMgmtOps . verifyOrAddStore ( newStoreDef , "BnP config/data" , enableStoreCreation , this . storeVerificationExecutorService ) ; } catch ( UnreachableStoreException e ) { log . info ( "verifyOrAddStore() failed on some nodes for clusterURL: " + clusterURL + " (this is harmless)." , e ) ; // When we can ' t reach some node , we just skip it and won ' t create the store on it .
// Next time BnP is run while the node is up , it will get the store created .
} // Other exceptions need to bubble up !
storeDef = newStoreDef ; |
public class ImageAnchorCell { /** * Sets the the horizontal spacing attribute for the HTML image tag .
* @ param hspace the horizontal spacing .
* @ jsptagref . attributedescription The horizontal spacing for the HTML image tag .
* @ jsptagref . attributesyntaxvalue < i > integer _ hspace < / i >
* @ netui : attribute required = " false " rtexprvalue = " true "
* description = " The horizontal spacing for the HTML image tag . " */
public void setHspace ( String hspace ) { } } | _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . HSPACE , hspace ) ; |
public class WktService { /** * Parses a given WKT ( or EWKT ) string into a geometry object .
* @ param wkt
* The Well Known Text to parse .
* @ return Returns The resulting geometry from parsing the WKT .
* @ throws WktException
* In case something went wrong while parsing . The WKT format must be respected . */
public static Geometry toGeometry ( String wkt ) throws WktException { } } | if ( wkt != null ) { // First we detect if the string is WKT or EWKT :
String [ ] parts = wkt . split ( ";" ) ; if ( parts . length == 2 ) { // We assume it is EWKT :
Geometry geometry = parseWkt ( parts [ 1 ] ) ; recursiveSetSrid ( geometry , parseSrid ( parts [ 0 ] ) ) ; return geometry ; } return parseWkt ( wkt ) ; } throw new WktException ( ERR_MSG + "illegal argument; no WKT" ) ; |
public class DateUtils { /** * < p > Parses a string representing a date by trying a variety of different parsers . < / p >
* < p > The parse will try each parse pattern in turn .
* A parse is only deemed successful if it parses the whole of the input string .
* If no parse patterns match , a ParseException is thrown . < / p >
* The parser parses strictly - it does not allow for dates such as " February 942 , 1996 " .
* @ param str the date to parse , not null
* @ param parsePatterns the date format patterns to use , see SimpleDateFormat , not null
* @ return the parsed date
* @ throws IllegalArgumentException if the date string or pattern array is null
* @ throws ParseException if none of the date patterns were suitable
* @ since 2.5 */
@ GwtIncompatible ( "incompatible method" ) public static Date parseDateStrictly ( final String str , final String ... parsePatterns ) throws ParseException { } } | return parseDateStrictly ( str , null , parsePatterns ) ; |
public class ModelClassGeneratorTasks { /** * For API Gateway request classes we override the sdkRequestConfig fluent setter to return the correct concrete request type
* for better method chaining .
* @ return True if sdkRequestConfig should be overriden by template . False if not . */
private boolean shouldGenerateSdkRequestConfigSetter ( ShapeModel shape ) { } } | return model . getMetadata ( ) . getProtocol ( ) == Protocol . API_GATEWAY && shape . getShapeType ( ) == ShapeType . Request ; |
public class CircuitBreakerExports { /** * Creates a new instance of { @ link CircuitBreakerExports } with specified metrics names prefix and
* { @ link CircuitBreakerRegistry } as a source of circuit breakers .
* @ param prefix the prefix of metrics names
* @ param circuitBreakerRegistry the registry of circuit breakers */
public static CircuitBreakerExports ofCircuitBreakerRegistry ( String prefix , CircuitBreakerRegistry circuitBreakerRegistry ) { } } | requireNonNull ( prefix ) ; requireNonNull ( circuitBreakerRegistry ) ; return new CircuitBreakerExports ( prefix , circuitBreakerRegistry ) ; |
public class AbstractDom4jExporter { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . io . xml . IDataExporter # exportData ( java . lang . String ) */
@ Override public Tuple < String , Element > exportData ( String id ) { } } | final Element node = this . exportDataElement ( id ) ; if ( node == null ) { return null ; } return new Tuple < String , Element > ( id , node ) ; |
public class LoggerOddities { /** * looks to see if this field is a logger , and declared non privately
* @ param fieldClsName
* the owning class type of the field
* @ param fieldName
* the name of the field
* @ param fieldSig
* the signature of the field
* @ return if the field is a logger and not private */
private boolean isNonPrivateLogField ( @ SlashedClassName String fieldClsName , String fieldName , String fieldSig ) { } } | String fieldType = SignatureUtils . trimSignature ( fieldSig ) ; if ( ! SLF4J_LOGGER . equals ( fieldType ) && ! COMMONS_LOGGER . equals ( fieldType ) && ! LOG4J_LOGGER . equals ( fieldType ) && ! LOG4J2_LOGGER . equals ( fieldType ) ) { return false ; } JavaClass cls = getClassContext ( ) . getJavaClass ( ) ; if ( ! cls . getClassName ( ) . equals ( fieldClsName . replace ( '/' , '.' ) ) ) { return false ; } for ( Field f : getClassContext ( ) . getJavaClass ( ) . getFields ( ) ) { if ( f . getName ( ) . equals ( fieldName ) ) { return ! f . isPrivate ( ) ; } } return true ; |
public class SagaKeyReaderExtractor { /** * { @ inheritDoc } */
@ Override public Object findSagaInstanceKey ( final Class < ? extends Saga > sagaClazz , final LookupContext context ) { } } | Object keyValue = null ; KeyReader reader = tryGetKeyReader ( sagaClazz , context . message ( ) ) ; if ( reader != null ) { keyValue = reader . readKey ( context . message ( ) , context ) ; } return keyValue ; |
public class ExcelUtil { /** * Sax方式读取Excel03
* @ param in 输入流
* @ param sheetIndex Sheet索引 , - 1表示全部Sheet , 0表示第一个Sheet
* @ param rowHandler 行处理器
* @ return { @ link Excel07SaxReader }
* @ since 3.2.0 */
public static Excel03SaxReader read03BySax ( InputStream in , int sheetIndex , RowHandler rowHandler ) { } } | try { return new Excel03SaxReader ( rowHandler ) . read ( in , sheetIndex ) ; } catch ( NoClassDefFoundError e ) { throw new DependencyException ( ObjectUtil . defaultIfNull ( e . getCause ( ) , e ) , PoiChecker . NO_POI_ERROR_MSG ) ; } |
public class BuildInfo { /** * Creates an instance using properties from the given stream ( which must be in property file
* format ) .
* < p > See { @ link # create ( Properties ) } for a list of required properties .
* < p > For convenience , this method throws a runtime exception if an IOException occurs . If you
* plan to do anything other than crash in the event of an error , you should use
* { @ link # create ( Properties ) } instead . */
public static BuildInfo load ( InputStream propertiesStream ) { } } | Properties properties = new Properties ( ) ; try { properties . load ( propertiesStream ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Unable to load build info properties" , e ) ; } finally { try { propertiesStream . close ( ) ; } catch ( IOException e ) { LOGGER . warn ( "Unable to close properties stream" , e ) ; } } return create ( properties ) ; |
public class FrameManager { /** * Asks about leaving the application
* @ param navigationFrameView used as parent of question dialog
* @ return true if user wants to leave */
private boolean askBeforeExit ( SwingFrame navigationFrameView ) { } } | if ( Configuration . isDevModeActive ( ) ) { return true ; } else { int answer = JOptionPane . showConfirmDialog ( navigationFrameView , Resources . getString ( "Exit.confirm" ) , Resources . getString ( "Exit.confirm.title" ) , JOptionPane . YES_NO_OPTION ) ; return answer == JOptionPane . YES_OPTION ; } |
public class JQLBuilder { /** * Define WHERE statement .
* @ param < L >
* the generic type
* @ param method
* the method
* @ param result
* the result
* @ param annotation
* the annotation
* @ param dynamicReplace
* the dynamic replace
* @ return the string */
private static < L extends Annotation > String defineLimitStatement ( final SQLiteModelMethod method , final JQL result , Class < L > annotation , Map < JQLDynamicStatementType , String > dynamicReplace ) { } } | StringBuilder builder = new StringBuilder ( ) ; int pageSize = AnnotationUtility . extractAsInt ( method . getElement ( ) , annotation , AnnotationAttributeType . PAGE_SIZE ) ; if ( pageSize > 0 ) { result . annotatedPageSize = true ; } final One < String > pageDynamicName = new One < String > ( null ) ; forEachParameter ( method , new OnMethodParameterListener ( ) { @ Override public void onMethodParameter ( VariableElement methodParam ) { if ( methodParam . getAnnotation ( BindSqlPageSize . class ) != null ) { pageDynamicName . value0 = methodParam . getSimpleName ( ) . toString ( ) ; result . paramPageSize = pageDynamicName . value0 ; // CONSTRAINT : @ BindSqlWhereArgs can be used only on
// String [ ] parameter type
AssertKripton . assertTrueOrInvalidTypeForAnnotationMethodParameterException ( TypeUtility . isEquals ( TypeName . INT , TypeUtility . typeName ( methodParam ) ) , method . getParent ( ) . getElement ( ) , method . getElement ( ) , methodParam , BindSqlPageSize . class ) ; } } } ) ; if ( pageSize > 0 || StringUtils . hasText ( pageDynamicName . value0 ) || method . isPagedLiveData ( ) ) { builder . append ( " " + LIMIT_KEYWORD + " " ) ; if ( pageSize > 0 ) { builder . append ( pageSize ) ; } else { String temp0 = "#{" + JQLDynamicStatementType . DYNAMIC_PAGE_SIZE + "}" ; builder . append ( temp0 ) ; dynamicReplace . put ( JQLDynamicStatementType . DYNAMIC_PAGE_SIZE , temp0 ) ; } // define replacement string for PAGE _ SIZE
String temp1 = " " + OFFSET_KEYWORD + " #{" + JQLDynamicStatementType . DYNAMIC_PAGE_OFFSET + "}" ; builder . append ( temp1 ) ; dynamicReplace . put ( JQLDynamicStatementType . DYNAMIC_PAGE_OFFSET , temp1 ) ; } return builder . toString ( ) ; |
public class JobDefinitionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( JobDefinition jobDefinition , ProtocolMarshaller protocolMarshaller ) { } } | if ( jobDefinition == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( jobDefinition . getJobDefinitionName ( ) , JOBDEFINITIONNAME_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getJobDefinitionArn ( ) , JOBDEFINITIONARN_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getRevision ( ) , REVISION_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getParameters ( ) , PARAMETERS_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getRetryStrategy ( ) , RETRYSTRATEGY_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getContainerProperties ( ) , CONTAINERPROPERTIES_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getTimeout ( ) , TIMEOUT_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getNodeProperties ( ) , NODEPROPERTIES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Configuration { /** * Back this < code > Configuration < / code > by the given properties from ConfigurationAdmin .
* @ param properties the properties from ConfigurationAdmin , may be < code > null < / code > .
* @ throws ConfigurationException thrown if the property values are not of type String */
public void setProperties ( Dictionary < ? , ? > properties ) throws ConfigurationException { } } | List < String > newArgumentList = new ArrayList < String > ( ) ; if ( properties != null ) { for ( Enumeration < ? > keysEnum = properties . keys ( ) ; keysEnum . hasMoreElements ( ) ; ) { String key = ( String ) keysEnum . nextElement ( ) ; Object val = properties . get ( key ) ; if ( val instanceof String ) { String value = ( String ) val ; if ( PropertyValueEncryptionUtils . isEncryptedValue ( value ) ) { StandardPBEStringEncryptor enc = new StandardPBEStringEncryptor ( ) ; EnvironmentStringPBEConfig env = new EnvironmentStringPBEConfig ( ) ; env . setProvider ( new BouncyCastleProvider ( ) ) ; env . setProviderName ( PROVIDER_NAME ) ; env . setAlgorithm ( ALGORITHM ) ; env . setPasswordEnvName ( PASSWORD_ENV_NAME ) ; enc . setConfig ( env ) ; val = PropertyValueEncryptionUtils . decrypt ( value , enc ) ; } String strval = convertArgument ( key , ( String ) val ) ; if ( strval != null ) { newArgumentList . add ( strval ) ; } } else { throw new ConfigurationException ( key , "Value is not of type String." ) ; } } } argumentList = newArgumentList ; configAvailable . countDown ( ) ; |
public class ReferenceStreamLink { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . msgstore . cache . links . LinkOwner # eventWatermarkBreached ( ) */
public final void eventWatermarkBreached ( ) throws SevereMessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "eventWatermarkBreached" ) ; ReferenceStream referenceStream = ( ReferenceStream ) getItem ( ) ; if ( null != referenceStream ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "notifying eventWatermarkBreached: " + referenceStream ) ; referenceStream . eventWatermarkBreached ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "notified eventWatermarkBreached: " + referenceStream ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "no referenceStream to notify" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "eventWatermarkBreached" ) ; |
public class ReportResourcesImpl { /** * Get a report .
* It mirrors to the following Smartsheet REST API method : GET / reports / { id }
* Exceptions :
* InvalidRequestException : if there is any problem with the REST API request
* AuthorizationException : if there is any problem with the REST API authorization ( access token )
* ResourceNotFoundException : if the resource can not be found
* ServiceUnavailableException : if the REST API service is not available ( possibly due to rate limiting )
* SmartsheetRestException : if there is any other REST API related error occurred during the operation
* SmartsheetException : if there is any other error occurred during the operation
* @ param reportId the folder id
* @ param includes the optional objects to include in response
* @ param pageSize Number of rows per page
* @ param page page number to return
* @ param level compatibility level
* @ return the report ( note that if there is no such resource , this method will throw ResourceNotFoundException
* rather than returning null )
* @ throws SmartsheetException the smartsheet exception */
public Report getReport ( long reportId , EnumSet < ReportInclusion > includes , Integer pageSize , Integer page , Integer level ) throws SmartsheetException { } } | String path = "reports/" + reportId ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "include" , QueryUtil . generateCommaSeparatedList ( includes ) ) ; if ( pageSize != null ) { parameters . put ( "pageSize" , pageSize . toString ( ) ) ; } if ( page != null ) { parameters . put ( "page" , page . toString ( ) ) ; } if ( level != null ) { parameters . put ( "level" , level ) ; } path += QueryUtil . generateUrl ( null , parameters ) ; return this . getResource ( path , Report . class ) ; |
public class RtfCodePage { /** * Writes the selected codepage */
public void writeDefinition ( final OutputStream result ) throws IOException { } } | result . write ( ANSI ) ; result . write ( ANSI_CODEPAGE ) ; result . write ( intToByteArray ( 1252 ) ) ; this . document . outputDebugLinebreak ( result ) ; |
public class NodeListener { /** * Inform listeners that node is being updated .
* @ param oldOne Old configuration .
* @ param newOne New Configuration . */
public static void fireOnUpdated ( @ Nonnull Node oldOne , @ Nonnull Node newOne ) { } } | for ( NodeListener nl : all ( ) ) { try { nl . onUpdated ( oldOne , newOne ) ; } catch ( Throwable ex ) { LOGGER . log ( Level . WARNING , "Listener invocation failed" , ex ) ; } } |
public class FaceletViewDeclarationLanguage { /** * Creates the Facelet page compiler .
* @ param context
* the current FacesContext
* @ return the application ' s Facelet page compiler */
protected Compiler createCompiler ( FacesContext context ) { } } | Compiler compiler = new SAXCompiler ( ) ; compiler . setDevelopmentProjectStage ( context . isProjectStage ( ProjectStage . Development ) ) ; loadLibraries ( context , compiler ) ; loadDecorators ( context , compiler ) ; loadOptions ( context , compiler ) ; return compiler ; |
public class Dictionary { /** * Attempts to load a dictionary using the URL to the FSA file and the
* expected metadata extension .
* @ param dictURL The URL pointing to the dictionary file ( < code > * . dict < / code > ) .
* @ return An instantiated dictionary .
* @ throws IOException if an I / O error occurs . */
public static Dictionary read ( URL dictURL ) throws IOException { } } | final URL expectedMetadataURL ; try { String external = dictURL . toExternalForm ( ) ; expectedMetadataURL = new URL ( DictionaryMetadata . getExpectedMetadataFileName ( external ) ) ; } catch ( MalformedURLException e ) { throw new IOException ( "Couldn't construct relative feature map URL for: " + dictURL , e ) ; } try ( InputStream fsaStream = dictURL . openStream ( ) ; InputStream metadataStream = expectedMetadataURL . openStream ( ) ) { return read ( fsaStream , metadataStream ) ; } |
public class ConversationState { /** * removeObject - remove an object from the object store .
* @ param objectIndex An integer value that identifies the location of the object in
* the object store .
* @ return Returns the object that was in that position
* @ throws IndexOutOfBoundsException
* @ throws NoSuchElementException */
public synchronized Object removeObject ( int objectIndex ) throws IndexOutOfBoundsException , NoSuchElementException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeObject" , Integer . valueOf ( objectIndex ) ) ; if ( ( objectIndex < OBJECT_TABLE_ORIGIN ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Invalid object index" ) ; throw new IndexOutOfBoundsException ( ) ; } else if ( ( objectIndex > maxIndex ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Invalid object index" ) ; return null ; } if ( objectTable [ objectIndex ] == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "No object exists at the entry" ) ; throw new NoSuchElementException ( ) ; } Object returnObject = objectTable [ objectIndex ] ; objectTable [ objectIndex ] = null ; /* * If no free slots , make the slot we just freed the next available free slot */
if ( freeSlot == MINUS_ONE ) { freeSlot = objectIndex ; } /* * If slot we just free is less than next available free slot , set next
* available free slot to this . */
else { freeSlot = Math . min ( freeSlot , objectIndex ) ; } /* * If the high water mark is equal to the index of the slot that we just
* freed , decrement the high water mark by one until we reach the next slot
* in use . */
if ( highWatermark == objectIndex ) { while ( objectTable [ highWatermark ] == null ) { if ( highWatermark == OBJECT_TABLE_ORIGIN ) { break ; } highWatermark = ( highWatermark - 1 ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeObject" , returnObject ) ; return returnObject ; |
public class ClientConversationState { /** * Sets the Connection ID referring to the SIMPConnection Object on the server .
* @ param i */
public void setConnectionObjectID ( int i ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setConnectionObjectID" , "" + i ) ; connectionObjectID = i ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setConnectionObjectID" ) ; |
public class JsonPController { /** * tag : : json [ ] */
@ Route ( method = HttpMethod . GET , uri = "/json" ) public Result usingJsonService ( @ Parameter ( "callback" ) String callback ) { } } | return ok ( json . toJsonP ( callback , json . newObject ( ) . put ( "foo" , "bar" ) ) ) . as ( MimeTypes . JAVASCRIPT ) ; |
public class IfBlock { /** * / * - - - - - [ FinishAll ] - - - - - */
public boolean usesFinishAll ( ) { } } | return parent == null && state . ifBlocks . get ( 0 ) == this && path != null && path . size ( ) > 1 && edgeWithRule ( ) == null && path . get ( 0 ) == path . get ( path . size ( ) - 1 ) ; |
public class AbstractCommandLineRunner { /** * Outputs the source map found in the compiler to the proper path if one exists .
* @ param options The options to the Compiler . */
@ GwtIncompatible ( "Unnecessary" ) private void outputSourceMap ( B options , String associatedName ) throws IOException { } } | if ( Strings . isNullOrEmpty ( options . sourceMapOutputPath ) || options . sourceMapOutputPath . equals ( "/dev/null" ) ) { return ; } String outName = expandSourceMapPath ( options , null ) ; maybeCreateDirsForPath ( outName ) ; try ( Writer out = fileNameToOutputWriter2 ( outName ) ) { compiler . getSourceMap ( ) . appendTo ( out , associatedName ) ; } |
public class BaseScreen { /** * Does the current user have permission to access this screen .
* @ return NORMAL _ RETURN if access is allowed , ACCESS _ DENIED or LOGIN _ REQUIRED otherwise . */
public int checkSecurity ( ) { } } | if ( ( this . getClass ( ) . getName ( ) . startsWith ( BASE_CLASS ) ) && ( this . getMainRecord ( ) != null ) ) { App application = null ; if ( this . getTask ( ) != null ) application = this . getTask ( ) . getApplication ( ) ; int iErrorCode = DBConstants . NORMAL_RETURN ; if ( application != null ) iErrorCode = application . checkSecurity ( this . getMainRecord ( ) . getClass ( ) . getName ( ) ) ; // Check access to main record
return iErrorCode ; } else return super . checkSecurity ( ) ; // Custom screen - check security |
public class NioTCPWriteRequestContextImpl { /** * @ see com . ibm . ws . tcpchannel . internal . TCPWriteRequestContextImpl #
* processSyncWriteRequest ( long , int ) */
@ Override public long processSyncWriteRequest ( long numBytes , int timeout ) throws IOException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processSyncRequest(" + numBytes + "," + timeout + ")" ) ; } long numUserBytesWritten = 0 ; // no . of user bytes written
if ( numBytes != 0 ) { if ( this . blockWait == null ) { this . blockWait = new SimpleSync ( ) ; } this . blockingIOError = null ; // before we write , signal that we want to do the write ourselves
// and not the worker threads .
this . blockedThread = true ; VirtualConnection vc = writeInternal ( numBytes , null , false , timeout ) ; while ( vc == null ) { // block until we are told to write
this . blockWait . simpleWait ( ) ; if ( this . blockingIOError == null ) { vc = ( ( NioTCPChannel ) getTCPConnLink ( ) . getTCPChannel ( ) ) . getWorkQueueManager ( ) . processWork ( this , 1 ) ; } else { break ; } } this . blockedThread = false ; if ( this . blockingIOError != null ) { throw this . blockingIOError ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getIOCompleteAmount() -->" + String . valueOf ( getIOCompleteAmount ( ) ) ) ; } numUserBytesWritten = getIOCompleteAmount ( ) ; } else { WsByteBuffer buffers [ ] = getBuffers ( ) ; NioSocketIOChannel channel = ( NioSocketIOChannel ) getTCPConnLink ( ) . getSocketIOChannel ( ) ; if ( buffers . length == 1 ) { numUserBytesWritten = channel . write ( buffers [ 0 ] . getWrappedByteBufferNonSafe ( ) ) ; } else { numUserBytesWritten = channel . write ( getByteBufferArray ( ) ) ; } } // return the number of bytes written
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "processSyncRequest" , Long . valueOf ( numUserBytesWritten ) ) ; } return ( numUserBytesWritten ) ; |
public class HTTPBatchClientConnectionInterceptor { /** * Returns first item from the list
* @ param intuitMessages
* @ return IntuitMessage
* @ throws FMSException */
private IntuitMessage getFirst ( List < IntuitMessage > intuitMessages ) throws FMSException { } } | if ( intuitMessages . isEmpty ( ) ) { throw new FMSException ( "IntuitMessages list is empty. Nothing to upload." ) ; } return intuitMessages . get ( 0 ) ; |
public class PermissionTargetProviderRegistryImpl { /** * Construct a new target provider registry and initialize it with the supplied map of key - >
* provider pairs .
* @ param providers */
public void setProviders ( Map < String , IPermissionTargetProvider > providers ) { } } | this . providers . clear ( ) ; for ( Map . Entry < String , IPermissionTargetProvider > provider : providers . entrySet ( ) ) { this . providers . put ( provider . getKey ( ) , provider . getValue ( ) ) ; } |
public class ESTemplate { /** * The AST node structure is merged with the
* context to produce the final output .
* @ param context Conext with data elements accessed by template
* @ param writer output writer for rendered template
* @ throws ResourceNotFoundException if template not found
* from any available source .
* @ throws ParseErrorException if template cannot be parsed due
* to syntax ( or other ) error .
* @ throws MethodInvocationException When a method on a referenced object in the context could not invoked . */
public void merge ( Context context , Writer writer ) throws ResourceNotFoundException , ParseErrorException , MethodInvocationException { } } | merge ( context , writer , null ) ; |
public class ClusterJoinManager { /** * Invoked from master node while executing a join request to validate it , delegating to
* { @ link com . hazelcast . instance . NodeExtension # validateJoinRequest ( JoinMessage ) } */
private boolean validateJoinRequest ( JoinRequest joinRequest , Address target ) { } } | if ( clusterService . isMaster ( ) ) { try { node . getNodeExtension ( ) . validateJoinRequest ( joinRequest ) ; } catch ( Exception e ) { logger . warning ( e . getMessage ( ) ) ; nodeEngine . getOperationService ( ) . send ( new BeforeJoinCheckFailureOp ( e . getMessage ( ) ) , target ) ; return false ; } } return true ; |
public class MessageInfo { /** * Add this field in the Record ' s field sequence . */
public BaseField setupField ( int iFieldSeq ) { } } | BaseField field = null ; // if ( iFieldSeq = = 0)
// field = new CounterField ( this , ID , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ;
// field . setHidden ( true ) ;
// if ( iFieldSeq = = 1)
// field = new RecordChangedField ( this , LAST _ CHANGED , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ;
// field . setHidden ( true ) ;
// if ( iFieldSeq = = 2)
// field = new BooleanField ( this , DELETED , Constants . DEFAULT _ FIELD _ LENGTH , null , new Boolean ( false ) ) ;
// field . setHidden ( true ) ;
if ( iFieldSeq == 3 ) field = new StringField ( this , DESCRIPTION , 50 , null , null ) ; if ( iFieldSeq == 4 ) field = new StringField ( this , CODE , 30 , null , null ) ; if ( iFieldSeq == 5 ) field = new StringField ( this , MESSAGE_CLASS , 127 , null , null ) ; if ( iFieldSeq == 6 ) field = new PropertiesField ( this , MESSAGE_PROPERTIES , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; if ( iFieldSeq == 7 ) { field = new MessageInfoTypeField ( this , MESSAGE_INFO_TYPE_ID , Constants . DEFAULT_FIELD_LENGTH , null , new Integer ( 1 ) ) ; field . addListener ( new InitOnceFieldHandler ( null ) ) ; } if ( iFieldSeq == 8 ) field = new MessageInfoField ( this , REVERSE_MESSAGE_INFO_ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; if ( iFieldSeq == 9 ) field = new ContactTypeField ( this , CONTACT_TYPE_ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; if ( iFieldSeq == 10 ) field = new RequestTypeField ( this , REQUEST_TYPE_ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; if ( field == null ) field = super . setupField ( iFieldSeq ) ; return field ; |
public class MailUtil { /** * Delivers the supplied mail , with the specified additional headers . */
public static void deliverMail ( String [ ] recipients , String sender , String subject , String body , String [ ] headers , String [ ] values ) throws IOException { } } | if ( recipients == null || recipients . length < 1 ) { throw new IOException ( "Must specify one or more recipients." ) ; } try { MimeMessage message = createEmptyMessage ( ) ; int hcount = ( headers == null ) ? 0 : headers . length ; for ( int ii = 0 ; ii < hcount ; ii ++ ) { message . addHeader ( headers [ ii ] , values [ ii ] ) ; } message . setText ( body ) ; deliverMail ( recipients , sender , subject , message ) ; } catch ( Exception e ) { String errmsg = "Failure sending mail [from=" + sender + ", to=" + StringUtil . toString ( recipients ) + ", subject=" + subject + "]" ; IOException ioe = new IOException ( errmsg ) ; ioe . initCause ( e ) ; throw ioe ; } |
public class FileUtils { /** * Gets the extension of the given file name or < code > " png " < / code > if the file name has no extension .
* @ param fileName The file name .
* @ return The extension of the given file . */
public static String getExtension ( String fileName ) { } } | if ( fileName . contains ( "." ) ) { return fileName . substring ( fileName . lastIndexOf ( "." ) + 1 ) ; } return "png" ; |
public class RestUtils { /** * A generic JSON response handler . Returns a message and response code .
* @ param response the response to write to
* @ param status status code
* @ param message error message */
public static void returnStatusResponse ( HttpServletResponse response , int status , String message ) { } } | if ( response == null ) { return ; } PrintWriter out = null ; try { response . setStatus ( status ) ; response . setContentType ( MediaType . APPLICATION_JSON ) ; out = response . getWriter ( ) ; ParaObjectUtils . getJsonWriter ( ) . writeValue ( out , getStatusResponse ( Response . Status . fromStatusCode ( status ) , message ) . getEntity ( ) ) ; } catch ( Exception ex ) { logger . error ( null , ex ) ; } finally { if ( out != null ) { out . close ( ) ; } } |
public class TArrayTypeEntry { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } } | if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case OBJECT_TYPE_PTR : return isSetObjectTypePtr ( ) ; } throw new IllegalStateException ( ) ; |
public class LineSegmentPath { /** * documentation inherited */
public void paint ( Graphics2D gfx ) { } } | gfx . setColor ( Color . red ) ; Point prev = null ; int size = size ( ) ; for ( int ii = 0 ; ii < size ; ii ++ ) { PathNode n = getNode ( ii ) ; if ( prev != null ) { gfx . drawLine ( prev . x , prev . y , n . loc . x , n . loc . y ) ; } prev = n . loc ; } |
public class AOConnectionPool { /** * Loads a driver at most once . */
private static void loadDriver ( String classname ) throws ClassNotFoundException , InstantiationException , IllegalAccessException { } } | if ( ! driversLoaded . containsKey ( classname ) ) { Object O = Class . forName ( classname ) . newInstance ( ) ; driversLoaded . putIfAbsent ( classname , O ) ; } |
public class RadioGroupBlankValidator { /** * { @ inheritDoc } */
@ Override public boolean isValid ( final T value ) { } } | boolean valid = false ; for ( Radio child : inputWidget . getRadioChildren ( ) ) { valid |= child . getValue ( ) ; } return valid ; |
public class SwimMembershipProtocolConfig { /** * Sets the probe timeout .
* @ param probeTimeout the probe timeout
* @ return the membership protocol configuration */
public SwimMembershipProtocolConfig setProbeTimeout ( Duration probeTimeout ) { } } | checkNotNull ( probeTimeout , "probeTimeout cannot be null" ) ; checkArgument ( ! probeTimeout . isNegative ( ) && ! probeTimeout . isZero ( ) , "probeTimeout must be positive" ) ; this . probeTimeout = probeTimeout ; return this ; |
public class SQLiteConnectionPool { /** * Dumps debugging information about this connection pool .
* @ param printer The printer to receive the dump , not null .
* @ param verbose True to dump more verbose information . */
public void dump ( Printer printer , boolean verbose ) { } } | Printer indentedPrinter = printer ; synchronized ( mLock ) { printer . println ( "Connection pool for " + mConfiguration . path + ":" ) ; printer . println ( " Open: " + mIsOpen ) ; printer . println ( " Max connections: " + mMaxConnectionPoolSize ) ; printer . println ( " Available primary connection:" ) ; if ( mAvailablePrimaryConnection != null ) { mAvailablePrimaryConnection . dump ( indentedPrinter , verbose ) ; } else { indentedPrinter . println ( "<none>" ) ; } printer . println ( " Available non-primary connections:" ) ; if ( ! mAvailableNonPrimaryConnections . isEmpty ( ) ) { final int count = mAvailableNonPrimaryConnections . size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { mAvailableNonPrimaryConnections . get ( i ) . dump ( indentedPrinter , verbose ) ; } } else { indentedPrinter . println ( "<none>" ) ; } printer . println ( " Acquired connections:" ) ; if ( ! mAcquiredConnections . isEmpty ( ) ) { for ( Map . Entry < SQLiteConnection , AcquiredConnectionStatus > entry : mAcquiredConnections . entrySet ( ) ) { final SQLiteConnection connection = entry . getKey ( ) ; connection . dumpUnsafe ( indentedPrinter , verbose ) ; indentedPrinter . println ( " Status: " + entry . getValue ( ) ) ; } } else { indentedPrinter . println ( "<none>" ) ; } printer . println ( " Connection waiters:" ) ; if ( mConnectionWaiterQueue != null ) { int i = 0 ; final long now = SystemClock . uptimeMillis ( ) ; for ( ConnectionWaiter waiter = mConnectionWaiterQueue ; waiter != null ; waiter = waiter . mNext , i ++ ) { indentedPrinter . println ( i + ": waited for " + ( ( now - waiter . mStartTime ) * 0.001f ) + " ms - thread=" + waiter . mThread + ", priority=" + waiter . mPriority + ", sql='" + waiter . mSql + "'" ) ; } } else { indentedPrinter . println ( "<none>" ) ; } } |
public class Legend_ { /** * Normally each legend entry just has one line of text , but it can be made multi - line by adding
* " \ \ n " . This method returns a Map for each single legend entry , which is normally just a Map
* with one single entry .
* @ param series
* @ return */
Map < String , Rectangle2D > getSeriesTextBounds ( S series ) { } } | // FontMetrics fontMetrics = g . getFontMetrics ( getChartPainter ( ) . getstyler ( ) . getLegendFont ( ) ) ;
// float fontDescent = fontMetrics . getDescent ( ) ;
String lines [ ] = series . getName ( ) . split ( "\\n" ) ; Map < String , Rectangle2D > seriesTextBounds = new LinkedHashMap < String , Rectangle2D > ( lines . length ) ; for ( String line : lines ) { TextLayout textLayout = new TextLayout ( line , chart . getStyler ( ) . getLegendFont ( ) , new FontRenderContext ( null , true , false ) ) ; Shape shape = textLayout . getOutline ( null ) ; Rectangle2D bounds = shape . getBounds2D ( ) ; // System . out . println ( tl . getAscent ( ) ) ;
// System . out . println ( tl . getDescent ( ) ) ;
// System . out . println ( tl . getBounds ( ) ) ;
// seriesTextBounds . put ( line , new Rectangle2D . Double ( bounds . getX ( ) , bounds . getY ( ) ,
// bounds . getWidth ( ) , bounds . getHeight ( ) - tl . getDescent ( ) ) ) ;
// seriesTextBounds . put ( line , new Rectangle2D . Double ( bounds . getX ( ) , bounds . getY ( ) ,
// bounds . getWidth ( ) , tl . getAscent ( ) ) ) ;
seriesTextBounds . put ( line , bounds ) ; } return seriesTextBounds ; |
public class VirtualHostMapper { /** * Returns an enumeration of all the target mappings added
* to this mapper */
public Iterator targetMappings ( ) { } } | // System . out . println ( " TargetMappings called " ) ;
// return vHostTable . values ( ) . iterator ( ) ; 316624
Collection vHosts = vHostTable . values ( ) ; // 316624
List l = new ArrayList ( ) ; // 316624
l . addAll ( vHosts ) ; // 316624
return l . listIterator ( ) ; // 316624 |
public class ExpressionBuilderImpl { /** * Replies the default value for the given type .
* @ param type the type for which the default value should be determined .
* @ return the default value . */
@ Pure public String getDefaultValueForType ( String type ) { } } | // TODO : Check if a similar function exists in the Xbase library .
String defaultValue = "" ; if ( ! Strings . isEmpty ( type ) && ! "void" . equals ( type ) ) { switch ( type ) { case "boolean" : defaultValue = "true" ; break ; case "double" : defaultValue = "0.0" ; break ; case "float" : defaultValue = "0.0f" ; break ; case "int" : defaultValue = "0" ; break ; case "long" : defaultValue = "0" ; break ; case "byte" : defaultValue = "(0 as byte)" ; break ; case "short" : defaultValue = "(0 as short)" ; break ; case "char" : defaultValue = "(0 as char)" ; break ; default : defaultValue = "null" ; break ; } } return defaultValue ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcConnectionCurveGeometry ( ) { } } | if ( ifcConnectionCurveGeometryEClass == null ) { ifcConnectionCurveGeometryEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 121 ) ; } return ifcConnectionCurveGeometryEClass ; |
public class ApiOvhDedicatedCloud { /** * Get the current state of Zerto deployment on your dedicated Cloud .
* REST : POST / dedicatedCloud / { serviceName } / datacenter / { datacenterId } / disasterRecovery / zerto / state
* @ param serviceName [ required ] Domain of the service
* @ param datacenterId [ required ]
* API beta */
public net . minidev . ovh . api . dedicatedcloud . disasterrecovery . OvhProfile serviceName_datacenter_datacenterId_disasterRecovery_zerto_state_POST ( String serviceName , Long datacenterId ) throws IOException { } } | String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/disasterRecovery/zerto/state" ; StringBuilder sb = path ( qPath , serviceName , datacenterId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , null ) ; return convertTo ( resp , net . minidev . ovh . api . dedicatedcloud . disasterrecovery . OvhProfile . class ) ; |
public class JenkinsLogs { /** * Adds j . u . l logging output that the support - core plugin captures .
* Compared to { @ link # addMasterJulRingBuffer ( Container ) } , this one uses disk files ,
* so it remembers larger number of entries . */
private void addMasterJulLogRecords ( Container result ) { } } | // this file captures the most recent of those that are still kept around in memory .
// this overlaps with Jenkins . logRecords , and also overlaps with what ' s written in files ,
// but added nonetheless just in case .
// should be ignorable .
result . add ( new LogRecordContent ( "nodes/master/logs/all_memory_buffer.log" ) { @ Override public Iterable < LogRecord > getLogRecords ( ) { return SupportPlugin . getInstance ( ) . getAllLogRecords ( ) ; } } ) ; final File [ ] julLogFiles = SupportPlugin . getRootDirectory ( ) . listFiles ( new LogFilenameFilter ( ) ) ; if ( julLogFiles == null ) { LOGGER . log ( Level . WARNING , "Cannot add master java.util.logging logs to the bundle. Cannot access log files" ) ; return ; } // log records written to the disk
for ( File file : julLogFiles ) { result . add ( new FileContent ( "nodes/master/logs/{0}" , new String [ ] { file . getName ( ) } , file ) ) ; } |
public class CalendarPeriodAssociative { /** * print string */
public String OutEx ( Printer < T > printer ) { } } | String out = "" ; for ( int i = 0 ; i < periods . size ( ) ; i ++ ) { PeriodAssociative < T > period = periods . get ( i ) ; out += "[" + period . getFrom ( ) + "->" + period . getTo ( ) + "] => " + printer . print ( period . getValue ( ) ) + "<br>" ; } return out ; |
public class UnicodeEncoder { /** * Encodes the given string , so that it can be used within a html page .
* @ param string the string to convert */
public static String encode ( String string ) { } } | if ( string == null ) { return "" ; } StringBuilder sb = null ; char c ; for ( int i = 0 ; i < string . length ( ) ; ++ i ) { c = string . charAt ( i ) ; if ( ( ( int ) c ) >= 0x80 ) { if ( sb == null ) { sb = new StringBuilder ( string . length ( ) + 4 ) ; sb . append ( string . substring ( 0 , i ) ) ; } // encode all non basic latin characters
sb . append ( "&#" ) ; sb . append ( ( int ) c ) ; sb . append ( ";" ) ; } else if ( sb != null ) { sb . append ( c ) ; } } return sb != null ? sb . toString ( ) : string ; |
public class PluralRules { /** * Given a number information , and keyword , return whether the keyword would match the number .
* @ param sample The number information for which the rule has to be determined .
* @ param keyword The keyword to filter on
* @ deprecated This API is ICU internal only .
* @ hide original deprecated declaration
* @ hide draft / provisional / internal are hidden on Android */
@ Deprecated public boolean matches ( FixedDecimal sample , String keyword ) { } } | return rules . select ( sample , keyword ) ; |
public class ProviderAttributeDefinition { /** * Populate the supplied response { @ link ModelNode } with information about the supplied { @ link Provider }
* @ param response the response to populate .
* @ param provider the { @ link Provider } to use when populating the response . */
static void populateProvider ( final ModelNode response , final Provider provider , final boolean includeServices ) { } } | response . get ( ElytronDescriptionConstants . NAME ) . set ( provider . getName ( ) ) ; response . get ( ElytronDescriptionConstants . INFO ) . set ( provider . getInfo ( ) ) ; response . get ( ElytronDescriptionConstants . VERSION ) . set ( provider . getVersion ( ) ) ; if ( includeServices ) { addServices ( response , provider ) ; } |
public class OmsTrentoP { /** * Find the pipes that are draining in this pipe ( defined by the index parameter ) .
* @ param index
* the ID of this pipe .
* @ param cord
* the Coordinate of the link where drain . */
private void findIdThatDrainsIntoIndex ( int index , Coordinate cord ) { } } | int t = 0 ; double toll = 0.1 ; for ( int i = 0 ; i < networkPipes . length ; i ++ ) { // if it is this pipe then go haead .
if ( index == i ) { continue ; } // there isn - t other pipe that can drain in this .
else if ( t == pMaxJunction ) { break ; } // the id is already set .
else if ( networkPipes [ i ] . getIdPipeWhereDrain ( ) != null ) { continue ; } // extract the coordinate of the point of the linee of the new pipe .
Coordinate [ ] coords = networkPipes [ i ] . point ; // if one of the coordinates are near of coord then the 2 pipe are
// linked .
int lastIndex = coords . length - 1 ; if ( cord . distance ( coords [ 0 ] ) < toll ) { networkPipes [ i ] . setIdPipeWhereDrain ( networkPipes [ index ] . getId ( ) ) ; networkPipes [ i ] . setIndexPipeWhereDrain ( index ) ; findIdThatDrainsIntoIndex ( i , coords [ lastIndex ] ) ; t ++ ; } else if ( cord . distance ( coords [ lastIndex ] ) < toll ) { networkPipes [ i ] . setIdPipeWhereDrain ( networkPipes [ index ] . getId ( ) ) ; networkPipes [ i ] . setIndexPipeWhereDrain ( index ) ; findIdThatDrainsIntoIndex ( i , coords [ 0 ] ) ; t ++ ; } } |
public class DiscoveredResource { /** * Verifies the given { @ link Link } by issuing an HTTP HEAD request to the resource .
* @ param link Must not be { @ literal null } .
* @ return - link to the resource */
private Link verify ( Link link ) { } } | Assert . notNull ( link , "Link must not be null!" ) ; try { String uri = link . expand ( ) . getHref ( ) ; this . log . debug ( "Verifying link pointing to {}…" , uri ) ; this . restOperations . headForHeaders ( uri ) ; this . log . debug ( "Successfully verified link!" ) ; return link ; } catch ( RestClientException o_O ) { this . log . debug ( "Verification failed, marking as outdated!" ) ; return null ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.