signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Futures { /** * Returns a new { @ code ListenableFuture } whose result is the product of * applying the given { @ code Function } to the result of the given { @ code * Future } . Example : * < pre > { @ code * ListenableFuture < QueryResult > queryFuture = . . . ; * Function < QueryResult , List ...
checkNotNull ( function ) ; return transform ( input , asAsyncFunction ( function ) , executor ) ;
public class BusinessProcess { /** * @ see # startTask ( String ) * this method allows to start a conversation if no conversation is active */ public Task startTask ( String taskId , boolean beginConversation ) { } }
if ( beginConversation ) { Conversation conversation = conversationInstance . get ( ) ; if ( conversation . isTransient ( ) ) { conversation . begin ( ) ; } } return startTask ( taskId ) ;
public class QueryResult { /** * The primary key of the item where the operation stopped , inclusive of the previous result set . Use this value to * start a new operation , excluding this value in the new request . * If < code > LastEvaluatedKey < / code > is empty , then the " last page " of results has been proc...
setLastEvaluatedKey ( lastEvaluatedKey ) ; return this ;
public class MigrateArgs { /** * Set { @ literal AUTH } { @ code password } option . * @ param password must not be { @ literal null } . * @ return { @ code this } { @ link MigrateArgs } . * @ since 4.4.5 */ public MigrateArgs < K > auth ( char [ ] password ) { } }
LettuceAssert . notNull ( password , "Password must not be null" ) ; this . password = Arrays . copyOf ( password , password . length ) ; return this ;
public class RegisteredResources { /** * Possibly update the heuristic state of the transaction . * This is only required if this is a subordinate . * If we are a subordinate we need to update the state and log it for recovery . * @ param commit - true if requested to commit , else false */ private void updateHeu...
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "updateHeuristicState" , commit ) ; if ( _transaction . isSubordinate ( ) ) { // Get the current transaction state . Need to do this in case we are // in recovery and have already logged a heuristic final TransactionState ts = _transaction . getTransactionState ( ) ; fin...
public class JDBCSQLXML { /** * Retrieves the XML value designated by this SQLXML instance as a stream . * The bytes of the input stream are interpreted according to appendix F of the XML 1.0 specification . * The behavior of this method is the same as ResultSet . getBinaryStream ( ) * when the designated column ...
checkClosed ( ) ; checkReadable ( ) ; InputStream inputStream = getBinaryStreamImpl ( ) ; setReadable ( false ) ; setWritable ( false ) ; return inputStream ;
public class NodeWrapper { /** * { @ inheritDoc } */ @ Override public boolean isSameNodeInfo ( final NodeInfo other ) { } }
boolean retVal ; if ( ! ( other instanceof NodeInfo ) ) { retVal = false ; } else { retVal = ( ( NodeWrapper ) other ) . mKey == mKey ; } return retVal ;
public class Clock { /** * Defines if alarms are enabled . * If false then no alarms will be triggered . * @ param CHECK */ public void setAlarmsEnabled ( final boolean CHECK ) { } }
if ( null == alarmsEnabled ) { _alarmsEnabled = CHECK ; fireUpdateEvent ( VISIBILITY_EVENT ) ; } else { alarmsEnabled . set ( CHECK ) ; }
public class PropertiesBase { /** * Gets all properties with a key starting with prefix . * @ param prefix * @ param removePrefix * remove prefix in the resulting properties or not * @ return properties starting with prefix */ Properties getProperties ( String prefix , boolean removePrefix ) { } }
Properties result = new Properties ( ) ; for ( String key : getPropertyNames ( ) ) { if ( key . startsWith ( prefix ) ) { result . put ( ( removePrefix ) ? key . substring ( prefix . length ( ) ) : key , getProperty ( key ) ) ; } } return result ;
public class Snappy { /** * Compress the content in the given input buffer . After the compression , * you can retrieve the compressed data from the output buffer [ pos ( ) . . . * limit ( ) ) ( compressed data size = limit ( ) - pos ( ) = remaining ( ) ) * @ param uncompressed buffer [ pos ( ) . . . limit ( ) ) ...
if ( ! uncompressed . isDirect ( ) ) { throw new SnappyError ( SnappyErrorCode . NOT_A_DIRECT_BUFFER , "input is not a direct buffer" ) ; } if ( ! compressed . isDirect ( ) ) { throw new SnappyError ( SnappyErrorCode . NOT_A_DIRECT_BUFFER , "destination is not a direct buffer" ) ; } // input : uncompressed [ pos ( ) , ...
public class SharedFieldCache { /** * Creates a < code > ValueIndex < / code > for a < code > field < / code > and a term * < code > prefix < / code > . The term prefix acts as the property name for the * shared < code > field < / code > . * < br > * This method is an adapted version of : < code > FieldCacheImp...
if ( reader instanceof ReadOnlyIndexReader ) { reader = ( ( ReadOnlyIndexReader ) reader ) . getBase ( ) ; } field = field . intern ( ) ; ValueIndex ret = lookup ( reader , field , prefix ) ; if ( ret == null ) { Comparable < ? > [ ] retArray = new Comparable [ reader . maxDoc ( ) ] ; int setValues = 0 ; if ( retArray ...
public class DTMDocumentImpl { /** * Given a node handle , advance to the next node on the preceding axis . * @ param axisContextHandle the start of the axis that is being traversed . * @ param nodeHandle the id of the node . * @ return int Node - number of preceding sibling , * or DTM . NULL to indicate none e...
// # # # shs copied from Xalan 1 , what is this suppose to do ? nodeHandle &= NODEHANDLE_MASK ; while ( nodeHandle > 1 ) { nodeHandle -- ; if ( ATTRIBUTE_NODE == ( nodes . readEntry ( nodeHandle , 0 ) & 0xFFFF ) ) continue ; // if nodeHandle is _ not _ an ancestor of // axisContextHandle , specialFind will return it . ...
public class Shape { /** * Get the offset of the specified [ dim0 , dim1 , dim2 ] for the 3d array * @ param shapeInformation Shape information * @ param dim0 Row index to get the offset for * @ param dim1 Column index to get the offset for * @ param dim2 dimension 2 index to get the offset for * @ return Buf...
int rank = rank ( shapeInformation ) ; if ( rank != 3 ) throw new IllegalArgumentException ( "Cannot use this getOffset method on arrays of rank != 3 (rank is: " + rank + ")" ) ; return getOffsetUnsafe ( shapeInformation , dim0 , dim1 , dim2 ) ;
public class Dom { public static boolean matches ( Node node , String requiredLocalName , Namespace requiredNamespace ) { } }
return hasNamespace ( node , requiredNamespace ) && matchingLocalName ( node , requiredLocalName ) ;
public class InsertIntoTable { /** * Adds all rows from the file specified , using the provided parser . * @ param file File to read the data from . * @ param fileParser Parser to be used to parse the file . * @ return { @ code this } */ public InsertIntoTable addRowsFrom ( File file , FileParser fileParser ) { }...
builder . addRowsFrom ( file , fileParser ) ; return this ;
public class ReferenceValueFactory { /** * Create a new instance . * @ param decoder the text decoder ; may be null if the default decoder should be used * @ param factories the set of value factories , used to obtain the { @ link ValueFactories # getStringFactory ( ) string value * factory } ; may not be null ...
if ( simple ) { return new ReferenceValueFactory ( PropertyType . SIMPLEREFERENCE , decoder , factories , weak , simple ) ; } return new ReferenceValueFactory ( weak ? PropertyType . WEAKREFERENCE : PropertyType . REFERENCE , decoder , factories , weak , simple ) ;
public class ClusteringService { /** * Sends a message of a given type across a cluster . * @ param payload the main body of the message ; must not be { @ code null } * @ return { @ code true } if the send operation was successful , { @ code false } otherwise */ public boolean sendMessage ( Serializable payload ) {...
if ( ! isOpen ( ) || ! multipleMembersInCluster ( ) ) { return false ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "{0} SENDING {1} " , toString ( ) , payload ) ; } try { byte [ ] messageData = toByteArray ( payload ) ; Message jgMessage = new Message ( null , channel . getAddress ( ) , messageData ) ; chan...
public class Lz4CompressUtils { /** * When the exact decompressed size is unknown . * Decompress data size cannot be larger then maxDecompressedSize */ public static byte [ ] decompressSafe ( final byte [ ] src , int maxDecompressedSize ) { } }
if ( src == null ) { throw new IllegalArgumentException ( "src must not be null." ) ; } if ( maxDecompressedSize <= 0 ) { throw new IllegalArgumentException ( "maxDecompressedSize must be larger than 0 but " + maxDecompressedSize ) ; } LZ4SafeDecompressor decompressor = factory . safeDecompressor ( ) ; return decompres...
public class SwimMembershipProtocol { /** * Unregisters handlers for the SWIM protocol . */ private void unregisterHandlers ( ) { } }
// Unregister TCP message handlers . bootstrapService . getMessagingService ( ) . unregisterHandler ( MEMBERSHIP_SYNC ) ; bootstrapService . getMessagingService ( ) . unregisterHandler ( MEMBERSHIP_PROBE ) ; bootstrapService . getMessagingService ( ) . unregisterHandler ( MEMBERSHIP_PROBE_REQUEST ) ; // Unregister UDP ...
public class CmsVfsSelection { /** * Opens the popup of this widget . < p > */ protected void open ( ) { } }
m_oldValue = m_selectionInput . m_textbox . getValue ( ) ; if ( m_popup == null ) { String title = org . opencms . gwt . client . Messages . get ( ) . key ( org . opencms . gwt . client . Messages . GUI_GALLERY_SELECT_DIALOG_TITLE_0 ) ; m_popup = new CmsFramePopup ( title , buildGalleryUrl ( ) ) ; m_popup . setCloseHan...
public class ResourceTable { /** * Update this record ( Always called from the record class ) . * @ exception DBException File exception . */ public void set ( Rec fieldList ) throws DBException { } }
this . restoreMainRecord ( ( Record ) fieldList , true ) ; super . set ( fieldList ) ;
public class DependencyListView { /** * Generate a table that contains the dependencies information with the column that match the configured filters * @ return Table */ public Table getTable ( ) { } }
final Table table = new Table ( getHeaders ( ) ) ; // Create row ( s ) per dependency for ( final Dependency dependency : dependencies ) { final List < String > licenseIds = dependency . getTarget ( ) . getLicenses ( ) ; // A dependency can have many rows if it has many licenses if ( licenseIds . isEmpty ( ) ) { table ...
public class AbstractTableColumnSpec { /** * Traverses links from a proposition to a list of propositions . * @ param links the { @ link Link } s to traverse . * @ param proposition the { @ link Proposition } from which to start . Cannot be * < code > null < / code > . * @ param forwardDerivations map of propos...
return this . linkTraverser . traverseLinks ( links , proposition , forwardDerivations , backwardDerivations , references , ksCache ) ;
public class AbstractIndex { /** * Closes the shared reader . * @ throws IOException if an error occurs while closing the reader . */ protected synchronized void invalidateSharedReader ( ) throws IOException { } }
// also close the read - only reader if ( readOnlyReader != null ) { readOnlyReader . release ( ) ; readOnlyReader = null ; } // invalidate shared reader if ( sharedReader != null ) { sharedReader . release ( ) ; sharedReader = null ; }
public class JobsImpl { /** * Lists the jobs that have been created under the specified job schedule . * @ param jobScheduleId The ID of the job schedule from which you want to get a list of jobs . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalAr...
return AzureServiceFuture . fromHeaderPageResponse ( listFromJobScheduleSinglePageAsync ( jobScheduleId ) , new Func1 < String , Observable < ServiceResponseWithHeaders < Page < CloudJob > , JobListFromJobScheduleHeaders > > > ( ) { @ Override public Observable < ServiceResponseWithHeaders < Page < CloudJob > , JobList...
public class FilesImpl { /** * Lists the files in a task ' s directory on its compute node . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request i...
ServiceResponseWithHeaders < Page < NodeFile > , FileListFromTaskHeaders > response = listFromTaskNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < NodeFile > ( response . body ( ) ) { @ Override public Page < NodeFile > nextPage ( String nextPageLink ) { return listFromTaskNex...
public class BatchJobUploader { /** * Incrementally uploads a batch job ' s operations and returns the response . * @ param request the request to upload * @ param isLastRequest if the request is the last request in the sequence of uploads for the job * @ param batchJobUploadStatus the current upload status of th...
Preconditions . checkNotNull ( batchJobUploadStatus , "Null batch job upload status" ) ; Preconditions . checkNotNull ( batchJobUploadStatus . getResumableUploadUri ( ) , "No resumable session URI" ) ; // This reference is final because it is referenced below within an anonymous class . final BatchJobUploadStatus effec...
public class PasswordCipherUtil { private static byte [ ] xor ( byte [ ] bytes ) { } }
byte [ ] xor_bytes = null ; if ( bytes != null ) { xor_bytes = new byte [ bytes . length ] ; for ( int i = 0 ; i < bytes . length ; i ++ ) { xor_bytes [ i ] = ( byte ) ( XOR_MASK ^ bytes [ i ] ) ; } } return xor_bytes ;
public class PublicIPPrefixesInner { /** * Creates or updates a static or dynamic public IP prefix . * @ param resourceGroupName The name of the resource group . * @ param publicIpPrefixName The name of the public IP prefix . * @ param parameters Parameters supplied to the create or update public IP prefix operat...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , publicIpPrefixName , parameters ) . map ( new Func1 < ServiceResponse < PublicIPPrefixInner > , PublicIPPrefixInner > ( ) { @ Override public PublicIPPrefixInner call ( ServiceResponse < PublicIPPrefixInner > response ) { return response . body ( ) ; }...
public class EntryIterator { /** * Attempts to get the next element in the iteration . Please refer to { @ link AsyncIterator # getNext ( ) } for details . * If this method is invoked concurrently ( a second call is initiated prior to the previous call terminating ) the * state of the { @ link EntryIterator } will ...
if ( this . finished . get ( ) ) { return CompletableFuture . completedFuture ( null ) ; } TimeoutTimer timer = new TimeoutTimer ( this . fetchTimeout ) ; return locateNextPage ( timer ) . thenApply ( pageWrapper -> { // Remember this page ( for next time ) . this . lastPage . set ( pageWrapper ) ; List < PageEntry > r...
public class PrefsTransformer { /** * Get transformer for type . * @ param property the property * @ return transform */ public static PrefsTransform lookup ( PrefsProperty property ) { } }
TypeMirror typeMirror = property . getElement ( ) . asType ( ) ; TypeName typeName = typeName ( typeMirror ) ; return lookup ( typeName ) ;
public class BigOpt2015 { /** * Evaluate ( ) method */ @ Override public void evaluate ( DoubleSolution solution ) { } }
List < List < Double > > s1 ; List < Double > s1Temp ; s1 = new ArrayList < > ( ) ; for ( int i = 0 ; i < dTypeG ; i ++ ) { s1Temp = new ArrayList < > ( ) ; for ( int j = 0 ; j < icaComponent . get ( 0 ) . size ( ) ; j ++ ) { s1Temp . add ( solution . getVariableValue ( i * ( icaComponent . get ( 0 ) . size ( ) ) + j )...
public class SolarTime { /** * used in test classes , too */ double getHighestElevationOfSun ( PlainDate date ) { } }
Moment noon = date . get ( this . transitAtNoon ( ) ) ; double jde = JulianDay . getValue ( noon , TimeScale . TT ) ; double decInRad = Math . toRadians ( this . getCalculator ( ) . getFeature ( jde , DECLINATION ) ) ; double latInRad = Math . toRadians ( this . latitude ) ; double sinElevation = // Extra term left out...
public class OperationBuilder { /** * Associate an input stream with the operation . Closing the input stream * is the responsibility of the caller . * @ param in the input stream . Cannot be { @ code null } * @ return a builder than can be used to continue building the operation */ public OperationBuilder addInp...
Assert . checkNotNullParam ( "in" , in ) ; if ( inputStreams == null ) { inputStreams = new ArrayList < InputStream > ( ) ; } inputStreams . add ( in ) ; return this ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcAxis2Placement ( ) { } }
if ( ifcAxis2PlacementEClass == null ) { ifcAxis2PlacementEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1117 ) ; } return ifcAxis2PlacementEClass ;
public class CertUtil { /** * 通过keyStore 获取私钥签名证书PrivateKey对象 * @ return */ public static PrivateKey getSignCertPrivateKey ( ) { } }
try { Enumeration < String > aliasenum = keyStore . aliases ( ) ; String keyAlias = null ; if ( aliasenum . hasMoreElements ( ) ) { keyAlias = aliasenum . nextElement ( ) ; } PrivateKey privateKey = ( PrivateKey ) keyStore . getKey ( keyAlias , SDKConfig . getConfig ( ) . getSignCertPwd ( ) . toCharArray ( ) ) ; return...
public class SSLReadServiceContext { /** * Note , a separate thread is not spawned to handle the decryption . The asynchronous * behavior of this call will take place when the device side channel makes a * nonblocking IO call and the request is potentially moved to a separate thread . * The buffers potentially se...
// Call the async read with a flag showing this was not done from a queued request . return read ( numBytes , userCallback , forceQueue , timeout , false ) ;
public class BasicAnnotationProcessor { /** * Returns the valid annotated elements contained in all of the deferred elements . If none are * found for a deferred element , defers it again . */ private ImmutableSetMultimap < Class < ? extends Annotation > , Element > validElements ( ImmutableMap < String , Optional < ...
ImmutableSetMultimap . Builder < Class < ? extends Annotation > , Element > deferredElementsByAnnotationBuilder = ImmutableSetMultimap . builder ( ) ; for ( Entry < String , Optional < ? extends Element > > deferredTypeElementEntry : deferredElements . entrySet ( ) ) { Optional < ? extends Element > deferredElement = d...
public class ByteBuffer { /** * method to append a part of a char array * @ param c char array to get part from * @ param off start index on the char array * @ param len length of the sequenz to get from array * @ throws IOException */ public void append ( char c [ ] , int off , int len ) throws IOException { }...
append ( new String ( c , off , len ) ) ;
public class SFStatement { /** * A helper method to build URL and cancel the SQL for exec * @ param sql sql statement * @ param mediaType media type * @ throws SnowflakeSQLException if failed to cancel the statement * @ throws SFException if statement is already closed */ private void cancelHelper ( String sql ...
synchronized ( this ) { if ( isClosed ) { throw new SFException ( ErrorCode . INTERNAL_ERROR , "statement already closed" ) ; } } StmtUtil . StmtInput stmtInput = new StmtUtil . StmtInput ( ) ; stmtInput . setServerUrl ( session . getServerUrl ( ) ) . setSql ( sql ) . setMediaType ( mediaType ) . setRequestId ( request...
public class PriorityStateManager { /** * return an array of short which contains the priority of state of monitored devices . * @ return short [ ] */ public short [ ] getDeviceStateNumberArray ( ) { } }
final short [ ] array = new short [ deviceStateMap . size ( ) ] ; int i = 0 ; for ( final Map . Entry < String , DevState > deviceStateEntry : deviceStateMap . entrySet ( ) ) { final DevState deviceState = deviceStateEntry . getValue ( ) ; array [ i ++ ] = ( short ) getPriorityForState ( deviceState ) ; } return array ...
public class PatchModuleInvalidationUtils { /** * Fills the Boyer Moore " bad character array " for the given pattern */ private static void computeBadByteSkipArray ( byte [ ] pattern , int [ ] badByteArray ) { } }
for ( int a = 0 ; a < ALPHABET_SIZE ; a ++ ) { badByteArray [ a ] = pattern . length ; } for ( int j = 0 ; j < pattern . length - 1 ; j ++ ) { badByteArray [ pattern [ j ] - Byte . MIN_VALUE ] = pattern . length - j - 1 ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } */ @ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "renditionFilter" , scope = GetRenditions . class ) public JAXBElement < String > createGetRenditi...
return new JAXBElement < String > ( _GetObjectOfLatestVersionRenditionFilter_QNAME , String . class , GetRenditions . class , value ) ;
public class OnesCounting { /** * This method calculates the fitness for a given genotype . */ private static Integer count ( final Genotype < BitGene > gt ) { } }
return gt . getChromosome ( ) . as ( BitChromosome . class ) . bitCount ( ) ;
public class AWSServiceCatalogClient { /** * Deletes the specified portfolio . * You cannot delete a portfolio if it was shared with you or if it has associated products , users , constraints , or * shared accounts . * @ param deletePortfolioRequest * @ return Result of the DeletePortfolio operation returned by...
request = beforeClientExecution ( request ) ; return executeDeletePortfolio ( request ) ;
public class CmsSubscriptionManager { /** * Returns the date when the resource was last visited by the user . < p > * @ param cms the current users context * @ param user the user to check the date * @ param resourcePath the name of the resource to check the date * @ return the date when the resource was last v...
CmsResource resource = cms . readResource ( resourcePath , CmsResourceFilter . ALL ) ; return m_securityManager . getDateLastVisitedBy ( cms . getRequestContext ( ) , getPoolName ( ) , user , resource ) ;
public class HTTaxinvoiceServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . HTTaxinvoiceService # getJobState ( java . lang . String , java . lang . String ) */ @ Override public HTTaxinvoiceJobState getJobState ( String CorpNum , String JobID ) throws PopbillException { } }
return getJobState ( CorpNum , JobID , null ) ;
public class CmsLinkRewriter { /** * Separate method for copying locale relations . . < p > * This is necessary because the default copy mechanism does not copy locale relations . * @ throws CmsException if something goes wrong */ protected void copyLocaleRelations ( ) throws CmsException { } }
long start = System . currentTimeMillis ( ) ; List < CmsRelation > localeRelations = m_cms . readRelations ( CmsRelationFilter . ALL . filterType ( CmsRelationType . LOCALE_VARIANT ) ) ; for ( CmsRelation rel : localeRelations ) { if ( isInSources ( rel . getSourcePath ( ) ) && isInSources ( rel . getTargetPath ( ) ) )...
public class StringParam { /** * String parameter modifier < code > : contains < / code > */ public StringParam setContains ( boolean theContains ) { } }
myContains = theContains ; if ( myContains ) { setExact ( false ) ; setMissing ( null ) ; } return this ;
public class X509DefaultEntryConverter { /** * Apply default coversion for the given value depending on the oid * and the character range of the value . * @ param oid the object identifier for the DN entry * @ param value the value associated with it * @ return the ASN . 1 equivalent for the string value . */ p...
if ( value . length ( ) != 0 && value . charAt ( 0 ) == '#' ) { try { return convertHexEncoded ( value , 1 ) ; } catch ( IOException e ) { throw new RuntimeException ( "can't recode value for oid " + oid . getId ( ) , e ) ; } } else if ( oid . equals ( X509Name . EmailAddress ) ) { return new DERIA5String ( value ) ; }...
public class TldFernClassifier { /** * Computes the value of the specified fern at the specified location in the image . */ protected int computeFernValue ( float c_x , float c_y , float rectWidth , float rectHeight , TldFernDescription fern ) { } }
rectWidth -= 1 ; rectHeight -= 1 ; int desc = 0 ; for ( int i = 0 ; i < fern . pairs . length ; i ++ ) { Point2D_F32 p_a = fern . pairs [ i ] . a ; Point2D_F32 p_b = fern . pairs [ i ] . b ; float valA = interpolate . get_fast ( c_x + p_a . x * rectWidth , c_y + p_a . y * rectHeight ) ; float valB = interpolate . get_f...
public class UtilMath { /** * Check if value is between an interval . * @ param value The value to check . * @ param min The minimum value . * @ param max The maximum value . * @ return < code > true < / code > if between , < code > false < / code > else . */ public static boolean isBetween ( double value , dou...
return Double . compare ( value , min ) >= 0 && Double . compare ( value , max ) <= 0 ;
public class NumberUtils { /** * Parse the given text into a number instance of the given target class , * using the given NumberFormat . Trims the input { @ code String } * before attempting to parse the number . * @ param text the text to convert * @ param targetClass the target class to parse into * @ para...
if ( numberFormat != null ) { Assert . notNull ( text , "Text must not be null" ) ; Assert . notNull ( targetClass , "Target class must not be null" ) ; DecimalFormat decimalFormat = null ; boolean resetBigDecimal = false ; if ( numberFormat instanceof DecimalFormat ) { decimalFormat = ( DecimalFormat ) numberFormat ; ...
public class PropertyDispatcher { /** * Adds a PropertySetter observer for properties . * @ param observer * @ param properties */ public void addObserver ( PropertySetter observer , String ... properties ) { } }
try { semaphore . acquire ( ) ; } catch ( InterruptedException ex ) { throw new IllegalArgumentException ( ex ) ; } try { addObserver ( observer ) ; for ( String p : properties ) { observers . addObserver ( p , observer ) ; } } finally { semaphore . release ( ) ; }
public class SessionManager { /** * Method createSession * Called by the HTTPSessionManager in order to create a session . The id provided is in advisory capability only i . e . If there is another webapp that is using this id , then we * can * reuse it . If not we need to create a new one . If the session id is ...
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { // LoggingUtil . SESSION _ LOGGER _ CORE . logp ( Level . FINE , methodClassName , // " createSession " , new Object [ ] { id , new Integer ( sessionVersion ) , // correlator } ) ...
public class H2GISFunctions { /** * Register a H2GIS java code function * @ param st SQL Statement * @ param function Function instance * @ param packagePrepend For OSGi environment only , use * Bundle - SymbolicName : Bundle - Version : * @ throws java . sql . SQLException */ public static void registerFunct...
registerFunction ( st , function , packagePrepend , true ) ;
public class Token { /** * Find the ManagedObject handled by this token . * @ return ManagedObject the underlying ManagedObject represented by the token . * @ throws ObjectManagerException */ public final ManagedObject getManagedObject ( ) throws ObjectManagerException { } }
// final String methodName = " getManagedObject " ; // if ( Tracing . isAnyTracingEnabled ( ) & & trace . isEntryEnabled ( ) ) // trace . entry ( this , // cclass , // methodName ) ; // Get the object if is already in memory . ManagedObject managedObject = null ; if ( managedObjectReference != null ) managedObject = ( ...
public class IPAddressCompare { /** * Checks whether ipAddress is in network with specified subnet by comparing byte logical end values */ private static boolean compareByteValues ( byte [ ] network , byte [ ] subnet , byte [ ] ipAddress ) { } }
for ( int i = 0 ; i < network . length ; i ++ ) if ( ( network [ i ] & subnet [ i ] ) != ( ipAddress [ i ] & subnet [ i ] ) ) return false ; return true ;
public class MinMaxBinaryArrayDoubleEndedHeap { /** * Create a heap from an array of elements . The elements of the array are * not destroyed . The method has linear time complexity . * @ param < K > * the type of keys maintained by the heap * @ param array * an array of elements * @ return a heap * @ thr...
if ( array == null ) { throw new IllegalArgumentException ( "Array cannot be null" ) ; } if ( array . length == 0 ) { return new MinMaxBinaryArrayDoubleEndedHeap < K > ( ) ; } MinMaxBinaryArrayDoubleEndedHeap < K > h = new MinMaxBinaryArrayDoubleEndedHeap < K > ( array . length ) ; System . arraycopy ( array , 0 , h . ...
public class MeteredInputStream { /** * Find the lowest { @ link MeteredInputStream } in a chain of { @ link FilterInputStream } s . */ public static Optional < MeteredInputStream > findWrappedMeteredInputStream ( InputStream is ) { } }
if ( is instanceof FilterInputStream ) { try { Optional < MeteredInputStream > meteredInputStream = findWrappedMeteredInputStream ( FilterStreamUnpacker . unpackFilterInputStream ( ( FilterInputStream ) is ) ) ; if ( meteredInputStream . isPresent ( ) ) { return meteredInputStream ; } } catch ( IllegalAccessException i...
public class AbstractMonteCarloProduct { /** * / * ( non - Javadoc ) * @ see net . finmath . montecarlo . MonteCarloProduct # getValuesForModifiedData ( double , net . finmath . montecarlo . MonteCarloSimulationModel , java . util . Map ) */ @ Override public Map < String , Object > getValuesForModifiedData ( double ...
MonteCarloSimulationModel modelModified = model . getCloneWithModifiedData ( dataModified ) ; return getValues ( evaluationTime , modelModified ) ;
public class CspResponseWriter { /** * Write needed attributes before the starting element will be closed by adding a trailing ' > ' character when calling e . g . * { @ link ResponseWriter # writeText } . * See { @ link ResponseWriter # startElement ( String , UIComponent ) } */ private void listenOnEndAttribute (...
if ( lastElement == null ) { return ; } // no nonce written - > do it if ( "script" . equalsIgnoreCase ( lastElement ) && LangUtils . isValueBlank ( lastNonce ) ) { getWrapped ( ) . writeAttribute ( "nonce" , cspState . getNonce ( ) , null ) ; } if ( lastEvents != null && ! lastEvents . isEmpty ( ) ) { String id = last...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSolidAngleMeasure ( ) { } }
if ( ifcSolidAngleMeasureEClass == null ) { ifcSolidAngleMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 864 ) ; } return ifcSolidAngleMeasureEClass ;
public class CharOperation { /** * Answers the number of occurrences of the given character in the given array , 0 if any . < br > * < br > * For example : * < ol > * < li > * < pre > * toBeFound = ' b ' * array = { ' a ' , ' b ' , ' b ' , ' a ' , ' b ' , ' a ' } * result = & gt ; 3 * < / pre > * < ...
int count = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( toBeFound == array [ i ] ) { count ++ ; } } return count ;
public class AggregationIterator { public boolean hasNext ( ) { } }
final int size = iterators . length ; for ( int i = 0 ; i < size ; i ++ ) { // As long as any of the iterators has a data point with a timestamp // that falls within our interval , we know we have at least one next . if ( ( timestamps [ size + i ] & TIME_MASK ) <= end_time ) { // LOG . debug ( " hasNext # " + ( size + ...
public class CommerceCurrencyPersistenceImpl { /** * Returns all the commerce currencies . * @ return the commerce currencies */ @ Override public List < CommerceCurrency > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class DataUtils { public static < T > List < T > getList ( final ContentValues [ ] values , final Class < T > klass ) { } }
final List < T > objects = new ArrayList < T > ( ) ; for ( int i = 0 ; i < values . length ; i ++ ) { final T object = getObject ( values [ i ] , klass ) ; if ( object != null ) { objects . add ( object ) ; } } return objects ;
public class ACLModel { /** * - - - - - Inherited methods - - - - - */ @ Override public boolean isAuthorizedForTransaction ( String subject , String activity ) throws CompatibilityException { } }
context . validateSubject ( subject ) ; context . validateActivity ( activity ) ; if ( ! activityPermissionsUT . containsKey ( subject ) ) { return false ; } return activityPermissionsUT . get ( subject ) . contains ( activity ) ;
public class DestinationChangeListener { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . trm . dlm . DestinationLocationChangeListener # destinationUnavailable ( com . ibm . ws . sib . utils . SIBUuid12 , com . ibm . ws . sib . trm . dlm . Capability ) */ public void destinationUnavailable ( SIBUuid12 dest...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "destinationUnavailable" , new Object [ ] { destId , capability } ) ; Set < SIBUuid8 > available = new HashSet < SIBUuid8 > ( ) ; // Empty set of available MEs . The destination is unavailable . Set < SIBUuid8 > unavailable ...
public class DirectoryWalker { /** * Start the directory analysis . */ public ISynchronizationPoint < IOException > start ( byte priority , WorkProgress progress , long work ) { } }
JoinPoint < IOException > jp = new JoinPoint < > ( ) ; jp . addToJoin ( 1 ) ; processDirectory ( "" , root , rootObject , jp , priority , progress , work ) ; jp . start ( ) ; return jp ;
public class SonarBuilder { /** * Parses the task status as returned from Sonar ' s CE API * @ param ceTaskResponse String * @ return value of status element in the CE API Response * @ throws ParseException org . json . simple . parser . ParseException */ private String getSonarTaskStatus ( String ceTaskResponse ...
JSONObject ceTaskResponseObject = ( JSONObject ) new org . json . simple . parser . JSONParser ( ) . parse ( ceTaskResponse ) ; JSONObject task = ( JSONObject ) ceTaskResponseObject . get ( "task" ) ; return str ( task , "status" ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcProjectOrderTypeEnum ( ) { } }
if ( ifcProjectOrderTypeEnumEEnum == null ) { ifcProjectOrderTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 875 ) ; } return ifcProjectOrderTypeEnumEEnum ;
public class GetStringComparator { /** * Get a chunk of the string that is all digits or all not digits . Length * of string is passed in for improved efficiency ( calculate once ) . * @ param string the string being chunked * @ param slength the length of the string * @ param marker the starting point for proc...
if ( isDigit ( string . charAt ( marker ) ) ) { return getNumericChunk ( string , slength , marker ) ; } else { return getTextChunk ( string , slength , marker ) ; }
public class VelocityParser { /** * Get the Velocity method parameters ( including < code > ( < / code > and < code > ) < / code > ) . * @ param array the source to parse * @ param currentIndex the current index in the < code > array < / code > * @ param velocityBlock the buffer where to append matched velocity b...
return getParameters ( array , currentIndex , velocityBlock , ')' , context ) ;
public class CmsObject { /** * Reads all resources with the given resource id . < p > * @ param resourceId the resource id for which we want the siblings * @ param filter the resource filter used to read the resources * @ return the siblings which share the given resource id * @ throws CmsException if something...
CmsResource pseudoResource = new CmsResource ( null , resourceId , null , 0 , false , 0 , null , null , 0 , null , 0 , null , 0 , 0 , 0 , 0 , 0 , 0 ) ; return readSiblings ( pseudoResource , filter ) ;
public class Box { /** * @ description * Authenticates and decrypts the given box with peer ' s public key , * our secret key , and the given nonce . * Returns the original message , or null if authentication fails . */ public byte [ ] open ( byte [ ] box ) { } }
if ( box == null ) return null ; // prepare shared key if ( this . sharedKey == null ) before ( ) ; return open_after ( box , 0 , box . length ) ;
public class RestQueryHandlerImpl { /** * Executes a the given query string ( based on the language information ) against a JCR repository , returning a rest model * based result . * @ param request a non - null { @ link Request } * @ param repositoryName a non - null , URL encoded { @ link String } representing ...
assert repositoryName != null ; assert workspaceName != null ; assert language != null ; assert statement != null ; Session session = getSession ( request , repositoryName , workspaceName ) ; org . modeshape . jcr . api . query . Query query = createQuery ( language , statement , session ) ; bindExtraVariables ( reques...
public class ModelSerializer { /** * Write a model to a file path * @ param model the model to write * @ param path the path to write to * @ param saveUpdater whether to save the updater * or not * @ throws IOException */ public static void writeModel ( @ NonNull Model model , @ NonNull String path , boolean ...
try ( BufferedOutputStream stream = new BufferedOutputStream ( new FileOutputStream ( path ) ) ) { writeModel ( model , stream , saveUpdater ) ; }
public class CustomViewPager { /** * Determine whether the distance between the user ' s ACTION _ DOWN * event ( x1 , y1 ) and the current ACTION _ MOVE event ( x2 , y2 ) should * be interpreted as a horizontal swipe . * @ param x1 * @ param y1 * @ param x2 * @ param y2 * @ return */ private boolean isScr...
float deltaX = x2 - x1 ; float deltaY = y2 - y1 ; if ( Math . abs ( deltaX ) > mTouchSlop && Math . abs ( deltaX ) > Math . abs ( deltaY ) ) { return true ; } return false ;
public class StringUtils { /** * Returns the number of times the specified character was found * in the target string , or 0 if there is no specified character . * @ param chars the target string * @ param c the character to find * @ return the number of times the specified character was found */ public static ...
int count = 0 ; for ( int i = 0 ; i < chars . length ( ) ; i ++ ) { if ( chars . charAt ( i ) == c ) { count ++ ; } } return count ;
public class CmsLoginUserAgreement { /** * Initializes the ' accepted ' data from the current user . < p > * Returns the absolute path in the OpenCms VFS to the user agreement configuration file . < p > */ protected void initAcceptData ( ) { } }
// read the current users agreement values CmsUser user = getCms ( ) . getRequestContext ( ) . getCurrentUser ( ) ; String result = ( String ) user . getAdditionalInfo ( CmsUserSettings . LOGIN_USERAGREEMENT_ACCEPTED ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( result ) ) { // read JSON data structure that is ...
public class MatrixVectorReader { /** * Reads a pattern matrix */ public void readPattern ( int [ ] row , int [ ] column ) throws IOException { } }
int size = row . length ; if ( size != column . length ) throw new IllegalArgumentException ( "All arrays must be of the same size" ) ; for ( int i = 0 ; i < size ; ++ i ) { row [ i ] = getInt ( ) ; column [ i ] = getInt ( ) ; }
public class RenameHandler { /** * Lookup an enum from a name , handling renames . * @ param < T > the type of the desired enum * @ param type the enum type , not null * @ param name the name of the enum to lookup , not null * @ return the enum value , not null * @ throws IllegalArgumentException if the name ...
if ( type == null ) { throw new IllegalArgumentException ( "type must not be null" ) ; } if ( name == null ) { throw new IllegalArgumentException ( "name must not be null" ) ; } Map < String , Enum < ? > > map = getEnumRenames ( type ) ; Enum < ? > value = map . get ( name ) ; if ( value != null ) { return type . cast ...
public class JobHistoryService { /** * Returns a list of { @ link Flow } instances generated from the given results . * For the moment , this assumes that the given scanner provides results * ordered first by flow ID . * @ param scan the Scan instance setup for retrieval * @ return */ private List < Flow > crea...
List < Flow > flows = new ArrayList < Flow > ( ) ; ResultScanner scanner = null ; try { Stopwatch timer = new Stopwatch ( ) . start ( ) ; Stopwatch timerJob = new Stopwatch ( ) ; int rowCount = 0 ; long colCount = 0 ; long resultSize = 0 ; int jobCount = 0 ; Table historyTable = hbaseConnection . getTable ( TableName ....
public class AbstractDocumentationMojo { /** * Execute the mojo on the given set of files . * @ param sourceFolder the source folder . * @ param inputFile the input file . * @ param relativeInputFile the name of the input file relatively to the source folder . * @ param outputFolder the output folder . * @ pa...
throw new UnsupportedOperationException ( ) ;
public class AlternativesImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case SimpleAntlrPackage . ALTERNATIVES__GROUPS : return groups != null && ! groups . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class AuthConfig { /** * Returns a properties object which is converted to { @ code T } . */ @ Nullable public < T > T properties ( Class < T > clazz ) throws JsonProcessingException { } }
return properties != null ? Jackson . treeToValue ( properties , clazz ) : null ;
public class WebJsJmsMessageEncoderImpl { /** * Encode a text message body */ private void encodeTextBody ( StringBuffer result , JsJmsTextMessage msg ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "encodeTextBody" ) ; try { String body = msg . getText ( ) ; if ( body != null ) { result . append ( '~' ) ; URLEncode ( result , body ) ; } } catch ( UnsupportedEncodingException e ) { FFDCFilter . processException ( e , "c...
public class WebSphereCDIDeploymentImpl { /** * Do any of the specified BDAs , or any of BDAs accessible by them , have any beans * BDAs for Runtime Extensions are ignored * @ param bdas * @ return * @ throws CDIException */ private boolean isCDIEnabled ( Collection < WebSphereBeanDeploymentArchive > bdas ) { }...
boolean anyHasBeans = false ; for ( WebSphereBeanDeploymentArchive bda : bdas ) { boolean hasBeans = false ; if ( bda . getType ( ) != ArchiveType . RUNTIME_EXTENSION ) { hasBeans = isCDIEnabled ( bda ) ; } anyHasBeans = anyHasBeans || hasBeans ; if ( anyHasBeans ) { break ; } } return anyHasBeans ;
public class CircularByteBuffer { /** * Gets as many of the requested bytes as available from this buffer . * @ return number of bytes actually got from this buffer ( 0 if no bytes are available ) */ public synchronized int get ( byte [ ] dst , int off , int len ) { } }
if ( available == 0 ) { return 0 ; } // limit is last index to read + 1 int limit = idxGet < idxPut ? idxPut : capacity ; int count = Math . min ( limit - idxGet , len ) ; System . arraycopy ( buffer , idxGet , dst , off , count ) ; idxGet += count ; if ( idxGet == capacity ) { // Array end reached , check if we have m...
public class CPOptionValueLocalServiceUtil { /** * Returns the cp option value matching the UUID and group . * @ param uuid the cp option value ' s UUID * @ param groupId the primary key of the group * @ return the matching cp option value , or < code > null < / code > if a matching cp option value could not be f...
return getService ( ) . fetchCPOptionValueByUuidAndGroupId ( uuid , groupId ) ;
public class CryptoServiceSingleton { /** * Encrypt a String with the AES encryption advanced using ' AES / CBC / PKCS5Padding ' . Unlike the regular * encode / decode AES method using ECB ( Electronic Codebook ) , it uses Cipher - block chaining ( CBC ) . The private key * must have a length of 16 bytes , the salt...
SecretKey genKey = generateAESKey ( privateKey , salt ) ; byte [ ] encrypted = doFinal ( Cipher . ENCRYPT_MODE , genKey , iv , value . getBytes ( UTF_8 ) ) ; return encodeBase64 ( encrypted ) ;
public class Geometry { /** * Center the columns of a matrix ( in - place ) . */ public static DoubleMatrix centerColumns ( DoubleMatrix x ) { } }
DoubleMatrix temp = new DoubleMatrix ( x . rows ) ; for ( int c = 0 ; c < x . columns ; c ++ ) x . putColumn ( c , center ( x . getColumn ( c , temp ) ) ) ; return x ;
public class AbstractJavaMetadata { /** * Extract the type name * @ param type - the type to be processed . This can be primitive , simple , parameterized . . . * @ return the name of a type . * @ throws IllegalArgumentException if type is null . */ private String getTypeName ( Type type ) { } }
CheckArg . isNotNull ( type , "type" ) ; if ( type . isPrimitiveType ( ) ) { PrimitiveType primitiveType = ( PrimitiveType ) type ; return primitiveType . getPrimitiveTypeCode ( ) . toString ( ) ; } if ( type . isSimpleType ( ) ) { SimpleType simpleType = ( SimpleType ) type ; return JavaMetadataUtil . getName ( simple...
public class ConcreteEditingContext { /** * Mark for creation all objects that were included into dependent collections . * Mark for deletion all objects that were excluded from dependent collections . */ private ArrayList handleDependentCollections ( Identity oid , Object obj , Object [ ] origCollections , Object [ ...
ClassDescriptor mif = _pb . getClassDescriptor ( obj . getClass ( ) ) ; Collection colDescs = mif . getCollectionDescriptors ( ) ; ArrayList newObjects = new ArrayList ( ) ; int count = 0 ; for ( Iterator it = colDescs . iterator ( ) ; it . hasNext ( ) ; count ++ ) { CollectionDescriptor cds = ( CollectionDescriptor ) ...
public class HttpProxyServiceHandler { /** * Helper method performing loop detection * @ param acceptSession - session parameter * @ return - whether a loop was detected or not */ private boolean validateNoLoopDetected ( DefaultHttpSession acceptSession ) { } }
List < String > viaHeaders = acceptSession . getReadHeaders ( HEADER_VIA ) ; if ( viaHeaders != null && viaHeaders . stream ( ) . anyMatch ( h -> h . equals ( viaHeader ) ) ) { LOGGER . warn ( "Connection to " + getConnectURIs ( ) . iterator ( ) . next ( ) + " failed due to loop detection [" + acceptSession + "->]" ) ;...
public class TaskRunner { /** * Corona will schedule tasks immediately after a failure , which can cause * the new task to potentially coincide with the failed task JVM still * running . Concurrent running JVMs can cause failure if they expect an * initial amount of memory available . As a temporary workaround , ...
long delayMs = conf . getLong ( MAPREDUCE_TASK_DELAY_MS , MAPREDUCE_TASK_DELAY_MS_DEFAULT ) ; try { Thread . sleep ( delayMs ) ; } catch ( InterruptedException e ) { LOG . info ( "delayStartingTask: Unexpected interruption of " + delayMs + " ms" ) ; } return delayMs ;
public class HiveMetaStoreUtils { /** * First tries getting the { @ code FieldSchema } s from the { @ code HiveRegistrationUnit } ' s columns , if set . * Else , gets the { @ code FieldSchema } s from the deserializer . */ private static List < FieldSchema > getFieldSchemas ( HiveRegistrationUnit unit ) { } }
List < Column > columns = unit . getColumns ( ) ; List < FieldSchema > fieldSchemas = new ArrayList < > ( ) ; if ( columns != null && columns . size ( ) > 0 ) { fieldSchemas = getFieldSchemas ( columns ) ; } else { Deserializer deserializer = getDeserializer ( unit ) ; if ( deserializer != null ) { try { fieldSchemas =...
public class Deployment { /** * < pre > * Manifest of the files stored in Google Cloud Storage that are included * as part of this version . All files must be readable using the * credentials supplied with this call . * < / pre > * < code > map & lt ; string , . google . appengine . v1 . FileInfo & gt ; files...
if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } java . util . Map < java . lang . String , com . google . appengine . v1 . FileInfo > map = internalGetFiles ( ) . getMap ( ) ; return map . containsKey ( key ) ? map . get ( key ) : defaultValue ;
public class VaultsInner { /** * Create or update a key vault in the specified subscription . * @ param resourceGroupName The name of the Resource Group to which the server belongs . * @ param vaultName Name of the vault * @ param parameters Parameters to create or update the vault * @ throws IllegalArgumentExc...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , vaultName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;