signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ElemTemplateElement { /** * Given a namespace , get the corrisponding prefix . * 9/15/00 : This had been iteratively examining the m _ declaredPrefixes * field for this node and its parents . That makes life difficult for * the compilation experiment , which doesn ' t have a static vector of * loca...
// if ( null ! = prefix & & prefix . equals ( " xmlns " ) ) // return Constants . S _ XMLNAMESPACEURI ; List nsDecls = m_declaredPrefixes ; if ( null != nsDecls ) { int n = nsDecls . size ( ) ; if ( prefix . equals ( Constants . ATTRVAL_DEFAULT_PREFIX ) ) { prefix = "" ; } for ( int i = 0 ; i < n ; i ++ ) { XMLNSDecl d...
public class AddInstanceGroupsResult { /** * Instance group IDs of the newly created instance groups . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setInstanceGroupIds ( java . util . Collection ) } or { @ link # withInstanceGroupIds ( java . util . Collec...
if ( this . instanceGroupIds == null ) { setInstanceGroupIds ( new com . amazonaws . internal . SdkInternalList < String > ( instanceGroupIds . length ) ) ; } for ( String ele : instanceGroupIds ) { this . instanceGroupIds . add ( ele ) ; } return this ;
public class ComputationGraph { /** * Set the state of the RNN layer , for use in { @ link # rnnTimeStep ( INDArray . . . ) } * @ param layerName The name of the layer . * @ param state The state to set the specified layer to */ public void rnnSetPreviousState ( String layerName , Map < String , INDArray > state ) ...
Layer l = verticesMap . get ( layerName ) . getLayer ( ) ; if ( l instanceof org . deeplearning4j . nn . layers . wrapper . BaseWrapperLayer ) { l = ( ( org . deeplearning4j . nn . layers . wrapper . BaseWrapperLayer ) l ) . getUnderlying ( ) ; } if ( l == null || ! ( l instanceof RecurrentLayer ) ) { throw new Unsuppo...
public class FilesImpl { /** * Deletes the specified file from the compute node . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the compute node from which you want to delete the file . * @ param filePath The path to the file or directory that you want to delete ....
return ServiceFuture . fromHeaderResponse ( deleteFromComputeNodeWithServiceResponseAsync ( poolId , nodeId , filePath , recursive , fileDeleteFromComputeNodeOptions ) , serviceCallback ) ;
public class RMIRegistryManager { /** * Checks if rmiregistry is running on the specified port . * @ param port * @ return true if rmiregistry is running on the specified port , false * otherwise */ public static boolean isRMIRegistryRunning ( Configuration configuration , int port ) { } }
try { final Registry registry = RegistryFinder . getInstance ( ) . getRegistry ( configuration , port ) ; registry . list ( ) ; return true ; } catch ( RemoteException ex ) { return false ; } catch ( Exception e ) { return false ; }
public class OptionGroup { /** * Adds an option to the option group . * @ param value Value , not null and not repeated in the group * @ param text Text , not null * @ return This group */ public OptionGroup addOption ( String value , String text ) { } }
return this . addOption ( new Option ( value , text ) ) ;
public class SingleEvaluatedMoveCache { /** * Cache the given evaluation , discarding any previously cached evaluations . * @ param move move applied to the current solution * @ param evaluation evaluation of obtained neighbour */ @ Override public final void cacheMoveEvaluation ( Move < ? > move , Evaluation evalu...
evaluatedMove = move ; this . evaluation = evaluation ;
public class UnicodeSet { /** * Returns true if this set contains every character * of the given range . * @ param start first character , inclusive , of the range * @ param end last character , inclusive , of the range * @ return true if the test condition is met */ public boolean contains ( int start , int en...
if ( start < MIN_VALUE || start > MAX_VALUE ) { throw new IllegalArgumentException ( "Invalid code point U+" + Utility . hex ( start , 6 ) ) ; } if ( end < MIN_VALUE || end > MAX_VALUE ) { throw new IllegalArgumentException ( "Invalid code point U+" + Utility . hex ( end , 6 ) ) ; } // int i = - 1; // while ( true ) { ...
public class FactoryFinder { /** * Try to find provider using Jar Service Provider Mechanism * @ return instance of provider class if found or null */ private static Object findJarServiceProvider ( String factoryId ) throws ConfigurationError { } }
String serviceId = "META-INF/services/" + factoryId ; InputStream is = null ; // First try the Context ClassLoader ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( cl != null ) { is = cl . getResourceAsStream ( serviceId ) ; } if ( is == null ) { cl = FactoryFinder . class . getClassLoader...
public class ActionContext { /** * Return a { @ link UrlPath } of this context . * Note this method is used only by { @ link Router } for dynamic path * matching . * @ return a { @ link UrlPath } of this context */ public UrlPath urlPath ( ) { } }
if ( null == urlPath ) { urlPath = UrlPath . of ( null == processedUrl ? req ( ) . url ( ) : processedUrl ) ; } return urlPath ;
public class QueryParser { /** * src / riemann / Query . g : 69:1 : value : ( String | t | f | nil | INT | FLOAT ) ; */ public final QueryParser . value_return value ( ) throws RecognitionException { } }
QueryParser . value_return retval = new QueryParser . value_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token String78 = null ; Token INT82 = null ; Token FLOAT83 = null ; QueryParser . t_return t79 = null ; QueryParser . f_return f80 = null ; QueryParser . nil_return nil81 = null ; Comm...
public class NonVoltDBBackend { /** * Returns all column names for the specified table , in the order defined * in the DDL . */ protected List < String > getAllColumns ( String tableName ) { } }
List < String > columns = new ArrayList < String > ( ) ; try { // Lower - case table names are required for PostgreSQL ; we might need to // alter this if we use another comparison database ( besides HSQL ) someday ResultSet rs = dbconn . getMetaData ( ) . getColumns ( null , null , tableName . toLowerCase ( ) , null )...
public class AnnotationUtil { /** * 获取注解类的保留时间 , 可选值 SOURCE ( 源码时 ) , CLASS ( 编译时 ) , RUNTIME ( 运行时 ) , 默认为 CLASS * @ param annotationType 注解类 * @ return 保留时间枚举 */ public static RetentionPolicy getRetentionPolicy ( Class < ? extends Annotation > annotationType ) { } }
final Retention retention = annotationType . getAnnotation ( Retention . class ) ; if ( null == retention ) { return RetentionPolicy . CLASS ; } return retention . value ( ) ;
public class ConnectionImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . core . SICoreConnection # receiveNoWait ( com . ibm . wsspi . sib . core . SITransaction , com . ibm . websphere . sib . Reliability , * com . ibm . websphere . sib . SIDestinationAddress , com . ibm . wsspi . sib . core . Desti...
if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConnection . tc , "receiveNoWait" , new Object [ ] { this , tran , unrecoverableReliability , destAddr , destinationType , criteria , reliability , alternateUser } ) ; SIBusMessage msg = internalReceive...
public class StringUtil { /** * Skips any spaces at or after start and returns the index of first * non - space character ; * @ param s the string * @ param start index to start * @ return index of first non - space */ public static int skipSpaces ( String s , int start ) { } }
int limit = s . length ( ) ; int i = start ; for ( ; i < limit ; i ++ ) { if ( s . charAt ( i ) != ' ' ) { break ; } } return i ;
public class Validators { /** * Creates and returns a validator , which allows to validate texts to ensure , that they * represent valid IPv4 addresses . Empty texts are also accepted . * @ param context * The context , which should be used to retrieve the error message , as an instance of * the class { @ link ...
return new IPv4AddressValidator ( context , resourceId ) ;
public class ContextAnalyzer { /** * Get the last tense used in the sentence * @ param timex timex construct to discover tense data for * @ return string that contains the tense */ public static String getClosestTense ( Timex3 timex , JCas jcas , Language language ) { } }
RePatternManager rpm = RePatternManager . getInstance ( language , false ) ; String lastTense = "" ; String nextTense = "" ; int tokenCounter = 0 ; int lastid = 0 ; int nextid = 0 ; int tid = 0 ; // Get the sentence FSIterator iterSentence = jcas . getAnnotationIndex ( Sentence . type ) . iterator ( ) ; Sentence s = ne...
public class RequestParams { /** * Checks if HTTP request matches all fields specified in config . * Fails on first mismatch . Both headers and query params can be configured as regex . * @ param req * @ return */ public boolean matches ( Request req ) { } }
if ( ! method . equals ( req . getMethod ( ) ) ) return false ; if ( useRegexForPath ) { if ( ! req . getPath ( ) . getPath ( ) . matches ( basePath ) ) return false ; } else { if ( ! basePath . equals ( req . getPath ( ) . getPath ( ) ) ) return false ; } if ( ! queries . keySet ( ) . containsAll ( req . getQuery ( ) ...
public class MiriamLink { /** * Converts a MIRIAM URN into its equivalent Identifiers . org URL . * @ see # getURI ( String , String ) - use this to get the URN * @ see # getIdentifiersOrgURI ( String , String ) - prefered URI * @ param urn - an existing Miriam URN , e . g . , " urn : miriam : obo . go : GO % 3A0...
String [ ] tokens = urn . split ( ":" ) ; return "http://identifiers.org/" + tokens [ tokens . length - 2 ] + "/" + URLDecoder . decode ( tokens [ tokens . length - 1 ] ) ;
public class CommonConfigUtils { /** * Returns the value for the configuration attribute matching the key provided . If the value does not exist or is empty , the * resulting value will be { @ code null } and an error message will be logged . */ public String getRequiredConfigAttributeWithDefaultValue ( Map < String ...
return getRequiredConfigAttributeWithDefaultValueAndConfigId ( props , key , defaultValue , null ) ;
public class ModuleImpl { /** * This accessor is provided for unit testing only */ protected String getCachedFileName ( String key ) throws InterruptedException { } }
String result = null ; if ( _moduleBuilds != null ) { CacheEntry bld = _moduleBuilds . get ( key ) ; for ( int i = 0 ; i < 5 ; i ++ ) { if ( bld . filename == null ) { Thread . sleep ( 500L ) ; } } result = _moduleBuilds . get ( key ) . fileName ( ) ; } return result ;
public class AttachProvider { /** * Attaches to a Java virtual machine . * A Java virtual machine can be described using a { @ link * com . sun . tools . attach . VirtualMachineDescriptor VirtualMachineDescriptor } . * This method invokes the descriptor ' s { @ link * com . sun . tools . attach . VirtualMachine...
if ( vmd . provider ( ) != this ) { throw new AttachNotSupportedException ( "provider mismatch" ) ; } return attachVirtualMachine ( vmd . id ( ) ) ;
public class BoxFolder { /** * Adds a collaborator to this folder . An email will be sent to the collaborator if they don ' t already have a Box * account . * @ param email the email address of the collaborator to add . * @ param role the role of the collaborator . * @ param notify the user / group should recei...
JsonObject accessibleByField = new JsonObject ( ) ; accessibleByField . add ( "login" , email ) ; accessibleByField . add ( "type" , "user" ) ; return this . collaborate ( accessibleByField , role , notify , canViewPath ) ;
public class MpxjFilter { /** * Apply a filter to the list of all tasks , and show the results . * @ param project project file * @ param filter filter */ private static void processTaskFilter ( ProjectFile project , Filter filter ) { } }
for ( Task task : project . getTasks ( ) ) { if ( filter . evaluate ( task , null ) ) { System . out . println ( task . getID ( ) + "," + task . getUniqueID ( ) + "," + task . getName ( ) ) ; } }
public class CacheProxy { /** * Returns a copy of the value if value - based caching is enabled . * @ param object the object to be copied * @ param < T > the type of object being copied * @ return a copy of the object if storing by value or the same instance if by reference */ @ SuppressWarnings ( "NullAway" ) p...
if ( object == null ) { return null ; } T copy = copier . copy ( object , cacheManager . getClassLoader ( ) ) ; return requireNonNull ( copy ) ;
public class ScanQueryEngine { /** * If we ' re performing time - ordering , we want to scan through the first ` limit ` rows in each segment ignoring the number * of rows already counted on other segments . */ private long calculateLimit ( ScanQuery query , Map < String , Object > responseContext ) { } }
if ( query . getOrder ( ) . equals ( ScanQuery . Order . NONE ) ) { return query . getLimit ( ) - ( long ) responseContext . get ( ScanQueryRunnerFactory . CTX_COUNT ) ; } return query . getLimit ( ) ;
public class Parameters { /** * Creates a new set of parameters with only those parameters in the specified namespace ( that is , * prefixed by " namespace . " . The namespace prefix and period will be removed from parameter names * in the new { @ code Parameters } . The name space name should * not * have a * tr...
checkArgument ( ! requestedNamespace . isEmpty ( ) ) ; checkArgument ( ! requestedNamespace . endsWith ( DELIM ) ) ; final ImmutableMap . Builder < String , String > ret = ImmutableMap . builder ( ) ; final String dottedNamespace = requestedNamespace + DELIM ; for ( final Map . Entry < String , String > param : params ...
public class GridFilesystem { /** * Opens an InputStream for reading from the given file . * @ param file the file to open for reading * @ return an InputStream for reading from the file * @ throws FileNotFoundException if the file does not exist or is a directory */ public InputStream getInput ( File file ) thro...
return file != null ? getInput ( file . getPath ( ) ) : null ;
public class FeatureUtilities { /** * Getter for attributes of a feature . * < p > If the attribute is not found , checks are done in non * case sensitive mode . * @ param feature the feature from which to get the attribute . * @ param field the name of the field . * @ return the attribute or null if none fou...
Object attribute = feature . getAttribute ( field ) ; if ( attribute == null ) { attribute = feature . getAttribute ( field . toLowerCase ( ) ) ; if ( attribute != null ) return attribute ; attribute = feature . getAttribute ( field . toUpperCase ( ) ) ; if ( attribute != null ) return attribute ; // alright , last try...
public class CmsStaticExportManager { /** * Returns the key for the online , export and secure cache . < p > * @ param siteRoot the site root of the resource * @ param uri the URI of the resource * @ return a key for the cache */ public String getCacheKey ( String siteRoot , String uri ) { } }
return new StringBuffer ( siteRoot ) . append ( uri ) . toString ( ) ;
public class ExprTag { /** * / * Evaluates expressions as necessary */ private void evaluateExpressions ( ) throws JspException { } }
/* * Note : we don ' t check for type mismatches here ; we assume * the expression evaluator will return the expected type * ( by virtue of knowledge we give it about what that type is ) . * A ClassCastException here is truly unexpected , so we let it * propagate up . */ if ( escapeXml_ != null ) { Boolean b = ...
public class VisibilityAlgorithm { /** * Add occlusion segment in isovist * @ param p0 segment origin * @ param p1 segment destination */ public void addSegment ( Coordinate p0 , Coordinate p1 ) { } }
if ( p0 . distance ( p1 ) < epsilon ) { return ; } addSegment ( originalSegments , p0 , p1 ) ;
public class ResultSetIterator { /** * { @ inheritDoc } */ @ Override public T next ( ) { } }
if ( closed ) throw new IllegalStateException ( "This iterator has been closed!" ) ; try { return rowMapper . mapRow ( resultSet , rowNum ) ; } catch ( Exception e ) { close ( ) ; throw e instanceof DaoException ? ( DaoException ) e : new DaoException ( e ) ; } finally { rowNum ++ ; }
public class JDBCCallableStatement { /** * # ifdef JAVA6 */ public synchronized void setSQLXML ( String parameterName , SQLXML xmlObject ) throws SQLException { } }
super . setSQLXML ( findParameterIndex ( parameterName ) , xmlObject ) ;
public class RedisInner { /** * Retrieve a Redis cache ' s access keys . This operation requires write permission to the cache resource . * @ param resourceGroupName The name of the resource group . * @ param name The name of the Redis cache . * @ throws IllegalArgumentException thrown if parameters fail the vali...
return listKeysWithServiceResponseAsync ( resourceGroupName , name ) . map ( new Func1 < ServiceResponse < RedisAccessKeysInner > , RedisAccessKeysInner > ( ) { @ Override public RedisAccessKeysInner call ( ServiceResponse < RedisAccessKeysInner > response ) { return response . body ( ) ; } } ) ;
public class TypeAnnotationPosition { /** * Create a { @ code TypeAnnotationPosition } for a field . * @ param location The type path . * @ param onLambda The lambda for this variable . * @ param pos The position from the associated tree node . */ public static TypeAnnotationPosition field ( final List < TypePath...
return new TypeAnnotationPosition ( TargetType . FIELD , pos , Integer . MIN_VALUE , onLambda , Integer . MIN_VALUE , Integer . MIN_VALUE , location ) ;
public class ConfigurationDocGenerator { /** * Writes property key to csv files . * @ param defaultKeys Collection which is from PropertyKey DEFAULT _ KEYS _ MAP . values ( ) * @ param filePath path for csv files */ @ VisibleForTesting public static void writeCSVFile ( Collection < ? extends PropertyKey > defaultKe...
if ( defaultKeys . size ( ) == 0 ) { return ; } FileWriter fileWriter ; Closer closer = Closer . create ( ) ; String [ ] fileNames = { "user-configuration.csv" , "master-configuration.csv" , "worker-configuration.csv" , "security-configuration.csv" , "common-configuration.csv" , "cluster-management-configuration.csv" }...
public class AmazonRedshiftClient { /** * Deletes a specified Amazon Redshift parameter group . * < note > * You cannot delete a parameter group if it is associated with a cluster . * < / note > * @ param deleteClusterParameterGroupRequest * @ return Result of the DeleteClusterParameterGroup operation returne...
request = beforeClientExecution ( request ) ; return executeDeleteClusterParameterGroup ( request ) ;
public class MusixMatch { /** * Handle the error response . * @ param jsonResponse * the jsonContent . * @ throws MusixMatchException * if any error occurs */ private void handleErrorResponse ( String jsonResponse ) throws MusixMatchException { } }
StatusCode statusCode ; Gson gson = new Gson ( ) ; System . out . println ( jsonResponse ) ; ErrorMessage errMessage = gson . fromJson ( jsonResponse , ErrorMessage . class ) ; int responseCode = errMessage . getMessageContainer ( ) . getHeader ( ) . getStatusCode ( ) ; switch ( responseCode ) { case 400 : statusCode =...
public class PluginResourceButton { /** * Returns the value of the button ' s caption text . * @ return The button ' s caption text . */ public String getCaption ( ) { } }
return caption != null && caption . toLowerCase ( ) . startsWith ( "label:" ) ? StrUtil . getLabel ( caption . substring ( 6 ) ) : caption ;
public class CmsADEConfigCacheState { /** * Helper method for getting the best matching sitemap configuration object for a given root path , ignoring the module * configuration . < p > * For example , if there are configurations available for the paths / a , / a / b / c , / a / b / x and / a / b / c / d / e , then ...
if ( path == null ) { return null ; } List < String > prefixes = getSiteConfigPaths ( path ) ; if ( prefixes . size ( ) == 0 ) { return null ; } // for any two prefixes of a string , one is a prefix of the other . so the alphabetically last // prefix is the longest prefix of all . return m_siteConfigurationsByPath . ge...
public class AbstractYarnClusterDescriptor { /** * Method to validate cluster specification before deploy it , it will throw * an { @ link FlinkException } if the { @ link ClusterSpecification } is invalid . * @ param clusterSpecification cluster specification to check against the configuration of the * AbstractY...
try { final long taskManagerMemorySize = clusterSpecification . getTaskManagerMemoryMB ( ) ; // We do the validation by calling the calculation methods here // Internally these methods will check whether the cluster can be started with the provided // ClusterSpecification and the configured memory requirements final lo...
public class ConnectionTcp { /** * Wake a connection . * The connection may be idle because it ' s received a close - read but * HTTP is still processing . When the HTTP write completes , it will * wake the read thread . */ @ Override public void requestWake ( ) { } }
try { _state = _state . toWake ( ) ; requestLoop ( ) ; } catch ( Exception e ) { log . log ( Level . WARNING , e . toString ( ) , e ) ; } /* if ( _ stateRef . get ( ) . toWake ( _ stateRef ) ) { offer ( getConnectionTask ( ) ) ; */
public class ExpressionTree { /** * Get the root of the tree * @ return the root of the tree or EMPTY _ SLOT if the tree is empty */ @ Nonnull public ExpressionTreeElement getRoot ( ) { } }
if ( last . isEmptySlot ( ) ) { return this . last ; } else { ExpressionTreeElement element = last ; while ( ! Thread . currentThread ( ) . isInterrupted ( ) ) { final ExpressionTreeElement next = element . getParent ( ) ; if ( next == null ) { return element ; } else { element = next ; } } } return ExpressionTreeEleme...
public class PopupMenuItemSiteNodeContainer { /** * Convenience method that extracts a { @ code SiteNode } from the given { @ code historyReference } . If no { @ code SiteNode } is * found { @ code null } is returned . * @ param historyReference the history reference * @ return the { @ code SiteNode } or { @ code...
SiteNode sn = historyReference . getSiteNode ( ) ; if ( sn == null ) { sn = Model . getSingleton ( ) . getSession ( ) . getSiteTree ( ) . getSiteNode ( historyReference . getHistoryId ( ) ) ; } return sn ;
public class Util { /** * helper method to get the color by attr ( if defined in the style ) or by resource . * @ param ctx * @ param attr attribute that defines the color * @ param res color resource id * @ return */ public static int getThemeColorFromAttrOrRes ( Context ctx , int attr , int res ) { } }
int color = getThemeColor ( ctx , attr ) ; // If this color is not styled , use the default from the resource if ( color == 0 ) { color = ContextCompat . getColor ( ctx , res ) ; } return color ;
public class AWSSimpleSystemsManagementClient { /** * Retrieves the current snapshot for the patch baseline the instance uses . This API is primarily used by the * AWS - RunPatchBaseline Systems Manager document . * @ param getDeployablePatchSnapshotForInstanceRequest * @ return Result of the GetDeployablePatchSn...
request = beforeClientExecution ( request ) ; return executeGetDeployablePatchSnapshotForInstance ( request ) ;
public class RegistriesInner { /** * Creates a new build based on the request parameters and add it to the build queue . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildRequest The param...
return queueBuildWithServiceResponseAsync ( resourceGroupName , registryName , buildRequest ) . map ( new Func1 < ServiceResponse < BuildInner > , BuildInner > ( ) { @ Override public BuildInner call ( ServiceResponse < BuildInner > response ) { return response . body ( ) ; } } ) ;
public class Segment { /** * Releases an entry from the segment . * @ param index The index of the entry to release . * @ return Indicates whether the entry was newly released from the segment . * @ throws IllegalStateException if the segment is not open */ public boolean release ( long index ) { } }
assertSegmentOpen ( ) ; long offset = offsetIndex . find ( relativeOffset ( index ) ) ; return offset != - 1 && offsetPredicate . release ( offset ) ;
public class DualMessageReceiver { /** * Add this message filter to this receive queue . * Also adds a message filter to the remote queue . * @ param The message filter to add . * @ return The message filter passed in . */ public void addMessageFilter ( MessageFilter messageFilter ) { } }
boolean bThinTarget = ( ( BaseMessageFilter ) messageFilter ) . isThinTarget ( ) ; ( ( BaseMessageFilter ) messageFilter ) . setThinTarget ( false ) ; // If this is replicated to a server , the server needs to know that I am thick . super . addMessageFilter ( messageFilter ) ; ( ( BaseMessageFilter ) messageFilter ) . ...
public class PhpDependencyResolver { /** * collect children ' s recursively for each dependencyInfo object */ private void collectChildren ( DependencyInfo dependencyInfo , HashMap < String , DependencyInfo > packageDependencyMap , HashMap < DependencyInfo , Collection < String > > requireDependenciesMap ) { } }
Collection < String > requires = requireDependenciesMap . get ( dependencyInfo ) ; // check if dependencyInfo object already have children ' s if ( dependencyInfo . getChildren ( ) . isEmpty ( ) ) { for ( String require : requires ) { DependencyInfo dependencyChild = packageDependencyMap . get ( require ) ; if ( depend...
public class LocalFileResource { /** * { @ inheritDoc } */ @ Override public void put ( ReadableByteChannel source ) throws IOException { } }
if ( source == null || ! source . isOpen ( ) ) return ; WritableByteChannel os = putChannel ( ) ; FileChannel fos = null ; try { if ( source instanceof FileChannel ) { fos = ( FileChannel ) os ; FileChannel fis = ( FileChannel ) source ; fis . transferTo ( 0 , fis . size ( ) , fos ) ; } else { ByteBuffer buf = ByteBuff...
public class InstanceTypeFactory { /** * Constructs an { @ link InstanceType } from the given parameters . * @ param identifier * identifier for this instance type * @ param numberOfComputeUnits * number of computational units of this instance type * @ param numberOfCores * number of CPU cores of this insta...
return new InstanceType ( identifier , numberOfComputeUnits , numberOfCores , memorySize , diskCapacity , pricePerHour ) ;
public class Ranges { /** * Return the center of the specified range . * @ param < C > range endpoint type * @ param range range , must not be null * @ return the center of the specified range */ public static < C extends Comparable > C center ( final Range < C > range ) { } }
checkNotNull ( range ) ; if ( ! range . hasLowerBound ( ) && ! range . hasUpperBound ( ) ) { throw new IllegalStateException ( "cannot find the center of a range without bounds" ) ; } if ( ! range . hasLowerBound ( ) ) { return range . upperEndpoint ( ) ; } if ( ! range . hasUpperBound ( ) ) { return range . lowerEndpo...
public class GuildWars2 { /** * Set language for APIs that are locale aware < br / > * Possible Value : english ( default ) , german , spanish , french , chinese * @ param lang selected language */ public static void setLanguage ( LanguageSelect lang ) { } }
if ( lang == null ) GuildWars2 . lang = LanguageSelect . English ; else GuildWars2 . lang = lang ;
public class LineWrapper { /** * Emit a newline character if the line will exceed it ' s limit , otherwise do nothing . */ void zeroWidthSpace ( int indentLevel ) throws IOException { } }
if ( closed ) throw new IllegalStateException ( "closed" ) ; if ( column == 0 ) return ; if ( this . nextFlush != null ) flush ( nextFlush ) ; this . nextFlush = FlushType . EMPTY ; this . indentLevel = indentLevel ;
public class GVRShaderData { /** * Gets the name of the vertex attribute containing the texture * coordinates for the named texture . * @ param texName name of texture * @ return name of texture coordinate vertex attribute */ public String getTexCoordAttr ( String texName ) { } }
GVRTexture tex = textures . get ( texName ) ; if ( tex != null ) { return tex . getTexCoordAttr ( ) ; } return null ;
public class Iterators { /** * Combines multiple iterators into a single iterator . The returned iterator * iterates across the elements of each iterator in { @ code inputs } . The input * iterators are not polled until necessary . * < p > The returned iterator supports { @ code remove ( ) } when the correspondin...
for ( Iterator < ? extends T > input : checkNotNull ( inputs ) ) { checkNotNull ( input ) ; } return concat ( new ConsumingQueueIterator < Iterator < ? extends T > > ( inputs ) ) ;
public class LazyReact { /** * Construct a FutureStream from specified Suppliers . Each Supplier is executed asyncrhonously , * and it ' s results provided to next phase of the Stream * < pre > * { @ code * LazyReact . parallelBuilder ( ) * . react ( asList ( this : : load ) * . map ( list - > 1 + 2) * . ...
final ReactiveSeq < Supplier < U > > seq = actions instanceof List ? ReactiveSeq . fromList ( ( List ) actions ) : ReactiveSeq . fromIterable ( actions ) ; return fromStreamAsync ( seq ) ;
public class TileSetBundlerTask { /** * Returns the target path in which our bundler will write the tile set . */ protected String getTargetPath ( File fromDir , String path ) { } }
return path . substring ( 0 , path . length ( ) - 4 ) + ".jar" ;
public class DateModifiedFollowingHandler { public Date adjustDate ( final Date startDate , final int increment , final NonWorkingDayChecker < Date > checker ) { } }
final Calendar cal = ( Calendar ) Utils . getCal ( startDate ) . clone ( ) ; int step = increment ; final int month = cal . get ( Calendar . MONTH ) ; while ( checker . isNonWorkingDay ( cal . getTime ( ) ) ) { cal . add ( Calendar . DAY_OF_MONTH , step ) ; if ( month != cal . get ( Calendar . MONTH ) ) { // switch dir...
public class GlobalUsersInner { /** * Starts an environment by starting all resources inside the environment . This operation can take a while to complete . * @ param userName The name of the user . * @ param environmentId The resourceId of the environment * @ throws IllegalArgumentException thrown if parameters ...
return startEnvironmentWithServiceResponseAsync ( userName , environmentId ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class ServletResponse { /** * { @ inheritDoc } */ @ Override public void setHeader ( final String name , final String value ) { } }
backing . setHeader ( name , value ) ;
public class ComponentEnhancer { /** * Check if annotation can be processed for the given class . * @ param componentClass the class to check * @ return true if annotation can be processed */ public static boolean canProcessAnnotation ( final Class < ? extends Component < ? > > componentClass ) { } }
final SkipAnnotation skip = ClassUtility . getLastClassAnnotation ( componentClass , SkipAnnotation . class ) ; // No annotation or annotation deactivated = = > skip annotation processing return ! ( skip == null || skip . value ( ) ) ;
public class ClassReader { /** * Include class corresponding to given class file in package , * unless ( 1 ) we already have one the same kind ( . class or . java ) , or * ( 2 ) we have one of the other kind , and the given class file * is older . */ protected void includeClassFile ( PackageSymbol p , JavaFileObj...
if ( ( p . flags_field & EXISTS ) == 0 ) for ( Symbol q = p ; q != null && q . kind == PCK ; q = q . owner ) q . flags_field |= EXISTS ; JavaFileObject . Kind kind = file . getKind ( ) ; int seen ; if ( kind == JavaFileObject . Kind . CLASS ) seen = CLASS_SEEN ; else seen = SOURCE_SEEN ; String binaryName = fileManager...
public class ArrayUtil { /** * Return count of true elements in array */ public static int countTrueElements ( boolean [ ] arra ) { } }
int count = 0 ; for ( int i = 0 ; i < arra . length ; i ++ ) { if ( arra [ i ] ) { count ++ ; } } return count ;
public class ModifySnapshotScheduleResult { /** * A list of clusters associated with the schedule . A maximum of 100 clusters is returned . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAssociatedClusters ( java . util . Collection ) } or { @ link # with...
if ( this . associatedClusters == null ) { setAssociatedClusters ( new com . amazonaws . internal . SdkInternalList < ClusterAssociatedToSchedule > ( associatedClusters . length ) ) ; } for ( ClusterAssociatedToSchedule ele : associatedClusters ) { this . associatedClusters . add ( ele ) ; } return this ;
public class CustomFunctions { /** * コレクションの値を結合する 。 * @ param collection 結合対象のコレクション * @ param delimiter 区切り文字 * @ return 結合した文字列を返す 。 結合の対象のコレクションがnulの場合 、 空文字を返す 。 */ public static String join ( final Collection < ? > collection , final String delimiter ) { } }
if ( collection == null || collection . isEmpty ( ) ) { return "" ; } String value = collection . stream ( ) . map ( v -> v . toString ( ) ) . collect ( Collectors . joining ( defaultString ( delimiter ) ) ) ; return value ;
public class StatusCodeDumper { /** * impl of dumping response status code to result * @ param result A map you want to put dump information to */ @ Override public void dumpResponse ( Map < String , Object > result ) { } }
this . statusCodeResult = String . valueOf ( exchange . getStatusCode ( ) ) ; this . putDumpInfoTo ( result ) ;
public class PdfTable { /** * Updates the table row additions in the underlying table object */ private void updateRowAdditionsInternal ( ) { } }
// correct table : fill empty cells / parse table in table Row row ; int prevRows = rows ( ) ; int rowNumber = 0 ; int groupNumber = 0 ; boolean groupChange ; int firstDataRow = table . getLastHeaderRow ( ) + 1 ; Cell cell ; PdfCell currentCell ; ArrayList newCells = new ArrayList ( ) ; int rows = table . size ( ) + 1 ...
public class CancelRotateSecretRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CancelRotateSecretRequest cancelRotateSecretRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( cancelRotateSecretRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cancelRotateSecretRequest . getSecretId ( ) , SECRETID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON...
public class DOMUtils { /** * Parse the given input source and return the root Element . * This uses the document builder associated with the current thread . */ public static Element parse ( InputSource source ) throws IOException { } }
try { Document doc ; DocumentBuilder builder = getDocumentBuilder ( ) ; synchronized ( builder ) // synchronize to prevent concurrent parsing on the same DocumentBuilder { doc = builder . parse ( source ) ; } return doc . getDocumentElement ( ) ; } catch ( SAXException se ) { throw new IOException ( se . toString ( ) )...
public class TextMateGenerator2 { /** * Generate the rules for the primitive types . * @ param primitiveTypes the primitive types . * @ return the rules . */ protected List < Map < String , ? > > generatePrimitiveTypes ( Set < String > primitiveTypes ) { } }
final List < Map < String , ? > > list = new ArrayList < > ( ) ; if ( ! primitiveTypes . isEmpty ( ) ) { list . add ( pattern ( it -> { it . matches ( keywordRegex ( primitiveTypes ) + "(?:\\s*\\[\\s*\\])*" ) ; // $ NON - NLS - 1 $ it . style ( PRIMITIVE_TYPE_STYLE ) ; it . comment ( "Primitive types" ) ; // $ NON - NL...
public class ManagementResource { /** * Upload an image for a template / application . * If an image was already set , it is overridden by the new one . * @ param name the name of the template / application . * @ param qualifier the qualifier of the template , or { @ code null } for an application . * @ param i...
// Check image size and extension . final long size = fileDetail . getSize ( ) ; final String extension = getFileExtension ( fileDetail . getFileName ( ) ) ; if ( size > MAX_IMAGE_SIZE ) throw new IllegalArgumentException ( "Image is too large: " + size ) ; if ( ! SUPPORTED_EXTENSIONS . contains ( extension ) ) throw n...
public class I18n { /** * Note , calling this method will < em > not < / em > trigger localization of the supplied internationalization class . * @ param i18nClass The internalization class for which localization problem locales should be returned . * @ return The locales for which localization problems were encoun...
CheckArg . isNotNull ( i18nClass , "i18nClass" ) ; Set < Locale > locales = new HashSet < Locale > ( LOCALE_TO_CLASS_TO_PROBLEMS_MAP . size ( ) ) ; for ( Entry < Locale , Map < Class < ? > , Set < String > > > localeEntry : LOCALE_TO_CLASS_TO_PROBLEMS_MAP . entrySet ( ) ) { for ( Entry < Class < ? > , Set < String > > ...
public class SymmetryAxes { /** * Get the first repeat index of each axis of a specified level . * @ param level level of the tree to cut at * @ return List of first Repeats of each index , sorted in ascending order */ public List < Integer > getFirstRepeats ( int level ) { } }
List < Integer > firstRepeats = new ArrayList < Integer > ( ) ; int m = getNumRepeats ( level + 1 ) ; // size of the level int d = axes . get ( level ) . getOrder ( ) ; // degree of this level int n = m * d ; // number of repeats included in each axis for ( int firstRepeat = 0 ; firstRepeat < getNumRepeats ( ) ; firstR...
public class MetaTinyTypes { /** * Checks whether a class is a TinyType . A class is considered a TinyType if * is a direct ancestor of a tech . anima . tinytypes . * TinyType , is not abstract * and provides a ctor matching super . * @ param candidate the class to be checked * @ return true if the candidate is...
for ( MetaTinyType meta : metas ) { if ( meta . isMetaOf ( candidate ) ) { return true ; } } return false ;
public class DefaultDocWorkUnitHandler { /** * Add any custom freemarker bindings discovered via custom javadoc tags . Subclasses can override this to * provide additional custom bindings . * @ param currentWorkUnit the work unit for the feature being documented */ protected void addCustomBindings ( final DocWorkUn...
final String tagFilterPrefix = getTagPrefix ( ) ; Arrays . stream ( currentWorkUnit . getClassDoc ( ) . inlineTags ( ) ) . filter ( t -> t . name ( ) . startsWith ( tagFilterPrefix ) ) . forEach ( t -> currentWorkUnit . setProperty ( t . name ( ) . substring ( tagFilterPrefix . length ( ) ) , t . text ( ) ) ) ;
public class AccountsInner { /** * Updates a Cognitive Services account . * @ param resourceGroupName The name of the resource group within the user ' s subscription . * @ param accountName The name of Cognitive Services account . * @ param sku Gets or sets the SKU of the resource . * @ param tags Gets or sets ...
return updateWithServiceResponseAsync ( resourceGroupName , accountName , sku , tags ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AbstractHttpWriterBuilder { /** * For backward compatibility on how Fork creates writer , invoke fromState when it ' s called writeTo method . * @ param destination * @ return */ @ Override public B writeTo ( Destination destination ) { } }
super . writeTo ( destination ) ; fromState ( destination . getProperties ( ) ) ; return typedSelf ( ) ;
public class MapsInner { /** * Get the content callback url . * @ param resourceGroupName The resource group name . * @ param integrationAccountName The integration account name . * @ param mapName The integration account map name . * @ param listContentCallbackUrl the GetCallbackUrlParameters value * @ param...
return ServiceFuture . fromResponse ( listContentCallbackUrlWithServiceResponseAsync ( resourceGroupName , integrationAccountName , mapName , listContentCallbackUrl ) , serviceCallback ) ;
public class ManagementClientImpl { /** * as readProperty , but collects all responses until response timeout is reached */ List < byte [ ] > readProperty2 ( final Destination dst , final int objIndex , final int propertyId , final int start , final int elements ) throws KNXTimeoutException , KNXRemoteException , KNXDi...
return readProperty ( dst , objIndex , propertyId , start , elements , false ) ;
public class CPSpecificationOptionPersistenceImpl { /** * Returns the last cp specification option in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > nul...
CPSpecificationOption cpSpecificationOption = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( cpSpecificationOption != null ) { return cpSpecificationOption ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ;...
public class EffectUtil { /** * Returns an image that can be used by effects as a temp image . * @ return The scratch image used for temporary operations */ static public BufferedImage getScratchImage ( ) { } }
Graphics2D g = ( Graphics2D ) scratchImage . getGraphics ( ) ; g . setComposite ( AlphaComposite . Clear ) ; g . fillRect ( 0 , 0 , GlyphPage . MAX_GLYPH_SIZE , GlyphPage . MAX_GLYPH_SIZE ) ; g . setComposite ( AlphaComposite . SrcOver ) ; g . setColor ( java . awt . Color . white ) ; return scratchImage ;
public class PublicKeyExtensions { /** * Transform the given { @ link PublicKey } to a base64 encoded { @ link String } value . * @ param publicKey * the public key * @ return the base64 encoded { @ link String } value . */ public static String toBase64 ( final PublicKey publicKey ) { } }
final byte [ ] encoded = publicKey . getEncoded ( ) ; return Base64 . encodeBase64String ( encoded ) ;
public class NetUtils { /** * 获取服务端错误消息 * @ param request { @ link HttpServletRequest } * @ param e { @ link Exception } * @ return { @ link Map } * @ since 1.1.1 */ public static Map < String , String > getServerErrorMap ( HttpServletRequest request , Exception e ) { } }
Map < String , String > attributes = new HashMap < > ( 4 ) ; attributes . put ( "code" , "500" ) ; attributes . put ( "message" , e . getMessage ( ) ) ; String queryString = request . getQueryString ( ) ; attributes . put ( "url" , request . getRequestURI ( ) + ( Checker . isEmpty ( queryString ) ? "" : "?" + queryStri...
public class ArrayConstructor { /** * Create an object based on machine code type */ public Object construct ( char typecode , int machinecode , byte [ ] data ) throws PickleException { } }
// Machine format codes . // Search for " enum machine _ format _ code " in Modules / arraymodule . c to get // the authoritative values . // UNKNOWN _ FORMAT = - 1 // UNSIGNED _ INT8 = 0 // SIGNED _ INT8 = 1 // UNSIGNED _ INT16 _ LE = 2 // UNSIGNED _ INT16 _ BE = 3 // SIGNED _ INT16 _ LE = 4 // SIGNED _ INT16 _ BE = 5...
public class ZoneExtension { /** * Add System Controller Filters */ public void addSysControllerFilters ( ) { } }
for ( SystemRequest rq : SystemRequest . values ( ) ) { ISystemFilterChain filterChain = new SysControllerFilterChain ( ) ; filterChain . addFilter ( "EzyFoxFilterChain#" + rq , new BaseSysControllerFilter ( appContext ( ) , rq ) ) ; getParentZone ( ) . setFilterChain ( rq , filterChain ) ; }
public class PathComputer { /** * Given an installation directory , find the root directory * for the nunaliit2 project . This makes sense only in the * context that the command - line tool is run from a development * environment . * @ param installDir Computed install directory where command - line is run * ...
while ( null != installDir ) { // The root of the nunalii2 project contains " nunaliit2 - couch - command " , // " nunaliit2 - couch - sdk " and " nunaliit2 - js " boolean commandExists = ( new File ( installDir , "nunaliit2-couch-command" ) ) . exists ( ) ; boolean sdkExists = ( new File ( installDir , "nunaliit2-couc...
public class DefaultNamespaceService { /** * Creates a new namespace . * @ param namespace The namespace to create . Cannot be null . * @ return The updated namespace object having the ID field populated . * @ throws SystemException If a duplicate namespace exists . */ @ Override public Namespace createNamespace ...
requireNotDisposed ( ) ; requireArgument ( namespace != null , "null namespace cannot be created." ) ; if ( ! _validateQualifier ( namespace . getQualifier ( ) ) ) { throw new SystemException ( new IllegalArgumentException ( "Illegal characters found while generating namespace. Cannot generate a namespace with this qua...
public class ExampleConvolution { /** * Convolves a 2D kernel */ private static void convolve2D ( GrayU8 gray ) { } }
// By default 2D kernels will be centered around width / 2 Kernel2D_S32 kernel = new Kernel2D_S32 ( 3 ) ; kernel . set ( 1 , 0 , 2 ) ; kernel . set ( 2 , 1 , 2 ) ; kernel . set ( 0 , 1 , - 2 ) ; kernel . set ( 1 , 2 , - 2 ) ; // Output needs to handle the increased domain after convolution . Can ' t be 8bit GrayS16 out...
public class M2tsSettings { /** * Specify the packet identifiers ( PIDs ) for any elementary audio streams you include in this output . Specify * multiple PIDs as a JSON array . Default is the range 482-492. * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # s...
if ( this . audioPids == null ) { setAudioPids ( new java . util . ArrayList < Integer > ( audioPids . length ) ) ; } for ( Integer ele : audioPids ) { this . audioPids . add ( ele ) ; } return this ;
public class MarkerUtil { /** * Fish an IMarker out of given selection . * @ param selection * the selection * @ return the selected IMarker , or null if we can ' t find an IMarker in the * selection */ public static Set < IMarker > getMarkerFromSelection ( ISelection selection ) { } }
Set < IMarker > markers = new HashSet < > ( ) ; if ( ! ( selection instanceof IStructuredSelection ) ) { return markers ; } IStructuredSelection sSelection = ( IStructuredSelection ) selection ; for ( Iterator < ? > iter = sSelection . iterator ( ) ; iter . hasNext ( ) ; ) { Object next = iter . next ( ) ; markers . ad...
public class FileMixedMetaManager { /** * = = = = = helper method = = = = = */ private File getDataFile ( String destination ) { } }
File destinationMetaDir = new File ( dataDir , destination ) ; if ( ! destinationMetaDir . exists ( ) ) { try { FileUtils . forceMkdir ( destinationMetaDir ) ; } catch ( IOException e ) { throw new CanalMetaManagerException ( e ) ; } } return new File ( destinationMetaDir , dataFileName ) ;
public class Vector2f { /** * / * ( non - Javadoc ) * @ see org . joml . Vector2fc # fma ( org . joml . Vector2fc , org . joml . Vector2fc , org . joml . Vector2f ) */ public Vector2f fma ( Vector2fc a , Vector2fc b , Vector2f dest ) { } }
dest . x = x + a . x ( ) * b . x ( ) ; dest . y = y + a . y ( ) * b . y ( ) ; return dest ;
public class TapConsumerImpl { /** * { @ inheritDoc } */ @ Override public TestSet load ( Readable tapStream ) { } }
try { this . testSet = this . parser . parseTapStream ( tapStream ) ; } catch ( ParserException e ) { throw new TapConsumerException ( "Failed to parse TAP Stream " + tapStream + ": " + e . getMessage ( ) , e ) ; } return this . testSet ;
public class ObjectUtils { /** * Get all declared fields on the leaf class and all superclasses . Leaf class methods are included first . * @ param leafClass * the leaf class . * @ return all declared fields . * @ see ReflectionUtils # getAllDeclaredMethods ( Class ) since is the same approach as this one . */ ...
Assert . notNull ( leafClass , "leafClass" ) ; final List < Field > fields = new ArrayList < Field > ( 32 ) ; ReflectionUtils . doWithFields ( leafClass , new ReflectionUtils . FieldCallback ( ) { @ Override public void doWith ( Field field ) throws IllegalArgumentException , IllegalAccessException { fields . add ( fie...
public class AbstractFormComponentInterceptor { /** * Check for JScrollPane . * @ param component * @ return the component itself , or the inner component if it was a * JScrollPane . */ protected JComponent getInnerComponent ( JComponent component ) { } }
if ( component instanceof JScrollPane ) { return getInnerComponent ( ( JComponent ) ( ( JScrollPane ) component ) . getViewport ( ) . getView ( ) ) ; } if ( component instanceof HasInnerComponent ) { return getInnerComponent ( ( ( HasInnerComponent ) component ) . getInnerComponent ( ) ) ; } return component ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcProductsOfCombustionProperties ( ) { } }
if ( ifcProductsOfCombustionPropertiesEClass == null ) { ifcProductsOfCombustionPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 389 ) ; } return ifcProductsOfCombustionPropertiesEClass ;
public class UniqueId { /** * Finds the ID associated with a given name or creates it . * < strong > This method is blocking . < / strong > Its use within OpenTSDB itself * is discouraged , please use { @ link # getOrCreateIdAsync } instead . * The length of the byte array is fixed in advance by the implementatio...
try { return getIdAsync ( name ) . joinUninterruptibly ( ) ; } catch ( NoSuchUniqueName e ) { if ( tsdb != null && tsdb . getUidFilter ( ) != null && tsdb . getUidFilter ( ) . fillterUIDAssignments ( ) ) { try { if ( ! tsdb . getUidFilter ( ) . allowUIDAssignment ( type , name , null , null ) . join ( ) ) { rejected_as...