signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ExpansionServiceImpl { /** * Apply all matching { @ link TermExpansionRule term expansion rules } defined
* in < tt > termExpansionRules < / tt > to the { @ link Term outer term } and all the
* { @ link Term inner terms } .
* This method is called recursively to evaluate the { @ link Term inner
* t... | for ( final ExpansionRule < Term > rule : termExpansionRules ) { if ( rule . match ( term ) ) { List < Statement > termExpansions = rule . expand ( term ) ; allExpansions . addAll ( termExpansions ) ; } final List < Term > innerTerms = term . getTerms ( ) ; for ( final Term innerTerm : innerTerms ) { expandTerm ( inner... |
public class CommonUtils { /** * 在图片缓存文件夹生成一个临时文件
* @ param context context
* @ param ext 文件后缀名 e . g " . jpg "
* @ return 生成的临时文件 */
public static File generateExternalImageCacheFile ( Context context , String ext ) { } } | String fileName = "img_" + System . currentTimeMillis ( ) ; return generateExternalImageCacheFile ( context , fileName , ext ) ; |
public class TaskKvStateRegistry { /** * Unregisters all registered KvState instances from the KvStateRegistry . */
public void unregisterAll ( ) { } } | for ( KvStateInfo kvState : registeredKvStates ) { registry . unregisterKvState ( jobId , jobVertexId , kvState . keyGroupRange , kvState . registrationName , kvState . kvStateId ) ; } |
public class DayOfTheWeek { /** * Returns the information this day of the week logically follows after the given one . Example TUE . follows ( MON ) or FRI . follows ( MON )
* would be true , but MON . follows ( TUE ) is not . Public holidays does not follow any other day .
* @ param other
* Day to compare with .... | Contract . requireArgNotNull ( "other" , other ) ; return this . id > other . id ; |
public class AAFAuthorizer { /** * Check only for Localized IDs ( see cadi . properties )
* @ param aau
* @ param perm
* @ return */
private Set < Permission > checkPermissions ( AAFAuthenticatedUser aau , LocalPermission perm ) { } } | if ( localLur . fish ( aau . getFullName ( ) , perm ) ) { // aau . setSuper ( true ) ;
return Permission . ALL ; } else { return Permission . NONE ; } |
public class UnmodifiableMutableList { /** * This method will take a MutableList and wrap it directly in a UnmodifiableMutableList . It will
* take any other non - GS - list and first adapt it will a ListAdapter , and then return a
* UnmodifiableMutableList that wraps the adapter . */
public static < E , L extends ... | if ( list == null ) { throw new IllegalArgumentException ( "cannot create an UnmodifiableMutableList for null" ) ; } if ( list instanceof RandomAccess ) { return new RandomAccessUnmodifiableMutableList < E > ( RandomAccessListAdapter . adapt ( list ) ) ; } return new UnmodifiableMutableList < E > ( ListAdapter . adapt ... |
public class StandardTypeConverters { /** * { @ inheritDoc } */
@ Override public < S , T > DynamoDBTypeConverter < S , T > getConverter ( Class < S > sourceType , Class < T > targetType ) { } } | final Scalar source = Scalar . of ( sourceType ) , target = Scalar . of ( targetType ) ; final Converter < S , T > toSource = source . getConverter ( sourceType , target . < T > type ( ) ) ; final Converter < T , S > toTarget = target . getConverter ( targetType , source . < S > type ( ) ) ; return new DynamoDBTypeConv... |
public class DefaultDatabaseContext { /** * Gets the data access object for an entity class that has an integer
* primary key data type . Dao caching is performed by
* the ORM library , so you don ' t need to take pains to hold on to this
* reference .
* @ param < T > the entity class type
* @ param clz the e... | return DaoManager . createDao ( getConnectionSource ( ) , clz ) ; |
public class AmqpChannel { /** * Fired on transaction rollbacked
* @ param e */
private void fireOnRollbackTransaction ( ChannelEvent e ) { } } | List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onRollback ( e ) ; } |
public class OperationDefinition { /** * Validates operation model against the definition and its parameters
* @ param operation model node of type { @ link ModelType # OBJECT } , representing an operation request
* @ throws OperationFailedException if the value is not valid
* @ deprecated Not used by the WildFly... | if ( operation . hasDefined ( ModelDescriptionConstants . OPERATION_NAME ) && deprecationData != null && deprecationData . isNotificationUseful ( ) ) { ControllerLogger . DEPRECATED_LOGGER . operationDeprecated ( getName ( ) , PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) . toCLI... |
public class ModuleMetadata { /** * syntactic sugar */
public ModuleMetadataContributorComponent addContributor ( ) { } } | ModuleMetadataContributorComponent t = new ModuleMetadataContributorComponent ( ) ; if ( this . contributor == null ) this . contributor = new ArrayList < ModuleMetadataContributorComponent > ( ) ; this . contributor . add ( t ) ; return t ; |
public class TypeUtil { /** * Creates a map from the even - sized parameter array .
* @ param < T > map type
* @ param _ args parameter array , any type
* @ return map of parameter type */
@ SafeVarargs public static < T > Map < T , T > createMap ( T ... _args ) { } } | Map < T , T > map = new HashMap < > ( ) ; if ( _args != null ) { if ( _args . length % 2 != 0 ) { throw new IllegalArgumentException ( "Even number of parameters required to create map: " + Arrays . toString ( _args ) ) ; } for ( int i = 0 ; i < _args . length ; ) { map . put ( _args [ i ] , _args [ i + 1 ] ) ; i += 2 ... |
public class CommerceShippingFixedOptionWrapper { /** * Returns the localized name of this commerce shipping fixed option in the language , optionally using the default language if no localization exists for the requested language .
* @ param languageId the ID of the language
* @ param useDefault whether to use the... | return _commerceShippingFixedOption . getName ( languageId , useDefault ) ; |
public class JDK14LoggerAdapter { /** * Log a message object at the WARNING level .
* @ param msg
* - the message object to be logged */
public void warn ( String msg ) { } } | if ( logger . isLoggable ( Level . WARNING ) ) { log ( SELF , Level . WARNING , msg , null ) ; } |
public class DefaultAnimationsBuilder { /** * @ param croutonView
* The croutonView which gets animated .
* @ return The default Animation for a showing { @ link Crouton } . */
static Animation buildDefaultSlideInDownAnimation ( View croutonView ) { } } | if ( ! areLastMeasuredInAnimationHeightAndCurrentEqual ( croutonView ) || ( null == slideInDownAnimation ) ) { slideInDownAnimation = new TranslateAnimation ( 0 , 0 , // X : from , to
- croutonView . getMeasuredHeight ( ) , 0 // Y : from , to
) ; slideInDownAnimation . setDuration ( DURATION ) ; setLastInAnimationHeigh... |
public class CreateRelationalDatabaseSnapshotRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateRelationalDatabaseSnapshotRequest createRelationalDatabaseSnapshotRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createRelationalDatabaseSnapshotRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createRelationalDatabaseSnapshotRequest . getRelationalDatabaseName ( ) , RELATIONALDATABASENAME_BINDING ) ; protocolMarshaller . marshall ( crea... |
public class AbstractMapValidatorBuilder { /** * @ see # size ( Range )
* @ param min the minimum { @ link Map # size ( ) size } allowed .
* @ param max the maximum { @ link Map # size ( ) size } allowed .
* @ return this build instance for fluent API calls . */
public SELF size ( int min , int max ) { } } | return size ( new Range < > ( Integer . valueOf ( min ) , Integer . valueOf ( max ) ) ) ; |
public class AbstractEJBRuntime { /** * RTC107334 */
private void queueOrStartNpTimer ( BeanO beanO , TimerNpImpl timer ) throws EJBException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; try { // d589357 - Prevent NP timers from being created after the
// application has been stopped . This call will race if it occurs on
// a thread other than the one stopping the application , but
// EJBApplicationMeaData . queueOrStartNonPersistentT... |
public class BatchGetDeploymentInstancesResult { /** * Information about the instance .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setInstancesSummary ( java . util . Collection ) } or { @ link # withInstancesSummary ( java . util . Collection ) } if you... | if ( this . instancesSummary == null ) { setInstancesSummary ( new com . amazonaws . internal . SdkInternalList < InstanceSummary > ( instancesSummary . length ) ) ; } for ( InstanceSummary ele : instancesSummary ) { this . instancesSummary . add ( ele ) ; } return this ; |
public class MemorySegment { /** * Writes the given long value ( 64bit , 8 bytes ) to the given position in the system ' s native
* byte order . This method offers the best speed for long integer writing and should be used
* unless a specific byte order is required . In most cases , it suffices to know that the
*... | if ( CHECKED ) { if ( index >= 0 && index <= this . memory . length - 8 ) { UNSAFE . putLong ( this . memory , BASE_OFFSET + index , value ) ; } else { throw new IndexOutOfBoundsException ( ) ; } } else { UNSAFE . putLong ( this . memory , BASE_OFFSET + index , value ) ; } |
public class ChannelFrameworkImpl { /** * This method is done in preparation for stopping a channel . It pull ' s its
* discriminator from the device side channel ' s discrimination process in the
* chain .
* @ param targetChannel
* being stopped
* @ param chain
* the channel is in
* @ return if the chann... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "disableChannelInChain" ) ; } String channelName = targetChannel . getName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "channelName=" + channelName + " chainName=" + ch... |
public class ConfigVariableRegistry { /** * Resolve the given variable .
* Formerly , this value was path - normalized ( i . e , " / / " is replaced
* with " / " and any trailing " / " are removed from the value ) .
* This has changed , at least temporarily , to not do path normalization for variables .
* @ par... | String varReference = XMLConfigConstants . VAR_OPEN + variableName + XMLConfigConstants . VAR_CLOSE ; String resolvedVar = registry . resolveRawString ( varReference ) ; return varReference . equalsIgnoreCase ( resolvedVar ) ? null : resolvedVar ; |
public class JGoogleAnalyticsTracker { /** * Sets the dispatch mode
* @ see DispatchMode
* @ param argMode the mode to to put the tracker in . If this is null , the tracker
* defaults to { @ link DispatchMode # SINGLE _ THREAD } */
public void setDispatchMode ( DispatchMode argMode ) { } } | if ( argMode == null ) { argMode = DispatchMode . SINGLE_THREAD ; } if ( argMode == DispatchMode . SINGLE_THREAD ) { startBackgroundThread ( ) ; } mode = argMode ; |
public class RtfParser { /** * Set the current destination object for the current state .
* @ param destination The destination value to set .
* @ since 2.1.3 */
public boolean setCurrentDestination ( String destination ) { } } | RtfDestination dest = RtfDestinationMgr . getDestination ( destination ) ; if ( dest != null ) { this . currentState . destination = dest ; return false ; } else { this . setTokeniserStateSkipGroup ( ) ; return false ; } |
public class ContextRuleAssistant { /** * Resolve bean class for the aspect rule .
* @ param aspectRule the aspect rule
* @ throws IllegalRuleException if an illegal rule is found */
public void resolveAdviceBeanClass ( AspectRule aspectRule ) throws IllegalRuleException { } } | String beanIdOrClass = aspectRule . getAdviceBeanId ( ) ; if ( beanIdOrClass != null ) { Class < ? > beanClass = resolveBeanClass ( beanIdOrClass , aspectRule ) ; if ( beanClass != null ) { aspectRule . setAdviceBeanClass ( beanClass ) ; reserveBeanReference ( beanClass , aspectRule ) ; } else { reserveBeanReference ( ... |
public class JellyBuilder { /** * Loads a Groovy tag lib instance .
* A groovy tag library is really just a script class with bunch of method definitions ,
* without any explicit class definition . Such a class is loaded as a subtype of
* { @ link GroovyClosureScript } so that it can use this builder as the deleg... | GroovyClosureScript o = taglibs . get ( type ) ; if ( o == null ) { o = ( GroovyClosureScript ) type . newInstance ( ) ; o . setDelegate ( this ) ; taglibs . put ( type , o ) ; adjunct ( type . getName ( ) ) ; } return o ; |
public class BaseFont { /** * Normalize the encoding names . " winansi " is changed to " Cp1252 " and
* " macroman " is changed to " MacRoman " .
* @ param enc the encoding to be normalized
* @ return the normalized encoding */
protected static String normalizeEncoding ( String enc ) { } } | if ( enc . equals ( "winansi" ) || enc . equals ( "" ) ) return CP1252 ; else if ( enc . equals ( "macroman" ) ) return MACROMAN ; else return enc ; |
public class DefaultTextListener { /** * Configures the target text box to display the supplied default text when it does not have
* focus and to clear it out when the user selects it to enter text .
* @ deprecated use Widgets . setPlaceholderText ( TextBoxBase , String ) */
@ Deprecated public static void configur... | DefaultTextListener listener = new DefaultTextListener ( target , defaultText ) ; target . addFocusHandler ( listener ) ; target . addBlurHandler ( listener ) ; |
public class InterceptionModelInitializer { /** * CDI @ AroundConstruct interceptors */
private void initCdiConstructorInterceptors ( Multimap < Class < ? extends Annotation > , Annotation > classBindingAnnotations ) { } } | Set < Annotation > constructorBindings = getMemberBindingAnnotations ( classBindingAnnotations , constructor . getMetaAnnotations ( InterceptorBinding . class ) ) ; if ( constructorBindings . isEmpty ( ) ) { return ; } initLifeCycleInterceptor ( InterceptionType . AROUND_CONSTRUCT , this . constructor , constructorBind... |
public class VetoableASTTransformation { /** * Handles the bulk of the processing , mostly delegating to other methods .
* @ param nodes the AST nodes
* @ param source the source unit for the nodes */
public void visit ( ASTNode [ ] nodes , SourceUnit source ) { } } | if ( ! ( nodes [ 0 ] instanceof AnnotationNode ) || ! ( nodes [ 1 ] instanceof AnnotatedNode ) ) { throw new RuntimeException ( "Internal error: wrong types: $node.class / $parent.class" ) ; } AnnotationNode node = ( AnnotationNode ) nodes [ 0 ] ; if ( nodes [ 1 ] instanceof ClassNode ) { addListenerToClass ( source , ... |
public class UriEscape { /** * Perform am URI path < strong > escape < / strong > operation
* on a < tt > String < / tt > input , writing results to a < tt > Writer < / tt > .
* The following are the only allowed chars in an URI path ( will not be escaped ) :
* < ul >
* < li > < tt > A - Z a - z 0-9 < / tt > < ... | if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( encoding == null ) { throw new IllegalArgumentException ( "Argument 'encoding' cannot be null" ) ; } UriEscapeUtil . escape ( new InternalStringReader ( text ) , writer , UriEscapeUtil . UriEscapeType . PATH , enc... |
public class FormValidation { /** * Makes sure that the given string is a positive integer . */
public static FormValidation validatePositiveInteger ( String value ) { } } | try { if ( Integer . parseInt ( value ) <= 0 ) return error ( hudson . model . Messages . Hudson_NotAPositiveNumber ( ) ) ; return ok ( ) ; } catch ( NumberFormatException e ) { return error ( hudson . model . Messages . Hudson_NotANumber ( ) ) ; } |
public class SchemaParserImpl { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . schemaparser . SchemaParserInterface # findConstantInScope ( java . lang . String , java . lang . String ) */
@ Override public EnumeratedConstant findConstantInScope ( String currentScope , String constant ) { } } | int i = constant . indexOf ( '.' ) ; if ( i == - 1 ) { return null ; } String className = constant . substring ( 0 , i ) ; String fieldName = constant . substring ( i + 1 ) ; List < String > constants = m_constants . get ( className ) ; if ( constants == null ) { return null ; } if ( constants . contains ( fieldName ) ... |
public class ManagementClient { /** * Updates an existing topic .
* @ param topicDescription - A { @ link TopicDescription } object describing the attributes with which the topic will be updated .
* @ return { @ link TopicDescription } of the updated topic .
* @ throws MessagingEntityNotFoundException - Described... | return Utils . completeFuture ( this . asyncClient . updateTopicAsync ( topicDescription ) ) ; |
public class CMISAclService { /** * Applies the given Acl exclusively , i . e . removes all other permissions / grants first .
* @ param repositoryId
* @ param objectId
* @ param acl
* @ param aclPropagation
* @ return the resulting Acl */
public Acl applyAcl ( final String repositoryId , final String objectI... | final App app = StructrApp . getInstance ( securityContext ) ; try ( final Tx tx = app . tx ( ) ) { final AbstractNode node = app . get ( AbstractNode . class , objectId ) ; if ( node != null ) { node . revokeAll ( ) ; // process add ACL entries
for ( final Ace toAdd : acl . getAces ( ) ) { applyAce ( node , toAdd , fa... |
public class ObjectInputStream { /** * Walks the hierarchy of classes described by class descriptor
* { @ code classDesc } and reads the field values corresponding to
* fields declared by the corresponding class descriptor . The instance to
* store field values into is { @ code object } . If the class
* ( corre... | if ( object == null && mustResolve ) { throw new NotActiveException ( ) ; } List < ObjectStreamClass > streamClassList = classDesc . getHierarchy ( ) ; if ( object == null ) { for ( ObjectStreamClass objectStreamClass : streamClassList ) { readObjectForClass ( null , objectStreamClass ) ; } } else { List < Class < ? > ... |
public class MBeanRegistry { /** * Register the given MBean based on the given name
* @ param mBean the bean
* @ param name the name
* @ return the subscription that can be used to unregister the bean */
public Subscription register ( final Object mBean , final String name ) { } } | try { if ( mbeanSupport . get ( ) ) { final ObjectName objectName = new ObjectName ( name ) ; server . registerMBean ( mBean , objectName ) ; return new Subscription ( ) { @ Override public void unsubscribe ( ) { try { server . unregisterMBean ( objectName ) ; } catch ( JMException e ) { throw new RuntimeException ( "C... |
public class Node { /** * Add a new < code > Entry < / code > to this node . If there is no space left a
* < code > NoFreeEntryException < / code > is thrown .
* @ param newEntry The < code > Entry < / code > to be added .
* @ throws NoFreeEntryException Is thrown when there is no space left in
* the node for t... | newEntry . setNode ( this ) ; int freePosition = getNextEmptyPosition ( ) ; entries [ freePosition ] . initializeEntry ( newEntry , currentTime ) ; |
public class BindContentProviderBuilder { /** * Generate delete .
* @ param schema
* the schema */
private void generateDelete ( SQLiteDatabaseSchema schema ) { } } | MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "delete" ) . addModifiers ( Modifier . PUBLIC ) . addAnnotation ( Override . class ) . returns ( Integer . TYPE ) ; methodBuilder . addParameter ( Uri . class , "uri" ) ; methodBuilder . addParameter ( String . class , "selection" ) ; methodBuilder . add... |
public class FinalizeMigrationOperation { /** * Updates the replica versions on the migration source if the replica index has changed . */
private void commitSource ( ) { } } | int partitionId = getPartitionId ( ) ; InternalPartitionServiceImpl partitionService = getService ( ) ; PartitionReplicaManager replicaManager = partitionService . getReplicaManager ( ) ; ILogger logger = getLogger ( ) ; int sourceNewReplicaIndex = migrationInfo . getSourceNewReplicaIndex ( ) ; if ( sourceNewReplicaInd... |
public class Resources { /** * Mapping between EAGLES PAROLE tagset and NAF .
* @ param postag
* the postag
* @ return the mapping to NAF pos tagset */
private static String mapSpanishTagSetToKaf ( final String postag ) { } } | if ( postag . equalsIgnoreCase ( "RG" ) || postag . equalsIgnoreCase ( "RN" ) ) { return "A" ; // adverb
} else if ( postag . equalsIgnoreCase ( "CC" ) || postag . equalsIgnoreCase ( "CS" ) ) { return "C" ; // conjunction
} else if ( postag . startsWith ( "D" ) ) { return "D" ; // det predeterminer
} else if ( postag .... |
public class Collector { /** * Convert a double to its string representation in Go . */
public static String doubleToGoString ( double d ) { } } | if ( d == Double . POSITIVE_INFINITY ) { return "+Inf" ; } if ( d == Double . NEGATIVE_INFINITY ) { return "-Inf" ; } if ( Double . isNaN ( d ) ) { return "NaN" ; } return Double . toString ( d ) ; |
public class FessMessages { /** * Add the created action message for the key ' constraints . TypeDouble . message ' with parameters .
* < pre >
* message : { item } should be numeric .
* < / pre >
* @ param property The property name for the message . ( NotNull )
* @ return this . ( NotNull ) */
public FessMe... | assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( CONSTRAINTS_TypeDouble_MESSAGE ) ) ; return this ; |
public class CohenKappaAgreement { /** * Artstein & Poesio have a different definition ! */
@ Override public double calculateCategoryAgreement ( final Object category ) { } } | // N = # subjects = # items - > index i
// n = # ratings / subject = # raters
// k = # categories - > index j
// n _ ij = # raters that annotated item i as category j
// k _ j = ( P _ j - p _ j ) / ( 1 - p _ j )
// P _ j = ( sum ( n _ ij ^ 2 ) - N n p _ j ) / ( N n ( n - 1 ) p _ j )
// p _ j = 1 / Nn sum n _ ij
int N =... |
public class Trajectory { /** * Generates a sub - trajectory */
@ Override public Trajectory subList ( int fromIndex , int toIndex ) { } } | Trajectory t = new Trajectory ( dimension ) ; for ( int i = fromIndex ; i < toIndex ; i ++ ) { t . add ( this . get ( i ) ) ; } return t ; |
public class ELParser { /** * DotSuffix
* Dot Property */
final public void DotSuffix ( ) throws ParseException { } } | /* @ bgen ( jjtree ) DotSuffix */
AstDotSuffix jjtn000 = new AstDotSuffix ( JJTDOTSUFFIX ) ; boolean jjtc000 = true ; jjtree . openNodeScope ( jjtn000 ) ; Token t = null ; try { jj_consume_token ( DOT ) ; t = jj_consume_token ( IDENTIFIER ) ; jjtree . closeNodeScope ( jjtn000 , true ) ; jjtc000 = false ; jjtn000 . setI... |
public class MongoReader { /** * Init void .
* @ param partition the partition */
public void init ( Partition partition ) { } } | try { List < ServerAddress > addressList = new ArrayList < > ( ) ; for ( String s : ( List < String > ) ( ( DeepPartition ) partition ) . splitWrapper ( ) . getReplicas ( ) ) { addressList . add ( new ServerAddress ( s ) ) ; } // Credentials
List < MongoCredential > mongoCredentials = new ArrayList < > ( ) ; if ( mongo... |
public class WorkQueue { /** * Registers a new task group with the specified number of tasks to execute and
* returns a task group identifier to use when registering its tasks .
* @ param numTasks the number of tasks that will be eventually run as a part
* of this group .
* @ returns an identifier associated wi... | Object key = new Object ( ) ; taskKeyToLatch . putIfAbsent ( key , new CountDownLatch ( numTasks ) ) ; return key ; |
public class SamlServiceFactory { /** * Gets the request body from the request .
* @ param request the request
* @ return the request body */
private static String getRequestBody ( final HttpServletRequest request ) { } } | val body = readRequestBodyIfAny ( request ) ; if ( ! StringUtils . hasText ( body ) ) { LOGGER . trace ( "Looking at the request attribute [{}] to locate SAML request body" , SamlProtocolConstants . PARAMETER_SAML_REQUEST ) ; return ( String ) request . getAttribute ( SamlProtocolConstants . PARAMETER_SAML_REQUEST ) ; ... |
public class AbstractInstrumentationTask { /** * Get the command line configuration arguments for the
* StaticTraceInstrumentation invocations .
* @ return the ant Commandline that holds the command line arguments */
protected Commandline getCommandline ( ) { } } | Commandline cmdl = new Commandline ( ) ; if ( configFile != null ) { cmdl . createArgument ( ) . setValue ( "--config" ) ; cmdl . createArgument ( ) . setFile ( configFile ) ; } if ( debug ) { cmdl . createArgument ( ) . setValue ( "--debug" ) ; } return cmdl ; |
public class ThreadPoolController { /** * Returns the largest valid poolSize in the current historical dataset .
* @ param poolSize - current poolSize
* @ param forecast - expected throughput at current poolSize
* @ return - largest valid poolSize found */
private Integer getLargestValidPoolSize ( Integer poolSiz... | Integer largestPoolSize = - 1 ; // find largest poolSize with valid data
boolean validLargeData = false ; while ( ! validLargeData ) { largestPoolSize = threadStats . lastKey ( ) ; ThroughputDistribution largestPoolSizeStats = getThroughputDistribution ( largestPoolSize , false ) ; ; // prune any data that is too old o... |
public class DirtyItemList { /** * Clears out any items that were in this list . */
public void clear ( ) { } } | for ( int icount = _items . size ( ) ; icount > 0 ; icount -- ) { DirtyItem item = _items . remove ( 0 ) ; item . clear ( ) ; _freelist . add ( item ) ; } |
public class A_CmsGroupsList { /** * This method should handle every defined list multi action ,
* by comparing < code > { @ link # getParamListAction ( ) } < / code > with the id
* of the action to execute . < p >
* @ throws CmsRuntimeException to signal that an action is not supported */
@ Override public void ... | if ( getParamListAction ( ) . equals ( LIST_MACTION_DELETE ) ) { // execute the delete multiaction
Map < String , String [ ] > params = new HashMap < String , String [ ] > ( ) ; params . put ( A_CmsEditGroupDialog . PARAM_GROUPID , new String [ ] { getParamSelItems ( ) } ) ; // set action parameter to initial dialog ca... |
public class AmazonIdentityManagementAsyncClient { /** * Simplified method form for invoking the ListAccountAliases operation with an AsyncHandler .
* @ see # listAccountAliasesAsync ( ListAccountAliasesRequest , com . amazonaws . handlers . AsyncHandler ) */
@ Override public java . util . concurrent . Future < List... | return listAccountAliasesAsync ( new ListAccountAliasesRequest ( ) , asyncHandler ) ; |
public class IntegerChromosome { /** * Create a new random { @ code IntegerChromosome } .
* @ param min the min value of the { @ link IntegerGene } s ( inclusively ) .
* @ param max the max value of the { @ link IntegerGene } s ( inclusively ) .
* @ param length the length of the chromosome .
* @ return a new r... | return of ( min , max , IntRange . of ( length ) ) ; |
public class CmsMultiDialog { /** * Returns the value of the resourcelist parameter in form of a String separated
* with { @ link # DELIMITER _ RESOURCES } , or the value of the resource parameter if the
* first parameter is not provided ( no multiple choice has been done . < p >
* This may be used for jsps as va... | String result = getParamResourcelist ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( result ) ) { result = getParamResource ( ) ; } return result ; |
public class Tesseract { /** * Creates documents .
* @ param filenames array of input files
* @ param outputbases array of output filenames without extension
* @ param formats types of renderer
* @ throws TesseractException */
@ Override public void createDocuments ( String [ ] filenames , String [ ] outputbase... | if ( filenames . length != outputbases . length ) { throw new RuntimeException ( "The two arrays must match in length." ) ; } init ( ) ; setTessVariables ( ) ; try { for ( int i = 0 ; i < filenames . length ; i ++ ) { File inputFile = new File ( filenames [ i ] ) ; File imageFile = null ; try { // if PDF , convert to m... |
public class CmsContextMenuOverlay { /** * Returns whether the given event targets the popup . < p >
* @ param event the event to check
* @ return < code > true < / code > if the event targets the popup */
protected boolean eventTargetsPopup ( NativeEvent event ) { } } | EventTarget target = event . getEventTarget ( ) ; if ( Element . is ( target ) ) { return getElement ( ) . isOrHasChild ( Element . as ( target ) ) ; } return false ; |
public class JedisSet { /** * Removes from this set all of its elements that are contained in the specified members array
* @ param members the members to remove
* @ return the number of members actually removed */
public long removeAll ( final String ... members ) { } } | return doWithJedis ( new JedisCallable < Long > ( ) { @ Override public Long call ( Jedis jedis ) { return jedis . srem ( getKey ( ) , members ) ; } } ) ; |
public class ListenersNotifier { /** * This method log given exception in specified listener */
private void logError ( LifecycleListener listener , Exception e ) { } } | LOGGER . error ( "Error for listener " + listener . getClass ( ) , e ) ; |
public class LinuxResourceCalculatorPlugin { /** * { @ inheritDoc } */
@ Override public synchronized float getCpuUsage ( ) { } } | readProcStatFile ( ) ; sampleTime = getCurrentTime ( ) ; if ( lastSampleTime == UNAVAILABLE || lastSampleTime > sampleTime ) { // lastSampleTime > sampleTime may happen when the system time is changed
lastSampleTime = sampleTime ; lastCumulativeCpuTime = cumulativeCpuTime ; return cpuUsage ; } // When lastSampleTime is... |
public class FighterParser { /** * Get a fighter fights
* @ param trs JSOUP TRs document
* @ param fighter a fighter to parse against */
private List < Fight > getFights ( Elements trs , Fighter fighter ) throws ArrayIndexOutOfBoundsException { } } | List < Fight > fights = new ArrayList < > ( ) ; logger . info ( "{} TRs to parse through" , trs . size ( ) ) ; SherdogBaseObject sFighter = new SherdogBaseObject ( ) ; sFighter . setName ( fighter . getName ( ) ) ; sFighter . setSherdogUrl ( fighter . getSherdogUrl ( ) ) ; // removing header row . . .
if ( trs . size (... |
public class NullHandler { /** * @ see org . browsermob . proxy . jetty . http . HttpHandler # handle ( java . lang . String , java . lang . String , org . browsermob . proxy . jetty . http . HttpRequest , org . browsermob . proxy . jetty . http . HttpResponse ) */
public void handle ( String pathInContext , String pat... | |
public class DelegatingDirContext { /** * Recursivley inspect delegates until a non - delegating dir context is found .
* @ return The innermost ( real ) DirContext that is being delegated to . */
public DirContext getInnermostDelegateDirContext ( ) { } } | final DirContext delegateDirContext = this . getDelegateDirContext ( ) ; if ( delegateDirContext instanceof DelegatingDirContext ) { return ( ( DelegatingDirContext ) delegateDirContext ) . getInnermostDelegateDirContext ( ) ; } return delegateDirContext ; |
public class DriverFactory { /** * Get selenium driver . Drivers are lazy loaded .
* @ return selenium driver */
public WebDriver getDriver ( ) { } } | // Driver ' s name is retrieved by system properties
String driverName = Context . getBrowser ( ) ; driverName = driverName != null ? driverName : DEFAULT_DRIVER ; WebDriver driver = null ; if ( ! drivers . containsKey ( driverName ) ) { try { driver = generateWebDriver ( driverName ) ; } catch ( final TechnicalExcepti... |
public class PageViewKit { /** * 获取根目录下的pageviews目录中pathRefRootViews子目录下面的静态页面
* @ param pathRefRootViews 目录 : 加入到 / pageviews / pathRefRootViews下
* @ param pageName 页面名称
* @ return */
public static String getHTMLPageViewFromRoot ( String pathRefRootViews , String pageName ) { } } | return getHTMLPageView ( ROOT_DIR , PAGE_VIEW_PATH + pathRefRootViews , pageName ) ; |
public class RecordWriter { /** * This is used to broadcast Streaming Watermarks in - band with records . This ignores
* the { @ link ChannelSelector } . */
public void broadcastEmit ( T record ) throws IOException , InterruptedException { } } | checkErroneous ( ) ; serializer . serializeRecord ( record ) ; boolean pruneAfterCopying = false ; for ( int channel : broadcastChannels ) { if ( copyFromSerializerToTargetChannel ( channel ) ) { pruneAfterCopying = true ; } } // Make sure we don ' t hold onto the large intermediate serialization buffer for too long
if... |
public class DevicesInner { /** * Updates the security settings on a data box edge / gateway device .
* @ param deviceName The device name .
* @ param resourceGroupName The resource group name .
* @ param deviceAdminPassword Device administrator password as an encrypted string ( encrypted using RSA PKCS # 1 ) is ... | return ServiceFuture . fromResponse ( beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync ( deviceName , resourceGroupName , deviceAdminPassword ) , serviceCallback ) ; |
public class SparkComputationGraph { /** * { @ code RDD < DataSet > } overload of { @ link # evaluate ( JavaRDD ) } */
public < T extends Evaluation > T evaluate ( RDD < DataSet > data ) { } } | return evaluate ( data . toJavaRDD ( ) ) ; |
public class Base64Encoder { /** * Returns the encoded form of the given unencoded string . The encoder uses the ISO - 8859-1
* ( Latin - 1 ) encoding to convert the string to bytes . For greater control over the encoding ,
* encode the string to bytes yourself and use encode ( byte [ ] ) .
* @ param unencoded th... | byte [ ] bytes = null ; try { bytes = unencoded . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException ignored ) { } if ( null == bytes ) { return null ; } return encode ( bytes ) ; |
public class PharmacophoreMatcher { /** * Get the matching pharmacophore constraints .
* The method should be called after performing the match , otherwise the return value is null .
* The method returns a List of List ' s . Each List represents the pharmacophore constraints in the
* target molecule that matched ... | if ( mappings == null ) return null ; // XXX : re - subsearching the query
List < List < IBond > > bonds = new ArrayList < > ( ) ; for ( Map < IBond , IBond > map : mappings . toBondMap ( ) ) { bonds . add ( new ArrayList < > ( map . values ( ) ) ) ; } return bonds ; |
public class FileAttributeName { /** * Returns a set that contains given views as well as all implied views .
* @ param views
* @ return */
public static final Set < String > impliedSet ( String ... views ) { } } | Set < String > set = new HashSet < > ( ) ; for ( String view : views ) { set . addAll ( impliesMap . get ( view ) ) ; } return set ; |
public class StreamingWordExtract { /** * Sets up and starts streaming pipeline .
* @ throws IOException if there is a problem setting up resources */
public static void main ( String [ ] args ) throws IOException { } } | StreamingWordExtractOptions options = PipelineOptionsFactory . fromArgs ( args ) . withValidation ( ) . as ( StreamingWordExtractOptions . class ) ; options . setStreaming ( true ) ; options . setBigQuerySchema ( StringToRowConverter . getSchema ( ) ) ; ExampleUtils exampleUtils = new ExampleUtils ( options ) ; example... |
public class ClassStrUtils { /** * e . g . transform ' StrUtils ' to ' str _ utils ' , ' strUtils ' to ' str _ utils '
* @ param string e . g . StrUtils
* @ return e . g . str _ utils */
public static String hump2Underline ( String string ) { } } | if ( string == null ) return null ; if ( string . trim ( ) . length ( ) == 0 ) return "" ; string = toFirstLower ( string ) ; StringBuilder sb = new StringBuilder ( ) ; char [ ] arr = string . toCharArray ( ) ; for ( char c : arr ) { if ( c >= 65 && c <= 90 ) { c += 32 ; sb . append ( "_" ) . append ( String . valueOf ... |
public class WordSegmenting { /** * Check args .
* @ param args the args
* @ return true , if successful */
public static boolean checkArgs ( String [ ] args ) { } } | if ( args . length < 4 ) { return false ; } if ( args [ 0 ] . compareToIgnoreCase ( "-modeldir" ) != 0 ) { return false ; } if ( ! ( args [ 2 ] . compareToIgnoreCase ( "-inputfile" ) == 0 || args [ 2 ] . compareToIgnoreCase ( "-inputdir" ) == 0 ) ) { return false ; } return true ; |
public class ConsecutiveSiblingsFactor { /** * Get the link var corresponding to the specified parent and child position .
* @ param parent The parent word position , or - 1 to indicate the wall node .
* @ param child The child word position .
* @ return The link variable . */
public LinkVar getLinkVar ( int pare... | if ( parent == - 1 ) { return rootVars [ child ] ; } else { return childVars [ parent ] [ child ] ; } |
public class Sendinblue { /** * Get all the processes information under the account .
* @ param { Object } data contains json objects as a key value pair from HashMap .
* @ options data { Integer } page : Maximum number of records per request is 50 , if there are more than 50 processes then you can use this paramet... | Gson gson = new Gson ( ) ; String json = gson . toJson ( data ) ; return get ( "process" , json ) ; |
public class ClassFileVersion { /** * Creates a wrapper for a given minor - major release of the Java class file file .
* @ param versionNumber The minor - major release number .
* @ return A representation of the version number . */
public static ClassFileVersion ofMinorMajor ( int versionNumber ) { } } | ClassFileVersion classFileVersion = new ClassFileVersion ( versionNumber ) ; if ( classFileVersion . getMajorVersion ( ) <= BASE_VERSION ) { throw new IllegalArgumentException ( "Class version " + versionNumber + " is not valid" ) ; } return classFileVersion ; |
public class TraceImpl { /** * Method exit tracing for static methods .
* @ param sourceClass The type of class which called this method
* @ param methodName The method name to trace */
public final void exit ( Class sourceClass , String methodName ) { } } | internalExit ( null , sourceClass , methodName , null ) ; |
public class CfgParser { /** * Initializes parse charts with the correct variable arguments .
* @ param terminals
* @ param useSumProduct
* @ return */
private CfgParseChart createParseChart ( List < ? > terminals , boolean useSumProduct ) { } } | return new CfgParseChart ( terminals , parentVar , leftVar , rightVar , terminalVar , ruleTypeVar , binaryDistribution , useSumProduct ) ; |
public class CxxCoverageSensor { /** * { @ inheritDoc } */
@ Override public void executeImpl ( SensorContext context ) { } } | Configuration conf = context . config ( ) ; String [ ] reportsKey = conf . getStringArray ( getReportPathKey ( ) ) ; LOG . info ( "Searching coverage reports by path with basedir '{}' and search prop '{}'" , context . fileSystem ( ) . baseDir ( ) , getReportPathKey ( ) ) ; LOG . info ( "Searching for coverage reports '... |
public class FieldEditor { /** * documentation inherited from interface */
public void focusLost ( FocusEvent event ) { } } | // make sure the value is not changed from the value in the
// object ; if it is , set a modified border
Object dvalue = null ; try { dvalue = getDisplayValue ( ) ; } catch ( Exception e ) { log . warning ( "Failed to parse display value " + e + "." ) ; displayValue ( getValue ( ) ) ; } updateBorder ( ! valueMatches ( ... |
public class WxApi2Impl { /** * 基本API */
@ Override public WxResp send ( WxOutMsg out ) { } } | if ( out . getFromUserName ( ) == null ) out . setFromUserName ( openid ) ; String str = Wxs . asJson ( out ) ; if ( Wxs . DEV_MODE ) log . debug ( "api out msg>\n" + str ) ; return call ( "/message/custom/send" , METHOD . POST , str ) ; |
public class Admin { /** * @ throws PageException */
private void doGetApplicationSetting ( ) throws PageException { } } | Struct sct = new StructImpl ( ) ; pageContext . setVariable ( getString ( "admin" , action , "returnVariable" ) , sct ) ; sct . set ( "scriptProtect" , AppListenerUtil . translateScriptProtect ( config . getScriptProtect ( ) ) ) ; // request timeout
sct . set ( "requestTimeout" , config . getRequestTimeout ( ) ) ; sct ... |
public class Stripe { /** * Call to create a { @ link Token } for CVC with the publishable key and
* { @ link Executor } specified .
* @ param cvc the CVC used to create this token
* @ param publishableKey the publishable key to use
* @ param executor an { @ link Executor } to run this operation on . If null , ... | createTokenFromParams ( mapFromCvc ( cvc ) , publishableKey , Token . TYPE_CVC_UPDATE , executor , callback ) ; |
public class OutputHandler { /** * { @ inheritDoc } */
public List < Record > handle ( Record record ) { } } | StringBuilder b = new StringBuilder ( ) ; // - - Special case for Exceptions
String [ ] content ; if ( record . content instanceof Throwable ) { // ( vars )
List < String > lines = new ArrayList < String > ( ) ; StackTraceElement [ ] trace = null ; StackTraceElement topTraceElement = null ; // ( root message )
Throwabl... |
public class OpenCryptoFiles { /** * Prepares to update any open file references during a move operation .
* MUST be invoked using a try - with - resource statement and committed after the physical file move succeeded .
* @ param src The ciphertext file path before the move
* @ param dst The ciphertext file path ... | return new TwoPhaseMove ( src , dst ) ; |
public class Log { /** * Send a WARN message .
* @ param domain The log domain .
* @ param msg The message you would like logged . */
public static void w ( com . couchbase . lite . LogDomain domain , String msg ) { } } | sendToLoggers ( com . couchbase . lite . LogLevel . WARNING , domain , msg ) ; |
public class JawrRequestHandler { /** * Handle the generated CSS content in debug mode .
* @ param requestedPath
* the request path
* @ param request
* the request
* @ param response
* the response
* @ param binaryRsHandler
* the image resource handler
* @ throws ResourceNotFoundException
* if the r... | // Retrieves the content of the CSS
Reader rd = rsReaderHandler . getResource ( null , requestedPath ) ; if ( rd == null ) { throw new ResourceNotFoundException ( requestedPath ) ; } String content = IOUtils . toString ( rd ) ; String requestPath = getRequestPath ( request ) ; // Rewrite the generated binary resources
... |
public class EmbeddedKafkaServer { /** * Create topics on embedded Kafka server .
* @ param topics */
protected void createKafkaTopics ( Set < String > topics ) { } } | Map < String , Object > adminConfigs = new HashMap < > ( ) ; adminConfigs . put ( AdminClientConfig . BOOTSTRAP_SERVERS_CONFIG , "localhost:" + kafkaServerPort ) ; try ( AdminClient admin = AdminClient . create ( adminConfigs ) ) { List < NewTopic > newTopics = topics . stream ( ) . map ( t -> new NewTopic ( t , partit... |
public class MetadataVersionStoreUtils { /** * Writes the Properties object to the Version metadata system store
* @ param versionStore The system store client used to retrieve the metadata
* versions
* @ param props The Properties object to write to the System store */
public static void setProperties ( SystemSt... | if ( props == null ) { logger . info ( "Ignoring set for empty properties" ) ; return ; } try { String versionString = getPropertiesString ( props ) ; versionStore . putSysStore ( SystemStoreConstants . VERSIONS_METADATA_KEY , versionString ) ; } catch ( Exception e ) { logger . info ( "Got exception in setting propert... |
public class ChargingStationEventListener { /** * Handles the { @ link AuthorizationListVersionReceivedEvent } .
* @ param event the event to handle . */
@ EventHandler public void handle ( AuthorizationListVersionReceivedEvent event ) { } } | ChargingStation chargingStation = repository . findOne ( event . getChargingStationId ( ) . getId ( ) ) ; if ( chargingStation != null ) { chargingStation . setLocalAuthorizationListVersion ( event . getVersion ( ) ) ; repository . createOrUpdate ( chargingStation ) ; } |
public class Caption { /** * Render the caption tag . This tag renders during the data grid ' s { @ link DataGridTagModel # RENDER _ STATE _ CAPTION }
* state and produces an HTML & lt ; caption & gt ; which contains the result of having evaluated
* the body of this tag .
* @ throws IOException
* @ throws JspEx... | JspContext jspContext = getJspContext ( ) ; DataGridTagModel dgm = DataGridUtil . getDataGridTagModel ( jspContext ) ; if ( dgm == null ) throw new JspException ( Bundle . getErrorString ( "DataGridTags_MissingDataGridModel" ) ) ; if ( dgm . getRenderState ( ) == DataGridTagModel . RENDER_STATE_CAPTION ) { JspFragment ... |
public class LocalDateTime { /** * Checks if this date - time is after the specified date - time .
* This checks to see if this date - time represents a point on the
* local time - line after the other date - time .
* < pre >
* LocalDate a = LocalDateTime . of ( 2012 , 6 , 30 , 12 , 00 ) ;
* LocalDate b = Loc... | if ( other instanceof LocalDateTime ) { return compareTo0 ( ( LocalDateTime ) other ) > 0 ; } return super . isAfter ( other ) ; |
public class L3ToSBGNPDConverter { /** * Creates a glyph representing the given PhysicalEntity .
* @ param e PhysicalEntity or Gene to represent
* @ return the created glyph */
private Glyph createGlyph ( Entity e ) { } } | String id = convertID ( e . getUri ( ) ) ; if ( glyphMap . containsKey ( id ) ) return glyphMap . get ( id ) ; // Create its glyph and register
Glyph g = createGlyphBasics ( e , true ) ; glyphMap . put ( g . getId ( ) , g ) ; // TODO : export metadata ( e . g . , from bpe . getAnnotations ( ) map ) using the SBGN Exten... |
public class LinkUtil { /** * in the case of a forwarded SSL request the resource resolver mapping rules must contain the
* false port ( 80 ) to ensure a proper resolving - but in the result this bad port is included in the
* mapped URL and must be removed - done here */
protected static String adjustMappedUrl ( Sl... | // build a pattern with the ( false ) default port
Pattern defaultPortPattern = Pattern . compile ( URL_PATTERN_STRING . replaceFirst ( "\\(:\\\\d\\+\\)\\?" , ":" + getDefaultPort ( request ) ) ) ; Matcher matcher = defaultPortPattern . matcher ( url ) ; // remove the port if the URL matches ( contains the port nnumber... |
public class SettingsPack { /** * Sets the session - global limits of download rate limit , in
* bytes per second .
* A value of 0 means unlimited .
* @ param value */
public SettingsPack downloadRateLimit ( int value ) { } } | sp . set_int ( settings_pack . int_types . download_rate_limit . swigValue ( ) , value ) ; return this ; |
public class VpcClient { /** * Modifying the special attribute to new value of the vpc owned by the user .
* @ param name The name of the vpc after modifying
* @ param vpcId the id of the vpc */
public void modifyInstanceAttributes ( String name , String vpcId ) { } } | ModifyVpcAttributesRequest request = new ModifyVpcAttributesRequest ( ) ; modifyInstanceAttributes ( request . withName ( name ) . withVpcId ( vpcId ) ) ; |
public class DateHelper { /** * Gets the current UTC date and time in ' yyyy - MM - dd ' T ' HH : mm : ss . SSS ' Z ' ' format .
* @ return Current UTC date and time . */
public static String getCurrentUTC ( ) { } } | SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" , Locale . ENGLISH ) ; sdf . setTimeZone ( TimeZone . getTimeZone ( "UTC" ) ) ; return sdf . format ( Calendar . getInstance ( ) . getTime ( ) ) ; |
public class DocumentClassifierFactory { /** * TODO call this method for default feature generation */
private static byte [ ] loadDefaultFeatureGeneratorBytes ( ) { } } | final ByteArrayOutputStream bytes = new ByteArrayOutputStream ( ) ; try ( InputStream in = DocumentClassifierFactory . class . getResourceAsStream ( "/documentClassifier/default-feature-descriptor.xml" ) ) { if ( in == null ) { throw new IllegalStateException ( "Classpath must contain default-feature-descriptor.xml fil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.