signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class FJIterate { /** * Same effect as { @ link Iterate # groupBy ( Iterable , Function ) } ,
* but executed in parallel batches , and writing output into a SynchronizedPutFastListMultimap . */
public static < K , V , R extends MutableMultimap < K , V > > MutableMultimap < K , V > groupBy ( Iterable < V > iter... | return FJIterate . groupBy ( iterable , function , concurrentMultimap , FJIterate . DEFAULT_MIN_FORK_SIZE ) ; |
public class ClassDescriptor { /** * add an Extent class to the current descriptor
* @ param newExtentClassName name of the class to add */
public void addExtentClass ( String newExtentClassName ) { } } | extentClassNames . add ( newExtentClassName ) ; if ( m_repository != null ) m_repository . addExtent ( newExtentClassName , this ) ; |
public class GedDocumentMongoToGedObjectConverterVisitor { /** * { @ inheritDoc } */
@ Override public void visit ( final RootDocumentMongo document ) { } } | final Root root = new Root ( "Root" ) ; root . setFilename ( document . getFilename ( ) ) ; root . setDbName ( document . getDbName ( ) ) ; setGedObject ( root ) ; |
public class AbstractParamContainerPanel { /** * This method initializes jPanel1
* @ return javax . swing . JPanel */
private JPanel getJPanel1 ( ) { } } | if ( jPanel1 == null ) { jPanel1 = new JPanel ( ) ; jPanel1 . setLayout ( new CardLayout ( ) ) ; jPanel1 . setBorder ( javax . swing . BorderFactory . createEmptyBorder ( 0 , 0 , 0 , 0 ) ) ; jPanel1 . add ( getJScrollPane1 ( ) , getJScrollPane1 ( ) . getName ( ) ) ; } return jPanel1 ; |
public class FilePublisher { /** * Unregisters all instances of fileSubscriber found .
* @ param fileSubscriber the fileSubscriber to unregister */
public void unregister ( FileSubscriber fileSubscriber ) { } } | for ( IdentificationSet < FileSubscriber > subList : fileSubscribers . values ( ) ) { subList . remove ( fileSubscriber ) ; } defaultFileSubscribers . remove ( fileSubscriber ) ; |
public class QueryColumnImpl { /** * touch the given line on the column at given row
* @ param row
* @ return new row or existing
* @ throws DatabaseException */
public Object touch ( int row ) { } } | if ( row < 1 || row > size ) return NullSupportHelper . full ( ) ? null : "" ; Object o = data [ row - 1 ] ; if ( o != null ) return o ; return setEL ( row , new StructImpl ( ) ) ; |
public class SimpleDateFormat { /** * Override readObject .
* See http : / / docs . oracle . com / javase / 6 / docs / api / java / io / ObjectInputStream . html */
private void readObject ( ObjectInputStream stream ) throws IOException , ClassNotFoundException { } } | stream . defaultReadObject ( ) ; int capitalizationSettingValue = ( serialVersionOnStream > 1 ) ? stream . readInt ( ) : - 1 ; // / CLOVER : OFF
// don ' t have old serial data to test with
if ( serialVersionOnStream < 1 ) { // didn ' t have defaultCenturyStart field
defaultCenturyBase = System . currentTimeMillis ( ) ... |
public class SSHLauncher { /** * Called to terminate the SSH connection . Used liberally when we back out from an error . */
private void cleanupConnection ( TaskListener listener ) { } } | // we might be called multiple times from multiple finally / catch block ,
if ( connection != null ) { connection . close ( ) ; connection = null ; listener . getLogger ( ) . println ( Messages . SSHLauncher_ConnectionClosed ( getTimestamp ( ) ) ) ; } |
public class IndexingConfiguration { /** * Check if the indexes can be shared . Currently only " ram " based indexes don ' t allow any sort of
* sharing .
* @ return false if the index is ram only and thus not shared */
public boolean indexShareable ( ) { } } | TypedProperties properties = properties ( ) ; boolean hasRamDirectoryProvider = false ; for ( Object objKey : properties . keySet ( ) ) { String key = ( String ) objKey ; if ( key . endsWith ( DIRECTORY_PROVIDER_KEY ) ) { String directoryImplementationName = String . valueOf ( properties . get ( key ) ) . trim ( ) ; if... |
public class EnvironmentsInner { /** * List environments in a given environment setting .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; Environ... | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < EnvironmentInner > > , Page < EnvironmentInner > > ( ) { @ Override public Page < EnvironmentInner > call ( ServiceResponse < Page < EnvironmentInner > > response ) { return response . body ( ) ; } } ) ; |
public class RestClient { /** * Returns the contents of an attachment
* @ param assetId
* The ID of the asset owning the attachment
* @ param attachmentId
* The ID of the attachment
* @ return The input stream for the attachment
* @ throws IOException
* @ throws RequestFailureException */
@ Override publi... | // accept license for type CONTENT
HttpURLConnection connection ; if ( attachment . getType ( ) == AttachmentType . CONTENT ) { connection = createHttpURLConnection ( attachment . getUrl ( ) + "?license=agree" ) ; } else { connection = createHttpURLConnection ( attachment . getUrl ( ) ) ; } // If the attachment was a l... |
public class NavMeshQuery { /** * Gets the path leading to the specified end node . */
private List < Long > getPathToNode ( Node endNode ) { } } | List < Long > path = new ArrayList < > ( ) ; // Reverse the path .
Node curNode = endNode ; do { path . add ( 0 , curNode . id ) ; curNode = m_nodePool . getNodeAtIdx ( curNode . pidx ) ; } while ( curNode != null ) ; return path ; |
public class ChannelWrapper { /** * Initialize a digest on this channel .
* @ param algorithm the digest algorithm to use in computing the hash
* @ return reference to the new key added to the consumers
* @ throws NoSuchAlgorithmException if the given algorithm does not exist */
public Key < byte [ ] > start ( fi... | final MessageDigest digest = MessageDigest . getInstance ( algorithm ) ; final Key < byte [ ] > object = new Key < byte [ ] > ( ) ; consumers . put ( object , new Consumer < byte [ ] > ( ) { public void consume ( final ByteBuffer buffer ) { try { digest . update ( buffer ) ; } catch ( Exception e ) { throw new RuntimeE... |
public class CommerceOrderNotePersistenceImpl { /** * Returns the commerce order note with the primary key or returns < code > null < / code > if it could not be found .
* @ param primaryKey the primary key of the commerce order note
* @ return the commerce order note , or < code > null < / code > if a commerce ord... | Serializable serializable = entityCache . getResult ( CommerceOrderNoteModelImpl . ENTITY_CACHE_ENABLED , CommerceOrderNoteImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CommerceOrderNote commerceOrderNote = ( CommerceOrderNote ) serializable ; if ( commerceOrderNote == null ) { Sessio... |
public class GrailsClassUtils { /** * Checks to see if a class is marked with @ grails . artefact . Enhanced and if the enhancedFor
* attribute of the annotation contains a specific feature name
* @ param controllerClass The class to inspect
* @ param featureName The name of a feature to check for
* @ return tr... | boolean hasBeenEnhanced = false ; final Enhanced enhancedAnnotation = controllerClass . getAnnotation ( Enhanced . class ) ; if ( enhancedAnnotation != null ) { final String [ ] enhancedFor = enhancedAnnotation . enhancedFor ( ) ; if ( enhancedFor != null ) { hasBeenEnhanced = GrailsArrayUtils . contains ( enhancedFor ... |
public class VirtualMachineScaleSetExtensionsInner { /** * The operation to create or update an extension .
* @ param resourceGroupName The name of the resource group .
* @ param vmScaleSetName The name of the VM scale set where the extension should be create or updated .
* @ param vmssExtensionName The name of t... | return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , vmssExtensionName , extensionParameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class FaceDetail { /** * The emotions detected on the face , and the confidence level in the determination . For example , HAPPY , SAD , and
* ANGRY .
* @ param emotions
* The emotions detected on the face , and the confidence level in the determination . For example , HAPPY , SAD ,
* and ANGRY . */
publ... | if ( emotions == null ) { this . emotions = null ; return ; } this . emotions = new java . util . ArrayList < Emotion > ( emotions ) ; |
public class ActionSupport { /** * 获得action消息 < br > */
public final List < String > getActionMessages ( ) { } } | Flash flash = getFlash ( ) ; ActionMessages messages = ( ActionMessages ) flash . get ( Flash . MESSAGES ) ; if ( null == messages ) return Collections . emptyList ( ) ; else return messages . getMessages ( ) ; |
public class CouchbaseManager { /** * Creates a { @ link Pair } containing a { @ link PasswordAuthenticator } and a { @ link List } of ( cluster ) nodes from configuration properties or a URI
* This method verifies if the variable hostOrKey has " couchbase " as a scheme if not then it consider hostOrKey as a configur... | // Check if hostOrKey is really a host , if it ' s a host , then we let only one host ! !
URI singleHostURI = checkAndGetURI ( hostOrKey ) ; // No scheme defined so it ' s considered a configuration key
if ( singleHostURI == null || singleHostURI . getScheme ( ) == null ) { return getConnectionObjectsFromConfigurationK... |
public class ExcelDataProviderImpl { /** * This method fetches a specific row from an excel sheet which can be identified using a key and returns the data
* as an Object which can be cast back into the user ' s actual data type .
* @ param userObj
* An Object into which data is to be packed into
* @ param key
... | logger . entering ( new Object [ ] { userObj , key , isExternalCall } ) ; Class < ? > cls ; try { cls = Class . forName ( userObj . getClass ( ) . getName ( ) ) ; } catch ( ClassNotFoundException e ) { throw new DataProviderException ( "Unable to find class of type + '" + userObj . getClass ( ) . getName ( ) + "'" , e ... |
public class Types { /** * Get the simple name of a possibly nested { @ link Class } .
* @ param type
* @ param separator
* @ return String */
public static String getSimpleName ( Class < ? > type , String separator ) { } } | final StringBuilder buf = new StringBuilder ( ) ; Class < ? > c = type ; while ( c != null ) { if ( buf . length ( ) > 0 && separator != null ) { buf . insert ( 0 , separator ) ; } buf . insert ( 0 , c . getSimpleName ( ) ) ; c = c . getEnclosingClass ( ) ; } return buf . toString ( ) ; |
public class IntegerRadixSortExperimental { /** * From https : / / github . com / gorset / radix / blob / master / Radix . java */
public static void sort ( final int [ ] array , int offset , int end , int shift , final Queue < Future < ? > > futures ) { } } | final int BITS_PER_PASS ; if ( ENABLE_CONCURRENCY && ( shift + R_BITS_PER_PASS ) == 32 ) { BITS_PER_PASS = FIRST_BITS_PER_PASS ; } else { BITS_PER_PASS = R_BITS_PER_PASS ; } final int PASS_SIZE = 1 << BITS_PER_PASS ; final int PASS_MASK = PASS_SIZE - 1 ; int [ ] last = new int [ PASS_SIZE ] ; final int [ ] pointer = ne... |
public class HFClient { /** * Create a new orderer .
* @ param name name of Orderer .
* @ param grpcURL url location of orderer grpc or grpcs protocol .
* @ param properties < p >
* Supported properties
* < ul >
* < li > pemFile - File location for x509 pem certificate for SSL . < / li >
* < li > pemBytes... | clientCheck ( ) ; return Orderer . createNewInstance ( name , grpcURL , properties ) ; |
public class JwtAccessTokenConverter { /** * Get the verification key for the token signatures .
* @ return the key used to verify tokens */
public Map < String , String > getKey ( ) { } } | Map < String , String > result = new LinkedHashMap < String , String > ( ) ; result . put ( "alg" , signer . algorithm ( ) ) ; result . put ( "value" , verifierKey ) ; return result ; |
public class Option { /** * If the option requires access to a port , then this DB security group allows access to the port .
* @ return If the option requires access to a port , then this DB security group allows access to the port . */
public java . util . List < DBSecurityGroupMembership > getDBSecurityGroupMember... | if ( dBSecurityGroupMemberships == null ) { dBSecurityGroupMemberships = new com . amazonaws . internal . SdkInternalList < DBSecurityGroupMembership > ( ) ; } return dBSecurityGroupMemberships ; |
public class FaxServiceImp { /** * ( non - Javadoc )
* @ see com . popbill . api . FaxService # cancelReserveRN ( java . lang . String , java . lang . String ) */
@ Override public Response cancelReserveRN ( String corpNum , String requestNum ) throws PopbillException { } } | return cancelReserveRN ( corpNum , requestNum , null ) ; |
public class RestXPathProcessor { /** * Getting part of the XML based on a XPath query
* @ param resourceName
* where the content should be extracted
* @ param query
* contains XPath query
* @ param rId
* To response the resource with a restid for each node ( < code > true < / code > ) or without (
* < co... | // work around because of query root char ' / '
String qQuery = query ; if ( query . charAt ( 0 ) == '/' ) qQuery = "." . concat ( query ) ; ISession session = null ; INodeReadTrx rtx = null ; try { if ( mDatabase . existsResource ( resourceName ) ) { session = mDatabase . getSession ( new SessionConfiguration ( resour... |
public class ArgUtils { /** * 値がnullでないかどうか検証する 。
* @ param arg 検証対象の値
* @ param name 検証対象の引数の名前
* @ throws IllegalArgumentException { @ literal arg = = null . } */
public static void notNull ( final Object arg , final String name ) { } } | if ( arg == null ) { throw new IllegalArgumentException ( String . format ( "%s should not be null." , name ) ) ; } |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcRelFlowControlElements ( ) { } } | if ( ifcRelFlowControlElementsEClass == null ) { ifcRelFlowControlElementsEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 474 ) ; } return ifcRelFlowControlElementsEClass ; |
public class ImageVerifyCode { /** * 得到验证码byte array
* @ param width
* @ param high
* @ param verifyCode
* @ return
* @ throws IOException */
public static byte [ ] encode2ByteArray ( int width , int high , String verifyCode ) throws IOException { } } | width = width < 1 ? defaultWidth : width ; high = high < 1 ? defaultHigh : high ; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; outputImage ( width , high , byteArrayOutputStream , verifyCode ) ; return byteArrayOutputStream . toByteArray ( ) ; |
public class lbvserver { /** * Use this API to fetch lbvserver resource of given name . */
public static lbvserver get ( nitro_service service , String name ) throws Exception { } } | lbvserver obj = new lbvserver ( ) ; obj . set_name ( name ) ; lbvserver response = ( lbvserver ) obj . get_resource ( service ) ; return response ; |
public class EpollDatagramChannelConfig { /** * If { @ code true } is used < a href = " http : / / man7 . org / linux / man - pages / man7 / ip . 7 . html " > IP _ FREEBIND < / a > is enabled ,
* { @ code false } for disable it . Default is disabled . */
public EpollDatagramChannelConfig setFreeBind ( boolean freeBin... | try { ( ( EpollDatagramChannel ) channel ) . socket . setIpFreeBind ( freeBind ) ; return this ; } catch ( IOException e ) { throw new ChannelException ( e ) ; } |
public class TransactionalProtocolHandlers { /** * Execute blocking for a prepared result .
* @ param operation the operation to execute
* @ param client the protocol client
* @ return the prepared operation
* @ throws IOException
* @ throws InterruptedException */
public static TransactionalProtocolClient . ... | final BlockingQueueOperationListener < TransactionalProtocolClient . Operation > listener = new BlockingQueueOperationListener < > ( ) ; client . execute ( listener , operation , OperationMessageHandler . DISCARD , OperationAttachments . EMPTY ) ; return listener . retrievePreparedOperation ( ) ; |
public class GrokParser { /** * Parses the given XML stream and returns the contained assembly data .
* @ param inputStream an InputStream containing assembly data
* @ return the assembly data
* @ throws GrokParseException thrown if the XML cannot be parsed */
public AssemblyData parse ( InputStream inputStream )... | try ( InputStream schema = FileUtils . getResourceAsStream ( GROK_SCHEMA ) ) { final GrokHandler handler = new GrokHandler ( ) ; final SAXParser saxParser = XmlUtils . buildSecureSaxParser ( schema ) ; final XMLReader xmlReader = saxParser . getXMLReader ( ) ; xmlReader . setErrorHandler ( new GrokErrorHandler ( ) ) ; ... |
public class PtrFrameLayout { /** * please DO REMEMBER resume the hook
* @ param hook */
public void setRefreshCompleteHook ( PtrUIHandlerHook hook ) { } } | mRefreshCompleteHook = hook ; hook . setResumeAction ( new Runnable ( ) { @ Override public void run ( ) { if ( DEBUG ) { PtrCLog . d ( LOG_TAG , "mRefreshCompleteHook resume." ) ; } notifyUIRefreshComplete ( true ) ; } } ) ; |
public class AmazonTranscribeClient { /** * Returns information about a transcription job . To see the status of the job , check the
* < code > TranscriptionJobStatus < / code > field . If the status is < code > COMPLETED < / code > , the job is finished and you
* can find the results at the location specified in t... | request = beforeClientExecution ( request ) ; return executeGetTranscriptionJob ( request ) ; |
public class CPDefinitionPersistenceImpl { /** * Removes all the cp definitions where groupId = & # 63 ; from the database .
* @ param groupId the group ID */
@ Override public void removeByGroupId ( long groupId ) { } } | for ( CPDefinition cpDefinition : findByGroupId ( groupId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpDefinition ) ; } |
public class AmazonECSClient { /** * Create or update an attribute on an Amazon ECS resource . If the attribute does not exist , it is created . If the
* attribute exists , its value is replaced with the specified value . To delete an attribute , use
* < a > DeleteAttributes < / a > . For more information , see < a... | request = beforeClientExecution ( request ) ; return executePutAttributes ( request ) ; |
public class PreparedDeleteCollectionOfObjects { /** * Creates { @ link io . reactivex . Flowable } which will perform Delete Operation and send result to observer .
* Returned { @ link io . reactivex . Flowable } will be " Cold Flowable " , which means that it performs
* delete only after subscribing to it . Also ... | return RxJavaUtils . createFlowable ( storIOSQLite , this , backpressureStrategy ) ; |
public class AbstractSimon { /** * Adds child to this Simon with setting the parent of the child .
* @ param simon future child of this Simon */
final void addChild ( AbstractSimon simon ) { } } | children . add ( simon ) ; simon . setParent ( this ) ; simon . enabled = enabled ; |
public class PseudoWordDependencyContextExtractor { /** * { @ inheritDoc } */
public void processDocument ( BufferedReader document , Wordsi wordsi ) { } } | try { // Handle the context header , if one exists . Context headers are
// assumed to be the first line in a document and to contain an
// integer specifying which line the focus word is on . .
String contextHeader = handleContextHeader ( document ) ; String [ ] contextTokens = contextHeader . split ( "\\s+" ) ; int f... |
public class JacksonConfiguration { /** * Sets the object mapper features to use .
* @ param mapper The object mapper features */
public void setMapper ( Map < MapperFeature , Boolean > mapper ) { } } | if ( CollectionUtils . isNotEmpty ( mapper ) ) { this . mapper = mapper ; } |
public class PDFDomTree { /** * Generate the global CSS style for the whole document .
* @ return the CSS code used in the generated document header */
protected String createGlobalStyle ( ) { } } | StringBuilder ret = new StringBuilder ( ) ; ret . append ( createFontFaces ( ) ) ; ret . append ( "\n" ) ; ret . append ( defaultStyle ) ; return ret . toString ( ) ; |
public class ActionHandler { /** * 抽取出该方法是为了缩短 handle 方法中的代码量 , 确保获得 JIT 优化 ,
* 方法长度超过 8000 个字节码时 , 将不会被 JIT 编译成二进制码
* 通过开启 java 的 - XX : + PrintCompilation 启动参数得知 , handle ( . . . )
* 方法 ( 73 行代码 ) 已被 JIT 优化 , 优化后的字节码长度为 593 个字节 , 相当于
* 每行代码产生 8.123 个字节 */
private void handleActionException ( String target , H... | int errorCode = e . getErrorCode ( ) ; String msg = null ; if ( errorCode == 404 ) { msg = "404 Not Found: " ; } else if ( errorCode == 400 ) { msg = "400 Bad Request: " ; } else if ( errorCode == 401 ) { msg = "401 Unauthorized: " ; } else if ( errorCode == 403 ) { msg = "403 Forbidden: " ; } if ( msg != null ) { if (... |
public class QueryService { /** * Helper function to return a specification for filtering on one - to - many or many - to - many reference . Usage :
* < pre >
* Specification & lt ; Employee & gt ; specByEmployeeId = buildReferringEntitySpecification ( criteria . getEmployeId ( ) ,
* Project _ . employees , Emplo... | if ( filter . getEquals ( ) != null ) { return equalsSetSpecification ( reference , valueField , filter . getEquals ( ) ) ; } else if ( filter . getSpecified ( ) != null ) { return byFieldSpecified ( reference , filter . getSpecified ( ) ) ; } return null ; |
public class XMLConfigurationProvider { /** * This method will find all the parameters under this
* < code > paramsElement < / code > and return them as Map < String , String > . For
* example ,
* < pre >
* < result . . . >
* < param name = " param1 " > value1 < / param >
* < param name = " param2 " > value... | LinkedHashMap < String , Object > params = new LinkedHashMap < String , Object > ( ) ; if ( paramsElement == null ) { return params ; } NodeList childNodes = paramsElement . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { Node childNode = childNodes . item ( i ) ; if ( ( childNode . getN... |
public class SpiderSession { /** * Get the object with the given ID from the given table . Null is returned if there is
* no such object .
* @ param tableName Name of table to get object from . It must belong to this
* session ' s application .
* @ param objectID Object ' s ID .
* @ return { @ link DBObject }... | Utils . require ( ! Utils . isEmpty ( tableName ) , "tableName" ) ; Utils . require ( ! Utils . isEmpty ( objectID ) , "objectID" ) ; TableDefinition tableDef = m_appDef . getTableDef ( tableName ) ; Utils . require ( tableDef != null , "Unknown table for application '%s': %s" , m_appDef . getAppName ( ) , tableName ) ... |
public class MoneyAmountStyle { /** * Returns a copy of this style with the specified absolute value setting .
* If this is set to true , the absolute ( unsigned ) value will be output .
* If this is set to false , the signed value will be output .
* Note that when parsing , signs are accepted .
* @ param absVa... | if ( this . absValue == absValue ) { return this ; } return new MoneyAmountStyle ( zeroCharacter , positiveCharacter , negativeCharacter , decimalPointCharacter , groupingStyle , groupingCharacter , groupingSize , extendedGroupingSize , forceDecimalPoint , absValue ) ; |
public class AbstractConcept { /** * Default { @ link Comparable # compareTo ( Object ) } implementation that calls
* { @ link # compareToWhenHashCodesEqual ( AbstractConcept ) } if and only if the
* { @ link # hashCode ( ) } values of { @ code this } and { @ code other } are equal .
* @ return a negative integer... | // Need to sort by concrete subclass first , and then by object hashCode
final int meta = getClass ( ) . hashCode ( ) - other . getClass ( ) . hashCode ( ) ; final int quickCompare = hashCode ( ) - other . hashCode ( ) ; int result = 0 == meta ? ( 0 == quickCompare ? compareToWhenHashCodesEqual ( other ) : quickCompare... |
public class VFS { /** * Create and mount a temporary file system , returning a single handle which will unmount and close the filesystem
* when closed .
* @ param mountPoint the point at which the filesystem should be mounted
* @ param tempFileProvider the temporary file provider
* @ return a handle
* @ thro... | boolean ok = false ; final TempDir tempDir = tempFileProvider . createTempDir ( "tmpfs" ) ; try { final MountHandle handle = doMount ( new RealFileSystem ( tempDir . getRoot ( ) ) , mountPoint , tempDir ) ; ok = true ; return handle ; } finally { if ( ! ok ) { VFSUtils . safeClose ( tempDir ) ; } } |
public class WTree { /** * Return the item ids that have been expanded .
* Note - Only used for when the tree is in LAZY mode
* @ return the previously expanded item ids */
protected Set < String > getPrevExpandedRows ( ) { } } | Set < String > prev = getComponentModel ( ) . prevExpandedRows ; if ( prev == null ) { return Collections . emptySet ( ) ; } else { return Collections . unmodifiableSet ( prev ) ; } |
public class ZoneRegion { /** * Obtains an instance of { @ code ZoneId } from an identifier .
* @ param zoneId the time - zone ID , not null
* @ param checkAvailable whether to check if the zone ID is available
* @ return the zone ID , not null
* @ throws DateTimeException if the ID format is invalid
* @ thro... | Jdk8Methods . requireNonNull ( zoneId , "zoneId" ) ; if ( zoneId . length ( ) < 2 || PATTERN . matcher ( zoneId ) . matches ( ) == false ) { throw new DateTimeException ( "Invalid ID for region-based ZoneId, invalid format: " + zoneId ) ; } ZoneRules rules = null ; try { // always attempt load for better behavior after... |
public class ExternalContextUtils { /** * Returns the name of the underlying context or < code > null < / code > if something
* went wrong in trying to retrieve the context .
* @ param ec the current external context
* @ return a String containing the context name */
public static String getContextName ( External... | try { if ( isPortlet ( ec ) ) { return ( String ) _runMethod ( ec . getContext ( ) , "getPortletContextName" ) ; } else { return ( ( ServletContext ) ec . getContext ( ) ) . getServletContextName ( ) ; } } catch ( final ClassCastException e ) { _LOG . severe ( e . getMessage ( ) ) ; } return null ; |
public class StandardSubjectBuilder { /** * Triggers the failure strategy with the given failure message */
public final void fail ( @ NullableDecl String format , Object /* @ NullableDeclType */
... args ) { } } | doFail ( lenientFormat ( format , args ) ) ; |
public class GrowingSparseMatrix { /** * Returns a { @ link DoubleVector } of the contents of the column .
* @ param column { @ inheritDoc }
* @ return { @ inheritDoc } */
public SparseDoubleVector getColumnVector ( int column ) { } } | SparseDoubleVector values = new SparseHashDoubleVector ( rows ) ; for ( int row = 0 ; row < rows ; ++ row ) { double d = get ( row , column ) ; if ( d != 0 ) values . set ( row , d ) ; } return values ; |
public class CPInstanceLocalServiceUtil { /** * Returns the cp instance matching the UUID and group .
* @ param uuid the cp instance ' s UUID
* @ param groupId the primary key of the group
* @ return the matching cp instance , or < code > null < / code > if a matching cp instance could not be found */
public stat... | return getService ( ) . fetchCPInstanceByUuidAndGroupId ( uuid , groupId ) ; |
public class ByteBuf { /** * Returns a { @ code String } created from this { @ code ByteBuf } using given charset .
* Does not recycle this { @ code ByteBuf } .
* @ param charset charset which is used to create { @ code String } from this { @ code ByteBuf } .
* @ return { @ code String } from this { @ code ByteBu... | return new String ( array , head , readRemaining ( ) , charset ) ; |
public class ArticleConsumerLogMessages { /** * Logs the status of the article consumer .
* @ param logger
* reference to the logger
* @ param articleReader
* reference to the ArticleReader
* @ param startTime
* start time
* @ param sleepingTime
* time the consumer has slept
* @ param workingTime
* ... | String message = "Consumer-Status-Report [" + Time . toClock ( System . currentTimeMillis ( ) - startTime ) + "]" ; if ( articleReader != null ) { message += "\tPOSITION <" + articleReader . getBytePosition ( ) + ">" ; } message += "\tEFFICIENCY\t " + MathUtilities . percentPlus ( workingTime , sleepingTime ) + "\tWORK... |
public class EasyRandomParameters { /** * Set the date range .
* @ param min date
* @ param max date
* @ return the current { @ link EasyRandomParameters } instance for method chaining */
public EasyRandomParameters dateRange ( final LocalDate min , final LocalDate max ) { } } | if ( min . isAfter ( max ) ) { throw new IllegalArgumentException ( "Min date should be before max date" ) ; } setDateRange ( new Range < > ( min , max ) ) ; return this ; |
public class DefaultExceptionContext { /** * { @ inheritDoc } */
@ Override public Object getFirstContextValue ( final String label ) { } } | for ( final Pair < String , Object > pair : contextValues ) { if ( StringUtils . equals ( label , pair . getKey ( ) ) ) { return pair . getValue ( ) ; } } return null ; |
public class CHFWBundle { /** * Access the scheduled event service .
* @ return ScheduledEventService - null if not found */
public static ScheduledEventService getScheduleService ( ) { } } | CHFWBundle c = instance . get ( ) . get ( ) ; if ( null != c ) { return c . scheduler ; } return null ; |
public class StorePackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getRevisionSummary ( ) { } } | if ( revisionSummaryEClass == null ) { revisionSummaryEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 32 ) ; } return revisionSummaryEClass ; |
public class PutObjectUiProgressBar { /** * uploadFile ( fileName ) uploads to configured object storage upon reading
* a local file , while asynchronously updating the progress bar UI
* as well . This function is involed when user clicks on the UI */
private void uploadFile ( String fileName ) throws IOException ,... | /* play . min . io for test and development . */
MinioClient minioClient = new MinioClient ( "https://play.min.io:9000" , "Q3AM3UQ867SPQQA43P2F" , "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" ) ; /* Amazon S3: */
// MinioClient minioClient = new MinioClient ( " https : / / s3 . amazonaws . com " ,
// " YOUR - ACCESSKEYID... |
public class EbeanExprInvoker { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override protected Val < Expression > expr ( String field , String op , Val < Expression > [ ] args , QueryExprMeta parent ) { } } | Iterable < ExprTransformer > transformers = getTransformer ( ExprTransformer . class ) ; for ( ExprTransformer < Expression , EbeanExprInvoker > transformer : transformers ) { Transformed < Val < Expression > > transformed = transformer . transform ( field , op , args , this , parent ) ; if ( transformed . success ( ) ... |
public class ExpectedConditions { /** * An expectation for checking WebElement with given locator has attribute with a specific value
* @ param locator used to find the element
* @ param attribute used to define css or html attribute
* @ param value used as expected attribute value
* @ return Boolean true when ... | return new ExpectedCondition < Boolean > ( ) { private String currentValue = null ; @ Override public Boolean apply ( WebDriver driver ) { WebElement element = driver . findElement ( locator ) ; currentValue = element . getAttribute ( attribute ) ; if ( currentValue == null || currentValue . isEmpty ( ) ) { currentValu... |
public class SqlParserImpl { /** * バインド変数解析 */
protected void parseBindVariable ( ) { } } | String expr = tokenizer . getToken ( ) ; peek ( ) . addChild ( new BindVariableNode ( this . position , expr , null , outputBindComment ) ) ; this . position = this . tokenizer . getPosition ( ) ; |
public class SessionManager { /** * Get a map of pool infos to average wait times for first
* resource of a resource type .
* @ param type Resource type
* @ return Map of pools into average first resource time */
public Map < PoolInfo , Long > getTypePoolInfoAveFirstWaitMs ( ResourceType type ) { } } | Map < PoolInfo , WaitCount > poolInfoWaitCount = new HashMap < PoolInfo , WaitCount > ( ) ; for ( Session session : sessions . values ( ) ) { synchronized ( session ) { if ( ! session . isDeleted ( ) ) { Long wait = session . getTypeFirstWaitMs ( type ) ; if ( wait == null ) { continue ; } WaitCount waitCount = poolInf... |
public class DataFactory { /** * Returns a string containing a set of numbers with a fixed number of digits
* @ param digits number of digits in the final number
* @ return Random number as a string with a fixed length */
public String getNumberText ( final int digits ) { } } | String result = "" ; for ( int i = 0 ; i < digits ; i ++ ) { result = result + random . nextInt ( 10 ) ; } return result ; |
public class DataProvider { /** * Build cache key
* @ param keys Entity keys
* @ return Cache key */
final long buildHashCode ( Object ... keys ) { } } | ArrayList < Object > keyList = new ArrayList < > ( ) ; Collections . addAll ( keyList , keys ) ; return buildHashCode ( keyList ) ; |
public class StripeJsonUtils { /** * Calls through to { @ link JSONObject # optInt ( String ) } only in the case that the
* key exists . This returns { @ code null } if the key is not in the object .
* @ param jsonObject the input object
* @ param fieldName the required field name
* @ return the value stored in... | if ( ! jsonObject . has ( fieldName ) ) { return null ; } return jsonObject . optInt ( fieldName ) ; |
public class GalaxyProperties { /** * Determines if this is a pre - 2014.10.06 release of Galaxy .
* @ param galaxyRoot The root directory of Galaxy .
* @ return True if this is a pre - 2014.10.06 release of Galaxy , false otherwise . */
public boolean isPre20141006Release ( File galaxyRoot ) { } } | if ( galaxyRoot == null ) { throw new IllegalArgumentException ( "galaxyRoot is null" ) ; } else if ( ! galaxyRoot . exists ( ) ) { throw new IllegalArgumentException ( "galaxyRoot=" + galaxyRoot . getAbsolutePath ( ) + " does not exist" ) ; } File configDirectory = new File ( galaxyRoot , CONFIG_DIR_NAME ) ; return ! ... |
public class WhileyFileParser { /** * Parse an < i > access expression < / i > , which has the form :
* < pre >
* AccessExpr : : = PrimaryExpr
* | AccessExpr ' [ ' AdditiveExpr ' ] '
* | AccessExpr ' [ ' AdditiveExpr " . . " AdditiveExpr ' ] '
* | AccessExpr ' . ' Identifier
* | AccessExpr ' . ' Identifier ... | int start = index ; Expr lhs = parseTermExpression ( scope , terminated ) ; Token token ; while ( ( token = tryAndMatchOnLine ( LeftSquare ) ) != null || ( token = tryAndMatch ( terminated , Dot , MinusGreater , ColonColon ) ) != null ) { switch ( token . kind ) { case LeftSquare : // NOTE : expression guaranteed to be... |
public class Domain { /** * Convenience method to get information about a specific Domain .
* @ param id the domain id .
* @ param description the description
* @ return information about a specific Domain
* @ throws AppPlatformException API Exception
* @ throws ParseException Error parsing data
* @ throws ... | final BandwidthClient client = BandwidthClient . getInstance ( ) ; final Map < String , Object > params = new HashMap < String , Object > ( ) ; if ( description != null ) { params . put ( "description" , description ) ; } return update ( client , id , params ) ; |
public class SocketFactory { /** * Creates the socket and the writer to go with it . */
@ Override public Socket makeObject ( InetSocketAddress address ) throws Exception { } } | Socket socket = new Socket ( address . getHostName ( ) , address . getPort ( ) ) ; socket . setKeepAlive ( true ) ; return socket ; |
public class JMThread { /** * Start with executor service executor service .
* @ param executorService the executor service
* @ param message the message
* @ param runnable the runnable
* @ return the executor service */
public static ExecutorService startWithExecutorService ( ExecutorService executorService , ... | runAsync ( ( ) -> { JMLog . info ( log , "startWithExecutorService" , message ) ; runnable . run ( ) ; } , executorService ) ; return executorService ; |
public class ReverseMap { /** * Creates a reverse map name corresponding to an address contained in
* an array of 4 bytes ( for an IPv4 address ) or 16 bytes ( for an IPv6 address ) .
* @ param addr The address from which to build a name .
* @ return The name corresponding to the address in the reverse map . */
p... | if ( addr . length != 4 && addr . length != 16 ) throw new IllegalArgumentException ( "array must contain " + "4 or 16 elements" ) ; StringBuffer sb = new StringBuffer ( ) ; if ( addr . length == 4 ) { for ( int i = addr . length - 1 ; i >= 0 ; i -- ) { sb . append ( addr [ i ] & 0xFF ) ; if ( i > 0 ) sb . append ( "."... |
public class OneStepDistributedRowLock { /** * Fill a mutation with the lock column . This may be used when the mutation
* is executed externally but should be used with extreme caution to ensure
* the lock is properly released
* @ param m
* @ param time
* @ param ttl */
public C fillLockMutation ( MutationBa... | if ( lockColumn != null ) { if ( ! lockColumn . equals ( columnStrategy . generateLockColumn ( ) ) ) throw new IllegalStateException ( "Can't change prefix or lockId after acquiring the lock" ) ; } else { lockColumn = columnStrategy . generateLockColumn ( ) ; } Long timeoutValue = ( time == null ) ? new Long ( 0 ) : ti... |
public class Condition { /** * URI starts with */
public static Condition startsWithUri ( final String uri ) { } } | return new Condition ( input -> input . getUri ( ) . startsWith ( uri ) ) ; |
public class UpdateDevEndpointRequest { /** * The list of public keys to be deleted from the DevEndpoint .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDeletePublicKeys ( java . util . Collection ) } or { @ link # withDeletePublicKeys ( java . util . Co... | if ( this . deletePublicKeys == null ) { setDeletePublicKeys ( new java . util . ArrayList < String > ( deletePublicKeys . length ) ) ; } for ( String ele : deletePublicKeys ) { this . deletePublicKeys . add ( ele ) ; } return this ; |
public class SelectiveCsvEncoder { /** * { @ inheritDoc } */
public String encode ( final String input , final CsvContext context , final CsvPreference preference ) { } } | return columnNumbers . contains ( context . getColumnNumber ( ) ) ? super . encode ( input , context , preference ) : input ; |
public class CholeskyDecomposition { /** * Solve A * X = b
* @ param b A column vector with as many rows as A .
* @ return X so that L * L ^ T * X = b
* @ exception IllegalArgumentException Matrix row dimensions must agree .
* @ exception RuntimeException Matrix is not symmetric positive definite . */
public do... | if ( b . length != L . length ) { throw new IllegalArgumentException ( ERR_MATRIX_DIMENSIONS ) ; } if ( ! isspd ) { throw new ArithmeticException ( ERR_MATRIX_NOT_SPD ) ; } // Work on a copy !
return solveLtransposed ( solveLInplace ( copy ( b ) ) ) ; |
public class NotificationManager { /** * Delete server - side notifications , represented by the 3 - tuple { source mbean , listener mbean , registration ID } .
* Called from direct HTTP users . */
public void deleteServerRegistrationHTTP ( RESTRequest request , int clientID , ServerNotificationRegistration serverNot... | // Get the client area
ClientNotificationArea clientArea = getInboxIfAvailable ( clientID , null ) ; if ( registrationID != null ) { String [ ] artifacts = registrationID . split ( "_" ) ; int filterID = Integer . parseInt ( artifacts [ 0 ] ) ; int handbackID = Integer . parseInt ( artifacts [ 1 ] ) ; // Since this is ... |
public class CredentialReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return Credential ResourceSet */
@ Override public ResourceSet < Credential > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class CommonsArrayList { /** * Create a new array list that contains a subset of the provided
* iterable . < br >
* Note : this method is a static factory method because the compiler sometimes
* cannot deduce between { @ link Predicate } and { @ link Function } and the
* mapping case occurs more often . ... | final CommonsArrayList < ELEMENTTYPE > ret = new CommonsArrayList < > ( ) ; ret . addAll ( aValues , aFilter ) ; return ret ; |
public class AbstractValidate { /** * Validate that the specified primitive value falls between the two exclusive values specified ; otherwise , throws an exception with the specified message .
* < pre > Validate . exclusiveBetween ( 0 , 2 , 1 , " Not in range " ) ; < / pre >
* @ param start
* the exclusive start... | if ( value <= start || value >= end ) { fail ( message ) ; } return value ; |
public class OneSelect { /** * Method used to append to the where part of an SQL statement .
* @ param _ select SQL select wrapper
* @ throws EFapsException on error */
public void append2SQLWhere ( final SQLSelect _select ) throws EFapsException { } } | for ( final ISelectPart part : this . selectParts ) { part . add2Where ( this , _select ) ; } |
public class ExtensionSpider { /** * Shows the spider dialogue with the given target , if not already visible .
* @ param target the target , might be { @ code null } .
* @ since TODO add version . */
public void showSpiderDialog ( Target target ) { } } | if ( spiderDialog == null ) { spiderDialog = new SpiderDialog ( this , View . getSingleton ( ) . getMainFrame ( ) , new Dimension ( 700 , 430 ) ) ; } if ( spiderDialog . isVisible ( ) ) { // Its behind you ! Actually not needed no the window is alwaysOnTop , but keeping in case we change that ; )
spiderDialog . toFront... |
public class GeospatialUtils { /** * Checks if the specified latitude is correct .
* @ param name the name of the latitude field
* @ param latitude the value of the latitude field
* @ return the latitude */
public static Double checkLatitude ( String name , Double latitude ) { } } | if ( latitude == null ) { throw new IndexException ( "{} required" , name ) ; } else if ( latitude < MIN_LATITUDE || latitude > MAX_LATITUDE ) { throw new IndexException ( "{} must be in range [{}, {}], but found {}" , name , MIN_LATITUDE , MAX_LATITUDE , latitude ) ; } return latitude ; |
public class ContentResourceImpl { /** * Retrieves content from a space .
* @ param spaceID
* @ param contentID
* @ return InputStream which can be used to read content . */
@ Override public RetrievedContent getContent ( String spaceID , String contentID , String storeID , String range ) throws InvalidRequestExc... | try { StorageProvider storage = storageProviderFactory . getStorageProvider ( storeID ) ; return storage . getContent ( spaceID , contentID , range ) ; } catch ( NotFoundException e ) { throw new ResourceNotFoundException ( "get content" , spaceID , contentID , e ) ; } catch ( StorageStateException e ) { throw new Reso... |
public class HttpPredicate { /** * An alias for { @ link HttpPredicate # http } .
* Creates a { @ link Predicate } based on a URI template filtering .
* This will listen for HEAD Method .
* @ param uri The string to compile into a URI template and use for matching
* @ return The new { @ link Predicate } .
* @... | return http ( uri , null , HttpMethod . HEAD ) ; |
public class ConcurrentLinkedList { /** * ( non - Javadoc )
* @ see com . ibm . ws . objectManager . Collection # remove ( com . ibm . ws . objectManager . Token , com . ibm . ws . objectManager . Transaction ) */
public boolean remove ( Token token , Transaction transaction ) throws ObjectManagerException { } } | final String methodName = "remove" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { token , transaction } ) ; // Make an initial unsynchronized search for the link .
ConcurrentSubList . Link linkToRemove = findLink ( token , transacti... |
public class ScriptRuntime { /** * The instanceof operator .
* @ return a instanceof b */
public static boolean instanceOf ( Object a , Object b , Context cx ) { } } | // Check RHS is an object
if ( ! ( b instanceof Scriptable ) ) { throw typeError0 ( "msg.instanceof.not.object" ) ; } // for primitive values on LHS , return false
if ( ! ( a instanceof Scriptable ) ) return false ; return ( ( Scriptable ) b ) . hasInstance ( ( Scriptable ) a ) ; |
public class PropertiesField { /** * Load the properties from the string and parse them .
* @ return The java properties . */
public static Map < String , Object > stringToProperties ( String strProperties ) { } } | Properties properties = new Properties ( ) ; if ( ( strProperties != null ) && ( strProperties . length ( ) > 0 ) ) { ByteArrayOutputStream baOut = new ByteArrayOutputStream ( ) ; OutputStreamWriter osOut = new OutputStreamWriter ( baOut ) ; try { osOut . write ( strProperties ) ; // Char - > Byte
osOut . flush ( ) ; b... |
public class HalFormsDocument { /** * Adds the given value as embedded one .
* @ param key must not be { @ literal null } or empty .
* @ param value must not be { @ literal null } .
* @ return */
public HalFormsDocument < T > andEmbedded ( HalLinkRelation key , Object value ) { } } | Assert . notNull ( key , "Embedded key must not be null!" ) ; Assert . notNull ( value , "Embedded value must not be null!" ) ; Map < HalLinkRelation , Object > embedded = new HashMap < > ( this . embedded ) ; embedded . put ( key , value ) ; return new HalFormsDocument < > ( resource , resources , embedded , pageMetad... |
public class BounceProxySystemPropertyLoader { /** * Replaces a variable defined by < code > $ { variable } < / code > by a system
* property with the key < code > variable < / code > .
* @ param value
* a string with any number of variables defined
* @ return a string in which each occurrence of < code > $ { v... | if ( value == null ) return null ; int startVariableIndex = value . indexOf ( "${" ) ; while ( startVariableIndex >= 0 ) { int endVariableIndex = value . indexOf ( "}" , startVariableIndex ) ; String propertyName = value . substring ( startVariableIndex + 2 , endVariableIndex ) ; String systemProperty = System . getPro... |
public class GosuStringUtil { /** * < p > Checks if String contains a search String irrespective of case ,
* handling < code > null < / code > . This method uses
* { @ link # contains ( String , String ) } . < / p >
* < p > A < code > null < / code > String will return < code > false < / code > . < / p >
* < pr... | if ( str == null || searchStr == null ) { return false ; } return contains ( str . toUpperCase ( ) , searchStr . toUpperCase ( ) ) ; |
public class CdnClient { /** * Set the request authentication .
* @ param domain Name of the domain .
* @ param requestAuth The configuration of authentication . */
public void setRequestAuth ( String domain , RequestAuth requestAuth ) { } } | SetRequestAuthRequest request = new SetRequestAuthRequest ( ) . withDomain ( domain ) . withRequestAuth ( requestAuth ) ; setRequestAuth ( request ) ; |
public class TableDefinition { /** * Get the { @ link FieldDefinition } of the sharding - field for this table . If this table
* is not sharded , the sharding - field option has not yet been set , or the sharding
* field has not yet been defined , null is returned .
* @ return The { @ link FieldDefinition } of th... | if ( ! isSharded ( ) ) { return null ; } String shardingFieldNme = getOption ( CommonDefs . OPT_SHARDING_FIELD ) ; if ( shardingFieldNme == null ) { return null ; } return getFieldDef ( shardingFieldNme ) ; // may return null |
public class OpenAPIModelFilterAdapter { /** * { @ inheritDoc } */
@ Override public Schema visitSchema ( Context context , Schema schema ) { } } | visitor . visitSchema ( context , schema ) ; return schema ; |
public class TableColumnManager { /** * Show a hidden column in the table . The column will be positioned at its
* proper place in the view of the table .
* @ param column
* the TableColumn to be shown . */
private void showColumn ( TableColumn column ) { } } | // Ignore changes to the TableColumnModel made by the TableColumnManager
columnModel . removeColumnModelListener ( this ) ; // Add the column to the end of the table
columnModel . addColumn ( column ) ; // Move the column to its position before it was hidden .
// ( Multiple columns may be hidden so we need to find the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.