signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ForwardState { /** * Initialize the state .
* @ param certPathCheckers the list of user - defined PKIXCertPathCheckers */
public void initState ( List < PKIXCertPathChecker > certPathCheckers ) throws CertPathValidatorException { } } | subjectNamesTraversed = new HashSet < GeneralNameInterface > ( ) ; traversedCACerts = 0 ; /* * Populate forwardCheckers with every user - defined checker
* that supports forward checking and initialize the forwardCheckers */
forwardCheckers = new ArrayList < PKIXCertPathChecker > ( ) ; for ( PKIXCertPathChecker check... |
public class PcsUtils { /** * Server has answered OK with a file to download as stream .
* Open byte sink stream , and copy data from server stream to sink stream
* @ param response server response to read from
* @ param byteSink destination */
public static void downloadDataToSink ( CResponse response , ByteSink... | InputStream is = null ; ByteSinkStream bss = null ; boolean success = false ; try { long contentLength = response . getContentLength ( ) ; if ( contentLength >= 0 ) { // content length is known : inform any listener
byteSink . setExpectedLength ( contentLength ) ; } long current = 0 ; is = response . openStream ( ) ; b... |
public class TaskConfig { /** * Get container bind mount volumes .
* @ return A list of container bind mount volumes . */
private List < String > binds ( ) { } } | final ImmutableList . Builder < String > binds = ImmutableList . builder ( ) ; for ( final Map . Entry < String , String > entry : job . getVolumes ( ) . entrySet ( ) ) { final String path = entry . getKey ( ) ; final String source = entry . getValue ( ) ; if ( Strings . isNullOrEmpty ( source ) ) { continue ; } binds ... |
public class ClassDescriptorDef { /** * Returns the default table name for this class which is the unqualified class name .
* @ return The default table name */
public String getDefaultTableName ( ) { } } | String name = getName ( ) ; int lastDotPos = name . lastIndexOf ( '.' ) ; int lastDollarPos = name . lastIndexOf ( '$' ) ; return lastDollarPos > lastDotPos ? name . substring ( lastDollarPos + 1 ) : name . substring ( lastDotPos + 1 ) ; |
public class OrderedRowsImpl { /** * Returns the last element in this row result . Helpful for passing along for paging situations .
* @ return */
@ Override public Row < K , N , V > peekLast ( ) { } } | return rowsList != null && rowsList . size ( ) > 0 ? rowsList . get ( rowsList . size ( ) - 1 ) : null ; |
public class Client { /** * Get metadata for object by hash .
* @ param hash Object hash .
* @ param size Object size .
* @ return Object metadata or null , if object not found .
* @ throws IOException */
@ Nullable public ObjectRes postMeta ( @ NotNull final String hash , final long size ) throws IOException {... | return postMeta ( new Meta ( hash , size ) ) ; |
public class Field { /** * Creates a field of a given type , the value is converted to the specified type .
* If the type is < code > MAP < / code > , < code > LIST < / code > or < code > LIST _ MAP < / code > this method performs a deep copy of
* the value .
* @ param type the type of the field to create .
* @... | return new Field ( Utils . checkNotNull ( type , "type" ) , type . convert ( value ) , attributes ) ; |
public class MatrixEntropy { /** * Returns a { @ link EntropyStats } covering the entropies of all joint events ,
* rows , and columns in { @ code m } . */
public static EntropyStats entropy ( Matrix m ) { } } | if ( m instanceof SparseMatrix ) return entropy ( ( SparseMatrix ) m ) ; double sum = 0 ; double [ ] colSums = new double [ m . columns ( ) ] ; double [ ] rowSums = new double [ m . rows ( ) ] ; for ( int r = 0 ; r < m . rows ( ) ; ++ r ) { for ( int c = 0 ; c < m . columns ( ) ; ++ c ) { double v = m . get ( r , c ) ;... |
public class Base64Decoder { /** * Start a new Task to decode the given buffer . */
public ISynchronizationPoint < IOException > decode ( ByteBuffer buffer ) { } } | SynchronizationPoint < IOException > result = new SynchronizationPoint < > ( ) ; new Task . Cpu < Void , NoException > ( "Decoding base 64" , output . getPriority ( ) ) { @ Override public Void run ( ) { if ( nbPrev > 0 ) { while ( nbPrev < 4 && buffer . hasRemaining ( ) ) previous [ nbPrev ++ ] = buffer . get ( ) ; if... |
public class AUTH { /** * An event was received from the layer below . Usually the current layer will want to examine the event type and
* - depending on its type - perform some computation ( e . g . removing headers from a MSG event type , or updating
* the internal membership list when receiving a VIEW _ CHANGE e... | // If we have a join or merge request - - > authenticate , else pass up
GMS . GmsHeader gms_hdr = getGMSHeader ( msg ) ; if ( gms_hdr != null && needsAuthentication ( gms_hdr ) ) { AuthHeader auth_hdr = msg . getHeader ( id ) ; if ( auth_hdr == null ) { sendRejectionMessage ( gms_hdr . getType ( ) , msg . src ( ) , "no... |
public class ThreadUtil { /** * 获得一个新的线程池 < br >
* 如果maximumPoolSize = 》 corePoolSize , 在没有新任务加入的情况下 , 多出的线程将最多保留60s
* @ param corePoolSize 初始线程池大小
* @ param maximumPoolSize 最大线程池大小
* @ return { @ link ThreadPoolExecutor } */
public static ThreadPoolExecutor newExecutor ( int corePoolSize , int maximumPoolSize ... | return ExecutorBuilder . create ( ) . setCorePoolSize ( corePoolSize ) . setMaxPoolSize ( maximumPoolSize ) . build ( ) ; |
public class FilesScanner { /** * get the content of directory by includes , excludes , followSymlinks and globCaseSensitive , the scanDirectories property define if the scanner will scan to find directories */
public String [ ] getDirectoryContent ( String scannerBaseDir , String [ ] includes , String [ ] excludes , b... | File file = new File ( scannerBaseDir ) ; String [ ] fileNames ; if ( file . exists ( ) && file . isDirectory ( ) ) { DirectoryScanner scanner = new DirectoryScanner ( ) ; scanner . setBasedir ( scannerBaseDir ) ; scanner . setIncludes ( includes ) ; scanner . setExcludes ( excludes ) ; scanner . setFollowSymlinks ( fo... |
public class UpdateMatchmakingConfigurationRequest { /** * Set of custom properties for a game session , formatted as key : value pairs . These properties are passed to a game
* server process in the < a > GameSession < / a > object with a request to start a new game session ( see < a href =
* " https : / / docs . ... | if ( gameProperties == null ) { this . gameProperties = null ; return ; } this . gameProperties = new java . util . ArrayList < GameProperty > ( gameProperties ) ; |
public class Compiler { /** * Generates a new { @ link CompilerDef } and populates it give the parameters
* provided .
* @ param type
* - main or test library - used to determine include and exclude
* paths .
* @ param output
* - TODO Not sure . .
* @ return { @ link CompilerDef } which contains the confi... | final String name = getName ( ) ; if ( name == null ) { return null ; } final CompilerDef compilerDef = new CompilerDef ( ) ; compilerDef . setProject ( this . mojo . getAntProject ( ) ) ; final CompilerEnum compilerName = new CompilerEnum ( ) ; compilerName . setValue ( name ) ; compilerDef . setName ( compilerName ) ... |
public class BaseTraceFormatter { /** * Format the given record into the desired trace format
* @ param name
* @ param sym
* @ param method
* @ param id
* @ param level
* @ param txt
* @ return String */
private String createFormattedString ( LogRecord logRecord , Object id , String txt ) { } } | String objId ; WsLogRecord wsLogRecord = getWsLogRecord ( logRecord ) ; String name ; String method = logRecord . getSourceMethodName ( ) ; String className = logRecord . getSourceClassName ( ) ; String stackTrace = getStackTrace ( logRecord ) ; String sym = getMarker ( logRecord ) ; StringBuilder sb = new StringBuilde... |
public class CmsPropertiesTab { /** * Gets the image preview handler , or null if there is no image preview handler . < p >
* @ return the image preview handler or null */
private CmsImagePreviewHandler getImagePreviewHandler ( ) { } } | if ( m_handler == null ) { return null ; } if ( m_handler instanceof CmsImagePreviewHandler ) { return ( CmsImagePreviewHandler ) m_handler ; } return null ; |
public class Market { /** * Cancel a quantity of an order in an order book . If the remaining quantity reaches zero , the
* order is deleted from the order book .
* < p > An update event is triggered .
* < p > If the order identifier is unknown , do nothing .
* @ param orderId the order identifier
* @ param q... | Order order = orders . get ( orderId ) ; if ( order == null ) { return 0 ; } OrderBook book = order . getOrderBook ( ) ; long remainingQuantity = order . getRemainingQuantity ( ) ; long canceledQuantity = Math . min ( quantity , remainingQuantity ) ; boolean bbo = book . update ( order . getSide ( ) , order . getPrice ... |
public class RSA { /** * 还原公钥 , X509EncodedKeySpec 用于构建公钥的规范
* @ param keyBytes
* @ return */
public static PublicKey loadPublicKey ( byte [ ] keyBytes ) { } } | X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec ( keyBytes ) ; try { KeyFactory factory = KeyFactory . getInstance ( KEY_ALGORITHM ) ; PublicKey publicKey = factory . generatePublic ( x509EncodedKeySpec ) ; return publicKey ; } catch ( NoSuchAlgorithmException | InvalidKeySpecException e ) { // TODO Auto... |
public class CoreMessageSender { /** * TODO : consolidate common - code written for timeouts in Sender / Receiver */
private void initializeLinkOpen ( TimeoutTracker timeout ) { } } | this . linkFirstOpen = new CompletableFuture < CoreMessageSender > ( ) ; // timer to signal a timeout if exceeds the operationTimeout on MessagingFactory
Timer . schedule ( new Runnable ( ) { public void run ( ) { if ( ! CoreMessageSender . this . linkFirstOpen . isDone ( ) ) { CoreMessageSender . this . closeInternals... |
public class Platform { /** * Attempt to match the host runtime to a capable Platform implementation . */
static Platform findPlatform ( ) { } } | Platform jre8 = Jre8 . buildIfSupported ( ) ; if ( jre8 != null ) return jre8 ; Platform jre7 = Jre7 . buildIfSupported ( ) ; if ( jre7 != null ) return jre7 ; // compatible with JRE 6
return Jre6 . build ( ) ; |
public class JTextFieldDateEditor { /** * ( non - Javadoc )
* @ see com . toedter . calendar . IDateEditor # setSelectableDateRange ( java . util . Date ,
* java . util . Date ) */
public void setSelectableDateRange ( Date min , Date max ) { } } | dateUtil . setSelectableDateRange ( min , max ) ; checkText ( ) ; |
public class Surface { /** * Create a plot canvas with the 3D surface plot of given data .
* @ param z the z - axis values of surface . The x - axis and y - axis location of
* surface will be set to 0.5 , 1.5 , 2.5 , . . .
* @ param palette the color palette . */
public static PlotCanvas plot ( double [ ] [ ] z ,... | double [ ] lowerBound = { 0 , 0 , Math . min ( z ) } ; double [ ] upperBound = { z . length , z [ 0 ] . length , Math . max ( z ) } ; PlotCanvas canvas = new PlotCanvas ( lowerBound , upperBound ) ; Surface surface = new Surface ( z , palette ) ; canvas . add ( surface ) ; return canvas ; |
public class MyCanvas { /** * Draws the empty board , no pieces on it yet , just grid lines */
void drawEmptyBoard ( Graphics g ) { } } | int x = x_offset , y = y_offset ; Color old_col = g . getColor ( ) ; g . setFont ( def_font2 ) ; old_col = g . getColor ( ) ; g . setColor ( checksum_col ) ; g . drawString ( ( "Checksum: " + checksum ) , x_offset + field_size , y_offset - 20 ) ; g . setFont ( def_font ) ; g . setColor ( old_col ) ; for ( int i = 0 ; i... |
public class AiffSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AiffSettings aiffSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( aiffSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( aiffSettings . getBitDepth ( ) , BITDEPTH_BINDING ) ; protocolMarshaller . marshall ( aiffSettings . getChannels ( ) , CHANNELS_BINDING ) ; protocolMarshaller . marshall ( ... |
public class UnlinkIdentityRequest { /** * Provider names to unlink from this identity .
* @ param loginsToRemove
* Provider names to unlink from this identity . */
public void setLoginsToRemove ( java . util . Collection < String > loginsToRemove ) { } } | if ( loginsToRemove == null ) { this . loginsToRemove = null ; return ; } this . loginsToRemove = new java . util . ArrayList < String > ( loginsToRemove ) ; |
public class SingleNodeRateLimiterComponent { /** * Saves the current list of buckets into a file . */
private void saveBuckets ( ) { } } | if ( lastModifiedOn > lastSavedOn ) { System . out . println ( "Persisting current rates to: " + savedRates ) ; // $ NON - NLS - 1 $
Properties props = new Properties ( ) ; for ( Entry < String , RateLimiterBucket > entry : buckets . entrySet ( ) ) { String value = entry . getValue ( ) . getCount ( ) + "|" + entry . ge... |
public class Caster { /** * cast a Object to a long value ( primitive value type )
* @ param o Object to cast
* @ param defaultValue
* @ return casted long value */
public static long toLongValue ( Object o , long defaultValue ) { } } | if ( o instanceof Character ) return ( ( ( Character ) o ) . charValue ( ) ) ; else if ( o instanceof Boolean ) return ( ( ( ( Boolean ) o ) . booleanValue ( ) ) ? 1L : 0L ) ; else if ( o instanceof Number ) return ( ( ( Number ) o ) . longValue ( ) ) ; else if ( o instanceof CharSequence ) return ( long ) toDoubleValu... |
public class DeviceImpl { /** * Execute a command .
* It ' s the master method executed when a " command _ inout " CORBA operation is
* requested by a client . It updates the device black - box , call the TANGO
* command handler and returned the output Any
* @ param in _ cmd
* The command name
* @ param in ... | Util . out4 . println ( "DeviceImpl.command_inout(): command received : " + in_cmd ) ; // Record operation request in black box
blackbox . insert_cmd ( in_cmd , 1 ) ; // Execute command
Any out_any = null ; try { // If nb connection is closed to the maximum value ,
// throw an exception to do not block devices .
Util .... |
public class OnyxPersistenceManager { /** * Delete an entity within the database
* @ param clazz Entity type
* @ param identifier Primary key of the entity */
public void delete ( Class clazz , Object identifier ) { } } | try { // noinspection ConstantConditions
persistenceManager . deleteEntity ( persistenceManager . findById ( clazz , identifier ) ) ; } catch ( InitializationException ignore ) { } catch ( Exception e ) { e . printStackTrace ( ) ; } |
public class NullArgumentException { /** * Validates that the string array instance is not null and that it has entries that are not null or empty .
* @ param arrayToCheck The object to be tested .
* @ param trim If the elements should be trimmed before checking if empty
* @ param argumentName The name of the obj... | validateNotEmpty ( arrayToCheck , argumentName ) ; for ( int i = 0 ; i < arrayToCheck . length ; i ++ ) { validateNotEmpty ( arrayToCheck [ i ] , arrayToCheck [ i ] + "[" + i + "]" ) ; if ( trim ) { validateNotEmpty ( arrayToCheck [ i ] . trim ( ) , arrayToCheck [ i ] + "[" + i + "]" ) ; } } |
public class SLF4JBridgeHandler { /** * Return the Logger instance that will be used for logging . */
protected Logger getSLF4JLogger ( LogRecord record ) { } } | String name = record . getLoggerName ( ) ; if ( name == null ) { name = UNKNOWN_LOGGER_NAME ; } return LoggerFactory . getLogger ( name ) ; |
public class XMLBuilder2 { /** * @ throws XMLBuilderRuntimeException
* to wrap { @ link TransformerException } */
@ Override public String elementAsString ( Properties outputProperties ) { } } | try { return super . elementAsString ( outputProperties ) ; } catch ( TransformerException e ) { throw wrapExceptionAsRuntimeException ( e ) ; } |
public class SegmentHelper { /** * Request Complete callback is invoked when the request is complete , either by sending and receiving a response from
* segment store or by way of failure of connection .
* This is responsible for returning the connection back to the connection pool .
* @ param connectionFuture co... | // when processing completes , return the connection back to connection manager asynchronously .
// Note : If result future is complete , connectionFuture is definitely complete . if connectionFuture had failed ,
// we would not have received a connection object anyway .
if ( e != null ) { Throwable unwrap = Exceptions... |
public class StreamEx { /** * Creates a new { @ link EntryStream } which keys are elements of this stream
* and values are the corresponding elements of the supplied other stream .
* The resulting stream is ordered if both of the input streams are ordered ,
* and parallel if either of the input streams is paralle... | return zipWith ( ( BaseStream < V , ? > ) other ) ; |
public class UnbindOperationExecutor { /** * @ see org . springframework . ldap . support . transaction . CompensatingTransactionOperationExecutor # rollback ( ) */
public void rollback ( ) { } } | try { ldapOperations . rename ( temporaryDn , originalDn ) ; } catch ( Exception e ) { log . warn ( "Filed to rollback unbind operation, temporaryDn: " + temporaryDn + "; originalDn: " + originalDn ) ; } |
public class SynchronizationActivity { /** * Executes the controlled activity
* @ throws ActivityException */
public void execute ( ) throws ActivityException { } } | isSynchronized = checkIfSynchronized ( ) ; if ( ! isSynchronized ) { EventWaitInstance received = registerWaitEvents ( false , true ) ; if ( received != null ) resume ( getExternalEventInstanceDetails ( received . getMessageDocumentId ( ) ) , received . getCompletionCode ( ) ) ; } |
public class SARLRuntime { /** * Notifies all SRE install changed listeners of the removed of a SRE .
* @ param installation the removed SRE . */
public static void fireSRERemoved ( ISREInstall installation ) { } } | for ( final Object listener : SRE_LISTENERS . getListeners ( ) ) { ( ( ISREInstallChangedListener ) listener ) . sreRemoved ( installation ) ; } |
public class Utils { /** * 文字列をトリムする 。
* @ param value トリム対象の文字
* @ param trimmed トリムするかどうか 。
* @ return トリミングした結果 。 */
public static String trim ( final String value , final boolean trimmed ) { } } | if ( ! trimmed || value == null ) { return value ; } return value . trim ( ) ; |
public class OAuth { /** * Request the request token and secret .
* @ param callbackURL the URL where the provider should redirect to ( usually a URL on the current app )
* @ return A Right ( RequestToken ) in case of success , Left ( OAuthException ) otherwise */
public RequestToken retrieveRequestToken ( String c... | OAuthConsumer consumer = new DefaultOAuthConsumer ( info . key . key , info . key . secret ) ; try { provider . retrieveRequestToken ( consumer , callbackURL ) ; return new RequestToken ( consumer . getToken ( ) , consumer . getTokenSecret ( ) ) ; } catch ( OAuthException ex ) { throw new RuntimeException ( ex ) ; } |
public class Unchecked { /** * Wrap a { @ link CheckedObjDoubleConsumer } in a { @ link ObjDoubleConsumer } . */
public static < T > ObjDoubleConsumer < T > objDoubleConsumer ( CheckedObjDoubleConsumer < T > consumer ) { } } | return objDoubleConsumer ( consumer , THROWABLE_TO_RUNTIME_EXCEPTION ) ; |
public class ImageExtensions { /** * Resize the given BufferedImage and returns the resized BufferedImage .
* @ param originalImage
* the original image
* @ param scalingMethod
* the scaling method
* @ param resizeMode
* the resize mode
* @ param formatName
* the format name
* @ param targetWidth
* ... | return read ( resize ( originalImage , scalingMethod , resizeMode , formatName , targetWidth , targetHeight ) ) ; |
public class FeatureSetCacheKeyGenerator { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . core . cachekeygenerator . ICacheKeyGenerator # generateKey ( javax . servlet . http . HttpServletRequest ) */
@ Override public String generateKey ( HttpServletRequest request ) { } } | Features features = ( Features ) request . getAttribute ( IHttpTransport . FEATUREMAP_REQATTRNAME ) ; if ( features == null ) { features = Features . emptyFeatures ; } IAggregator aggr = ( IAggregator ) request . getAttribute ( IAggregator . AGGREGATOR_REQATTRNAME ) ; IConfig config = aggr . getConfig ( ) ; // First , ... |
public class TrainingsImpl { /** * Add the provided images urls to the set of training images .
* This API accepts a batch of urls , and optionally tags , to create images . There is a limit of 64 images and 20 tags .
* @ param projectId The project id
* @ param batch Image urls and tag ids . Limited to 64 images... | return createImagesFromUrlsWithServiceResponseAsync ( projectId , batch ) . map ( new Func1 < ServiceResponse < ImageCreateSummary > , ImageCreateSummary > ( ) { @ Override public ImageCreateSummary call ( ServiceResponse < ImageCreateSummary > response ) { return response . body ( ) ; } } ) ; |
public class HashMap { /** * Associates the specified value with the specified key in this map .
* If the map previously contained a mapping for the key , the old
* value is replaced .
* @ param key key with which the specified value is to be associated
* @ param value value to be associated with the specified ... | return putVal ( hash ( key ) , key , value , false , true ) ; |
public class AbstractClassLoader { /** * Release the synchronized object for loading the given class . */
public static void releaseClassLoadingSP ( String name ) { } } | synchronized ( classLoadingSP ) { Pair < Thread , JoinPoint < NoException > > sp = classLoadingSP . get ( name ) ; JoinPoint < NoException > jp = sp . getValue2 ( ) ; jp . joined ( ) ; if ( jp . isUnblocked ( ) ) classLoadingSP . remove ( name ) ; } |
public class CollisionFormulaConfig { /** * Create a collision formula from its node .
* @ param node The collision formula node ( must not be < code > null < / code > ) .
* @ return The tile collision formula instance .
* @ throws LionEngineException If error when reading data . */
public static CollisionFormula... | Check . notNull ( node ) ; final String name = node . readString ( ATT_NAME ) ; final CollisionRange range = CollisionRangeConfig . imports ( node . getChild ( CollisionRangeConfig . NODE_RANGE ) ) ; final CollisionFunction function = CollisionFunctionConfig . imports ( node ) ; final CollisionConstraint constraint = C... |
public class QueryResult { /** * Creates a snapshot of the query results
* @ return returns snapshot of query result */
public QueryResult createSnapshot ( ) { } } | QueryResult queryResult = new QueryResult ( ) ; queryResult . setResults ( getResults ( ) ) ; queryResult . setIncludes ( getIncludes ( ) ) ; queryResult . setIndexName ( getIndexName ( ) ) ; queryResult . setIndexTimestamp ( getIndexTimestamp ( ) ) ; queryResult . setIncludedPaths ( getIncludedPaths ( ) ) ; queryResul... |
public class FNDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . FND__TYPE_FC_DESC : setTypeFcDesc ( TYPE_FC_DESC_EDEFAULT ) ; return ; case AfplibPackage . FND__FT_WT_CLASS : setFtWtClass ( FT_WT_CLASS_EDEFAULT ) ; return ; case AfplibPackage . FND__FT_WD_CLASS : setFtWdClass ( FT_WD_CLASS_EDEFAULT ) ; return ; case AfplibPackage . FND__M... |
public class VcfReader { /** * Read zero or more VCF records from the specified URL .
* @ param url URL to read from , must not be null
* @ return zero or more VCF records read from the specified URL
* @ throws IOException if an I / O error occurs */
public static Iterable < VcfRecord > records ( final URL url ) ... | checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return records ( reader ) ; } |
public class HttpOutboundServiceContextImpl { /** * Send the given body buffers for the outgoing request asynchronously .
* If chunked encoding is set , then these buffers will be considered a
* " chunk " and encoded as such . If the message is Content - Length defined ,
* then the buffers will simply be sent out... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "finishRequestMessage(async)" ) ; } if ( isMessageSent ( ) ) { throw new MessageSentException ( "Message already sent" ) ; } // if headers haven ' t been sent and chunked encoding is not explicitly
// configured , then set th... |
public class JCloudsComputeModule { /** * Allows jclouds submodules to override the hardware supplier */
protected Supplier < Set < HardwareFlavor > > overrideHardwareFlavorSupplier ( Injector injector , Supplier < Set < HardwareFlavor > > originalSupplier ) { } } | return originalSupplier ; |
public class DeletePipelineRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeletePipelineRequest deletePipelineRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deletePipelineRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deletePipelineRequest . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMes... |
public class Future { /** * / * ( non - Javadoc )
* @ see com . oath . cyclops . types . MonadicValue # forEach2 ( java . util . function . Function , java . util . function . BiFunction , java . util . function . BiFunction ) */
@ Override public < R1 , R > Future < R > forEach2 ( Function < ? super T , ? extends Mo... | return ( Future < R > ) MonadicValue . super . forEach2 ( value1 , filterFunction , yieldingFunction ) ; |
public class JdbcCpoXaAdapter { /** * Retrieves the bean from the datasource . The assumption is that the bean exists in the datasource .
* @ param name The filter name which tells the datasource which beans should be returned . The name also signifies what
* data in the bean will be populated .
* @ param criteri... | return getCurrentResource ( ) . retrieveBeans ( name , criteria , where , orderBy ) ; |
public class AbstractComponent { /** * Perform the internal release . */
private void internalRelease ( ) { } } | // try {
// setKey ( null ) ;
// getNotifier ( ) . unlistenAll ( getWaveReady ( ) ) ;
callAnnotatedMethod ( OnRelease . class ) ; if ( localFacade ( ) != null ) { localFacade ( ) . unregister ( key ( ) ) ; } // thisObject . ready = false ;
// Shall also release all InnerComponent
if ( getInnerComponentMap ( ) . isPrese... |
public class Sets { /** * This method finds the union of set A and set B
* @ param setA set A
* @ param setB set B
* @ param < T > type
* @ return a new set containing the union */
public static < T > Set < T > union ( Set < T > setA , Set < T > setB ) { } } | Set < T > union = new HashSet < T > ( setA ) ; union . addAll ( setB ) ; return union ; |
public class TransactionService { /** * Executes a { @ link Transaction } with token for the given amount in the given currency .
* @ param token
* Token generated by PAYMILL Bridge , which represents a credit card or direct debit .
* @ param amount
* Amount ( in cents ) which will be charged .
* @ param curr... | return this . createWithTokenAndFee ( token , amount , currency , description , null ) ; |
public class Facebook { /** * Set the OAuth 2.0 access token for API access .
* This method is deprecated . See { @ link Facebook } and { @ link Session } for more info .
* @ param token
* - access token */
@ Deprecated public void setAccessToken ( String token ) { } } | checkUserSession ( "setAccessToken" ) ; synchronized ( this . lock ) { accessToken = token ; lastAccessUpdateMillisecondsAfterEpoch = System . currentTimeMillis ( ) ; sessionInvalidated = true ; } |
public class Wrapper { /** * 包装字段名 < br >
* 有时字段与SQL的某些关键字冲突 , 导致SQL出错 , 因此需要将字段名用单引号或者反引号包装起来 , 避免冲突
* @ param fields 字段名
* @ return 包装后的字段名 */
public String [ ] wrap ( String ... fields ) { } } | if ( ArrayUtil . isEmpty ( fields ) ) { return fields ; } String [ ] wrappedFields = new String [ fields . length ] ; for ( int i = 0 ; i < fields . length ; i ++ ) { wrappedFields [ i ] = wrap ( fields [ i ] ) ; } return wrappedFields ; |
public class ScenarioModelHolder { /** * Returns the { @ link com . tngtech . jgiven . report . model . ReportModel } for the given test class .
* If there is no report model yet , creates a new one .
* @ param testClass the test class to get the report model for
* @ return the report model for the given test cla... | synchronized ( reportModels ) { ReportModel reportModel = reportModels . get ( testClass . getCanonicalName ( ) ) ; if ( reportModel == null ) { reportModel = new ReportModel ( ) ; reportModel . setTestClass ( testClass ) ; reportModels . put ( testClass . getCanonicalName ( ) , reportModel ) ; } return reportModel ; } |
public class BitFlipMutation { /** * Perform the mutation operation
* @ param probability Mutation setProbability
* @ param solution The solution to mutate */
public void doMutation ( double probability , BinarySolution solution ) { } } | for ( int i = 0 ; i < solution . getNumberOfVariables ( ) ; i ++ ) { for ( int j = 0 ; j < solution . getVariableValue ( i ) . getBinarySetLength ( ) ; j ++ ) { if ( randomGenerator . getRandomValue ( ) <= probability ) { solution . getVariableValue ( i ) . flip ( j ) ; } } } |
public class ConfigurationPropertiesReportEndpoint { /** * Extract configuration prefix from
* { @ link ConfigurationProperties @ ConfigurationProperties } annotation .
* @ param context the application context
* @ param beanFactoryMetaData the bean factory meta - data
* @ param beanName the bean name
* @ ret... | ConfigurationProperties annotation = context . findAnnotationOnBean ( beanName , ConfigurationProperties . class ) ; if ( beanFactoryMetaData != null ) { ConfigurationProperties override = beanFactoryMetaData . findFactoryAnnotation ( beanName , ConfigurationProperties . class ) ; if ( override != null ) { // The @ Bea... |
public class CPInstancePersistenceImpl { /** * Returns a range of all the cp instances where groupId = & # 63 ; and status = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they ... | return findByG_ST ( groupId , status , start , end , null ) ; |
public class EquirectangularDistortBase_F64 { /** * Specifies the rotation offset from the canonical location using yaw and pitch .
* @ param yaw Radian from - pi to pi
* @ param pitch Radian from - pi / 2 to pi / 2
* @ param roll Radian from - pi to pi */
public void setDirection ( double yaw , double pitch , do... | ConvertRotation3D_F64 . eulerToMatrix ( EulerType . YZX , pitch , yaw , roll , R ) ; |
public class ThrottlingRpcService { /** * Creates a new decorator using the specified { @ link ThrottlingStrategy } instance .
* @ param strategy The { @ link ThrottlingStrategy } instance to be used */
public static Function < Service < RpcRequest , RpcResponse > , ThrottlingRpcService > newDecorator ( ThrottlingStr... | requireNonNull ( strategy , "strategy" ) ; return delegate -> new ThrottlingRpcService ( delegate , strategy ) ; |
public class ReadWriteMultipleResponse { /** * Returns the < tt > Register < / tt > at the given position ( relative to the
* reference used in the request ) .
* @ param index the relative index of the < tt > InputRegister < / tt > .
* @ return the register as < tt > InputRegister < / tt > .
* @ throws IndexOut... | if ( registers == null ) { throw new IndexOutOfBoundsException ( "No registers defined!" ) ; } if ( index < 0 ) { throw new IndexOutOfBoundsException ( "Negative index: " + index ) ; } if ( index >= getWordCount ( ) ) { throw new IndexOutOfBoundsException ( index + " > " + getWordCount ( ) ) ; } return registers [ inde... |
public class GetModelsResult { /** * The current page of elements from this collection .
* @ param items
* The current page of elements from this collection . */
public void setItems ( java . util . Collection < Model > items ) { } } | if ( items == null ) { this . items = null ; return ; } this . items = new java . util . ArrayList < Model > ( items ) ; |
public class MappeableRunContainer { /** * To merge values length from begin ( inclusive ) to end ( inclusive ) */
private void mergeValuesLength ( int begin , int end ) { } } | if ( begin < end ) { int bValue = toIntUnsigned ( getValue ( begin ) ) ; int eValue = toIntUnsigned ( getValue ( end ) ) ; int eLength = toIntUnsigned ( getLength ( end ) ) ; int newLength = eValue - bValue + eLength ; setLength ( begin , ( short ) newLength ) ; recoverRoomsInRange ( begin , end ) ; } |
public class TableColumnManager { /** * Reset the TableColumnManager to only manage the TableColumns that are
* currently visible in the table .
* Generally this method should only be invoked by the TableColumnManager
* when the TableModel of the table is changed . */
public void reset ( ) { } } | table . getColumnModel ( ) . removeColumnModelListener ( this ) ; columnModel = table . getColumnModel ( ) ; columnModel . addColumnModelListener ( this ) ; // Keep a duplicate TableColumns for managing hidden TableColumns
int count = columnModel . getColumnCount ( ) ; allColumns = new ArrayList < > ( count ) ; for ( i... |
public class HttpContext { /** * remove a virtual host alias to this context .
* @ see # setVirtualHosts
* @ param hostname A hostname . A null host name means any hostname is
* acceptable . Host names may String representation of IP addresses . */
public void removeVirtualHost ( String hostname ) { } } | // Note that null hosts are also added .
if ( _vhosts . remove ( hostname ) ) { _contextName = null ; if ( _httpServer != null ) { _httpServer . removeMapping ( hostname , this ) ; if ( _vhosts . size ( ) == 0 ) _httpServer . addMapping ( null , this ) ; } _vhostsArray = null ; } |
public class PlayRecordContext { /** * Defines a key sequence consisting of a command key optionally followed by zero or more keys . This key sequence has the
* following action : terminate the current event and any queued event and return the terminating key sequence to the call
* processing agent .
* < b > No d... | String value = Optional . fromNullable ( getParameter ( SignalParameters . RETURN_KEY . symbol ( ) ) ) . or ( "" ) ; return value . isEmpty ( ) ? ' ' : value . charAt ( 0 ) ; |
public class RuleQueryFactory { /** * Similar to { @ link # createRuleQuery ( DbSession , Request ) } but sets additional fields which are only used
* for the rule search WS . */
public RuleQuery createRuleSearchQuery ( DbSession dbSession , Request request ) { } } | RuleQuery query = createRuleQuery ( dbSession , request ) ; query . setIncludeExternal ( request . mandatoryParamAsBoolean ( PARAM_INCLUDE_EXTERNAL ) ) ; return query ; |
public class AccessCache { /** * Method to initialize the Cache of this CacheObjectInterface . */
public static void initialize ( ) { } } | if ( InfinispanCache . get ( ) . exists ( AccessCache . PERMISSIONCACHE ) ) { InfinispanCache . get ( ) . < UUID , AccessType > getCache ( AccessCache . PERMISSIONCACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < UUID , AccessType > getCache ( AccessCache . PERMISSIONCACHE ) . addListener ( new CacheLogListe... |
public class MapperPlugin { /** * 生成基础实体类
* @ param topLevelClass
* @ param introspectedTable
* @ return */
@ Override public boolean modelBaseRecordClassGenerated ( TopLevelClass topLevelClass , IntrospectedTable introspectedTable ) { } } | processEntityClass ( topLevelClass , introspectedTable ) ; return true ; |
public class DwgUtil { /** * Read a short value from a group of unsigned bytes
* @ param data Array of unsigned bytes obtained from the DWG binary file
* @ param offset The current bit offset where the value begins
* @ throws Exception If an unexpected bit value is found in the DWG file . Occurs
* when we are l... | byte [ ] bytes = ( byte [ ] ) getBits ( data , 16 , offset ) ; ByteBuffer bb = ByteBuffer . wrap ( bytes ) ; bb . order ( ByteOrder . LITTLE_ENDIAN ) ; int val = bb . getShort ( ) ; Vector v = new Vector ( ) ; v . add ( new Integer ( offset + 16 ) ) ; v . add ( new Integer ( val ) ) ; return v ; |
public class Postcard { /** * Inserts a float array value into the mapping of this Bundle , replacing
* any existing value for the given key . Either key or value may be null .
* @ param key a String , or null
* @ param value a float array object , or null
* @ return current */
public Postcard withFloatArray ( ... | mBundle . putFloatArray ( key , value ) ; return this ; |
public class EasyLinearEquation { /** * Most typical factory , for BigInteger arrays .
* @ param inMatrix given in BigIntegers , where the first column is the constant
* and all the other columns are the variables
* @ return instance */
public static EasyLinearEquation create ( BigInteger [ ] [ ] inMatrix ) { } } | EasyLinearEquation ret = null ; final int width = inMatrix [ 0 ] . length ; for ( BigInteger [ ] row : inMatrix ) { if ( width != row . length ) { throw new SecretShareException ( "All rows must be " + width + " wide" ) ; } } List < Row > rows = new ArrayList < Row > ( ) ; for ( BigInteger [ ] row : inMatrix ) { Row ad... |
public class SystemContextBean { @ Override public Object putString ( Scope scope , String key , String value ) { } } | return getScopeMap ( scope ) . put ( key , value ) ; |
public class Utils4J { /** * Returns a relative path based on a base directory . If the < code > dir < / code > is not inside < code > baseDir < / code > an
* < code > IllegalArgumentException < / code > is thrown .
* @ param baseDir
* Base directory the path is relative to - Cannot be < code > null < / code > . ... | checkNotNull ( "baseDir" , baseDir ) ; checkNotNull ( "dir" , dir ) ; final String base = getCanonicalPath ( baseDir ) ; final String path = getCanonicalPath ( dir ) ; if ( ! path . startsWith ( base ) ) { throw new IllegalArgumentException ( "The path '" + path + "' is not inside the base directory '" + base + "'!" ) ... |
public class LockTable { /** * Return the lock which is associated with the specified key . Uses
* < code > hashCode ( ) < / code > to index into the table of locks . Keys
* which hash identically will share a single lock .
* @ param key The key for which the lock is desired */
public Object getLock ( Object key ... | int index = ( key . hashCode ( ) & 0x7FFFFFFF ) % locks . length ; // Double - checked locking . Safe since Object has no state .
Object lock = locks [ index ] ; if ( lock == null ) { synchronized ( this ) { lock = locks [ index ] ; if ( lock == null ) { lock = new Object ( ) ; locks [ index ] = lock ; } } } return loc... |
public class PlainTextStreamParser { /** * Read a single char from an Reader source .
* @ param source the input to read from
* @ return the char read
* @ throws ParseException in case of reading error */
private int readChar ( Reader source ) throws ParseException { } } | int c ; try { c = source . read ( ) ; } catch ( IOException e ) { throw new ParseException ( "Failed to read input source" , e ) ; } return c ; |
public class CmsEditModuleForm { /** * Helper method to get the descendants of a container with a specific widget type . < p >
* @ param container the container
* @ param cls the class
* @ return the list of results */
< T extends Component > List < T > getFormRowChildren ( AbstractComponentContainer container , ... | final List < T > result = Lists . newArrayList ( ) ; CmsVaadinUtils . visitDescendants ( container , new Predicate < Component > ( ) { public boolean apply ( Component comp ) { if ( cls . isAssignableFrom ( comp . getClass ( ) ) ) { result . add ( cls . cast ( comp ) ) ; } return true ; } } ) ; return result ; |
public class AVA { /** * Return true if DerValue can be represented as a String . */
private static boolean isDerString ( DerValue value , boolean canonical ) { } } | if ( canonical ) { switch ( value . tag ) { case DerValue . tag_PrintableString : case DerValue . tag_UTF8String : return true ; default : return false ; } } else { switch ( value . tag ) { case DerValue . tag_PrintableString : case DerValue . tag_T61String : case DerValue . tag_IA5String : case DerValue . tag_GeneralS... |
public class AtlasRegistry { /** * Get a list of all measurements and break them into batches . */
List < List < Measurement > > getBatches ( ) { } } | List < List < Measurement > > batches = new ArrayList < > ( ) ; List < Measurement > ms = getMeasurements ( ) . collect ( Collectors . toList ( ) ) ; for ( int i = 0 ; i < ms . size ( ) ; i += batchSize ) { List < Measurement > batch = ms . subList ( i , Math . min ( ms . size ( ) , i + batchSize ) ) ; batches . add ( ... |
public class DefaultWebElementsFactory { /** * ( non - Javadoc )
* @ see
* minium . web . internal . InternalWebElementsFactory # createMixinWithParent (
* minium . webElements , minium . webElements ) */
@ Override public T createMixin ( final Elements parent , final Elements elems ) { } } | AbstractMixinInitializer initializer = new AbstractMixinInitializer ( ) { @ Override protected void initialize ( ) { implement ( Object . class ) . with ( elems ) ; implement ( HasParent . class ) . with ( new HasParent . Impl ( parent ) ) ; implement ( InternalWebElements . class ) . with ( elems ) ; implement ( Freez... |
public class BrowserController { /** * Actually launch a probe .
* @ return some confirmation string back to the client
* @ throws IOException if there is some transport issues
* @ throws UnsupportedPayloadType shouldn ' t happen as we always ask for JSON
* here
* @ throws ProbeSenderException if something el... | Properties clientProps = getPropeSenderProps ( ) ; String multicastGroupAddr = clientProps . getProperty ( "multicastGroupAddr" , DEFAULT_MULTICAST_GROUP_ADDR ) ; String multicastPortString = clientProps . getProperty ( "multicastPort" , DEFAULT_MULTICAST_PORT . toString ( ) ) ; // String listenerIPAddress = clientProp... |
public class CmsResourceTable { /** * Static helper method to initialize the ' standard ' properties of a data item from a given resource . < p >
* @ param resourceItem the resource item to fill
* @ param cms the CMS context
* @ param resource the resource
* @ param locale the locale */
public static void fillI... | if ( resource == null ) { LOG . error ( "Error rendering item for 'null' resource" ) ; return ; } if ( resourceItem == null ) { LOG . error ( "Error rendering 'null' item for resource " + resource . getRootPath ( ) ) ; return ; } if ( cms == null ) { cms = A_CmsUI . getCmsObject ( ) ; LOG . warn ( "CmsObject was 'null'... |
public class ExceptionTransformer { /** * Transforms the given throwable into an appropriate fetch exception . If
* it already is a fetch exception , it is simply casted .
* @ param e required exception to transform
* @ return FetchException , never null */
public FetchException toFetchException ( Throwable e ) {... | FetchException fe = transformIntoFetchException ( e ) ; if ( fe != null ) { return fe ; } Throwable cause = e . getCause ( ) ; if ( cause != null ) { fe = transformIntoFetchException ( cause ) ; if ( fe != null ) { return fe ; } } else { cause = e ; } return new FetchException ( cause ) ; |
public class MtasSpanRecurrenceSpans { /** * ( non - Javadoc )
* @ see org . apache . lucene . search . DocIdSetIterator # advance ( int ) */
@ Override public int advance ( int target ) throws IOException { } } | resetQueue ( ) ; return ( spans . advance ( target ) == NO_MORE_DOCS ) ? NO_MORE_DOCS : toMatchDoc ( ) ; |
public class JSONWriter { /** * Begin appending a new object . All keys and values until the balancing
* < code > endObject < / code > will be appended to this object . The
* < code > endObject < / code > method must be called to mark the object ' s end .
* @ return this
* @ throws JSONException If the nesting ... | if ( m_mode == 'k' || m_mode == 'd' ) { throw new JSONException ( "Misplaced object." ) ; } push ( m_expectingComma ? ScopeOptions . ObjectWithComma : ScopeOptions . ObjectWithoutComma ) ; return this ; |
public class XPMImage { /** * Gets a tile of the XPM Image .
* @ param x Between 0 and 31.
* @ param y Between 0 and 7.
* @ return An XPM image string defining an 8*8 image . */
public String getTile ( int x , int y ) { } } | if ( ( x > getArrayWidth ( ) ) || ( y > getArrayHeight ( ) ) || ( x < 0 ) || ( y < 0 ) ) { throw new IllegalArgumentException ( ) ; } return image [ x ] [ y ] ; |
public class CommaListIterator { /** * / * ( non - Javadoc )
* @ see java . util . Iterator # hasNext ( ) */
public boolean hasNext ( ) { } } | while ( _list . hasMoreTokens ( ) && ( _current . length ( ) == 0 ) ) { _current = _list . nextToken ( ) ; } return ( _current . length ( ) > 0 ) ; |
public class OptionalIssues { /** * returns whether the set of operations that contributed to the current stack form , are trivial or not , specifically boxing a primitive value , or appending
* to strings or such .
* @ return the operations that caused the current stack to exist are trivial */
private boolean isTr... | int invokeCount = 0 ; for ( ActiveStackOp op : activeStackOps ) { if ( INVOKE_OPS . get ( op . getOpcode ( ) ) ) { invokeCount ++ ; } } if ( invokeCount == 1 ) { FQMethod method = activeStackOps . getLast ( ) . getMethod ( ) ; if ( method == null ) { return false ; } if ( "valueOf" . equals ( method . getMethodName ( )... |
public class CmsCloneModuleThread { /** * Returns < code > true < / code > if form input is selected , checked , on or yes . < p >
* @ param value the value to check
* @ return < code > true < / code > if form input is selected , checked , on or yes */
private boolean isTrue ( String value ) { } } | if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( value ) ) { if ( Boolean . valueOf ( value . toLowerCase ( ) ) . booleanValue ( ) || value . toLowerCase ( ) . equals ( "on" ) || value . toLowerCase ( ) . equals ( "yes" ) || value . toLowerCase ( ) . equals ( "checked" ) || value . toLowerCase ( ) . equals ( "selected... |
public class WorldGroupsManager { /** * Remove a world group . Reverting all the world into this group to the default one .
* @ param group The group to remove . */
public void removeGroup ( String group ) { } } | if ( worldGroupExist ( group ) ) { Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . removeWorldGroup ( group ) ; list . remove ( group ) ; } |
public class CreateDBClusterEndpointRequest { /** * List of DB instance identifiers that are part of the custom endpoint group .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setStaticMembers ( java . util . Collection ) } or { @ link # withStaticMembers ( ... | if ( this . staticMembers == null ) { setStaticMembers ( new com . amazonaws . internal . SdkInternalList < String > ( staticMembers . length ) ) ; } for ( String ele : staticMembers ) { this . staticMembers . add ( ele ) ; } return this ; |
public class CmsCmisService { /** * Gets the repository for a given repository id . < p >
* @ param repositoryId the repository id
* @ return the repository with the given id */
protected I_CmsCmisRepository getRepository ( String repositoryId ) { } } | I_CmsCmisRepository result = OpenCms . getRepositoryManager ( ) . getRepository ( repositoryId , I_CmsCmisRepository . class ) ; if ( result == null ) { throw new CmisConnectionException ( "missing repository: " + repositoryId ) ; } return result ; |
public class CommonOps_DDF4 { /** * Performs an in - place element by element scalar division . Scalar denominator . < br >
* < br >
* a < sub > i < / sub > = a < sub > i < / sub > / & alpha ;
* @ param a The vector whose elements are to be divided . Modified .
* @ param alpha the amount each element is divided... | a . a1 /= alpha ; a . a2 /= alpha ; a . a3 /= alpha ; a . a4 /= alpha ; |
public class ConfigRestClientUtil { /** * 发送es restful sql请求 / _ xpack / sql , 获取返回值 , 返回值类型由beanType决定
* @ param beanType
* @ param templateName
* @ param < T >
* @ return
* @ throws ElasticSearchException */
public < T > List < T > sql ( Class < T > beanType , String templateName , Map params ) throws Elast... | SQLRestResponse result = this . client . executeRequest ( "/_xpack/sql" , ESTemplateHelper . evalTemplate ( esUtil , templateName , params ) , new SQLRestResponseHandler ( ) ) ; return ResultUtil . buildSQLResult ( result , beanType ) ; |
public class DeclarationMap { /** * Adds a declaration for a specified list . If the list does not exist yet , it is created .
* @ param el the element that the declaration belongs to
* @ param pseudo an optional pseudo - element or null
* @ param decl the new declaration */
public void addDeclaration ( Element e... | List < Declaration > list = getOrCreate ( el , pseudo ) ; list . add ( decl ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.