signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JobExecutionPlanDagFactory { /** * The job name is derived from the { @ link ConfigurationKeys # JOB _ NAME _ KEY } config . It is assumed to be unique * across all jobs in a { @ link Dag } . * @ param jobExecutionPlan * @ return the name of the job . */ private static String getJobName ( JobExecutionPlan jobExecutionPlan ) { } }
return jobExecutionPlan . getJobSpec ( ) . getConfig ( ) . getString ( ConfigurationKeys . JOB_NAME_KEY ) ;
public class EditorModel { /** * Show next element . * @ param event the next event to show */ private void showNext ( final JRebirthEvent event ) { } }
this . timeFrame ++ ; callCommand ( ProcessEventCommand . class , WBuilder . waveData ( EditorWaves . EVENT , event ) ) ;
public class ElemLiteralResult { /** * Get an " extension - element - prefix " property . * @ see < a href = " http : / / www . w3 . org / TR / xslt # extension - element " > extension - element in XSLT Specification < / a > * @ param i Index of URI ( " extension - element - prefix " property ) to get * @ return URI at given index ( " extension - element - prefix " property ) * @ throws ArrayIndexOutOfBoundsException */ public String getExtensionElementPrefix ( int i ) throws ArrayIndexOutOfBoundsException { } }
if ( null == m_ExtensionElementURIs ) throw new ArrayIndexOutOfBoundsException ( ) ; return m_ExtensionElementURIs . elementAt ( i ) ;
public class JavaCompilerUtil { /** * Returns the classpath for the compiler . */ private String buildClassPath ( ) { } }
String classPath = null ; // _ classPath ; if ( classPath != null ) { return classPath ; } if ( classPath == null && _loader instanceof DynamicClassLoader ) { classPath = ( ( DynamicClassLoader ) _loader ) . getClassPath ( ) ; } else { // if ( true | | _ loader instanceof URLClassLoader ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( CauchoUtil . getClassPath ( ) ) ; if ( _loader != null ) buildClassPath ( sb , _loader ) ; classPath = sb . toString ( ) ; } // else if ( classPath = = null ) // classPath = CauchoSystem . getClassPath ( ) ; String srcDirName = getSourceDirName ( ) ; String classDirName = getClassDirName ( ) ; char sep = CauchoUtil . getPathSeparatorChar ( ) ; if ( _extraClassPath != null ) classPath = classPath + sep + _extraClassPath ; // Adding the srcDir lets javac and jikes find source files if ( ! srcDirName . equals ( classDirName ) ) classPath = srcDirName + sep + classPath ; classPath = classDirName + sep + classPath ; return classPath ;
public class HDUtils { /** * Append a derivation level to an existing path */ public static ImmutableList < ChildNumber > append ( List < ChildNumber > path , ChildNumber childNumber ) { } }
return ImmutableList . < ChildNumber > builder ( ) . addAll ( path ) . add ( childNumber ) . build ( ) ;
public class SSLSocket { /** * / * - - - - - [ App Write ] - - - - - */ @ Override public void addWriteInterest ( ) { } }
if ( transportOut . peekOut == this ) transportOut . peekOutInterested = true ; if ( engine . isOutboundDone ( ) ) transportOut . wakeupWriter ( ) ; else { if ( selfInterests == 0 ) peerOut . addWriteInterest ( ) ; else { if ( ( selfInterests & OP_READ ) != 0 ) peerIn . addReadInterest ( ) ; if ( ( selfInterests & OP_WRITE ) != 0 ) peerOut . addWriteInterest ( ) ; } }
public class mps_doc_image { /** * Use this API to fetch filtered set of mps _ doc _ image resources . * set the filter parameter values in filtervalue object . */ public static mps_doc_image [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { } }
mps_doc_image obj = new mps_doc_image ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; mps_doc_image [ ] response = ( mps_doc_image [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class AopLogUtils { /** * 获取 { @ link AopLog } 注解中的描述 * @ param className 类名 : joinPoint # getTarget # getClass # getName * @ param methodName 方法名 : joinPoint # getSignature # getName * @ param args 参数数组 : joinPoint # getArgs * @ return 描述 * @ since 1.1.0 */ public static String getDescriptionNoThrow ( String className , String methodName , Object [ ] args ) { } }
try { return getDescription ( className , methodName , args ) ; } catch ( ClassNotFoundException e ) { LoggerUtils . error ( "get description from {}#{} error: {}" , className , methodName , e . getMessage ( ) ) ; return "" ; }
public class TSColumnSchema { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case NAME : return isSetName ( ) ; case DATA_TYPE : return isSetDataType ( ) ; case ENCODING : return isSetEncoding ( ) ; case OTHER_ARGS : return isSetOtherArgs ( ) ; } throw new IllegalStateException ( ) ;
public class Entry { /** * Implementation . */ private synchronized void lazyLoad ( ) { } }
if ( formula != null ) { // We ' ve already done this . . . return ; } try { // Obtain the Formula . . . Class < ? > c = grammar . getClassLoader ( ) . loadClass ( clazz ) ; Bootstrappable b = ( Bootstrappable ) c . newInstance ( ) ; Formula frm = b . getFormula ( ) ; // Sanity check - - refuse the formula if the class doesn ' t match ! if ( ! frm . getImplementationClass ( ) . equals ( c ) ) { String msg = "Invalid Formula Provided by Task or Phrase Implementation: class '" + c . getName ( ) + "' provided a formula specifying implementation class '" + frm . getImplementationClass ( ) . getName ( ) + "'." ; throw new RuntimeException ( msg ) ; } // Evaluate the mappings . . . Map < Reagent , Object > mpg = new HashMap < Reagent , Object > ( ) ; if ( contentModel != null ) { for ( Reagent r : frm . getReagents ( ) ) { Object value = r . getReagentType ( ) . evaluate ( grammar , contentModel , r . getXpath ( ) ) ; if ( value != null ) { mpg . put ( r , value ) ; } } } // Evaluate the type . . . Entry . Type y = null ; if ( b instanceof Phrase ) { // NB : For the moment it seems perilous to allow a // single class to define both a Phrase and a Task ; // if it implements Phrase , it ' s a Phrase . y = Entry . Type . PHRASE ; } else if ( b instanceof Task ) { y = Entry . Type . TASK ; } else { String msg = "The specified IMPL class does not implement a " + "known entry type: " + clazz ; throw new RuntimeException ( msg ) ; } // Set the member variables that were lazyLoaded . . . this . type = y ; this . formula = frm ; this . mappings = mpg ; } catch ( Throwable t ) { String msg = "Unable to lazyLoad() the specified entry:" + "\n\t\tname=" + this . name + "\n\t\timpl=" + this . clazz ; throw new RuntimeException ( msg , t ) ; }
public class ParseUtils { /** * Get an exception reporting an unexpected XML attribute . * @ param reader the stream reader * @ param index the attribute index * @ param possibleAttributes attributes that are expected on this element * @ return the exception */ public static XMLStreamException unexpectedAttribute ( final XMLExtendedStreamReader reader , final int index , Set < String > possibleAttributes ) { } }
final XMLStreamException ex = ControllerLogger . ROOT_LOGGER . unexpectedAttribute ( reader . getAttributeName ( index ) , asStringList ( possibleAttributes ) , reader . getLocation ( ) ) ; return new XMLStreamValidationException ( ex . getMessage ( ) , ValidationError . from ( ex , ErrorType . UNEXPECTED_ATTRIBUTE ) . element ( reader . getName ( ) ) . attribute ( reader . getAttributeName ( index ) ) . alternatives ( possibleAttributes ) , ex ) ;
public class StringRecord { /** * Set the Text to range of bytes * @ param utf8 * the data to copy from * @ param start * the first position of the new string * @ param len * the number of bytes of the new string */ public void set ( final byte [ ] utf8 , final int start , final int len ) { } }
setCapacity ( len , false ) ; System . arraycopy ( utf8 , start , bytes , 0 , len ) ; this . length = len ; this . hash = 0 ;
public class CredHubRestTemplateFactory { /** * Create a { @ link RestTemplate } configured for communication with a CredHub server . * @ param properties CredHub connection properties * @ param clientHttpRequestFactory the { @ link ClientHttpRequestFactory } to use when * creating new connections * @ return a configured { @ link RestTemplate } */ static RestTemplate createRestTemplate ( CredHubProperties properties , ClientHttpRequestFactory clientHttpRequestFactory ) { } }
RestTemplate restTemplate = new RestTemplate ( ) ; configureRestTemplate ( restTemplate , properties . getUrl ( ) , clientHttpRequestFactory ) ; return restTemplate ;
public class CmsInheritanceReferenceParser { /** * Parses a given resource . < p > * @ param resource the resource to parse * @ throws CmsException if something goes wrong */ public void parse ( CmsResource resource ) throws CmsException { } }
CmsFile file = m_cms . readFile ( resource ) ; m_resource = resource ; CmsXmlContent content = CmsXmlContentFactory . unmarshal ( m_cms , file ) ; parse ( content ) ;
public class StringSupport { /** * Retrieves stack trace from throwable . * @ param t * @ param depth * @ return */ public static String getRootCauseAndStackTrace ( Throwable t , int depth ) { } }
while ( t . getCause ( ) != null ) { t = t . getCause ( ) ; } return t . toString ( ) + "\n" + getStackTrace ( t , depth , null ) ;
public class LIBORMarketModel { /** * Return the complete vector of the drift for the time index timeIndex , given that current state is realizationAtTimeIndex . * The drift will be zero for rates being already fixed . * The method currently provides the drift for either < code > Measure . SPOT < / code > or < code > Measure . TERMINAL < / code > - depending how the * model object was constructed . For < code > Measure . TERMINAL < / code > the j - th entry of the return value is the random variable * \ mu _ { j } ^ { \ mathbb { Q } ^ { P ( T _ { n } ) } } ( t ) \ = \ - \ mathop { \ sum _ { l \ geq j + 1 } } _ { l \ leq n - 1 } \ frac { \ delta _ { l } } { 1 + \ delta _ { l } L _ { l } ( t ) } ( \ lambda _ { j } ( t ) \ cdot \ lambda _ { l } ( t ) ) * and for < code > Measure . SPOT < / code > the j - th entry of the return value is the random variable * \ mu _ { j } ^ { \ mathbb { Q } ^ { N } } ( t ) \ = \ \ sum _ { m ( t ) & lt ; l \ leq j } \ frac { \ delta _ { l } } { 1 + \ delta _ { l } L _ { l } ( t ) } ( \ lambda _ { j } ( t ) \ cdot \ lambda _ { l } ( t ) ) * where \ ( \ lambda _ { j } \ ) is the vector for factor loadings for the j - th component of the stochastic process ( that is , the diffusion part is * \ ( \ sum _ { k = 1 } ^ m \ lambda _ { j , k } \ mathrm { d } W _ { k } \ ) ) . * Note : The scalar product of the factor loadings determines the instantaneous covariance . If the model is written in log - coordinates ( using exp as a state space transform ) , we find * \ ( \ lambda _ { j } \ cdot \ lambda _ { l } = \ sum _ { k = 1 } ^ m \ lambda _ { j , k } \ lambda _ { l , k } = \ sigma _ { j } \ sigma _ { l } \ rho _ { j , l } \ ) . * If the model is written without a state space transformation ( in its orignial coordinates ) then \ ( \ lambda _ { j } \ cdot \ lambda _ { l } = \ sum _ { k = 1 } ^ m \ lambda _ { j , k } \ lambda _ { l , k } = L _ { j } L _ { l } \ sigma _ { j } \ sigma _ { l } \ rho _ { j , l } \ ) . * @ see net . finmath . montecarlo . interestrate . LIBORMarketModel # getNumeraire ( double ) The calculation of the drift is consistent with the calculation of the numeraire in < code > getNumeraire < / code > . * @ see net . finmath . montecarlo . interestrate . LIBORMarketModel # getFactorLoading ( int , int , RandomVariableInterface [ ] ) The factor loading \ ( \ lambda _ { j , k } \ ) . * @ param timeIndex Time index < i > i < / i > for which the drift should be returned < i > & mu ; ( t < sub > i < / sub > ) < / i > . * @ param realizationAtTimeIndex Time current forward rate vector at time index < i > i < / i > which should be used in the calculation . * @ return The drift vector & mu ; ( t < sub > i < / sub > ) as < code > RandomVariable [ ] < / code > */ @ Override public RandomVariableInterface [ ] getDrift ( int timeIndex , RandomVariableInterface [ ] realizationAtTimeIndex , RandomVariableInterface [ ] realizationPredictor ) { } }
double time = getTime ( timeIndex ) ; int firstLiborIndex = this . getLiborPeriodIndex ( time ) + 1 ; if ( firstLiborIndex < 0 ) { firstLiborIndex = - firstLiborIndex - 1 + 1 ; } RandomVariableInterface zero = getRandomVariableForConstant ( 0.0 ) ; // Allocate drift vector and initialize to zero ( will be used to sum up drift components ) RandomVariableInterface [ ] drift = new RandomVariableInterface [ getNumberOfComponents ( ) ] ; for ( int componentIndex = firstLiborIndex ; componentIndex < getNumberOfComponents ( ) ; componentIndex ++ ) { drift [ componentIndex ] = zero ; } RandomVariableInterface [ ] covarianceFactorSums = new RandomVariableInterface [ getNumberOfFactors ( ) ] ; for ( int factorIndex = 0 ; factorIndex < getNumberOfFactors ( ) ; factorIndex ++ ) { covarianceFactorSums [ factorIndex ] = zero ; } if ( measure == Measure . SPOT ) { // Calculate drift for the component componentIndex ( starting at firstLiborIndex , others are zero ) for ( int componentIndex = firstLiborIndex ; componentIndex < getNumberOfComponents ( ) ; componentIndex ++ ) { double periodLength = liborPeriodDiscretization . getTimeStep ( componentIndex ) ; RandomVariableInterface libor = realizationAtTimeIndex [ componentIndex ] ; RandomVariableInterface oneStepMeasureTransform = getRandomVariableForConstant ( periodLength ) . discount ( libor , periodLength ) ; if ( stateSpace == StateSpace . LOGNORMAL ) { oneStepMeasureTransform = oneStepMeasureTransform . mult ( libor ) ; } RandomVariableInterface [ ] factorLoading = getFactorLoading ( timeIndex , componentIndex , realizationAtTimeIndex ) ; for ( int factorIndex = 0 ; factorIndex < getNumberOfFactors ( ) ; factorIndex ++ ) { covarianceFactorSums [ factorIndex ] = covarianceFactorSums [ factorIndex ] . add ( oneStepMeasureTransform . mult ( factorLoading [ factorIndex ] ) ) ; drift [ componentIndex ] = drift [ componentIndex ] . addProduct ( covarianceFactorSums [ factorIndex ] , factorLoading [ factorIndex ] ) ; } } } else if ( measure == Measure . TERMINAL ) { // Calculate drift for the component componentIndex ( starting at firstLiborIndex , others are zero ) for ( int componentIndex = getNumberOfComponents ( ) - 1 ; componentIndex >= firstLiborIndex ; componentIndex -- ) { double periodLength = liborPeriodDiscretization . getTimeStep ( componentIndex ) ; RandomVariableInterface libor = realizationAtTimeIndex [ componentIndex ] ; RandomVariableInterface oneStepMeasureTransform = getRandomVariableForConstant ( periodLength ) . discount ( libor , periodLength ) ; if ( stateSpace == StateSpace . LOGNORMAL ) { oneStepMeasureTransform = oneStepMeasureTransform . mult ( libor ) ; } RandomVariableInterface [ ] factorLoading = getFactorLoading ( timeIndex , componentIndex , realizationAtTimeIndex ) ; for ( int factorIndex = 0 ; factorIndex < getNumberOfFactors ( ) ; factorIndex ++ ) { drift [ componentIndex ] = drift [ componentIndex ] . addProduct ( covarianceFactorSums [ factorIndex ] , factorLoading [ factorIndex ] ) ; covarianceFactorSums [ factorIndex ] = covarianceFactorSums [ factorIndex ] . sub ( oneStepMeasureTransform . mult ( factorLoading [ factorIndex ] ) ) ; } } } if ( stateSpace == StateSpace . LOGNORMAL ) { // Drift adjustment for log - coordinate in each component for ( int componentIndex = firstLiborIndex ; componentIndex < getNumberOfComponents ( ) ; componentIndex ++ ) { RandomVariableInterface variance = covarianceModel . getCovariance ( getTime ( timeIndex ) , componentIndex , componentIndex , realizationAtTimeIndex ) ; drift [ componentIndex ] = drift [ componentIndex ] . addProduct ( variance , - 0.5 ) ; } } return drift ;
public class FormatStringBuffer { /** * Format a < tt > char < / tt > . */ public FormatStringBuffer format ( char ch ) { } }
Format fmt = getFormat ( ) ; if ( fmt . type != CHAR ) throw new IllegalArgumentException ( "Expected a char format" ) ; if ( ( fmt . flags & LEFT ) != LEFT ) while ( -- fmt . fieldWidth > 0 ) buffer . append ( ' ' ) ; buffer . append ( ch ) ; while ( -- fmt . fieldWidth > 0 ) buffer . append ( ' ' ) ; return this ;
public class ReflectUtil { /** * 获取指定对象中指定字段对应的字段的值 * @ param obj 对象 , 不能为空 * @ param field 字段 * @ param < T > 字段类型 * @ return 字段值 */ @ SuppressWarnings ( "unchecked" ) public static < T extends Object > T getFieldValue ( Object obj , Field field ) { } }
Assert . notNull ( obj , "obj不能为空" ) ; Assert . notNull ( field , "field不能为空" ) ; try { return ( T ) field . get ( obj ) ; } catch ( IllegalArgumentException e ) { throw new ReflectException ( e ) ; } catch ( IllegalAccessException e ) { String msg = StringUtils . format ( "类型[{0}]的字段[{1}]不允许访问" , obj . getClass ( ) , field . getName ( ) ) ; log . error ( msg ) ; throw new ReflectException ( msg , e ) ; }
public class DateIntervalFormat { /** * get separated date and time skeleton from a combined skeleton . * The difference between date skeleton and normalizedDateSkeleton are : * 1 . both ' y ' and ' d ' are appeared only once in normalizeDateSkeleton * 2 . ' E ' and ' EE ' are normalized into ' EEE ' * 3 . ' MM ' is normalized into ' M ' * * the difference between time skeleton and normalizedTimeSkeleton are : * 1 . both ' H ' and ' h ' are normalized as ' h ' in normalized time skeleton , * 2 . ' a ' is omitted in normalized time skeleton . * 3 . there is only one appearance for ' h ' , ' m ' , ' v ' , ' z ' in normalized time * skeleton * @ param skeleton given combined skeleton . * @ param date Output parameter for date only skeleton . * @ param normalizedDate Output parameter for normalized date only * @ param time Output parameter for time only skeleton . * @ param normalizedTime Output parameter for normalized time only * skeleton . */ private static void getDateTimeSkeleton ( String skeleton , StringBuilder dateSkeleton , StringBuilder normalizedDateSkeleton , StringBuilder timeSkeleton , StringBuilder normalizedTimeSkeleton ) { } }
// dateSkeleton follows the sequence of y * M * E * d * // timeSkeleton follows the sequence of hm * [ v | z ] ? int i ; int ECount = 0 ; int dCount = 0 ; int MCount = 0 ; int yCount = 0 ; int hCount = 0 ; int HCount = 0 ; int mCount = 0 ; int vCount = 0 ; int zCount = 0 ; for ( i = 0 ; i < skeleton . length ( ) ; ++ i ) { char ch = skeleton . charAt ( i ) ; switch ( ch ) { case 'E' : dateSkeleton . append ( ch ) ; ++ ECount ; break ; case 'd' : dateSkeleton . append ( ch ) ; ++ dCount ; break ; case 'M' : dateSkeleton . append ( ch ) ; ++ MCount ; break ; case 'y' : dateSkeleton . append ( ch ) ; ++ yCount ; break ; case 'G' : case 'Y' : case 'u' : case 'Q' : case 'q' : case 'L' : case 'l' : case 'W' : case 'w' : case 'D' : case 'F' : case 'g' : case 'e' : case 'c' : case 'U' : case 'r' : normalizedDateSkeleton . append ( ch ) ; dateSkeleton . append ( ch ) ; break ; case 'a' : // ' a ' is implicitly handled timeSkeleton . append ( ch ) ; break ; case 'h' : timeSkeleton . append ( ch ) ; ++ hCount ; break ; case 'H' : timeSkeleton . append ( ch ) ; ++ HCount ; break ; case 'm' : timeSkeleton . append ( ch ) ; ++ mCount ; break ; case 'z' : ++ zCount ; timeSkeleton . append ( ch ) ; break ; case 'v' : ++ vCount ; timeSkeleton . append ( ch ) ; break ; case 'V' : case 'Z' : case 'k' : case 'K' : case 'j' : case 's' : case 'S' : case 'A' : timeSkeleton . append ( ch ) ; normalizedTimeSkeleton . append ( ch ) ; break ; } } /* generate normalized form for date */ if ( yCount != 0 ) { for ( i = 0 ; i < yCount ; i ++ ) { normalizedDateSkeleton . append ( 'y' ) ; } } if ( MCount != 0 ) { if ( MCount < 3 ) { normalizedDateSkeleton . append ( 'M' ) ; } else { for ( i = 0 ; i < MCount && i < 5 ; ++ i ) { normalizedDateSkeleton . append ( 'M' ) ; } } } if ( ECount != 0 ) { if ( ECount <= 3 ) { normalizedDateSkeleton . append ( 'E' ) ; } else { for ( i = 0 ; i < ECount && i < 5 ; ++ i ) { normalizedDateSkeleton . append ( 'E' ) ; } } } if ( dCount != 0 ) { normalizedDateSkeleton . append ( 'd' ) ; } /* generate normalized form for time */ if ( HCount != 0 ) { normalizedTimeSkeleton . append ( 'H' ) ; } else if ( hCount != 0 ) { normalizedTimeSkeleton . append ( 'h' ) ; } if ( mCount != 0 ) { normalizedTimeSkeleton . append ( 'm' ) ; } if ( zCount != 0 ) { normalizedTimeSkeleton . append ( 'z' ) ; } if ( vCount != 0 ) { normalizedTimeSkeleton . append ( 'v' ) ; }
public class cacheforwardproxy { /** * Use this API to delete cacheforwardproxy resources of given names . */ public static base_responses delete ( nitro_service client , String ipaddress [ ] ) throws Exception { } }
base_responses result = null ; if ( ipaddress != null && ipaddress . length > 0 ) { cacheforwardproxy deleteresources [ ] = new cacheforwardproxy [ ipaddress . length ] ; for ( int i = 0 ; i < ipaddress . length ; i ++ ) { deleteresources [ i ] = new cacheforwardproxy ( ) ; deleteresources [ i ] . ipaddress = ipaddress [ i ] ; } result = delete_bulk_request ( client , deleteresources ) ; } return result ;
public class KeyVaultClientBaseImpl { /** * List all versions of the specified secret . * The full secret identifier and attributes are provided in the response . No values are returned for the secrets . This operations requires the secrets / list permission . * @ 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 ; SecretItem & gt ; object */ public Observable < Page < SecretItem > > getSecretVersionsNextAsync ( final String nextPageLink ) { } }
return getSecretVersionsNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < SecretItem > > , Page < SecretItem > > ( ) { @ Override public Page < SecretItem > call ( ServiceResponse < Page < SecretItem > > response ) { return response . body ( ) ; } } ) ;
public class StatusData { /** * Stores given key - value mapping if no restrictions are violated by them . * @ param key mapping key . * @ param value mapping value . * @ throws IllegalArgumentException if the given key is { @ code null } or if value is neither of correct type nor of String type . */ public void put ( T key , Object value ) { } }
data . put ( key , ensureValueCorrectness ( key , value ) ) ;
public class NumericShaper { /** * Returns a { @ code Set } representing all the Unicode ranges in * this { @ code NumericShaper } that will be shaped . * @ return all the Unicode ranges to be shaped . * @ since 1.7 */ public Set < Range > getRangeSet ( ) { } }
if ( rangeSet != null ) { return EnumSet . copyOf ( rangeSet ) ; } return Range . maskToRangeSet ( mask ) ;
public class OsDetector { /** * Attempts to detect the operating system of a machine by using system calls ( if the machine is local ) , connecting * to the machine using SSH or PowerShell ( and running specific commands ) or by running a Nmap command . * @ param host The hostname or ip address of the remote host . * @ param username The username used to connect to the remote machine ( For SSH and PowerShell detection ) . * @ param password The password used to connect to the remote machine ( For SSH and PowerShell detection ) . * @ param port The port to use when connecting to the remote server ( For SSH and PowerShell detection ) . * Default for SSH : 22 * Default for PowerShell : 5986 * Example : 22 , 5985 , 5986 * @ param proxyHost The proxy server used to access the remote host ( For SSH , PowerShell and Nmap detection ) . * @ param proxyPort The proxy server port ( For SSH , PowerShell and Nmap detection ) . * Default value : 8080 * @ param proxyUsername The username used when connecting to the proxy ( For SSH and PowerShell detection ) . * @ param proxyPassword The password used when connecting to the proxy ( For SSH and PowerShell detection ) . * @ param privateKeyFile The path to the private key file ( OpenSSH type ) on the machine where is the worker * ( For SSH detection ) . * @ param privateKeyData A string representing the private key ( OpenSSH type ) used for authenticating the user . * This string is usually the content of a private key file . The ' privateKeyData ' and the * ' privateKeyFile ' inputs are mutually exclusive . For security reasons it is recommend * that the private key be protected by a passphrase that should be provided through the * ' password ' input ( For SSH detection ) . * @ param knownHostsPolicy The policy used for managing known _ hosts file ( For SSH detection ) . * Valid values : allow , strict , add . * Default value : strict * @ param knownHostsPath The path to the known hosts file . ( For SSH detection ) . * @ param allowedCiphers A comma separated list of ciphers that will be used in the client - server handshake * mechanism when the connection is created . Check the notes section for security concerns * regarding your choice of ciphers . The default value will be used even if the input is not * added to the operation ( For SSH detection ) . * Default value : aes128 - ctr , aes128 - cbc , 3des - ctr , 3des - cbc , blowfish - cbc , aes192 - ctr , aes192 - cbc , aes256 - ctr , aes256 - cbc * @ param agentForwarding Enables or disables the forwarding of the authentication agent connection ( For SSH detection ) . * Agent forwarding should be enabled with caution . * @ param sshTimeout Time in milliseconds to wait for the command to complete ( For SSH detection ) . * Default value is 90000 ( 90 seconds ) * @ param sshConnectTimeout Time in milliseconds to wait for the connection to be made ( For SSH detection ) . * Default value : 10000 * @ param protocol The protocol to use when connecting to the remote server ( For PowerShell detection ) . * Valid values are ' HTTP ' and ' HTTPS ' . * Default value is ' HTTPS ' . * @ param authType : Type of authentication used to execute the request on the target server ( For PowerShell detection ) . * Valid : ' basic ' , ' form ' , ' springForm ' , ' digest ' , ' ntlm ' , ' kerberos ' , ' anonymous ' ( no authentication ) * Default : ' basic ' * @ param trustAllRoots Specifies whether to enable weak security over SSL / TSL . A certificate is trusted even * if no trusted certification authority issued it ( For PowerShell detection ) . * Valid values are ' true ' and ' false ' . * Default value : false * @ param x509HostnameVerifier Specifies the way the server hostname must match a domain name in the subject ' s Common * Name ( CN ) or subjectAltName field of the X . 509 certificate . The hostname verification * system prevents communication with other hosts other than the ones you intended . * This is done by checking that the hostname is in the subject alternative name extension * of the certificate . This system is designed to ensure that , if an attacker ( Man In The * Middle ) redirects traffic to his machine , the client will not accept the connection . * If you set this input to " allow _ all " , this verification is ignored and you become * vulnerable to security attacks . For the value " browser _ compatible " the hostname verifier * works the same way as Curl and Firefox . The hostname must match either the first CN , * or any of the subject - alts . A wildcard can occur in the CN , and in any of the subject - alts . * The only difference between " browser _ compatible " and " strict " is that a wildcard * ( such as " * . foo . com " ) with " browser _ compatible " matches all subdomains , including " a . b . foo . com " . * From the security perspective , to provide protection against possible Man - In - The - Middle * attacks , we strongly recommend to use " strict " option ( For PowerShell detection ) . * Valid values are ' strict ' , ' browser _ compatible ' , ' allow _ all ' . * Default value : strict * @ param trustKeystore The pathname of the Java TrustStore file . This contains certificates from other parties * that you expect to communicate with , or from Certificate Authorities that you trust to * identify other parties . If the protocol selected is not ' https ' or if trustAllRoots * is ' true ' this input is ignored ( For PowerShell detection ) . * Format of the keystore is Java KeyStore ( JKS ) . * @ param trustPassword The password associated with the TrustStore file . If trustAllRoots is false and * trustKeystore is empty , trustPassword default will be supplied ( For PowerShell detection ) . * @ param keystore The pathname of the Java KeyStore file . You only need this if the server requires client * authentication . If the protocol selected is not ' https ' or if trustAllRoots is ' true ' * this input is ignored ( For PowerShell detection ) . * Format of the keystore is Java KeyStore ( JKS ) . * @ param keystorePassword The password associated with the KeyStore file . If trustAllRoots is false and keystore * is empty , keystorePassword default will be supplied ( For PowerShell detection ) . * @ param kerberosConfFile A krb5 . conf file with content similar to the one in the examples ( where you * replace CONTOSO . COM with your domain and ' ad . contoso . com ' with your kdc FQDN ) . * This configures the Kerberos mechanism required by the Java GSS - API methods * ( For PowerShell detection ) . * Example : http : / / web . mit . edu / kerberos / krb5-1.4 / krb5-1.4.4 / doc / krb5 - admin / krb5 . conf . html * @ param kerberosLoginConfFile A login . conf file needed by the JAAS framework with the content similar to the one in examples * ( For PowerShell detection ) . * Example : http : / / docs . oracle . com / javase / 7 / docs / jre / api / security / jaas / spec / com / sun / security / auth / module / Krb5LoginModule . html * Examples : com . sun . security . jgss . initiate { com . sun . security . auth . module . Krb5LoginModule * required principal = Administrator doNotPrompt = true useKeyTab = true * keyTab = " file : / C : / Users / Administrator . CONTOSO / krb5 . keytab " ; } ; * @ param kerberosSkipPortForLookup Do not include port in the key distribution center database lookup ( For PowerShell detection ) . * Default value : true * Valid values : true , false * @ param winrmLocale The WinRM locale to use ( For PowerShell detection ) . * Default value : en - US * @ param powerShellTimeout Defines the OperationTimeout value in seconds to indicate that the clients expect a * response or a fault within the specified time ( For PowerShell detection ) . * Default value : 60000 * @ param nmapPath The absolute path to the Nmap executable or " nmap " if added in system path ( For Nmap detection ) . * Note : the path can be a network path . * Example : / / my - network - share / / nmap , nmap , " C : \ \ Program Files ( x86 ) \ \ Nmap \ \ nmap . exe " * Default value : nmap * @ param nmapArguments The Nmap arguments for operating system detection . ( For Nmap detection ) . * Refer to this document for more details : https : / / nmap . org / book / man . html * Default value : - sS - sU - O - Pn - - top - ports 20 * @ param nmapValidator The validation level for the Nmap arguments . It is recommended to use a * restrictive validator ( For Nmap detection ) . * Valid values : restrictive , permissive * Default value : restrictive * @ param nmapTimeout Time in milliseconds to wait for the Nmap command to finish execution ( For Nmap detection ) . * Default value : 30000 * @ return A map containing the output of the operation . Keys present in the map are : * < br > < b > returnResult < / b > The primary output , containing a success message or the exception message in case of failure . * < br > < b > returnCode < / b > The return code of the operation . 0 if the operation goes to success , - 1 if the operation goes to failure . * < br > < b > osFamily < / b > The operating system family in case of success . If the osFamily can not be determined * from either direct outputs of the detection commands or osName the value will * be " Other " . * < br > < b > osName < / b > The operating system name in case of success . This result might not be present . * < br > < b > osArchitecture < / b > The operating system architecture in case of success . This result might not be present . * < br > < b > osVersion < / b > The operating system version in case of success . This result might not be present . * < br > < b > osCommands < / b > The output of the commands that were run in order to detect the operating system . * < br > < b > exception < / b > The stack trace of the exception in case an exception occurred . */ @ Action ( name = "Operating System Detector" , outputs = { } }
@ Output ( RETURN_RESULT ) , @ Output ( RETURN_CODE ) , @ Output ( OS_FAMILY ) , @ Output ( OS_NAME ) , @ Output ( OS_ARCHITECTURE ) , @ Output ( OS_VERSION ) , @ Output ( OS_COMMANDS ) , @ Output ( EXCEPTION ) , } , responses = { @ Response ( text = ResponseNames . SUCCESS , field = RETURN_CODE , value = ReturnCodes . SUCCESS , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . RESOLVED ) , @ Response ( text = ResponseNames . FAILURE , field = RETURN_CODE , value = ReturnCodes . FAILURE , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . ERROR ) , } ) public Map < String , String > execute ( @ Param ( value = HOST , required = true ) String host , @ Param ( USERNAME ) String username , @ Param ( PASSWORD ) String password , @ Param ( PORT ) String port , @ Param ( PROXY_HOST ) String proxyHost , @ Param ( PROXY_PORT ) String proxyPort , @ Param ( PROXY_USERNAME ) String proxyUsername , @ Param ( value = PROXY_PASSWORD , encrypted = true ) String proxyPassword , @ Param ( PRIVATE_KEY_FILE ) String privateKeyFile , @ Param ( value = PRIVATE_KEY_DATA , encrypted = true ) String privateKeyData , @ Param ( KNOWN_HOSTS_POLICY ) String knownHostsPolicy , @ Param ( KNOWN_HOSTS_PATH ) String knownHostsPath , @ Param ( ALLOWED_CIPHERS ) String allowedCiphers , @ Param ( value = AGENT_FORWARDING ) String agentForwarding , @ Param ( SSH_TIMEOUT ) String sshTimeout , @ Param ( SSH_CONNECT_TIMEOUT ) String sshConnectTimeout , @ Param ( PROTOCOL ) String protocol , @ Param ( AUTH_TYPE ) String authType , @ Param ( TRUST_ALL_ROOTS ) String trustAllRoots , @ Param ( X509_HOSTNAME_VERIFIER ) String x509HostnameVerifier , @ Param ( TRUST_KEYSTORE ) String trustKeystore , @ Param ( value = TRUST_PASSWORD , encrypted = true ) String trustPassword , @ Param ( KEYSTORE ) String keystore , @ Param ( value = KEYSTORE_PASSWORD , encrypted = true ) String keystorePassword , @ Param ( KERBEROS_CONFIG_FILE ) String kerberosConfFile , @ Param ( KERBEROS_LOGIN_CONFIG_FILE ) String kerberosLoginConfFile , @ Param ( KERBEROS_SKIP_PORT_CHECK ) String kerberosSkipPortForLookup , @ Param ( WINRM_LOCALE ) String winrmLocale , @ Param ( POWERSHELL_OPERATION_TIMEOUT ) String powerShellTimeout , @ Param ( NMAP_PATH ) String nmapPath , @ Param ( NMAP_ARGUMENTS ) String nmapArguments , @ Param ( NMAP_VALIDATOR ) String nmapValidator , @ Param ( NMAP_TIMEOUT ) String nmapTimeout ) { try { OsDetectorInputs osDetectorInputs = new OsDetectorInputs . Builder ( ) . withHost ( host ) . withPort ( port ) . withUsername ( username ) . withPassword ( password ) . withSshTimeout ( defaultIfEmpty ( sshTimeout , DEFAULT_SSH_TIMEOUT ) ) . withPowerShellTimeout ( defaultIfEmpty ( powerShellTimeout , DEFAULT_POWER_SHELL_OP_TIMEOUT ) ) . withNmapTimeout ( defaultIfEmpty ( nmapTimeout , DEFAULT_NMAP_TIMEOUT ) ) . withSshConnectTimeout ( defaultIfEmpty ( sshConnectTimeout , String . valueOf ( DEFAULT_CONNECT_TIMEOUT ) ) ) . withNmapPath ( defaultIfEmpty ( nmapPath , DEFAULT_NMAP_PATH ) ) . withNmapArguments ( defaultIfEmpty ( nmapArguments , DEFAULT_NMAP_ARGUMENTS ) ) . withNmapValidator ( defaultIfEmpty ( nmapValidator , RESTRICTIVE_NMAP_VALIDATOR ) ) . withPrivateKeyFile ( privateKeyFile ) . withPrivateKeyData ( privateKeyData ) . withKnownHostsPolicy ( defaultIfEmpty ( knownHostsPolicy , KNOWN_HOSTS_STRICT ) ) . withKnownHostsPath ( defaultIfEmpty ( knownHostsPath , DEFAULT_KNOWN_HOSTS_PATH . toString ( ) ) ) . withAllowedCiphers ( defaultIfEmpty ( allowedCiphers , DEFAULT_ALLOWED_CIPHERS ) ) . withAgentForwarding ( defaultIfEmpty ( agentForwarding , valueOf ( DEFAULT_USE_AGENT_FORWARDING ) ) ) . withProtocol ( defaultIfEmpty ( protocol , InputDefaults . PROTOCOL . getValue ( ) ) ) . withAuthType ( defaultIfEmpty ( authType , BASIC_AUTH ) ) . withProxyHost ( proxyHost ) . withProxyPort ( defaultIfEmpty ( proxyPort , DEFAULT_PROXY_PORT ) ) . withProxyUsername ( proxyUsername ) . withProxyPassword ( proxyPassword ) . withTrustAllRoots ( defaultIfEmpty ( trustAllRoots , valueOf ( false ) ) ) . withX509HostnameVerifier ( defaultIfEmpty ( x509HostnameVerifier , X_509_HOSTNAME_VERIFIER . getValue ( ) ) ) . withTrustKeystore ( trustKeystore ) . withTrustPassword ( trustPassword ) . withKerberosConfFile ( kerberosConfFile ) . withKerberosLoginConfFile ( kerberosLoginConfFile ) . withKerberosSkipPortForLookup ( kerberosSkipPortForLookup ) . withKeystore ( keystore ) . withKeystorePassword ( keystorePassword ) . withWinrmLocale ( defaultIfEmpty ( winrmLocale , InputDefaults . WINRM_LOCALE . getValue ( ) ) ) . build ( ) ; OsDetectorHelperService osDetectorHelperService = new OsDetectorHelperService ( ) ; NmapOsDetectorService nmapOsDetectorService = new NmapOsDetectorService ( osDetectorHelperService ) ; OperatingSystemDetectorService service = new OperatingSystemDetectorService ( new SshOsDetectorService ( osDetectorHelperService , new ScoreSSHShellCommand ( ) ) , new PowerShellOsDetectorService ( osDetectorHelperService , new WSManRemoteShellService ( ) ) , nmapOsDetectorService , new LocalOsDetectorService ( osDetectorHelperService ) , osDetectorHelperService ) ; osDetectorHelperService . validateNmapInputs ( osDetectorInputs , nmapOsDetectorService ) ; OperatingSystemDetails os = service . detectOs ( osDetectorInputs ) ; Map < String , String > returnResult ; if ( osDetectorHelperService . foundOperatingSystem ( os ) ) { returnResult = getSuccessResultsMap ( "Successfully detected the operating system." ) ; returnResult . put ( OS_FAMILY , os . getFamily ( ) ) ; returnResult . put ( OS_NAME , os . getName ( ) ) ; returnResult . put ( OS_ARCHITECTURE , os . getArchitecture ( ) ) ; returnResult . put ( OS_VERSION , os . getVersion ( ) ) ; } else { returnResult = getFailureResultsMap ( "Unable to detect the operating system." ) ; } returnResult . put ( OS_COMMANDS , osDetectorHelperService . formatOsCommandsOutput ( os . getCommandsOutput ( ) ) ) ; return returnResult ; } catch ( Exception e ) { return getFailureResultsMap ( e ) ; }
public class EditTextPreference { /** * Obtains the hint of the edit text widget , which is shown in the preference ' s dialog , from a * specific typed array . * @ param typedArray * The typed array , the hint should be obtained from , as an instance of the class { @ link * TypedArray } . The typed array may not be null */ private void obtainHint ( @ NonNull final TypedArray typedArray ) { } }
setHint ( typedArray . getText ( R . styleable . EditTextPreference_android_hint ) ) ;
public class LocalProperties { /** * Translates the properties as much as possible , and truncates at the first non - translatable property */ public static < X , Y > List < LocalProperty < Y > > translate ( List < ? extends LocalProperty < X > > properties , Function < X , Optional < Y > > translator ) { } }
properties = normalizeAndPrune ( properties ) ; ImmutableList . Builder < LocalProperty < Y > > builder = ImmutableList . builder ( ) ; for ( LocalProperty < X > property : properties ) { Optional < LocalProperty < Y > > translated = property . translate ( translator ) ; if ( translated . isPresent ( ) ) { builder . add ( translated . get ( ) ) ; } else if ( ! ( property instanceof ConstantProperty ) ) { break ; // Only break if we fail to translate non - constants } } return builder . build ( ) ;
public class BinaryOWLMetadata { /** * Gets the long value of an attribute . * @ param name The name of the attribute . Not null . * @ param defaultValue The default value for the attribute . May be null . This value will be returned if this * metadata object does not contain a long value for the specified attribute name . * @ return Either the long value of the attribute with the specified name , or the value specified by the defaultValue * object if this metadata object does not contain a long value for the specified attribute name . * @ throws NullPointerException if name is null . */ public Long getLongAttribute ( String name , Long defaultValue ) { } }
return getValue ( longAttributes , name , defaultValue ) ;
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a multi - role pool of an App Service Environment . * Get metric definitions for a multi - role 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 . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; ResourceMetricDefinitionInner & gt ; object */ public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > listMultiRoleMetricDefinitionsWithServiceResponseAsync ( final String resourceGroupName , final String name ) { } }
return listMultiRoleMetricDefinitionsSinglePageAsync ( resourceGroupName , name ) . concatMap ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > call ( ServiceResponse < Page < ResourceMetricDefinitionInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listMultiRoleMetricDefinitionsNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcElectricFlowStorageDeviceTypeEnum ( ) { } }
if ( ifcElectricFlowStorageDeviceTypeEnumEEnum == null ) { ifcElectricFlowStorageDeviceTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 976 ) ; } return ifcElectricFlowStorageDeviceTypeEnumEEnum ;
public class JAASConfigurationImpl { /** * The proxy ( WSLoginModuleProxy ) can not be configured for the system . DEFAULT . * @ param entryName * @ param loginModules */ private void ensureProxyIsNotSpecifyInSystemDefaultEntry ( String entryName , List < JAASLoginModuleConfig > loginModules ) { } }
for ( Iterator < JAASLoginModuleConfig > i = loginModules . iterator ( ) ; i . hasNext ( ) ; ) { JAASLoginModuleConfig loginModule = i . next ( ) ; if ( loginModule . getId ( ) . equalsIgnoreCase ( JAASLoginModuleConfig . PROXY ) ) { Tr . warning ( tc , "JAAS_PROXY_IS_NOT_SUPPORT_IN_SYSTEM_DEFAULT" ) ; i . remove ( ) ; } }
public class Stream { /** * Returns a { @ code Stream } produced by iterative application of a accumulation function * to an initial element { @ code identity } and next element of the current stream . * Produces a { @ code Stream } consisting of { @ code identity } , { @ code acc ( identity , value1 ) } , * { @ code acc ( acc ( identity , value1 ) , value2 ) } , etc . * < p > This is an intermediate operation . * < p > Example : * < pre > * identity : 0 * accumulator : ( a , b ) - & gt ; a + b * stream : [ 1 , 2 , 3 , 4 , 5] * result : [ 0 , 1 , 3 , 6 , 10 , 15] * < / pre > * @ param < R > the type of the result * @ param identity the initial value * @ param accumulator the accumulation function * @ return the new stream * @ throws NullPointerException if { @ code accumulator } is null * @ since 1.1.6 */ @ NotNull public < R > Stream < R > scan ( @ Nullable final R identity , @ NotNull final BiFunction < ? super R , ? super T , ? extends R > accumulator ) { } }
Objects . requireNonNull ( accumulator ) ; return new Stream < R > ( params , new ObjScanIdentity < T , R > ( iterator , identity , accumulator ) ) ;
public class ReportingDialog { /** * Shows the dialog and submits the issue to the specified repository if the { @ code vatbubgitreports } - server has write access to it . * @ param windowTitle The title of the window * @ param userName The repo owner of the repo to send the issue to * @ param repoName The name of the repo to send the issue to */ public void show ( String windowTitle , String userName , String repoName ) { } }
show ( windowTitle , defaultGitReportsURL , userName , repoName ) ;
public class CPTaxCategoryServiceBaseImpl { /** * Sets the cp measurement unit remote service . * @ param cpMeasurementUnitService the cp measurement unit remote service */ public void setCPMeasurementUnitService ( com . liferay . commerce . product . service . CPMeasurementUnitService cpMeasurementUnitService ) { } }
this . cpMeasurementUnitService = cpMeasurementUnitService ;
public class JPAScopeInfo { /** * Cloase all the active EntityManagers defined in this scope . */ void close ( ) { } }
synchronized ( pxmlsInfo ) { for ( JPAPxmlInfo pxmlInfo : pxmlsInfo . values ( ) ) { pxmlInfo . close ( ) ; } pxmlsInfo . clear ( ) ; }
public class PoolPatchOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has been modified since the specified time . * @ param ifModifiedSince the ifModifiedSince value to set * @ return the PoolPatchOptions object itself . */ public PoolPatchOptions withIfModifiedSince ( DateTime ifModifiedSince ) { } }
if ( ifModifiedSince == null ) { this . ifModifiedSince = null ; } else { this . ifModifiedSince = new DateTimeRfc1123 ( ifModifiedSince ) ; } return this ;
public class Regex { /** * Splits the input * @ param in * @ param bufferSize * @ return * @ throws IOException */ public String [ ] split ( PushbackReader in , int bufferSize ) throws IOException { } }
return split ( in , bufferSize , Integer . MAX_VALUE ) ;
public class FsSettingsFileHandler { /** * We read settings in ~ / . fscrawler / { job _ name } / _ settings . json * @ param jobname is the job _ name * @ return Settings settings * @ throws IOException in case of error while reading */ public FsSettings readAsJson ( String jobname ) throws IOException { } }
return FsSettingsParser . fromJson ( readFile ( jobname , FILENAME_JSON ) ) ;
public class FbBotMillNetworkController { /** * POSTs an attachment as a JSON string to Facebook . * @ param input * the JSON data to send . * @ return the uploaded attachment ID . */ public static UploadAttachmentResponse postUploadAttachment ( Object input ) { } }
StringEntity stringEntity = toStringEntity ( input ) ; return postUploadAttachment ( stringEntity ) ;
public class SQLExpressions { /** * Add the given amount of seconds to the date * @ param date datetime * @ param seconds seconds to add * @ return converted datetime */ public static < D extends Comparable > DateTimeExpression < D > addSeconds ( DateTimeExpression < D > date , int seconds ) { } }
return Expressions . dateTimeOperation ( date . getType ( ) , Ops . DateTimeOps . ADD_SECONDS , date , ConstantImpl . create ( seconds ) ) ;
public class LocalQueuePoint { /** * @ see com . ibm . ws . sib . processor . runtime . SIMPLocalizationControllable # getDestinationHighMsgs ( ) */ public long getDestinationHighMsgs ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDestinationHighMsgs" ) ; long destHighMsgs = itemStream . getDestHighMsgs ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getDestinationHighMsgs" , new Long ( destHighMsgs ) ) ; return destHighMsgs ;
public class ReflectUtils { /** * will copy fields with same declaration name < br > * @ param clazz the starting / root class of input ( maybe input class is wrapped by spring , hibernate or another framework so you should define the root class ) * @ param input the input object * @ param output the object to fill / override * @ param copyCollections if collections should be copied * ( if true you may get a < code > org . hibernate . HibernateException : Found shared references to a collection < / code > on entities ) * @ param ignoreFields list of field names to ignore * @ param ignoreNonExisiting do not throw NPE if setter on output doesn ' t exists */ public static < O extends Object > O copyFields ( Class < ? > clazz , Object input , O output , boolean copyCollections , Collection < String > ignoreFields , boolean ignoreNonExisiting ) { } }
if ( null == clazz ) { clazz = input . getClass ( ) ; } Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( Field field : fields ) { /* * do not copy collections because of possible * org . hibernate . HibernateException : Found shared references to a collection */ if ( ReflectUtils . isNotStatic ( field ) ) { if ( null != ignoreFields && ignoreFields . contains ( field . getName ( ) ) ) { if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( String . format ( "ignoring field: %s" , field . getName ( ) ) ) ; } continue ; } if ( Collection . class . isAssignableFrom ( field . getType ( ) ) && ! copyCollections ) { if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( String . format ( "skipping collection field: %s" , field . getName ( ) ) ) ; } continue ; } if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( String . format ( "copying field: %s, with value: %s" , field . getName ( ) , ReflectUtils . invokeGetter ( input , field ) ) ) ; } ReflectUtils . copy ( input , output , field . getName ( ) , ignoreNonExisiting ) ; } } Class < ? > superClazz = clazz . getSuperclass ( ) ; if ( null != superClazz && ! superClazz . isAssignableFrom ( Object . class ) ) { output = copyFields ( superClazz , input , output , copyCollections , ignoreFields , ignoreNonExisiting ) ; } return output ;
public class Phrase { /** * Advances the current character position without any error checking . Consuming beyond the * end of the string can only happen if this parser contains a bug . */ private void consume ( ) { } }
curCharIndex ++ ; curChar = ( curCharIndex == pattern . length ( ) ) ? EOF : pattern . charAt ( curCharIndex ) ;
public class PolymerUtils { /** * method to get the number of all existing monomers from one MonomerNotation * @ param monomerNotation MonomerNotation * @ return number of monomers in the given MonomerNotation */ private static int getMonomerCountFromMonomerNotation ( MonomerNotation monomerNotation ) { } }
int multiply ; try { multiply = Integer . parseInt ( monomerNotation . getCount ( ) ) ; if ( multiply < 1 ) { multiply = 1 ; } } catch ( NumberFormatException e ) { multiply = 1 ; } if ( monomerNotation instanceof MonomerNotationGroup ) { return 1 * multiply ; } if ( monomerNotation instanceof MonomerNotationList ) { int count = 0 ; for ( MonomerNotation unit : ( ( MonomerNotationList ) monomerNotation ) . getListofMonomerUnits ( ) ) { count += getMonomerCountFromMonomerNotation ( unit ) ; } return count * multiply ; } if ( monomerNotation instanceof MonomerNotationUnitRNA ) { int count = 0 ; for ( MonomerNotationUnit unit : ( ( MonomerNotationUnitRNA ) monomerNotation ) . getContents ( ) ) { count += getMonomerCountFromMonomerNotation ( unit ) ; } return count * multiply ; } return 1 * multiply ;
public class JsonBuffer { /** * Add the given value . * @ param name the name . * @ param value the value . */ public void add ( String name , JsonBuffer value ) { } }
if ( value != null && value != this && ! value . isEmpty ( ) ) { this . content . put ( name , value ) ; }
public class DbHelperBase { /** * List of references with multiplicity > 1 */ private List < Reference > getAllManyReferences ( DomainObject domainObject ) { } }
List < Reference > allReferences = domainObject . getReferences ( ) ; List < Reference > allManyReferences = new ArrayList < Reference > ( ) ; for ( Reference ref : allReferences ) { if ( ref . isMany ( ) ) { allManyReferences . add ( ref ) ; } } return allManyReferences ;
public class Monitors { /** * Create a new timer with a name and context . The returned timer will maintain separate * sub - monitors for each distinct set of tags returned from the context on an update operation . */ public static Timer newTimer ( String name , TimeUnit unit , TaggingContext context ) { } }
final MonitorConfig config = MonitorConfig . builder ( name ) . build ( ) ; return new ContextualTimer ( config , context , new TimerFactory ( unit ) ) ;
public class BaseResourceReferenceDt { /** * Returns the referenced resource , fetching it < b > if it has not already been loaded < / b > . This method invokes the * HTTP client to retrieve the resource unless it has already been loaded , or was a contained resource in which case * it is simply returned . */ public IBaseResource loadResource ( IRestfulClient theClient ) { } }
if ( myResource != null ) { return myResource ; } IdDt resourceId = getReference ( ) ; if ( resourceId == null || isBlank ( resourceId . getValue ( ) ) ) { throw new IllegalStateException ( "Reference has no resource ID defined" ) ; } if ( isBlank ( resourceId . getBaseUrl ( ) ) || isBlank ( resourceId . getResourceType ( ) ) ) { throw new IllegalStateException ( "Reference is not complete (must be in the form [baseUrl]/[resource type]/[resource ID]) - Reference is: " + resourceId . getValue ( ) ) ; } String resourceUrl = resourceId . getValue ( ) ; ourLog . debug ( "Loading resource at URL: {}" , resourceUrl ) ; RuntimeResourceDefinition definition = theClient . getFhirContext ( ) . getResourceDefinition ( resourceId . getResourceType ( ) ) ; Class < ? extends IBaseResource > resourceType = definition . getImplementingClass ( ) ; myResource = theClient . fetchResourceFromUrl ( resourceType , resourceUrl ) ; myResource . setId ( resourceUrl ) ; return myResource ;
public class BaseMessagingEngineImpl { /** * Determine whether the conditions permitting a " server stopping " * notification to be sent are met . * The ME state can be STARTED , AUTOSTARTING or in STARTING state , to receive " server stopping " notification * @ return boolean a value indicating whether the notification can be sent */ private boolean okayToSendServerStopping ( ) { } }
// Removed the synchronized modifier of this method , as its only setting one private variable _ sentServerStopping , // If its synchronized , then notification thread gets blocked here until JsActivationThread returns and so it doesnot set _ sentServerStopping to true if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) // To enable the JsActivationThread to check for serverStopping notification while its still running , this method should not be synchronized . SibTr . entry ( tc , "okayToSendServerStopping" , this ) ; synchronized ( lockObject ) { // This should be run in a synchronized context if ( ! _sentServerStopping ) { if ( ( _state == STATE_STARTED || _state == STATE_AUTOSTARTING || _state == STATE_STARTING ) && _mainImpl . isServerStopping ( ) ) { // Adding additional ME states ( STARTING and AUTOSTARTING ) , so that sever stopping notification is also sent when ME is in those states . _sentServerStopping = true ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "okayToSendServerStopping" , new Boolean ( _sentServerStopping ) ) ; return _sentServerStopping ;
public class Locales { /** * Gets country from the specified locale string . * @ param localeString the specified locale string * @ return country , if the length of specified locale string less than 5 , returns " " */ public static String getCountry ( final String localeString ) { } }
if ( localeString . length ( ) >= COUNTRY_END ) { return localeString . substring ( COUNTRY_START , COUNTRY_END ) ; } return "" ;
public class ObjectPropertiesController { /** * Replace default values will null , allowing them to be ignored . * @ param value value to test * @ return filtered value */ private Object filterValue ( Object value ) { } }
if ( value instanceof Boolean && ! ( ( Boolean ) value ) . booleanValue ( ) ) { value = null ; } if ( value instanceof String && ( ( String ) value ) . isEmpty ( ) ) { value = null ; } if ( value instanceof Double && ( ( Double ) value ) . doubleValue ( ) == 0.0 ) { value = null ; } if ( value instanceof Integer && ( ( Integer ) value ) . intValue ( ) == 0 ) { value = null ; } if ( value instanceof Duration && ( ( Duration ) value ) . getDuration ( ) == 0.0 ) { value = null ; } return value ;
public class Assistant { /** * Update dialog node . * Update an existing dialog node with new or modified data . * This operation is limited to 500 requests per 30 minutes . For more information , see * * Rate limiting * * . * @ param updateDialogNodeOptions the { @ link UpdateDialogNodeOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type of { @ link DialogNode } */ public ServiceCall < DialogNode > updateDialogNode ( UpdateDialogNodeOptions updateDialogNodeOptions ) { } }
Validator . notNull ( updateDialogNodeOptions , "updateDialogNodeOptions cannot be null" ) ; String [ ] pathSegments = { "v1/workspaces" , "dialog_nodes" } ; String [ ] pathParameters = { updateDialogNodeOptions . workspaceId ( ) , updateDialogNodeOptions . dialogNode ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "conversation" , "v1" , "updateDialogNode" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; final JsonObject contentJson = new JsonObject ( ) ; if ( updateDialogNodeOptions . newDialogNode ( ) != null ) { contentJson . addProperty ( "dialog_node" , updateDialogNodeOptions . newDialogNode ( ) ) ; } if ( updateDialogNodeOptions . newDescription ( ) != null ) { contentJson . addProperty ( "description" , updateDialogNodeOptions . newDescription ( ) ) ; } if ( updateDialogNodeOptions . newConditions ( ) != null ) { contentJson . addProperty ( "conditions" , updateDialogNodeOptions . newConditions ( ) ) ; } if ( updateDialogNodeOptions . newParent ( ) != null ) { contentJson . addProperty ( "parent" , updateDialogNodeOptions . newParent ( ) ) ; } if ( updateDialogNodeOptions . newPreviousSibling ( ) != null ) { contentJson . addProperty ( "previous_sibling" , updateDialogNodeOptions . newPreviousSibling ( ) ) ; } if ( updateDialogNodeOptions . newOutput ( ) != null ) { contentJson . add ( "output" , GsonSingleton . getGson ( ) . toJsonTree ( updateDialogNodeOptions . newOutput ( ) ) ) ; } if ( updateDialogNodeOptions . newContext ( ) != null ) { contentJson . add ( "context" , GsonSingleton . getGson ( ) . toJsonTree ( updateDialogNodeOptions . newContext ( ) ) ) ; } if ( updateDialogNodeOptions . newMetadata ( ) != null ) { contentJson . add ( "metadata" , GsonSingleton . getGson ( ) . toJsonTree ( updateDialogNodeOptions . newMetadata ( ) ) ) ; } if ( updateDialogNodeOptions . newNextStep ( ) != null ) { contentJson . add ( "next_step" , GsonSingleton . getGson ( ) . toJsonTree ( updateDialogNodeOptions . newNextStep ( ) ) ) ; } if ( updateDialogNodeOptions . newTitle ( ) != null ) { contentJson . addProperty ( "title" , updateDialogNodeOptions . newTitle ( ) ) ; } if ( updateDialogNodeOptions . nodeType ( ) != null ) { contentJson . addProperty ( "type" , updateDialogNodeOptions . nodeType ( ) ) ; } if ( updateDialogNodeOptions . newEventName ( ) != null ) { contentJson . addProperty ( "event_name" , updateDialogNodeOptions . newEventName ( ) ) ; } if ( updateDialogNodeOptions . newVariable ( ) != null ) { contentJson . addProperty ( "variable" , updateDialogNodeOptions . newVariable ( ) ) ; } if ( updateDialogNodeOptions . newActions ( ) != null ) { contentJson . add ( "actions" , GsonSingleton . getGson ( ) . toJsonTree ( updateDialogNodeOptions . newActions ( ) ) ) ; } if ( updateDialogNodeOptions . newDigressIn ( ) != null ) { contentJson . addProperty ( "digress_in" , updateDialogNodeOptions . newDigressIn ( ) ) ; } if ( updateDialogNodeOptions . newDigressOut ( ) != null ) { contentJson . addProperty ( "digress_out" , updateDialogNodeOptions . newDigressOut ( ) ) ; } if ( updateDialogNodeOptions . newDigressOutSlots ( ) != null ) { contentJson . addProperty ( "digress_out_slots" , updateDialogNodeOptions . newDigressOutSlots ( ) ) ; } if ( updateDialogNodeOptions . newUserLabel ( ) != null ) { contentJson . addProperty ( "user_label" , updateDialogNodeOptions . newUserLabel ( ) ) ; } builder . bodyJson ( contentJson ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( DialogNode . class ) ) ;
public class ClientConfig { /** * Sets the map of { @ link ClientReliableTopicConfig } , * mapped by config name . The config name may be a pattern with which the * configuration will be obtained in the future . * @ param map the FlakeIdGenerator configuration map to set * @ return this config instance */ public ClientConfig setReliableTopicConfigMap ( Map < String , ClientReliableTopicConfig > map ) { } }
Preconditions . isNotNull ( map , "reliableTopicConfigMap" ) ; reliableTopicConfigMap . clear ( ) ; reliableTopicConfigMap . putAll ( map ) ; for ( Entry < String , ClientReliableTopicConfig > entry : map . entrySet ( ) ) { entry . getValue ( ) . setName ( entry . getKey ( ) ) ; } return this ;
public class UndoUtils { /** * Applies a list of { @ link PlainTextChange } s to the given area when the { @ link UndoManager } ' s change stream emits * an event by { @ code area . replaceAbsolutely ( change . getPosition ( ) , change . getRemovalEnd ( ) , change . getInserted ( ) } . */ public static < PS , SEG , S > Consumer < List < PlainTextChange > > applyMultiPlainTextChange ( GenericStyledArea < PS , SEG , S > area ) { } }
return changeList -> { MultiChangeBuilder < PS , SEG , S > builder = area . createMultiChange ( changeList . size ( ) ) ; for ( PlainTextChange c : changeList ) { builder . replaceTextAbsolutely ( c . getPosition ( ) , c . getRemovalEnd ( ) , c . getInserted ( ) ) ; } builder . commit ( ) ; } ;
public class DependencyGraph { /** * Flattens this graph into an observer list in dependencys order . Empties the graph in the * process . */ public ObserverList < T > toObserverList ( ) { } }
ObserverList < T > list = ObserverList . newSafeInOrder ( ) ; while ( ! isEmpty ( ) ) { list . add ( removeAvailableElement ( ) ) ; } return list ;
public class AmazonWorkMailClient { /** * Deletes permissions granted to a member ( user or group ) . * @ param deleteMailboxPermissionsRequest * @ return Result of the DeleteMailboxPermissions operation returned by the service . * @ throws EntityNotFoundException * The identifier supplied for the user , group , or resource does not exist in your organization . * @ throws EntityStateException * You are performing an operation on a user , group , or resource that isn ' t in the expected state , such as * trying to delete an active user . * @ throws InvalidParameterException * One or more of the input parameters don ' t match the service ' s restrictions . * @ throws OrganizationNotFoundException * An operation received a valid organization identifier that either doesn ' t belong or exist in the system . * @ throws OrganizationStateException * The organization must have a valid state ( Active or Synchronizing ) to perform certain operations on the * organization or its members . * @ sample AmazonWorkMail . DeleteMailboxPermissions * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / workmail - 2017-10-01 / DeleteMailboxPermissions " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DeleteMailboxPermissionsResult deleteMailboxPermissions ( DeleteMailboxPermissionsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteMailboxPermissions ( request ) ;
public class SignitClient { /** * 可用单独授权 , 或者可单独调用只获取token */ public OauthData getOauthData ( String apiKey , String secretKey , TokenType grantType , boolean autoSetRequestToken ) throws SignitException { } }
if ( apiKey == null || secretKey == null ) { throw new SignitException ( "请完善开发者账户数据" ) ; } TokenType tmpGrantType = grantType != null ? grantType : TokenType . CLIENT_CREDENTIALS ; String response = httpClient . withAuth ( auth ) . withGetParam ( RequestParam . CLIENT_ID , apiKey ) . withGetParam ( RequestParam . CLIENT_SECRET , secretKey ) . withGetParam ( RequestParam . GRANT_TYPE , tmpGrantType . name ( ) . toLowerCase ( ) ) . get ( OAUTH_TOKEN_URL ) . getLastResponse ( ) ; JSONObject data = JSON . parseObject ( Validator . notNull ( response , "请求token数据失败" ) ) ; if ( data != null && autoSetRequestToken ) { auth . setAccessToken ( Validator . notNull ( data . getString ( "access_token" ) , "token获取失败" ) ) ; } return FastjsonDecoder . decodeAsBean ( response , OauthData . class ) ;
public class JsonTextSequences { /** * Creates a new JSON Text Sequences from the specified { @ link Publisher } . * @ param headers the HTTP headers supposed to send * @ param contentPublisher the { @ link Publisher } which publishes the objects supposed to send as contents * @ param trailingHeaders the trailing HTTP headers supposed to send * @ param mapper the mapper which converts the content object into JSON Text Sequences */ public static HttpResponse fromPublisher ( HttpHeaders headers , Publisher < ? > contentPublisher , HttpHeaders trailingHeaders , ObjectMapper mapper ) { } }
requireNonNull ( mapper , "mapper" ) ; return streamingFrom ( contentPublisher , sanitizeHeaders ( headers ) , trailingHeaders , o -> toHttpData ( mapper , o ) ) ;
public class PerceptronLexicalAnalyzer { /** * 在线学习 * @ param segmentedTaggedSentence 已分词 、 标好词性和命名实体的人民日报2014格式的句子 * @ return 是否学习成果 ( 失败的原因是句子格式不合法 ) */ public boolean learn ( String segmentedTaggedSentence ) { } }
Sentence sentence = Sentence . create ( segmentedTaggedSentence ) ; return learn ( sentence ) ;
public class NamespaceRegistryImpl { /** * { @ inheritDoc } */ public void registerNamespace ( String prefix , String uri ) throws NamespaceException , RepositoryException { } }
validateNamespace ( prefix , uri ) ; registerNamespace ( prefix , uri , true ) ; if ( started && rpcService != null ) { try { rpcService . executeCommandOnAllNodes ( registerNamespace , false , id , prefix , uri ) ; } catch ( Exception e ) { LOG . warn ( "Could not register the namespace '" + uri + "' on other cluster nodes" , e ) ; } }
public class OWLLiteralImplNoCompression_CustomFieldSerializer { /** * Deserializes the content of the object from the * { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } . * @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read the * object ' s content from * @ param instance the object instance to deserialize * @ throws com . google . gwt . user . client . rpc . SerializationException * if the deserialization operation is not * successful */ @ Override public void deserializeInstance ( SerializationStreamReader streamReader , OWLLiteralImplNoCompression instance ) throws SerializationException { } }
deserialize ( streamReader , instance ) ;
public class Check { /** * Check if < code > a < / code > is strictly inferior to < code > b < / code > . * @ param a The parameter to test . * @ param b The parameter to compare to . * @ throws LionEngineException If check failed . */ public static void inferiorStrict ( int a , int b ) { } }
if ( a >= b ) { throw new LionEngineException ( ERROR_ARGUMENT + String . valueOf ( a ) + ERROR_INFERIOR_STRICT + String . valueOf ( b ) ) ; }
public class BasicFileServlet { /** * Copies the given range of bytes from the input stream to the output stream . * @ param in * @ param out * @ param r * @ throws IOException */ public static void copyPartialContent ( InputStream in , OutputStream out , Range r ) throws IOException { } }
IOUtils . copyLarge ( in , out , r . start , r . length ) ;
public class PtoPInputHandler { /** * Sends a Nack message back to the originating ME */ @ Override public void sendNackMessage ( SIBUuid8 sourceMEUuid , SIBUuid12 destUuid , SIBUuid8 busUuid , long startTick , long endTick , int priority , Reliability reliability , SIBUuid12 stream ) throws SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendNackMessage" , new Object [ ] { new Long ( startTick ) , new Long ( endTick ) } ) ; ControlNack nackMsg = createControlNackMessage ( ) ; // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want . SIMPUtils . setGuaranteedDeliveryProperties ( nackMsg , _messageProcessor . getMessagingEngineUuid ( ) , sourceMEUuid , stream , null , destUuid , ProtocolType . UNICASTOUTPUT , GDConfig . PROTOCOL_VERSION ) ; nackMsg . setPriority ( priority ) ; nackMsg . setReliability ( reliability ) ; nackMsg . setStartTick ( startTick ) ; nackMsg . setEndTick ( endTick ) ; // Send Nack messages at original message priority + 2 sendToME ( nackMsg , sourceMEUuid , busUuid , priority + 2 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendNackMessage " ) ;
public class HeapUtils { /** * Finds the { @ code n } largest values in { @ code values } , returning their * indexes in { @ code values } . The returned indexes are sorted in descending * order by their value , i . e . , the 0th element is the index of the maximum * value in { @ code values } . * To avoid reimplementing heaps with ints , the indexes are returned as * { @ code long } s . They can be cast back to { @ code int } s to access the elements * of { @ code values } . * @ param keys * @ param values * @ param n * @ return */ public static final long [ ] findLargestItemIndexes ( double [ ] values , int n ) { } }
long [ ] heapKeys = new long [ n + 1 ] ; double [ ] heapValues = new double [ n + 1 ] ; int heapSize = 0 ; for ( int i = 0 ; i < values . length ; i ++ ) { offer ( heapKeys , heapValues , heapSize , i , values [ i ] ) ; heapSize ++ ; if ( heapSize > n ) { removeMin ( heapKeys , heapValues , heapSize ) ; heapSize -- ; } } long [ ] returnKeys = new long [ heapSize ] ; while ( heapSize > 0 ) { returnKeys [ heapSize - 1 ] = heapKeys [ 0 ] ; removeMin ( heapKeys , heapValues , heapSize ) ; heapSize -- ; } return returnKeys ;
public class DbxClientV1 { /** * Creates and returns a publicly - shareable URL to a file ' s contents . This URL can be used * without authentication . This link will stop working after a few hours . * @ param path * The Dropbox path to a file . * @ return * If there is no file at that path , return { @ code null } . Otherwise return * a shareable URL along with the expiration time . */ public /* @ Nullable */ DbxUrlWithExpiration createTemporaryDirectUrl ( String path ) throws DbxException { } }
DbxPathV1 . checkArgNonRoot ( "path" , path ) ; String apiPath = "1/media/auto" + path ; return doPost ( host . getApi ( ) , apiPath , null , null , new DbxRequestUtil . ResponseHandler < /* @ Nullable */ DbxUrlWithExpiration > ( ) { @ Override public /* @ Nullable */ DbxUrlWithExpiration handle ( HttpRequestor . Response response ) throws DbxException { if ( response . getStatusCode ( ) == 404 ) return null ; if ( response . getStatusCode ( ) != 200 ) throw DbxRequestUtil . unexpectedStatus ( response ) ; return DbxRequestUtil . readJsonFromResponse ( DbxUrlWithExpiration . Reader , response ) ; } } ) ;
public class TcpWriter { /** * - - - CLOSE SOCKET BY NODE ID - - - */ public void close ( String nodeID ) { } }
SendBuffer buffer ; synchronized ( buffers ) { buffer = buffers . remove ( nodeID ) ; } if ( buffer != null ) { buffer . close ( ) ; }
public class DeployMojo { /** * endregion */ protected ArtifactHandler getArtifactHandler ( ) throws MojoExecutionException { } }
final ArtifactHandlerBase . Builder builder ; switch ( this . getDeploymentType ( ) ) { case MSDEPLOY : builder = new MSDeployArtifactHandlerImpl . Builder ( ) . functionAppName ( this . getAppName ( ) ) ; break ; case FTP : builder = new FTPArtifactHandlerImpl . Builder ( ) ; break ; case EMPTY : case ZIP : builder = new ZIPArtifactHandlerImpl . Builder ( ) ; break ; default : throw new MojoExecutionException ( "The value of <deploymentType> is unknown, supported values are: ftp, zip and msdeploy." ) ; } return builder . project ( this . getProject ( ) ) . session ( this . getSession ( ) ) . filtering ( this . getMavenResourcesFiltering ( ) ) . resources ( this . getResources ( ) ) . stagingDirectoryPath ( this . getDeploymentStagingDirectoryPath ( ) ) . buildDirectoryAbsolutePath ( this . getBuildDirectoryAbsolutePath ( ) ) . log ( this . getLog ( ) ) . build ( ) ;
public class Groups { /** * Get the Group instance from the list by * name . * @ param groupName The group for which will be searched . * @ return The Group instance for the given group name . */ public Group getGroup ( String groupName ) { } }
Group result = null ; for ( Group item : getGroupsList ( ) ) { if ( item . getName ( ) . equals ( groupName ) ) { result = item ; } } return result ;
public class LayerUtil { /** * Converts the supplied point from screen coordinates to coordinates * relative to the specified layer . The results are stored into { @ code into } * , which is returned for convenience . */ public static Point screenToLayer ( Layer layer , XY point , Point into ) { } }
Layer parent = layer . parent ( ) ; XY cur = ( parent == null ) ? point : screenToLayer ( parent , point , into ) ; return parentToLayer ( layer , cur , into ) ;
public class GVRIndexBuffer { /** * Get the triangle vertex indices of the mesh as an integer array . * The indices for each * triangle are represented as a packed { @ code int } triplet , where * { @ code t0 } is the first triangle , { @ code t1 } is the second , etc . : * < code > * { t0[0 ] , t0[1 ] , t0[2 ] , t1[0 ] , t1[1 ] , t1[2 ] , . . . } * < / code > * Face indices may also be { @ code char } . If you have specified * char indices , this function will throw an exception . * @ return integer array with the packed triangle index data . * @ see # asCharArray ( ) * @ throws IllegalArgumentException if index buffer is not < i > int < / i > */ public int [ ] asIntArray ( ) { } }
int n = getIndexCount ( ) ; if ( getIndexSize ( ) != 4 ) { throw new UnsupportedOperationException ( "Cannot convert char indices to int array" ) ; } if ( n <= 0 ) { return null ; } return NativeIndexBuffer . getIntArray ( getNative ( ) ) ;
public class Readability { /** * Get an elements class / id weight . Uses regular expressions to tell if this * element looks good or bad . * @ param e * @ return */ private static int getClassWeight ( Element e ) { } }
int weight = 0 ; /* Look for a special classname */ String className = e . className ( ) ; if ( ! isEmpty ( className ) ) { Matcher negativeMatcher = Patterns . get ( Patterns . RegEx . NEGATIVE ) . matcher ( className ) ; Matcher positiveMatcher = Patterns . get ( Patterns . RegEx . POSITIVE ) . matcher ( className ) ; if ( negativeMatcher . find ( ) ) { weight -= 25 ; } if ( positiveMatcher . find ( ) ) { weight += 25 ; } } /* Look for a special ID */ String id = e . id ( ) ; if ( ! isEmpty ( id ) ) { Matcher negativeMatcher = Patterns . get ( Patterns . RegEx . NEGATIVE ) . matcher ( id ) ; Matcher positiveMatcher = Patterns . get ( Patterns . RegEx . POSITIVE ) . matcher ( id ) ; if ( negativeMatcher . find ( ) ) { weight -= 25 ; } if ( positiveMatcher . find ( ) ) { weight += 25 ; } } return weight ;
public class KeyVaultClientBaseImpl { /** * Lists the policy for a certificate . * The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault . This operation requires the certificates / get permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param certificateName The name of the certificate in a given key vault . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < CertificatePolicy > getCertificatePolicyAsync ( String vaultBaseUrl , String certificateName , final ServiceCallback < CertificatePolicy > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getCertificatePolicyWithServiceResponseAsync ( vaultBaseUrl , certificateName ) , serviceCallback ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } * { @ link EnumIncludeRelationships } { @ code > } */ @ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "includeRelationships" , scope = GetChildren . class ) public JAXBElement < EnumIncludeRelationships > createGetChildrenIncludeRelationships ( EnumIncludeRelationships value ) { } }
return new JAXBElement < EnumIncludeRelationships > ( _GetObjectOfLatestVersionIncludeRelationships_QNAME , EnumIncludeRelationships . class , GetChildren . class , value ) ;
public class CmsLockManager { /** * Counts the exclusive locked resources in a project . < p > * @ param project the project * @ return the number of exclusive locked resources in the specified project */ public int countExclusiveLocksInProject ( CmsProject project ) { } }
int count = 0 ; Iterator < CmsLock > itLocks = OpenCms . getMemoryMonitor ( ) . getAllCachedLocks ( ) . iterator ( ) ; while ( itLocks . hasNext ( ) ) { CmsLock lock = itLocks . next ( ) ; if ( lock . getEditionLock ( ) . isInProject ( project ) ) { count ++ ; } } return count ;
public class Choice3 { /** * { @ inheritDoc } */ @ Override public final < D > Choice4 < A , B , C , D > diverge ( ) { } }
return match ( Choice4 :: a , Choice4 :: b , Choice4 :: c ) ;
public class TSDBEntity { /** * Returns an unmodifiable collection of tags associated with the metric . * @ return The tags for a metric . Will never be null but may be empty . */ public Map < String , String > getTags ( ) { } }
Map < String , String > result = new HashMap < > ( ) ; for ( Map . Entry < String , String > entry : _tags . entrySet ( ) ) { String key = entry . getKey ( ) ; if ( ! ReservedField . isReservedField ( key ) ) { result . put ( key , entry . getValue ( ) ) ; } } return Collections . unmodifiableMap ( result ) ;
public class PackageCache { /** * To get all the versions of packageVOs ( including archive ) based on package name * @ param packageName * @ return * @ throws CachingException */ public static List < Package > getAllPackages ( String packageName ) throws CachingException { } }
List < Package > allPackages = new ArrayList < > ( ) ; for ( Package packageVO : getPackageList ( ) ) { if ( packageVO . getName ( ) . equals ( packageName ) ) { allPackages . add ( packageVO ) ; } } return allPackages ;
public class CollectionUtils { /** * Returns a { @ link Collection } containing the intersection * of the given { @ link Collection } s . * The cardinality of each element in the returned { @ link Collection } * will be equal to the minimum of the cardinality of that element * in the two given { @ link Collection } s . * @ param a the first collection , must not be null * @ param b the second collection , must not be null * @ return the intersection of the two collections */ public static Collection intersection ( final Collection a , final Collection b ) { } }
ArrayList list = new ArrayList ( ) ; Map mapa = getCardinalityMap ( a ) ; Map mapb = getCardinalityMap ( b ) ; Set elts = new HashSet ( a ) ; elts . addAll ( b ) ; Iterator it = elts . iterator ( ) ; while ( it . hasNext ( ) ) { Object obj = it . next ( ) ; for ( int i = 0 , m = Math . min ( getFreq ( obj , mapa ) , getFreq ( obj , mapb ) ) ; i < m ; i ++ ) { list . add ( obj ) ; } } return list ;
public class Voice { /** * Returns the last note that has been added to this score . * @ return The last note that has been added to this score . < TT > null < / TT > * if no note in this score . */ public NoteAbstract getLastNote ( ) { } }
if ( lastNote == null ) { for ( int i = super . size ( ) - 1 ; i >= 0 ; i -- ) { if ( super . elementAt ( i ) instanceof NoteAbstract ) { lastNote = ( NoteAbstract ) super . elementAt ( i ) ; break ; } } } return lastNote ;
public class MassNumberRule { /** * { @ inheritDoc } */ @ Override public int compare ( ILigand ligand1 , ILigand ligand2 ) { } }
ensureFactory ( ) ; return getMassNumber ( ligand1 ) . compareTo ( getMassNumber ( ligand2 ) ) ;
public class XPathToQueryTranslator { /** * Determine if the predicates contain any expressions that cannot be put into a LIKE constraint on the path . * @ param predicates the predicates * @ return true if the supplied predicates can be handled entirely in the LIKE constraint on the path , or false if they have * to be handled as other criteria */ protected boolean appliesToPathConstraint ( List < Component > predicates ) { } }
if ( predicates . isEmpty ( ) ) return true ; if ( predicates . size ( ) > 1 ) return false ; assert predicates . size ( ) == 1 ; Component predicate = predicates . get ( 0 ) ; if ( predicate instanceof Literal && ( ( Literal ) predicate ) . isInteger ( ) ) return true ; if ( predicate instanceof NameTest && ( ( NameTest ) predicate ) . isWildcard ( ) ) return true ; return false ;
public class MutableDigest { /** * Returns true if all members have a corresponding seqno > = 0 , else false */ public boolean allSet ( ) { } }
for ( int i = 0 ; i < seqnos . length ; i += 2 ) if ( seqnos [ i ] == - 1 ) return false ; return true ;
public class ListDocumentsResult { /** * The names of the Systems Manager documents . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDocumentIdentifiers ( java . util . Collection ) } or { @ link # withDocumentIdentifiers ( java . util . Collection ) } * if you want to override the existing values . * @ param documentIdentifiers * The names of the Systems Manager documents . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListDocumentsResult withDocumentIdentifiers ( DocumentIdentifier ... documentIdentifiers ) { } }
if ( this . documentIdentifiers == null ) { setDocumentIdentifiers ( new com . amazonaws . internal . SdkInternalList < DocumentIdentifier > ( documentIdentifiers . length ) ) ; } for ( DocumentIdentifier ele : documentIdentifiers ) { this . documentIdentifiers . add ( ele ) ; } return this ;
public class CreateSymbols { /** * < editor - fold defaultstate = " collapsed " desc = " Class Writing " > */ void writeClass ( String ctSymLocation , ClassDescription classDescription , ClassHeaderDescription header , String version ) throws IOException { } }
List < CPInfo > constantPool = new ArrayList < > ( ) ; constantPool . add ( null ) ; List < Method > methods = new ArrayList < > ( ) ; for ( MethodDescription methDesc : classDescription . methods ) { if ( disjoint ( methDesc . versions , version ) ) continue ; Descriptor descriptor = new Descriptor ( addString ( constantPool , methDesc . descriptor ) ) ; // TODO : LinkedHashMap to avoid param annotations vs . Signature problem in javac ' s ClassReader : Map < String , Attribute > attributesMap = new LinkedHashMap < > ( ) ; addAttributes ( methDesc , constantPool , attributesMap ) ; Attributes attributes = new Attributes ( attributesMap ) ; AccessFlags flags = new AccessFlags ( methDesc . flags ) ; int nameString = addString ( constantPool , methDesc . name ) ; methods . add ( new Method ( flags , nameString , descriptor , attributes ) ) ; } List < Field > fields = new ArrayList < > ( ) ; for ( FieldDescription fieldDesc : classDescription . fields ) { if ( disjoint ( fieldDesc . versions , version ) ) continue ; Descriptor descriptor = new Descriptor ( addString ( constantPool , fieldDesc . descriptor ) ) ; Map < String , Attribute > attributesMap = new HashMap < > ( ) ; addAttributes ( fieldDesc , constantPool , attributesMap ) ; Attributes attributes = new Attributes ( attributesMap ) ; AccessFlags flags = new AccessFlags ( fieldDesc . flags ) ; int nameString = addString ( constantPool , fieldDesc . name ) ; fields . add ( new Field ( flags , nameString , descriptor , attributes ) ) ; } int currentClass = addClass ( constantPool , classDescription . name ) ; int superclass = header . extendsAttr != null ? addClass ( constantPool , header . extendsAttr ) : 0 ; int [ ] interfaces = new int [ header . implementsAttr . size ( ) ] ; int i = 0 ; for ( String intf : header . implementsAttr ) { interfaces [ i ++ ] = addClass ( constantPool , intf ) ; } AccessFlags flags = new AccessFlags ( header . flags ) ; Map < String , Attribute > attributesMap = new HashMap < > ( ) ; addAttributes ( header , constantPool , attributesMap ) ; Attributes attributes = new Attributes ( attributesMap ) ; ConstantPool cp = new ConstantPool ( constantPool . toArray ( new CPInfo [ constantPool . size ( ) ] ) ) ; ClassFile classFile = new ClassFile ( 0xCAFEBABE , Target . DEFAULT . minorVersion , Target . DEFAULT . majorVersion , cp , flags , currentClass , superclass , interfaces , fields . toArray ( new Field [ 0 ] ) , methods . toArray ( new Method [ 0 ] ) , attributes ) ; Path outputClassFile = Paths . get ( ctSymLocation , version , classDescription . name + EXTENSION ) ; Files . createDirectories ( outputClassFile . getParent ( ) ) ; try ( OutputStream out = Files . newOutputStream ( outputClassFile ) ) { ClassWriter w = new ClassWriter ( ) ; w . write ( classFile , out ) ; }
public class IntArrayList { /** * Remove the first instance of a value if found in the list . * @ param value to be removed . * @ return true if successful otherwise false . */ public boolean removeInt ( final int value ) { } }
@ DoNotSub final int index = indexOf ( value ) ; if ( - 1 != index ) { remove ( index ) ; return true ; } return false ;
public class SessionProtocolNegotiationCache { /** * Returns { @ code true } if the specified { @ code remoteAddress } is known to have no support for * the specified { @ link SessionProtocol } . */ public static boolean isUnsupported ( SocketAddress remoteAddress , SessionProtocol protocol ) { } }
final String key = key ( remoteAddress ) ; final CacheEntry e ; final long stamp = lock . readLock ( ) ; try { e = cache . get ( key ) ; } finally { lock . unlockRead ( stamp ) ; } if ( e == null ) { // Can ' t tell if it ' s unsupported return false ; } return e . isUnsupported ( protocol ) ;
public class TransformerImpl { /** * Push both the current xsl : template or xsl : for - each onto the * stack , along with the child node that was matched . * ( Note : should this only be used for xsl : templates ? ? - sb ) * @ param template xsl : template or xsl : for - each . * @ param child The child that was matched . */ public void pushPairCurrentMatched ( ElemTemplateElement template , int child ) { } }
m_currentMatchTemplates . push ( template ) ; m_currentMatchedNodes . push ( child ) ;
public class AbstractJSPExtensionServletWrapper { /** * Defect 268176.1 */ public boolean isAvailable ( ) { } }
boolean available = false ; String relativeURL = inputSource . getRelativeURL ( ) ; Container container = tcontext . getServletContext ( ) . getModuleContainer ( ) ; if ( container != null ) { if ( options . isDisableJspRuntimeCompilation ( ) == false ) { Entry entry = container . getEntry ( relativeURL ) ; if ( entry != null ) { available = true ; } else { available = inputSource . getLastModified ( ) != 0 ; } } else { available = true ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "isAvailable" , "Container's relativeURL [" + relativeURL + "] " + "is available [" + available + "]" ) ; } } else { String realPath = tcontext . getRealPath ( relativeURL ) ; if ( options . isDisableJspRuntimeCompilation ( ) == false ) { available = new File ( realPath ) . exists ( ) ; } else { available = true ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "isAvailable" , "relativeURL [" + relativeURL + "] " + "realPath [" + realPath + "] is available [" + available + "]" ) ; } } return available ;
public class ChemicalFilters { /** * Sort MCS solution by stereo and bond type matches . * @ throws CDKException */ public synchronized void sortResultsByStereoAndBondMatch ( ) throws CDKException { } }
// System . out . println ( " \ n \ n \ n \ nSort By ResultsByStereoAndBondMatch " ) ; Map < Integer , Map < Integer , Integer > > allStereoMCS = new HashMap < Integer , Map < Integer , Integer > > ( ) ; Map < Integer , Map < IAtom , IAtom > > allStereoAtomMCS = new HashMap < Integer , Map < IAtom , IAtom > > ( ) ; Map < Integer , Integer > fragmentScoreMap = new TreeMap < Integer , Integer > ( ) ; Map < Integer , Double > energyScoreMap = new TreeMap < Integer , Double > ( ) ; Map < Integer , Double > stereoScoreMap = new HashMap < Integer , Double > ( ) ; initializeMaps ( allStereoMCS , allStereoAtomMCS , stereoScoreMap , fragmentScoreMap , energyScoreMap ) ; boolean stereoMatchFlag = getStereoBondChargeMatch ( stereoScoreMap , allStereoMCS , allStereoAtomMCS ) ; boolean flag = false ; if ( stereoMatchFlag ) { // Higher Score is mapped preferred over lower stereoScoreMap = sortMapByValueInDecendingOrder ( stereoScoreMap ) ; double higestStereoScore = stereoScoreMap . isEmpty ( ) ? 0 : stereoScoreMap . values ( ) . iterator ( ) . next ( ) ; double secondhigestStereoScore = higestStereoScore ; for ( Integer key : stereoScoreMap . keySet ( ) ) { if ( secondhigestStereoScore < higestStereoScore && stereoScoreMap . get ( key ) > secondhigestStereoScore ) { secondhigestStereoScore = stereoScoreMap . get ( key ) ; } else if ( secondhigestStereoScore == higestStereoScore && stereoScoreMap . get ( key ) < secondhigestStereoScore ) { secondhigestStereoScore = stereoScoreMap . get ( key ) ; } } if ( ! stereoScoreMap . isEmpty ( ) ) { flag = true ; clear ( ) ; } /* Put back the sorted solutions */ int counter = 0 ; for ( Integer i : stereoScoreMap . keySet ( ) ) { // System . out . println ( " Sorted Map key " + I + " Sorted Value : " + stereoScoreMap . get ( I ) ) ; // System . out . println ( " Stereo MCS " + allStereoMCS . get ( I ) + " Stereo Value : " // + stereoScoreMap . get ( I ) ) ; if ( higestStereoScore == stereoScoreMap . get ( i ) . doubleValue ( ) ) { // | | secondhigestStereoScore = = stereoScoreMap . get ( I ) . doubleValue ( ) ) { addSolution ( counter , i , allStereoAtomMCS , allStereoMCS , stereoScoreMap , energyScoreMap , fragmentScoreMap ) ; counter ++ ; // System . out . println ( " Sorted Map key " + I + " Sorted Value : " + stereoScoreMap . get ( I ) ) ; // System . out . println ( " Stereo MCS " + allStereoMCS . get ( I ) + " Stereo Value : " // + stereoScoreMap . get ( I ) ) ; } } if ( flag ) { firstSolution . putAll ( allMCS . get ( 0 ) ) ; firstAtomMCS . putAll ( allAtomMCS . get ( 0 ) ) ; clear ( allStereoMCS , allStereoAtomMCS , stereoScoreMap , fragmentScoreMap , energyScoreMap ) ; } }
public class JKMessage { public String fixValue ( String value ) { } }
logger . trace ( "Fix label value : " , value ) ; if ( value != null && ! value . equals ( "" ) ) { value = value . toUpperCase ( ) ; if ( value . startsWith ( "MI " ) ) value = value . replaceFirst ( "MI " , "" ) ; if ( value . startsWith ( "MEN " ) ) value = value . replaceFirst ( "MEN " , "" ) ; if ( value . startsWith ( "MOD " ) ) value = value . replaceFirst ( "MOD " , "" ) ; value = value . replaceAll ( "-" , " " ) ; value = value . replaceAll ( "_" , " " ) ; value = JKStringUtil . capitalizeFully ( value ) ; // final String [ ] words = value . toLowerCase ( ) . split ( " _ " ) ; // value = " " ; // for ( final String word : words ) { // if ( word . length ( ) > 1 ) { // value + = word . substring ( 0 , 1 ) . toUpperCase ( ) + word . substring ( 1 ) + " " ; // } else { // value = word ; } if ( value . contains ( "\\n" ) ) { value = value . replace ( "\\n" , System . getProperty ( "line.separator" ) ) ; } return value ;
public class TarFileInputStream { /** * Work - around for the problem that compressed InputReaders don ' t fill * the read buffer before returning . * Has visibility ' protected ' so that subclasses may override with * different algorithms , or use different algorithms for different * compression stream . */ protected void readCompressedBlocks ( int blocks ) throws IOException { } }
int bytesSoFar = 0 ; int requiredBytes = 512 * blocks ; // This method works with individual bytes ! int i ; while ( bytesSoFar < requiredBytes ) { i = readStream . read ( readBuffer , bytesSoFar , requiredBytes - bytesSoFar ) ; if ( i < 0 ) { // A VoltDB extension to disable tagging eof as an error . return ; /* disable 3 lines . . . throw new EOFException ( RB . singleton . getString ( RB . DECOMPRESS _ RANOUT , bytesSoFar , requiredBytes ) ) ; . . . disabled 3 lines */ // End of VoltDB extension } bytesRead += i ; bytesSoFar += i ; }
public class CholeskyDecompositionCommon_DDRM { /** * Performs Choleksy decomposition on the provided matrix . * If the matrix is not positive definite then this function will return * false since it can ' t complete its computations . Not all errors will be * found . This is an efficient way to check for positive definiteness . * @ param mat A symmetric positive definite matrix with n & le ; widthMax . * @ return True if it was able to finish the decomposition . */ @ Override public boolean decompose ( DMatrixRMaj mat ) { } }
if ( mat . numRows > maxWidth ) { setExpectedMaxSize ( mat . numRows , mat . numCols ) ; } else if ( mat . numRows != mat . numCols ) { throw new IllegalArgumentException ( "Must be a square matrix." ) ; } n = mat . numRows ; T = mat ; t = T . data ; if ( lower ) { return decomposeLower ( ) ; } else { return decomposeUpper ( ) ; }
public class TurfMeta { /** * Get all coordinates from a { @ link MultiPoint } object , returning a { @ code List } of Point * objects . If you have a geometry collection , you need to break it down to individual geometry * objects before using { @ link # coordAll } . * @ param multiPoint any { @ link MultiPoint } object * @ return a { @ code List } made up of { @ link Point } s * @ since 2.0.0 */ @ NonNull public static List < Point > coordAll ( @ NonNull MultiPoint multiPoint ) { } }
return coordAll ( new ArrayList < Point > ( ) , multiPoint ) ;
public class ParseZoneId { /** * { @ inheritDoc } * @ throws SuperCsvCellProcessorException if value is null or is not a String */ public Object execute ( final Object value , final CsvContext context ) { } }
validateInputNotNull ( value , context ) ; if ( ! ( value instanceof String ) ) { throw new SuperCsvCellProcessorException ( String . class , value , context , this ) ; } final ZoneId result ; try { if ( aliasMap != null ) { result = ZoneId . of ( ( String ) value , aliasMap ) ; } else { result = ZoneId . of ( ( String ) value ) ; } } catch ( DateTimeException e ) { throw new SuperCsvCellProcessorException ( "Failed to parse value as a ZoneId" , context , this , e ) ; } return next . execute ( result , context ) ;
public class ServiceOperations { /** * Verify that a service is in a given state . * @ param state the actual state a service is in * @ param expectedState the desired state * @ throws IllegalStateException if the service state is different from * the desired state */ public static void ensureCurrentState ( Service . STATE state , Service . STATE expectedState ) { } }
if ( state != expectedState ) { throw new IllegalStateException ( "For this operation, the " + "current service state must be " + expectedState + " instead of " + state ) ; }
public class ESSOAProviderParser { @ Override public Object getRealPropertyValue ( Pro pro ) { } }
String templateFile = ( String ) pro . getExtendAttribute ( "templateFile" ) ; if ( templateFile == null ) return pro . getValue ( ) ; else { String templateName = ( String ) pro . getExtendAttribute ( "templateName" ) ; if ( templateName == null ) { logger . warn ( new StringBuilder ( ) . append ( "The DSL template " ) . append ( pro . getName ( ) ) . append ( " in the DSl file " ) . append ( applicationContext . getConfigfile ( ) ) . append ( " is defined as a reference to the DSL template in another configuration file " ) . append ( templateFile ) . append ( ", but the name of the DSL template statement to be referenced is not specified by the templateName attribute, for example:\r\n" ) . append ( "<property name= \"querySqlTraces\"\r\n" ) . append ( "templateFile= \"esmapper/estrace/ESTracesMapper.xml\"\r\n" ) . append ( "templateName= \"queryTracesByCriteria\"/>" ) . toString ( ) ) ; return null ; } else { ESUtil . ESRef ref = new ESUtil . ESRef ( templateName , templateFile , pro . getName ( ) ) ; return ref . getTemplate ( ) ; } }
public class AppServiceEnvironmentsInner { /** * Get available SKUs for scaling a worker pool . * Get available SKUs for scaling a worker pool . * @ 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 ; SkuInfoInner & gt ; object */ public Observable < Page < SkuInfoInner > > listWorkerPoolSkusNextAsync ( final String nextPageLink ) { } }
return listWorkerPoolSkusNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < SkuInfoInner > > , Page < SkuInfoInner > > ( ) { @ Override public Page < SkuInfoInner > call ( ServiceResponse < Page < SkuInfoInner > > response ) { return response . body ( ) ; } } ) ;
public class Expressions { /** * Create a new DateTimeExpression * @ param expr the date time Expression * @ return new DateTimeExpression */ public static < T extends Comparable < ? > > DateTimeExpression < T > asDateTime ( Expression < T > expr ) { } }
Expression < T > underlyingMixin = ExpressionUtils . extract ( expr ) ; if ( underlyingMixin instanceof PathImpl ) { return new DateTimePath < T > ( ( PathImpl < T > ) underlyingMixin ) ; } else if ( underlyingMixin instanceof OperationImpl ) { return new DateTimeOperation < T > ( ( OperationImpl < T > ) underlyingMixin ) ; } else if ( underlyingMixin instanceof TemplateExpressionImpl ) { return new DateTimeTemplate < T > ( ( TemplateExpressionImpl < T > ) underlyingMixin ) ; } else { return new DateTimeExpression < T > ( underlyingMixin ) { private static final long serialVersionUID = 8007203530480765244L ; @ Override public < R , C > R accept ( Visitor < R , C > v , C context ) { return this . mixin . accept ( v , context ) ; } } ; }
public class CsvEscape { /** * Perform a CSV < strong > escape < / strong > operation on a < tt > String < / tt > input , writing results to * a < tt > Writer < / tt > . * This method is < strong > thread - safe < / strong > . * @ param text the < tt > String < / tt > to be escaped . * @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ throws IOException if an input / output exception occurs * @ since 1.1.2 */ public static void escapeCsv ( final String text , final Writer writer ) throws IOException { } }
if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } CsvEscapeUtil . escape ( new InternalStringReader ( text ) , writer ) ;
public class Descriptives { /** * Calculates the Frequency Table * @ param flatDataCollection * @ return */ public static AssociativeArray frequencies ( FlatDataCollection flatDataCollection ) { } }
AssociativeArray frequencies = new AssociativeArray ( ) ; for ( Object value : flatDataCollection ) { Object counter = frequencies . get ( value ) ; if ( counter == null ) { frequencies . put ( value , 1 ) ; } else { frequencies . put ( value , ( ( Number ) counter ) . intValue ( ) + 1 ) ; } } return frequencies ;