signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Strings { /** * Make a minimal printable string from a double value . This method does
* not necessary generate a string that when parsed generates the identical
* number as given in . But ut should consistently generate the same string
* ( locale independent ) for the same number with reasonable acc... | long l = ( long ) d ; if ( d > ( ( 10 << 9 ) - 1 ) || ( 1 / d ) > ( 10 << 6 ) ) { // Scientific notation should be used .
return SCIENTIFIC_FORMATTER . format ( d ) ; } else if ( d == ( double ) l ) { // actually an integer or long value .
return Long . toString ( l ) ; } else { return DOUBLE_FORMATTER . format ( d ) ;... |
public class PatternStream { /** * Applies a flat select function to the detected pattern sequence . For each pattern sequence
* the provided { @ link PatternFlatSelectFunction } is called . The pattern flat select function
* can produce an arbitrary number of resulting elements .
* @ param patternFlatSelectFunct... | final PatternProcessFunction < T , R > processFunction = fromFlatSelect ( builder . clean ( patternFlatSelectFunction ) ) . build ( ) ; return process ( processFunction , outTypeInfo ) ; |
public class UsersApi { /** * Get the logged in user .
* Get the [ CfgPerson ] ( https : / / docs . genesys . com / Documentation / PSDK / latest / ConfigLayerRef / CfgPerson ) object for the currently logged in user .
* @ return the current User .
* @ throws ProvisioningApiException if the call is unsuccessful .... | try { GetUsersSuccessResponse resp = usersApi . getCurrentUser ( ) ; if ( ! resp . getStatus ( ) . getCode ( ) . equals ( 0 ) ) { throw new ProvisioningApiException ( "Error getting current user. Code: " + resp . getStatus ( ) . getCode ( ) ) ; } return new User ( ( Map < String , Object > ) resp . getData ( ) . getUse... |
public class DefaultFilenameTabCompleter { /** * The only supported syntax at command execution is fully quoted , e . g . :
* " / My Files \ . . . " or not quoted at all . Completion supports only these 2
* syntaxes . */
@ Override void completeCandidates ( CommandContext ctx , String buffer , int cursor , List < S... | boolean quoted = buffer . startsWith ( "\"" ) ; if ( candidates . size ( ) == 1 ) { // Escaping must occur in all cases .
// if quoted , only " will be escaped .
EscapeSelector escSelector = quoted ? QUOTES_ONLY_ESCAPE_SELECTOR : ESCAPE_SELECTOR ; candidates . set ( 0 , Util . escapeString ( candidates . get ( 0 ) , es... |
public class ServerPrepareResult { /** * Asked if can be deallocate ( is not shared in other statement and not in cache ) Set deallocate
* flag to true if so .
* @ return true if can be deallocate */
public synchronized boolean canBeDeallocate ( ) { } } | if ( shareCounter > 0 || isBeingDeallocate ) { return false ; } if ( ! inCache . get ( ) ) { isBeingDeallocate = true ; return true ; } return false ; |
public class SystemInputDefBuilder { /** * Adds system functions . */
public SystemInputDefBuilder functions ( Stream < FunctionInputDef > functions ) { } } | functions . forEach ( function -> systemInputDef_ . addFunctionInputDef ( function ) ) ; return this ; |
public class ListKeyPhrasesDetectionJobsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListKeyPhrasesDetectionJobsRequest listKeyPhrasesDetectionJobsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listKeyPhrasesDetectionJobsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listKeyPhrasesDetectionJobsRequest . getFilter ( ) , FILTER_BINDING ) ; protocolMarshaller . marshall ( listKeyPhrasesDetectionJobsRequest . getNextTo... |
public class ReflectionUtils { /** * Get the unique set of declared methods on the leaf class and all superclasses . Leaf
* class methods are included first and while traversing the superclass hierarchy any methods found
* with signatures matching a method already included are filtered out . */
public static Method... | final List < Method > methods = new ArrayList < Method > ( 32 ) ; doWithMethods ( leafClass , new MethodCallback ( ) { @ Override public void doWith ( Method method ) { boolean knownSignature = false ; Method methodBeingOverriddenWithCovariantReturnType = null ; for ( Method existingMethod : methods ) { if ( method . g... |
public class MBeanAccessConnectionFactoryUtil { /** * Supports the following formats :
* < ul >
* < li > Full JMX url starting with " service : " ( e . g . service : jmx : rmi : / / / jndi / rmi : / / localhost : 1099 / jmxrmi ) < / li >
* < li > JVM ID starting with " jvmId = " or " pid = " < / li >
* < li > J... | MBeanAccessConnectionFactorySupplier factorySupplier ; MBeanAccessConnectionFactory result ; factorySupplier = this . findSupplier ( location ) ; if ( factorySupplier != null ) { result = factorySupplier . createFactory ( location ) ; } else { throw new Exception ( "invalid location: " + location ) ; } return result ; |
public class HydrogenPlacer { /** * Place hydrogens connected to the given atom using the average bond length
* in the container .
* @ param container atom container of which < i > atom < / i > is a member
* @ param atom the atom of which to place connected hydrogens
* @ throws IllegalArgumentException if the <... | double bondLength = GeometryUtil . getBondLengthAverage ( container ) ; placeHydrogens2D ( container , atom , bondLength ) ; |
public class ParaClient { /** * Retrieves an object from the data store .
* @ param < P > the type of object
* @ param id the id of the object
* @ return the retrieved object or null if not found */
public < P extends ParaObject > P read ( String id ) { } } | if ( StringUtils . isBlank ( id ) ) { return null ; } Map < String , Object > data = getEntity ( invokeGet ( "_id/" . concat ( id ) , null ) , Map . class ) ; return ParaObjectUtils . setAnnotatedFields ( data ) ; |
public class BatchGetDeploymentGroupsResult { /** * Information about the deployment groups .
* @ return Information about the deployment groups . */
public java . util . List < DeploymentGroupInfo > getDeploymentGroupsInfo ( ) { } } | if ( deploymentGroupsInfo == null ) { deploymentGroupsInfo = new com . amazonaws . internal . SdkInternalList < DeploymentGroupInfo > ( ) ; } return deploymentGroupsInfo ; |
public class JMatrix { /** * Symmetric Householder reduction to tridiagonal form . */
private static void tred ( DenseMatrix V , double [ ] d , double [ ] e ) { } } | int n = V . nrows ( ) ; for ( int i = 0 ; i < n ; i ++ ) { d [ i ] = V . get ( n - 1 , i ) ; } // Householder reduction to tridiagonal form .
for ( int i = n - 1 ; i > 0 ; i -- ) { // Scale to avoid under / overflow .
double scale = 0.0 ; double h = 0.0 ; for ( int k = 0 ; k < i ; k ++ ) { scale = scale + Math . abs ( ... |
public class Expression { /** * Compiles the expression .
* @ param exp
* @ return */
public static Expression compile ( String exp ) { } } | if ( Miscellaneous . isEmpty ( exp ) || exp . equals ( "." ) ) { exp = "$" ; } Queue < String > queue = new LinkedList < String > ( ) ; List < String > tokens = parseTokens ( exp ) ; boolean isInBracket = false ; int numInBracket = 0 ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < tokens . size ( ) ;... |
public class CmsMessages { /** * Returns the localized resource string for a given message key . < p >
* If the key was not found in the bundle , the provided default value
* is returned . < p >
* @ param keyName the key for the desired string
* @ param defaultValue the default value in case the key does not ex... | String result = key ( keyName , true ) ; return ( result == null ) ? defaultValue : result ; |
public class WalkerState { /** * seeks by a span of time ( weeks , months , etc )
* @ param direction the direction to seek : two possibilities
* ' < ' go backward
* ' > ' go forward
* @ param seekAmount the amount to seek . Must be guaranteed to parse as an integer
* @ param span */
public void seekBySpan ( ... | if ( span . startsWith ( SEEK_PREFIX ) ) span = span . substring ( 3 ) ; int seekAmountInt = Integer . parseInt ( seekAmount ) ; assert ( direction . equals ( DIR_LEFT ) || direction . equals ( DIR_RIGHT ) ) ; assert ( span . equals ( DAY ) || span . equals ( WEEK ) || span . equals ( MONTH ) || span . equals ( YEAR ) ... |
public class SchemaFactory { /** * Set the value of a feature flag .
* Feature can be used to control the way a { @ link SchemaFactory }
* parses schemas , although { @ link SchemaFactory } s are not required
* to recognize any specific feature names . < / p >
* < p > The feature name is any fully - qualified U... | if ( name == null ) { throw new NullPointerException ( "name == null" ) ; } throw new SAXNotRecognizedException ( name ) ; |
public class ReduceTo { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > specify the accumulator variable of a REDUCE expression .
* < div color = ' red ... | CollectExpression collXpr = ( CollectExpression ) this . astNode ; ReduceEvalExpression reduceEval = ( ReduceEvalExpression ) ( collXpr ) . getEvalExpression ( ) ; reduceEval . setResultVariable ( value ) ; return new ReduceBy ( collXpr ) ; |
public class DRL6Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 459:1 : shiftExpression returns [ BaseDescr result ] : left = additiveExpression ( ( shiftOp ) = > shiftOp additiveExpression ) * ; */
public final DRL6Expressions . shiftExpression_return shiftExpressio... | DRL6Expressions . shiftExpression_return retval = new DRL6Expressions . shiftExpression_return ( ) ; retval . start = input . LT ( 1 ) ; BaseDescr left = null ; try { // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 460:3 : ( left = additiveExpression ( ( shiftOp ) = > shiftOp additive... |
public class ChronoFormatter { /** * / * [ deutsch ]
* < p > Konstruiert einen stilbasierten Formatierer f & uuml ; r allgemeine Chronologien . < / p >
* @ param < T > generic chronological type
* @ param style format style
* @ param locale format locale
* @ param chronology chronology with format pattern sup... | if ( LocalizedPatternSupport . class . isAssignableFrom ( chronology . getChronoType ( ) ) ) { Builder < T > builder = new Builder < > ( chronology , locale ) ; builder . addProcessor ( new StyleProcessor < > ( style , style ) ) ; return builder . build ( ) ; // Compiler will not accept the Moment - chronology !
// } e... |
public class VariableFromCsvFileReader { /** * Parses ( name , value ) pairs from the input and returns the result as a Map . The name is taken from the first column and
* value from the second column . If an input line contains only one column its value is defaulted to an empty string .
* Any extra columns are ign... | return getDataAsMap ( prefix , separator , 0 ) ; |
public class DeviceImpl { /** * Check if an init is in progress
* @ throws DevFailed if init is init progress */
private synchronized void checkInitialization ( ) throws DevFailed { } } | if ( initImpl != null ) { isInitializing = initImpl . isInitInProgress ( ) ; } else { isInitializing = false ; } if ( isInitializing ) { throw DevFailedUtils . newDevFailed ( "CONCURRENT_ERROR" , name + " in Init command " ) ; } |
public class JsonReader { /** * Reads the next array with an expected name and returns a list of its values
* @ param expectedName The name that the next array should have
* @ return A list of the values in the array
* @ throws IOException Something went wrong reading the array or the expected name was not found ... | beginArray ( expectedName ) ; List < Val > array = new ArrayList < > ( ) ; while ( peek ( ) != JsonTokenType . END_ARRAY ) { array . add ( nextValue ( ) ) ; } endArray ( ) ; return array . toArray ( new Val [ array . size ( ) ] ) ; |
public class CmsLocationPopupContent { /** * Sets the field visibility . < p >
* @ param visible < code > true < / code > to show the field */
protected void setSizeVisible ( boolean visible ) { } } | Style style = m_sizeLabel . getElement ( ) . getParentElement ( ) . getStyle ( ) ; if ( visible ) { style . clearDisplay ( ) ; } else { style . setDisplay ( Display . NONE ) ; } |
public class NotificationBoard { /** * Enable / disable this board .
* @ param enable */
public void setBoardEnabled ( boolean enable ) { } } | if ( mEnabled != enable ) { if ( DBG ) Log . v ( TAG , "enable - " + enable ) ; mEnabled = enable ; } |
public class GeometryUtilities { /** * Creates a line that may help out as placeholder .
* @ return a dummy { @ link LineString } . */
public static LineString createDummyLine ( ) { } } | Coordinate [ ] c = new Coordinate [ ] { new Coordinate ( 0.0 , 0.0 ) , new Coordinate ( 1.0 , 1.0 ) , new Coordinate ( 1.0 , 0.0 ) } ; LineString lineString = gf ( ) . createLineString ( c ) ; return lineString ; |
public class JobStepExecutionsInner { /** * Lists the step executions of a job execution .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; JobExe... | return listByJobExecutionNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < JobExecutionInner > > , Observable < ServiceResponse < Page < JobExecutionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < JobExecutionInner > > > call ( ServiceResponse < Page < J... |
public class Rect { /** * Sets the visible rectangle of translated coordinates .
* @ param xMin
* @ param xMax
* @ param yMin
* @ param yMax */
public final void setRect ( double xMin , double xMax , double yMin , double yMax ) { } } | this . xMin = xMin ; this . xMax = xMax ; this . yMin = yMin ; this . yMax = yMax ; |
public class ComposeMatchers { /** * Returns a matcher that matches the specified feature of an object .
* For example :
* < pre >
* assertThat ( " ham " , hasFeature ( " a string with length " , " string length " , String : : length , equalTo ( 3 ) ) ) ;
* < / pre >
* @ param featureDescription
* a descrip... | return new HasFeatureMatcher < > ( featureDescription , featureName , featureFunction , featureMatcher ) ; |
public class ConditionalCheck { /** * Ensures that a given position index is valid within the size of an array , list or string . . .
* @ param condition
* condition must be { @ code true } ^ so that the check will be performed
* @ param index
* index of an array , list or string
* @ param size
* size of an... | if ( condition ) { Check . positionIndex ( index , size ) ; } |
public class PlanNode { /** * Determine whether this node has an ancestor with any of the supplied types .
* @ param firstType the first type ; may not be null
* @ param additionalTypes the additional types ; may not be null
* @ return true if there is at least one ancestor that has any of the supplied types , or... | return hasAncestorOfType ( EnumSet . of ( firstType , additionalTypes ) ) ; |
public class CmsContainerConfigurationCache { /** * Processes all enqueued inheritance container updates . < p > */
public synchronized void flushUpdates ( ) { } } | Set < CmsUUID > updateIds = m_updateSet . removeAll ( ) ; if ( ! updateIds . isEmpty ( ) ) { if ( updateIds . contains ( UPDATE_ALL ) ) { initialize ( ) ; } else { Map < CmsUUID , CmsContainerConfigurationGroup > groups = loadFromIds ( updateIds ) ; CmsContainerConfigurationCacheState state = m_state . updateWithChange... |
public class CsvSink { /** * Gets the polling time unit .
* @ return the polling time unit set by properties , If it is not set , a default value SECONDS is
* returned . */
private TimeUnit getPollUnit ( ) { } } | String unit = mProperties . getProperty ( CSV_KEY_UNIT ) ; if ( unit == null ) { unit = CSV_DEFAULT_UNIT ; } return TimeUnit . valueOf ( unit . toUpperCase ( ) ) ; |
public class PluginManager { /** * Load detached plugins and their dependencies .
* Only loads plugins that :
* < ul >
* < li > Have been detached since the last running version . < / li >
* < li > Are already installed and need to be upgraded . This can be the case if this Jenkins install has been running sinc... | VersionNumber lastExecVersion = new VersionNumber ( InstallUtil . getLastExecVersion ( ) ) ; if ( lastExecVersion . isNewerThan ( InstallUtil . NEW_INSTALL_VERSION ) && lastExecVersion . isOlderThan ( Jenkins . getVersion ( ) ) ) { LOGGER . log ( INFO , "Upgrading Jenkins. The last running version was {0}. This Jenkins... |
public class BatchOutput { /** * extract parent directory from filepath of pidsfile , store it as directory
* where processing progress report will be written . see also
* BatchBuildGUI . java , BatchBuildIngestGUI . java , and BatchIngestGUI . java ,
* each of which calls setDirectoryPath ( ) */
public void setD... | File pidsfile = new File ( pidsfilepath ) ; directoryPath = pidsfile . getParent ( ) ; |
public class DFSClient { /** * Get the CRC32 Checksum of a file .
* @ param src The file path
* @ return The checksum
* @ see DistributedFileSystem # getFileCrc ( Path ) */
int getFileCrc ( String src ) throws IOException { } } | checkOpen ( ) ; return getFileCrc ( dataTransferVersion , src , namenode , namenodeProtocolProxy , socketFactory , socketTimeout ) ; |
public class XlsLoader { /** * Excelファイルの複数シートを読み込み 、 任意のクラスにマップする 。
* < p > 複数のシートの形式を一度に読み込む際に使用します 。 < / p >
* @ param xlsIn 読み込み元のExcelファイルのストリーム 。
* @ param classes マッピング先のクラスタイプの配列 。
* @ return マッピングした複数のシートの結果 。
* { @ link Configuration # isIgnoreSheetNotFound ( ) } の値がtrueで 、 シートが見つからない場合 、 マ... | "unchecked" , "rawtypes" } ) public MultipleSheetBindingErrors < Object > loadMultipleDetail ( final InputStream xlsIn , final Class < ? > [ ] classes ) throws XlsMapperException , IOException { ArgUtils . notNull ( xlsIn , "xlsIn" ) ; ArgUtils . notEmpty ( classes , "classes" ) ; final AnnotationReader annoReader = ne... |
public class V1InstanceCreator { /** * Create a new project entity with a name , parent project , begin date , and
* optional schedule .
* @ param name name of project .
* @ param parentProjectID id of parent project for created project .
* @ param beginDate start date of created project .
* @ param schedule ... | return project ( name , new Project ( parentProjectID , instance ) , beginDate , schedule , attributes ) ; |
public class MorphShape { /** * Set the current frame
* @ param current The current frame */
public void setExternalFrame ( Shape current ) { } } | this . current = current ; next = ( Shape ) shapes . get ( 0 ) ; offset = 0 ; |
public class ServiceGraphModule { /** * Adds the dependency for key
* @ param key key for adding dependency
* @ param keyDependency key of dependency
* @ return ServiceGraphModule with change */
public ServiceGraphModule addDependency ( Key < ? > key , Key < ? > keyDependency ) { } } | addedDependencies . computeIfAbsent ( key , key1 -> new HashSet < > ( ) ) . add ( keyDependency ) ; return this ; |
public class JmsSessionImpl { /** * Use to propagate session / connection properties to a JMS message .
* @ param msg */
private void setMessageProperties ( JmsMessageImpl msg ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setMessageProperties" , msg . getClass ( ) + "@" + System . identityHashCode ( msg ) ) ; // Get properties from the pass through properties
String prodProp = ( String ) passThruProps . get ( JmsraConstants . PRODUCER... |
public class Internal { /** * Extracts the timestamp from a row key . */
public static long baseTime ( final TSDB tsdb , final byte [ ] row ) { } } | return Bytes . getUnsignedInt ( row , Const . SALT_WIDTH ( ) + TSDB . metrics_width ( ) ) ; |
public class PassThroughSetTransformer { /** * A set transformer that returns the supplied set .
* @ param set The set to be transformed . Not { @ code null } .
* @ param < O > The type of elements contained within the set .
* @ return The same set that was supplied . */
@ Override public < O extends Comparable >... | return checkNotNull ( set ) ; |
public class bridgegroup { /** * Use this API to fetch bridgegroup resource of given name . */
public static bridgegroup get ( nitro_service service , Long id ) throws Exception { } } | bridgegroup obj = new bridgegroup ( ) ; obj . set_id ( id ) ; bridgegroup response = ( bridgegroup ) obj . get_resource ( service ) ; return response ; |
public class YPipe { /** * flushed down the stream . */
@ Override public void write ( final T value , boolean incomplete ) { } } | // Place the value to the queue , add new terminator element .
queue . push ( value ) ; // Move the " flush up to here " pointer .
if ( ! incomplete ) { f = queue . backPos ( ) ; } |
public class PremiumRate { /** * Sets the pricingMethod value for this PremiumRate .
* @ param pricingMethod * The method of deciding which { @ link PremiumRateValue } objects
* from this
* { @ code PremiumRate } to apply to a { @ link ProposalLineItem } .
* This attribute is required . */
public void setPricin... | this . pricingMethod = pricingMethod ; |
public class SessionData { /** * getSessionValue - handles special security property */
protected Object getSessionValue ( String pName , boolean securityInfo ) { } } | if ( pName . equals ( SECURITY_PROP_NAME ) && ( securityInfo == false ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName , methodNames [ GET_SESSION_V... |
public class RungeKuttaFelberg { /** * Returns the value of the function described by differential equations in the next time step
* @ param currentTimeInMinutes The current time
* @ param initialConditions The value of the initial condition
* @ param timeStepInMinutes The desired step size
* @ param finalize A... | double [ ] carrier = new double [ initialConditions . length ] ; double [ ] k0 = duffy . eval ( currentTimeInMinutes , initialConditions , rainArray , etpArray , false ) ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) carrier [ i ] = Math . max ( 0 , initialConditions [ i ] + timeStepInMinutes * b [ 1 ] [ 0... |
public class AbstractMetricsContext { /** * Registers a callback to be called at time intervals determined by
* the configuration .
* @ param updater object to be run periodically ; it should update
* some metrics records */
public synchronized void registerUpdater ( final Updater updater ) { } } | if ( ! updaters . containsKey ( updater ) ) { updaters . put ( updater , Boolean . TRUE ) ; } |
public class InternalConfigSource { /** * { @ inheritDoc } */
@ Override @ FFDCIgnore ( { } } | ConfigStartException . class } ) public String getValue ( String propertyName ) { String theValue = null ; try { theValue = getProperties ( ) . get ( propertyName ) ; } catch ( ConfigStartException cse ) { // Swallow the exception , don ' t FFDC
// At the moment this exception means that we could not properly query the... |
public class GangliaWriter { /** * Send query result values to Ganglia . */
@ Override public void internalWrite ( Server server , Query query , ImmutableList < Result > results ) throws Exception { } } | for ( final Result result : results ) { final String name = KeyUtils . getKeyString ( query , result , getTypeNames ( ) ) ; Object transformedValue = valueTransformer . apply ( result . getValue ( ) ) ; GMetricType dataType = getType ( result . getValue ( ) ) ; log . debug ( "Sending Ganglia metric {}={} [type={}]" , n... |
public class AppServiceCertificateOrdersInner { /** * Create or update a certificate purchase order .
* Create or update a certificate purchase order .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param certificateOrderName Name of the certificate order .
* @ param ... | return updateWithServiceResponseAsync ( resourceGroupName , certificateOrderName , certificateDistinguishedName ) . map ( new Func1 < ServiceResponse < AppServiceCertificateOrderInner > , AppServiceCertificateOrderInner > ( ) { @ Override public AppServiceCertificateOrderInner call ( ServiceResponse < AppServiceCertifi... |
public class CreateConfigurationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateConfigurationRequest createConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createConfigurationRequest . getEngineType ( ) , ENGINETYPE_BINDING ) ; protocolMarshaller . marshall ( createConfigurationRequest . getEngineVersion ( ) , EN... |
public class TemplateVariableManager { /** * Returns the field that holds the currently rendering LoggingAdvisingAppendable object that is
* used for streaming renders .
* < p > Unlike normal variables the VariableSet doesn ' t maintain responsibility for saving and
* restoring the current renderee to a local .
... | FieldRef local = currentAppendable ; if ( local == null ) { local = currentAppendable = FieldRef . createField ( owner , CURRENT_APPENDABLE_FIELD , LoggingAdvisingAppendable . class ) ; } return local ; |
public class Joining { /** * Returns a { @ code Collector } which behaves like this collector , but
* additionally wraps the result with the specified prefix and suffix .
* The collector returned by
* { @ code Joining . with ( delimiter ) . wrap ( prefix , suffix ) } is equivalent to
* { @ link Collectors # joi... | return new Joining ( delimiter , ellipsis , prefix . toString ( ) . concat ( this . prefix ) , this . suffix . concat ( suffix . toString ( ) ) , cutStrategy , lenStrategy , maxLength ) ; |
public class ReturnValueIgnored { /** * { @ link java . time } types are immutable . The only methods we allow ignoring the return value on
* are the { @ code parse } - style APIs since folks often use it for validation . */
private static boolean javaTimeTypes ( ExpressionTree tree , VisitorState state ) { } } | if ( packageStartsWith ( "java.time" ) . matches ( tree , state ) ) { return false ; } Symbol symbol = ASTHelpers . getSymbol ( tree ) ; if ( symbol instanceof MethodSymbol ) { MethodSymbol methodSymbol = ( MethodSymbol ) symbol ; if ( methodSymbol . owner . packge ( ) . getQualifiedName ( ) . toString ( ) . startsWith... |
public class AsnInputStream { /** * Skip content field of primitive and constructed element ( definite and indefinite length supported )
* @ param length
* @ throws IOException
* @ throws AsnException */
public void advanceElementData ( int length ) throws IOException , AsnException { } } | if ( length == Tag . Indefinite_Length ) this . advanceIndefiniteLength ( ) ; else this . advance ( length ) ; |
public class DynamoDBScanExpression { /** * One or more substitution variables for simplifying complex expressions .
* @ param expressionAttributeNames
* One or more substitution variables for simplifying complex
* expressions .
* @ return A reference to this updated object so that method calls can be
* chain... | setExpressionAttributeNames ( expressionAttributeNames ) ; return this ; |
public class AbstractLRParser { /** * This method is the actual parsing . The parser creates an action stack which
* can be later convertered with a { @ link LRTokenStreamConverter } into a
* { @ link ParseTreeNode } .
* @ throws ParserException
* @ throws GrammarException */
private void createActionStack ( ) ... | boolean accepted = false ; do { checkTimeout ( ) ; stepCounter ++ ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( toString ( ) ) ; } if ( streamPosition > maxPosition ) { maxPosition = streamPosition ; } final ParserActionSet actionSet ; final Token token ; if ( streamPosition < getTokenStream ( ) . size ( ) ) ... |
public class ResourceIndexModule { /** * { @ inheritDoc } */
public void export ( OutputStream out , RDFFormat format ) throws ResourceIndexException { } } | _ri . export ( out , format ) ; |
public class CachingGroovyEngine { /** * Evaluate an expression . */
public Object eval ( String source , int lineNo , int columnNo , Object script ) throws BSFException { } } | try { Class scriptClass = evalScripts . get ( script ) ; if ( scriptClass == null ) { scriptClass = loader . parseClass ( script . toString ( ) , source ) ; evalScripts . put ( script , scriptClass ) ; } else { LOG . fine ( "eval() - Using cached script..." ) ; } // can ' t cache the script because the context may be d... |
public class HashConfigurationBuilder { /** * Number of cluster - wide replicas for each cache entry . */
public HashConfigurationBuilder numOwners ( int numOwners ) { } } | if ( numOwners < 1 ) throw new IllegalArgumentException ( "numOwners cannot be less than 1" ) ; attributes . attribute ( NUM_OWNERS ) . set ( numOwners ) ; return this ; |
public class Predicates { /** * parses the predicate string , and returns the result , using the TCCL to load predicate definitions
* @ param predicate The prediate string
* @ return The predicate */
public static Predicate parse ( final String predicate ) { } } | return PredicateParser . parse ( predicate , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; |
public class LoadableResource { /** * This method is called after data could be successfully loaded from a non fallback resource . This method by
* default writes an file containing the data into the user ' s local home directory , so subsequent or later calls ,
* even after a VM restart , should be able to recover... | if ( this . cache != null ) { byte [ ] cachedData = this . data == null ? null : this . data . get ( ) ; if ( cachedData == null ) { return ; } this . cache . write ( resourceId , cachedData ) ; } |
public class MapReduceServlet { /** * See rfc6585 */
@ Override public void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException { } } | try { MapReduceServletImpl . doPost ( req , resp ) ; } catch ( RejectRequestException e ) { handleRejectedRequest ( resp , e ) ; } |
public class DnDManager { /** * Add a dragsource . */
protected void addSource ( DragSource source , JComponent comp , boolean autoremove ) { } } | _draggers . put ( comp , source ) ; comp . addMouseListener ( _sourceListener ) ; comp . addMouseMotionListener ( _sourceListener ) ; if ( autoremove ) { comp . addAncestorListener ( _remover ) ; } |
public class ProteinBuilderTool { /** * Builds a protein by connecting a new amino acid at the N - terminus of the
* given strand .
* @ param protein protein to which the strand belongs
* @ param aaToAdd amino acid to add to the strand of the protein
* @ param strand strand to which the protein is added */
publ... | // then add the amino acid
addAminoAcid ( protein , aaToAdd , strand ) ; // Now think about the protein back bone connection
if ( protein . getMonomerCount ( ) == 0 ) { // make the connection between that aminoAcid ' s C - terminus and the
// protein ' s N - terminus
protein . addBond ( aaToAdd . getBuilder ( ) . newIn... |
public class JSLocalConsumerPoint { /** * Gets the max active message count ,
* Currently only used by the unit tests to be sure that the max active count has
* been updated
* @ return */
public int getMaxActiveMessages ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getMaxActiveMessages" ) ; SibTr . exit ( tc , "getMaxActiveMessages" , Integer . valueOf ( _maxActiveMessages ) ) ; } return _maxActiveMessages ; |
public class Circle { /** * Draws this circle
* @ param context the { @ link Context2D } used to draw this circle . */
@ Override protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { } } | final double r = attr . getRadius ( ) ; if ( r > 0 ) { context . beginPath ( ) ; context . arc ( 0 , 0 , r , 0 , Math . PI * 2 , true ) ; context . closePath ( ) ; return true ; } return false ; |
public class SignalUtil { /** * Implements the same semantics as { @ link Lock # lock ( ) } , except that the wait will periodically
* time out within this method to log a warning message that the thread appears stuck . This
* cycle will be repeated until the lock is obtained . If the thread has waited for an exten... | final String sourceMethod = "lock" ; // $ NON - NLS - 1 $
final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { Thread . currentThread ( ) , lock , callerClass , callerMethod , args } ) ; } long start = System . current... |
public class PrcItemSpecificsRetrieve { /** * < p > Setter for prcEntityRetrieve . < / p >
* @ param pPrcEntityRetrieve reference */
public final void setPrcEntityRetrieve ( final PrcEntityRetrieve < RS , AItemSpecifics < T , ID > , ID > pPrcEntityRetrieve ) { } } | this . prcEntityRetrieve = pPrcEntityRetrieve ; |
public class ModifyWorkspacePropertiesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ModifyWorkspacePropertiesRequest modifyWorkspacePropertiesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( modifyWorkspacePropertiesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( modifyWorkspacePropertiesRequest . getWorkspaceId ( ) , WORKSPACEID_BINDING ) ; protocolMarshaller . marshall ( modifyWorkspacePropertiesRequest . getWo... |
public class NumberUtils { /** * < p > Returns the maximum value in an array . < / p >
* @ param array an array , must not be null or empty
* @ return the maximum value in the array
* @ throws IllegalArgumentException if < code > array < / code > is < code > null < / code >
* @ throws IllegalArgumentException i... | // Validates input
validateArray ( array ) ; // Finds and returns max
float max = array [ 0 ] ; for ( int j = 1 ; j < array . length ; j ++ ) { if ( Float . isNaN ( array [ j ] ) ) { return Float . NaN ; } if ( array [ j ] > max ) { max = array [ j ] ; } } return max ; |
public class Statement { /** * Sets the resources associated with this policy statement . Resources are
* what a policy statement is allowing or denying access to , such as an
* Amazon SQS queue or an Amazon SNS topic .
* Note that some services allow only one resource to be specified per
* policy statement .
... | List < Resource > resourceList = new ArrayList < Resource > ( resources ) ; PolicyUtils . validateResourceList ( resourceList ) ; this . resources = resourceList ; |
public class MaterializeKNNPreprocessor { /** * Updates the kNNs of the RkNNs of the specified ids .
* @ param ids the ids of deleted objects causing a change of materialized kNNs
* @ return the RkNNs of the specified ids , i . e . the kNNs which have been
* updated */
private ArrayDBIDs updateKNNsAfterDeletion (... | SetDBIDs idsSet = DBIDUtil . ensureSet ( ids ) ; ArrayModifiableDBIDs rkNN_ids = DBIDUtil . newArray ( ) ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { KNNList kNNs = storage . get ( iditer ) ; for ( DBIDIter it = kNNs . iter ( ) ; it . valid ( ) ; it . advance ( ) ) ... |
public class BlockDataMessage { /** * Sends the data to the specified { @ link EntityPlayerMP } .
* @ param chunk the chunk
* @ param identifier the identifier
* @ param data the data
* @ param player the player */
public static void sendBlockData ( Chunk chunk , String identifier , ByteBuf data , EntityPlayerM... | MalisisCore . network . sendTo ( new Packet ( chunk , identifier , data ) , player ) ; |
public class TcpConnecter { /** * Returns the currently used interval */
private int getNewReconnectIvl ( ) { } } | // The new interval is the current interval + random value .
int interval = currentReconnectIvl + ( Utils . randomInt ( ) % options . reconnectIvl ) ; // Only change the current reconnect interval if the maximum reconnect
// interval was set and if it ' s larger than the reconnect interval .
if ( options . reconnectIvl... |
public class RunnableUtils { /** * Runs the given { @ link Runnable } object and then causes the current , calling { @ link Thread } to sleep
* for the given number of milliseconds .
* This utility method can be used to simulate a long running , expensive operation .
* @ param milliseconds a long value with the n... | Assert . isTrue ( milliseconds > 0 , "Milliseconds [%d] must be greater than 0" , milliseconds ) ; runnable . run ( ) ; if ( ! ThreadUtils . sleep ( milliseconds , 0 ) ) { throw new SleepDeprivedException ( String . format ( "Failed to wait for [%d] millisecond(s)" , milliseconds ) ) ; } return true ; |
public class Http { /** * Serialises the given object as a { @ link StringEntity } .
* @ param requestMessage The object to be serialised .
* @ throws UnsupportedEncodingException If a serialisation error occurs . */
protected StringEntity serialiseRequestMessage ( Object requestMessage ) throws UnsupportedEncoding... | StringEntity result = null ; // Add the request message if there is one
if ( requestMessage != null ) { // Send the message
String message = Serialiser . serialise ( requestMessage ) ; result = new StringEntity ( message ) ; } return result ; |
public class CallStatsAuthenticator { /** * Schedule authentication .
* @ param appId the app id
* @ param appSecret the app secret
* @ param bridgeId the bridge id
* @ param httpClient the http client */
private void scheduleAuthentication ( final int appId , final String bridgeId , final CallStatsHttp2Client ... | scheduler . schedule ( new Runnable ( ) { public void run ( ) { sendAsyncAuthenticationRequest ( appId , bridgeId , httpClient ) ; } } , authenticationRetryTimeout , TimeUnit . MILLISECONDS ) ; |
public class HiveDataset { /** * Sort all partitions inplace on the basis of complete name ie dbName . tableName . partitionName */
public static List < Partition > sortPartitions ( List < Partition > partitions ) { } } | Collections . sort ( partitions , new Comparator < Partition > ( ) { @ Override public int compare ( Partition o1 , Partition o2 ) { return o1 . getCompleteName ( ) . compareTo ( o2 . getCompleteName ( ) ) ; } } ) ; return partitions ; |
public class AppServiceEnvironmentsInner { /** * Get metrics for a specific instance of a worker pool of an App Service Environment .
* Get metrics for a specific instance of a worker pool of an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ pa... | return listWorkerPoolInstanceMetricsWithServiceResponseAsync ( resourceGroupName , name , workerPoolName , instance ) . map ( new Func1 < ServiceResponse < Page < ResourceMetricInner > > , Page < ResourceMetricInner > > ( ) { @ Override public Page < ResourceMetricInner > call ( ServiceResponse < Page < ResourceMetricI... |
public class AmazonAlexaForBusinessClient { /** * Gets room details by room ARN .
* @ param getRoomRequest
* @ return Result of the GetRoom operation returned by the service .
* @ throws NotFoundException
* The resource is not found .
* @ sample AmazonAlexaForBusiness . GetRoom
* @ see < a href = " http : /... | request = beforeClientExecution ( request ) ; return executeGetRoom ( request ) ; |
public class MtasCQLParserBasicSentenceCondition { /** * Gets the query .
* @ return the query
* @ throws ParseException the parse exception */
public MtasSpanQuery getQuery ( ) throws ParseException { } } | simplify ( ) ; MtasSpanSequenceItem currentQuery = null ; List < MtasSpanSequenceItem > currentQueryList = null ; for ( MtasCQLParserBasicSentencePartCondition part : partList ) { // start list
if ( currentQuery != null ) { currentQueryList = new ArrayList < MtasSpanSequenceItem > ( ) ; currentQueryList . add ( current... |
public class ServiceValidationViewFactory { /** * Gets view .
* @ param request the request
* @ param isSuccess the is success
* @ param service the service
* @ param ownerClass the owner class
* @ return the view */
public View getView ( final HttpServletRequest request , final boolean isSuccess , final WebA... | val type = getValidationResponseType ( request , service ) ; if ( type == ValidationResponseType . JSON ) { return getSingleInstanceView ( ServiceValidationViewTypes . JSON ) ; } return isSuccess ? getSuccessView ( ownerClass . getSimpleName ( ) ) : getFailureView ( ownerClass . getSimpleName ( ) ) ; |
public class AccountUpdater { /** * Queues the avatar of the connected account to get updated .
* @ param avatar The avatar to set .
* @ param fileType The type of the avatar , e . g . " png " or " jpg " .
* @ return The current instance in order to chain call methods . */
public AccountUpdater setAvatar ( InputS... | delegate . setAvatar ( avatar , fileType ) ; return this ; |
public class JvmOperationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetDefaultValue ( JvmAnnotationValue newDefaultValue , NotificationChain msgs ) { } } | JvmAnnotationValue oldDefaultValue = defaultValue ; defaultValue = newDefaultValue ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , TypesPackage . JVM_OPERATION__DEFAULT_VALUE , oldDefaultValue , newDefaultValue ) ; if ( msgs == null ) msgs = noti... |
public class RuntimeEnvironment { /** * Returns the thread which is assigned to execute the user code .
* @ return the thread which is assigned to execute the user code */
public Thread getExecutingThread ( ) { } } | synchronized ( this ) { if ( this . executingThread == null ) { if ( this . taskName == null ) { this . executingThread = new Thread ( this ) ; } else { this . executingThread = new Thread ( this , getTaskNameWithIndex ( ) ) ; } } return this . executingThread ; } |
public class RegistryFactory { /** * 得到注册中心对象
* @ param registryConfig RegistryConfig类
* @ return Registry实现 */
public static synchronized Registry getRegistry ( RegistryConfig registryConfig ) { } } | if ( ALL_REGISTRIES . size ( ) > 3 ) { // 超过3次 是不是配错了 ?
if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( "Size of registry is greater than 3, Please check it!" ) ; } } try { // 注意 : RegistryConfig重写了equals方法 , 如果多个RegistryConfig属性一样 , 则认为是一个对象
Registry registry = ALL_REGISTRIES . get ( registryConfig ) ; if ( regist... |
public class App { /** * Navigates to a new url
* @ param url - the URL to navigate to */
public void goToURL ( String url ) { } } | String action = "Loading " + url ; String expected = "Loaded " + url ; double start = System . currentTimeMillis ( ) ; try { driver . get ( url ) ; } catch ( Exception e ) { log . warn ( e ) ; reporter . fail ( action , expected , "Fail to Load " + url + ". " + e . getMessage ( ) ) ; return ; } double timeTook = System... |
public class JsonArray { /** * Convenient replace method that allows you to replace an object based on field equality for a specified field .
* Useful if you have an id field in your objects . Note , the array may contain non objects as well or objects
* without the specified field . Those elements won ' t be repla... | JsonElement compareElement = e1 . get ( path ) ; if ( compareElement == null ) { throw new IllegalArgumentException ( "specified path may not be null in object " + StringUtils . join ( path ) ) ; } int i = 0 ; for ( JsonElement e : this ) { if ( e . isObject ( ) ) { JsonElement fieldValue = e . asObject ( ) . get ( pat... |
public class QueryImpl { /** * Handle post event callbacks . */
protected void handlePostEvent ( ) { } } | EntityMetadata metadata = getEntityMetadata ( ) ; if ( ! kunderaQuery . isDeleteUpdate ( ) ) { persistenceDelegeator . getEventDispatcher ( ) . fireEventListeners ( metadata , null , PostLoad . class ) ; } |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcProcess ( ) { } } | if ( ifcProcessEClass == null ) { ifcProcessEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 453 ) ; } return ifcProcessEClass ; |
public class BeanUtils { /** * 手动转换 { @ link List } 和 { @ link Map }
* @ param fieldName 字段名
* @ param object 对象
* @ return json对象 */
@ SuppressWarnings ( "unchecked" ) private static String converter ( String fieldName , Object object ) { } } | StringBuilder builder = new StringBuilder ( ) ; if ( Checker . isNotEmpty ( fieldName ) ) { builder . append ( "\"" ) . append ( fieldName ) . append ( "\":" ) ; } if ( object instanceof Collection ) { List list = ( List ) object ; builder . append ( "[" ) ; list . forEach ( obj -> builder . append ( converter ( ValueC... |
public class AbstractObjectTable { /** * Handle a double click on a row of the table . The row will already be
* selected . */
protected void onDoubleClick ( ) { } } | // Dispatch this to the doubleClickHandler , if any
if ( doubleClickHandler != null ) { boolean okToExecute = true ; if ( doubleClickHandler instanceof GuardedActionCommandExecutor ) { okToExecute = ( ( GuardedActionCommandExecutor ) doubleClickHandler ) . isEnabled ( ) ; } if ( okToExecute ) { doubleClickHandler . exe... |
public class SecondaryIndex { /** * Returns the decoratedKey for a column value
* @ param value column value
* @ return decorated key */
public DecoratedKey getIndexKeyFor ( ByteBuffer value ) { } } | // FIXME : this imply one column definition per index
ByteBuffer name = columnDefs . iterator ( ) . next ( ) . name . bytes ; return new BufferDecoratedKey ( new LocalToken ( baseCfs . metadata . getColumnDefinition ( name ) . type , value ) , value ) ; |
public class UnsafeOperations { /** * Copies the array of the specified type from the given field offset in the source object
* to the same location in the copy , visiting the array during the copy so that its contents are also copied
* @ param source The object to copy from
* @ param copy The target object
* @... | Object origFieldValue = THE_UNSAFE . getObject ( source , offset ) ; if ( origFieldValue == null ) { putNullObject ( copy , offset ) ; } else { final Object copyFieldValue = deepCopyArray ( origFieldValue , referencesToReuse ) ; UnsafeOperations . THE_UNSAFE . putObject ( copy , offset , copyFieldValue ) ; } |
public class Image { /** * Gets an instance of an Image from a java . awt . Image .
* @ param image
* the < CODE > java . awt . Image < / CODE > to convert
* @ param color
* if different from < CODE > null < / CODE > the transparency pixels
* are replaced by this color
* @ param forceBW
* if < CODE > true... | if ( image instanceof BufferedImage ) { BufferedImage bi = ( BufferedImage ) image ; if ( bi . getType ( ) == BufferedImage . TYPE_BYTE_BINARY ) { forceBW = true ; } } java . awt . image . PixelGrabber pg = new java . awt . image . PixelGrabber ( image , 0 , 0 , - 1 , - 1 , true ) ; try { pg . grabPixels ( ) ; } catch ... |
public class MessageItemReference { /** * Returns the producerConnectionUuid .
* @ return SIBUuid12 */
@ Override public SIBUuid12 getProducerConnectionUuid ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getProducerConnectionUuid" ) ; SibTr . exit ( tc , "getProducerConnectionUuid" ) ; } return getMessageItem ( ) . getProducerConnectionUuid ( ) ; |
public class Router { /** * Now that we know that this controller is under a package , need to find the controller short name .
* @ param pack part of the package of the controller , taken from URI : value between " app . controllers " and controller name .
* @ param uri uri from request
* @ return controller nam... | String temp = uri . startsWith ( "/" ) ? uri . substring ( 1 ) : uri ; temp = temp . replace ( "/" , "." ) ; if ( temp . length ( ) > pack . length ( ) ) temp = temp . substring ( pack . length ( ) + 1 ) ; if ( temp . equals ( "" ) ) throw new ControllerException ( "You defined a controller package '" + pack + "', but ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.