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 * terms } . * @ param term { @ link Term } , the current term to process for expansion * @ param allExpansions { @ link List } of { @ link Statement } , all statements * currently collected through term expansion * @ throws TermExpansionException Thrown if a { @ link TermExpansionRule } * encounters an error with the { @ link Term term } being expanded . */ private void expandTerm ( Term term , List < Statement > allExpansions ) { } }
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 ( innerTerm , allExpansions ) ; } }
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 . * @ return { @ literal true } if this day of the week is later in the week than the given one . */ public boolean after ( @ NotNull final DayOfTheWeek other ) { } }
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 List < E > > UnmodifiableMutableList < E > of ( L list ) { } }
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 ( list ) ) ;
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 DynamoDBTypeConverter < S , T > ( ) { @ Override public final S convert ( final T o ) { return toSource . convert ( o ) ; } @ Override public final T unconvert ( final S o ) { return toTarget . convert ( o ) ; } } ;
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 entity class * @ return the dao * @ throws java . sql . SQLException if * { @ link # getDao ( java . lang . Class , java . lang . Class ) } throws one */ @ Override public < T > Dao < T , ? > getDao ( Class < T > clz ) throws SQLException { } }
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 management kernel ; will be removed in a future release */ @ Deprecated public void validateOperation ( final ModelNode operation ) throws OperationFailedException { } }
if ( operation . hasDefined ( ModelDescriptionConstants . OPERATION_NAME ) && deprecationData != null && deprecationData . isNotificationUseful ( ) ) { ControllerLogger . DEPRECATED_LOGGER . operationDeprecated ( getName ( ) , PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) . toCLIStyleString ( ) ) ; } for ( AttributeDefinition ad : this . parameters ) { ad . validateOperation ( operation ) ; }
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 ; } } return map ;
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 default language if no localization exists for the requested language * @ return the localized name of this commerce shipping fixed option */ @ Override public String getName ( String languageId , boolean useDefault ) { } }
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 ) ; setLastInAnimationHeight ( croutonView . getMeasuredHeight ( ) ) ; } return slideInDownAnimation ;
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 ( createRelationalDatabaseSnapshotRequest . getRelationalDatabaseSnapshotName ( ) , RELATIONALDATABASESNAPSHOTNAME_BINDING ) ; protocolMarshaller . marshall ( createRelationalDatabaseSnapshotRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 . queueOrStartNonPersistentTimerAlarm won ' t // actually start the alarm . EJBModuleMetaDataImpl mmd = beanO . getHome ( ) . getBeanMetaData ( ) . _moduleMetaData ; mmd . getEJBApplicationMetaData ( ) . checkIfCreateNonPersistentTimerAllowed ( mmd ) ; ContainerTx tx = beanO . getContainerTx ( ) ; if ( tx == null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "queueOrStartNpTimer found ivContainerTx null. Calling getCurrentTx(false)" ) ; tx = beanO . getContainer ( ) . getCurrentContainerTx ( ) ; } if ( tx != null ) { // Will queue timer for global / start immediately for local transactions tx . queueTimerToStart ( timer ) ; } else { // Here for backward compatibility . Could only occur for EJB 1.1 // module with BMT bean , which the customer has re - coded to // implement TimedObject . Start the timer immediately , as this // would be a local transaction scenario in later module levels . if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Container Tx not found; starting timer immediately." ) ; timer . start ( ) ; } } catch ( Exception e ) { throw ExceptionUtil . EJBException ( e ) ; }
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 * want to override the existing values . * @ param instancesSummary * Information about the instance . * @ return Returns a reference to this object so that method calls can be chained together . */ public BatchGetDeploymentInstancesResult withInstancesSummary ( InstanceSummary ... instancesSummary ) { } }
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 * byte order in which the value is written is the same as the one in which it is read * ( such as transient storage in memory , or serialization for I / O and network ) , making this * method the preferable choice . * @ param index The position at which the value will be written . * @ param value The long value to be written . * @ throws IndexOutOfBoundsException Thrown , if the index is negative , or larger then the segment * size minus 8. */ @ SuppressWarnings ( "restriction" ) public final void putLong ( int index , long value ) { } }
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 channel was disabled * @ throws ChannelException * @ throws ChainException */ private boolean disableChannelInChain ( Channel targetChannel , Chain chain ) throws ChannelException , ChainException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "disableChannelInChain" ) ; } String channelName = targetChannel . getName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "channelName=" + channelName + " chainName=" + chain . getName ( ) ) ; } ChannelContainer channelContainer = channelRunningMap . get ( channelName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found channel, state: " + channelContainer . getState ( ) . ordinal ) ; } Channel channel = channelContainer . getChannel ( ) ; RuntimeState chainState = null ; boolean stillInUse = false ; for ( Chain channelChain : channelContainer . getChainMap ( ) . values ( ) ) { chainState = channelChain . getState ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found chain reference: " + channelChain . getName ( ) + ", state: " + chainState . ordinal ) ; } if ( channelChain . getName ( ) . equals ( chain . getName ( ) ) ) { // Don ' t analyze this channel . It is either in STARTED or QUIESCED // state . continue ; } else if ( ( RuntimeState . STARTED == chainState ) || ( RuntimeState . QUIESCED == chainState ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found chain that is not ready to stop, " + channelChain . getName ( ) ) ; } stillInUse = true ; break ; } } // Check to ensure that no other chains will be broken . if ( ! stillInUse ) { // Disable the channel from handling any more connections in the chain . if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Disabling channel, " + channelName ) ; } ( ( InboundChain ) chain ) . disableChannel ( channel ) ; } else if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Skip channel stop, in use by other chain(s)" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "disableChannelInChain" ) ; } return ! stillInUse ;
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 . * @ param variableName * @ return The resolved value or null if the variable doesn ' t exist */ public String lookupVariable ( String variableName ) { } }
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 ( beanIdOrClass , aspectRule ) ; } }
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 delegation target . * This method instantiates the class ( if not done so already for this request ) , * and return it . */ public Object taglib ( Class type ) throws IllegalAccessException , InstantiationException , IOException , SAXException { } }
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 configure ( TextBoxBase target , String defaultText ) { } }
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 , constructorBindings ) ;
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 , ( ClassNode ) nodes [ 1 ] ) ; } else { if ( ( ( ( FieldNode ) nodes [ 1 ] ) . getModifiers ( ) & Opcodes . ACC_FINAL ) != 0 ) { source . getErrorCollector ( ) . addErrorAndContinue ( new SyntaxErrorMessage ( new SyntaxException ( "@groovy.beans.Vetoable cannot annotate a final property." , node . getLineNumber ( ) , node . getColumnNumber ( ) , node . getLastLineNumber ( ) , node . getLastColumnNumber ( ) ) , source ) ) ; } addListenerToProperty ( source , node , ( AnnotatedNode ) nodes [ 1 ] ) ; }
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 > < / li > * < li > < tt > - . _ ~ < / tt > < / li > * < li > < tt > ! $ & amp ; ' ( ) * + , ; = < / tt > < / li > * < li > < tt > : @ < / tt > < / li > * < li > < tt > / < / tt > < / li > * < / ul > * All other chars will be escaped by converting them to the sequence of bytes that * represents them in the specified < em > encoding < / em > and then representing each byte * in < tt > % HH < / tt > syntax , being < tt > HH < / tt > the hexadecimal representation of the byte . * This method is < strong > thread - safe < / strong > . * @ param text the < tt > String < / tt > to be escaped . * @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ param encoding the encoding to be used for escaping . * @ throws IOException if an input / output exception occurs * @ since 1.1.2 */ public static void escapeUriPath ( final String text , final Writer writer , final String encoding ) throws IOException { } }
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 , encoding ) ;
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 ) ) { return new EnumeratedConstant ( m_xsdpackageName , className , fieldName ) ; } return null ;
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 entity was not found . * @ throws IllegalArgumentException - descriptor is null . * @ throws TimeoutException - The operation times out . The timeout period is initiated through ClientSettings . operationTimeout * @ throws AuthorizationFailedException - No sufficient permission to perform this operation . Please check ClientSettings . tokenProvider has correct details . * @ throws ServerBusyException - The server is busy . You should wait before you retry the operation . * @ throws ServiceBusException - An internal error or an unexpected exception occurred . * @ throws QuotaExceededException - Either the specified size in the description is not supported or the maximum allowed quota has been reached . * @ throws InterruptedException if the current thread was interrupted */ public TopicDescription updateTopic ( TopicDescription topicDescription ) throws ServiceBusException , InterruptedException { } }
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 objectId , final Acl acl , final AclPropagation aclPropagation ) { } }
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 , false ) ; } tx . success ( ) ; // return the wrapper which implements the Acl interface return CMISObjectWrapper . wrap ( node , null , false ) ; } } catch ( FrameworkException fex ) { logger . warn ( "" , fex ) ; } throw new CmisObjectNotFoundException ( "Object with ID " + objectId + " does not exist" ) ;
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 * ( corresponding to class descriptor { @ code classDesc } ) defines * private instance method { @ code readObject } it will be used to load * field values . * @ param object * Instance into which stored field values loaded . * @ param classDesc * A class descriptor ( an { @ code ObjectStreamClass } ) * defining which fields should be loaded . * @ throws IOException * If an IO exception happened when reading the field values in * the hierarchy . * @ throws ClassNotFoundException * If a class for one of the field types could not be found * @ throws NotActiveException * If { @ code defaultReadObject } is called from the wrong * context . * @ see # defaultReadObject * @ see # readObject ( ) */ private void readHierarchy ( Object object , ObjectStreamClass classDesc ) throws IOException , ClassNotFoundException , NotActiveException { } }
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 < ? > > superclasses = cachedSuperclasses . get ( object . getClass ( ) ) ; if ( superclasses == null ) { superclasses = cacheSuperclassesFor ( object . getClass ( ) ) ; } int lastIndex = 0 ; for ( int i = 0 , end = superclasses . size ( ) ; i < end ; ++ i ) { Class < ? > superclass = superclasses . get ( i ) ; int index = findStreamSuperclass ( superclass , streamClassList , lastIndex ) ; if ( index == - 1 ) { readObjectNoData ( object , superclass , ObjectStreamClass . lookupStreamClass ( superclass ) ) ; } else { for ( int j = lastIndex ; j <= index ; j ++ ) { readObjectForClass ( object , streamClassList . get ( j ) ) ; } lastIndex = index + 1 ; } } }
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 ( "Can not unsubscribe!" , e ) ; } } } ; } else { return new Subscription ( ) { @ Override public void unsubscribe ( ) { } } ; } } catch ( Exception e ) { throw new RuntimeException ( "Can not register MBean!" , e ) ; }
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 the new entry . */ public void addEntry ( Entry newEntry , long currentTime ) { } }
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 . addParameter ( ParameterSpec . builder ( TypeUtility . arrayTypeName ( String . class ) , "selectionArgs" ) . build ( ) ) ; boolean hasOperation = hasOperationOfType ( schema , methodBuilder , JQLType . DELETE ) ; if ( ! hasOperation ) { methodBuilder . addStatement ( "throw new $T(\"Unknown URI for $L operation: \" + uri)" , IllegalArgumentException . class , JQLType . DELETE ) ; classBuilder . addMethod ( methodBuilder . build ( ) ) ; return ; } methodBuilder . addStatement ( "int returnRowDeleted=-1" ) ; methodBuilder . beginControlFlow ( "switch (sURIMatcher.match(uri))" ) ; defineJavadocHeaderForContentOperation ( methodBuilder , "delete" ) ; for ( Entry < String , ContentEntry > item : uriSet . entrySet ( ) ) { if ( item . getValue ( ) . delete == null ) continue ; defineJavadocForContentUri ( methodBuilder , item . getValue ( ) . delete ) ; // methodBuilder . addJavadoc ( " uri $ L \ n " , item . getKey ( ) ) ; methodBuilder . beginControlFlow ( "case $L:" , item . getValue ( ) . pathIndex ) ; methodBuilder . addCode ( "// URI: $L\n" , item . getValue ( ) . delete . contentProviderUri ( ) ) ; methodBuilder . addStatement ( "returnRowDeleted=dataSource.get$L().$L(uri, selection, selectionArgs)" , item . getValue ( ) . delete . getParent ( ) . getName ( ) , item . getValue ( ) . delete . contentProviderMethodName ) ; methodBuilder . addStatement ( "break" ) ; methodBuilder . endControlFlow ( ) ; } defineJavadocFooterForContentOperation ( methodBuilder ) ; methodBuilder . beginControlFlow ( "default:" ) ; methodBuilder . addStatement ( "throw new $T(\"Unknown URI for $L operation: \" + uri)" , IllegalArgumentException . class , JQLType . DELETE ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . endControlFlow ( ) ; if ( hasOperation ) { if ( schema . generateLog ) { // generate log section - BEGIN methodBuilder . addComment ( "log section for content provider delete BEGIN" ) ; methodBuilder . beginControlFlow ( "if (dataSource.isLogEnabled())" ) ; methodBuilder . addStatement ( "$T.info(\"Changes are notified for URI %s\", uri)" , Logger . class ) ; // generate log section - END methodBuilder . endControlFlow ( ) ; methodBuilder . addComment ( "log section for content provider delete END" ) ; } methodBuilder . addStatement ( "getContext().getContentResolver().notifyChange(uri, null)" ) ; } methodBuilder . addCode ( "return returnRowDeleted;\n" ) ; classBuilder . addMethod ( methodBuilder . build ( ) ) ;
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 ( sourceNewReplicaIndex < 0 ) { clearPartitionReplicaVersions ( partitionId ) ; if ( logger . isFinestEnabled ( ) ) { logger . finest ( "Replica versions are cleared in source after migration. partitionId=" + partitionId ) ; } } else if ( migrationInfo . getSourceCurrentReplicaIndex ( ) != sourceNewReplicaIndex && sourceNewReplicaIndex > 1 ) { for ( ServiceNamespace namespace : replicaManager . getNamespaces ( partitionId ) ) { long [ ] versions = updatePartitionReplicaVersions ( replicaManager , partitionId , namespace , sourceNewReplicaIndex - 1 ) ; if ( logger . isFinestEnabled ( ) ) { logger . finest ( "Replica versions are set after SHIFT DOWN migration. partitionId=" + partitionId + " namespace: " + namespace + " replica versions=" + Arrays . toString ( versions ) ) ; } } }
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 . startsWith ( "A" ) ) { return "G" ; // adjective } else if ( postag . startsWith ( "NC" ) ) { return "N" ; // common noun } else if ( postag . startsWith ( "NP" ) ) { return "R" ; // proper noun } else if ( postag . startsWith ( "SP" ) ) { return "P" ; // preposition } else if ( postag . startsWith ( "P" ) ) { return "Q" ; // pronoun } else if ( postag . startsWith ( "V" ) ) { return "V" ; // verb } else { return "O" ; // other }
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 FessMessages addConstraintsTypeDoubleMessage ( String property ) { } }
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 = study . getItemCount ( ) ; int n = study . getRaterCount ( ) ; int sum_nij = 0 ; int sum_nij_2 = 0 ; for ( ICodingAnnotationItem item : study . getItems ( ) ) { int nij = 0 ; for ( IAnnotationUnit unit : item . getUnits ( ) ) if ( unit . getCategory ( ) . equals ( category ) ) nij ++ ; sum_nij += nij ; sum_nij_2 += ( nij * nij ) ; } double pj = 1 / ( double ) ( N * n ) * sum_nij ; double Pj = ( sum_nij_2 - N * n * pj ) / ( double ) ( N * n * ( n - 1 ) * pj ) ; double kappaj = ( Pj - pj ) / ( double ) ( 1 - pj ) ; return kappaj ;
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 . setImage ( t . image ) ; } finally { if ( jjtc000 ) { jjtree . closeNodeScope ( jjtn000 , true ) ; } }
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 ( mongoDeepJobConfig . getUsername ( ) != null && mongoDeepJobConfig . getPassword ( ) != null ) { MongoCredential credential = MongoCredential . createMongoCRCredential ( mongoDeepJobConfig . getUsername ( ) , mongoDeepJobConfig . getDatabase ( ) , mongoDeepJobConfig . getPassword ( ) . toCharArray ( ) ) ; mongoCredentials . add ( credential ) ; } mongoClient = new MongoClient ( addressList , mongoCredentials ) ; mongoClient . setReadPreference ( ReadPreference . valueOf ( mongoDeepJobConfig . getReadPreference ( ) ) ) ; db = mongoClient . getDB ( mongoDeepJobConfig . getDatabase ( ) ) ; collection = db . getCollection ( mongoDeepJobConfig . getCollection ( ) ) ; dbCursor = collection . find ( generateFilterQuery ( ( MongoPartition ) partition ) , mongoDeepJobConfig . getDBFields ( ) ) ; } catch ( UnknownHostException e ) { throw new DeepExtractorInitializationException ( e ) ; }
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 with a group of tasks */ public Object registerTaskGroup ( int numTasks ) { } }
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 ) ; } return body ;
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 poolSize , Double forecast ) { } }
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 or outside believable range if ( pruneData ( largestPoolSizeStats , forecast ) ) { threadStats . remove ( largestPoolSize ) ; } else { validLargeData = true ; } } return largestPoolSize ;
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 executeListMultiActions ( ) throws CmsRuntimeException { } }
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 call params . put ( CmsDialog . PARAM_ACTION , new String [ ] { CmsDialog . DIALOG_INITIAL } ) ; try { getToolManager ( ) . jspForwardTool ( this , getCurrentToolPath ( ) + "/delete" , params ) ; } catch ( Exception e ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_DELETE_SELECTED_GROUPS_0 ) , e ) ; } } else if ( getParamListAction ( ) . equals ( LIST_MACTION_ACTIVATE ) ) { // execute the activate multiaction try { Iterator < CmsListItem > itItems = getSelectedItems ( ) . iterator ( ) ; while ( itItems . hasNext ( ) ) { CmsListItem listItem = itItems . next ( ) ; String groupName = listItem . get ( LIST_COLUMN_NAME ) . toString ( ) ; CmsGroup group = getCms ( ) . readGroup ( groupName ) ; if ( ! group . isEnabled ( ) ) { group . setEnabled ( true ) ; getCms ( ) . writeGroup ( group ) ; } } } catch ( CmsException e ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_ACTIVATE_SELECTED_GROUPS_0 ) , e ) ; } // refreshing no needed becaus the activate action does not add / remove rows to the list } else if ( getParamListAction ( ) . equals ( LIST_MACTION_DEACTIVATE ) ) { // execute the activate multiaction try { Iterator < CmsListItem > itItems = getSelectedItems ( ) . iterator ( ) ; while ( itItems . hasNext ( ) ) { CmsListItem listItem = itItems . next ( ) ; String groupName = listItem . get ( LIST_COLUMN_NAME ) . toString ( ) ; CmsGroup group = getCms ( ) . readGroup ( groupName ) ; if ( group . isEnabled ( ) ) { group . setEnabled ( false ) ; getCms ( ) . writeGroup ( group ) ; } } } catch ( CmsException e ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_DEACTIVATE_SELECTED_GROUPS_0 ) , e ) ; } // refreshing no needed becaus the activate action does not add / remove rows to the list } else { throwListUnsupportedActionException ( ) ; } listSave ( ) ;
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 < ListAccountAliasesResult > listAccountAliasesAsync ( com . amazonaws . handlers . AsyncHandler < ListAccountAliasesRequest , ListAccountAliasesResult > asyncHandler ) { } }
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 random { @ code IntegerChromosome } * @ throws IllegalArgumentException if the length is smaller than one */ public static IntegerChromosome of ( final int min , final int max , final int length ) { } }
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 value for the parameter for resources { @ link # PARAM _ RESOURCELIST } . < p > * @ return the value of the resourcelist parameter or null , if the parameter is not provided */ public String getResourceListAsParam ( ) { } }
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 [ ] outputbases , List < RenderedFormat > formats ) throws TesseractException { } }
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 multi - page TIFF imageFile = ImageIOHelper . getImageFile ( inputFile ) ; TessResultRenderer renderer = createRenderers ( outputbases [ i ] , formats ) ; createDocuments ( imageFile . getPath ( ) , renderer ) ; api . TessDeleteResultRenderer ( renderer ) ; } catch ( Exception e ) { // skip the problematic image file logger . warn ( e . getMessage ( ) , e ) ; } finally { // delete temporary TIFF image for PDF if ( imageFile != null && imageFile . exists ( ) && imageFile != inputFile && imageFile . getName ( ) . startsWith ( "multipage" ) && imageFile . getName ( ) . endsWith ( ImageIOHelper . TIFF_EXT ) ) { imageFile . delete ( ) ; } } } } finally { dispose ( ) ; }
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 sufficiently old , update cpuUsage . // Also take a sample of the current time and cumulative CPU time for the // use of the next calculation . final long MINIMUM_UPDATE_INTERVAL = 10 * jiffyLengthInMillis ; if ( sampleTime > lastSampleTime + MINIMUM_UPDATE_INTERVAL ) { cpuUsage = ( float ) ( cumulativeCpuTime - lastCumulativeCpuTime ) * 100F / ( ( float ) ( sampleTime - lastSampleTime ) * getNumProcessors ( ) ) ; lastSampleTime = sampleTime ; lastCumulativeCpuTime = cumulativeCpuTime ; } return cpuUsage ;
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 ( ) > 0 ) { trs . remove ( 0 ) ; trs . forEach ( tr -> { Fight fight = new Fight ( ) ; fight . setFighter1 ( sFighter ) ; Elements tds = tr . select ( "td" ) ; fight . setResult ( getFightResult ( tds . get ( COLUMN_RESULT ) ) ) ; fight . setFighter2 ( getOpponent ( tds . get ( COLUMN_OPPONENT ) ) ) ; fight . setEvent ( getEvent ( tds . get ( COLUMN_EVENT ) ) ) ; fight . setDate ( getDate ( tds . get ( COLUMN_EVENT ) ) ) ; fight . setWinMethod ( getWinMethod ( tds . get ( COLUMN_METHOD ) ) ) ; fight . setWinRound ( getWinRound ( tds . get ( COLUMN_ROUND ) ) ) ; fight . setWinTime ( getWinTime ( tds . get ( COLUMN_TIME ) ) ) ; fights . add ( fight ) ; logger . info ( "{}" , fight ) ; } ) ; } return fights ;
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 pathParams , HttpRequest request , HttpResponse response ) throws HttpException , IOException { } }
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 TechnicalException e ) { logger . error ( "error DriverFactory.getDriver()" , e ) ; } } else { driver = drivers . get ( driverName ) ; } return driver ;
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 ( pruneAfterCopying ) { serializer . prune ( ) ; }
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 used to sign into the local web UI of the device . The Actual password should have at least 8 characters that are a combination of uppercase , lowercase , numeric , and special characters . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Void > beginCreateOrUpdateSecuritySettingsAsync ( String deviceName , String resourceGroupName , AsymmetricEncryptedSecret deviceAdminPassword , final ServiceCallback < Void > serviceCallback ) { } }
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 the string to encode * @ return the encoded form of the unencoded string */ public static String encode ( String unencoded ) { } }
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 the query . Since constraints are conceptually modeled on bonds * the result is a list of list of IBond . You should coerce these to the appropriate pharmacophore * bond to get at the underlying grops . * @ return a List of a List of pharmacophore constraints in the target molecule that match the query * @ see org . openscience . cdk . pharmacophore . PharmacophoreBond * @ see org . openscience . cdk . pharmacophore . PharmacophoreAngleBond */ public List < List < IBond > > getMatchingPharmacophoreBonds ( ) { } }
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 ) ; exampleUtils . setup ( ) ; Pipeline pipeline = Pipeline . create ( options ) ; String tableSpec = new StringBuilder ( ) . append ( options . getProject ( ) ) . append ( ":" ) . append ( options . getBigQueryDataset ( ) ) . append ( "." ) . append ( options . getBigQueryTable ( ) ) . toString ( ) ; pipeline . apply ( "ReadLines" , TextIO . read ( ) . from ( options . getInputFile ( ) ) ) . apply ( ParDo . of ( new ExtractWords ( ) ) ) . apply ( ParDo . of ( new Uppercase ( ) ) ) . apply ( ParDo . of ( new StringToRowConverter ( ) ) ) . apply ( BigQueryIO . writeTableRows ( ) . to ( tableSpec ) . withSchema ( StringToRowConverter . getSchema ( ) ) ) ; PipelineResult result = pipeline . run ( ) ; // ExampleUtils will try to cancel the pipeline before the program exists . exampleUtils . waitToFinish ( result ) ;
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 ( c ) . toLowerCase ( ) ) ; } else { sb . append ( c ) ; } } return sb . toString ( ) ;
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 parent , int child ) { } }
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 parameter to get next 50 results [ Mandatory ] * @ options data { Integer } page _ limit : This should be a valid number between 1-50 [ Mandatory ] */ public String get_processes ( Object data ) { } }
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 '{}'" , Arrays . toString ( reportsKey ) ) ; LOG . info ( "Coverage BaseDir '{}' " , context . fileSystem ( ) . baseDir ( ) ) ; if ( context . config ( ) . hasKey ( getReportPathKey ( ) ) ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Parsing unit test coverage reports" ) ; } List < File > reports = getReports ( context . config ( ) , context . fileSystem ( ) . baseDir ( ) , getReportPathKey ( ) ) ; Map < String , CoverageMeasures > coverageMeasures = processReports ( reports , this . cache . unitCoverageCache ( ) ) ; saveMeasures ( context , coverageMeasures ) ; }
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 ( dvalue ) ) ;
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 . set ( "requestTimeout_day" , Caster . toInteger ( config . getRequestTimeout ( ) . getDay ( ) ) ) ; sct . set ( "requestTimeout_hour" , Caster . toInteger ( config . getRequestTimeout ( ) . getHour ( ) ) ) ; sct . set ( "requestTimeout_minute" , Caster . toInteger ( config . getRequestTimeout ( ) . getMinute ( ) ) ) ; sct . set ( "requestTimeout_second" , Caster . toInteger ( config . getRequestTimeout ( ) . getSecond ( ) ) ) ; // AllowURLRequestTimeout sct . set ( "AllowURLRequestTimeout" , Caster . toBoolean ( config . isAllowURLRequestTimeout ( ) ) ) ;
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 , this is run on a * default non - ui executor * @ param callback a { @ link TokenCallback } to receive the result or error message */ public void createCvcUpdateToken ( @ NonNull @ Size ( min = 3 , max = 4 ) final String cvc , @ NonNull @ Size ( min = 1 ) final String publishableKey , @ Nullable final Executor executor , @ NonNull final TokenCallback callback ) { } }
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 ) Throwable exception = ( Throwable ) record . content ; lines . add ( record . content . toString ( ) ) ; trace = exception . getStackTrace ( ) ; topTraceElement = trace . length > 0 ? trace [ 0 ] : null ; for ( StackTraceElement e : exception . getStackTrace ( ) ) { lines . add ( tab + e . toString ( ) ) ; } // ( causes ) while ( exception . getCause ( ) != null ) { System . out . println ( "TOP ELEMENT: " + topTraceElement ) ; // ( ( variables ) ) exception = exception . getCause ( ) ; trace = exception . getStackTrace ( ) ; lines . add ( "Caused by: " + exception . getClass ( ) + ": " + exception . getMessage ( ) ) ; for ( int i = 0 ; i < trace . length ; i ++ ) { // ( ( add trace element ) ) StackTraceElement e = trace [ i ] ; lines . add ( tab + e . toString ( ) ) ; // ( ( don ' t print redundant elements ) ) if ( topTraceElement != null && e . getClassName ( ) . equals ( topTraceElement . getClassName ( ) ) && e . getMethodName ( ) . equals ( topTraceElement . getMethodName ( ) ) ) { lines . add ( tab + "..." + ( trace . length - i - 1 ) + " more" ) ; break ; } } // ( ( update top element ) ) topTraceElement = trace . length > 0 ? trace [ 0 ] : null ; } // ( set content array ) content = new String [ lines . size ( ) ] ; content = lines . toArray ( content ) ; } else if ( record . content == null ) { content = new String [ ] { "null" } ; } else { content = record . content . toString ( ) . split ( "\n" ) ; // would be nice to get rid of this ' split ( ) ' call at some point } // - - Handle Tracks updateTracks ( record . depth ) ; if ( this . missingOpenBracket ) { this . style ( b , "{\n" , trackColor , trackStyle ) ; this . missingOpenBracket = false ; } // - - Process Record // ( variables ) int cursorPos = 0 ; int contentLinesPrinted = 0 ; // ( loop ) Color color = Color . NONE ; Style style = Style . NONE ; // ( get channels ) ArrayList < Object > printableChannels = new ArrayList < Object > ( ) ; for ( Object chan : record . channels ( ) ) { if ( chan instanceof Color ) { color = ( Color ) chan ; } else if ( chan instanceof Style ) { style = ( Style ) chan ; } else if ( chan != Redwood . FORCE ) { printableChannels . add ( chan ) ; } } // - - Write Channels if ( leftMargin > 2 ) { // don ' t print if not enough space // ( ( print channels ) if ( printableChannels . size ( ) > 0 ) { b . append ( "[" ) ; cursorPos += 1 ; } Object lastChan = null ; for ( int i = 0 ; i < printableChannels . size ( ) ; i ++ ) { Object chan = printableChannels . get ( i ) ; if ( chan . equals ( lastChan ) ) { continue ; } // skip duplicate channels lastChan = chan ; // ( get chan ) String chanToString = chan . toString ( ) ; String toPrint = chan . toString ( ) ; if ( toPrint . length ( ) > leftMargin - 1 ) { toPrint = toPrint . substring ( 0 , leftMargin - 2 ) ; } if ( cursorPos + toPrint . length ( ) >= leftMargin ) { // ( case : doesn ' t fit ) while ( cursorPos < leftMargin ) { b . append ( " " ) ; cursorPos += 1 ; } if ( contentLinesPrinted < content . length ) { writeContent ( record . depth , style ( new StringBuilder ( ) , content [ contentLinesPrinted ] , color , style ) . toString ( ) , b ) ; contentLinesPrinted += 1 ; } b . append ( "\n " ) ; cursorPos = 1 ; } // ( print flag ) formatChannel ( b , toPrint , chanToString ) ; if ( i < printableChannels . size ( ) - 1 ) { b . append ( channelSeparatorChar ) ; cursorPos += 1 ; } cursorPos += toPrint . length ( ) ; } if ( printableChannels . size ( ) > 0 ) { b . append ( "]" ) ; cursorPos += 1 ; } } // - - Content // ( write content ) while ( contentLinesPrinted < content . length ) { while ( cursorPos < leftMargin ) { b . append ( " " ) ; cursorPos += 1 ; } writeContent ( record . depth , style ( new StringBuilder ( ) , content [ contentLinesPrinted ] , color , style ) . toString ( ) , b ) ; contentLinesPrinted += 1 ; if ( contentLinesPrinted < content . length ) { b . append ( "\n" ) ; cursorPos = 0 ; } } // ( print ) if ( b . length ( ) == 0 || b . charAt ( b . length ( ) - 1 ) != '\n' ) { b . append ( "\n" ) ; } print ( b . toString ( ) ) ; // - - Continue if ( info != null ) { info . numElementsPrinted += 1 ; } ArrayList < Record > rtn = new ArrayList < Record > ( ) ; rtn . add ( record ) ; return rtn ;
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 after the move * @ return Utility to update OpenCryptoFile references . * @ throws FileAlreadyExistsException Thrown if the destination file is an existing file that is currently opened . */ public TwoPhaseMove prepareMove ( Path src , Path dst ) throws FileAlreadyExistsException { } }
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 resource is not found * @ throws IOException * if an IO exception occurs */ private void handleGeneratedCssInDebugMode ( String requestedPath , HttpServletRequest request , HttpServletResponse response , BinaryResourcesHandler binaryRsHandler ) throws ResourceNotFoundException , IOException { } }
// 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 String result = CssDebugUrlRewriter . rewriteGeneratedBinaryResourceDebugUrl ( requestPath , content , binaryRsHandler . getConfig ( ) . getServletMapping ( ) ) ; Writer out = response . getWriter ( ) ; out . write ( result ) ;
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 , partitions , ( short ) 1 ) ) . collect ( Collectors . toList ( ) ) ; CreateTopicsResult createTopics = admin . createTopics ( newTopics ) ; try { createTopics . all ( ) . get ( ) ; } catch ( Exception e ) { log . warn ( "Failed to create Kafka topics" , e ) ; } }
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 ( SystemStoreClient < String , String > versionStore , Properties props ) { } }
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 properties : " , e ) ; }
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 JspException when the { @ link DataGridTagModel } can not be found in the { @ link JspContext } */ public void doTag ( ) throws IOException , JspException { } }
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 fragment = getJspBody ( ) ; if ( fragment != null ) { String captionScript = null ; if ( _captionTag . id != null ) { HttpServletRequest request = JspUtil . getRequest ( getJspContext ( ) ) ; captionScript = renderNameAndId ( request , _captionTag , null ) ; } StringWriter sw = new StringWriter ( ) ; TableRenderer tableRenderer = dgm . getTableRenderer ( ) ; StyleModel stylePolicy = dgm . getStyleModel ( ) ; AbstractRenderAppender appender = new WriteRenderAppender ( jspContext ) ; if ( _captionTag . styleClass == null ) _captionTag . styleClass = stylePolicy . getCaptionClass ( ) ; tableRenderer . openCaption ( _captionTag , appender ) ; fragment . invoke ( sw ) ; appender . append ( sw . toString ( ) ) ; tableRenderer . closeCaption ( appender ) ; if ( captionScript != null ) appender . append ( captionScript ) ; } }
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 = LocalDateTime . of ( 2012 , 7 , 1 , 12 , 00 ) ; * a . isAfter ( b ) = = false * a . isAfter ( a ) = = false * b . isAfter ( a ) = = true * < / pre > * This method only considers the position of the two date - times on the local time - line . * It does not take into account the chronology , or calendar system . * This is different from the comparison in { @ link # compareTo ( ChronoLocalDateTime ) } , * but is the same approach as { @ link # DATE _ TIME _ COMPARATOR } . * @ param other the other date - time to compare to , not null * @ return true if this date - time is after the specified date - time */ @ Override // override for Javadoc and performance public boolean isAfter ( ChronoLocalDateTime < ? > other ) { } }
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 Extension feature // SBGNBase . Extension ext = new SBGNBase . Extension ( ) ; // g . setExtension ( ext ) ; // Element el = biopaxMetaDoc . createElement ( e . getModelInterface ( ) . getSimpleName ( ) ) ; // el . setAttribute ( " uri " , e . getUri ( ) ) ; // ext . getAny ( ) . add ( el ) ; if ( g . getClone ( ) != null ) ubiqueSet . add ( g ) ; if ( e instanceof PhysicalEntity ) { PhysicalEntity pe = ( PhysicalEntity ) e ; assignLocation ( pe , g ) ; if ( "or" . equalsIgnoreCase ( g . getClazz ( ) ) ) { buildGeneric ( pe , g , null ) ; } else if ( pe instanceof Complex ) { createComplexContent ( ( Complex ) pe , g ) ; } } return g ;
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 ( SlingHttpServletRequest request , String url ) { } }
// 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 ) if ( matcher . matches ( ) ) { if ( null == matcher . group ( 1 ) ) url = "//" + matcher . group ( 2 ) ; else url = matcher . group ( 1 ) + "://" + matcher . group ( 2 ) ; String uri = matcher . group ( 3 ) ; if ( StringUtils . isNotBlank ( uri ) ) { url += uri ; } else { url += "/" ; } } return url ;
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 file!" ) ; } final byte buf [ ] = new byte [ 1024 ] ; int len ; while ( ( len = in . read ( buf ) ) > 0 ) { bytes . write ( buf , 0 , len ) ; } } catch ( final IOException e ) { throw new IllegalStateException ( "Failed reading from default-feature-descriptor.xml file on classpath!" ) ; } return bytes . toByteArray ( ) ;