signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class BrokerHelper { /** * returns true if the primary key fields are valid for delete , else false .
* PK fields are valid if each of them contains a valid non - null value
* @ param cld the ClassDescriptor
* @ param obj the object
* @ return boolean */
public boolean assertValidPkForDelete ( ClassDescriptor cld , Object obj ) { } } | if ( ! ProxyHelper . isProxy ( obj ) ) { FieldDescriptor fieldDescriptors [ ] = cld . getPkFields ( ) ; int fieldDescriptorSize = fieldDescriptors . length ; for ( int i = 0 ; i < fieldDescriptorSize ; i ++ ) { FieldDescriptor fd = fieldDescriptors [ i ] ; Object pkValue = fd . getPersistentField ( ) . get ( obj ) ; if ( representsNull ( fd , pkValue ) ) { return false ; } } } return true ; |
public class JCurand { /** * < pre >
* Generate Poisson - distributed unsigned ints .
* Use generator to generate n unsigned int results into device memory at
* outputPtr . The device memory must have been previously allocated and must be
* large enough to hold all the results . Launches are done with the stream
* set using : : curandSetStream ( ) , or the null stream if no stream has been set .
* Results are 32 - bit unsigned int point values with Poisson distribution ,
* with lambda lambda .
* @ param generator - Generator to use
* @ param outputPtr - Pointer to device memory to store CUDA - generated results , or
* Pointer to host memory to store CPU - generated results
* @ param n - Number of unsigned ints to generate
* @ param lambda - lambda for the Poisson distribution
* @ return
* - CURAND _ STATUS _ NOT _ INITIALIZED if the generator was never created
* - CURAND _ STATUS _ PREEXISTING _ FAILURE if there was an existing error from
* a previous kernel launch
* - CURAND _ STATUS _ LAUNCH _ FAILURE if the kernel launch failed for any reason
* - CURAND _ STATUS _ LENGTH _ NOT _ MULTIPLE if the number of output samples is
* not a multiple of the quasirandom dimension
* - CURAND _ STATUS _ DOUBLE _ PRECISION _ REQUIRED if the GPU or sm does not support double precision
* - CURAND _ STATUS _ OUT _ OF _ RANGE if lambda is non - positive or greater than 400,000
* - CURAND _ STATUS _ SUCCESS if the results were generated successfully
* < / pre > */
public static int curandGeneratePoisson ( curandGenerator generator , Pointer outputPtr , long n , double lambda ) { } } | return checkResult ( curandGeneratePoissonNative ( generator , outputPtr , n , lambda ) ) ; |
public class PeepholeRemoveDeadCode { /** * Try removing identity assignments and empty destructuring pattern assignments
* @ return the replacement node , if changed , or the original if not */
private Node tryOptimizeNameDeclaration ( Node subtree ) { } } | checkState ( NodeUtil . isNameDeclaration ( subtree ) ) ; Node left = subtree . getFirstChild ( ) ; if ( left . isDestructuringLhs ( ) && left . hasTwoChildren ( ) ) { Node pattern = left . getFirstChild ( ) ; if ( ! pattern . hasChildren ( ) ) { // ` var [ ] = foo ( ) ; ` becomes ` foo ( ) ; `
Node value = left . getSecondChild ( ) ; subtree . replaceWith ( IR . exprResult ( value . detach ( ) ) . srcref ( value ) ) ; reportChangeToEnclosingScope ( value ) ; } } return subtree ; |
public class ZTimer { /** * Add timer to the set , timer repeats forever , or until cancel is called .
* @ param interval the interval of repetition in milliseconds .
* @ param handler the callback called at the expiration of the timer .
* @ param args the optional arguments for the handler .
* @ return an opaque handle for further cancel . */
public Timer add ( long interval , TimerHandler handler , Object ... args ) { } } | if ( handler == null ) { return null ; } return new Timer ( timer . add ( interval , handler , args ) ) ; |
public class SourceStream { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . interfaces . BatchListener # batchPrecommit ( com . ibm . ws . sib . msgstore . transactions . Transaction ) */
public void batchPrecommit ( TransactionCommon currentTran ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "batchPrecommit" , currentTran ) ; // Holds TickRanges of all messages to be sent downstream
TickRange tr1 = null ; TickRange tickRange = null ; synchronized ( this ) { // 316010 : It is possible for the sourcestream to have
// been removed when the batch timer triggers ( if destination
// is deleted ) . So check the streamset is still in the store .
if ( ! streamSet . isPersistent ( ) || streamSet . isInStore ( ) ) { for ( int i = 0 ; i < batchList . size ( ) ; i ++ ) { tickRange = ( TickRange ) batchList . get ( i ) ; try { if ( ( tr1 = msgRemoved ( tickRange . valuestamp , oststream , currentTran ) ) != null ) { batchSendList . add ( tr1 ) ; lastMsgSent = tr1 . valuestamp ; } } catch ( SIResourceException e ) { // FFDC
FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.gd.SourceStream.batchPrecommit" , "1:2558:1.138" , this ) ; SibTr . exception ( tc , e ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "batchPrecommit" ) ; |
public class AbstractSearchStructure { /** * This method creates and / or opens the BDB databases with the appropriate parameters .
* @ throws Exception */
private void createOrOpenBDBDbs ( ) throws Exception { } } | // configuration for the mapping dbs
DatabaseConfig dbConfig = new DatabaseConfig ( ) ; dbConfig . setAllowCreate ( true ) ; // db will be created if it does not exist
dbConfig . setReadOnly ( readOnly ) ; dbConfig . setTransactional ( transactional ) ; // create / open mapping dbs using config
iidToIdDB = dbEnv . openDatabase ( null , "idToName" , dbConfig ) ; // if countSizeOnLoad is true , the id - name mappings are counted and the loadCounter is initialized
if ( countSizeOnLoad ) { System . out . println ( new Date ( ) + " counting index size started " ) ; int idToNameMappings = ( int ) iidToIdDB . count ( ) ; loadCounter = Math . min ( idToNameMappings , maxNumVectors ) ; System . out . println ( new Date ( ) + " counting index size ended " ) ; System . out . println ( "Index size: " + loadCounter ) ; } idToIidDB = dbEnv . openDatabase ( null , "nameToId" , dbConfig ) ; if ( useGeolocation ) { // create / open geolocation db using config
iidToGeolocationDB = dbEnv . openDatabase ( null , "idToGeolocation" , dbConfig ) ; } if ( useMetaData ) { StoreConfig storeConfig = new StoreConfig ( ) ; // configuration of the entity store
storeConfig . setAllowCreate ( true ) ; // store will be created if it does not exist
storeConfig . setReadOnly ( readOnly ) ; storeConfig . setTransactional ( transactional ) ; iidToMetadataDB = new EntityStore ( dbEnv , "idToMetadata" , storeConfig ) ; // int nameToMetadataMappings = ( int ) nameToMetadataBDB . getPrimaryIndex ( String . class ,
// MediaFeedData . class ) . count ( ) ; / / counting the size of an EntityStore
} |
public class ClassInfo { /** * Return property type , return null when not found . */
public final Class < ? > getPropertyType ( String property ) { } } | MethodInfo info = propertyWriteMethods . get ( property ) ; if ( null == info ) return null ; else return info . parameterTypes [ 0 ] ; |
public class Dynamic { /** * Binds the supplied bootstrap method or constructor for the resolution of a dynamic constant .
* @ param name The name of the bootstrap constant that is provided to the bootstrap method or constructor .
* @ param bootstrapMethod The bootstrap method or constructor to invoke .
* @ param rawArguments The arguments for the bootstrap method or constructor represented as primitive wrapper types ,
* { @ link String } , { @ link TypeDescription } or { @ link JavaConstant } values or their loaded forms .
* @ return A dynamic constant that represents the bootstrapped method ' s or constructor ' s result . */
public static Dynamic bootstrap ( String name , MethodDescription . InDefinedShape bootstrapMethod , List < ? > rawArguments ) { } } | if ( name . length ( ) == 0 || name . contains ( "." ) ) { throw new IllegalArgumentException ( "Not a valid field name: " + name ) ; } List < Object > arguments = new ArrayList < Object > ( rawArguments . size ( ) ) ; for ( Object argument : rawArguments ) { if ( argument == null ) { argument = ofNullConstant ( ) ; } else if ( argument instanceof Class ) { argument = ( ( Class < ? > ) argument ) . isPrimitive ( ) ? ofPrimitiveType ( ( Class < ? > ) argument ) : TypeDescription . ForLoadedType . of ( ( Class < ? > ) argument ) ; } else if ( argument instanceof TypeDescription && ( ( TypeDescription ) argument ) . isPrimitive ( ) ) { argument = ofPrimitiveType ( ( TypeDescription ) argument ) ; } else if ( JavaType . METHOD_HANDLE . isInstance ( argument ) ) { argument = MethodHandle . ofLoaded ( argument ) ; } else if ( JavaType . METHOD_TYPE . isInstance ( argument ) ) { argument = MethodType . ofLoaded ( argument ) ; } arguments . add ( argument ) ; } if ( ! bootstrapMethod . isConstantBootstrap ( arguments ) ) { throw new IllegalArgumentException ( "Not a valid bootstrap method " + bootstrapMethod + " for " + arguments ) ; } Object [ ] asmifiedArgument = new Object [ arguments . size ( ) ] ; int index = 0 ; for ( Object argument : arguments ) { if ( argument instanceof TypeDescription ) { argument = Type . getType ( ( ( TypeDescription ) argument ) . getDescriptor ( ) ) ; } else if ( argument instanceof JavaConstant ) { argument = ( ( JavaConstant ) argument ) . asConstantPoolValue ( ) ; } asmifiedArgument [ index ++ ] = argument ; } return new Dynamic ( new ConstantDynamic ( name , ( bootstrapMethod . isConstructor ( ) ? bootstrapMethod . getDeclaringType ( ) : bootstrapMethod . getReturnType ( ) . asErasure ( ) ) . getDescriptor ( ) , new Handle ( bootstrapMethod . isConstructor ( ) ? Opcodes . H_NEWINVOKESPECIAL : Opcodes . H_INVOKESTATIC , bootstrapMethod . getDeclaringType ( ) . getInternalName ( ) , bootstrapMethod . getInternalName ( ) , bootstrapMethod . getDescriptor ( ) , false ) , asmifiedArgument ) , bootstrapMethod . isConstructor ( ) ? bootstrapMethod . getDeclaringType ( ) : bootstrapMethod . getReturnType ( ) . asErasure ( ) ) ; |
public class FSInputChecker { /** * / * Read up one checksum chunk to array < i > b < / i > at pos < i > off < / i >
* It requires a checksum chunk boundary
* in between < cur _ pos , cur _ pos + len >
* and it stops reading at the boundary or at the end of the stream ;
* Otherwise an IllegalArgumentException is thrown .
* This makes sure that all data read are checksum verified .
* @ param b the buffer into which the data is read .
* @ param off the start offset in array < code > b < / code >
* at which the data is written .
* @ param len the maximum number of bytes to read .
* @ return the total number of bytes read into the buffer , or
* < code > - 1 < / code > if there is no more data because the end of
* the stream has been reached .
* @ throws IOException if an I / O error occurs . */
private int readChecksumChunk ( byte b [ ] , int off , int len ) throws IOException { } } | // invalidate buffer
count = pos = 0 ; int read = 0 ; boolean retry = true ; int retriesLeft = numOfRetries ; do { retriesLeft -- ; try { read = readChunk ( chunkPos , b , off , len , checksum ) ; if ( read > 0 ) { if ( needChecksum ( ) ) { sum . update ( b , off , read ) ; verifySum ( chunkPos ) ; if ( cliData != null ) { cliData . recordVerifyChunkCheckSumTime ( ) ; } } chunkPos += read ; } retry = false ; } catch ( ChecksumException ce ) { LOG . info ( "Found checksum error: b[" + off + ", " + ( off + read ) + "]=" + StringUtils . byteToHexString ( b , off , off + read ) , ce ) ; if ( retriesLeft == 0 ) { throw ce ; } // try a new replica
if ( seekToNewSource ( chunkPos ) ) { // Since at least one of the sources is different ,
// the read might succeed , so we ' ll retry .
seek ( chunkPos ) ; } else { // Neither the data stream nor the checksum stream are being read
// from different sources , meaning we ' ll still get a checksum error
// if we try to do the read again . We throw an exception instead .
throw ce ; } } } while ( retry ) ; return read ; |
public class BatchUpdateDaemon { /** * This will send a " CLEAR " command to all caches . */
public void cacheCommand_Clear ( boolean waitOnInvalidation , DCache cache ) { } } | String template = cache . getCacheName ( ) ; synchronized ( this ) { BatchUpdateList bul = getUpdateList ( cache ) ; bul . invalidateByIdEvents . clear ( ) ; bul . invalidateByTemplateEvents . clear ( ) ; bul . pushCacheEntryEvents . clear ( ) ; bul . pushECFEvents . clear ( ) ; InvalidateByTemplateEvent invalidateByTemplateEvent = new InvalidateByTemplateEvent ( template , CachePerf . LOCAL ) ; invalidateByTemplateEvent . setCacheCommand_Clear ( ) ; bul . invalidateByTemplateEvents . put ( template , invalidateByTemplateEvent ) ; } if ( waitOnInvalidation ) { wakeUp ( 0 , 0 ) ; } |
public class OtfHeaderDecoder { /** * Get the schema version number from the message header .
* @ param buffer from which to read the value .
* @ param bufferOffset in the buffer at which the message header begins .
* @ return the value of the schema version number . */
public int getSchemaVersion ( final DirectBuffer buffer , final int bufferOffset ) { } } | return Types . getInt ( buffer , bufferOffset + schemaVersionOffset , schemaVersionType , schemaVersionByteOrder ) ; |
public class MisoScenePanel { /** * Called when an object or object menu item has been clicked . */
protected void fireObjectAction ( ObjectActionHandler handler , SceneObject scobj , ActionEvent event ) { } } | if ( handler == null ) { Controller . postAction ( event ) ; } else { handler . handleAction ( scobj , event ) ; } |
public class CSSParseHelper { /** * Remove surrounding quotes ( single or double ) of a string ( if present ) . If
* the start and the end quote are not equal , nothing happens .
* @ param sStr
* The string where the quotes should be removed
* @ return The string without quotes . */
@ Nullable public static String extractStringValue ( @ Nullable final String sStr ) { } } | if ( StringHelper . hasNoText ( sStr ) || sStr . length ( ) < 2 ) return sStr ; final char cFirst = sStr . charAt ( 0 ) ; if ( ( cFirst == '"' || cFirst == '\'' ) && StringHelper . getLastChar ( sStr ) == cFirst ) { // Remove quotes around the string
return _trimBy ( sStr , 1 , 1 ) ; } return sStr ; |
public class LocalQueue { /** * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . local . destination . AbstractLocalDestination # close ( ) */
@ Override public final void close ( ) throws JMSException { } } | synchronized ( closeLock ) { if ( closed ) return ; closed = true ; } ActivityWatchdog . getInstance ( ) . unregister ( this ) ; synchronized ( storeLock ) { if ( volatileStore != null ) { volatileStore . close ( ) ; // Delete message store if the queue was temporary
if ( queueDef . isTemporary ( ) ) volatileStore . delete ( ) ; } if ( persistentStore != null ) { persistentStore . close ( ) ; // Delete message store if the queue was temporary
if ( queueDef . isTemporary ( ) ) persistentStore . delete ( ) ; } } // Create a snapshot to avoid concurrent modification
List < LocalMessageConsumer > consumers ; consumersLock . readLock ( ) . lock ( ) ; try { if ( localConsumers . isEmpty ( ) ) return ; consumers = new ArrayList < > ( localConsumers ) ; } finally { consumersLock . readLock ( ) . unlock ( ) ; } // Close all consumers
for ( int n = 0 ; n < consumers . size ( ) ; n ++ ) { LocalMessageConsumer consumer = consumers . get ( n ) ; try { consumer . close ( ) ; } catch ( JMSException e ) { ErrorTools . log ( e , log ) ; } } |
public class TablePodImpl { /** * Notify the watches on the target server . */
@ Override public void notifyForeignWatch ( byte [ ] key , String serverId ) { } } | ClusterServiceKraken proxy = _podKraken . getProxy ( serverId ) ; if ( proxy != null ) { proxy . notifyLocalWatch ( _table . getKey ( ) , key ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RelationsType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "leq" ) public JAXBElement < RelationsType > createLeq ( RelationsType value ) { } } | return new JAXBElement < RelationsType > ( _Leq_QNAME , RelationsType . class , null , value ) ; |
public class MigrationModel { /** * < p > findMigrationResource . < / p >
* @ return a { @ link java . util . List } object . */
protected List < MigrationResource > findMigrationResource ( ) { } } | final List < MigrationResource > resources = Lists . newArrayList ( ) ; BeanDescriptor < ScriptInfo > beanDescriptor = server . getBeanDescriptor ( ScriptInfo . class ) ; Transaction transaction = server . createTransaction ( TxIsolation . READ_COMMITED ) ; try ( Connection connection = transaction . getConnection ( ) ) { String tableName = beanDescriptor . getBaseTable ( ) ; ResultSet rs = connection . getMetaData ( ) . getTables ( null , null , "%" , null ) ; while ( rs . next ( ) ) { if ( tableName . equalsIgnoreCase ( rs . getString ( 3 ) ) ) { migrationTableExist = true ; break ; } } if ( migrationTableExist ) { server . find ( ScriptInfo . class ) . findEach ( bean -> resources . add ( new MigrationResource ( bean ) ) ) ; } transaction . commit ( ) ; } catch ( Exception e ) { transaction . rollback ( ) ; } finally { transaction . end ( ) ; } return resources ; |
public class AbstractDatabaseEngine { /** * Check if the entity has an identity column .
* @ param entity The entity to check .
* @ return True if the entity has an identity column and false otherwise . */
public boolean hasIdentityColumn ( DbEntity entity ) { } } | for ( final DbColumn column : entity . getColumns ( ) ) { if ( column . isAutoInc ( ) ) { return true ; } } return false ; |
public class DatabaseMetaData { /** * { @ inheritDoc } */
public ResultSet getPseudoColumns ( final String catalog , final String schemaPattern , final String tableNamePattern , final String columnNamePattern ) throws SQLException { } } | return RowLists . rowList8 ( String . class , String . class , String . class , String . class , String . class , String . class , String . class , String . class ) . withLabel ( 1 , "TABLE_CAT" ) . withLabel ( 2 , "TABLE_SCHEM" ) . withLabel ( 3 , "TABLE_NAME" ) . withLabel ( 4 , "COLUMN_NAME" ) . withLabel ( 5 , "GRANTOR" ) . withLabel ( 6 , "GRANTEE" ) . withLabel ( 7 , "PRIVILEGE" ) . withLabel ( 8 , "IS_GRANTABLE" ) . resultSet ( ) ; |
public class AbstractDraweeControllerBuilder { /** * Creates a data source supplier for the given image request . */
protected Supplier < DataSource < IMAGE > > getDataSourceSupplierForRequest ( final DraweeController controller , String controllerId , REQUEST imageRequest ) { } } | return getDataSourceSupplierForRequest ( controller , controllerId , imageRequest , CacheLevel . FULL_FETCH ) ; |
public class KerasEmbedding { /** * Get layer output type .
* @ param inputType Array of InputTypes
* @ return output type as InputType
* @ throws InvalidKerasConfigurationException Invalid Keras config */
@ Override public InputType getOutputType ( InputType ... inputType ) throws InvalidKerasConfigurationException { } } | /* Check whether layer requires a preprocessor for this InputType . */
InputPreProcessor preprocessor = getInputPreprocessor ( inputType [ 0 ] ) ; if ( preprocessor != null ) { return this . getEmbeddingLayer ( ) . getOutputType ( - 1 , preprocessor . getOutputType ( inputType [ 0 ] ) ) ; } return this . getEmbeddingLayer ( ) . getOutputType ( - 1 , inputType [ 0 ] ) ; |
public class DiffieHellmanSuiteImpl { /** * DH3K RIM implementation is currently buggy and DOES NOT WORK ! ! ! */
public void setAlgorithm ( KeyAgreementType dh ) { } } | log ( "DH algorithm set: " + getDHName ( dhMode ) + " -> " + getDHName ( dh ) ) ; try { if ( dhMode != null && dh . keyType == dhMode . keyType ) return ; dhMode = dh ; switch ( dhMode . keyType ) { case KeyAgreementType . DH_MODE_DH3K : DHParameterSpec paramSpec = new DHParameterSpec ( dhP , dhG , DH_EXP_LENGTH ) ; dhKeyGen = KeyPairGenerator . getInstance ( ALGORITHM_DH ) ; dhKeyGen . initialize ( paramSpec , sr ) ; dhKeyPair = dhKeyGen . generateKeyPair ( ) ; clearEcdh ( ) ; break ; case KeyAgreementType . DH_MODE_EC25 : setupEC ( 256 ) ; break ; case KeyAgreementType . DH_MODE_EC38 : default : setupEC ( 384 ) ; break ; } } catch ( Exception e ) { // TODO Auto - generated catch block
e . printStackTrace ( ) ; throw new RuntimeException ( "Failed init Diffie-Hellman: " + e . getClass ( ) . getName ( ) + ": " + e . getMessage ( ) + ", bitlength p = " + dhP . bitCount ( ) ) ; } |
public class QueriedGetResponseUnmarshaller { /** * { @ inheritDoc } */
@ Override protected void onDouble ( Double floating , String fieldName , JsonParser jp ) { } } | log . trace ( fieldName + " " + floating ) ; if ( resultStarted && entityStarted && idFound && fieldName != null && floating != null ) { ClassUtil . setSilent ( getEntityInstance ( ) , fieldName , floating ) ; } |
public class ArrayQueue { /** * Serialize this queue .
* @ serialData The current size ( < tt > int < / tt > ) of the queue ,
* followed by all of its elements ( each an object reference ) in
* first - to - last order . */
private void writeObject ( java . io . ObjectOutputStream s ) throws java . io . IOException { } } | s . defaultWriteObject ( ) ; // Write out size
s . writeInt ( size ( ) ) ; // Write out elements in order .
int mask = elements . length - 1 ; for ( int i = head ; i != tail ; i = ( i + 1 ) & mask ) s . writeObject ( elements [ i ] ) ; |
public class XData { /** * stores a datanode in a xdata file using the given marshallers . For all classes other
* than these a special marshaller is required to map the class ' data to a data node
* deSerializedObject :
* < ul >
* < li > Boolean < / li >
* < li > Long < / li >
* < li > Integer < / li >
* < li > String < / li >
* < li > Float < / li >
* < li > Double < / li >
* < li > Byte < / li >
* < li > Short < / li >
* < li > Character < / li >
* < li > DataNode < / li >
* < li > List & lt ; ? & gt ; < / li >
* < / ul >
* Also take a look at { @ link com . moebiusgames . xdata . marshaller } . There are a bunch of
* standard marshallers that ARE INCLUDED by default . So you don ' t need to add them here
* to work .
* @ param node
* @ param out
* @ param addChecksum if this is true then a sha - 256 checksum is added at the end of this xdata stream
* @ param ignoreMissingMarshallers if this is set to true then classes that can ' t be marshalled are
* silently replaced with null values
* @ param marshallers
* @ throws IOException */
public static void store ( DataNode node , OutputStream out , boolean addChecksum , boolean ignoreMissingMarshallers , AbstractDataMarshaller < ? > ... marshallers ) throws IOException { } } | store ( node , out , addChecksum , ignoreMissingMarshallers , DUMMY_PROGRESS_LISTENER , marshallers ) ; |
public class Calendar { /** * Assign the given entry to each date that it intersects with in the given search interval . */
private void addEntryToResult ( Map < LocalDate , List < Entry < ? > > > result , Entry < ? > entry , LocalDate startDate , LocalDate endDate ) { } } | LocalDate entryStartDate = entry . getStartDate ( ) ; LocalDate entryEndDate = entry . getEndDate ( ) ; // entry does not intersect with time interval
if ( entryEndDate . isBefore ( startDate ) || entryStartDate . isAfter ( endDate ) ) { return ; } if ( entryStartDate . isAfter ( startDate ) ) { startDate = entryStartDate ; } if ( entryEndDate . isBefore ( endDate ) ) { endDate = entryEndDate ; } LocalDate date = startDate ; do { result . computeIfAbsent ( date , it -> new ArrayList < > ( ) ) . add ( entry ) ; date = date . plusDays ( 1 ) ; } while ( ! date . isAfter ( endDate ) ) ; |
public class ServerControllerImpl { /** * Build { @ link SSLContext } from < code > org . ops4j . pax . web < / code > PID configuration
* @ return */
private SSLContext buildSSLContext ( ) { } } | String keyANDkeystorePassword = configuration . getSslKeyPassword ( ) == null ? configuration . getSslPassword ( ) : configuration . getSslKeyPassword ( ) ; return buildSSLContext ( configuration . getSslKeystore ( ) , configuration . getSslKeystoreType ( ) , keyANDkeystorePassword , keyANDkeystorePassword , configuration . getSslKeyAlias ( ) , configuration . getTrustStore ( ) , configuration . getTrustStoreType ( ) , configuration . getTrustStorePassword ( ) , configuration . isValidateCerts ( ) , configuration . getCrlPath ( ) , null , configuration . isValidatePeerCerts ( ) , configuration . isEnableCRLDP ( ) , configuration . isEnableOCSP ( ) , configuration . getOcspResponderURL ( ) , configuration . getSslKeystoreProvider ( ) , configuration . getSslTrustStoreProvider ( ) , configuration . getSslProvider ( ) ) ; |
public class MinioClient { /** * Set JSON string of policy on given bucket .
* @ param bucketName Bucket name .
* @ param policy Bucket policy JSON string .
* < / p > < b > Example : < / b > < br >
* < pre > { @ code StringBuilder builder = new StringBuilder ( ) ;
* builder . append ( " { \ n " ) ;
* builder . append ( " \ " Statement \ " : [ \ n " ) ;
* builder . append ( " { \ n " ) ;
* builder . append ( " \ " Action \ " : [ \ n " ) ;
* builder . append ( " \ " s3 : GetBucketLocation \ " , \ n " ) ;
* builder . append ( " \ " s3 : ListBucket \ " \ n " ) ;
* builder . append ( " ] , \ n " ) ;
* builder . append ( " \ " Effect \ " : \ " Allow \ " , \ n " ) ;
* builder . append ( " \ " Principal \ " : \ " * \ " , \ n " ) ;
* builder . append ( " \ " Resource \ " : \ " arn : aws : s3 : : : my - bucketname \ " \ n " ) ;
* builder . append ( " } , \ n " ) ;
* builder . append ( " { \ n " ) ;
* builder . append ( " \ " Action \ " : \ " s3 : GetObject \ " , \ n " ) ;
* builder . append ( " \ " Effect \ " : \ " Allow \ " , \ n " ) ;
* builder . append ( " \ " Principal \ " : \ " * \ " , \ n " ) ;
* builder . append ( " \ " Resource \ " : \ " arn : aws : s3 : : : my - bucketname / myobject * \ " \ n " ) ;
* builder . append ( " } \ n " ) ;
* builder . append ( " ] , \ n " ) ;
* builder . append ( " \ " Version \ " : \ " 2012-10-17 \ " \ n " ) ;
* builder . append ( " } \ n " ) ;
* setBucketPolicy ( " my - bucketname " , builder . toString ( ) ) ; } < / pre >
* @ throws InvalidBucketNameException upon invalid bucket name is given
* @ throws InvalidObjectPrefixException upon invalid object prefix .
* @ throws NoSuchAlgorithmException
* upon requested algorithm was not found during signature calculation
* @ throws InsufficientDataException upon getting EOFException while reading given
* InputStream even before reading given length
* @ throws IOException upon connection error
* @ throws InvalidKeyException
* upon an invalid access key or secret key
* @ throws NoResponseException upon no response from server
* @ throws XmlPullParserException upon parsing response xml
* @ throws ErrorResponseException upon unsuccessful execution
* @ throws InternalException upon internal library error * */
public void setBucketPolicy ( String bucketName , String policy ) throws InvalidBucketNameException , InvalidObjectPrefixException , NoSuchAlgorithmException , InsufficientDataException , IOException , InvalidKeyException , NoResponseException , XmlPullParserException , ErrorResponseException , InternalException { } } | Map < String , String > headerMap = new HashMap < > ( ) ; headerMap . put ( "Content-Type" , "application/json" ) ; Map < String , String > queryParamMap = new HashMap < > ( ) ; queryParamMap . put ( "policy" , "" ) ; HttpResponse response = executePut ( bucketName , null , headerMap , queryParamMap , policy , 0 ) ; response . body ( ) . close ( ) ; |
public class GetLoadBalancerTlsCertificatesResult { /** * An array of LoadBalancerTlsCertificate objects describing your SSL / TLS certificates .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTlsCertificates ( java . util . Collection ) } or { @ link # withTlsCertificates ( java . util . Collection ) } if you
* want to override the existing values .
* @ param tlsCertificates
* An array of LoadBalancerTlsCertificate objects describing your SSL / TLS certificates .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetLoadBalancerTlsCertificatesResult withTlsCertificates ( LoadBalancerTlsCertificate ... tlsCertificates ) { } } | if ( this . tlsCertificates == null ) { setTlsCertificates ( new java . util . ArrayList < LoadBalancerTlsCertificate > ( tlsCertificates . length ) ) ; } for ( LoadBalancerTlsCertificate ele : tlsCertificates ) { this . tlsCertificates . add ( ele ) ; } return this ; |
public class JmxBean { /** * Optional setting which defines the additional methods ( not get / is / set . . . ) to be exposed as operations via JMX . */
public void setOperationInfos ( JmxOperationInfo [ ] operationInfos ) { } } | if ( this . operationInfos == null ) { this . operationInfos = arrayToList ( operationInfos ) ; } else { for ( JmxOperationInfo opertionInfo : operationInfos ) { this . operationInfos . add ( opertionInfo ) ; } } |
public class PathOverrideService { /** * First we get the oldGroups by looking at the database to find the path / profile match
* @ param profileId ID of profile
* @ param pathId ID of path
* @ return Comma - delimited list of groups IDs */
public String getGroupIdsInPathProfile ( int profileId , int pathId ) { } } | return ( String ) sqlService . getFromTable ( Constants . PATH_PROFILE_GROUP_IDS , Constants . GENERIC_ID , pathId , Constants . DB_TABLE_PATH ) ; |
public class DesignClockSkin { /** * * * * * * Initialization * * * * * */
@ Override protected void initGraphics ( ) { } } | // Set initial size
if ( Double . compare ( clock . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( clock . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getHeight ( ) , 0.0 ) <= 0 ) { if ( clock . getPrefWidth ( ) > 0 && clock . getPrefHeight ( ) > 0 ) { clock . setPrefSize ( clock . getPrefWidth ( ) , clock . getPrefHeight ( ) ) ; } else { clock . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } rotationRadius = PREFERRED_WIDTH * 1.25 ; clip = new Circle ( PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT * 0.5 , PREFERRED_WIDTH * 0.5 ) ; tickCanvas = new Canvas ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; tickCanvas . setClip ( clip ) ; tickCtx = tickCanvas . getGraphicsContext2D ( ) ; needle = new Line ( PREFERRED_WIDTH * 0.5 , 0 , PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT ) ; needle . setFill ( null ) ; needle . setStrokeLineCap ( StrokeLineCap . BUTT ) ; needle . setStroke ( clock . getHourColor ( ) ) ; dropShadow = new DropShadow ( ) ; dropShadow = new DropShadow ( BlurType . TWO_PASS_BOX , Color . rgb ( 0 , 0 , 0 , 0.25 ) , 0.015 * PREFERRED_WIDTH , 0.0 , 0.0 , 0.015 * PREFERRED_WIDTH ) ; shadowGroup = new Group ( needle ) ; shadowGroup . setEffect ( clock . getShadowsEnabled ( ) ? dropShadow : null ) ; innerShadow = new InnerShadow ( BlurType . TWO_PASS_BOX , Color . rgb ( 0 , 0 , 0 , 0.65 ) , 4 , 0.0 , 0 , 1 ) ; pane = new Pane ( tickCanvas , shadowGroup ) ; pane . setBorder ( new Border ( new BorderStroke ( clock . getBorderPaint ( ) , BorderStrokeStyle . SOLID , new CornerRadii ( 1024 ) , new BorderWidths ( clock . getBorderWidth ( ) ) ) ) ) ; pane . setBackground ( new Background ( new BackgroundFill ( clock . getBackgroundPaint ( ) , new CornerRadii ( 1024 ) , Insets . EMPTY ) ) ) ; pane . setEffect ( innerShadow ) ; getChildren ( ) . setAll ( pane ) ; |
public class SmartsAtomAtomMapFilter { /** * Filters a structure match ( described as an index permutation query - > target ) for
* those where the atom - atom maps are acceptable .
* @ param perm permuation
* @ return whether the match should be accepted */
@ Override public boolean apply ( int [ ] perm ) { } } | for ( MappedPairs mpair : mapped ) { // possibly ' or ' of query maps , need to use a set
if ( mpair . rIdxs . length > 1 ) { // bind target reactant maps
final Set < Integer > bound = new HashSet < > ( ) ; for ( int rIdx : mpair . rIdxs ) { int refidx = mapidx ( target . getAtom ( perm [ rIdx ] ) ) ; if ( refidx == 0 ) return false ; // unmapped in target
bound . add ( refidx ) ; } // check product maps
for ( int pIdx : mpair . pIdxs ) { if ( ! bound . contains ( mapidx ( target . getAtom ( perm [ pIdx ] ) ) ) ) return false ; } } // no ' or ' of query atom map ( more common case )
else { final int refidx = mapidx ( target . getAtom ( perm [ mpair . rIdxs [ 0 ] ] ) ) ; if ( refidx == 0 ) return false ; // unmapped in target
// pairwise mismatch
if ( refidx != mapidx ( target . getAtom ( perm [ mpair . pIdxs [ 0 ] ] ) ) ) return false ; for ( int i = 1 ; i < mpair . pIdxs . length ; i ++ ) { if ( refidx != mapidx ( target . getAtom ( perm [ mpair . pIdxs [ i ] ] ) ) ) return false ; } } } return true ; |
public class ComponentDao { /** * Scroll all < strong > enabled < / strong > files of the specified project ( same project _ uuid ) in no specific order with
* ' SOURCE ' source and a non null path . */
public void scrollAllFilesForFileMove ( DbSession session , String projectUuid , ResultHandler < FileMoveRowDto > handler ) { } } | mapper ( session ) . scrollAllFilesForFileMove ( projectUuid , handler ) ; |
public class IdeContentProposalCreator { /** * Returns an entry with the given proposal and the prefix from the context , or null if the proposal is not valid .
* If it is valid , the initializer function is applied to it . */
public ContentAssistEntry createProposal ( final String proposal , final ContentAssistContext context , final Procedure1 < ? super ContentAssistEntry > init ) { } } | return this . createProposal ( proposal , context . getPrefix ( ) , context , ContentAssistEntry . KIND_UNKNOWN , init ) ; |
public class MMORGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setFlags ( Integer newFlags ) { } } | Integer oldFlags = flags ; flags = newFlags ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . MMORG__FLAGS , oldFlags , flags ) ) ; |
public class Signing { /** * Updates { @ code h } with the contents of { @ code labels } .
* { @ code labels } can be any Map & lt ; String , String & gt ; , but intended to be used for the labels of
* one of the model protobufs .
* @ param h a { @ link Hasher }
* @ param labels some labels
* @ return the { @ code Hasher } , to allow fluent - style usage */
public static Hasher putLabels ( Hasher h , Map < String , String > labels ) { } } | for ( Map . Entry < String , String > labelsEntry : labels . entrySet ( ) ) { h . putChar ( '\0' ) ; h . putString ( labelsEntry . getKey ( ) , StandardCharsets . UTF_8 ) ; h . putChar ( '\0' ) ; h . putString ( labelsEntry . getValue ( ) , StandardCharsets . UTF_8 ) ; } return h ; |
public class ProposalLineItem { /** * Sets the lastReservationDateTime value for this ProposalLineItem .
* @ param lastReservationDateTime * The last { @ link DateTime } when the { @ link ProposalLineItem }
* reserved inventory .
* This attribute is read - only . */
public void setLastReservationDateTime ( com . google . api . ads . admanager . axis . v201811 . DateTime lastReservationDateTime ) { } } | this . lastReservationDateTime = lastReservationDateTime ; |
public class ServerRequestQueue { /** * Set Process wait lock to false for any open / install request in the queue */
void unlockProcessWait ( ServerRequest . PROCESS_WAIT_LOCK lock ) { } } | synchronized ( reqQueueLockObject ) { for ( ServerRequest req : queue ) { if ( req != null ) { req . removeProcessWaitLock ( lock ) ; } } } |
public class MatrixIO { /** * Converts the contents of a matrix file as a { @ link Matrix } object , using
* the provided type description as a hint for what kind to create . The
* type of { @ code Matrix } object created will be based on an estimate of
* whether the data will fit into the available memory . Note that the
* returned { @ link Matrix } instance is not backed by the data on file ;
* changes to the { @ code Matrix } will < i > not < / i > be reflected in the
* original file ' s data .
* @ param matrix a file contain matrix data
* @ param format the format of the file
* @ param matrixType the expected type and behavior of the matrix in
* relation to memory . This value will be used as a hint for what
* kind of { @ code Matrix } instance to create
* @ param transposeOnRead { @ code true } if the matrix should be transposed as
* its data is read in . For certain formats , this is more efficient
* than reading the data in and then transposing it directly .
* @ return the { @ code Matrix } instance that contains the data in the
* provided file , optionally transposed from its original format
* @ throws IOException if any error occurs while reading in the matrix data */
public static Matrix readMatrix ( File matrix , Format format , Type matrixType , boolean transposeOnRead ) throws IOException { } } | try { switch ( format ) { case DENSE_TEXT : return readDenseTextMatrix ( matrix , matrixType , transposeOnRead ) ; case MATLAB_SPARSE : return readMatlabSparse ( matrix , matrixType , transposeOnRead ) ; case CLUTO_SPARSE : return readClutoSparse ( matrix , matrixType , transposeOnRead ) ; case SVDLIBC_SPARSE_TEXT : return readSparseSVDLIBCtext ( matrix , matrixType , transposeOnRead ) ; // These two formats are equivalent
case CLUTO_DENSE : case SVDLIBC_DENSE_TEXT : return readDenseSVDLIBCtext ( matrix , matrixType , transposeOnRead ) ; case SVDLIBC_SPARSE_BINARY : return readSparseSVDLIBCbinary ( matrix , matrixType , transposeOnRead ) ; case SVDLIBC_DENSE_BINARY : return readDenseSVDLIBCbinary ( matrix , matrixType , transposeOnRead ) ; } } catch ( EOFException eofe ) { // Rethrow with more specific type information
throw new MatrixIOException ( "Matrix file " + matrix + " appeared " + "truncated, or was missing expected values at the end of its " + "contents." ) ; } throw new Error ( "Reading matrices of " + format + " format is not " + "currently supported. Email " + "s-space-research-dev@googlegroups.com to request its " + "inclusion and it will be quickly added" ) ; |
public class AuditSourceIdentificationType { /** * Sets the value of the auditSourceTypeCode property .
* @ deprecated use { @ link # getAuditSourceType ( ) and add to the list } */
public void setAuditSourceTypeCode ( CodedValueType auditSourceTypeCode ) { } } | AuditSourceType auditSourceType = new AuditSourceType ( ) ; auditSourceType . setCode ( auditSourceTypeCode . getCode ( ) ) ; auditSourceType . setCodeSystem ( auditSourceTypeCode . getCodeSystem ( ) ) ; auditSourceType . setCodeSystemName ( auditSourceTypeCode . getCodeSystemName ( ) ) ; auditSourceType . setOriginalText ( auditSourceTypeCode . getOriginalText ( ) ) ; |
public class CoronaJobHistory { /** * Log job finished . closes the job file in history .
* @ param finishTime finish time of job in ms .
* @ param finishedMaps no of maps successfully finished .
* @ param finishedReduces no of reduces finished sucessfully .
* @ param failedMaps no of failed map tasks . ( includes killed )
* @ param failedReduces no of failed reduce tasks . ( includes killed )
* @ param killedMaps no of killed map tasks .
* @ param killedReduces no of killed reduce tasks .
* @ param counters the counters from the job */
public void logFinished ( long finishTime , int finishedMaps , int finishedReduces , int failedMaps , int failedReduces , int killedMaps , int killedReduces , Counters mapCounters , Counters reduceCounters , Counters counters ) { } } | if ( disableHistory ) { return ; } if ( null != writers ) { log ( writers , RecordTypes . Job , new Keys [ ] { Keys . JOBID , Keys . FINISH_TIME , Keys . JOB_STATUS , Keys . FINISHED_MAPS , Keys . FINISHED_REDUCES , Keys . FAILED_MAPS , Keys . FAILED_REDUCES , Keys . KILLED_MAPS , Keys . KILLED_REDUCES , Keys . MAP_COUNTERS , Keys . REDUCE_COUNTERS , Keys . COUNTERS } , new String [ ] { jobId . toString ( ) , Long . toString ( finishTime ) , Values . SUCCESS . name ( ) , String . valueOf ( finishedMaps ) , String . valueOf ( finishedReduces ) , String . valueOf ( failedMaps ) , String . valueOf ( failedReduces ) , String . valueOf ( killedMaps ) , String . valueOf ( killedReduces ) , mapCounters . makeEscapedCompactString ( ) , reduceCounters . makeEscapedCompactString ( ) , counters . makeEscapedCompactString ( ) } , true ) ; closeAndClear ( writers ) ; } // NOTE : history cleaning stuff deleted from here . We should do that
// somewhere else ! |
public class AbstractCsvReader { /** * { @ inheritDoc } */
public String [ ] getHeader ( final boolean firstLineCheck ) throws IOException { } } | if ( firstLineCheck && tokenizer . getLineNumber ( ) != 0 ) { throw new SuperCsvException ( String . format ( "CSV header must be fetched as the first read operation, but %d lines have already been read" , tokenizer . getLineNumber ( ) ) ) ; } if ( readRow ( ) ) { return columns . toArray ( new String [ columns . size ( ) ] ) ; } return null ; |
public class HTTPUtilities { /** * Used to send arbitrary to the user .
* @ param data The contents of the file to send
* @ param filename The name of the file . This is only useful if asAttachment
* is true
* @ param mime The MIME type of the content
* @ param asAttachment If true , the file will be downloaded . If false , it is
* up to the browser to decide whether to display or download the
* file */
private static void writeOutContent ( final byte [ ] data , final String filename , final String mime , final boolean asAttachment ) { } } | try { final HttpServletResponse response = ( HttpServletResponse ) FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . getResponse ( ) ; response . setContentType ( mime ) ; if ( asAttachment ) response . addHeader ( "Content-Disposition" , "attachment;filename=" + filename ) ; response . setContentLength ( data . length ) ; final OutputStream writer = response . getOutputStream ( ) ; writer . write ( data ) ; writer . flush ( ) ; writer . close ( ) ; FacesContext . getCurrentInstance ( ) . responseComplete ( ) ; } catch ( final Exception ex ) { LOG . error ( "Unable to write content to HTTP Output Stream" , ex ) ; } |
public class GenerateParseInfoVisitor { /** * Implementations for specific nodes . */
@ Override protected void visitSoyFileSetNode ( SoyFileSetNode node ) { } } | // Figure out the generated class name for each Soy file , including adding number suffixes
// to resolve collisions , and then adding the common suffix " SoyInfo " .
Multimap < String , SoyFileNode > baseGeneratedClassNameToSoyFilesMap = HashMultimap . create ( ) ; for ( SoyFileNode soyFile : node . getChildren ( ) ) { baseGeneratedClassNameToSoyFilesMap . put ( javaClassNameSource . generateBaseClassName ( soyFile ) , soyFile ) ; } soyFileToJavaClassNameMap = Maps . newHashMap ( ) ; for ( String baseClassName : baseGeneratedClassNameToSoyFilesMap . keySet ( ) ) { Collection < SoyFileNode > soyFiles = baseGeneratedClassNameToSoyFilesMap . get ( baseClassName ) ; if ( soyFiles . size ( ) == 1 ) { for ( SoyFileNode soyFile : soyFiles ) { soyFileToJavaClassNameMap . put ( soyFile , baseClassName + "SoyInfo" ) ; } } else { int numberSuffix = 1 ; for ( SoyFileNode soyFile : soyFiles ) { soyFileToJavaClassNameMap . put ( soyFile , baseClassName + numberSuffix + "SoyInfo" ) ; numberSuffix ++ ; } } } // Run the pass .
for ( SoyFileNode soyFile : node . getChildren ( ) ) { visit ( soyFile ) ; } |
public class SquareCrossClustersIntoGrids { /** * Given a node and the corner to the next node down the line , add to the list every other node until
* it hits the end of the row .
* @ param n Initial node
* @ param corner Which corner points to the next node
* @ param sign Determines the direction it will traverse . - 1 or 1
* @ param skip true = start adding nodes at second , false = start first .
* @ param row List that the nodes are placed into */
boolean addToRow ( SquareNode n , int corner , int sign , boolean skip , List < SquareNode > row ) { } } | SquareEdge e ; while ( ( e = n . edges [ corner ] ) != null ) { if ( e . a == n ) { n = e . b ; corner = e . sideB ; } else { n = e . a ; corner = e . sideA ; } if ( ! skip ) { if ( n . graph != SquareNode . RESET_GRAPH ) { // This should never happen in a valid grid . It can happen if two nodes link to each other multiple
// times . Other situations as well
invalid = true ; return false ; } n . graph = 0 ; row . add ( n ) ; } skip = ! skip ; sign *= - 1 ; corner = addOffset ( corner , sign , n . square . size ( ) ) ; } return true ; |
public class AmazonKinesisAnalyticsV2Client { /** * Returns a list of Amazon Kinesis Data Analytics applications in your account . For each application , the response
* includes the application name , Amazon Resource Name ( ARN ) , and status .
* If you want detailed information about a specific application , use < a > DescribeApplication < / a > .
* @ param listApplicationsRequest
* @ return Result of the ListApplications operation returned by the service .
* @ throws InvalidRequestException
* The request JSON is not valid for the operation .
* @ sample AmazonKinesisAnalyticsV2 . ListApplications
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / kinesisanalyticsv2-2018-05-23 / ListApplications "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ListApplicationsResult listApplications ( ListApplicationsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListApplications ( request ) ; |
public class GrailsClassUtils { /** * < p > Looks for a property of the reference instance with a given name . < / p >
* < p > If found its value is returned . We follow the Java bean conventions with augmentation for groovy support
* and static fields / properties . We will therefore match , in this order :
* < ol >
* < li > Standard public bean property ( with getter or just public field , using normal introspection )
* < li > Public static property with getter method
* < li > Public static field
* < / ol >
* @ return property value or null if no property found */
public static Object getPropertyOrStaticPropertyOrFieldValue ( Object obj , String name ) throws BeansException { } } | BeanWrapper ref = new BeanWrapperImpl ( obj ) ; return getPropertyOrStaticPropertyOrFieldValue ( ref , obj , name ) ; |
public class RemoteMessageRequest { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteMessageControllable # removeMessage ( boolean ) */
public void moveMessage ( boolean discard ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeMessage" , new Boolean ( discard ) ) ; InvalidOperationException finalE = new InvalidOperationException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0005" , new Object [ ] { "RemoteMessageRequest.removeMessage" , "1:259:1.34" , this } , null ) ) ; SibTr . exception ( tc , finalE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeMessage" , finalE ) ; throw finalE ; |
public class OrderItemUrl { /** * Get Resource Url for UpdateItemDuty
* @ param dutyAmount The amount added to the order item for duty fees .
* @ param orderId Unique identifier of the order .
* @ param orderItemId Unique identifier of the item to remove from the order .
* @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss .
* @ param updateMode Specifies whether to update the original order , update the order in draft mode , or update the order in draft mode and then commit the changes to the original . Draft mode enables users to make incremental order changes before committing the changes to the original order . Valid values are " ApplyToOriginal , " " ApplyToDraft , " or " ApplyAndCommit . "
* @ param version Determines whether or not to check versioning of items for concurrency purposes .
* @ return String Resource Url */
public static MozuUrl updateItemDutyUrl ( Double dutyAmount , String orderId , String orderItemId , String responseFields , String updateMode , String version ) { } } | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/items/{orderItemId}/dutyAmount/{dutyAmount}?updatemode={updateMode}&version={version}&responseFields={responseFields}" ) ; formatter . formatUrl ( "dutyAmount" , dutyAmount ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "orderItemId" , orderItemId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "updateMode" , updateMode ) ; formatter . formatUrl ( "version" , version ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
public class IntegralImageOps { /** * Checks to see if the kernel is applied at this specific spot if all the pixels
* would be inside the image bounds or not
* @ param x location where the kernel is applied . x - axis
* @ param y location where the kernel is applied . y - axis
* @ param kernel The kernel
* @ param width Image ' s width
* @ param height Image ' s height
* @ return true if in bounds and false if out of bounds */
public static boolean isInBounds ( int x , int y , IntegralKernel kernel , int width , int height ) { } } | for ( ImageRectangle r : kernel . blocks ) { if ( x + r . x0 < 0 || y + r . y0 < 0 ) return false ; if ( x + r . x1 >= width || y + r . y1 >= height ) return false ; } return true ; |
public class TimeBasedRollingPolicy { /** * { @ inheritDoc } */
public RolloverDescription initialize ( final String currentActiveFile , final boolean append ) { } } | long n = System . currentTimeMillis ( ) ; nextCheck = ( ( n / 1000 ) + 1 ) * 1000 ; StringBuffer buf = new StringBuffer ( ) ; formatFileName ( new Date ( n ) , buf ) ; lastFileName = buf . toString ( ) ; // RollingPolicyBase . activeFileName duplicates RollingFileAppender . file
// and should be removed .
if ( activeFileName != null ) { return new RolloverDescriptionImpl ( activeFileName , append , null , null ) ; } else if ( currentActiveFile != null ) { return new RolloverDescriptionImpl ( currentActiveFile , append , null , null ) ; } else { return new RolloverDescriptionImpl ( lastFileName . substring ( 0 , lastFileName . length ( ) - suffixLength ) , append , null , null ) ; } |
public class XmlFile { /** * Parse this XML document with the given parser .
* @ param parser the parser to parse the document with .
* @ param < T > the type of the element produced by parsing the XML document .
* @ return the object parsed from the XML document .
* @ throws ParserConfigurationException if an XML ( SAX ) parser cannot be created .
* @ throws SAXException if parsing the XML document failed .
* @ throws IOException if reading the XML document failed . */
public < T > T parse ( XmlParser < T > parser ) throws ParserConfigurationException , SAXException , IOException { } } | return resolver . parse ( path , parser ) ; |
public class SettingsCommandUser { /** * CLI utility methods */
public static SettingsCommandUser build ( String [ ] params ) { } } | GroupedOptions options = GroupedOptions . select ( params , new Options ( new Uncertainty ( ) ) , new Options ( new Duration ( ) ) , new Options ( new Count ( ) ) ) ; if ( options == null ) { printHelp ( ) ; System . out . println ( "Invalid USER options provided, see output for valid options" ) ; System . exit ( 1 ) ; } return new SettingsCommandUser ( ( Options ) options ) ; |
public class SarlCompiler { /** * Generate the Java code to the preparation statements for the assert keyword .
* @ param assertExpression the expression .
* @ param appendable the output .
* @ param isReferenced indicates if the expression is referenced . */
protected void _toJavaStatement ( SarlAssertExpression assertExpression , ITreeAppendable appendable , boolean isReferenced ) { } } | if ( ! assertExpression . isIsStatic ( ) && assertExpression . getCondition ( ) != null && isAtLeastJava8 ( assertExpression ) ) { final XExpression condition = assertExpression . getCondition ( ) ; final LightweightTypeReference actualType = getLightweightType ( condition ) ; if ( actualType != null ) { final Boolean booleanConstant = this . sarlExpressionHelper . toBooleanPrimitiveWrapperConstant ( condition ) ; if ( booleanConstant != null ) { appendable . newLine ( ) . append ( "assert " ) ; // $ NON - NLS - 1 $
appendable . append ( booleanConstant . toString ( ) ) ; } else { // Get the local variables .
final Map < XVariableDeclaration , XFeatureCall > localVariables = getReferencedLocalVariable ( condition , true ) ; final String className = appendable . declareUniqueNameVariable ( assertExpression , "$AssertEvaluator$" ) ; // $ NON - NLS - 1 $
appendable . openScope ( ) ; try { reassignThisInClosure ( appendable , findKnownTopLevelType ( Object . class , assertExpression ) ) ; appendable . newLine ( ) . append ( "class " ) . append ( className ) . append ( " {" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
appendable . increaseIndentation ( ) . newLine ( ) ; appendable . append ( "final boolean $$result;" ) . newLine ( ) ; // $ NON - NLS - 1 $
appendable . append ( className ) . append ( "(" ) ; // $ NON - NLS - 1 $
boolean first = true ; for ( final Entry < XVariableDeclaration , XFeatureCall > localVariable : localVariables . entrySet ( ) ) { if ( first ) { first = false ; } else { appendable . append ( ", " ) ; // $ NON - NLS - 1 $
} final JvmTypeReference localVariableType = getType ( localVariable . getValue ( ) ) ; appendable . append ( "final " ) . append ( toLightweight ( localVariableType , assertExpression ) ) ; // $ NON - NLS - 1 $
String referenceName = getReferenceName ( localVariable . getValue ( ) , appendable ) ; if ( Strings . isEmpty ( referenceName ) ) { referenceName = localVariable . getKey ( ) . getName ( ) ; } appendable . append ( " " ) . append ( referenceName ) ; // $ NON - NLS - 1 $
} appendable . append ( ") {" ) ; // $ NON - NLS - 1 $
appendable . increaseIndentation ( ) ; internalToJavaStatement ( condition , appendable , true ) ; appendable . newLine ( ) ; appendable . append ( "this.$$result = " ) ; // $ NON - NLS - 1 $
internalToConvertedExpression ( condition , appendable , actualType ) ; appendable . append ( ";" ) ; // $ NON - NLS - 1 $
appendable . decreaseIndentation ( ) . newLine ( ) ; appendable . append ( "}" ) ; // $ NON - NLS - 1 $
appendable . decreaseIndentation ( ) . newLine ( ) ; appendable . append ( "}" ) ; // $ NON - NLS - 1 $
appendable . newLine ( ) ; appendable . append ( "assert new " ) . append ( className ) . append ( "(" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
first = true ; for ( final Entry < XVariableDeclaration , XFeatureCall > localVariable : localVariables . entrySet ( ) ) { if ( first ) { first = false ; } else { appendable . append ( ", " ) ; // $ NON - NLS - 1 $
} String referenceName = getReferenceName ( localVariable . getValue ( ) , appendable ) ; if ( Strings . isEmpty ( referenceName ) ) { referenceName = localVariable . getKey ( ) . getName ( ) ; } appendable . append ( referenceName ) ; } appendable . append ( ").$$result" ) ; // $ NON - NLS - 1 $
} finally { appendable . closeScope ( ) ; } } if ( ! Strings . isEmpty ( assertExpression . getMessage ( ) ) ) { appendable . append ( " : \"" ) ; // $ NON - NLS - 1 $
appendable . append ( Strings . convertToJavaString ( assertExpression . getMessage ( ) ) ) ; appendable . append ( "\"" ) ; // $ NON - NLS - 1 $
} appendable . append ( ";" ) ; // $ NON - NLS - 1 $
} } |
public class CallExecutor { protected void handleOutParams ( List < Param > paramList , final CallableStatement cs , Object parameter , boolean functionCall ) { } } | if ( parameter == null ) { return ; } try { final int start = functionCall ? 1 : 0 ; for ( int i = start ; i < paramList . size ( ) ; i ++ ) { final Param param = paramList . get ( i ) ; if ( param . paramType == ParameterType . IN ) { continue ; } PropertyDesc pd = param . propertyDesc ; @ SuppressWarnings ( "unchecked" ) Object value = param . valueType . get ( param . paramClass , cs , i + 1 ) ; if ( value instanceof ResultSet ) { value = handleResultSet ( pd , ( ResultSet ) value ) ; } pd . setValue ( parameter , value ) ; } } catch ( final SQLException e ) { throw new SQLRuntimeException ( e ) ; } |
public class ApnsPayloadBuilder { /** * < p > Sets the summary argument count for this notification . The summary argument count is : < / p >
* < blockquote > The number of items the notification adds to the category ’ s summary format string . < / blockquote >
* < p > By default , all notifications count as a single " item " in a group of notifications . The summary argument count
* controls how many " items " in a " stack " of notifications are represented by a specific notification .
* If , for example , a notification informed a user that seven new podcasts are available , it might be helpful to set
* the summary argument count to 7 . When " stacked , " the notification would contribute an item count of 7
* to the total number of notifications reported in the summary string ( for example , " 7 more podcasts " ) .
* < p > By default , notifications count as a single " item " in a group of notifications , and so the default
* summary argument count is 1 ( even if no summary argument count is specified in the notification payload ) .
* If specified , summary argument count must be positive . < / p >
* @ param summaryArgumentCount the summary argument count for this notification ; if { @ code null } , the
* { @ code summary - arg - count } key is omitted from the payload entirely
* @ return a reference to this payload builder
* @ see < a href =
* " https : / / developer . apple . com / documentation / usernotifications / unnotificationcontent " >
* UNNotificationContent < / a >
* @ since 0.13.6 */
public ApnsPayloadBuilder setSummaryArgumentCount ( final Integer summaryArgumentCount ) { } } | if ( summaryArgumentCount != null && summaryArgumentCount < 1 ) { throw new IllegalArgumentException ( "Summary argument count must be positive." ) ; } this . summaryArgumentCount = summaryArgumentCount ; return this ; |
public class LogInterceptor { /** * Log the incomming request .
* Once a request gets triggered in okhttp3 , this interceptor gets called .
* @ param chain the chain of interceptor , provided by the okhttp3.
* @ return the response of the chain .
* @ throws IOException in case of failure down the line . */
@ Override public Response intercept ( Chain chain ) throws IOException { } } | Request request = chain . request ( ) ; long t1 = System . nanoTime ( ) ; logger . log ( String . format ( "Sending request %s on %s%n%s" , request . url ( ) , chain . connection ( ) , request . headers ( ) ) ) ; Response response = chain . proceed ( request ) ; long t2 = System . nanoTime ( ) ; logger . log ( String . format ( "Received response for %s in %.1fms%n%s" , response . request ( ) . url ( ) , ( t2 - t1 ) / NANOS_PER_SECOND , response . headers ( ) ) ) ; return response ; |
public class CmsContainerpageUtil { /** * Adds an option bar to the given drag element . < p >
* @ param element the element */
public void addOptionBar ( CmsContainerPageElementPanel element ) { } } | // the view permission is required for any actions regarding this element
if ( element . hasViewPermission ( ) ) { CmsElementOptionBar optionBar = CmsElementOptionBar . createOptionBarForElement ( element , m_controller . getDndHandler ( ) , m_optionButtons ) ; element . setElementOptionBar ( optionBar ) ; } |
public class Chain { /** * Creates a { @ link JobConf } for one of the Maps or Reduce in the chain .
* It creates a new JobConf using the chain job ' s JobConf as base and adds to
* it the configuration properties for the chain element . The keys of the
* chain element jobConf have precedence over the given JobConf .
* @ param jobConf the chain job ' s JobConf .
* @ param confKey the key for chain element configuration serialized in the
* chain job ' s JobConf .
* @ return a new JobConf aggregating the chain job ' s JobConf with the chain
* element configuration properties . */
private static JobConf getChainElementConf ( JobConf jobConf , String confKey ) { } } | JobConf conf ; try { Stringifier < JobConf > stringifier = new DefaultStringifier < JobConf > ( jobConf , JobConf . class ) ; conf = stringifier . fromString ( jobConf . get ( confKey , null ) ) ; } catch ( IOException ioex ) { throw new RuntimeException ( ioex ) ; } // we have to do this because the Writable desearialization clears all
// values set in the conf making not possible do do a new JobConf ( jobConf )
// in the creation of the conf above
jobConf = new JobConf ( jobConf ) ; for ( Map . Entry < String , String > entry : conf ) { jobConf . set ( entry . getKey ( ) , entry . getValue ( ) ) ; } return jobConf ; |
public class Validation { /** * Bootstrap accuracy estimation of a classification model .
* @ param < T > the data type of input objects .
* @ param k k - round bootstrap estimation .
* @ param trainer a classifier trainer that is properly parameterized .
* @ param x the test data set .
* @ param y the test data labels .
* @ return the k - round accuracies */
public static < T > double [ ] bootstrap ( int k , ClassifierTrainer < T > trainer , T [ ] x , int [ ] y ) { } } | if ( k < 2 ) { throw new IllegalArgumentException ( "Invalid k for k-fold bootstrap: " + k ) ; } int n = x . length ; double [ ] results = new double [ k ] ; Accuracy measure = new Accuracy ( ) ; Bootstrap bootstrap = new Bootstrap ( n , k ) ; for ( int i = 0 ; i < k ; i ++ ) { T [ ] trainx = Math . slice ( x , bootstrap . train [ i ] ) ; int [ ] trainy = Math . slice ( y , bootstrap . train [ i ] ) ; Classifier < T > classifier = trainer . train ( trainx , trainy ) ; int nt = bootstrap . test [ i ] . length ; int [ ] truth = new int [ nt ] ; int [ ] predictions = new int [ nt ] ; for ( int j = 0 ; j < nt ; j ++ ) { int l = bootstrap . test [ i ] [ j ] ; truth [ j ] = y [ l ] ; predictions [ j ] = classifier . predict ( x [ l ] ) ; } results [ i ] = measure . measure ( truth , predictions ) ; } return results ; |
public class Long { /** * Determines the { @ code long } value of the system property
* with the specified name .
* < p > The first argument is treated as the name of a system
* property . System properties are accessible through the { @ link
* java . lang . System # getProperty ( java . lang . String ) } method . The
* string value of this property is then interpreted as a { @ code
* long } value using the grammar supported by { @ link Long # decode decode }
* and a { @ code Long } object representing this value is returned .
* < p > The second argument is the default value . A { @ code Long } object
* that represents the value of the second argument is returned if there
* is no property of the specified name , if the property does not have
* the correct numeric format , or if the specified name is empty or null .
* < p > In other words , this method returns a { @ code Long } object equal
* to the value of :
* < blockquote >
* { @ code getLong ( nm , new Long ( val ) ) }
* < / blockquote >
* but in practice it may be implemented in a manner such as :
* < blockquote > < pre >
* Long result = getLong ( nm , null ) ;
* return ( result = = null ) ? new Long ( val ) : result ;
* < / pre > < / blockquote >
* to avoid the unnecessary allocation of a { @ code Long } object when
* the default value is not needed .
* @ param nm property name .
* @ param val default value .
* @ return the { @ code Long } value of the property .
* @ throws SecurityException for the same reasons as
* { @ link System # getProperty ( String ) System . getProperty }
* @ see java . lang . System # getProperty ( java . lang . String )
* @ see java . lang . System # getProperty ( java . lang . String , java . lang . String ) */
public static Long getLong ( String nm , long val ) { } } | Long result = Long . getLong ( nm , null ) ; return ( result == null ) ? Long . valueOf ( val ) : result ; |
public class MetaClassRegistryImpl { /** * Gets an array of of all registered ConstantMetaClassListener instances . */
public MetaClassRegistryChangeEventListener [ ] getMetaClassRegistryChangeEventListeners ( ) { } } | synchronized ( changeListenerList ) { ArrayList < MetaClassRegistryChangeEventListener > ret = new ArrayList < MetaClassRegistryChangeEventListener > ( changeListenerList . size ( ) + nonRemoveableChangeListenerList . size ( ) ) ; ret . addAll ( nonRemoveableChangeListenerList ) ; ret . addAll ( changeListenerList ) ; return ret . toArray ( new MetaClassRegistryChangeEventListener [ ret . size ( ) ] ) ; } |
public class GenericsUtils { /** * LinkedHashMap indicates stored order , important for context */
@ SuppressWarnings ( "PMD.LooseCoupling" ) public static LinkedHashMap < String , Type > createGenericsMap ( final Class < ? > type , final List < ? extends Type > generics ) { } } | final TypeVariable < ? extends Class < ? > > [ ] params = type . getTypeParameters ( ) ; if ( params . length != generics . size ( ) ) { throw new IllegalArgumentException ( String . format ( "Can't build generics map for %s with %s because of incorrect generics count" , type . getSimpleName ( ) , Arrays . toString ( generics . toArray ( ) ) ) ) ; } final LinkedHashMap < String , Type > res = new LinkedHashMap < String , Type > ( ) ; int i = 0 ; for ( TypeVariable var : params ) { res . put ( var . getName ( ) , generics . get ( i ++ ) ) ; } // add possible outer class generics to avoid unknown generics
return GenericsResolutionUtils . fillOuterGenerics ( type , res , null ) ; |
public class CommercePriceListAccountRelPersistenceImpl { /** * Returns the last commerce price list account rel in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce price list account rel
* @ throws NoSuchPriceListAccountRelException if a matching commerce price list account rel could not be found */
@ Override public CommercePriceListAccountRel findByUuid_C_Last ( String uuid , long companyId , OrderByComparator < CommercePriceListAccountRel > orderByComparator ) throws NoSuchPriceListAccountRelException { } } | CommercePriceListAccountRel commercePriceListAccountRel = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( commercePriceListAccountRel != null ) { return commercePriceListAccountRel ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", companyId=" ) ; msg . append ( companyId ) ; msg . append ( "}" ) ; throw new NoSuchPriceListAccountRelException ( msg . toString ( ) ) ; |
public class DisableGatewayRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DisableGatewayRequest disableGatewayRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( disableGatewayRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disableGatewayRequest . getGatewayARN ( ) , GATEWAYARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Ginv { /** * Swap the matrices so that the largest value is on the pivot
* @ param source
* the matrix to modify
* @ param diag
* the position on the diagonal
* @ param s
* the matrix s
* @ param t
* the matrix t */
public static void swapPivot ( double [ ] [ ] source , int diag , double [ ] [ ] s , double [ ] [ ] t ) { } } | // get swap row and col
int swapRow = diag ; int swapCol = diag ; double maxValue = Math . abs ( source [ diag ] [ diag ] ) ; int rows = source . length ; int cols = source [ 0 ] . length ; double abs = 0 ; double [ ] r = null ; for ( int row = diag ; row < rows ; row ++ ) { r = source [ row ] ; for ( int col = diag ; col < cols ; col ++ ) { abs = Math . abs ( r [ col ] ) ; if ( abs > maxValue ) { maxValue = abs ; swapRow = row ; swapCol = col ; } } } // swap rows and columns
if ( swapRow != diag ) { swapRows ( source , swapRow , diag ) ; swapRows ( t , swapRow , diag ) ; } if ( swapCol != diag ) { swapCols ( source , swapCol , diag ) ; swapCols ( s , swapCol , diag ) ; } |
public class SimpleGroovyDoc { /** * Methods from Comparable */
public int compareTo ( Object that ) { } } | if ( that instanceof GroovyDoc ) { return name . compareTo ( ( ( GroovyDoc ) that ) . name ( ) ) ; } else { throw new ClassCastException ( String . format ( "Cannot compare object of type %s." , that . getClass ( ) ) ) ; } |
public class SquaresIntoCrossClusters { /** * Goes through each node and uses a nearest - neighbor search to find the closest nodes in its local neighborhood .
* It then checks those to see if it should connect */
void connectNodes ( ) { } } | setupSearch ( ) ; int indexCornerList = 0 ; for ( int indexNode = 0 ; indexNode < nodes . size ( ) ; indexNode ++ ) { // search all the corners of this node for their neighbors
SquareNode n = nodes . get ( indexNode ) ; for ( int indexLocal = 0 ; indexLocal < n . square . size ( ) ; indexLocal ++ ) { if ( n . touch . size > 0 && n . touch . get ( indexLocal ) ) continue ; // find it ' s neighbors
searchResults . reset ( ) ; search . findNearest ( searchPoints . get ( indexCornerList ++ ) , maxCornerDistance * maxCornerDistance , maxNeighbors + 1 , searchResults ) ; for ( int indexResults = 0 ; indexResults < searchResults . size ( ) ; indexResults ++ ) { NnData < Point2D_F64 > neighborData = searchResults . get ( indexResults ) ; SquareNode neighborNode = searchSquareList . get ( neighborData . index ) ; Point2D_F64 closestCorner = neighborData . point ; // if the neighbor corner is from the same node skip it
if ( neighborNode == n ) continue ; int neighborCornerIndex = getCornerIndex ( neighborNode , closestCorner . x , closestCorner . y ) ; if ( candidateIsMuchCloser ( n , neighborNode , neighborData . distance ) ) graph . checkConnect ( n , indexLocal , neighborNode , neighborCornerIndex , neighborData . distance ) ; } } } |
public class ChannelSelector { /** * Process the actual key cancel requests now . This does not
* remove the item from the list as it needs a second pass
* through select ( ) before notifyCancelRequests handles that step .
* @ return boolean , true if any key was cancelled */
private boolean processCancelRequests ( ) { } } | // Try to make this as fast as possible . Don ' t need to sync
// since if a cancel gets added after checking the size , we will
// see it next time .
if ( cancelList . size ( ) == 0 ) { return false ; } boolean needSelectToOccur = false ; final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; synchronized ( cancelList ) { for ( CancelRequest req : this . cancelList ) { if ( req . state == CancelRequest . Ready_To_Cancel ) { if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "cancelling key " + req . key ) ; } req . key . cancel ( ) ; req . state = CancelRequest . Ready_To_Signal_Done ; needSelectToOccur = true ; } } } // end - sync
return needSelectToOccur ; |
public class NotifdEventConsumer { public void push_structured_event ( org . omg . CosNotification . StructuredEvent notification ) { } } | String domainName = notification . header . fixed_header . event_type . domain_name ; String eventType = notification . header . fixed_header . event_name ; try { // Check if Heartbeat event
if ( eventType . equals ( "heartbeat" ) ) { push_structured_event_heartbeat ( domainName ) ; return ; } // Else check if event is registered and get its CB struct
String eventName = domainName + "." + eventType ; EventCallBackStruct callBackStruct = getEventCallBackStruct ( eventName ) ; if ( callBackStruct != null ) { CallBack callback = callBackStruct . callback ; DeviceAttribute attr_value = null ; AttributeInfoEx attr_config = null ; AttDataReady data_ready = null ; DevError [ ] dev_err_list = null ; // Extract CORBA object to check What kind ( Value or config )
java . lang . Object obj = extractAttributeObject ( notification ) ; if ( obj instanceof AttributeInfoEx ) attr_config = ( AttributeInfoEx ) obj ; else if ( obj instanceof AttDataReady ) data_ready = ( AttDataReady ) obj ; else if ( obj instanceof DeviceAttribute ) attr_value = ( DeviceAttribute ) obj ; else if ( obj instanceof DevError [ ] ) dev_err_list = ( DevError [ ] ) obj ; // And build event data
EventData event_data = new EventData ( callBackStruct . device , domainName , eventType , callBackStruct . event_type , EventData . NOTIFD_EVENT , attr_value , null , attr_config , data_ready , null , dev_err_list ) ; if ( callBackStruct . use_ev_queue ) { EventQueue ev_queue = callBackStruct . device . getEventQueue ( ) ; ev_queue . insert_event ( event_data ) ; } else if ( callback != null ) callback . push_event ( event_data ) ; } else System . err . println ( eventName + " event not found" ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } |
public class InMemoryQueueService { /** * Drop either all streams or all queues .
* @ param clearStreams if true , drops all streams , if false , clears all queues .
* @ param prefix if non - null , drops only queues with a name that begins with this prefix . */
private void resetAllQueuesOrStreams ( boolean clearStreams , @ Nullable String prefix ) { } } | List < String > toRemove = Lists . newArrayListWithCapacity ( queues . size ( ) ) ; for ( String queueName : queues . keySet ( ) ) { if ( ( clearStreams && QueueName . isStream ( queueName ) ) || ( ! clearStreams && QueueName . isQueue ( queueName ) ) ) { if ( prefix == null || queueName . startsWith ( prefix ) ) { toRemove . add ( queueName ) ; } } } for ( String queueName : toRemove ) { queues . remove ( queueName ) ; } |
public class InitializationNormalizer { /** * Returns true if this is a constructor that doesn ' t call " this ( . . . ) " . This constructors are
* skipped so initializers aren ' t run more than once per instance creation . */
public static boolean isDesignatedConstructor ( MethodDeclaration node ) { } } | if ( ! node . isConstructor ( ) ) { return false ; } Block body = node . getBody ( ) ; if ( body == null ) { return false ; } List < Statement > stmts = body . getStatements ( ) ; return ( stmts . isEmpty ( ) || ! ( stmts . get ( 0 ) instanceof ConstructorInvocation ) ) ; |
public class StringUtils { /** * Joins the elements of the provided array into a single String containing
* the provided list of elements .
* No delimiter is added before or after the list . A null separator is the
* same as an empty String ( " " ) . Null objects or empty strings within the
* array are represented by empty strings .
* < pre >
* StringUtils . join ( null , * ) = null
* StringUtils . join ( [ ] , * ) = " "
* StringUtils . join ( [ null ] , * ) = " "
* StringUtils . join ( [ " a " , " b " , " c " ] , " - - " ) = " a - - b - - c "
* StringUtils . join ( [ " a " , " b " , " c " ] , null ) = " abc "
* StringUtils . join ( [ " a " , " b " , " c " ] , " " ) = " abc "
* StringUtils . join ( [ null , " " , " a " ] , ' , ' ) = " , , a "
* < / pre >
* @ param array
* the array of values to join together , may be null
* @ param separator
* the separator character to use , null treated as " "
* @ return the joined String , null if null array input */
public static String join ( Object [ ] array , String separator ) { } } | return org . apache . commons . lang3 . StringUtils . join ( array , separator ) ; |
public class EJBJavaColonNamingHelper { /** * { @ inheritDoc } */
@ Override public void moduleMetaDataCreated ( MetaDataEvent < ModuleMetaData > event ) throws MetaDataException { } } | if ( ! MetaDataUtils . copyModuleMetaDataSlot ( event , mmdSlot ) ) { getModuleBindingMap ( event . getMetaData ( ) ) ; } |
public class CancelStepsInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CancelStepsInfo cancelStepsInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( cancelStepsInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cancelStepsInfo . getStepId ( ) , STEPID_BINDING ) ; protocolMarshaller . marshall ( cancelStepsInfo . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( cancelStepsInfo . getReason ( ) , REASON_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class PermOverrideManager { /** * Denies the provided { @ link net . dv8tion . jda . core . Permission Permissions }
* from the selected { @ link net . dv8tion . jda . core . entities . PermissionOverride PermissionOverride } .
* @ param permissions
* The permissions to deny from the selected { @ link net . dv8tion . jda . core . entities . PermissionOverride PermissionOverride }
* @ throws IllegalArgumentException
* If any of the provided Permissions is { @ code null }
* @ return PermOverrideManager for chaining convenience
* @ see net . dv8tion . jda . core . Permission # getRaw ( net . dv8tion . jda . core . Permission . . . ) Permission . getRaw ( Permission . . . ) */
@ CheckReturnValue public PermOverrideManager deny ( Permission ... permissions ) { } } | Checks . notNull ( permissions , "Permissions" ) ; return deny ( Permission . getRaw ( permissions ) ) ; |
public class LdapTemplate { /** * { @ inheritDoc } */
@ Override public void rename ( final Name oldDn , final Name newDn ) { } } | executeReadWrite ( new ContextExecutor ( ) { public Object executeWithContext ( DirContext ctx ) throws javax . naming . NamingException { ctx . rename ( oldDn , newDn ) ; return null ; } } ) ; |
public class MediaType { /** * Parse the given String into a single { @ code MediaType } .
* @ param mediaType the string to parse
* @ return the media type
* @ throws InvalidMediaTypeException if the string cannot be parsed */
public static MediaType parseMediaType ( String mediaType ) { } } | MimeType type ; try { type = MimeTypeUtils . parseMimeType ( mediaType ) ; } catch ( InvalidMimeTypeException ex ) { throw new InvalidMediaTypeException ( ex ) ; } try { return new MediaType ( type . getType ( ) , type . getSubtype ( ) , type . getParameters ( ) ) ; } catch ( IllegalArgumentException ex ) { throw new InvalidMediaTypeException ( mediaType , ex . getMessage ( ) ) ; } |
public class ReflectedFormatter { /** * Loads all methods with a { @ link Format } annotation , creates an individual { @ link Formatter } instance and stores
* them to the { @ link # formats } map . */
private Map < Class < ? > , Formatter > findFormatMethods ( ) { } } | final Map < Class < ? > , Formatter > formats = new HashMap < Class < ? > , Formatter > ( ) ; for ( Method method : this . getClass ( ) . getMethods ( ) ) { Format formatAnnotation = method . getAnnotation ( Format . class ) ; if ( formatAnnotation != null ) { Class < ? > [ ] parameterTypes = method . getParameterTypes ( ) ; if ( parameterTypes . length == 0 ) { throw new InvalidFormatMethodException ( getClass ( ) , method , "Format methods must take at least 1 parameter!" ) ; } formats . put ( parameterTypes [ 0 ] , createFormatter ( method , parameterTypes , formatAnnotation . value ( ) ) ) ; } } return formats ; |
public class CamelJdbcStoreBolt { /** * endpointUriを指定して 、 DBにinsertを行う 。
* @ param endpointUri CamelのendpointUri
* @ param values PreparedStatementに設定する値 */
protected void insert ( String endpointUri , Collection < Object > values ) { } } | this . producerTemplate . sendBody ( endpointUri , values ) ; |
public class GroupBy { /** * Create a new aggregating set expression using a backing TreeSet
* @ param groupExpression values for this expression will be accumulated into a set
* @ return wrapper expression */
public static < E , F extends Comparable < ? super F > > GroupExpression < E , SortedSet < F > > sortedSet ( GroupExpression < E , F > groupExpression ) { } } | return new MixinGroupExpression < E , F , SortedSet < F > > ( groupExpression , GSet . createSorted ( groupExpression ) ) ; |
public class AbstractSequenceClassifier { /** * Classify a List of IN . This method returns a new list of tokens , not
* the list of tokens passed in , and runs the new tokens through
* ObjectBankWrapper . ( Both these behaviors are different from that of the
* classify ( List ) method .
* @ param sentence The List of IN to be classified .
* @ return The classified List of IN , where the classifier output for
* each token is stored in its { @ link AnswerAnnotation } field . */
public List < IN > classifySentence ( List < ? extends HasWord > sentence ) { } } | List < IN > document = new ArrayList < IN > ( ) ; int i = 0 ; for ( HasWord word : sentence ) { IN wi ; // initialized below
if ( word instanceof CoreMap ) { // copy all annotations ! some are required later in
// AbstractSequenceClassifier . classifyWithInlineXML
// wi = ( IN ) new ArrayCoreMap ( ( ArrayCoreMap ) word ) ;
wi = tokenFactory . makeToken ( ( IN ) word ) ; } else { wi = tokenFactory . makeToken ( ) ; wi . set ( CoreAnnotations . TextAnnotation . class , word . word ( ) ) ; // wi . setWord ( word . word ( ) ) ;
} wi . set ( PositionAnnotation . class , Integer . toString ( i ) ) ; wi . set ( AnswerAnnotation . class , backgroundSymbol ( ) ) ; document . add ( wi ) ; i ++ ; } // TODO get rid of objectbankwrapper
ObjectBankWrapper < IN > wrapper = new ObjectBankWrapper < IN > ( flags , null , knownLCWords ) ; wrapper . processDocument ( document ) ; classify ( document ) ; return document ; |
public class DateTimeUtil { /** * Null - safe method of converting a SQL Timestamp into a DateTime that
* it set specifically to be in UTC .
* < br >
* NOTE : The timestamp also should be in UTC .
* @ return A UTC DateTime */
public static DateTime toDateTime ( Timestamp value ) { } } | if ( value == null ) { return null ; } else { return new DateTime ( value . getTime ( ) , DateTimeZone . UTC ) ; } |
public class ComponentFactory { /** * Create a scrollable panel .
* @ param horizontalGap
* the horizontal gap .
* @ param verticalGap
* the vertical gap .
* @ return a scrollable panel .
* @ since 15.02.00 */
public static FluidFlowPanelModel createFluidFlowPanel ( int horizontalGap , int verticalGap ) { } } | FlowLayout _flowLayout = new FlowLayout ( FlowLayout . LEFT , horizontalGap , verticalGap ) ; return FluidFlowPanelModel . createFluidFlowPanel ( _flowLayout ) ; |
public class ErrorPagePool { /** * remove this error page
* @ param type */
public void removeErrorPage ( PageException pe ) { } } | // exception
ErrorPage ep = getErrorPage ( pe , ErrorPage . TYPE_EXCEPTION ) ; if ( ep != null ) { pages . remove ( ep ) ; hasChanged = true ; } // request
ep = getErrorPage ( pe , ErrorPage . TYPE_REQUEST ) ; if ( ep != null ) { pages . remove ( ep ) ; hasChanged = true ; } // validation
ep = getErrorPage ( pe , ErrorPage . TYPE_VALIDATION ) ; if ( ep != null ) { pages . remove ( ep ) ; hasChanged = true ; } |
public class JsoupCssInliner { /** * Replace link tags with style tags in order to keep the same inclusion
* order
* @ param doc
* the html document
* @ param cssContents
* the list of external css files with their content */
private void internStyles ( Document doc , List < ExternalCss > cssContents ) { } } | Elements els = doc . select ( CSS_LINKS_SELECTOR ) ; for ( Element e : els ) { if ( ! TRUE_VALUE . equals ( e . attr ( SKIP_INLINE ) ) ) { String path = e . attr ( HREF_ATTR ) ; Element style = new Element ( Tag . valueOf ( STYLE_TAG ) , "" ) ; style . appendChild ( new DataNode ( getCss ( cssContents , path ) , "" ) ) ; e . replaceWith ( style ) ; } } |
public class SasUtils { /** * De - serialize secret share from binary message data . Serialization mechanism is detailed in { @ link # encodeToBinary ( rs . in . zivanovic . sss . SecretShare )
* @ param data binary data to de - serialize
* @ return secret share data */
public static SecretShare decodeFromBinary ( byte [ ] data ) { } } | ByteBuffer bb = ByteBuffer . wrap ( data ) ; try { byte [ ] signature = new byte [ SIGNATURE . length ] ; bb . get ( signature ) ; if ( ! Arrays . equals ( SIGNATURE , signature ) ) { throw new IllegalArgumentException ( "signature missing" ) ; } byte n = bb . get ( ) ; int shareDataLen = bb . getInt ( ) ; byte [ ] shareData = new byte [ shareDataLen ] ; bb . get ( shareData ) ; int primeDataLen = bb . getInt ( ) ; byte [ ] primeData = new byte [ primeDataLen ] ; bb . get ( primeData ) ; BigInteger share = new BigInteger ( shareData ) ; BigInteger prime = new BigInteger ( primeData ) ; if ( share . compareTo ( BigInteger . ZERO ) <= 0 ) { throw new IllegalArgumentException ( "invalid share number" ) ; } if ( prime . compareTo ( BigInteger . ZERO ) <= 0 ) { throw new IllegalArgumentException ( "invalid prime" ) ; } return new SecretShare ( n , share , prime ) ; } catch ( BufferUnderflowException ex ) { throw new IllegalArgumentException ( ex ) ; } |
public class Timex3 { /** * getter for timexValue - gets
* @ generated
* @ return value of the feature */
public String getTimexValue ( ) { } } | if ( Timex3_Type . featOkTst && ( ( Timex3_Type ) jcasType ) . casFeat_timexValue == null ) jcasType . jcas . throwFeatMissing ( "timexValue" , "de.unihd.dbs.uima.types.heideltime.Timex3" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Timex3_Type ) jcasType ) . casFeatCode_timexValue ) ; |
public class XPathParser { /** * Parses the the rule MultiplicativeExpr according to the following
* production rule :
* [ 13 ] MultiplicativeExpr : : = UnionExpr ( ( " * " | " div " | " idiv " | " mod " ) UnionExpr ) * .
* @ throws TTXPathException */
private void parseMultiplicativeExpr ( ) throws TTXPathException { } } | parseUnionExpr ( ) ; String op = mToken . getContent ( ) ; while ( isMultiplication ( ) ) { // for ( Operators op : Operators . values ( ) ) {
// / / identify current operator
// if ( is ( op . getOpName ( ) , true ) ) {
mPipeBuilder . addExpressionSingle ( ) ; // parse second operand axis
parseUnionExpr ( ) ; mPipeBuilder . addOperatorExpression ( getTransaction ( ) , op ) ; op = mToken . getContent ( ) ; } |
public class BcCMSUtils { /** * Build a Bouncy Castle { @ link CMSSignedData } from bytes .
* @ param signature the signature .
* @ param data the data signed .
* @ return a CMS signed data .
* @ throws GeneralSecurityException if the signature could not be decoded . */
public static CMSSignedData getSignedData ( byte [ ] signature , byte [ ] data ) throws GeneralSecurityException { } } | CMSSignedData signedData ; try { if ( data != null ) { signedData = new CMSSignedData ( new CMSProcessableByteArray ( data ) , signature ) ; } else { signedData = new CMSSignedData ( signature ) ; } } catch ( CMSException e ) { throw new GeneralSecurityException ( "Unable to decode signature" , e ) ; } return signedData ; |
public class BuddyOnlineStateUpdateEventHandler { /** * / * ( non - Javadoc )
* @ see com . tvd12 . ezyfox . sfs2x . serverhandler . UserZoneEventHandler # handleServerEvent ( com . smartfoxserver . v2 . core . ISFSEvent ) */
@ Override public void handleServerEvent ( ISFSEvent event ) throws SFSException { } } | User user = ( User ) event . getParameter ( SFSEventParam . USER ) ; boolean online = ( Boolean ) event . getParameter ( SFSBuddyEventParam . BUDDY_IS_ONLINE ) ; updateBuddyProperties ( ( ApiBaseUser ) user . getProperty ( APIKey . USER ) , online ) ; super . handleServerEvent ( event ) ; |
public class EditShape { /** * stores - 1 for that geometry . */
int createGeometryUserIndex ( ) { } } | if ( m_geometry_indices == null ) m_geometry_indices = new ArrayList < AttributeStreamOfInt32 > ( 4 ) ; // Try getting existing index . Use linear search . We do not expect many
// indices to be created .
for ( int i = 0 ; i < m_geometry_indices . size ( ) ; i ++ ) { if ( m_geometry_indices . get ( i ) == null ) { m_geometry_indices . set ( i , ( AttributeStreamOfInt32 ) AttributeStreamBase . createIndexStream ( 0 ) ) ; return i ; } } m_geometry_indices . add ( ( AttributeStreamOfInt32 ) AttributeStreamBase . createIndexStream ( 0 ) ) ; return m_geometry_indices . size ( ) - 1 ; |
public class RelationalOperations { /** * Returns true if polygon _ a is disjoint from polygon _ b . */
private static boolean polygonDisjointPolygon_ ( Polygon polygon_a , Polygon polygon_b , double tolerance , ProgressTracker progress_tracker ) { } } | // Quick rasterize test to see whether the the geometries are disjoint ,
// or if one is contained in the other .
int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polygon_b , tolerance , true ) ; if ( relation == Relation . disjoint ) return true ; if ( relation == Relation . contains || relation == Relation . within || relation == Relation . intersects ) return false ; return polygonDisjointMultiPath_ ( polygon_a , polygon_b , tolerance , progress_tracker ) ; |
public class Stapler { /** * Serves the specified { @ link URL } as a static resource . */
boolean serveStaticResource ( HttpServletRequest req , StaplerResponse rsp , URL url , long expiration ) throws IOException { } } | return serveStaticResource ( req , rsp , openURL ( url ) , expiration ) ; |
public class A_CmsListTab { /** * Creates the quick search / finder box . < p > */
private void createQuickBox ( ) { } } | if ( hasQuickSearch ( ) || hasQuickFilter ( ) ) { m_quickSearch = new CmsTextBox ( ) ; // m _ quickFilter . setVisible ( hasQuickFilter ( ) ) ;
m_quickSearch . addStyleName ( DIALOG_CSS . quickFilterBox ( ) ) ; m_quickSearch . setTriggerChangeOnKeyPress ( true ) ; String message = hasQuickFilter ( ) ? Messages . get ( ) . key ( Messages . GUI_QUICK_FINDER_FILTER_0 ) : Messages . get ( ) . key ( Messages . GUI_QUICK_FINDER_SEARCH_0 ) ; m_quickSearch . setGhostValue ( message , true ) ; m_quickSearch . setGhostModeClear ( true ) ; m_options . insert ( m_quickSearch , 0 ) ; m_searchButton = new CmsPushButton ( ) ; m_searchButton . setImageClass ( hasQuickFilter ( ) ? I_CmsButton . FILTER : I_CmsButton . SEARCH_SMALL ) ; m_searchButton . setButtonStyle ( ButtonStyle . FONT_ICON , null ) ; m_searchButton . getElement ( ) . getStyle ( ) . setFloat ( Style . Float . RIGHT ) ; m_searchButton . getElement ( ) . getStyle ( ) . setMarginTop ( 4 , Unit . PX ) ; m_options . insert ( m_searchButton , 0 ) ; m_quickSearch . addValueChangeHandler ( this ) ; if ( hasQuickFilter ( ) ) { m_filterTimer = new Timer ( ) { @ Override public void run ( ) { getTabHandler ( ) . onSort ( m_sortSelectBox . getFormValueAsString ( ) , m_quickSearch . getFormValueAsString ( ) ) ; onContentChange ( ) ; } } ; m_searchButton . setTitle ( message ) ; } else { m_quickSearch . addKeyPressHandler ( new KeyPressHandler ( ) { public void onKeyPress ( KeyPressEvent event ) { if ( event . getNativeEvent ( ) . getKeyCode ( ) == KeyCodes . KEY_ENTER ) { quickSearch ( ) ; } } } ) ; m_searchButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent arg0 ) { quickSearch ( ) ; } } ) ; m_quickSearchRegistration = getTabHandler ( ) . addSearchChangeHandler ( new ValueChangeHandler < CmsGallerySearchBean > ( ) { public void onValueChange ( ValueChangeEvent < CmsGallerySearchBean > event ) { m_quickSearch . setFormValueAsString ( event . getValue ( ) . getQuery ( ) ) ; } } ) ; m_searchButton . setTitle ( Messages . get ( ) . key ( Messages . GUI_TAB_SEARCH_SEARCH_EXISTING_0 ) ) ; } } |
public class QRDecompositionHouseholderColumn_DDRM { /** * Returns an upper triangular matrix which is the R in the QR decomposition . If compact then the input
* expected to be size = [ min ( rows , cols ) , numCols ] otherwise size = [ numRows , numCols ] .
* @ param R Storage for upper triangular matrix .
* @ param compact If true then a compact matrix is expected . */
@ Override public DMatrixRMaj getR ( DMatrixRMaj R , boolean compact ) { } } | if ( compact ) { R = UtilDecompositons_DDRM . checkZerosLT ( R , minLength , numCols ) ; } else { R = UtilDecompositons_DDRM . checkZerosLT ( R , numRows , numCols ) ; } for ( int j = 0 ; j < numCols ; j ++ ) { double colR [ ] = dataQR [ j ] ; int l = Math . min ( j , numRows - 1 ) ; for ( int i = 0 ; i <= l ; i ++ ) { double val = colR [ i ] ; R . set ( i , j , val ) ; } } return R ; |
public class SequenceFile { /** * Construct the preferred type of ' raw ' SequenceFile Writer .
* @ param out The stream on top which the writer is to be constructed .
* @ param keyClass The ' key ' type .
* @ param valClass The ' value ' type .
* @ param compress Compress data ?
* @ param blockCompress Compress blocks ?
* @ param metadata The metadata of the file .
* @ return Returns the handle to the constructed SequenceFile Writer .
* @ throws IOException */
private static Writer createWriter ( Configuration conf , FSDataOutputStream out , Class keyClass , Class valClass , boolean compress , boolean blockCompress , CompressionCodec codec , Metadata metadata ) throws IOException { } } | if ( codec != null && ( codec instanceof GzipCodec ) && ! NativeCodeLoader . isNativeCodeLoaded ( ) && ! ZlibFactory . isNativeZlibLoaded ( conf ) ) { throw new IllegalArgumentException ( "SequenceFile doesn't work with " + "GzipCodec without native-hadoop code!" ) ; } Writer writer = null ; if ( ! compress ) { writer = new Writer ( conf , out , keyClass , valClass , metadata ) ; } else if ( compress && ! blockCompress ) { writer = new RecordCompressWriter ( conf , out , keyClass , valClass , codec , metadata ) ; } else { writer = new BlockCompressWriter ( conf , out , keyClass , valClass , codec , metadata ) ; } return writer ; |
public class IntIterator { /** * Lazy evaluation .
* @ param iteratorSupplier
* @ return */
public static IntIterator of ( final Supplier < ? extends IntIterator > iteratorSupplier ) { } } | N . checkArgNotNull ( iteratorSupplier , "iteratorSupplier" ) ; return new IntIterator ( ) { private IntIterator iter = null ; private boolean isInitialized = false ; @ Override public boolean hasNext ( ) { if ( isInitialized == false ) { init ( ) ; } return iter . hasNext ( ) ; } @ Override public int nextInt ( ) { if ( isInitialized == false ) { init ( ) ; } return iter . nextInt ( ) ; } private void init ( ) { if ( isInitialized == false ) { isInitialized = true ; iter = iteratorSupplier . get ( ) ; } } } ; |
public class DOM3TreeWalker { /** * If the configuration parameter " namespaces " is set to true , this methods
* checks if an entity whose replacement text contains unbound namespace
* prefixes is referenced in a location where there are no bindings for
* the namespace prefixes and if so raises a LSException with the error - type
* " unbound - prefix - in - entity - reference "
* @ param Node , The EntityReference nodes whose children are to be checked */
protected void checkUnboundPrefixInEntRef ( Node node ) { } } | Node child , next ; for ( child = node . getFirstChild ( ) ; child != null ; child = next ) { next = child . getNextSibling ( ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { // If a NamespaceURI is not declared for the current
// node ' s prefix , raise a fatal error .
String prefix = child . getPrefix ( ) ; if ( prefix != null && fNSBinder . getURI ( prefix ) == null ) { String msg = Utils . messages . createMessage ( MsgKey . ER_ELEM_UNBOUND_PREFIX_IN_ENTREF , new Object [ ] { node . getNodeName ( ) , child . getNodeName ( ) , prefix } ) ; if ( fErrorHandler != null ) { fErrorHandler . handleError ( new DOMErrorImpl ( DOMError . SEVERITY_FATAL_ERROR , msg , MsgKey . ER_ELEM_UNBOUND_PREFIX_IN_ENTREF , null , null , null ) ) ; } } NamedNodeMap attrs = child . getAttributes ( ) ; for ( int i = 0 ; i < attrs . getLength ( ) ; i ++ ) { String attrPrefix = attrs . item ( i ) . getPrefix ( ) ; if ( attrPrefix != null && fNSBinder . getURI ( attrPrefix ) == null ) { String msg = Utils . messages . createMessage ( MsgKey . ER_ATTR_UNBOUND_PREFIX_IN_ENTREF , new Object [ ] { node . getNodeName ( ) , child . getNodeName ( ) , attrs . item ( i ) } ) ; if ( fErrorHandler != null ) { fErrorHandler . handleError ( new DOMErrorImpl ( DOMError . SEVERITY_FATAL_ERROR , msg , MsgKey . ER_ATTR_UNBOUND_PREFIX_IN_ENTREF , null , null , null ) ) ; } } } } if ( child . hasChildNodes ( ) ) { checkUnboundPrefixInEntRef ( child ) ; } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.