signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class NewRelicManager { /** * Synchronise the Synthetics configuration with the cache .
* @ param cache The provider cache
* @ return < CODE > true < / CODE > if the operation was successful */
public boolean syncMonitors ( NewRelicCache cache ) { } } | boolean ret = true ; if ( apiClient == null ) throw new IllegalArgumentException ( "null API client" ) ; // Get the Synthetics configuration using the REST API
if ( cache . isSyntheticsEnabled ( ) ) { ret = false ; logger . info ( "Getting the monitors" ) ; cache . monitors ( ) . add ( syntheticsApiClient . monitors ( ... |
public class CPOptionCategoryUtil { /** * Returns a range of all the cp option categories where groupId = & # 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 are indexes in the ... | return getPersistence ( ) . findByGroupId ( groupId , start , end ) ; |
public class UniversalProjectReader { /** * Determine if the start of the buffer matches a fingerprint byte array .
* @ param buffer bytes from file
* @ param fingerprint fingerprint bytes
* @ return true if the file matches the fingerprint */
private boolean matchesFingerprint ( byte [ ] buffer , byte [ ] finger... | return Arrays . equals ( fingerprint , Arrays . copyOf ( buffer , fingerprint . length ) ) ; |
public class Assert { /** * Assert a boolean expression , throwing an { @ code IllegalStateException } if the expression
* evaluates to { @ code false } .
* Call { @ link # isTrue } if you wish to throw an { @ code IllegalArgumentException } on an assertion
* failure .
* < pre class = " code " >
* Assert . st... | if ( ! expression ) { throw new IllegalStateException ( Assert . nullSafeGet ( messageSupplier ) ) ; } |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcElectricDistributionPoint ( ) { } } | if ( ifcElectricDistributionPointEClass == null ) { ifcElectricDistributionPointEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 187 ) ; } return ifcElectricDistributionPointEClass ; |
public class Offering { /** * Sanitizes a name by replacing every not alphanumeric character with ' _ '
* @ param name the name of the offerings
* @ return the sanitized name */
public static String sanitizeName ( String name ) { } } | if ( name == null ) throw new NullPointerException ( "Parameter name cannot be null" ) ; name = name . trim ( ) ; if ( name . length ( ) == 0 ) throw new IllegalArgumentException ( "Parameter name cannot be empty" ) ; StringBuilder ret = new StringBuilder ( "" ) ; for ( int i = 0 ; i < name . length ( ) ; i ++ ) { char... |
public class WorkerPools { /** * region getCurrentInstanceProvider overloads */
public < T > Provider < T > getCurrentInstanceProvider ( Class < T > type ) { } } | return getCurrentInstanceProvider ( Key . get ( type ) ) ; |
public class XCostExtension { /** * Assigns ( to the given event ) multiple amounts given their key lists . The
* i - th element in the key list should correspond to an i - level attribute
* with the prescribed key . Note that as a side effect this method creates
* attributes when it does not find an attribute wi... | XCostAmount . instance ( ) . assignNestedValues ( event , amounts ) ; |
public class CmsDomUtil { /** * Checks if the given color value is transparent . < p >
* @ param backgroundColor the color value
* @ return < code > true < / code > if transparent */
private static boolean isTransparent ( String backgroundColor ) { } } | // not only check ' transparent ' but also ' rgba ( 0 , 0 , 0 , 0 ) ' as returned by chrome
return StyleValue . transparent . toString ( ) . equalsIgnoreCase ( backgroundColor ) || "rgba(0, 0, 0, 0)" . equalsIgnoreCase ( backgroundColor ) ; |
public class RNAUtils { /** * method to get the rna sequence of the given PolymerNotation
* @ param one
* PolymerNotation
* @ return sequence
* @ throws RNAUtilsException if the polymer is not a RNA / DNA
* @ throws HELM2HandledException if it contains helm2 specific features can not be casted to HELM1 Format... | checkRNA ( one ) ; List < Nucleotide > nucleotideList = getNucleotideList ( one ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < nucleotideList . size ( ) ; i ++ ) { sb . append ( nucleotideList . get ( i ) . getNaturalAnalog ( ) ) ; } return sb . toString ( ) ; |
public class User { /** * Provides the { @ link Extension } with the given URN
* @ param urn The URN of the extension
* @ return The extension for the given URN
* @ throws IllegalArgumentException If urn is null or empty
* @ throws NoSuchElementException If extension with given urn is not available */
public Ex... | if ( urn == null || urn . isEmpty ( ) ) { throw new IllegalArgumentException ( "urn must be neither null nor empty" ) ; } if ( ! extensions . containsKey ( urn ) ) { throw new NoSuchElementException ( "extension " + urn + " is not available" ) ; } return extensions . get ( urn ) ; |
public class ScriptableObject { /** * Utility method to add properties to arbitrary Scriptable object .
* If destination is instance of ScriptableObject , calls
* defineProperty there , otherwise calls put in destination
* ignoring attributes
* @ param destination ScriptableObject to define the property on
* ... | if ( ! ( destination instanceof ScriptableObject ) ) { destination . put ( propertyName , destination , value ) ; return ; } ScriptableObject so = ( ScriptableObject ) destination ; so . defineProperty ( propertyName , value , attributes ) ; |
public class LoadBalancerFrontendIPConfigurationsInner { /** * Gets all the load balancer frontend IP configurations .
* @ param resourceGroupName The name of the resource group .
* @ param loadBalancerName The name of the load balancer .
* @ throws IllegalArgumentException thrown if parameters fail the validatio... | return listWithServiceResponseAsync ( resourceGroupName , loadBalancerName ) . map ( new Func1 < ServiceResponse < Page < FrontendIPConfigurationInner > > , Page < FrontendIPConfigurationInner > > ( ) { @ Override public Page < FrontendIPConfigurationInner > call ( ServiceResponse < Page < FrontendIPConfigurationInner ... |
public class AmazonCloudWatchEventsClient { /** * Displays the external AWS accounts that are permitted to write events to your account using your account ' s event
* bus , and the associated policy . To enable your account to receive events from other accounts , use
* < a > PutPermission < / a > .
* @ param desc... | request = beforeClientExecution ( request ) ; return executeDescribeEventBus ( request ) ; |
public class Version { /** * Creates a new Version from the three provided components . The version ' s pre release
* and build meta data fields will be empty . Neither value must be lower than 0 and at
* least one must be greater than zero
* @ param major The major version .
* @ param minor The minor version .... | return new Version ( major , minor , patch , EMPTY_ARRAY , EMPTY_ARRAY ) ; |
public class Captions { /** * Source files for the input sidecar captions used during the transcoding process . To omit all sidecar captions ,
* leave < code > CaptionSources < / code > blank .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCaptionSourc... | if ( this . captionSources == null ) { setCaptionSources ( new com . amazonaws . internal . SdkInternalList < CaptionSource > ( captionSources . length ) ) ; } for ( CaptionSource ele : captionSources ) { this . captionSources . add ( ele ) ; } return this ; |
public class ConciseSet { /** * { @ inheritDoc } */
@ Override public ConciseSet intersection ( IntSet other ) { } } | if ( isEmpty ( ) || other == null || other . isEmpty ( ) ) { return empty ( ) ; } if ( other == this ) { return clone ( ) ; } return performOperation ( convert ( other ) , Operator . AND ) ; |
public class AWSRoboMakerClient { /** * Describes a simulation job .
* @ param describeSimulationJobRequest
* @ return Result of the DescribeSimulationJob operation returned by the service .
* @ throws ResourceNotFoundException
* The specified resource does not exist .
* @ throws InvalidParameterException
*... | request = beforeClientExecution ( request ) ; return executeDescribeSimulationJob ( request ) ; |
public class DefaultCurieProvider { /** * ( non - Javadoc )
* @ see org . springframework . hateoas . hal . CurieProvider # getNamespacedRelFrom ( java . lang . String ) */
@ Override public HalLinkRelation getNamespacedRelFor ( LinkRelation relation ) { } } | HalLinkRelation result = HalLinkRelation . of ( relation ) ; return defaultCurie == null ? result : result . curieIfUncuried ( defaultCurie ) ; |
public class DiscoveryMulticastResponder { /** * Start the responder ( if not already started ) */
public synchronized void start ( ) throws IOException { } } | if ( listenerThreads . size ( ) == 0 ) { List < InetAddress > addresses = hostAddress == null ? NetworkUtil . getMulticastAddresses ( ) : Arrays . asList ( hostAddress ) ; if ( addresses . size ( ) == 0 ) { logHandler . info ( "No suitable address found for listening on multicast discovery requests" ) ; return ; } // W... |
public class RandomUtil { /** * Picks a random object from the supplied iterator ( which must iterate over exactly
* < code > count < / code > objects . The specified skip object will be skipped when selecting a
* random value . The skipped object must exist exactly once in the set of objects returned by
* the it... | if ( count < 2 ) { throw new IllegalArgumentException ( "Must have at least two elements [count=" + count + "]" ) ; } int index = getInt ( count - 1 ) ; T value = null ; do { value = iter . next ( ) ; if ( value == skip ) { value = iter . next ( ) ; } } while ( index -- > 0 ) ; return value ; |
public class Expression { /** * Applies a type conversion to this expression which is chained to all
* previous conversions .
* @ param toType the type to convert to .
* @ param preferCast a hint that the conversion should be performed by a
* type cast operation , by default is true .
* @ throws IllegalArgume... | Type fromType = getType ( ) ; Type actual = Type . preserveType ( fromType , toType ) ; if ( actual . equals ( fromType ) ) { return ; } boolean legal = false ; if ( ! preferCast && fromType == Type . NULL_TYPE ) { preferCast = true ; } if ( fromType == null ) { legal = true ; } else if ( fromType . isPrimitive ( ) ) {... |
public class Expressions { /** * Create a new Path expression
* @ param type type of expression
* @ param variable variable name
* @ return path expression */
public static < T > DslPath < T > dslPath ( Class < ? extends T > type , String variable ) { } } | return new DslPath < T > ( type , PathMetadataFactory . forVariable ( variable ) ) ; |
public class Cache { /** * 删除哈希表 key 中的一个或多个指定域 , 不存在的域将被忽略 。 */
public Long hdel ( Object key , Object ... fields ) { } } | Jedis jedis = getJedis ( ) ; try { return jedis . hdel ( keyToBytes ( key ) , fieldsToBytesArray ( fields ) ) ; } finally { close ( jedis ) ; } |
public class GridNode { /** * Get a window of values surrounding the current node .
* < p > Notes : < / p >
* < ul >
* < li > the size has to be odd , so that the current node can be in the center .
* If the size is even , size + 1 will be used . < / li >
* < li > values outside the boundaries of the raster w... | if ( size % 2 == 0 ) { size ++ ; } double [ ] [ ] window = new double [ size ] [ size ] ; int delta = ( size - 1 ) / 2 ; if ( ! doCircular ) { for ( int c = - delta ; c <= delta ; c ++ ) { int tmpCol = col + c ; for ( int r = - delta ; r <= delta ; r ++ ) { int tmpRow = row + r ; GridNode n = new GridNode ( gridIter , ... |
public class HBaseVersion { /** * Prints out the HBase { @ link Version } enum value for the current version of HBase on the classpath . */
public static void main ( String [ ] args ) { } } | Version version = HBaseVersion . get ( ) ; System . out . println ( version . getMajorVersion ( ) ) ; |
public class StopWatch { /** * Stop the current task . The results are undefined if timing methods are
* called without invoking at least one pair { @ link # start ( ) } /
* { @ link # stop ( ) } methods .
* @ see # start ( ) */
public void stop ( ) throws IllegalStateException { } } | if ( ! this . running ) { throw new IllegalStateException ( "Can't stop StopWatch: it's not running" ) ; } long lastTime = System . currentTimeMillis ( ) - this . startTimeMillis ; this . totalTimeMillis += lastTime ; this . lastTaskInfo = new TaskInfo ( this . currentTaskName , lastTime ) ; if ( this . keepTaskList ) ... |
public class OAuth2SessionRef { /** * Use the refresh token to get a new token with a longer lifespan */
public synchronized void refreshToken ( ) { } } | final String refreshToken = this . response . refresh_token ; this . response = null ; this . cachedInfo = null ; final String responseStr = authService . getToken ( UserManagerOAuthService . GRANT_TYPE_REFRESH_TOKEN , null , null , clientId , clientSecret , refreshToken , null , null , null ) ; loadAuthResponse ( resp... |
public class ComputationGraph { /** * Return the layer size ( number of units ) for the specified layer .
* Note that the meaning of the " layer size " can depend on the type of layer . For example : < br >
* - DenseLayer , OutputLayer , recurrent layers : number of units ( nOut configuration option ) < br >
* - ... | if ( layer < 0 || layer > layers . length ) { throw new IllegalArgumentException ( "Invalid layer index: " + layer + ". Layer index must be between 0 and " + ( layers . length - 1 ) + " inclusive" ) ; } return layerSize ( layers [ layer ] . conf ( ) . getLayer ( ) . getLayerName ( ) ) ; |
public class PreviousSnapshotsCalculator { /** * Returns a Map from snapshot . id to snapshot with this id .
* The Map contains entries for all previous snapshots .
* I . e , for each snapshot S from a given list , there is a map entry for S . id . previous ( ) */
Map < SnapshotIdentifier , CdoSnapshot > calculate ... | Map < SnapshotIdentifier , CdoSnapshot > previousSnapshots = new HashMap < > ( ) ; populatePreviousSnapshotsWithSnapshots ( previousSnapshots , snapshots ) ; List < CdoSnapshot > missingPreviousSnapshots = getMissingPreviousSnapshots ( snapshots , previousSnapshots ) ; populatePreviousSnapshotsWithSnapshots ( previousS... |
public class DataProviderFactory { /** * Creates an instance of the specified class using the specified < code > ClassLoader < / code > object .
* @ throws ClassNotFoundException if the given class could not be found or could not be instantiated */
private static Class < ? > findClass ( String className , ClassLoader... | try { Class < ? > spiClass ; if ( classLoader == null ) { spiClass = Class . forName ( className ) ; } else { try { spiClass = Class . forName ( className , false , classLoader ) ; } catch ( ClassNotFoundException ex ) { spiClass = Class . forName ( className ) ; } } return spiClass ; } catch ( ClassNotFoundException x... |
public class AutoZone { /** * async */
void preQueryIndex ( final ZoneIndex index , final QueryHandler complete ) { } } | if ( index == null ) { complete . onFailure ( ResponseInfo . InvalidToken ) ; return ; } ZoneInfo info = zones . get ( index ) ; if ( info != null ) { complete . onSuccess ( ) ; return ; } getZoneJsonAsync ( index , new CompletionHandler ( ) { @ Override public void complete ( ResponseInfo info , JSONObject response ) ... |
public class FileUtil { /** * 创建文件及其父目录 , 如果这个文件存在 , 直接返回这个文件 < br >
* 此方法不对File对象类型做判断 , 如果File不存在 , 无法判断其类型
* @ param fullFilePath 文件的全路径 , 使用POSIX风格
* @ return 文件 , 若路径为null , 返回null
* @ throws IORuntimeException IO异常 */
public static File touch ( String fullFilePath ) throws IORuntimeException { } } | if ( fullFilePath == null ) { return null ; } return touch ( file ( fullFilePath ) ) ; |
public class JDBCStorageConnection { /** * Delete Property Values .
* @ param cid
* Property id
* @ param pdata
* PropertyData
* @ param update
* boolean true if it ' s delete - add sequence ( update operation )
* @ param sizeHandler
* accumulates changed size
* @ throws IOException
* i / O error
... | Set < String > storages = new HashSet < String > ( ) ; final ResultSet valueRecords = findValueStorageDescAndSize ( cid ) ; try { if ( valueRecords . next ( ) ) { do { final String storageId = valueRecords . getString ( COLUMN_VSTORAGE_DESC ) ; if ( ! valueRecords . wasNull ( ) ) { storages . add ( storageId ) ; } else... |
public class Util { /** * Count the number of JDBC parameters in a sql statement .
* @ param query
* . sql ( )
* @ return */
static int parametersCount ( Query query ) { } } | if ( query . names ( ) . isEmpty ( ) ) return countQuestionMarkParameters ( query . sql ( ) ) ; else return query . names ( ) . size ( ) ; |
public class Configuration { /** * Check to see if the size is valid for any of the images types
* @ param sizeToCheck
* @ return */
public boolean isValidSize ( String sizeToCheck ) { } } | return isValidPosterSize ( sizeToCheck ) || isValidBackdropSize ( sizeToCheck ) || isValidProfileSize ( sizeToCheck ) || isValidLogoSize ( sizeToCheck ) ; |
public class FdfWriter { /** * Removes the field value .
* @ param field the field name
* @ return < CODE > true < / CODE > if the field was found and removed ,
* < CODE > false < / CODE > otherwise */
public boolean removeField ( String field ) { } } | HashMap map = fields ; StringTokenizer tk = new StringTokenizer ( field , "." ) ; if ( ! tk . hasMoreTokens ( ) ) return false ; ArrayList hist = new ArrayList ( ) ; while ( true ) { String s = tk . nextToken ( ) ; Object obj = map . get ( s ) ; if ( obj == null ) return false ; hist . add ( map ) ; hist . add ( s ) ; ... |
public class AmazonRoute53ResolverClient { /** * Adds IP addresses to an inbound or an outbound resolver endpoint . If you want to adding more than one IP address ,
* submit one < code > AssociateResolverEndpointIpAddress < / code > request for each IP address .
* To remove an IP address from an endpoint , see < a ... | request = beforeClientExecution ( request ) ; return executeAssociateResolverEndpointIpAddress ( request ) ; |
public class EmailIntents { /** * Create an intent to send an email with an attachment to a single recipient
* @ param address The recipient address ( or null if not specified )
* @ param subject The subject of the email ( or null if not specified )
* @ param body The body of the email ( or null if not specified ... | return newEmailIntent ( address == null ? null : new String [ ] { address } , subject , body , attachment ) ; |
public class DRUMS { /** * Determines the number of elements in each buckets by opening all files .
* @ return the number of elements in the database .
* @ throws IOException
* @ throws FileLockException */
public long size ( ) throws FileLockException , IOException { } } | long size = 0L ; for ( int bucketId = 0 ; bucketId < hashFunction . getNumberOfBuckets ( ) ; bucketId ++ ) { HeaderIndexFile < Data > headerIndexFile = new HeaderIndexFile < Data > ( gp . DATABASE_DIRECTORY + "/" + hashFunction . getFilename ( bucketId ) , gp . HEADER_FILE_LOCK_RETRY , gp ) ; size += headerIndexFile . ... |
public class FDBigInteger { /** * @ requires p5 > = 0 & & p2 > = 0;
* @ assignable \ nothing ;
* @ ensures \ result . value ( ) = = \ old ( pow52 ( p5 , p2 ) ) ; */
public static FDBigInteger valueOfPow52 ( int p5 , int p2 ) { } } | if ( p5 != 0 ) { if ( p2 == 0 ) { return big5pow ( p5 ) ; } else if ( p5 < SMALL_5_POW . length ) { int pow5 = SMALL_5_POW [ p5 ] ; int wordcount = p2 >> 5 ; int bitcount = p2 & 0x1f ; if ( bitcount == 0 ) { return new FDBigInteger ( new int [ ] { pow5 } , wordcount ) ; } else { return new FDBigInteger ( new int [ ] { ... |
public class WFileWidgetRenderer { /** * Paints the given WFileWidget .
* @ param component the WFileWidget to paint .
* @ param renderContext the RenderContext to paint to . */
@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } } | WFileWidget fileWidget = ( WFileWidget ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; boolean readOnly = fileWidget . isReadOnly ( ) ; xml . appendTagOpen ( TAG_NAME ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ... |
public class DomainEntry { /** * ( Deprecated ) The options for the domain entry .
* < note >
* In releases prior to November 29 , 2017 , this parameter was not included in the API response . It is now
* deprecated .
* < / note >
* @ param options
* ( Deprecated ) The options for the domain entry . < / p > ... | setOptions ( options ) ; return this ; |
public class TorrentInfo { /** * This function will map a range in a specific file into a range in the torrent .
* The { @ code offset } parameter is the offset in the file , given in bytes , where
* 0 is the start of the file .
* The input range is assumed to be valid within the torrent . { @ code offset + size ... | return new PeerRequest ( ti . map_file ( file , offset , size ) ) ; |
public class AmazonIdentityManagementClient { /** * Retrieves the specified inline policy document that is embedded in the specified IAM user .
* < note >
* Policies returned by this API are URL - encoded compliant with < a href = " https : / / tools . ietf . org / html / rfc3986 " > RFC
* 3986 < / a > . You can ... | request = beforeClientExecution ( request ) ; return executeGetUserPolicy ( request ) ; |
public class DefaultCacheContainer { /** * { @ inheritDoc }
* @ see org . infinispan . manager . EmbeddedCacheManager # getCache ( java . lang . String , boolean ) */
@ Override public < K , V > Cache < K , V > getCache ( String cacheName , boolean start ) { } } | Cache < K , V > cache = this . cm . getCache ( this . getCacheName ( cacheName ) , start ) ; return ( cache != null ) ? new DelegatingCache < > ( cache ) : null ; |
public class DatabaseJournal { /** * { @ inheritDoc } */
public void init ( String id , NamespaceResolver resolver ) throws JournalException { } } | super . init ( id , resolver ) ; init ( ) ; try { conHelper = createConnectionHelper ( getDataSource ( ) ) ; // make sure schemaObjectPrefix consists of legal name characters only
schemaObjectPrefix = conHelper . prepareDbIdentifier ( schemaObjectPrefix ) ; // check if schema objects exist and create them if necessary
... |
public class MappedBuffer { /** * Allocates a mapped buffer .
* Memory will be mapped by opening and expanding the given { @ link java . io . File } to the desired { @ code count } and mapping the
* file contents into memory via { @ link java . nio . channels . FileChannel # map ( java . nio . channels . FileChanne... | return allocate ( file , FileChannel . MapMode . READ_WRITE , initialCapacity , maxCapacity ) ; |
public class PartitionRequestClient { /** * Sends a task event backwards to an intermediate result partition producer .
* Backwards task events flow between readers and writers and therefore
* will only work when both are running at the same time , which is only
* guaranteed to be the case when both the respectiv... | checkNotClosed ( ) ; tcpChannel . writeAndFlush ( new TaskEventRequest ( event , partitionId , inputChannel . getInputChannelId ( ) ) ) . addListener ( new ChannelFutureListener ( ) { @ Override public void operationComplete ( ChannelFuture future ) throws Exception { if ( ! future . isSuccess ( ) ) { SocketAddress rem... |
public class DatePicker { /** * Set the range of selectable dates .
* @ param minDay The day value of minimum date .
* @ param minMonth The month value of minimum date .
* @ param minYear The year value of minimum date .
* @ param maxDay The day value of maximum date .
* @ param maxMonth The month value of ma... | mAdapter . setDateRange ( minDay , minMonth , minYear , maxDay , maxMonth , maxYear ) ; |
public class PmiRegistry { /** * return the PerfLevelDescriptor for each module / instance / submodule / subinstance during runtime . */
public static PerfLevelDescriptor [ ] getAllInstrumentationLevels ( ) { } } | if ( disabled ) return null ; ArrayList res = moduleRoot . getPerfLevelDescriptors ( false ) ; // create returned array
PerfLevelDescriptor [ ] retArray = new PerfLevelDescriptor [ res . size ( ) ] ; for ( int i = 0 ; i < retArray . length ; i ++ ) retArray [ i ] = ( PerfLevelDescriptor ) res . get ( i ) ; return retAr... |
public class DeprecationStatus { /** * Returns the timestamp ( in milliseconds since epoch ) on or after which the deprecation state of
* this resource will be changed to { @ link Status # OBSOLETE } . Returns { @ code null } if not set .
* @ throws IllegalStateException if { @ link # getObsolete ( ) } is not a val... | try { return obsolete != null ? TIMESTAMP_FORMATTER . parse ( obsolete , Instant . FROM ) . toEpochMilli ( ) : null ; } catch ( DateTimeParseException ex ) { throw new IllegalStateException ( ex . getMessage ( ) , ex ) ; } |
public class JdbcKAMLoaderImpl { /** * { @ inheritDoc } */
@ Override public void loadAnnotationValues ( AnnotationValueTable avt ) throws SQLException { } } | PreparedStatement aps = getPreparedStatement ( ANNOTATION_SQL ) ; Set < Entry < Integer , TableAnnotationValue > > annotationEntries = avt . getIndexValue ( ) . entrySet ( ) ; for ( Entry < Integer , TableAnnotationValue > annotationEntry : annotationEntries ) { aps . setInt ( 1 , ( annotationEntry . getKey ( ) + 1 ) )... |
public class ResponseDownloadPerformer { protected void writeDownloadStream ( InputStream ins , OutputStream out ) throws IOException { } } | try { fromInputStreamToOutputStream ( ins , out ) ; } catch ( IOException e ) { throwDownloadIOException ( e ) ; } |
public class StopBackupJobRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StopBackupJobRequest stopBackupJobRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( stopBackupJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopBackupJobRequest . getBackupJobId ( ) , BACKUPJOBID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " ... |
public class DatatypeConverter { /** * Prints a currency symbol position value .
* @ param value CurrencySymbolPosition instance
* @ return currency symbol position */
public static final String printCurrencySymbolPosition ( CurrencySymbolPosition value ) { } } | String result ; switch ( value ) { default : case BEFORE : { result = "0" ; break ; } case AFTER : { result = "1" ; break ; } case BEFORE_WITH_SPACE : { result = "2" ; break ; } case AFTER_WITH_SPACE : { result = "3" ; break ; } } return ( result ) ; |
public class GISLayerWriter { /** * Flush temp buffers , write down final information in
* file header ( file size . . . ) , and close the streams .
* @ throws IOException in case of error . */
@ SuppressWarnings ( "resource" ) @ Override public void close ( ) throws IOException { } } | if ( this . tmpFile . canRead ( ) ) { try { this . tmpOutput . close ( ) ; try ( WritableByteChannel out = Channels . newChannel ( this . output ) ) { try ( ReadableByteChannel in = Channels . newChannel ( new FileInputStream ( this . tmpFile ) ) ) { // Write the header
final int limit = HEADER_KEY . getBytes ( ) . len... |
public class SasFileParser { /** * Put next page to cache and read it ' s header .
* @ throws IOException if reading from the { @ link SasFileParser # sasFileStream } string is impossible . */
private void processNextPage ( ) throws IOException { } } | int bitOffset = sasFileProperties . isU64 ( ) ? PAGE_BIT_OFFSET_X64 : PAGE_BIT_OFFSET_X86 ; currentPageDataSubheaderPointers . clear ( ) ; try { sasFileStream . readFully ( cachedPage , 0 , sasFileProperties . getPageLength ( ) ) ; } catch ( EOFException ex ) { eof = true ; return ; } readPageHeader ( ) ; if ( currentP... |
public class DomXmlMessageValidator { /** * Validate namespaces in message . The method compares namespace declarations in the root
* element of the received message to expected namespaces . Prefixes are important too , so
* differing namespace prefixes will fail the validation .
* @ param expectedNamespaces
* ... | if ( CollectionUtils . isEmpty ( expectedNamespaces ) ) { return ; } if ( receivedMessage . getPayload ( ) == null || ! StringUtils . hasText ( receivedMessage . getPayload ( String . class ) ) ) { throw new ValidationException ( "Unable to validate message namespaces - receive message payload was empty" ) ; } log . de... |
public class FastForward { /** * Initialization method for a FastForward client .
* @ return A new instance of a FastForward client .
* @ throws SocketException If a datagram socket cannot be created . */
public static FastForward setup ( InetAddress addr , int port ) throws SocketException { } } | final DatagramSocket socket = new DatagramSocket ( ) ; return new FastForward ( addr , port , socket ) ; |
public class ProbeHandlerThread { /** * Handle the probe . */
public void run ( ) { } } | ResponseWrapper response = null ; LOGGER . info ( "Received probe id: " + probe . getProbeId ( ) ) ; // Only handle probes that we haven ' t handled before
// The Probe Generator needs to send a stream of identical UDP packets
// to compensate for UDP reliability issues . Therefore , the Responder
// will likely get mo... |
public class FloatArray { /** * Converts this < code > FloatArray < / code > to an array of floats .
* @ return An array of floats containing the same elements as this array . */
public float [ ] toFloatArray ( ) { } } | float [ ] copy = new float [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { copy [ i ] = elements [ i ] ; } return copy ; |
public class LimesurveyRC { /** * Check if a survey is active .
* @ param surveyId the survey id of the survey you want to check
* @ return true if the survey is active
* @ throws LimesurveyRCException the limesurvey rc exception */
public boolean isSurveyActive ( int surveyId ) throws LimesurveyRCException { } } | LsApiBody . LsApiParams params = getParamsWithKey ( surveyId ) ; List < String > surveySettings = new ArrayList < > ( ) ; surveySettings . add ( "active" ) ; params . setSurveySettings ( surveySettings ) ; return "Y" . equals ( callRC ( new LsApiBody ( "get_survey_properties" , params ) ) . getAsJsonObject ( ) . get ( ... |
public class DiscreteFourierTransformOps { /** * Computes the magnitude of the complex image : < br >
* magnitude = sqrt ( real < sup > 2 < / sup > + imaginary < sup > 2 < / sup > )
* @ param transform ( Input ) Complex interleaved image
* @ param magnitude ( Output ) Magnitude of image */
public static void magn... | checkImageArguments ( magnitude , transform ) ; for ( int y = 0 ; y < transform . height ; y ++ ) { int indexTran = transform . startIndex + y * transform . stride ; int indexMag = magnitude . startIndex + y * magnitude . stride ; for ( int x = 0 ; x < transform . width ; x ++ , indexTran += 2 ) { float real = transfor... |
public class TableWriterServiceImpl { /** * Writes a blob page to the current output segment .
* @ param page the blob to be written
* @ param saveSequence
* @ return true on completion */
@ InService ( TableWriterService . class ) public void writeBlobPage ( PageBlob page , int saveSequence , Result < Integer > ... | SegmentStream sOut = getBlobStream ( ) ; int saveLength = 0 ; int saveTail = 0 ; if ( _blobSizeMax < page . getLength ( ) ) { _blobSizeMax = page . getLength ( ) ; calculateSegmentSize ( ) ; } sOut . writePage ( this , page , saveLength , saveTail , saveSequence , result ) ; _isBlobDirty = true ; |
public class AbstractVariantEndpoint { /** * Delete Variant
* @ param variantId id of { @ link Variant }
* @ return no content or 404
* @ statuscode 204 The Variant successfully deleted
* @ statuscode 400 The requested Variant resource exists but it is not of the given type
* @ statuscode 404 The requested Va... | Variant variant = variantService . findByVariantID ( variantId ) ; if ( variant == null ) { return Response . status ( Response . Status . NOT_FOUND ) . entity ( "Could not find requested Variant" ) . build ( ) ; } if ( ! type . isInstance ( variant ) ) { return Response . status ( Response . Status . BAD_REQUEST ) . e... |
public class KModuleDeploymentService { /** * This creates and fills a { @ link RuntimeEnvironmentBuilder } instance , which is later used when creating services .
* A lot of the logic here is used to process the information in the { @ link DeploymentDescriptor } instance , which is
* part of the { @ link Deploymen... | DeploymentDescriptor descriptor = deploymentUnit . getDeploymentDescriptor ( ) ; if ( descriptor == null || ( ( DeploymentDescriptorImpl ) descriptor ) . isEmpty ( ) ) { // skip empty descriptors as its default can override settings
DeploymentDescriptorManager descriptorManager = new DeploymentDescriptorManager ( "org.... |
public class JndiContext { /** * Will create a JNDI Context and register it as the initial context factory builder
* @ return the context
* @ throws NamingException
* on any issue during initial context factory builder registration */
static JndiContext createJndiContext ( ) throws NamingException { } } | try { if ( ! NamingManager . hasInitialContextFactoryBuilder ( ) ) { JndiContext ctx = new JndiContext ( ) ; NamingManager . setInitialContextFactoryBuilder ( ctx ) ; return ctx ; } else { return ( JndiContext ) NamingManager . getInitialContext ( null ) ; } } catch ( Exception e ) { jqmlogger . error ( "Could not crea... |
public class LocalProperties { public static LocalProperties forOrdering ( Ordering o ) { } } | LocalProperties props = new LocalProperties ( ) ; props . ordering = o ; props . groupedFields = o . getInvolvedIndexes ( ) ; return props ; |
public class IfcObjectDefinitionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcRelAssigns > getHasAssignments ( ) { } } | return ( EList < IfcRelAssigns > ) eGet ( Ifc2x3tc1Package . Literals . IFC_OBJECT_DEFINITION__HAS_ASSIGNMENTS , true ) ; |
public class HFactory { /** * Creates a Keyspace with the given consistency level , fail over policy
* and user credentials . For a reference to the consistency level , please
* refer to http : / / wiki . apache . org / cassandra / API .
* @ param keyspace
* @ param cluster
* @ param consistencyLevelPolicy
... | return new ExecutingKeyspace ( keyspace , cluster . getConnectionManager ( ) , consistencyLevelPolicy , failoverPolicy , credentials ) ; |
public class CommerceDiscountUserSegmentRelPersistenceImpl { /** * Returns the first commerce discount user segment rel in the ordered set where commerceDiscountId = & # 63 ; .
* @ param commerceDiscountId the commerce discount ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > ... | CommerceDiscountUserSegmentRel commerceDiscountUserSegmentRel = fetchByCommerceDiscountId_First ( commerceDiscountId , orderByComparator ) ; if ( commerceDiscountUserSegmentRel != null ) { return commerceDiscountUserSegmentRel ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ;... |
public class MobileProcessLauncher { /** * Get program arguments to pass
* @ return the program arguments to pass represented as an array of { @ link String }
* @ throws IOException */
@ Override String [ ] getProgramArguments ( ) throws IOException { } } | LOGGER . entering ( ) ; List < String > args = new LinkedList < > ( Arrays . asList ( super . getProgramArguments ( ) ) ) ; // add the defaults which we don ' t already have a value for
for ( Entry < String , JsonElement > entry : defaultArgs . entrySet ( ) ) { String key = entry . getKey ( ) ; if ( ! args . contains (... |
public class JimfsFileSystems { /** * Initialize and configure a new file system with the given provider and URI , using the given
* configuration . */
public static JimfsFileSystem newFileSystem ( JimfsFileSystemProvider provider , URI uri , Configuration config ) throws IOException { } } | PathService pathService = new PathService ( config ) ; FileSystemState state = new FileSystemState ( removeFileSystemRunnable ( uri ) ) ; JimfsFileStore fileStore = createFileStore ( config , pathService , state ) ; FileSystemView defaultView = createDefaultView ( config , fileStore , pathService ) ; WatchServiceConfig... |
public class TunnelingFeature { /** * Creates a new tunneling feature - get service .
* @ param channelId tunneling connection channel identifier
* @ param seq tunneling connection send sequence number
* @ param featureId the requested interface feature
* @ return new tunneling feature - get service */
public s... | return new TunnelingFeature ( KNXnetIPHeader . TunnelingFeatureGet , channelId , seq , featureId , Success ) ; |
public class CpnlElFunctions { /** * Returns the escaped text of a rich text value as HTML text for a tag attribute .
* We assume that the result is used as value for a insertion done by jQuery . html ( ) ;
* in this case all ' & . . . ' escaped chars are translated back by jQuery and the XSS protection
* is brok... | if ( value != null ) { value = rich ( request , value ) ; value = value . replaceAll ( "&" , "&" ) // prevent from unescaping in jQuery . html ( )
. replaceAll ( QTYPE_CHAR [ qType ] , QTYPE_ESC [ qType ] ) ; } return value ; |
public class ConstructState { /** * Merge a { @ link ConstructState } for a child construct into this { @ link ConstructState } .
* Non - override property names will be mutated as follows : key - > construct . name ( ) + infix + key
* @ param construct type of the child construct .
* @ param constructState { @ l... | addOverwriteProperties ( constructState . getOverwritePropertiesMap ( ) ) ; constructState . removeProp ( OVERWRITE_PROPS_KEY ) ; for ( String key : constructState . getPropertyNames ( ) ) { setProp ( construct . name ( ) + "." + ( infix . isPresent ( ) ? infix . get ( ) + "." : "" ) + key , constructState . getProp ( ... |
public class SavedQueriesPanel { /** * < / editor - fold > / / GEN - END : initComponents */
private void selectQueryNode ( javax . swing . event . TreeSelectionEvent evt ) { } } | // GEN - FIRST : event _ selectQueryNode
String currentQuery = "" ; DefaultMutableTreeNode node = ( DefaultMutableTreeNode ) evt . getPath ( ) . getLastPathComponent ( ) ; if ( node instanceof QueryTreeElement ) { QueryTreeElement queryElement = ( QueryTreeElement ) node ; currentQuery = queryElement . getQuery ( ) ; c... |
public class CreateBrowserQuery { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . network . packet . AbstractPacket # serializeTo ( net . timewalker . ffmq4 . utils . RawDataOutputStream ) */
@ Override protected void serializeTo ( RawDataBuffer out ) { } } | super . serializeTo ( out ) ; out . writeInt ( browserId . asInt ( ) ) ; DestinationSerializer . serializeTo ( queue , out ) ; out . writeNullableUTF ( messageSelector ) ; |
public class CmsFocalPointController { /** * Saves the focal point to a property on the image . < p > */
public void reset ( ) { } } | if ( isEditable ( ) ) { String val = "" ; CmsUUID sid = m_imageInfoProvider . get ( ) . getStructureId ( ) ; List < CmsPropertyModification > propChanges = new ArrayList < > ( ) ; propChanges . add ( new CmsPropertyModification ( sid , CmsGwtConstants . PROPERTY_IMAGE_FOCALPOINT , val , false ) ) ; propChanges . add ( ... |
public class ObjectUtil { /** * { @ code null } 安全的对象比较 , { @ code null } 对象排在末尾
* @ param < T > 被比较对象类型
* @ param c1 对象1 , 可以为 { @ code null }
* @ param c2 对象2 , 可以为 { @ code null }
* @ return 比较结果 , 如果c1 & lt ; c2 , 返回数小于0 , c1 = = c2返回0 , c1 & gt ; c2 大于0
* @ since 3.0.7
* @ see java . util . Comparator ... | return CompareUtil . compare ( c1 , c2 ) ; |
public class ApacheHTTPResponse { /** * Wait for and then return the response body .
* @ return body of the response
* @ throws InterruptedException if interrupted while awaiting the response
* @ throws BOSHException on communication failure */
public AbstractBody getBody ( ) throws InterruptedException , BOSHExc... | if ( toThrow != null ) { throw ( toThrow ) ; } lock . lock ( ) ; try { if ( ! sent ) { awaitResponse ( ) ; } } finally { lock . unlock ( ) ; } return body ; |
public class ErrorDetectingWrapper { /** * Old - style calls , including multiquery , has its own wacky error format :
* < pre >
* " error _ code " : 602,
* " error _ msg " : " bogus is not a member of the user table . " ,
* " request _ args " : [
* " key " : " queries " ,
* " value " : " { " query1 " : " S... | JsonNode errorCode = node . get ( "error_code" ) ; if ( errorCode != null ) { int code = errorCode . intValue ( ) ; String msg = node . path ( "error_msg" ) . asText ( ) ; this . throwCodeAndMessage ( code , msg ) ; } |
public class AbstractGISGridSet { @ Override @ Pure public int indexOf ( Object obj ) { } } | if ( this . clazz . isInstance ( obj ) ) { return this . grid . indexOf ( this . clazz . cast ( obj ) ) ; } return - 1 ; |
public class DownloadService { /** * Loads JSON from a JSONP URL .
* Metadata for downloadables and update centers is offered in two formats , both designed for download from the browser ( predating { @ link DownloadSettings } ) :
* HTML using { @ code postMessage } for newer browsers , and JSONP as a fallback .
... | URLConnection con = ProxyConfiguration . open ( src ) ; if ( con instanceof HttpURLConnection ) { // prevent problems from misbehaving plugins disabling redirects by default
( ( HttpURLConnection ) con ) . setInstanceFollowRedirects ( true ) ; } try ( InputStream is = con . getInputStream ( ) ) { String jsonp = IOUtils... |
public class ResponseTimeRootCauseEntityMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ResponseTimeRootCauseEntity responseTimeRootCauseEntity , ProtocolMarshaller protocolMarshaller ) { } } | if ( responseTimeRootCauseEntity == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( responseTimeRootCauseEntity . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( responseTimeRootCauseEntity . getCoverage ( ) , COVERAGE_BINDING... |
public class ProjectIdValidator { /** * Check whether a string is a syntactically correct project ID . This method only checks syntax .
* It does not check that the ID actually identifies a project in the Google Cloud Platform .
* @ param id the alleged project ID
* @ return true if it ' s correct , false otherwi... | if ( id == null ) { return false ; } Matcher matcher = PROJECT_ID_REGEX . matcher ( id ) ; return matcher . matches ( ) ; |
public class RecoveryLogManagerImpl { /** * Returns a RecoveryLog that can be used to access a specific recovery log .
* Each recovery log is contained within a FailureScope . For example , the
* transaction service on a distributed system has a transaction log in each
* server node ( ie in each FailureScope ) . ... | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getRecoveryLog" , new java . lang . Object [ ] { failureScope , logProperties , this } ) ; /* 5 @ PK01151D */
// If we ' re on Z , we can have a ZLogProperties ( System Logger ) based
// recovery log . Otherwise , FileLogProperties and CustomLogProperties are the only s... |
public class LocalEventManager { /** * This method fires an Event
* @ param event the fired Event
* @ throws IllegalIDException not yet implemented
* @ throws org . intellimate . izou . events . MultipleEventsException if there is currently another event getting processed */
public void fireEvent ( EventModel eve... | if ( events == null ) return ; if ( events . isEmpty ( ) ) { events . add ( event ) ; } else { throw new org . intellimate . izou . events . MultipleEventsException ( ) ; } |
public class ApplicationReportIndexService { /** * Return a global application index ( not associated with a specific { @ link ProjectModel } ) . */
public ApplicationReportIndexModel getOrCreateGlobalApplicationIndex ( ) { } } | GraphTraversal < Vertex , Vertex > pipeline = getGraphContext ( ) . getGraph ( ) . traversal ( ) . V ( ) ; pipeline . has ( WindupVertexFrame . TYPE_PROP , ApplicationReportModel . TYPE ) ; pipeline . filter ( it -> ! it . get ( ) . edges ( Direction . OUT , ApplicationReportIndexModel . APPLICATION_REPORT_INDEX_TO_PRO... |
public class ClientDObjectMgr { /** * Notifies the subscribers that had requested this object ( for subscription ) that it is not
* available . */
protected void notifyFailure ( int oid , String message ) { } } | // let the penders know that the object is not available
PendingRequest < ? > req = _penders . remove ( oid ) ; if ( req == null ) { log . warning ( "Failed to get object, but no one cares?!" , "oid" , oid ) ; return ; } for ( int ii = 0 ; ii < req . targets . size ( ) ; ii ++ ) { req . targets . get ( ii ) . requestFa... |
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 > MutableMultimap < K , V > groupBy ( Iterable < V > iterable , Function < ? super V , ? extend... | return FJIterate . groupBy ( iterable , function , SynchronizedPutFastListMultimap . < K , V > newMultimap ( ) , batchSize , executor ) ; |
public class AmazonSQSMessagingClientWrapper { /** * Gets the queueUrl of a queue given a queue name owned by the provided accountId .
* @ param queueName
* @ param queueOwnerAccountId The AWS accountId of the account that created the queue
* @ return The response from the GetQueueUrl service method , as returned... | return getQueueUrl ( new GetQueueUrlRequest ( queueName ) . withQueueOwnerAWSAccountId ( queueOwnerAccountId ) ) ; |
public class ExtensionHttpSessions { /** * Gets all of the sites with http sessions .
* @ return all of the sites with http sessions */
public List < String > getSites ( ) { } } | List < String > sites = new ArrayList < String > ( ) ; if ( this . sessions == null ) { return sites ; } synchronized ( sessionLock ) { sites . addAll ( this . sessions . keySet ( ) ) ; } return sites ; |
public class GetGatewayResponseResult { /** * Response templates of the < a > GatewayResponse < / a > as a string - to - string map of key - value pairs .
* @ param responseTemplates
* Response templates of the < a > GatewayResponse < / a > as a string - to - string map of key - value pairs .
* @ return Returns a... | setResponseTemplates ( responseTemplates ) ; return this ; |
public class ListenerTimeMeasure { /** * This method wrap a { @ link MeasureManager } ( the wrapped ) into another one
* ( the wrapper ) which provides the same measures , excepted that any
* { @ link PushMeasure } returned by the wrapper will be automatically wrapped
* via { @ link # wrapMeasure ( PushMeasure ) ... | if ( wrapped == null ) { throw new IllegalArgumentException ( "No manager provided" ) ; } else if ( measureKey != null && wrapped . getMeasureKeys ( ) . contains ( measureKey ) ) { throw new IllegalArgumentException ( "The key " + measureKey + " is already used by the wrapped manager " + wrapped ) ; } else { MeasureMan... |
public class AnalyzeSpark { /** * Get a list of unique values from the specified columns .
* For sequence data , use { @ link # getUniqueSequence ( List , Schema , JavaRDD ) }
* @ param columnName Name of the column to get unique values from
* @ param schema Data schema
* @ param data Data to get unique values ... | int colIdx = schema . getIndexOfColumn ( columnName ) ; JavaRDD < Writable > ithColumn = data . map ( new SelectColumnFunction ( colIdx ) ) ; return ithColumn . distinct ( ) . collect ( ) ; |
public class JsonSchema { /** * { @ link InputType } of the elements composed within complex type .
* @ param itemKey
* @ return */
public InputType getElementTypeUsingKey ( String itemKey ) { } } | String type = this . getDataType ( ) . get ( itemKey ) . getAsString ( ) . toUpperCase ( ) ; return InputType . valueOf ( type ) ; |
public class ModelFactory { /** * Create a Model for a registered Blueprint using Erector .
* Values set in the model will not be overridden by defaults in the
* Blueprint .
* @ param < T > model class
* @ param erector Erector
* @ param referenceModel T the reference model instance , or null
* @ param with... | erector . clearCommands ( ) ; T createdModel ; try { createdModel = ( T ) createNewInstance ( erector ) ; } catch ( BlueprintTemplateException e ) { throw new CreateModelException ( e ) ; } logger . trace ( "Created model {} from {} based on {}" , new Object [ ] { createdModel , erector , referenceModel } ) ; final T n... |
public class CmsUploadBean { /** * Starts the upload . < p >
* @ return the response String ( JSON ) */
public String start ( ) { } } | // ensure that this method can only be called once
if ( m_called ) { throw new UnsupportedOperationException ( ) ; } m_called = true ; // create a upload listener
CmsUploadListener listener = createListener ( ) ; try { // try to parse the request
parseRequest ( listener ) ; // try to create the resources on the VFS
cre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.