signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class LoggingSnippets { /** * [ VARIABLE " my _ metric _ name " ] */
public Metric getMetricAsync ( String metricName ) throws ExecutionException , InterruptedException { } }
|
// [ START getMetricAsync ]
Future < Metric > future = logging . getMetricAsync ( metricName ) ; Metric metric = future . get ( ) ; if ( metric == null ) { // metric was not found
} // [ END getMetricAsync ]
return metric ;
|
public class VerboseFormatter { /** * Append thrown exception trace .
* @ param message The message builder .
* @ param event The log record . */
private static void appendThrown ( StringBuilder message , LogRecord event ) { } }
|
final Throwable thrown = event . getThrown ( ) ; if ( thrown != null ) { final StringWriter sw = new StringWriter ( ) ; thrown . printStackTrace ( new PrintWriter ( sw ) ) ; message . append ( sw ) ; }
|
public class ListOrganizationsResult { /** * The overview of owned organizations presented as a list of organization summaries .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setOrganizationSummaries ( java . util . Collection ) } or
* { @ link # withOrganizationSummaries ( java . util . Collection ) } if you want to override the existing values .
* @ param organizationSummaries
* The overview of owned organizations presented as a list of organization summaries .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListOrganizationsResult withOrganizationSummaries ( OrganizationSummary ... organizationSummaries ) { } }
|
if ( this . organizationSummaries == null ) { setOrganizationSummaries ( new java . util . ArrayList < OrganizationSummary > ( organizationSummaries . length ) ) ; } for ( OrganizationSummary ele : organizationSummaries ) { this . organizationSummaries . add ( ele ) ; } return this ;
|
public class BoxApiMetadata { /** * Gets a request that retrieves available metadata templates under the enterprise scope
* @ return request to retrieve available metadata templates */
public BoxRequestsMetadata . GetMetadataTemplates getMetadataTemplatesRequest ( ) { } }
|
BoxRequestsMetadata . GetMetadataTemplates request = new BoxRequestsMetadata . GetMetadataTemplates ( getMetadataTemplatesUrl ( ) , mSession ) ; return request ;
|
public class Mapper { /** * Map dynamically using a bean property name .
* @ param property the name of a bean property
* @ param i an iterator of objects
* @ return collection
* @ throws ClassCastException if there is an error invoking the method on any object . */
public static Collection beanMap ( String property , Iterator i ) { } }
|
return beanMap ( property , i , false ) ;
|
public class PlainTime { /** * / * [ deutsch ]
* < p > Definiert eine nat & uuml ; rliche Ordnung , die auf der zeitlichen
* Position basiert . < / p >
* < p > Der Vergleich ist konsistent mit { @ code equals ( ) } . < / p >
* @ see # isBefore ( PlainTime )
* @ see # isAfter ( PlainTime ) */
@ Override public int compareTo ( PlainTime time ) { } }
|
int delta = this . hour - time . hour ; if ( delta == 0 ) { delta = this . minute - time . minute ; if ( delta == 0 ) { delta = this . second - time . second ; if ( delta == 0 ) { delta = this . nano - time . nano ; } } } return ( ( delta < 0 ) ? - 1 : ( ( delta == 0 ) ? 0 : 1 ) ) ;
|
public class AWSCodeBuildClient { /** * Gets information about build projects .
* @ param batchGetProjectsRequest
* @ return Result of the BatchGetProjects operation returned by the service .
* @ throws InvalidInputException
* The input value that was provided is not valid .
* @ sample AWSCodeBuild . BatchGetProjects
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / codebuild - 2016-10-06 / BatchGetProjects " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public BatchGetProjectsResult batchGetProjects ( BatchGetProjectsRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeBatchGetProjects ( request ) ;
|
public class ConcurrentUtils { /** * Checks if a concurrent map contains a key and creates a corresponding
* value if not , suppressing checked exceptions . This method calls
* { @ code createIfAbsent ( ) } . If a { @ link ConcurrentException } is thrown , it
* is caught and re - thrown as a { @ link ConcurrentRuntimeException } .
* @ param < K > the type of the keys of the map
* @ param < V > the type of the values of the map
* @ param map the map to be modified
* @ param key the key of the value to be added
* @ param init the { @ link ConcurrentInitializer } for creating the value
* @ return the value stored in the map after this operation ; this may or may
* not be the object created by the { @ link ConcurrentInitializer }
* @ throws ConcurrentRuntimeException if the initializer throws an exception */
public static < K , V > V createIfAbsentUnchecked ( final ConcurrentMap < K , V > map , final K key , final ConcurrentInitializer < V > init ) { } }
|
try { return createIfAbsent ( map , key , init ) ; } catch ( final ConcurrentException cex ) { throw new ConcurrentRuntimeException ( cex . getCause ( ) ) ; }
|
public class FileHelper { /** * Reads a PID ( Process Id ) file
* @ param f
* File The process Id file ( must exist ! )
* @ param carefulProcessing
* boolean If true , non - numeric chars are stripped from the PID before it is parsed
* @ return String The process Id represented by the file ( or - 1 if the file doesn ' t exist )
* @ throws IOException
* On filesystem - level errors */
public static long readPID ( File f , boolean carefulProcessing ) throws IOException { } }
|
if ( f . exists ( ) ) { String pidString = cat ( f ) ; if ( carefulProcessing ) pidString = pidString . replaceAll ( "[^0-9]" , "" ) ; // Strip out anything that ' s not a number
else pidString = pidString . replace ( "\n" , "" ) ; // Just remove newlines
if ( pidString . length ( ) > 0 ) return Long . parseLong ( pidString ) ; else return - 1 ; } else { return - 1 ; }
|
public class NotesDao { /** * Retrieve those notes in the given area that match the given search string
* @ param handler The handler which is fed the incoming notes
* @ param bounds the area within the notes should be queried . This is usually limited at 25
* square degrees . Check the server capabilities .
* @ param search what to search for . Null to return everything .
* @ param limit number of entries returned at maximum . Any value between 1 and 10000
* @ param hideClosedNoteAfter number of days until a closed note should not be shown anymore .
* - 1 means that all notes should be returned , 0 that only open notes
* are returned .
* @ throws OsmQueryTooBigException if the bounds area is too large
* @ throws IllegalArgumentException if the bounds cross the 180th meridian
* @ throws OsmAuthorizationException if not logged in */
public void getAll ( BoundingBox bounds , String search , Handler < Note > handler , int limit , int hideClosedNoteAfter ) { } }
|
if ( limit <= 0 || limit > 10000 ) { throw new IllegalArgumentException ( "limit must be within 1 and 10000" ) ; } if ( bounds . crosses180thMeridian ( ) ) { throw new IllegalArgumentException ( "bounds may not cross the 180th meridian" ) ; } String searchQuery = "" ; if ( search != null && ! search . isEmpty ( ) ) { searchQuery = "&q=" + urlEncode ( search ) ; } final String call = NOTES + "?bbox=" + bounds . getAsLeftBottomRightTopString ( ) + searchQuery + "&limit=" + limit + "&closed=" + hideClosedNoteAfter ; try { osm . makeAuthenticatedRequest ( call , null , new NotesParser ( handler ) ) ; } catch ( OsmBadUserInputException e ) { // we can be more specific here
throw new OsmQueryTooBigException ( e ) ; }
|
public class InternalPureXbaseLexer { /** * $ ANTLR start " T _ _ 24" */
public final void mT__24 ( ) throws RecognitionException { } }
|
try { int _type = T__24 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalPureXbase . g : 22:7 : ( ' - = ' )
// InternalPureXbase . g : 22:9 : ' - = '
{ match ( "-=" ) ; } state . type = _type ; state . channel = _channel ; } finally { }
|
public class TacoTangoDevice { DeviceData command_inout ( String command , DeviceData argin ) throws DevFailed { } }
|
return tacoDevice . command_inout ( this , command , argin ) ;
|
public class HibernateSearchPropertyHelper { /** * Determines whether the given property path denotes an embedded entity ( not a property of such entity ) .
* @ param entityType the indexed type
* @ param propertyPath the path of interest
* @ return { @ code true } if the given path denotes an embedded entity of the given indexed type , { @ code false }
* otherwise . */
@ Override public boolean hasEmbeddedProperty ( Class < ? > entityType , String [ ] propertyPath ) { } }
|
EntityIndexBinding indexBinding = searchFactory . getIndexBindings ( ) . get ( entityType ) ; if ( indexBinding != null ) { ResolvedProperty resolvedProperty = resolveProperty ( indexBinding , propertyPath ) ; if ( resolvedProperty != null ) { return resolvedProperty . propertyMetadata == null ; } } return super . hasEmbeddedProperty ( entityType , propertyPath ) ;
|
public class SimpleNumberControl { /** * { @ inheritDoc } */
@ Override public void setupEventHandlers ( ) { } }
|
editableSpinner . getEditor ( ) . setOnKeyPressed ( event -> { switch ( event . getCode ( ) ) { case UP : editableSpinner . increment ( 1 ) ; break ; case DOWN : editableSpinner . decrement ( 1 ) ; break ; default : } } ) ;
|
public class Translations { /** * use configured language
* @ param id - the id of the message to retrieve
* @ param defaultMsg - string to use if the message is not defined or a language match is not found ( if null , then will default to english )
* @ return the message */
public String getMessage ( String id , String defaultMsg ) { } }
|
return getMessage ( id , lang , defaultMsg ) ;
|
public class ScreenFullAwt { /** * Check if the display mode is supported .
* @ param display The display mode to check .
* @ return Supported display , < code > null < / code > else . */
private DisplayMode isSupported ( DisplayMode display ) { } }
|
final DisplayMode [ ] supported = dev . getDisplayModes ( ) ; for ( final DisplayMode current : supported ) { final boolean multiDepth = current . getBitDepth ( ) != DisplayMode . BIT_DEPTH_MULTI && display . equals ( current ) ; if ( multiDepth || current . getBitDepth ( ) == DisplayMode . BIT_DEPTH_MULTI && display . getWidth ( ) == current . getWidth ( ) && display . getHeight ( ) == current . getHeight ( ) ) { return current ; } } return null ;
|
public class ResourceAwareObject { /** * Wouldn ' t it be nice if we wrote some tests ? */
protected ByteSource stream ( final String resourceId ) { } }
|
return new ByteSource ( ) { @ Override public InputStream openStream ( ) throws IOException { return loader . getResource ( resourceId ) . getInputStream ( ) ; } } ;
|
public class KeyVaultClientBaseImpl { /** * Updates the specified certificate issuer .
* The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity . This operation requires the certificates / setissuers permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param issuerName The name of the issuer .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < IssuerBundle > updateCertificateIssuerAsync ( String vaultBaseUrl , String issuerName , final ServiceCallback < IssuerBundle > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( updateCertificateIssuerWithServiceResponseAsync ( vaultBaseUrl , issuerName ) , serviceCallback ) ;
|
public class HlpEntitiesPage { /** * < p > Make SQL WHERE clause for boolean if need . < / p >
* @ param pSbWhere result clause
* @ param pRequestData - Request Data
* @ param pEntityClass - entity class
* @ param pFldNm - field name
* @ param pFilterMap - map to store current filter
* @ param pFilterAppearance - set to store current filter appearance
* if null - not required
* @ throws Exception - an Exception */
public final void tryMakeWhereBoolean ( final StringBuffer pSbWhere , final IRequestData pRequestData , final Class < ? > pEntityClass , final String pFldNm , final Map < String , Object > pFilterMap , final Set < String > pFilterAppearance ) throws Exception { } }
|
String nmRnd = pRequestData . getParameter ( "nmRnd" ) ; String fltOrdPrefix ; if ( nmRnd . contains ( "pickerDub" ) ) { fltOrdPrefix = "fltordPD" ; } else if ( nmRnd . contains ( "picker" ) ) { fltOrdPrefix = "fltordP" ; } else { fltOrdPrefix = "fltordM" ; } String fltforcedName = fltOrdPrefix + "forcedFor" ; String fltforced = pRequestData . getParameter ( fltforcedName ) ; if ( fltforced != null ) { pFilterMap . put ( fltforcedName , fltforced ) ; } String nmFldVal = fltOrdPrefix + pFldNm + "Val" ; String fltVal = pRequestData . getParameter ( nmFldVal ) ; if ( fltVal != null && ( fltVal . length ( ) == 0 || "null" . equals ( fltVal ) ) ) { fltVal = null ; } pFilterMap . put ( nmFldVal , fltVal ) ; if ( fltVal != null ) { int intVal = 0 ; if ( fltVal . equals ( "true" ) ) { intVal = 1 ; } String cond = pEntityClass . getSimpleName ( ) . toUpperCase ( ) + "." + pFldNm . toUpperCase ( ) + " = " + intVal ; if ( pSbWhere . toString ( ) . length ( ) == 0 ) { pSbWhere . append ( cond ) ; } else { pSbWhere . append ( " and " + cond ) ; } if ( pFilterAppearance != null ) { pFilterAppearance . add ( getSrvI18n ( ) . getMsg ( pFldNm ) + " = " + fltVal ) ; } }
|
public class ObjIntConsumerBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T > ObjIntConsumerBuilder < T > objIntConsumer ( Consumer < ObjIntConsumer < T > > consumer ) { } }
|
return new ObjIntConsumerBuilder ( consumer ) ;
|
public class DereferenceExpression { /** * If this DereferenceExpression looks like a QualifiedName , return QualifiedName .
* Otherwise return null */
public static QualifiedName getQualifiedName ( DereferenceExpression expression ) { } }
|
List < String > parts = tryParseParts ( expression . base , expression . field . getValue ( ) . toLowerCase ( Locale . ENGLISH ) ) ; return parts == null ? null : QualifiedName . of ( parts ) ;
|
public class InterleavedU8 { /** * Returns an integer formed from 3 bands . a [ i ] < < 16 | a [ i + 1 ] < < 8 | a [ i + 2]
* @ param x column
* @ param y row
* @ return 32 bit integer */
public int get24 ( int x , int y ) { } }
|
int i = startIndex + y * stride + x * 3 ; return ( ( data [ i ] & 0xFF ) << 16 ) | ( ( data [ i + 1 ] & 0xFF ) << 8 ) | ( data [ i + 2 ] & 0xFF ) ;
|
public class ESQuery { /** * Checks whether key exist in ES Query .
* @ param key
* the key
* @ return true , if is new key */
private boolean checkIfKeyExists ( String key ) { } }
|
if ( aggregationsKeySet == null ) { aggregationsKeySet = new HashSet < String > ( ) ; } return aggregationsKeySet . add ( key ) ;
|
public class SubGraphPredicate { /** * Determine if the subgraph , starting with the root function , matches the predicate
* @ param sameDiff SameDiff instance the function belongs to
* @ param rootFn Function that defines the root of the subgraph
* @ return True if the subgraph mathes the predicate */
public boolean matches ( SameDiff sameDiff , DifferentialFunction rootFn ) { } }
|
if ( ! root . matches ( sameDiff , rootFn ) ) { return false ; } SDVariable [ ] inputs = rootFn . args ( ) ; int inCount = inputs == null ? 0 : inputs . length ; if ( inputCount != null ) { if ( inCount != this . inputCount ) return false ; } SDVariable [ ] outputs = rootFn . outputVariables ( ) ; int outCount = outputs == null ? 0 : outputs . length ; if ( outputCount != null ) { if ( outCount != outputCount ) return false ; } for ( Map < Integer , OpPredicate > m : Arrays . asList ( opInputMatchPredicates , opInputSubgraphPredicates ) ) { for ( Map . Entry < Integer , OpPredicate > e : m . entrySet ( ) ) { int inNum = e . getKey ( ) ; if ( inNum >= inCount ) { return false ; } SDVariable in = inputs [ inNum ] ; DifferentialFunction df = sameDiff . getVariableOutputFunction ( in . getVarName ( ) ) ; if ( df == null || ! e . getValue ( ) . matches ( sameDiff , df ) ) { return false ; } } } return true ;
|
public class GoogleComputeInstanceMetadataResolver { /** * Get instance Metadata JSON .
* @ param url The metadata URL
* @ param connectionTimeoutMs connection timeout in millis
* @ param readTimeoutMs read timeout in millis
* @ return The Metadata JSON
* @ throws IOException Failed or interrupted I / O operations while reading from input stream .
* @ deprecated See { @ link io . micronaut . discovery . cloud . ComputeInstanceMetadataResolverUtils # readMetadataUrl ( URL , int , int , ObjectMapper , Map ) } */
@ Deprecated protected JsonNode readGcMetadataUrl ( URL url , int connectionTimeoutMs , int readTimeoutMs ) throws IOException { } }
|
return readMetadataUrl ( url , connectionTimeoutMs , readTimeoutMs , objectMapper , Collections . emptyMap ( ) ) ;
|
public class DisassociateCertificateRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DisassociateCertificateRequest disassociateCertificateRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( disassociateCertificateRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disassociateCertificateRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class FreeRingSoft { /** * Try to get an object from the free list . Returns null if the free list
* is empty .
* @ return the new object or null . */
public T allocate ( ) { } }
|
while ( true ) { SoftReference < T > ref ; ref = _ringQueue . poll ( ) ; if ( ref == null ) { return null ; } T value = ref . get ( ) ; if ( value != null ) { return value ; } }
|
public class GuidedDecisionTable52 { /** * This method expands Composite columns into individual columns where
* knowledge of individual columns is necessary ; for example separate
* columns in the user - interface or where individual columns need to be
* analysed .
* @ return A List of individual columns */
public List < BaseColumn > getExpandedColumns ( ) { } }
|
final List < BaseColumn > columns = new ArrayList < BaseColumn > ( ) ; columns . add ( rowNumberCol ) ; columns . add ( descriptionCol ) ; columns . addAll ( metadataCols ) ; columns . addAll ( attributeCols ) ; for ( CompositeColumn < ? > cc : this . conditionPatterns ) { boolean explode = ! ( cc instanceof LimitedEntryCol ) ; if ( explode ) { for ( BaseColumn bc : cc . getChildColumns ( ) ) { columns . add ( bc ) ; } } else { columns . add ( cc ) ; } } for ( ActionCol52 ac : this . actionCols ) { if ( ac instanceof BRLActionColumn ) { if ( ac instanceof LimitedEntryCol ) { columns . add ( ac ) ; } else { final BRLActionColumn bac = ( BRLActionColumn ) ac ; for ( BRLActionVariableColumn variable : bac . getChildColumns ( ) ) { columns . add ( variable ) ; } } } else { columns . add ( ac ) ; } } return columns ;
|
public class AnyValueMap { /** * Converts map element into a string or returns null if conversion is not
* possible .
* @ param key a key of element to get .
* @ return string value of the element or null if conversion is not supported .
* @ see StringConverter # toNullableString ( Object ) */
public String getAsNullableString ( String key ) { } }
|
Object value = getAsObject ( key ) ; return StringConverter . toNullableString ( value ) ;
|
public class ElementParentsIterable { /** * Creates stream with parent chain
* @ param element element to start with ( will be included to chain )
* @ return stream with elements from current with his parents until package ( inclusive ) */
public static Stream < Element > stream ( Element element ) { } }
|
return StreamSupport . stream ( new ElementParentsIterable ( element ) . spliterator ( ) , false ) ;
|
public class MessageProcessorMatching { /** * Method deregisterConsumerSetMonitor
* Deregisters a previously registered callback .
* @ param connection
* @ param callback
* @ throws SINotPossibleInCurrentConfigurationException */
public void deregisterConsumerSetMonitor ( ConnectionImpl connection , ConsumerSetChangeCallback callback ) throws SINotPossibleInCurrentConfigurationException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deregisterConsumerSetMonitor" , new Object [ ] { connection , callback } ) ; // Deregister under a lock on the targets table
synchronized ( _targets ) { _consumerMonitoring . deregisterConsumerSetMonitor ( connection , callback ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deregisterConsumerSetMonitor" ) ;
|
public class CompositeBinding { /** * Disposes itself and all inner Bindings .
* < p > After call of this method , new { @ code Binding } s added to { @ link CompositeBinding }
* will be disposed immediately . */
public void dispose ( ) { } }
|
if ( ! disposedInd ) { Collection < Binding > unsubscribe1 = null ; Collection < CompositeBinding > unsubscribe2 = null ; disposedInd = true ; unsubscribe1 = bindings ; unsubscribe2 = compBindings ; bindings = null ; compBindings = null ; // we will only get here once
unsubscribeFromAll ( unsubscribe1 ) ; unsubscribeFromAllComposite ( unsubscribe2 ) ; }
|
public class JsonParser { private void write ( JsonLikeWriter theEventWriter , String theChildName , BigDecimal theDecimalValue ) throws IOException { } }
|
theEventWriter . write ( theChildName , theDecimalValue ) ;
|
public class OracleHelper { /** * order of array is : 0 - clientId */
@ Override public void setClientInformationArray ( String [ ] clientInfoArray , WSRdbManagedConnectionImpl mc , boolean explicitCall ) throws SQLException { } }
|
// set the flag here even if the call fails , safer that way .
if ( explicitCall ) mc . clientInfoExplicitlySet = true ; else mc . clientInfoImplicitlySet = true ; // set the clientid in the matrix
matrix [ 1 /* OracleConnection . END _ TO _ END _ CLIENTID _ INDEX */
] = clientInfoArray [ 0 ] ; setEndToEndMetrics ( mc . sqlConn , matrix , ( short ) 0 ) ;
|
public class ListVolumeInitiatorsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListVolumeInitiatorsRequest listVolumeInitiatorsRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( listVolumeInitiatorsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listVolumeInitiatorsRequest . getVolumeARN ( ) , VOLUMEARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class Job { /** * Get a map of string properties .
* @ return map of properties , may be an empty map */
public Map < String , String > getProperties ( ) { } }
|
final Map < String , String > res = new HashMap < > ( ) ; for ( final Map . Entry < String , Object > e : prop . entrySet ( ) ) { if ( e . getValue ( ) instanceof String ) { res . put ( e . getKey ( ) , ( String ) e . getValue ( ) ) ; } } return Collections . unmodifiableMap ( res ) ;
|
public class FacebookProfileCreator { /** * Adds the token to the URL in question . If we require appsecret _ proof , then this method
* will also add the appsecret _ proof parameter to the URL , as Facebook expects .
* @ param url the URL to modify
* @ param accessToken the token we ' re passing back and forth
* @ return url with additional parameter ( s ) */
protected String addExchangeToken ( final String url , final OAuth2AccessToken accessToken ) { } }
|
final FacebookProfileDefinition profileDefinition = ( FacebookProfileDefinition ) configuration . getProfileDefinition ( ) ; final FacebookConfiguration facebookConfiguration = ( FacebookConfiguration ) configuration ; String computedUrl = url ; if ( facebookConfiguration . isUseAppsecretProof ( ) ) { computedUrl = profileDefinition . computeAppSecretProof ( computedUrl , accessToken , facebookConfiguration ) ; } return CommonHelper . addParameter ( computedUrl , EXCHANGE_TOKEN_PARAMETER , accessToken . getAccessToken ( ) ) ;
|
public class DiffusionDither { /** * Converts an int ARGB to int triplet . */
private static int [ ] toRGBArray ( int pARGB , int [ ] pBuffer ) { } }
|
pBuffer [ 0 ] = ( ( pARGB & 0x00ff0000 ) >> 16 ) ; pBuffer [ 1 ] = ( ( pARGB & 0x0000ff00 ) >> 8 ) ; pBuffer [ 2 ] = ( ( pARGB & 0x000000ff ) ) ; // pBuffer [ 3 ] = ( ( pARGB & 0xff00000 ) > > 24 ) ; / / alpha
return pBuffer ;
|
public class Schema { /** * Create a schema from a given json string
* @ param json the json to create the schema from
* @ return the created schema based on the json */
public static Schema fromJson ( String json ) { } }
|
try { return JsonMappers . getMapper ( ) . readValue ( json , Schema . class ) ; } catch ( Exception e ) { // TODO better exceptions
throw new RuntimeException ( e ) ; }
|
public class ProcessThread { /** * Match waiting thread waiting for given thread to be notified . */
public static @ Nonnull Predicate waitingOnLock ( final @ Nonnull String className ) { } }
|
return new Predicate ( ) { @ Override public boolean isValid ( @ Nonnull ProcessThread < ? , ? , ? > thread ) { final ThreadLock lock = thread . getWaitingOnLock ( ) ; return lock != null && lock . getClassName ( ) . equals ( className ) ; } } ;
|
public class GA4GHPicardRunner { /** * Parses cmd line with JCommander */
void parseCmdLine ( String [ ] args ) { } }
|
JCommander parser = new JCommander ( this , args ) ; parser . setProgramName ( "GA4GHPicardRunner" ) ; LOG . info ( "Cmd line parsed" ) ;
|
public class TagUtils { /** * Converts the global Tag list into a Map where the tag name is the key and the Tag the value .
* Either ordered or as - is , if the comparator is null .
* @ param tags the List of tags
* @ param comparator the comparator to use .
* @ return the Map of tags . Either ordered or as - is , if the comparator is null . */
public static Map < String , Tag > toSortedMap ( List < Tag > tags , Comparator < String > comparator ) { } }
|
Map < String , Tag > sortedMap ; if ( comparator == null ) sortedMap = new LinkedHashMap < > ( ) ; else sortedMap = new TreeMap < > ( comparator ) ; tags . forEach ( tag -> sortedMap . put ( tag . getName ( ) , tag ) ) ; return sortedMap ;
|
public class Security { /** * Returns a Set of Strings containing the names of all available
* algorithms or types for the specified Java cryptographic service
* ( e . g . , Signature , MessageDigest , Cipher , Mac , KeyStore ) . Returns
* an empty Set if there is no provider that supports the
* specified service or if serviceName is null . For a complete list
* of Java cryptographic services , please see the
* < a href = " { @ docRoot } openjdk - redirect . html ? v = 8 & path = / technotes / guides / security / crypto / CryptoSpec . html " > Java
* Cryptography Architecture API Specification & amp ; Reference < / a > .
* Note : the returned set is immutable .
* @ param serviceName the name of the Java cryptographic
* service ( e . g . , Signature , MessageDigest , Cipher , Mac , KeyStore ) .
* Note : this parameter is case - insensitive .
* @ return a Set of Strings containing the names of all available
* algorithms or types for the specified Java cryptographic service
* or an empty set if no provider supports the specified service .
* @ since 1.4 */
public static Set < String > getAlgorithms ( String serviceName ) { } }
|
if ( ( serviceName == null ) || ( serviceName . length ( ) == 0 ) || ( serviceName . endsWith ( "." ) ) ) { return Collections . EMPTY_SET ; } HashSet < String > result = new HashSet < > ( ) ; Provider [ ] providers = Security . getProviders ( ) ; for ( int i = 0 ; i < providers . length ; i ++ ) { // Check the keys for each provider .
for ( Enumeration < Object > e = providers [ i ] . keys ( ) ; e . hasMoreElements ( ) ; ) { String currentKey = ( ( String ) e . nextElement ( ) ) . toUpperCase ( ) ; if ( currentKey . startsWith ( serviceName . toUpperCase ( ) ) ) { // We should skip the currentKey if it contains a
// whitespace . The reason is : such an entry in the
// provider property contains attributes for the
// implementation of an algorithm . We are only interested
// in entries which lead to the implementation
// classes .
if ( currentKey . indexOf ( " " ) < 0 ) { result . add ( currentKey . substring ( serviceName . length ( ) + 1 ) ) ; } } } } return Collections . unmodifiableSet ( result ) ;
|
public class ConvertRaster { /** * Checks to see if it is a known byte format */
public static boolean isKnownByteFormat ( BufferedImage image ) { } }
|
int type = image . getType ( ) ; return type != BufferedImage . TYPE_BYTE_INDEXED && type != BufferedImage . TYPE_BYTE_BINARY && type != BufferedImage . TYPE_CUSTOM ;
|
public class LUDecompositionBase_DDRM { /** * Writes the upper triangular matrix into the specified matrix .
* @ param upper Where the upper triangular matrix is writen to . */
@ Override public DMatrixRMaj getUpper ( DMatrixRMaj upper ) { } }
|
int numRows = LU . numRows < LU . numCols ? LU . numRows : LU . numCols ; int numCols = LU . numCols ; upper = UtilDecompositons_DDRM . checkZerosLT ( upper , numRows , numCols ) ; for ( int i = 0 ; i < numRows ; i ++ ) { for ( int j = i ; j < numCols ; j ++ ) { upper . unsafe_set ( i , j , LU . unsafe_get ( i , j ) ) ; } } return upper ;
|
public class JobState { /** * Add a collection of { @ link TaskState } s .
* @ param taskStates collection of { @ link TaskState } s to add */
public void addTaskStates ( Collection < TaskState > taskStates ) { } }
|
for ( TaskState taskState : taskStates ) { this . taskStates . put ( taskState . getTaskId ( ) , taskState ) ; }
|
public class Scs_cumsum { /** * p [ 0 . f . n ] = cumulative sum of c [ 0 . f . n - 1 ] , and then copy p [ 0 . f . n - 1 ] into c
* @ param p
* size n + 1 , cumulative sum of c
* @ param c
* size n , overwritten with p [ 0 . f . n - 1 ] on output
* @ param n
* length of c
* @ return sum ( c ) , null on error */
public static int cs_cumsum ( int [ ] p , int [ ] c , int n ) { } }
|
int i , nz = 0 ; float nz2 = 0 ; if ( p == null || c == null ) return ( - 1 ) ; /* check inputs */
for ( i = 0 ; i < n ; i ++ ) { p [ i ] = nz ; nz += c [ i ] ; nz2 += c [ i ] ; /* also in float to avoid int overflow */
c [ i ] = p [ i ] ; /* also copy p [ 0 . f . n - 1 ] back into c [ 0 . f . n - 1] */
} p [ n ] = nz ; return ( int ) nz2 ; /* return sum ( c [ 0 . f . n - 1 ] ) */
|
public class HttpInputStream { /** * Read Http body from input stream as a string basing on the content length on the method .
* @ param httpHeader
* @ return Http body */
public synchronized HttpRequestBody readRequestBody ( HttpHeader httpHeader ) { } }
|
int contentLength = httpHeader . getContentLength ( ) ; // -1 = default to unlimited length until connection close
HttpRequestBody body = ( contentLength > 0 ) ? new HttpRequestBody ( contentLength ) : new HttpRequestBody ( ) ; readBody ( contentLength , body ) ; return body ;
|
public class BaseFlowGraph { /** * Delete a { @ link DataNode } by its identifier
* @ param nodeId identifier of the { @ link DataNode } to be deleted .
* @ return true if { @ link DataNode } is successfully deleted . */
@ Override public boolean deleteDataNode ( String nodeId ) { } }
|
try { rwLock . writeLock ( ) . lock ( ) ; return this . dataNodeMap . containsKey ( nodeId ) && deleteDataNode ( this . dataNodeMap . get ( nodeId ) ) ; } finally { rwLock . writeLock ( ) . unlock ( ) ; }
|
public class EndianNumbers { /** * Converting four bytes to a Big Endian integer .
* @ param b1 the first byte .
* @ param b2 the second byte .
* @ param b3 the third byte .
* @ param b4 the fourth byte .
* @ return the conversion result */
@ Pure public static int toBEInt ( int b1 , int b2 , int b3 , int b4 ) { } }
|
return ( ( b1 & 0xFF ) << 24 ) + ( ( b2 & 0xFF ) << 16 ) + ( ( b3 & 0xFF ) << 8 ) + ( b4 & 0xFF ) ;
|
public class MapTileProviderBase { /** * Called by implementation class methods indicating that they have failed to retrieve the
* requested map tile . a MAPTILE _ FAIL _ ID message is sent .
* @ param pState
* the map tile request state object */
@ Override public void mapTileRequestFailed ( final MapTileRequestState pState ) { } }
|
if ( mTileNotFoundImage != null ) { putTileIntoCache ( pState . getMapTile ( ) , mTileNotFoundImage , ExpirableBitmapDrawable . NOT_FOUND ) ; for ( final Handler handler : mTileRequestCompleteHandlers ) { if ( handler != null ) { handler . sendEmptyMessage ( MAPTILE_SUCCESS_ID ) ; } } } else { for ( final Handler handler : mTileRequestCompleteHandlers ) { if ( handler != null ) { handler . sendEmptyMessage ( MAPTILE_FAIL_ID ) ; } } } if ( Configuration . getInstance ( ) . isDebugTileProviders ( ) ) { Log . d ( IMapView . LOGTAG , "MapTileProviderBase.mapTileRequestFailed(): " + MapTileIndex . toString ( pState . getMapTile ( ) ) ) ; }
|
public class CreativeWrapper { /** * Sets the ordering value for this CreativeWrapper .
* @ param ordering * If there are multiple wrappers for a creative , then
* { @ code ordering } defines the order in which the HTML
* snippets are rendered . */
public void setOrdering ( com . google . api . ads . admanager . axis . v201808 . CreativeWrapperOrdering ordering ) { } }
|
this . ordering = ordering ;
|
public class DefaultApplicationContext { /** * Creates the default environment for the given environment name .
* @ deprecated Use { @ link # createEnvironment ( ApplicationContextConfiguration ) } instead
* @ param environmentNames The environment name
* @ return The environment instance */
@ Deprecated protected @ Nonnull DefaultEnvironment createEnvironment ( @ Nonnull String ... environmentNames ) { } }
|
return createEnvironment ( ( ) -> Arrays . asList ( environmentNames ) ) ;
|
public class BaseAsyncInterceptor { /** * Invoke the next interceptor , possibly with a new command , and execute an { @ link InvocationCallback }
* after all the interceptors have finished successfully .
* < p > You need to wrap the result with { @ link # makeStage ( Object ) } if you need to add another handler . < / p > */
public final Object invokeNextThenAccept ( InvocationContext ctx , VisitableCommand command , InvocationSuccessAction action ) { } }
|
try { Object rv ; if ( nextDDInterceptor != null ) { rv = command . acceptVisitor ( ctx , nextDDInterceptor ) ; } else { rv = nextInterceptor . visitCommand ( ctx , command ) ; } if ( rv instanceof InvocationStage ) { return ( ( InvocationStage ) rv ) . thenAccept ( ctx , command , action ) ; } action . accept ( ctx , command , rv ) ; return rv ; } catch ( Throwable throwable ) { return new SimpleAsyncInvocationStage ( throwable ) ; }
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RuleType } { @ code > } } */
@ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" , name = "Rule" ) public JAXBElement < RuleType > createRule ( RuleType value ) { } }
|
return new JAXBElement < RuleType > ( _Rule_QNAME , RuleType . class , null , value ) ;
|
public class LdaGibbsSampler { /** * Print table of multinomial data
* @ param data
* vector of evidence
* @ param fmax
* max frequency in display
* the scaled histogram bin values */
public static void hist ( float [ ] data , int fmax ) { } }
|
float [ ] hist = new float [ data . length ] ; // scale maximum
float hmax = 0 ; for ( int i = 0 ; i < data . length ; i ++ ) { hmax = Math . max ( data [ i ] , hmax ) ; } float shrink = fmax / hmax ; for ( int i = 0 ; i < data . length ; i ++ ) { hist [ i ] = shrink * data [ i ] ; } NumberFormat nf = new DecimalFormat ( "00" ) ; String scale = "" ; for ( int i = 1 ; i < fmax / 10 + 1 ; i ++ ) { scale += " . " + i % 10 ; } System . out . println ( "x" + nf . format ( hmax / fmax ) + "\t0" + scale ) ; for ( int i = 0 ; i < hist . length ; i ++ ) { System . out . print ( i + "\t|" ) ; for ( int j = 0 ; j < Math . round ( hist [ i ] ) ; j ++ ) { if ( ( j + 1 ) % 10 == 0 ) System . out . print ( "]" ) ; else System . out . print ( "|" ) ; } System . out . println ( ) ; }
|
public class WebInterfaceUtils { /** * Determines whether or not the given node contains web content .
* @ param node The node to evaluate
* @ return { @ code true } if the node contains web content , { @ code false } otherwise */
public static boolean supportsWebActions ( AccessibilityNodeInfoCompat node ) { } }
|
return AccessibilityNodeInfoUtils . supportsAnyAction ( node , AccessibilityNodeInfoCompat . ACTION_NEXT_HTML_ELEMENT , AccessibilityNodeInfoCompat . ACTION_PREVIOUS_HTML_ELEMENT ) ;
|
public class HttpResourceModel { /** * Gathers all parameters ' annotations for the given method , starting from the third parameter . */
private List < Map < Class < ? extends Annotation > , ParameterInfo < ? > > > createParametersInfos ( Method method ) { } }
|
if ( method . getParameterTypes ( ) . length <= 2 ) { return Collections . emptyList ( ) ; } List < Map < Class < ? extends Annotation > , ParameterInfo < ? > > > result = new ArrayList < > ( ) ; Type [ ] parameterTypes = method . getGenericParameterTypes ( ) ; Annotation [ ] [ ] parameterAnnotations = method . getParameterAnnotations ( ) ; for ( int i = 2 ; i < parameterAnnotations . length ; i ++ ) { Annotation [ ] annotations = parameterAnnotations [ i ] ; Map < Class < ? extends Annotation > , ParameterInfo < ? > > paramAnnotations = new IdentityHashMap < > ( ) ; for ( Annotation annotation : annotations ) { Class < ? extends Annotation > annotationType = annotation . annotationType ( ) ; ParameterInfo < ? > parameterInfo ; if ( PathParam . class . isAssignableFrom ( annotationType ) ) { parameterInfo = ParameterInfo . create ( annotation , ParamConvertUtils . createPathParamConverter ( parameterTypes [ i ] ) ) ; } else if ( QueryParam . class . isAssignableFrom ( annotationType ) ) { parameterInfo = ParameterInfo . create ( annotation , ParamConvertUtils . createQueryParamConverter ( parameterTypes [ i ] ) ) ; } else if ( HeaderParam . class . isAssignableFrom ( annotationType ) ) { parameterInfo = ParameterInfo . create ( annotation , ParamConvertUtils . createHeaderParamConverter ( parameterTypes [ i ] ) ) ; } else { parameterInfo = ParameterInfo . create ( annotation , null ) ; } paramAnnotations . put ( annotationType , parameterInfo ) ; } // Must have either @ PathParam , @ QueryParam or @ HeaderParam , but not two or more .
int presence = 0 ; for ( Class < ? extends Annotation > annotationClass : paramAnnotations . keySet ( ) ) { if ( SUPPORTED_PARAM_ANNOTATIONS . contains ( annotationClass ) ) { presence ++ ; } } if ( presence != 1 ) { throw new IllegalArgumentException ( String . format ( "Must have exactly one annotation from %s for parameter %d in method %s" , SUPPORTED_PARAM_ANNOTATIONS , i , method ) ) ; } result . add ( Collections . unmodifiableMap ( paramAnnotations ) ) ; } return Collections . unmodifiableList ( result ) ;
|
public class CharSkippingBufferedString { /** * Marks a character in the backing array as skipped . Such character is no longer serialized when toString ( ) method
* is called on this buffer .
* @ param skippedCharIndex Index of the character in the backing array to skip */
protected final void skipIndex ( final int skippedCharIndex ) { } }
|
_bufferedString . addChar ( ) ; if ( _skipped . length == 0 || _skipped [ _skipped . length - 1 ] != - 1 ) { _skipped = Arrays . copyOf ( _skipped , Math . max ( _skipped . length + 1 , 1 ) ) ; } _skipped [ _skippedWriteIndex ] = skippedCharIndex ; _skippedWriteIndex ++ ;
|
public class CmsResourceHistoryTable { /** * Helper method for adding a table column with a given width and label . < p >
* @ param label the column label
* @ param width the column width in pixels
* @ param col the column to add */
private void addColumn ( String label , int width , Column < CmsHistoryResourceBean , ? > col ) { } }
|
addColumn ( col , label ) ; setColumnWidth ( col , width , Unit . PX ) ;
|
public class EncoderConverter { /** * Retrieve ( in string format ) from this field .
* @ return This field as a percent string . */
public String getString ( ) { } }
|
String string = super . getString ( ) ; if ( ( string != null ) && ( string . length ( ) > 0 ) ) string = this . decodeString ( string ) ; return string ;
|
public class Matrix { /** * Adds one row to matrix .
* @ param i the row index
* @ return matrix with row . */
public Matrix insertRow ( int i , Vector row ) { } }
|
if ( i > rows || i < 0 ) { throw new IndexOutOfBoundsException ( "Illegal row number, must be 0.." + rows ) ; } Matrix result ; if ( columns == 0 ) { result = blankOfShape ( rows + 1 , row . length ( ) ) ; } else { result = blankOfShape ( rows + 1 , columns ) ; } for ( int ii = 0 ; ii < i ; ii ++ ) { result . setRow ( ii , getRow ( ii ) ) ; } result . setRow ( i , row ) ; for ( int ii = i ; ii < rows ; ii ++ ) { result . setRow ( ii + 1 , getRow ( ii ) ) ; } return result ;
|
public class SecurityDomain { /** * Initialize the key and trust stores
* @ throws SecurityDomainException */
protected void initStores ( ) throws SecurityDomainException { } }
|
setDomainEnvironment ( ) ; char [ ] keyStorePasswd = domainProperties . getProperty ( JAVAX_NET_SSL_KEYSTORE_PASSWORD , "" ) . toCharArray ( ) ; char [ ] trustStorePasswd = domainProperties . getProperty ( JAVAX_NET_SSL_TRUSTSTORE_PASSWORD , "" ) . toCharArray ( ) ; String keyStoreName = domainProperties . getProperty ( JAVAX_NET_SSL_KEYSTORE , null ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Name of key store for security domain " + name + " is " + keyStoreName ) ; if ( keyStoreName == null ) { restoreSystemEnvironment ( ) ; throw new SecurityDomainException ( name , "Key Store file is undefined" ) ; } String trustStoreName = domainProperties . getProperty ( JAVAX_NET_SSL_TRUSTSTORE , null ) ; if ( logger . isDebugEnabled ( ) ) { if ( trustStoreName != null ) { logger . debug ( "Name of trust store for security domain " + name + " is " + trustStoreName ) ; } else { logger . debug ( "Name of trust store for security domain " + name + " was not defined. Default trust store from JVM will be used" ) ; } } // Key Store
try { InputStream keystoreInputStream = preBufferInputStream ( new FileInputStream ( keyStoreName ) ) ; initKeyStore ( keystoreInputStream , keyStorePasswd ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Key store for security domain " + name + " initialized successfully" ) ; } catch ( NoSuchAlgorithmException e ) { String msg = "Error: Key Store Manager Algorithm " + KeyManagerFactory . getDefaultAlgorithm ( ) + " is not supported. " + e . getLocalizedMessage ( ) ; logger . error ( msg ) ; restoreSystemEnvironment ( ) ; throw new SecurityDomainException ( name , msg , e ) ; } catch ( CertificateException | IOException | UnrecoverableKeyException e ) { String msg = "Error loading key store file " + keyStoreName + ". " + e . getLocalizedMessage ( ) ; logger . error ( msg ) ; restoreSystemEnvironment ( ) ; throw new SecurityDomainException ( name , msg , e ) ; } if ( trustStoreName != null ) { // Trust Store
try { InputStream trustoreInputStream = preBufferInputStream ( new FileInputStream ( trustStoreName ) ) ; initTrustStore ( trustoreInputStream , trustStorePasswd ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Trust store for security domain " + name + " initialized successfully" ) ; } catch ( NoSuchAlgorithmException e ) { String msg = "Error: Key Store Manager Algorithm " + KeyManagerFactory . getDefaultAlgorithm ( ) + " is not supported. " + e . getLocalizedMessage ( ) ; logger . error ( msg ) ; restoreSystemEnvironment ( ) ; throw new SecurityDomainException ( name , msg , e ) ; } catch ( CertificateException e ) { String msg = "Error loading trust store file " + trustStoreName + ". " + e . getLocalizedMessage ( ) ; logger . error ( msg ) ; restoreSystemEnvironment ( ) ; throw new SecurityDomainException ( name , msg , e ) ; } catch ( IOException e ) { String msg = "Error loading trust store file " + trustStoreName + ". " + e . getLocalizedMessage ( ) ; logger . error ( msg ) ; restoreSystemEnvironment ( ) ; throw new SecurityDomainException ( name , msg , e ) ; } } restoreSystemEnvironment ( ) ;
|
public class NumberRange { /** * Decrements by given step
* @ param value the value to decrement
* @ param step the amount to decrement
* @ return the decremented value */
@ SuppressWarnings ( "unchecked" ) private Comparable decrement ( Object value , Number step ) { } }
|
return ( Comparable ) minus ( ( Number ) value , step ) ;
|
public class AmazonEC2Client { /** * Describes the permissions for your network interfaces .
* @ param describeNetworkInterfacePermissionsRequest
* Contains the parameters for DescribeNetworkInterfacePermissions .
* @ return Result of the DescribeNetworkInterfacePermissions operation returned by the service .
* @ sample AmazonEC2 . DescribeNetworkInterfacePermissions
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DescribeNetworkInterfacePermissions "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeNetworkInterfacePermissionsResult describeNetworkInterfacePermissions ( DescribeNetworkInterfacePermissionsRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeNetworkInterfacePermissions ( request ) ;
|
public class ActivityChooserModel { /** * Persists the history data to the backing file if the latter
* was provided . Calling this method before a call to { @ link # readHistoricalData ( ) }
* throws an exception . Calling this method more than one without choosing an
* activity has not effect .
* @ throws IllegalStateException If this method is called before a call to
* { @ link # readHistoricalData ( ) } . */
private void persistHistoricalData ( ) { } }
|
synchronized ( mInstanceLock ) { if ( ! mReadShareHistoryCalled ) { throw new IllegalStateException ( "No preceding call to #readHistoricalData" ) ; } if ( ! mHistoricalRecordsChanged ) { return ; } mHistoricalRecordsChanged = false ; mCanReadHistoricalData = true ; if ( ! TextUtils . isEmpty ( mHistoryFileName ) ) { /* AsyncTask . */
SERIAL_EXECUTOR . execute ( new HistoryPersister ( ) ) ; } }
|
public class SpringBootUtil { /** * Read the value of the classifier configuration parameter from the
* spring - boot - maven - plugin
* @ param project
* @ param log
* @ return the value if it was found , null otherwise */
public static String getSpringBootMavenPluginClassifier ( MavenProject project , Log log ) { } }
|
String classifier = null ; try { classifier = MavenProjectUtil . getPluginGoalConfigurationString ( project , "org.springframework.boot:spring-boot-maven-plugin" , "repackage" , "classifier" ) ; } catch ( PluginScenarioException e ) { log . debug ( "No classifier found for spring-boot-maven-plugin" ) ; } return classifier ;
|
public class ToSAXHandler { /** * This method gets the node ' s value as a String and uses that String as if
* it were an input character notification .
* @ param node the Node to serialize
* @ throws org . xml . sax . SAXException */
public void characters ( org . w3c . dom . Node node ) throws org . xml . sax . SAXException { } }
|
// remember the current node
if ( m_state != null ) { m_state . setCurrentNode ( node ) ; } // Get the node ' s value as a String and use that String as if
// it were an input character notification .
String data = node . getNodeValue ( ) ; if ( data != null ) { this . characters ( data ) ; }
|
public class AbstractTextFileConverter { /** * Prepare the output stream .
* @ param outputFileName
* the file to write into .
* @ throws IOException
* if a problem occurs . */
private void openOutputFile ( final String outputFileName ) throws IOException { } }
|
myOutputFile = new File ( outputFileName ) ; myOutputStream = new FileOutputStream ( myOutputFile ) ; myStreamWriter = new OutputStreamWriter ( myOutputStream , getOutputEncodingCode ( ) ) ; myBufferedWriter = new BufferedWriter ( myStreamWriter ) ;
|
public class NetworkEndpointGroupClient { /** * Deletes the specified network endpoint group . The network endpoints in the NEG and the VM
* instances they belong to are not terminated when the NEG is deleted . Note that the NEG cannot
* be deleted if there are backend services referencing it .
* < p > Sample code :
* < pre > < code >
* try ( NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient . create ( ) ) {
* ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName . of ( " [ PROJECT ] " , " [ ZONE ] " , " [ NETWORK _ ENDPOINT _ GROUP ] " ) ;
* Operation response = networkEndpointGroupClient . deleteNetworkEndpointGroup ( networkEndpointGroup ) ;
* < / code > < / pre >
* @ param networkEndpointGroup The name of the network endpoint group to delete . It should comply
* with RFC1035.
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation deleteNetworkEndpointGroup ( ProjectZoneNetworkEndpointGroupName networkEndpointGroup ) { } }
|
DeleteNetworkEndpointGroupHttpRequest request = DeleteNetworkEndpointGroupHttpRequest . newBuilder ( ) . setNetworkEndpointGroup ( networkEndpointGroup == null ? null : networkEndpointGroup . toString ( ) ) . build ( ) ; return deleteNetworkEndpointGroup ( request ) ;
|
public class CommerceTaxFixedRateAddressRelLocalServiceBaseImpl { /** * Deletes the commerce tax fixed rate address rel with the primary key from the database . Also notifies the appropriate model listeners .
* @ param commerceTaxFixedRateAddressRelId the primary key of the commerce tax fixed rate address rel
* @ return the commerce tax fixed rate address rel that was removed
* @ throws PortalException if a commerce tax fixed rate address rel with the primary key could not be found */
@ Indexable ( type = IndexableType . DELETE ) @ Override public CommerceTaxFixedRateAddressRel deleteCommerceTaxFixedRateAddressRel ( long commerceTaxFixedRateAddressRelId ) throws PortalException { } }
|
return commerceTaxFixedRateAddressRelPersistence . remove ( commerceTaxFixedRateAddressRelId ) ;
|
public class ConfigUtils { /** * Method is used to retrieve a URI from a configuration key .
* @ param config Config to read
* @ param key Key to read
* @ return URI for the value . */
public static URI uri ( AbstractConfig config , String key ) { } }
|
final String value = config . getString ( key ) ; return uri ( key , value ) ;
|
public class DiskStorageCache { /** * Test if the cache size has exceeded its limits , and if so , evict some files .
* It also calls maybeUpdateFileCacheSize
* This method uses mLock for synchronization purposes . */
private void maybeEvictFilesInCacheDir ( ) throws IOException { } }
|
synchronized ( mLock ) { boolean calculatedRightNow = maybeUpdateFileCacheSize ( ) ; // Update the size limit ( mCacheSizeLimit )
updateFileCacheSizeLimit ( ) ; long cacheSize = mCacheStats . getSize ( ) ; // If we are going to evict force a recalculation of the size
// ( except if it was already calculated ! )
if ( cacheSize > mCacheSizeLimit && ! calculatedRightNow ) { mCacheStats . reset ( ) ; maybeUpdateFileCacheSize ( ) ; } // If size has exceeded the size limit , evict some files
if ( cacheSize > mCacheSizeLimit ) { evictAboveSize ( mCacheSizeLimit * 9 / 10 , CacheEventListener . EvictionReason . CACHE_FULL ) ; // 90%
} }
|
public class UriTemplate { /** * Expand the template of a composite map property . Eg : If d : = [ ( " semi " , " ; " ) , ( " dot " ,
* " . " ) , ( " comma " , " , " ) ] then { / d * } is expanded to " / semi = % 3B / dot = . / comma = % 2C "
* @ param varName The name of the variable the value corresponds to . Eg : " d "
* @ param map The map property value . Eg : [ ( " semi " , " ; " ) , ( " dot " , " . " ) , ( " comma " , " , " ) ]
* @ param containsExplodeModifier Set to true if the template contains the explode modifier " * "
* @ param compositeOutput An instance of CompositeOutput . Contains information on how the
* expansion should be done
* @ return The expanded map template
* @ throws IllegalArgumentException if the required list path parameter is map */
private static String getMapPropertyValue ( String varName , Map < String , Object > map , boolean containsExplodeModifier , CompositeOutput compositeOutput ) { } }
|
if ( map . isEmpty ( ) ) { return "" ; } StringBuilder retBuf = new StringBuilder ( ) ; String joiner ; String mapElementsJoiner ; if ( containsExplodeModifier ) { joiner = compositeOutput . getExplodeJoiner ( ) ; mapElementsJoiner = "=" ; } else { joiner = COMPOSITE_NON_EXPLODE_JOINER ; mapElementsJoiner = COMPOSITE_NON_EXPLODE_JOINER ; if ( compositeOutput . requiresVarAssignment ( ) ) { retBuf . append ( CharEscapers . escapeUriPath ( varName ) ) ; retBuf . append ( "=" ) ; } } for ( Iterator < Map . Entry < String , Object > > mapIterator = map . entrySet ( ) . iterator ( ) ; mapIterator . hasNext ( ) ; ) { Map . Entry < String , Object > entry = mapIterator . next ( ) ; String encodedKey = compositeOutput . getEncodedValue ( entry . getKey ( ) ) ; String encodedValue = compositeOutput . getEncodedValue ( entry . getValue ( ) . toString ( ) ) ; retBuf . append ( encodedKey ) ; retBuf . append ( mapElementsJoiner ) ; retBuf . append ( encodedValue ) ; if ( mapIterator . hasNext ( ) ) { retBuf . append ( joiner ) ; } } return retBuf . toString ( ) ;
|
public class LocationBasedPopupHandler { /** * Prepare all { @ link LocationBasedAction } s that are contained in the
* items of the menu based on the component and coordinates of the
* given mouse event
* @ param e The mouse event */
private void prepareAndShowPopup ( MouseEvent e ) { } }
|
prepareMenu ( popupMenu , e . getComponent ( ) , e . getX ( ) , e . getY ( ) ) ; popupMenu . show ( e . getComponent ( ) , e . getX ( ) , e . getY ( ) ) ;
|
public class DERUTCTime { /** * return an UTC Time from the passed in object .
* @ exception IllegalArgumentException if the object cannot be converted . */
public static DERUTCTime getInstance ( Object obj ) { } }
|
if ( obj == null || obj instanceof DERUTCTime ) { return ( DERUTCTime ) obj ; } if ( obj instanceof ASN1OctetString ) { return new DERUTCTime ( ( ( ASN1OctetString ) obj ) . getOctets ( ) ) ; } throw new IllegalArgumentException ( "illegal object in getInstance: " + obj . getClass ( ) . getName ( ) ) ;
|
public class MultiIndex { /** * Recursively creates an index starting with the NodeState
* < code > node < / code > .
* @ param tasks
* the queue of existing indexing tasks
* @ param node
* the current NodeState .
* @ param stateMgr
* the shared item state manager .
* @ param count
* the number of nodes already indexed .
* @ param nodeData
* the node data to index .
* @ throws IOException
* if an error occurs while writing to the index .
* @ throws RepositoryException
* if any other error occurs
* @ throws InterruptedException
* if the task has been interrupted */
private void createIndex ( final Queue < Callable < Void > > tasks , final NodeData node , final ItemDataConsumer stateMgr , final AtomicLong count , final NodeData nodeData , final AtomicLong processed ) throws RepositoryException , IOException , InterruptedException { } }
|
NodeData childState = null ; try { childState = ( NodeData ) stateMgr . getItemData ( nodeData . getIdentifier ( ) ) ; } catch ( RepositoryException e ) { LOG . error ( "Error indexing subtree " + node . getQPath ( ) . getAsString ( ) + ". Check JCR consistency. " + e . getMessage ( ) , e ) ; return ; } if ( childState == null ) { LOG . error ( "Error indexing subtree " + node . getQPath ( ) . getAsString ( ) + ". Item not found." ) ; return ; } if ( nodeData != null ) { createIndex ( tasks , nodeData , stateMgr , count , processed ) ; }
|
public class TransportLayerImpl { /** * { @ inheritDoc } Only one destination can be created per remote address . If a
* destination with the supplied remote address already exists for this transport
* layer , a { @ link KNXIllegalArgumentException } is thrown . < br >
* A transport layer can only handle one connection per destination , because it can ' t
* distinguish incoming messages between more than one connection . */
@ Override public Destination createDestination ( final IndividualAddress remote , final boolean connectionOriented , final boolean keepAlive , final boolean verifyMode ) { } }
|
if ( detached ) throw new IllegalStateException ( "TL detached" ) ; synchronized ( proxies ) { if ( proxies . containsKey ( remote ) ) throw new KNXIllegalArgumentException ( "destination already created: " + remote ) ; final AggregatorProxy p = new AggregatorProxy ( this ) ; final Destination d = new Destination ( p , remote , connectionOriented , keepAlive , verifyMode ) ; proxies . put ( remote , p ) ; logger . trace ( "created {} destination for {}" , ( connectionOriented ? "co" : "cl" ) , remote ) ; return d ; }
|
public class GrailsResourceUtils { /** * Gets the path relative to the project base directory .
* Input : / usr / joe / project / grails - app / conf / BootStrap . groovy
* Output : grails - app / conf / BootStrap . groovy
* @ param path The path
* @ return The path relative to the base directory or null if it can ' t be established */
public static String getPathFromBaseDir ( String path ) { } }
|
int i = path . indexOf ( "grails-app/" ) ; if ( i > - 1 ) { return path . substring ( i + 11 ) ; } else { try { File baseDir = BuildSettings . BASE_DIR ; String basePath = baseDir != null ? baseDir . getCanonicalPath ( ) : null ; if ( basePath != null ) { String canonicalPath = new File ( path ) . getCanonicalPath ( ) ; return canonicalPath . substring ( basePath . length ( ) + 1 ) ; } } catch ( IOException e ) { // ignore
} } return null ;
|
public class ClusterMetadataCodec { /** * Decodes metadata into { @ link ServiceEndpoint } .
* @ param metadata - raw metadata to decode from .
* @ return decoded { @ link ServiceEndpoint } . In case of deserialization error returns { @ code null } */
public static ServiceEndpoint decodeMetadata ( String metadata ) { } }
|
try { return objectMapper . readValue ( metadata , ServiceEndpoint . class ) ; } catch ( IOException e ) { LOGGER . error ( "Failed to read metadata: " + e ) ; return null ; }
|
public class SimpleDataSource { /** * 内部的にコネクションを返します 。
* @ param info JDBCドライバへのプロパティ
* @ return コネクション
* @ throws SQLException SQLに関する例外が発生した場合 */
protected Connection getConnectionInternal ( Properties info ) throws SQLException { } }
|
if ( url == null ) { throw new SQLException ( Message . DOMAGEN5002 . getMessage ( ) ) ; } try { return DriverManager . getConnection ( url , info ) ; } catch ( SQLException e ) { if ( UNABLE_TO_ESTABLISH_CONNECTION . equals ( e . getSQLState ( ) ) ) { throw new SQLException ( Message . DOMAGEN5001 . getMessage ( ) , UNABLE_TO_ESTABLISH_CONNECTION , e ) ; } throw e ; }
|
public class DeleteFileExtensions { /** * Deletes the File and if it is an directory it deletes his sub - directories recursively .
* @ param file
* The File to delete .
* @ throws IOException
* Signals that an I / O exception has occurred . */
public static void deleteAllFiles ( final File file ) throws IOException { } }
|
String error = null ; if ( ! file . exists ( ) ) { return ; } final Exception ex = checkFile ( file ) ; if ( ex != null ) { try { throw ex ; } catch ( final Exception e ) { e . printStackTrace ( ) ; } } DeleteFileExtensions . deleteFiles ( file ) ; if ( ! file . delete ( ) ) { error = "Cannot delete the File " + file . getAbsolutePath ( ) + "." ; throw new IOException ( error ) ; }
|
public class GlobusGSSManagerImpl { /** * for acceptors */
public GSSContext createContext ( GSSCredential cred ) throws GSSException { } }
|
GlobusGSSCredentialImpl globusCred = null ; if ( cred == null ) { globusCred = ( GlobusGSSCredentialImpl ) createCredential ( GSSCredential . ACCEPT_ONLY ) ; } else if ( cred instanceof GlobusGSSCredentialImpl ) { globusCred = ( GlobusGSSCredentialImpl ) cred ; } else { throw new GSSException ( GSSException . NO_CRED ) ; } // XXX : don ' t know about the first argument
GSSContext ctx = new GlobusGSSContextImpl ( null , globusCred ) ; return ctx ;
|
public class ServiceRegistryInitializer { /** * Init service registry if necessary . */
@ SuppressFBWarnings ( "PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS" ) public void initServiceRegistryIfNecessary ( ) { } }
|
val size = this . serviceRegistry . size ( ) ; LOGGER . trace ( "Service registry contains [{}] service definition(s)" , size ) ; LOGGER . warn ( "Service registry [{}] will be auto-initialized from JSON service definitions. " + "This behavior is only useful for testing purposes and MAY NOT be appropriate for production. " + "Consider turning off this behavior via the setting [cas.serviceRegistry.initFromJson=false] " + "and explicitly register definitions in the services registry." , this . serviceRegistry . getName ( ) ) ; val servicesLoaded = this . jsonServiceRegistry . load ( ) ; LOGGER . debug ( "Loaded JSON services are [{}]" , servicesLoaded . stream ( ) . map ( RegisteredService :: getName ) . collect ( Collectors . joining ( "," ) ) ) ; servicesLoaded . forEach ( r -> { if ( ! findExistingMatchForService ( r ) ) { LOGGER . debug ( "Initializing service registry with the [{}] JSON service definition..." , r . getName ( ) ) ; this . serviceRegistry . save ( r ) ; } } ) ; this . servicesManager . load ( ) ; LOGGER . info ( "Service registry [{}] contains [{}] service definitions" , this . serviceRegistry . getName ( ) , this . servicesManager . count ( ) ) ;
|
public class FileUtils { /** * Get relative path to base path .
* < p > For { @ code foo / bar / baz . txt } return { @ code . . / . . / } < / p >
* @ param relativePath relative path
* @ param sep path separator
* @ return relative path to base path , { @ code null } if reference path was a single file */
private static String getRelativePathForPath ( final String relativePath , final String sep ) { } }
|
final StringTokenizer tokenizer = new StringTokenizer ( relativePath . replace ( WINDOWS_SEPARATOR , UNIX_SEPARATOR ) , UNIX_SEPARATOR ) ; final StringBuilder buffer = new StringBuilder ( ) ; if ( tokenizer . countTokens ( ) == 1 ) { return null ; } else { while ( tokenizer . countTokens ( ) > 1 ) { tokenizer . nextToken ( ) ; buffer . append ( ".." ) ; buffer . append ( sep ) ; } return buffer . toString ( ) ; }
|
public class UResourceBundle { /** * < strong > [ icu ] < / strong > Loads a new resource bundle for the given base name , locale and class loader .
* Optionally will disable loading of fallback bundles .
* @ param baseName string containing the name of the data package .
* If null the default ICU package name is used .
* @ param localeName the locale for which a resource bundle is desired
* @ param root the class object from which to load the resource bundle
* @ param disableFallback disables loading of fallback lookup chain
* @ throws MissingResourceException If no resource bundle for the specified base name
* can be found
* @ return a resource bundle for the given base name and locale */
protected static UResourceBundle instantiateBundle ( String baseName , String localeName , ClassLoader root , boolean disableFallback ) { } }
|
RootType rootType = getRootType ( baseName , root ) ; switch ( rootType ) { case ICU : return ICUResourceBundle . getBundleInstance ( baseName , localeName , root , disableFallback ) ; case JAVA : return ResourceBundleWrapper . getBundleInstance ( baseName , localeName , root , disableFallback ) ; case MISSING : default : UResourceBundle b ; try { b = ICUResourceBundle . getBundleInstance ( baseName , localeName , root , disableFallback ) ; setRootType ( baseName , RootType . ICU ) ; } catch ( MissingResourceException ex ) { b = ResourceBundleWrapper . getBundleInstance ( baseName , localeName , root , disableFallback ) ; setRootType ( baseName , RootType . JAVA ) ; } return b ; }
|
public class MatchState { /** * Converts case of the string token according to match element attributes .
* @ param s Token to be converted .
* @ param sample the sample string used to determine how the original string looks like ( used only on case preservation )
* @ return Converted string . */
String convertCase ( String s , String sample , Language lang ) { } }
|
return CaseConversionHelper . convertCase ( match . getCaseConversionType ( ) , s , sample , lang ) ;
|
public class ExtensionFactoryRegistry { /** * Finds all factory from the extensions directory .
* @ param factories list of factories to add to */
private void scanExtensions ( List < T > factories , String extensionsDir ) { } }
|
LOG . info ( "Loading extension jars from {}" , extensionsDir ) ; scan ( Arrays . asList ( ExtensionUtils . listExtensions ( extensionsDir ) ) , factories ) ;
|
public class CmsValidationController { /** * Internal method which is executed when the results of the asynchronous validation are received from the server . < p >
* @ param results the validation results */
protected void onReceiveValidationResults ( Map < String , CmsValidationResult > results ) { } }
|
try { for ( Map . Entry < String , CmsValidationResult > resultEntry : results . entrySet ( ) ) { String fieldName = resultEntry . getKey ( ) ; CmsValidationResult result = resultEntry . getValue ( ) ; provideValidationResult ( fieldName , result ) ; } m_handler . onValidationFinished ( m_validationOk ) ; } finally { CmsValidationScheduler . get ( ) . executeNext ( ) ; }
|
public class ListDeploymentTargetsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListDeploymentTargetsRequest listDeploymentTargetsRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( listDeploymentTargetsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listDeploymentTargetsRequest . getDeploymentId ( ) , DEPLOYMENTID_BINDING ) ; protocolMarshaller . marshall ( listDeploymentTargetsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listDeploymentTargetsRequest . getTargetFilters ( ) , TARGETFILTERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class ConsumerDispatcherState { /** * Sets the topic space .
* @ param topicSpace The topicSpaceUuid to set */
public void setTopicSpaceUuid ( SIBUuid12 topicSpace ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setTopicSpaceUuid" , topicSpace ) ; this . topicSpaceUuid = topicSpace ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setTopicSpaceUuid" ) ;
|
public class AmazonApiGatewayV2Client { /** * Gets a Route .
* @ param getRouteRequest
* @ return Result of the GetRoute operation returned by the service .
* @ throws NotFoundException
* The resource specified in the request was not found .
* @ throws TooManyRequestsException
* The client is sending more than the allowed number of requests per unit of time .
* @ sample AmazonApiGatewayV2 . GetRoute */
@ Override public GetRouteResult getRoute ( GetRouteRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeGetRoute ( request ) ;
|
public class TransactionImpl { /** * Lock and register the specified object , make sure that when cascading locking and register
* is enabled to specify a List to register the already processed object Identiy . */
public synchronized void lockAndRegister ( RuntimeObject rtObject , int lockMode , boolean cascade , List registeredObjects ) { } }
|
if ( log . isDebugEnabled ( ) ) log . debug ( "Lock and register called for " + rtObject . getIdentity ( ) ) ; // if current object was already locked , do nothing
// avoid endless loops when circular object references are used
if ( ! registeredObjects . contains ( rtObject . getIdentity ( ) ) ) { if ( cascade ) { // if implicite locking is enabled , first add the current object to
// list of registered objects to avoid endless loops on circular objects
registeredObjects . add ( rtObject . getIdentity ( ) ) ; // lock and register 1:1 references first
// If implicit locking is used , we have materialize the main object
// to lock the referenced objects too
lockAndRegisterReferences ( rtObject . getCld ( ) , rtObject . getObjMaterialized ( ) , lockMode , registeredObjects ) ; } try { // perform the lock on the object
// we don ' t need to lock new objects
if ( ! rtObject . isNew ( ) ) { doSingleLock ( rtObject . getCld ( ) , rtObject . getObj ( ) , rtObject . getIdentity ( ) , lockMode ) ; } // after we locked the object , register it to detect status and changes while tx
doSingleRegister ( rtObject , lockMode ) ; } catch ( Throwable t ) { // log . error ( " Locking of obj " + rtObject . getIdentity ( ) + " failed " , t ) ;
// if registering of object fails release lock on object , because later we don ' t
// get a change to do this .
implementation . getLockManager ( ) . releaseLock ( this , rtObject . getIdentity ( ) , rtObject . getObj ( ) ) ; if ( t instanceof LockNotGrantedException ) { throw ( LockNotGrantedException ) t ; } else { log . error ( "Unexpected failure while locking" , t ) ; throw new LockNotGrantedException ( "Locking failed for " + rtObject . getIdentity ( ) + ", nested exception is: [" + t . getClass ( ) . getName ( ) + ": " + t . getMessage ( ) + "]" ) ; } } if ( cascade ) { // perform locks and register 1 : n and m : n references
// If implicit locking is used , we have materialize the main object
// to lock the referenced objects too
lockAndRegisterCollections ( rtObject . getCld ( ) , rtObject . getObjMaterialized ( ) , lockMode , registeredObjects ) ; } }
|
public class JsDocInfoParser { /** * Looks for a type expression at the current token and if found ,
* returns it . Note that this method consumes input .
* Parameter type expressions are special for two reasons :
* < ol >
* < li > They must begin with ' { ' , to distinguish type names from param names .
* < li > They may end in ' = ' , to denote optionality .
* < / ol >
* @ param token The current token .
* @ return The type expression found or null if none . */
private Node parseAndRecordParamTypeNode ( JsDocToken token ) { } }
|
checkArgument ( token == JsDocToken . LEFT_CURLY ) ; int lineno = stream . getLineno ( ) ; int startCharno = stream . getCharno ( ) ; Node typeNode = parseParamTypeExpressionAnnotation ( token ) ; recordTypeNode ( lineno , startCharno , typeNode , true ) ; return typeNode ;
|
public class ListRetirableGrantsResult { /** * A list of grants .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setGrants ( java . util . Collection ) } or { @ link # withGrants ( java . util . Collection ) } if you want to override the
* existing values .
* @ param grants
* A list of grants .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListRetirableGrantsResult withGrants ( GrantListEntry ... grants ) { } }
|
if ( this . grants == null ) { setGrants ( new com . ibm . cloud . objectstorage . internal . SdkInternalList < GrantListEntry > ( grants . length ) ) ; } for ( GrantListEntry ele : grants ) { this . grants . add ( ele ) ; } return this ;
|
public class LsImageVisitor { /** * values needed to display the inode in ls - style format . */
@ Override void visit ( ImageElement element , String value ) throws IOException { } }
|
if ( inInode ) { switch ( element ) { case INODE_PATH : if ( value . equals ( "" ) ) path = "/" ; else path = value ; break ; case PERMISSION_STRING : perms = value ; break ; case REPLICATION : replication = value ; break ; case USER_NAME : username = value ; break ; case GROUP_NAME : group = value ; break ; case NUM_BYTES : filesize += Long . valueOf ( value ) ; break ; case MODIFICATION_TIME : modTime = value ; break ; case SYMLINK : linkTarget = value ; break ; case INODE_TYPE : type = value ; break ; case INODE_HARDLINK_ID : hardlinkId = value ; break ; default : // This is OK . We ' re not looking for all the values .
break ; } }
|
public class Money { /** * Returns a copy of this monetary value with the amount added .
* This adds the specified amount to this monetary amount , returning a new object .
* If the amount to add exceeds the scale of the currency , then the
* rounding mode will be used to adjust the result .
* This instance is immutable and unaffected by this method .
* @ param amountToAdd the monetary value to add , not null
* @ param roundingMode the rounding mode to use , not null
* @ return the new instance with the input amount added , never null */
public Money plus ( BigDecimal amountToAdd , RoundingMode roundingMode ) { } }
|
return with ( money . plusRetainScale ( amountToAdd , roundingMode ) ) ;
|
public class Util { /** * Returns a byte - array representation of an ASCII string .
* < p > This method is significantly faster than those relying on character encoders , and it allocates just
* one object & mdash ; the resulting byte array .
* @ param s an ASCII string .
* @ return a byte - array representation of { @ code s } .
* @ throws AssertionError if assertions are enabled and some character of { @ code s } is not ASCII . */
public static byte [ ] toByteArray ( final String s ) { } }
|
final byte [ ] byteArray = new byte [ s . length ( ) ] ; // This needs to be fast .
for ( int i = s . length ( ) ; i -- != 0 ; ) { assert s . charAt ( i ) < ( char ) 0x80 : s . charAt ( i ) ; byteArray [ i ] = ( byte ) s . charAt ( i ) ; } return byteArray ;
|
public class Vector4f { /** * Rotate this vector the specified radians around the given rotation axis .
* @ param angle
* the angle in radians
* @ param x
* the x component of the rotation axis
* @ param y
* the y component of the rotation axis
* @ param z
* the z component of the rotation axis
* @ return a vector holding the result */
public Vector4f rotateAbout ( float angle , float x , float y , float z ) { } }
|
return rotateAxis ( angle , x , y , z , thisOrNew ( ) ) ;
|
public class MiscUtils { /** * Compare two versions . Version should be represented as an array of
* integers .
* @ param left
* @ param right
* @ return - 1 if left is smaller than right , 0 if they are equal , 1 if left
* is greater than right . */
public static int compareVersions ( Object [ ] left , Object [ ] right ) { } }
|
if ( left == null || right == null ) { throw new IllegalArgumentException ( "Invalid versions" ) ; } for ( int i = 0 ; i < left . length ; i ++ ) { // right is shorter than left and share the same prefix = > left must be larger
if ( right . length == i ) { return 1 ; } if ( left [ i ] instanceof Integer ) { if ( right [ i ] instanceof Integer ) { // compare two numbers
if ( ( ( Integer ) left [ i ] ) > ( ( Integer ) right [ i ] ) ) { return 1 ; } else if ( ( ( Integer ) left [ i ] ) < ( ( Integer ) right [ i ] ) ) { return - 1 ; } else { continue ; } } else { // numbers always greater than alphanumeric tags
return 1 ; } } else if ( right [ i ] instanceof Integer ) { // alphanumeric tags always less than numbers
return - 1 ; } else { // compare two alphanumeric tags lexicographically
int cmp = ( ( String ) left [ i ] ) . compareTo ( ( String ) right [ i ] ) ; if ( cmp != 0 ) { return cmp ; } else { // two alphanumeric tags are the same . . . so keep comparing
continue ; } } } // left is shorter than right and share the same prefix , must be less
if ( left . length < right . length ) { return - 1 ; } // samesies
return 0 ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.