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 accuracy .
* @ param d The double value .
* @ return The string value . */
public static String asString ( double d ) { } } | 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 patternFlatSelectFunction The pattern flat select function which is called for each
* detected pattern sequence .
* @ param < R > Type of the resulting elements
* @ param outTypeInfo Explicit specification of output type .
* @ return { @ link DataStream } which contains the resulting elements from the pattern flat select
* function . */
public < R > SingleOutputStreamOperator < R > flatSelect ( final PatternFlatSelectFunction < T , R > patternFlatSelectFunction , final TypeInformation < R > outTypeInfo ) { } } | 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 . */
public User getCurrentUser ( ) throws ProvisioningApiException { } } | 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 ( ) . getUser ( ) ) ; } catch ( ApiException e ) { throw new ProvisioningApiException ( "Error getting current user" , e ) ; } |
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 < String > candidates ) { } } | 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 ) , escSelector ) ) ; } |
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 . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listKeyPhrasesDetectionJobsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 [ ] getUniqueDeclaredMethods ( Class < ? > leafClass ) throws IllegalArgumentException { } } | 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 . getName ( ) . equals ( existingMethod . getName ( ) ) && Arrays . equals ( method . getParameterTypes ( ) , existingMethod . getParameterTypes ( ) ) ) { // Is this a covariant return type situation ?
if ( existingMethod . getReturnType ( ) != method . getReturnType ( ) && existingMethod . getReturnType ( ) . isAssignableFrom ( method . getReturnType ( ) ) ) { methodBeingOverriddenWithCovariantReturnType = existingMethod ; } else { knownSignature = true ; } break ; } } if ( methodBeingOverriddenWithCovariantReturnType != null ) { methods . remove ( methodBeingOverriddenWithCovariantReturnType ) ; } if ( ! knownSignature ) { methods . add ( method ) ; } } } ) ; return methods . toArray ( new Method [ methods . size ( ) ] ) ; |
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 > Jolokia URL starting with " jolokia : " ( e . g . jolokia : http : / / localhost : 8161 / api / jolokia ) < / li >
* < li > Broker hostname and port separated by a colon ( e . g . localhost : 1099 ) < / li >
* < / ul >
* @ param location
* @ return */
public MBeanAccessConnectionFactory getLocationConnectionFactory ( String location ) throws Exception { } } | 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 < i > atom < / i > does not have 2d
* coordinates
* @ see # placeHydrogens2D ( org . openscience . cdk . interfaces . IAtomContainer ,
* double ) */
public void placeHydrogens2D ( IAtomContainer container , IAtom atom ) { } } | 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 ( d [ k ] ) ; } if ( scale == 0.0 ) { e [ i ] = d [ i - 1 ] ; for ( int j = 0 ; j < i ; j ++ ) { d [ j ] = V . get ( i - 1 , j ) ; V . set ( i , j , 0.0 ) ; V . set ( j , i , 0.0 ) ; } } else { // Generate Householder vector .
for ( int k = 0 ; k < i ; k ++ ) { d [ k ] /= scale ; h += d [ k ] * d [ k ] ; } double f = d [ i - 1 ] ; double g = Math . sqrt ( h ) ; if ( f > 0 ) { g = - g ; } e [ i ] = scale * g ; h = h - f * g ; d [ i - 1 ] = f - g ; for ( int j = 0 ; j < i ; j ++ ) { e [ j ] = 0.0 ; } // Apply similarity transformation to remaining columns .
for ( int j = 0 ; j < i ; j ++ ) { f = d [ j ] ; V . set ( j , i , f ) ; g = e [ j ] + V . get ( j , j ) * f ; for ( int k = j + 1 ; k <= i - 1 ; k ++ ) { g += V . get ( k , j ) * d [ k ] ; e [ k ] += V . get ( k , j ) * f ; } e [ j ] = g ; } f = 0.0 ; for ( int j = 0 ; j < i ; j ++ ) { e [ j ] /= h ; f += e [ j ] * d [ j ] ; } double hh = f / ( h + h ) ; for ( int j = 0 ; j < i ; j ++ ) { e [ j ] -= hh * d [ j ] ; } for ( int j = 0 ; j < i ; j ++ ) { f = d [ j ] ; g = e [ j ] ; for ( int k = j ; k <= i - 1 ; k ++ ) { V . sub ( k , j , ( f * e [ k ] + g * d [ k ] ) ) ; } d [ j ] = V . get ( i - 1 , j ) ; V . set ( i , j , 0.0 ) ; } } d [ i ] = h ; } for ( int j = 0 ; j < n ; j ++ ) { d [ j ] = V . get ( j , j ) ; } e [ 0 ] = 0.0 ; |
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 ( ) ; i ++ ) { String token = tokens . get ( i ) ; if ( token . equals ( "[" ) ) { if ( isInBracket ) { throw new IllegalArgumentException ( "Error parsing expression '" + exp + "': Nested [ found" ) ; } isInBracket = true ; numInBracket = 0 ; sb . append ( token ) ; } else if ( token . equals ( "]" ) ) { if ( ! isInBracket ) { throw new IllegalArgumentException ( "Error parsing expression '" + exp + "': Unbalanced ] found" ) ; } isInBracket = false ; sb . append ( token ) ; queue . add ( sb . toString ( ) ) ; sb = new StringBuilder ( ) ; } else { if ( isInBracket ) { if ( numInBracket > 0 ) { throw new IllegalArgumentException ( "Error parsing expression '" + exp + "': Multiple tokens found inside a bracket" ) ; } sb . append ( token ) ; numInBracket ++ ; } else { queue . add ( token ) ; } } if ( i == tokens . size ( ) - 1 ) { if ( isInBracket ) { throw new IllegalArgumentException ( "Error parsing expression '" + exp + "': Unbalanced [ found" ) ; } } } return new Expression ( queue , exp ) ; |
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 exist in the bundle
* @ return the resource string for the given key it it exists , or the given default if not */
public String keyDefault ( String keyName , String defaultValue ) { } } | 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 ( String direction , String seekAmount , String span ) { } } | 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 ) || span . equals ( HOUR ) || span . equals ( MINUTE ) || span . equals ( SECOND ) ) ; boolean isDateSeek = span . equals ( DAY ) || span . equals ( WEEK ) || span . equals ( MONTH ) || span . equals ( YEAR ) ; if ( isDateSeek ) { markDateInvocation ( ) ; } else { markTimeInvocation ( null ) ; } int sign = direction . equals ( DIR_RIGHT ) ? 1 : - 1 ; int field = span . equals ( DAY ) ? Calendar . DAY_OF_YEAR : span . equals ( WEEK ) ? Calendar . WEEK_OF_YEAR : span . equals ( MONTH ) ? Calendar . MONTH : span . equals ( YEAR ) ? Calendar . YEAR : span . equals ( HOUR ) ? Calendar . HOUR : span . equals ( MINUTE ) ? Calendar . MINUTE : span . equals ( SECOND ) ? Calendar . SECOND : null ; if ( field > 0 ) _calendar . add ( field , seekAmountInt * sign ) ; |
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 URI . It is
* possible for a { @ link SchemaFactory } to expose a feature value but
* to be unable to change the current value . < / p >
* < p > All implementations are required to support the { @ link javax . xml . XMLConstants # FEATURE _ SECURE _ PROCESSING } feature .
* When the feature is : < / p >
* < ul >
* < li >
* < code > true < / code > : the implementation will limit XML processing to conform to implementation limits .
* Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources .
* If XML processing is limited for security reasons , it will be reported via a call to the registered
* { @ link ErrorHandler # fatalError ( org . xml . sax . SAXParseException ) } .
* See { @ link # setErrorHandler ( ErrorHandler errorHandler ) } .
* < / li >
* < li >
* < code > false < / code > : the implementation will processing XML according to the XML specifications without
* regard to possible implementation limits .
* < / li >
* < / ul >
* @ param name The feature name , which is a non - null fully - qualified URI .
* @ param value The requested value of the feature ( true or false ) .
* @ exception org . xml . sax . SAXNotRecognizedException If the feature
* value can ' t be assigned or retrieved .
* @ exception org . xml . sax . SAXNotSupportedException When the
* { @ link SchemaFactory } recognizes the feature name but
* cannot set the requested value .
* @ exception NullPointerException
* if the name parameter is null .
* @ see # getFeature ( String ) */
public void setFeature ( String name , boolean value ) throws SAXNotRecognizedException , SAXNotSupportedException { } } | 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 ' style = " font - size : 18px ; color : red " > < i > e . g . . . . REDUCE ( ) < br / > . fromAll ( n ) . IN _ nodes ( p ) < br / > . < b > to ( totalAge ) < / b > < br / > . by ( totalAge . plus ( n . numberProperty ( " age " ) ) ) < br / > . startWith ( 0 ) < / i > < / div >
* < br / > */
public ReduceBy to ( JcValue value ) { } } | 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 shiftExpression ( ) throws RecognitionException { } } | 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 additiveExpression ) * )
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 460:5 : left = additiveExpression ( ( shiftOp ) = > shiftOp additiveExpression ) *
{ pushFollow ( FOLLOW_additiveExpression_in_shiftExpression2146 ) ; left = additiveExpression ( ) ; state . _fsp -- ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { if ( buildDescr ) { retval . result = left ; } } // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 461:5 : ( ( shiftOp ) = > shiftOp additiveExpression ) *
loop45 : while ( true ) { int alt45 = 2 ; int LA45_0 = input . LA ( 1 ) ; if ( ( LA45_0 == LESS ) ) { int LA45_6 = input . LA ( 2 ) ; if ( ( synpred13_DRL6Expressions ( ) ) ) { alt45 = 1 ; } } else if ( ( LA45_0 == GREATER ) ) { int LA45_7 = input . LA ( 2 ) ; if ( ( synpred13_DRL6Expressions ( ) ) ) { alt45 = 1 ; } } switch ( alt45 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 461:7 : ( shiftOp ) = > shiftOp additiveExpression
{ pushFollow ( FOLLOW_shiftOp_in_shiftExpression2160 ) ; shiftOp ( ) ; state . _fsp -- ; if ( state . failed ) return retval ; pushFollow ( FOLLOW_additiveExpression_in_shiftExpression2162 ) ; additiveExpression ( ) ; state . _fsp -- ; if ( state . failed ) return retval ; } break ; default : break loop45 ; } } } retval . stop = input . LT ( - 1 ) ; } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving
} return retval ; |
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 support
* @ return new { @ code ChronoFormatter } - instance
* @ throws UnsupportedOperationException if given style is not supported
* @ see DisplayMode
* @ since 3.10/4.7 */
public static < T extends LocalizedPatternSupport > ChronoFormatter < T > ofStyle ( DisplayMode style , Locale locale , Chronology < T > chronology ) { } } | 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 !
// } else if ( chronology . equals ( Moment . axis ( ) ) ) {
// throw new UnsupportedOperationException ( " Timezone required , use ' ofMomentStyle ( ) ' instead . " ) ;
} else { throw new UnsupportedOperationException ( "Localized format patterns not available: " + chronology ) ; } |
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 ignored .
* @ param prefix a prefix to apply to the mapped variable names
* @ param separator the field delimiter
* @ return a map of ( name , value ) pairs */
public Map < String , String > getDataAsMap ( String prefix , String separator ) { } } | 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 */
public Val [ ] nextArray ( String expectedName ) throws IOException { } } | 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 ; JobExecutionInner & gt ; object */
public Observable < ServiceResponse < Page < JobExecutionInner > > > listByJobExecutionNextWithServiceResponseAsync ( final String nextPageLink ) { } } | return listByJobExecutionNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < JobExecutionInner > > , Observable < ServiceResponse < Page < JobExecutionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < JobExecutionInner > > > call ( ServiceResponse < Page < JobExecutionInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listByJobExecutionNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ; |
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 description of this feature used by { @ code describeTo }
* @ param featureName
* the name of this feature used by { @ code describeMismatch }
* @ param featureFunction
* a function to extract the feature from the object
* @ param featureMatcher
* the matcher to apply to the specified feature
* @ param < T >
* the type of the object to be matched
* @ param < U >
* the type of the feature to be matched
* @ return the feature matcher */
public static < T , U > Matcher < T > hasFeature ( String featureDescription , String featureName , Function < T , U > featureFunction , Matcher < ? super U > featureMatcher ) { } } | 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 array list or string
* @ throws IllegalPositionIndexException
* if the index is not a valid position index within an array , list or string of size < em > size < / em > */
@ Throws ( IllegalPositionIndexException . class ) public static void positionIndex ( final boolean condition , final int index , final int size ) { } } | 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 false otherwise */
public boolean hasAncestorOfType ( Type firstType , Type ... additionalTypes ) { } } | 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 . updateWithChangedGroups ( groups ) ; m_state = state ; } } |
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 since before plugins were " unbundled " . < / li >
* < li > Are dependencies of one of the above e . g . script - security is not one of the detached plugins but it must be loaded if matrix - project is loaded . < / li >
* < / ul > */
protected void loadDetachedPlugins ( ) { } } | 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 is version {1}." , new Object [ ] { lastExecVersion , Jenkins . VERSION } ) ; final List < DetachedPluginsUtil . DetachedPlugin > detachedPlugins = DetachedPluginsUtil . getDetachedPlugins ( lastExecVersion ) ; Set < String > loadedDetached = loadPluginsFromWar ( "/WEB-INF/detached-plugins" , new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { name = normalisePluginName ( name ) ; // If this was a plugin that was detached some time in the past i . e . not just one of the
// plugins that was bundled " for fun " .
if ( DetachedPluginsUtil . isDetachedPlugin ( name ) ) { VersionNumber installedVersion = getPluginVersion ( rootDir , name ) ; VersionNumber bundledVersion = getPluginVersion ( dir , name ) ; // If the plugin is already installed , we need to decide whether to replace it with the bundled version .
if ( installedVersion != null && bundledVersion != null ) { // If the installed version is older than the bundled version , then it MUST be upgraded .
// If the installed version is newer than the bundled version , then it MUST NOT be upgraded .
// If the versions are equal we just keep the installed version .
return installedVersion . isOlderThan ( bundledVersion ) ; } } // If it ' s a plugin that was detached since the last running version .
for ( DetachedPluginsUtil . DetachedPlugin detachedPlugin : detachedPlugins ) { if ( detachedPlugin . getShortName ( ) . equals ( name ) ) { return true ; } } // Otherwise skip this and do not install .
return false ; } } ) ; LOGGER . log ( INFO , "Upgraded Jenkins from version {0} to version {1}. Loaded detached plugins (and dependencies): {2}" , new Object [ ] { lastExecVersion , Jenkins . VERSION , loadedDetached } ) ; InstallUtil . saveLastExecVersion ( ) ; } else { final Set < DetachedPluginsUtil . DetachedPlugin > forceUpgrade = new HashSet < > ( ) ; // TODO using getDetachedPlugins here seems wrong ; should be forcing an upgrade when the installed version is older than that in WEB - INF / detached - plugins /
for ( DetachedPluginsUtil . DetachedPlugin p : DetachedPluginsUtil . getDetachedPlugins ( ) ) { VersionNumber installedVersion = getPluginVersion ( rootDir , p . getShortName ( ) ) ; VersionNumber requiredVersion = p . getRequiredVersion ( ) ; if ( installedVersion != null && installedVersion . isOlderThan ( requiredVersion ) ) { LOGGER . log ( Level . WARNING , "Detached plugin {0} found at version {1}, required minimum version is {2}" , new Object [ ] { p . getShortName ( ) , installedVersion , requiredVersion } ) ; forceUpgrade . add ( p ) ; } } if ( ! forceUpgrade . isEmpty ( ) ) { Set < String > loadedDetached = loadPluginsFromWar ( "/WEB-INF/detached-plugins" , new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { name = normalisePluginName ( name ) ; for ( DetachedPluginsUtil . DetachedPlugin detachedPlugin : forceUpgrade ) { if ( detachedPlugin . getShortName ( ) . equals ( name ) ) { return true ; } } return false ; } } ) ; LOGGER . log ( INFO , "Upgraded detached plugins (and dependencies): {0}" , new Object [ ] { loadedDetached } ) ; } } |
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 setDirectoryPath ( String pidsfilepath ) { } } | 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で 、 シートが見つからない場合 、 マッピング結果には含まれません 。
* @ throws IllegalArgumentException { @ literal xlsIn = = null or classes = = null }
* @ throws IllegalArgumentException { @ literal calsses . length = = 0}
* @ throws IOException ファイルの読み込みに失敗した場合
* @ throws XlsMapperException マッピングに失敗した場合 */
@ SuppressWarnings ( { } } | "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 = new AnnotationReader ( configuration . getAnnotationMapping ( ) . orElse ( null ) ) ; final MultipleSheetBindingErrors < Object > multipleStore = new MultipleSheetBindingErrors < > ( ) ; final Workbook book ; try { book = WorkbookFactory . create ( xlsIn ) ; } catch ( InvalidFormatException e ) { throw new XlsMapperException ( MessageBuilder . create ( "file.failLoadExcel.notSupportType" ) . format ( ) , e ) ; } for ( Class < ? > clazz : classes ) { final XlsSheet sheetAnno = clazz . getAnnotation ( XlsSheet . class ) ; if ( sheetAnno == null ) { throw new AnnotationInvalidException ( sheetAnno , MessageBuilder . create ( "anno.notFound" ) . varWithClass ( "property" , clazz ) . varWithAnno ( "anno" , XlsSheet . class ) . format ( ) ) ; } try { final Sheet [ ] xlsSheet = configuration . getSheetFinder ( ) . findForLoading ( book , sheetAnno , annoReader , clazz ) ; for ( Sheet sheet : xlsSheet ) { multipleStore . addBindingErrors ( loadSheet ( sheet , ( Class ) clazz , annoReader ) ) ; } } catch ( SheetNotFoundException ex ) { if ( ! configuration . isIgnoreSheetNotFound ( ) ) { logger . warn ( MessageBuilder . create ( "log.skipNotFoundSheet" ) . format ( ) , ex ) ; throw ex ; } } } return multipleStore ; |
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 Schedule that defines how this project ' s iterations are
* spaced .
* @ param attributes additional attributes for the Project .
* @ return A newly minted Project that exists in the VersionOne system . */
public Project project ( String name , AssetID parentProjectID , DateTime beginDate , Schedule schedule , Map < String , Object > attributes ) { } } | 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_DOES_NOT_MODIFY_PAYLOAD_AFTER_SET ) ; String consProp = ( String ) passThruProps . get ( JmsraConstants . CONSUMER_DOES_NOT_MODIFY_PAYLOAD_AFTER_GET ) ; // Check property values & assign message attributes accordingly
msg . producerWontModifyPayloadAfterSet = prodProp . equalsIgnoreCase ( ApiJmsConstants . WILL_NOT_MODIFY_PAYLOAD ) ; msg . consumerWontModifyPayloadAfterGet = consProp . equalsIgnoreCase ( ApiJmsConstants . WILL_NOT_MODIFY_PAYLOAD ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setMessageProperties" ) ; |
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 > Set < O > transform ( Set < O > set ) { } } | 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 setPricingMethod ( com . google . api . ads . admanager . axis . v201805 . PricingMethod pricingMethod ) { } } | 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_VALUE ] , "attempt to retrieve security info failed" ) ; } return null ; } return super . getAttribute ( pName ) ; |
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 boolean indicating in the timeStep provided is final or if it needs to be
* refined
* @ param currentSolution
* @ param rainArray
* @ param etpArray */
private void step ( double currentTimeInMinutes , double [ ] initialConditions , double timeStepInMinutes , boolean finalize , CurrentTimestepSolution currentSolution , double [ ] rainArray , double [ ] etpArray ) { } } | 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 ] * k0 [ i ] ) ; double [ ] k1 = duffy . eval ( currentTimeInMinutes , carrier , rainArray , etpArray , false ) ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) carrier [ i ] = Math . max ( 0 , initialConditions [ i ] + timeStepInMinutes * ( b [ 2 ] [ 0 ] * k0 [ i ] + b [ 2 ] [ 1 ] * k1 [ i ] ) ) ; double [ ] k2 = duffy . eval ( currentTimeInMinutes , carrier , rainArray , etpArray , false ) ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) carrier [ i ] = Math . max ( 0 , initialConditions [ i ] + timeStepInMinutes * ( b [ 3 ] [ 0 ] * k0 [ i ] + b [ 3 ] [ 1 ] * k1 [ i ] + b [ 3 ] [ 2 ] * k2 [ i ] ) ) ; double [ ] k3 = duffy . eval ( currentTimeInMinutes , carrier , rainArray , etpArray , false ) ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) carrier [ i ] = Math . max ( 0 , initialConditions [ i ] + timeStepInMinutes * ( b [ 4 ] [ 0 ] * k0 [ i ] + b [ 4 ] [ 1 ] * k1 [ i ] + b [ 4 ] [ 2 ] * k2 [ i ] + b [ 4 ] [ 3 ] * k3 [ i ] ) ) ; double [ ] k4 = duffy . eval ( currentTimeInMinutes , carrier , rainArray , etpArray , false ) ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) carrier [ i ] = Math . max ( 0 , initialConditions [ i ] + timeStepInMinutes * ( b [ 5 ] [ 0 ] * k0 [ i ] + b [ 5 ] [ 1 ] * k1 [ i ] + b [ 5 ] [ 2 ] * k2 [ i ] + b [ 5 ] [ 3 ] * k3 [ i ] + b [ 5 ] [ 4 ] * k4 [ i ] ) ) ; double [ ] k5 = duffy . eval ( currentTimeInMinutes , carrier , rainArray , etpArray , isAtFinalSubtimestep ) ; double [ ] newY = new double [ initialConditions . length ] ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) { newY [ i ] = initialConditions [ i ] + timeStepInMinutes * ( c [ 0 ] * k0 [ i ] + c [ 1 ] * k1 [ i ] + c [ 2 ] * k2 [ i ] + c [ 3 ] * k3 [ i ] + c [ 4 ] * k4 [ i ] + c [ 5 ] * k5 [ i ] ) ; newY [ i ] = Math . max ( 0 , newY [ i ] ) ; if ( Double . isInfinite ( newY [ i ] ) || newY [ i ] != newY [ i ] ) { throw new ModelsIllegalargumentException ( "An error occurred during the integration procedure." , this ) ; } } double [ ] newYstar = new double [ initialConditions . length ] ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) { newYstar [ i ] = initialConditions [ i ] + timeStepInMinutes * ( cStar [ 0 ] * k0 [ i ] + cStar [ 1 ] * k1 [ i ] + cStar [ 2 ] * k2 [ i ] + cStar [ 3 ] * k3 [ i ] + cStar [ 4 ] * k4 [ i ] + cStar [ 5 ] * k5 [ i ] ) ; newYstar [ i ] = Math . max ( 0 , newYstar [ i ] ) ; if ( Double . isInfinite ( newYstar [ i ] ) || newYstar [ i ] != newYstar [ i ] ) { throw new ModelsIllegalargumentException ( "An error occurred during the integration procedure." , this ) ; } } double delta = 0 ; for ( int i = 0 ; i < initialConditions . length ; i ++ ) { if ( ( newY [ i ] + newYstar [ i ] ) > 0 ) delta = Math . max ( delta , Math . abs ( 2 * ( newY [ i ] - newYstar [ i ] ) / ( newY [ i ] + newYstar [ i ] ) ) ) ; } double newTimeStepInMinutes = timeStepInMinutes ; if ( finalize ) { currentSolution . newTimeStepInMinutes = newTimeStepInMinutes ; currentSolution . solution = newY ; } else { double factor ; if ( delta != 0.0 ) { factor = epsilon / delta ; if ( factor >= 1 ) newTimeStepInMinutes = timeStepInMinutes * Math . pow ( factor , 0.15 ) ; else newTimeStepInMinutes = timeStepInMinutes * Math . pow ( factor , 0.25 ) ; } else { factor = 1e8 ; newTimeStepInMinutes = timeStepInMinutes * Math . pow ( factor , 0.15 ) ; finalize = true ; } // System . out . println ( " - - > " + timeStep + " " + epsilon + " " + Delta + " " + factor + "
// " + newTimeStep + " ( " + java . util . Calendar . getInstance ( ) . getTime ( ) + " ) " ) ;
step ( currentTimeInMinutes , initialConditions , newTimeStepInMinutes , true , currentSolution , rainArray , etpArray ) ; } |
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 config source
// It was introduced as a quick fix for issue # 3997 but we might reconsider the design at some point
} return theValue ; |
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={}]" , name , transformedValue , dataType ) ; try ( GMetric metric = new GMetric ( host , port , addressingMode , ttl , v31 , null , spoofedHostName ) ) { metric . announce ( name , transformedValue . toString ( ) , dataType , units , slope , tmax , dmax , groupName ) ; } } |
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 certificateDistinguishedName Distinguished name to to use for the certificate order .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the AppServiceCertificateOrderInner object */
public Observable < AppServiceCertificateOrderInner > updateAsync ( String resourceGroupName , String certificateOrderName , AppServiceCertificateOrderPatchResource certificateDistinguishedName ) { } } | return updateWithServiceResponseAsync ( resourceGroupName , certificateOrderName , certificateDistinguishedName ) . map ( new Func1 < ServiceResponse < AppServiceCertificateOrderInner > , AppServiceCertificateOrderInner > ( ) { @ Override public AppServiceCertificateOrderInner call ( ServiceResponse < AppServiceCertificateOrderInner > response ) { return response . body ( ) ; } } ) ; |
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 ( ) , ENGINEVERSION_BINDING ) ; protocolMarshaller . marshall ( createConfigurationRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createConfigurationRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 .
* < p > TODO ( lukes ) : it would be better if the VariableSet would save / restore . . . the issue is
* allowing multiple uses within a template to share the field . */
FieldRef getCurrentAppendable ( ) { } } | 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 # joining ( CharSequence , CharSequence , CharSequence ) } , but
* can be further set up in a flexible way , for example , specifying the
* maximal allowed length of the resulting { @ code String } .
* If length limit is specified for the collector , the prefix length and the
* suffix length are also counted towards this limit . If the length of the
* prefix and the suffix exceed the limit , the resulting collector will not
* accumulate any elements and produce the same output . For example ,
* { @ code stream . collect ( Joining . with ( " , " ) . wrap ( " prefix " , " suffix " ) . maxChars ( 9 ) ) }
* will produce { @ code " prefixsuf " } string regardless of the input stream
* content .
* You may wrap several times :
* { @ code Joining . with ( " , " ) . wrap ( " [ " , " ] " ) . wrap ( " ( " , " ) " ) } is equivalent to
* { @ code Joining . with ( " , " ) . wrap ( " ( [ " , " ] ) " ) } .
* @ param prefix the sequence of characters to be used at the beginning of
* the joined result
* @ param suffix the sequence of characters to be used at the end of the
* joined result
* @ return a new { @ code Collector } which wraps the result with the specified
* prefix and suffix . */
public Joining wrap ( CharSequence prefix , CharSequence suffix ) { } } | 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 ( "java.time" ) && methodSymbol . getModifiers ( ) . contains ( Modifier . PUBLIC ) ) { if ( ALLOWED_JAVA_TIME_METHODS . matches ( tree , state ) ) { return false ; } return true ; } } return false ; |
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
* chained together .
* @ see ScanRequest # withExpressionAttributeNames ( Map ) */
public DynamoDBScanExpression withExpressionAttributeNames ( java . util . Map < String , String > expressionAttributeNames ) { } } | 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 ( ) throws ParserException , GrammarException { } } | 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 ( ) ) { token = getTokenStream ( ) . get ( streamPosition ) ; actionSet = parserTable . getActionSet ( stateStack . peek ( ) , new Terminal ( token . getName ( ) , token . getText ( ) ) ) ; } else { token = null ; actionSet = parserTable . getActionSet ( stateStack . peek ( ) , FinishTerminal . getInstance ( ) ) ; } if ( logger . isTraceEnabled ( ) ) { logger . trace ( actionSet . toString ( ) ) ; } final ParserAction action = getAction ( actionSet ) ; switch ( action . getAction ( ) ) { case SHIFT : shift ( action ) ; break ; case REDUCE : reduce ( action ) ; break ; case ACCEPT : accept ( action ) ; accepted = true ; break ; case ERROR : error ( ) ; break ; default : throw new ParserException ( "Invalid action '" + action + "'for parser near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'!" ) ; } } while ( ! accepted ) ; |
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 different .
// but don ' t bother loading parsing the class again
Script s = InvokerHelper . createScript ( scriptClass , context ) ; return s . run ( ) ; } catch ( Exception e ) { throw new BSFException ( BSFException . REASON_EXECUTION_ERROR , "exception from Groovy: " + e , e ) ; } |
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 this information . */
protected void writeCache ( ) throws IOException { } } | 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 */
public static IBioPolymer addAminoAcidAtNTerminus ( IBioPolymer protein , IAminoAcid aaToAdd , IStrand strand , IAminoAcid aaToAddTo ) { } } | // 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 ( ) . newInstance ( IBond . class , aaToAddTo . getNTerminus ( ) , aaToAdd . getCTerminus ( ) , IBond . Order . SINGLE ) ) ; } // else : no current N - terminus , so nothing special to do
return protein ; |
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 extended
* period , then wait logging is quiesced to avoid overwhelming the logs . If and when a thread
* that has been reported as being stuck finally does obtain the lock , then a warning level
* message is logged to indicate that the thread is resuming .
* @ param lock
* the Lock object to wait on
* @ param callerClass
* the caller class
* @ param callerMethod
* the caller method
* @ param args
* extra arguments to be appended to the log message */
public static void lock ( Lock lock , String callerClass , String callerMethod , Object ... args ) { } } | 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 . currentTimeMillis ( ) ; boolean quiesced = false , logged = false ; try { while ( ! lock . tryLock ( SIGNAL_LOG_INTERVAL_SECONDS , TimeUnit . SECONDS ) ) { if ( ! quiesced ) { quiesced = logWaiting ( callerClass , callerMethod , lock , start , args ) ; logged = true ; } } } catch ( InterruptedException ex ) { // InterruptedException is not thrown by Lock . lock ( ) so convert to a
// RuntimeException .
throw new RuntimeException ( ex ) ; } if ( logged ) { logResuming ( callerClass , callerMethod , lock , start ) ; } if ( isTraceLogging ) { log . exiting ( sourceClass , sourceMethod , Arrays . asList ( Thread . currentThread ( ) , lock , callerClass , callerMethod ) ) ; } return ; |
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 . getWorkspaceProperties ( ) , WORKSPACEPROPERTIES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
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 if < code > array < / code > is empty
* @ see IEEE754rUtils # max ( float [ ] ) IEEE754rUtils for a version of this method that handles NaN differently
* @ since 3.4 Changed signature from max ( float [ ] ) to max ( float . . . ) */
public static float max ( final float ... array ) { } } | // 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 .
* @ param resources
* The resources associated with this policy statement .
* @ throws IllegalArgumentException
* If the list of resources contains both a Resource and a NotResource */
public void setResources ( Collection < Resource > resources ) { } } | 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 ( DBIDs ids ) { } } | 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 ( ) ) { if ( idsSet . contains ( it ) ) { rkNN_ids . add ( iditer ) ; break ; } } } // update the kNNs of the RkNNs
List < ? extends KNNList > kNNList = knnQuery . getKNNForBulkDBIDs ( rkNN_ids , k ) ; DBIDIter iter = rkNN_ids . iter ( ) ; for ( int i = 0 ; i < rkNN_ids . size ( ) ; i ++ , iter . advance ( ) ) { storage . put ( iter , kNNList . get ( i ) ) ; } return rkNN_ids ; |
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 , EntityPlayerMP player ) { } } | 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 . reconnectIvlMax > 0 && options . reconnectIvlMax > options . reconnectIvl ) { // Calculate the next interval
currentReconnectIvl = Math . min ( currentReconnectIvl * 2 , options . reconnectIvlMax ) ; } return interval ; |
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 number of milliseconds for the current { @ link Thread } to sleep .
* @ param runnable { @ link Runnable } object to run ; must not be { @ literal null } .
* @ return a boolean value indicating whether the { @ link Runnable } ran successfully
* and whether the current { @ link Thread } slept for the given number of milliseconds .
* @ throws IllegalArgumentException if milliseconds is less than equal to 0.
* @ throws SleepDeprivedException if the current { @ link Thread } is interrupted while sleeping .
* @ see org . cp . elements . lang . concurrent . ThreadUtils # sleep ( long , int )
* @ see java . lang . Runnable # run ( ) */
public static boolean runWithSleepThrowOnInterrupt ( long milliseconds , Runnable runnable ) { } } | 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 UnsupportedEncodingException { } } | 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 httpClient ) { } } | 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 .
* @ param name Name of the App Service Environment .
* @ param workerPoolName Name of the worker pool .
* @ param instance Name of the instance in the worker pool .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; ResourceMetricInner & gt ; object */
public Observable < Page < ResourceMetricInner > > listWorkerPoolInstanceMetricsAsync ( final String resourceGroupName , final String name , final String workerPoolName , final String instance ) { } } | return listWorkerPoolInstanceMetricsWithServiceResponseAsync ( resourceGroupName , name , workerPoolName , instance ) . map ( new Func1 < ServiceResponse < Page < ResourceMetricInner > > , Page < ResourceMetricInner > > ( ) { @ Override public Page < ResourceMetricInner > call ( ServiceResponse < Page < ResourceMetricInner > > response ) { return response . body ( ) ; } } ) ; |
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 : / / docs . aws . amazon . com / goto / WebAPI / alexaforbusiness - 2017-11-09 / GetRoom " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public GetRoomResult getRoom ( GetRoomRequest request ) { } } | 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 ( currentQuery ) ; currentQuery = null ; } if ( part . getMaximumOccurence ( ) > 1 ) { MtasSpanQuery q = new MtasSpanRecurrenceQuery ( part . getQuery ( ) , part . getMinimumOccurence ( ) , part . getMaximumOccurence ( ) , ignoreClause , maximumIgnoreLength ) ; currentQuery = new MtasSpanSequenceItem ( q , part . isOptional ( ) ) ; } else { currentQuery = new MtasSpanSequenceItem ( part . getQuery ( ) , part . isOptional ( ) ) ; } // add to list , if it exists
if ( currentQueryList != null ) { currentQueryList . add ( currentQuery ) ; currentQuery = null ; } } if ( currentQueryList != null ) { return new MtasSpanSequenceQuery ( currentQueryList , ignoreClause , maximumIgnoreLength ) ; } else if ( currentQuery . isOptional ( ) ) { currentQueryList = new ArrayList < MtasSpanSequenceItem > ( ) ; currentQueryList . add ( currentQuery ) ; currentQuery = null ; return new MtasSpanSequenceQuery ( currentQueryList , ignoreClause , maximumIgnoreLength ) ; } else { return currentQuery . getQuery ( ) ; } |
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 WebApplicationService service , final Class ownerClass ) { } } | 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 ( InputStream avatar , String fileType ) { } } | 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 = notification ; else msgs . add ( notification ) ; } return msgs ; |
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 ( registry == null ) { ExtensionClass < Registry > ext = ExtensionLoaderFactory . getExtensionLoader ( Registry . class ) . getExtensionClass ( registryConfig . getProtocol ( ) ) ; if ( ext == null ) { throw ExceptionUtils . buildRuntime ( "registry.protocol" , registryConfig . getProtocol ( ) , "Unsupported protocol of registry config !" ) ; } registry = ext . getExtInstance ( new Class [ ] { RegistryConfig . class } , new Object [ ] { registryConfig } ) ; ALL_REGISTRIES . put ( registryConfig , registry ) ; } return registry ; } catch ( SofaRpcRuntimeException e ) { throw e ; } catch ( Throwable e ) { throw new SofaRpcRuntimeException ( e . getMessage ( ) , e ) ; } |
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 . currentTimeMillis ( ) - start ; timeTook = timeTook / 1000 ; reporter . pass ( action , expected , "Loaded " + url + " in " + timeTook + SECONDS ) ; acceptCertificate ( ) ; |
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 replaced of course .
* @ param e1 object you want replaced ; must have a value at the specified path
* @ param e2 replacement
* @ param path path
* @ return true if something was replaced . */
public boolean replaceObject ( JsonObject e1 , JsonObject e2 , String ... path ) { } } | 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 ( path ) ; if ( compareElement . equals ( fieldValue ) ) { set ( i , e2 ) ; return true ; } } i ++ ; } return false ; |
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 ( ValueConsts . EMPTY_STRING , obj ) ) ) ; return builder . substring ( 0 , builder . length ( ) - 1 ) + "]," ; } else if ( object instanceof Map ) { Map map = ( Map ) object ; builder . append ( "{" ) ; map . forEach ( ( k , v ) -> builder . append ( converter ( k . toString ( ) , v ) ) ) ; return builder . substring ( 0 , builder . length ( ) - 1 ) + "}," ; } else if ( Checker . isEmpty ( fieldName ) ) { builder . append ( "\"" ) . append ( object ) . append ( "\"," ) ; } else { builder . append ( "\"" ) . append ( object ) . append ( "\"," ) ; } return builder . toString ( ) ; |
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 . execute ( ) ; } } |
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
* @ param fieldClass The declared type of array at the given offset
* @ param offset The offset to copy from
* @ param referencesToReuse An identity map of references to reuse - this is further populated as the copy progresses .
* The key is the original object reference - the value is the copied instance for that original . */
public final void deepCopyArrayAtOffset ( Object source , Object copy , Class < ? > fieldClass , long offset , IdentityHashMap < Object , Object > referencesToReuse ) { } } | 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 < / CODE > the image is treated as black and white
* @ return an object of type < CODE > ImgRaw < / CODE >
* @ throws BadElementException
* on error
* @ throws IOException
* on error */
public static Image getInstance ( java . awt . Image image , java . awt . Color color , boolean forceBW ) throws BadElementException , IOException { } } | 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 ( InterruptedException e ) { throw new IOException ( "java.awt.Image Interrupted waiting for pixels!" ) ; } if ( ( pg . getStatus ( ) & java . awt . image . ImageObserver . ABORT ) != 0 ) { throw new IOException ( "java.awt.Image fetch aborted or errored" ) ; } int w = pg . getWidth ( ) ; int h = pg . getHeight ( ) ; int [ ] pixels = ( int [ ] ) pg . getPixels ( ) ; if ( forceBW ) { int byteWidth = ( w / 8 ) + ( ( w & 7 ) != 0 ? 1 : 0 ) ; byte [ ] pixelsByte = new byte [ byteWidth * h ] ; int index = 0 ; int size = h * w ; int transColor = 1 ; if ( color != null ) { transColor = ( color . getRed ( ) + color . getGreen ( ) + color . getBlue ( ) < 384 ) ? 0 : 1 ; } int transparency [ ] = null ; int cbyte = 0x80 ; int wMarker = 0 ; int currByte = 0 ; if ( color != null ) { for ( int j = 0 ; j < size ; j ++ ) { int alpha = ( pixels [ j ] >> 24 ) & 0xff ; if ( alpha < 250 ) { if ( transColor == 1 ) currByte |= cbyte ; } else { if ( ( pixels [ j ] & 0x888 ) != 0 ) currByte |= cbyte ; } cbyte >>= 1 ; if ( cbyte == 0 || wMarker + 1 >= w ) { pixelsByte [ index ++ ] = ( byte ) currByte ; cbyte = 0x80 ; currByte = 0 ; } ++ wMarker ; if ( wMarker >= w ) wMarker = 0 ; } } else { for ( int j = 0 ; j < size ; j ++ ) { if ( transparency == null ) { int alpha = ( pixels [ j ] >> 24 ) & 0xff ; if ( alpha == 0 ) { transparency = new int [ 2 ] ; /* bugfix by M . P . Liston , ASC , was : . . . ? 1 : 0; */
transparency [ 0 ] = transparency [ 1 ] = ( ( pixels [ j ] & 0x888 ) != 0 ) ? 0xff : 0 ; } } if ( ( pixels [ j ] & 0x888 ) != 0 ) currByte |= cbyte ; cbyte >>= 1 ; if ( cbyte == 0 || wMarker + 1 >= w ) { pixelsByte [ index ++ ] = ( byte ) currByte ; cbyte = 0x80 ; currByte = 0 ; } ++ wMarker ; if ( wMarker >= w ) wMarker = 0 ; } } return Image . getInstance ( w , h , 1 , 1 , pixelsByte , transparency ) ; } else { byte [ ] pixelsByte = new byte [ w * h * 3 ] ; byte [ ] smask = null ; int index = 0 ; int size = h * w ; int red = 255 ; int green = 255 ; int blue = 255 ; if ( color != null ) { red = color . getRed ( ) ; green = color . getGreen ( ) ; blue = color . getBlue ( ) ; } int transparency [ ] = null ; if ( color != null ) { for ( int j = 0 ; j < size ; j ++ ) { int alpha = ( pixels [ j ] >> 24 ) & 0xff ; if ( alpha < 250 ) { pixelsByte [ index ++ ] = ( byte ) red ; pixelsByte [ index ++ ] = ( byte ) green ; pixelsByte [ index ++ ] = ( byte ) blue ; } else { pixelsByte [ index ++ ] = ( byte ) ( ( pixels [ j ] >> 16 ) & 0xff ) ; pixelsByte [ index ++ ] = ( byte ) ( ( pixels [ j ] >> 8 ) & 0xff ) ; pixelsByte [ index ++ ] = ( byte ) ( ( pixels [ j ] ) & 0xff ) ; } } } else { int transparentPixel = 0 ; smask = new byte [ w * h ] ; boolean shades = false ; for ( int j = 0 ; j < size ; j ++ ) { byte alpha = smask [ j ] = ( byte ) ( ( pixels [ j ] >> 24 ) & 0xff ) ; /* bugfix by Chris Nokleberg */
if ( ! shades ) { if ( alpha != 0 && alpha != - 1 ) { shades = true ; } else if ( transparency == null ) { if ( alpha == 0 ) { transparentPixel = pixels [ j ] & 0xffffff ; transparency = new int [ 6 ] ; transparency [ 0 ] = transparency [ 1 ] = ( transparentPixel >> 16 ) & 0xff ; transparency [ 2 ] = transparency [ 3 ] = ( transparentPixel >> 8 ) & 0xff ; transparency [ 4 ] = transparency [ 5 ] = transparentPixel & 0xff ; } } else if ( ( pixels [ j ] & 0xffffff ) != transparentPixel ) { shades = true ; } } pixelsByte [ index ++ ] = ( byte ) ( ( pixels [ j ] >> 16 ) & 0xff ) ; pixelsByte [ index ++ ] = ( byte ) ( ( pixels [ j ] >> 8 ) & 0xff ) ; pixelsByte [ index ++ ] = ( byte ) ( ( pixels [ j ] ) & 0xff ) ; } if ( shades ) transparency = null ; else smask = null ; } Image img = Image . getInstance ( w , h , 3 , 8 , pixelsByte , transparency ) ; if ( smask != null ) { Image sm = Image . getInstance ( w , h , 1 , 8 , smask ) ; try { sm . makeMask ( ) ; img . setImageMask ( sm ) ; } catch ( DocumentException de ) { throw new ExceptionConverter ( de ) ; } } return img ; } |
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 name */
protected static String findControllerNamePart ( String pack , String uri ) { } } | 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 did not specify controller name" ) ; return temp . split ( "\\." ) [ 0 ] ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.