signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class IdleConnectionRemover { /** * Set the executor service * @ param v The value */ public void setExecutorService ( ExecutorService v ) { } }
if ( v != null ) { executorService = v ; isExternal = true ; } else { executorService = null ; isExternal = false ; }
public class AzureAffinityGroupSupport { /** * Creates an affinity group in the cloud * @ param options the options used when creating the affinity group * @ return the provider ID of the affinity group * @ throws org . dasein . cloud . InternalException an error occurred within the Dasein Cloud implementation cr...
if ( options == null || options . getName ( ) == null ) throw new InternalException ( "Cannot create AffinityGroup. Create options or affinity group name cannot be null." ) ; CreateAffinityGroupModel createAffinityGroupModel = new CreateAffinityGroupModel ( ) ; createAffinityGroupModel . setName ( options . getName ( )...
public class DatastreamReferencedContent { /** * Gets the external content manager which is used for the retrieval of * content . * @ return an instance of < code > ExternalContentManager < / code > * @ throws Exception is thrown in case the server is not able to find the module . */ private ExternalContentManage...
if ( s_ecm == null ) { Server server ; try { server = Server . getInstance ( new File ( Constants . FEDORA_HOME ) , false ) ; s_ecm = ( ExternalContentManager ) server . getModule ( "org.fcrepo.server.storage.ExternalContentManager" ) ; } catch ( InitializationException e ) { throw new Exception ( "Unable to get Extern...
public class MasterPlaylistSettings { /** * Sets the refreshType value for this MasterPlaylistSettings . * @ param refreshType * Indicates how the master playlist gets refreshed . This field * is optional and defaults to { @ link * RefreshType # AUTOMATIC } . */ public void setRefreshType ( com . google . api . a...
this . refreshType = refreshType ;
public class Enhancements { /** * Returns a { @ link Collection } of { @ link EntityAnnotation } s which confidences values are greater than or equal * to the value passed by parameter * @ param confidenceValue Threshold confidence value * @ return */ public Collection < EntityAnnotation > getEntityAnnotationsByC...
return FluentIterable . from ( getEntityAnnotations ( ) ) . filter ( new Predicate < EntityAnnotation > ( ) { @ Override public boolean apply ( EntityAnnotation e ) { return e . confidence . doubleValue ( ) >= confidenceValue . doubleValue ( ) ; } } ) . toList ( ) ;
public class AmazonRoute53DomainsClient { /** * Checks whether a domain name can be transferred to Amazon Route 53. * @ param checkDomainTransferabilityRequest * The CheckDomainTransferability request contains the following elements . * @ return Result of the CheckDomainTransferability operation returned by the s...
request = beforeClientExecution ( request ) ; return executeCheckDomainTransferability ( request ) ;
public class MethodPod { /** * Return the local method for this pod method , when the pod is on the * same jvm . */ private MethodRefAmp findLocalMethod ( ) { } }
ServiceRefAmp serviceRefLocal = _serviceRef . getLocalService ( ) ; if ( serviceRefLocal == null ) { return null ; } if ( _type != null ) { return serviceRefLocal . methodByName ( _name , _type ) ; } else { return serviceRefLocal . methodByName ( _name ) ; }
public class AnnivMasterScreen { /** * Add all the screen listeners . */ public void addListeners ( ) { } }
super . addListeners ( ) ; this . getMainRecord ( ) . getField ( AnnivMaster . CALENDAR_CATEGORY_ID ) . addListener ( new InitFieldHandler ( this . getRecord ( CalendarControl . CALENDAR_CONTROL_FILE ) . getField ( CalendarControl . ANNIVERSARY_CATEGORY_ID ) ) ) ;
public class NodeTypeDataValidator { /** * Check according the JSR - 170 */ private void validateNodeType ( NodeTypeData nodeType ) throws RepositoryException { } }
if ( nodeType == null ) { throw new RepositoryException ( "NodeType object " + nodeType + " is null" ) ; } if ( nodeType . getName ( ) == null ) { throw new RepositoryException ( "NodeType implementation class " + nodeType . getClass ( ) . getName ( ) + " is not supported in this method" ) ; } for ( InternalQName sname...
public class VolumeBindingUtil { /** * Resolves relative paths in the supplied { @ code bindingString } , and returns a binding string that has relative * paths replaced with absolute paths . If the supplied { @ code bindingString } does not contain a relative path , it * is returned unmodified . * < h3 > Discuss...
// a ' services : ' - > service - > ' volumes : ' may be formatted as : // ( https : / / docs . docker . com / compose / compose - file / compose - file - v2 / # volumes - volume _ driver ) // volumes : // # Just specify a path and let the Engine create a volume // - / var / lib / mysql // # Specify an absolute path ma...
public class JCasUtil2 { /** * Returns token at the given position * @ param jCas jCas * @ param begin token begin position * @ return Token or null */ public static Token findTokenByBeginPosition ( JCas jCas , int begin ) { } }
for ( Token token : JCasUtil . select ( getInitialView ( jCas ) , Token . class ) ) { if ( token . getBegin ( ) == begin ) { return token ; } } return null ;
public class HttpContext { /** * Execute a POST call against the partial URL . * @ param partialUrl The partial URL to build * @ param payload The object to use for the POST * @ return The response to the POST */ public Optional < Response > POST ( String partialUrl , Object payload ) { } }
URI uri = buildUri ( partialUrl ) ; return executePostRequest ( uri , payload ) ;
public class TextHelper { /** * Get a copy of this object with the specified locales . The default locale is * copied . * @ param aMLT * The initial multilingual text . May not be < code > null < / code > . * @ param aContentLocales * The list of locales of which the strings are desired . May not be * < cod...
final MultilingualText ret = new MultilingualText ( ) ; for ( final Locale aConrentLocale : aContentLocales ) if ( aMLT . texts ( ) . containsKey ( aConrentLocale ) ) ret . setText ( aConrentLocale , aMLT . getText ( aConrentLocale ) ) ; return ret ;
public class RaftNetworkClient { /** * Start the { @ code RaftNetworkClient } . * Following a call to { @ code start ( ) } the network threads * will begin to do work . This means that the server component * will accept and service incoming connections . Likewise , the * the client component will attempt to est...
if ( running ) { return ; } LOGGER . info ( "{}: starting network client" , self . getId ( ) ) ; checkNotNull ( server ) ; checkNotNull ( client ) ; // IMPORTANT : set running _ early , up here _ // this is because the bind ( ) and connect ( ) // calls below will not succeed if their // callbacks see " running " as fal...
public class Symm { /** * Create an encrypted password , making sure that even short passwords have a minimum length . * @ param password * @ param os * @ throws IOException */ public void enpass ( final String password , final OutputStream os ) throws IOException { } }
final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( baos ) ; byte [ ] bytes = password . getBytes ( ) ; if ( this . getClass ( ) . getSimpleName ( ) . startsWith ( "base64" ) ) { // don ' t expose randomization dos . write ( bytes ) ; } else { Random r = new ...
public class DescribeScalableTargetsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeScalableTargetsRequest describeScalableTargetsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeScalableTargetsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeScalableTargetsRequest . getServiceNamespace ( ) , SERVICENAMESPACE_BINDING ) ; protocolMarshaller . marshall ( describeScalableTargetsRequest . g...
public class Strings { /** * Repeat a String { @ code repeat } times to form a new String . * < pre > * repeat ( null , 2 ) = null * repeat ( " " , 0 ) = " " * repeat ( " " , 2 ) = " " * repeat ( " a " , 3 ) = " aaa " * repeat ( " ab " , 2 ) = " abab " * repeat ( " a " , - 2 ) = " " * < / pre > * @ pa...
if ( str == null ) return null ; if ( repeat <= 0 ) return Empty ; if ( repeat == 1 ) return str ; final int len = str . length ( ) ; final long longSize = ( long ) len * ( long ) repeat ; final int size = ( int ) longSize ; if ( size != longSize ) { throw new ArrayIndexOutOfBoundsException ( "Required array size too l...
public class SRTServletRequest { /** * If the session doesn ' t exist , then the Id that came * in is invalid . If there is no sessionID in the request , then * it ' s not valid . */ public boolean isRequestedSessionIdValid ( ) { } }
if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } // 321485 boolean sessionInvalid = _requestContext . isRequestedSessionIdValid ( ( ( WebAppDispatcherContext ) this . getDispatchContext ( ) ) . getWebApp ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggabl...
public class BibliographyFileReader { /** * Reads all items from an input stream and returns a provider * serving these items . Note that you can supply an additional file * name to help the method to determine the exact bibliography file format . * If you don ' t know the file name you can pass null , but in thi...
BufferedInputStream bis ; if ( bibstream instanceof BufferedInputStream ) { bis = ( BufferedInputStream ) bibstream ; } else { bis = new BufferedInputStream ( bibstream ) ; } // determine file format FileFormat ff = determineFileFormat ( bis , filename ) ; // read stream return readBibliographyFile ( bis , ff ) ;
public class Mixer2Engine { /** * replace the reference of character entity reference to numeric character * reference . * @ param sb * xhtml template * @ return replaced xhtml template */ public StringBuilder replaceNamedEntity ( StringBuilder sb ) { } }
for ( NamedEntityEnum nEnum : NamedEntityEnum . values ( ) ) { int i ; while ( ( i = sb . indexOf ( nEnum . getName ( ) ) ) > - 1 ) { sb . replace ( i , i + nEnum . getName ( ) . length ( ) , nEnum . getNumber ( ) ) ; } } return sb ;
public class DecimalFormat { /** * Formats a BigDecimal number . */ @ Override public StringBuffer format ( java . math . BigDecimal number , StringBuffer result , FieldPosition fieldPosition ) { } }
return format ( number , result , fieldPosition , false ) ;
public class ExampleSection { /** * Selects an example . If there is an error instantiating the component , an error message will be displayed . * @ param example the ExampleData of the example to select . */ public void selectExample ( final ExampleData example ) { } }
try { StringBuilder exampleName = new StringBuilder ( ) ; if ( example . getExampleGroupName ( ) != null && ! example . getExampleGroupName ( ) . equals ( "" ) ) { exampleName . append ( example . getExampleGroupName ( ) ) . append ( " - " ) ; } exampleName . append ( example . getExampleName ( ) ) ; selectExample ( ex...
public class ClassifierKNearestNeighborsBow { /** * Finds the scene which most resembles the provided image * @ param image Image that ' s to be classified * @ return The index of the scene it most resembles */ public int classify ( T image ) { } }
if ( numNeighbors == 0 ) throw new IllegalArgumentException ( "Must specify number of neighbors!" ) ; // compute all the features inside the image describe . process ( image ) ; // find which word the feature matches and construct a frequency histogram featureToHistogram . reset ( ) ; List < Desc > imageFeatures = desc...
public class ClientSupportImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . clientcontainer . remote . common . ClientSupport # listRemoteInstances ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) */ @ Override public Collection < ? extends Nam...
Collection < NameClassPair > allInstances = new HashSet < NameClassPair > ( ) ; NamingConstants . JavaColonNamespace namespace = NamingConstants . JavaColonNamespace . fromName ( namespaceString ) ; ComponentMetaData cmd = getCMD ( appName , moduleName , compName , namespace ) ; try { ComponentMetaDataAccessorImpl . ge...
public class ComponentEnhancer { /** * Store annotated method related to a lifecycle phase . * @ param component the JRebirth component to manage * @ param lifecycleMethod the map that store methods * @ param annotationClass the annotation related to lifecycle phase */ private static void manageLifecycleAnnotatio...
for ( final Method method : ClassUtility . getAnnotatedMethods ( component . getClass ( ) , annotationClass ) ) { // Add a method to the multimap entry // TODO sort lifecycleMethod . add ( annotationClass . getName ( ) , method ) ; }
public class Vector { /** * Addition from two vectors */ public Vector add ( Vector b ) { } }
if ( ( b == null ) || ( size != b . size ) ) return null ; int i ; Vector result = new Vector ( size ) ; for ( i = 0 ; i < size ; i ++ ) result . vector [ i ] = vector [ i ] + b . vector [ i ] ; return result ;
public class ServerDefaultHttpHandler { /** * ( non - Javadoc ) * @ see io . undertow . server . HttpHandler # handleRequest ( io . undertow . server . HttpServerExchange ) */ @ Override public void handleRequest ( final HttpServerExchange exchange ) throws Exception { } }
if ( this . defaultResponseListener != null ) { exchange . addDefaultResponseListener ( defaultResponseListener ) ; } long fiGlobal = this . headers . fastIterateNonEmpty ( ) ; while ( fiGlobal != - 1 ) { final HeaderValues headerValues = headers . fiCurrent ( fiGlobal ) ; exchange . getResponseHeaders ( ) . addAll ( h...
public class InsufficientOperationalNodesException { /** * Helper method to get a list of node ids . * @ param nodeList */ private static List < Integer > stripNodeIds ( List < Node > nodeList ) { } }
List < Integer > nodeidList = new ArrayList < Integer > ( ) ; if ( nodeList != null ) { for ( Node node : nodeList ) { nodeidList . add ( node . getId ( ) ) ; } } return nodeidList ;
public class ModelRegistry { /** * Finds the most specific models for the given { @ link Resource } , i . e . the * first model ( s ) found when traversing the resource ' s * { @ link MappableTypeHierarchy mappable hierarchy } . * @ param resource must not be < code > null < / code > . * @ return the model sour...
if ( resource == null ) { throw new IllegalArgumentException ( "Method argument resource must not be null." ) ; } final Key key = key ( resource ) ; if ( isUnmapped ( key ) ) { return null ; } Collection < LookupResult > sources = lookupFromCache ( key ) ; if ( sources == null ) { final int currentStateId = this . stat...
public class MicroMetaDao { /** * 锟斤拷锟斤拷锟揭筹拷锟绞硷拷锟铰嘉伙拷锟 � */ public int calcuStartIndex ( int pageNum , int onePageCount ) { } }
int startIndex = 0 ; String tempType = calcuDbType ( ) ; if ( tempType != null && tempType . equals ( "mysql" ) ) { // if ( dbType ! = null & & dbType . equals ( " mysql " ) ) { startIndex = pageNum * onePageCount ; } else { startIndex = pageNum * onePageCount + 1 ; } return startIndex ;
public class MemcachedClient { /** * Asynchronous CAS operation using the default transcoder . * @ param key the key * @ param casId the CAS identifier ( from a gets operation ) * @ param value the new value * @ return a future that will indicate the status of the CAS * @ throws IllegalStateException in the r...
return asyncCAS ( key , casId , value , transcoder ) ;
public class SingleEvaluatedMoveCache { /** * Cache validation of the given move , discarding any previously cached value . * @ param move move applied to the current solution * @ param validation validation of obtained neighbour */ @ Override public final void cacheMoveValidation ( Move < ? > move , Validation val...
validatedMove = move ; this . validation = validation ;
public class ObjectCacheTwoLevelImpl { /** * Put object to session cache . * @ param oid The { @ link org . apache . ojb . broker . Identity } of the object to cache * @ param entry The { @ link org . apache . ojb . broker . cache . ObjectCacheTwoLevelImpl . CacheEntry } of the object * @ param onlyIfNew Flag , i...
if ( onlyIfNew ) { // no synchronization needed , because session cache was used per broker instance if ( ! sessionCache . containsKey ( oid ) ) sessionCache . put ( oid , entry ) ; } else { sessionCache . put ( oid , entry ) ; }
public class UserDeserializer { /** * Gson invokes this call - back method during deserialization when it encounters a field of the specified type . * @ param element The Json data being deserialized * @ param type The type of the Object to deserialize to * @ param context The JSON deserialization context * @ r...
JsonObject obj = element . getAsJsonObject ( ) ; JsonElement user = obj . get ( "user" ) ; if ( user != null && user . isJsonObject ( ) ) return gson . fromJson ( user , User . class ) ; return gson . fromJson ( element , User . class ) ;
public class EndpointBuilder { /** * Returns either a client proxy or { @ link HTTPServerEndpoint } instance . * @ return building result */ @ SuppressWarnings ( "unchecked" ) public T get ( ) { } }
T result ; if ( uri != null ) { if ( classLoader == null ) { classLoader = clazz . getClassLoader ( ) ; } Endpoint clientEndpoint = new HTTPClientEndpoint ( uri ) ; if ( logger != null ) { clientEndpoint = new LoggerEndpoint ( clientEndpoint , logger ) ; } result = new FacadeEndpoint < T > ( clientEndpoint , classLoade...
public class Service { /** * < pre > * Configuration controlling usage of this service . * < / pre > * < code > . google . api . Usage usage = 15 ; < / code > */ public com . google . api . Usage getUsage ( ) { } }
return usage_ == null ? com . google . api . Usage . getDefaultInstance ( ) : usage_ ;
public class FSDatasetDescriptor { /** * A helper to determine if the path description of this { @ link DatasetDescriptor } is a superset of paths * accepted by the other { @ link DatasetDescriptor } . If the path description of the other { @ link DatasetDescriptor } * is a glob pattern , we return false . * @ pa...
if ( otherPath == null ) { return false ; } if ( DatasetDescriptorConfigKeys . DATASET_DESCRIPTOR_CONFIG_ANY . equals ( this . getPath ( ) ) ) { return true ; } if ( PathUtils . isGlob ( new Path ( otherPath ) ) ) { return false ; } GlobPattern globPattern = new GlobPattern ( this . getPath ( ) ) ; return globPattern ....
public class V1KnowledgeComponentImplementationModel { /** * { @ inheritDoc } */ @ Override public LoggersModel getLoggers ( ) { } }
if ( _loggers == null ) { _loggers = ( LoggersModel ) getFirstChildModel ( LOGGERS ) ; } return _loggers ;
public class PremiumRateServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } ...
try { if ( com . google . api . ads . admanager . axis . v201902 . PremiumRateServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201902 . PremiumRateServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201902 . Premium...
public class ParameterUtil { /** * This is a utility method intended provided to help the JPA module . */ public static IQueryParameterAnd < ? > parseQueryParams ( FhirContext theContext , RestSearchParameterTypeEnum paramType , String theUnqualifiedParamName , List < QualifiedParamList > theParameters ) { } }
QueryParameterAndBinder binder = null ; switch ( paramType ) { case COMPOSITE : throw new UnsupportedOperationException ( ) ; case DATE : binder = new QueryParameterAndBinder ( DateAndListParam . class , Collections . < Class < ? extends IQueryParameterType > > emptyList ( ) ) ; break ; case NUMBER : binder = new Query...
public class AbstractWebServer { /** * Set the { @ link PippoFilter } instance . * This method call { @ link PippoFilter # setApplication ( Application ) } to end . * @ param pippoFilter * @ return */ @ Override public WebServer < T > setPippoFilter ( PippoFilter pippoFilter ) { } }
this . pippoFilter = pippoFilter ; pippoFilter . setApplication ( application ) ; return this ;
public class RaidDFSUtil { /** * Returns the corrupt blocks in a file . */ public static List < LocatedBlock > corruptBlocksInFile ( DistributedFileSystem dfs , String path , long offset , long length ) throws IOException { } }
List < LocatedBlock > corrupt = new LinkedList < LocatedBlock > ( ) ; LocatedBlocks locatedBlocks = getBlockLocations ( dfs , path , offset , length ) ; for ( LocatedBlock b : locatedBlocks . getLocatedBlocks ( ) ) { if ( b . isCorrupt ( ) || ( b . getLocations ( ) . length == 0 && b . getBlockSize ( ) > 0 ) ) { corrup...
public class ReflectiveInterceptor { /** * Implementation of java . lang . class . getDeclaredMethod ( String name , Class . . . params ) . */ @ UsedByGeneratedCode public static Method jlClassGetDeclaredMethod ( Class < ? > clazz , String name , Class < ? > ... params ) throws SecurityException , NoSuchMethodException...
ReloadableType rtype = getRType ( clazz ) ; if ( rtype == null ) { // Not reloadable . . . return clazz . getDeclaredMethod ( name , params ) ; } else { // Reloadable MethodProvider methods = MethodProvider . create ( rtype ) ; Invoker method = methods . getDeclaredMethod ( name , params ) ; if ( method == null ) { thr...
public class HttpBase { /** * 新增请求头 < br > * 不覆盖原有请求头 * @ param headers 请求头 * @ return this * @ since 4.0.3 */ public T addHeaders ( Map < String , String > headers ) { } }
if ( CollectionUtil . isEmpty ( headers ) ) { return ( T ) this ; } for ( Entry < String , String > entry : headers . entrySet ( ) ) { this . header ( entry . getKey ( ) , StrUtil . nullToEmpty ( entry . getValue ( ) ) , false ) ; } return ( T ) this ;
public class Mapper { /** * Creates a map where the object at index N from the first Iterator is the key for the object at index N of the * second Iterator . < br > By default discards both key and value if either one is null . * @ param keys Iterator of keys * @ param values Iterator of values * @ return map *...
return zip ( keys , values , false ) ;
public class CreateSnapshotScheduleResult { /** * @ param nextInvocations * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateSnapshotScheduleResult withNextInvocations ( java . util . Collection < java . util . Date > nextInvocations ) { } }
setNextInvocations ( nextInvocations ) ; return this ;
public class LogSignAlgebra { /** * Converts a real value to its compacted representation . */ @ Override public double fromReal ( double x ) { } }
long sign = POSITIVE ; if ( x < 0 ) { sign = NEGATIVE ; x = - x ; } return compact ( sign , FastMath . log ( x ) ) ;
public class DividableGridAdapter { /** * Inflates the view , which is used to visualize an item . * @ param parent * The parent of the view , which should be inflated , as an instance of the class { @ link * ViewGroup } or null , if no parent is available * @ return The view , which has been inflated , as an i...
LayoutInflater layoutInflater = LayoutInflater . from ( context ) ; View view = layoutInflater . inflate ( style == Style . GRID ? R . layout . grid_item : R . layout . list_item , parent , false ) ; ItemViewHolder viewHolder = new ItemViewHolder ( ) ; viewHolder . iconImageView = view . findViewById ( android . R . id...
public class BicValidator { /** * { @ inheritDoc } check if given string is a valid BIC . * @ see javax . validation . ConstraintValidator # isValid ( java . lang . Object , * javax . validation . ConstraintValidatorContext ) */ @ Override public final boolean isValid ( final Object pvalue , final ConstraintValidat...
final String valueAsString ; if ( ignoreWhitspaces ) { valueAsString = Objects . toString ( pvalue , StringUtils . EMPTY ) . replaceAll ( "\\s+" , StringUtils . EMPTY ) ; } else { valueAsString = Objects . toString ( pvalue , null ) ; } if ( StringUtils . isEmpty ( valueAsString ) ) { // empty field is ok return true ;...
public class CmsAliasTableController { /** * This method is called after the mode of an alias has been edited . < p > * @ param row the edited row * @ param mode the new alias mode */ public void editAliasMode ( CmsAliasTableRow row , CmsAliasMode mode ) { } }
row . setMode ( mode ) ; row . setEdited ( true ) ;
public class TopicRefWriter { /** * Retrieve the element ID from the path . If there is no element ID , return topic ID . */ private String getElementID ( final String relativePath ) { } }
final String fragment = getFragment ( relativePath ) ; if ( fragment != null ) { if ( fragment . lastIndexOf ( SLASH ) != - 1 ) { return fragment . substring ( fragment . lastIndexOf ( SLASH ) + 1 ) ; } else { return fragment ; } } return null ;
public class InMemoryBulkheadRegistry { /** * { @ inheritDoc } */ @ Override public Bulkhead bulkhead ( String name , BulkheadConfig config ) { } }
return computeIfAbsent ( name , ( ) -> Bulkhead . of ( name , Objects . requireNonNull ( config , CONFIG_MUST_NOT_BE_NULL ) ) ) ;
public class StorageProviderFactoryImpl { /** * This method returns all of the registered storage accounts . * @ return list of storage accounts */ @ Override public List < StorageAccount > getStorageAccounts ( ) { } }
List < StorageAccount > accts = new ArrayList < > ( ) ; Iterator < String > ids = getAccountManager ( ) . getStorageAccountIds ( ) ; while ( ids . hasNext ( ) ) { accts . add ( getAccountManager ( ) . getStorageAccount ( ids . next ( ) ) ) ; } return accts ;
public class PropertiesUtils { /** * Converts a { @ link Properties } object to a { @ link Map } where each key is a { @ link String } . */ public static Map < String , ? > propsToStringKeyMap ( Properties properties ) { } }
ImmutableMap . Builder < String , Object > mapBuilder = ImmutableMap . builder ( ) ; for ( Map . Entry < Object , Object > entry : properties . entrySet ( ) ) { mapBuilder . put ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) ) ; } return mapBuilder . build ( ) ;
public class RenderTheme { /** * Matches a node with the given parameters against this RenderTheme . * @ param renderCallback the callback implementation which will be executed on each match . * @ param renderContext * @ param poi the point of interest . */ public synchronized void matchNode ( RenderCallback rend...
MatchingCacheKey matchingCacheKey = new MatchingCacheKey ( poi . tags , renderContext . rendererJob . tile . zoomLevel , Closed . NO ) ; List < RenderInstruction > matchingList = this . poiMatchingCache . get ( matchingCacheKey ) ; if ( matchingList != null ) { // cache hit for ( int i = 0 , n = matchingList . size ( )...
public class MemoryInfo { /** * Returns an estimation , in bytes , of the memory usage of the given objects plus ( recursively ) * objects referenced via non - static references from any of those objects via non - public fields . If * two or more of the given objects reference the same Object X , then the memory us...
return deepMemoryUsageOfAll ( inst , objs , NON_PUBLIC ) ;
public class DefaultOverlayService { /** * { @ inheritDoc } */ @ Override public Boolean showOverlay ( JComponent targetComponent , JComponent overlay ) { } }
overlay . setVisible ( Boolean . TRUE ) ; return Boolean . TRUE ;
public class VariableScopeImpl { /** * only called when a new variable is created on this variable scope . This method is also responsible for propagating the creation of this variable to the history . */ protected void createVariableLocal ( String variableName , Object value , ExecutionEntity sourceActivityExecution )...
ensureVariableInstancesInitialized ( ) ; if ( variableInstances . containsKey ( variableName ) ) { throw new ActivitiException ( "variable '" + variableName + "' already exists. Use setVariableLocal if you want to overwrite the value" ) ; } createVariableInstance ( variableName , value , sourceActivityExecution ) ;
public class Bidi { /** * Perform the Unicode Bidi algorithm on a given paragraph , as defined in the * < a href = " http : / / www . unicode . org / unicode / reports / tr9 / " > Unicode Standard Annex # 9 < / a > , * version 13, * also described in The Unicode Standard , Version 4.0 . < p > * This method take...
byte paraLvl ; Boolean runDirection = ( Boolean ) paragraph . getAttribute ( TextAttribute . RUN_DIRECTION ) ; if ( runDirection == null ) { paraLvl = LEVEL_DEFAULT_LTR ; } else { paraLvl = ( runDirection . equals ( TextAttribute . RUN_DIRECTION_LTR ) ) ? LTR : RTL ; } byte [ ] lvls = null ; int len = paragraph . getEn...
public class WVideo { /** * Creates dynamic URLs that the video clips can be loaded from . In fact the URL points to the main application * servlet , but includes a non - null for the parameter associated with this WComponent ( ie , its label ) . The * handleRequest method below detects this when the browser reques...
Track [ ] tracks = getTracks ( ) ; if ( tracks == null || tracks . length == 0 ) { return null ; } String [ ] urls = new String [ tracks . length ] ; // this variable needs to be set in the portlet environment . String url = getEnvironment ( ) . getWServletPath ( ) ; Map < String , String > parameters = getBaseParamete...
public class Router { /** * GO ! * @ param request The request . * @ param response The response . */ void doMethod ( HttpServletRequest request , HttpServletResponse response , HttpMethod httpMethod ) { } }
// Locate a request handler : String requestPath = mapRequestPath ( request ) ; Route route = api . get ( requestPath ) ; try { if ( route != null && route . requestHandlers . containsKey ( httpMethod ) ) { handleRequest ( request , response , route , httpMethod ) ; } else { handleNotFound ( request , response ) ; } } ...
public class IO { /** * Writes an int value to a series of bytes . The values are written using * < a href = " http : / / lucene . apache . org / core / 3_5_0 / fileformats . html # VInt " > variable - length < / a > * < a href = " https : / / developers . google . com / protocol - buffers / docs / encoding ? csw =...
// Zig - zag encoding . int n = ( value << 1 ) ^ ( value >> 31 ) ; if ( ( n & ~ 0x7F ) != 0 ) { out . write ( ( byte ) ( ( n | 0x80 ) & 0xFF ) ) ; n >>>= 7 ; if ( n > 0x7F ) { out . write ( ( byte ) ( ( n | 0x80 ) & 0xFF ) ) ; n >>>= 7 ; if ( n > 0x7F ) { out . write ( ( byte ) ( ( n | 0x80 ) & 0xFF ) ) ; n >>>= 7 ; if...
public class AbstractSubCodeBuilderFragment { /** * Replies the " an " or " a " article according to the given word . * < p > This function does not follow the real English grammatical rule , but it is * an acceptable approximation . * @ param word the word that follows the article . * @ return the article . */...
if ( Arrays . asList ( 'a' , 'e' , 'i' , 'o' , 'u' , 'y' ) . contains ( Character . toLowerCase ( word . charAt ( 0 ) ) ) ) { return "an" ; // $ NON - NLS - 1 $ } return "a" ; // $ NON - NLS - 1 $
public class JMSContextInjected { /** * If there is a transaction in progress , then create a new JMSContext add to Transaction registry and return the same * If there is no transaction , then create a new context and return the JMSContext */ private synchronized JMSContext getInternalJMSContext ( ) { } }
TransactionSynchronizationRegistry tranSyncRegistry = null ; try { boolean tranIsActive = false ; tranSyncRegistry = ( TransactionSynchronizationRegistry ) new InitialContext ( ) . lookup ( TSR_LOOKUP_NAME ) ; if ( tranSyncRegistry != null ) { tranIsActive = ( tranSyncRegistry . getTransactionStatus ( ) == Status . STA...
public class GrammarAccess { /** * Creates an identifier for a Rule which is a valid Java idetifier and unique within * the Rule ' s grammar . * @ param rule the Rule * @ return the identifier */ public String gaRuleIdentifyer ( final AbstractRule rule ) { } }
final String plainName = RuleNames . getRuleNames ( rule ) . getUniqueRuleName ( rule ) ; return this . toJavaIdentifier ( plainName , true ) ;
public class DescribeVTLDevicesResult { /** * An array of VTL device objects composed of the Amazon Resource Name ( ARN ) of the VTL devices . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVTLDevices ( java . util . Collection ) } or { @ link # withVTLDe...
if ( this . vTLDevices == null ) { setVTLDevices ( new com . amazonaws . internal . SdkInternalList < VTLDevice > ( vTLDevices . length ) ) ; } for ( VTLDevice ele : vTLDevices ) { this . vTLDevices . add ( ele ) ; } return this ;
public class HBaseUtils { /** * Add a Collection of Columns to an Operation , Only Add Single Columns * If Their Family Isn ' t Already Being Added . * @ param columns * Collection of columns to add to the operation * @ param operation * The HBase operation to add the columns to */ private static void addColu...
// Keep track of whole family additions Set < String > familySet = new HashSet < String > ( ) ; // Iterate through each of the required columns for ( String column : columns ) { // Split the column by : ( family : column ) String [ ] familyAndColumn = column . split ( ":" ) ; // Check if this is a family only if ( fami...
public class ActivityChooserModel { /** * Sets the sorter for ordering activities based on historical data and an intent . * @ param activitySorter The sorter . * @ see ActivitySorter */ public void setActivitySorter ( ActivitySorter activitySorter ) { } }
synchronized ( mInstanceLock ) { if ( mActivitySorter == activitySorter ) { return ; } mActivitySorter = activitySorter ; if ( sortActivitiesIfNeeded ( ) ) { notifyChanged ( ) ; } }
public class ArtifactsMojo { /** * Build the list of files from which digests should be generated . * < p > The list is composed of the project main and attached artifacts . < / p > * @ return the list of files that should be processed . * @ see # hasValidFile ( org . apache . maven . artifact . Artifact ) */ @ O...
List < ChecksumFile > files = new LinkedList < ChecksumFile > ( ) ; // Add project main artifact . if ( hasValidFile ( project . getArtifact ( ) ) ) { files . add ( new ChecksumFile ( "" , project . getArtifact ( ) . getFile ( ) , project . getArtifact ( ) . getType ( ) , null ) ) ; } // Add projects attached . if ( pr...
public class InjectionService { /** * Returns the received { @ code name } , { @ code id } and { @ link Gender } to the sender as a JSON list . */ @ Get ( "/param/{name}/{id}" ) public HttpResponse param ( @ Param String name , /* from path variable */ @ Param int id , /* from path variable and converted into integer *...
return HttpResponse . of ( HttpStatus . OK , MediaType . JSON_UTF_8 , mapper . writeValueAsBytes ( Arrays . asList ( name , id , gender ) ) ) ;
public class AmazonConfigClient { /** * Returns a list of all pending aggregation requests . * @ param describePendingAggregationRequestsRequest * @ return Result of the DescribePendingAggregationRequests operation returned by the service . * @ throws InvalidParameterValueException * One or more of the specifie...
request = beforeClientExecution ( request ) ; return executeDescribePendingAggregationRequests ( request ) ;
public class InetAddressPredicates { /** * Returns a { @ link Predicate } which returns { @ code true } if the given { @ link InetAddress } is in the * range of a < a href = " https : / / tools . ietf . org / html / rfc4632 " > Classless Inter - domain Routing ( CIDR ) < / a > block . * @ param baseAddress the base...
requireNonNull ( baseAddress , "baseAddress" ) ; checkArgument ( maskBits >= 0 , "maskBits: %s (expected: >= 0)" , maskBits ) ; return ofCidr ( baseAddress , maskBits , maskBits ) ;
public class AuthorizationCodeHandler { /** * refactored from Oauth SendErrorJson . Only usable for sending an http400. */ private void sendErrorJSON ( HttpServletResponse response , int statusCode , String errorCode , String errorDescription ) { } }
final String error = "error" ; final String error_description = "error_description" ; try { if ( errorCode != null ) { response . setStatus ( statusCode ) ; response . setHeader ( ClientConstants . REQ_CONTENT_TYPE_NAME , "application/json;charset=UTF-8" ) ; JSONObject responseJSON = new JSONObject ( ) ; responseJSON ....
public class AtomPlacer3D { /** * Count and find first heavy atom ( s ) ( non Hydrogens ) in a chain . * @ param molecule the reference molecule for searching the chain * @ param chain chain to be searched * @ return the atom number of the first heavy atom the number of heavy atoms in the chain */ public int [ ] ...
int [ ] heavy = { - 1 , - 1 } ; int hc = 0 ; for ( int i = 0 ; i < chain . getAtomCount ( ) ; i ++ ) { if ( isHeavyAtom ( chain . getAtom ( i ) ) ) { if ( heavy [ 0 ] < 0 ) { heavy [ 0 ] = molecule . indexOf ( chain . getAtom ( i ) ) ; } hc ++ ; } } heavy [ 1 ] = hc ; return heavy ;
public class sslservice_sslcertkey_binding { /** * Use this API to fetch sslservice _ sslcertkey _ binding resources of given name . */ public static sslservice_sslcertkey_binding [ ] get ( nitro_service service , String servicename ) throws Exception { } }
sslservice_sslcertkey_binding obj = new sslservice_sslcertkey_binding ( ) ; obj . set_servicename ( servicename ) ; sslservice_sslcertkey_binding response [ ] = ( sslservice_sslcertkey_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class ChainImpl { /** * { @ inheritDoc } */ @ Override public void addGroup ( Group group ) { } }
group . setChain ( this ) ; // Set the altlocs chain as well for ( Group g : group . getAltLocs ( ) ) { g . setChain ( this ) ; } groups . add ( group ) ; // store the position internally for quick access of this group String pdbResnum = null ; ResidueNumber resNum = group . getResidueNumber ( ) ; if ( resNum != null )...
public class Streams { /** * Attempt to flush and close an array of < tt > OutputStream < / tt > s . * @ param streams < tt > OutputStream < / tt > s to attempt to flush and close . * @ return < tt > True < / tt > if all streams were flushed and closed , or * < tt > false < / tt > if an exception was thrown . */ ...
boolean success = true ; for ( OutputStream stream : streams ) { boolean rv = fclose ( stream ) ; if ( ! rv ) success = false ; } return success ;
public class OptionIOSetting { /** * Sets the setting for a certain question . It will throw * a CDKException when the setting is not valid . The first setting is * setting 1. */ public void setSetting ( int setting ) throws CDKException { } }
if ( setting < settings . size ( ) + 1 && setting > 0 ) { this . setting = ( String ) settings . get ( setting - 1 ) ; } else { throw new CDKException ( "Setting " + setting + " does not exist." ) ; }
public class OrderAnalyzer { /** * { @ inheritDoc } */ @ Override public OrderAnalyzerResult analyze ( ) { } }
setCurrentDate ( null ) ; setSeenEvent ( null ) ; final PersonAnalysisVisitor visitor = new PersonAnalysisVisitor ( ) ; person . accept ( visitor ) ; for ( final Attribute attribute : visitor . getTrimmedAttributes ( ) ) { basicOrderCheck ( attribute ) ; if ( isUnorderedEvent ( attribute ) ) { // We DO NOT pay attentio...
public class Swagger2MarkupConfigBuilder { /** * Specifies if the paths should be grouped by tags or stay as - is . * @ param pathsGroupedBy the GroupBy enum * @ return this builder */ public Swagger2MarkupConfigBuilder withPathsGroupedBy ( GroupBy pathsGroupedBy ) { } }
Validate . notNull ( pathsGroupedBy , "%s must not be null" , "pathsGroupedBy" ) ; config . pathsGroupedBy = pathsGroupedBy ; return this ;
public class ImageMemoryCache { /** * Generates key for memory cache entry * Format for memory cache key is [ imageUri ] _ [ width ] : [ height ] . */ public static String generateMemoryCacheEntryKey ( String imageUri , int width , int height ) { } }
return new StringBuilder ( imageUri ) . append ( URI_DIMENTION_SEPARATOR ) . append ( width ) . append ( WIDTH_HEIGHT_SEPARATOR ) . append ( height ) . toString ( ) ;
public class WTreeRenderer { /** * Iterate of over the rows to render the tree items . * @ param tree the WTree to render * @ param mode the expand mode * @ param model the tree model * @ param rowIndex the current row index * @ param xml the XML string builder * @ param selectedRows the set of selected row...
String itemId = model . getItemId ( rowIndex ) ; boolean selected = selectedRows . remove ( itemId ) ; boolean expandable = model . isExpandable ( rowIndex ) && model . hasChildren ( rowIndex ) ; boolean expanded = expandedRows . remove ( itemId ) ; TreeItemImage image = model . getItemImage ( rowIndex ) ; String url =...
public class ControlPoint { /** * Queues a task to run when the request controller allows it . This allows tasks not to be dropped when the max request * limit has been hit . If the container has been suspended then this * Note that the task will be run withing the context of a { @ link # beginRequest ( ) } call , ...
controller . queueTask ( this , task , taskExecutor , - 1 , null , false , true ) ;
public class SIMPUtils { /** * Set up guaranteed delivery message properties . These are compulsory properties * on a control message and are therefore set throughout the code . The method * makes it easier to cope with new properties in the message . * @ param msg ControlMessage on which to set properties . */ p...
// Remote to local message properties msg . setGuaranteedSourceMessagingEngineUUID ( sourceMEUuid ) ; msg . setGuaranteedTargetMessagingEngineUUID ( targetMEUuid ) ; msg . setGuaranteedStreamUUID ( streamId ) ; msg . setGuaranteedGatheringTargetUUID ( gatheringTargetDestUuid ) ; msg . setGuaranteedTargetDestinationDefi...
public class EvolvingImagesWorker { /** * Starts the evolution worker with the given evolution result callback . The * callback may be null . * @ param callback the { @ code EvolutionResult } callback . The first parameter * contains the current result and the second the best . */ public void start ( final BiCons...
final Thread thread = new Thread ( ( ) -> { final MinMax < EvolutionResult < PolygonGene , Double > > best = MinMax . of ( ) ; _engine . stream ( ) . limit ( result -> ! Thread . currentThread ( ) . isInterrupted ( ) ) . peek ( best ) . forEach ( r -> { waiting ( ) ; if ( callback != null ) { callback . accept ( r , be...
public class PortletAdministrationHelper { /** * Persist a new or edited PortletDefinition from a form , replacing existing values . * @ param publisher { @ code IPerson } that requires permission to save this definition * @ param form form data to persist * @ return new { @ code PortletDefinitionForm } for this ...
logger . trace ( "In savePortletRegistration() - for: {}" , form . getPortletName ( ) ) ; /* TODO : Service - Layer Security Reboot ( great need of refactoring with a community - approved plan in place ) */ // User must have the selected lifecycle permission over AT LEAST ONE // category in which this portlet resides ....
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcStructuralLoadPlanarForce ( ) { } }
if ( ifcStructuralLoadPlanarForceEClass == null ) { ifcStructuralLoadPlanarForceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 646 ) ; } return ifcStructuralLoadPlanarForceEClass ;
public class GosuEscapeUtil { /** * Escape any special characters in the string , using the Java escape syntax . * For example any tabs become \ t , newlines become \ n etc . * @ return the escaped string . Returns the original string unchanged if it * contains no special characters . */ public static String esca...
String result ; StringBuffer resultBuffer = null ; for ( int i = 0 , length = string . length ( ) ; i < length ; i ++ ) { char ch = string . charAt ( i ) ; String escape = escapeForJava ( ch ) ; if ( escape != null ) { if ( resultBuffer == null ) { resultBuffer = new StringBuffer ( string ) ; resultBuffer . setLength (...
public class Validation { /** * method to check the monomer ' s validation * @ param str * monomer id * @ param type * type of monomer * @ return true if the monomer is valid , false otherwise * @ throws ChemistryException * if the Chemistry Engine can not be initialized * @ throws MonomerLoadingExcepti...
LOG . info ( "Is Monomer valid: " + str ) ; MonomerFactory monomerFactory = null ; monomerFactory = MonomerFactory . getInstance ( ) ; /* Search in Database */ MonomerStore monomerStore = monomerFactory . getMonomerStore ( ) ; if ( monomerStore . hasMonomer ( type , str ) ) { LOG . info ( "Monomer is located in the dat...
public class IOManagerAsync { RequestQueue < ReadRequest > getReadRequestQueue ( FileIOChannel . ID channelID ) { } }
return this . readers [ channelID . getThreadNum ( ) ] . requestQueue ;
public class AbstractMemberWriter { /** * Add the navigation summary link . * @ param members members to be linked * @ param visibleMemberMap the visible inherited members map * @ param liNav the content tree to which the navigation summary link will be added */ protected void addNavSummaryLink ( SortedSet < ? ex...
if ( ! members . isEmpty ( ) ) { liNav . addContent ( getNavSummaryLink ( null , true ) ) ; return ; } TypeElement superClass = utils . getSuperClass ( typeElement ) ; while ( superClass != null ) { if ( visibleMemberMap . hasMembers ( superClass ) ) { liNav . addContent ( getNavSummaryLink ( superClass , true ) ) ; re...
public class DAOGenerator { /** * Curated will correct The ModelDef * @ param curated * @ throws Exception */ public void start ( ) throws Exception { } }
if ( cleanupDirectory ) { CleanUp . start ( conf ) ; } IDatabaseDev db = ( IDatabaseDev ) em . getDB ( ) ; // TODO make sure DB platform can be used for development ModelDefinitionProvider provider = new ModelDefinitionProvider ( db , conf . dbUser , null , conf . includeSchema ) ; ModelDef [ ] origModelList = provider...
public class FloatWindowApi { /** * activity onResume 事件回调 * @ param activity 发生 onResume 事件的activity */ @ Override public void onActivityResume ( Activity activity ) { } }
HMSAgentLog . d ( "autoShowFloatWindow:" + isShowFloatWindowCalled ) ; if ( isShowFloatWindowCalled ) { showFinal ( true , null , ApiClientMgr . INST . getApiClient ( ) ) ; }
public class MathUtils { /** * / * [ deutsch ] * < p > Macht einen sicheren TypeCast auf ein int - Primitive . < / p > * @ param num long - primitive * @ return int as type - cast * @ throws ArithmeticException if int - range overflows */ public static int safeCast ( long num ) { } }
if ( num < Integer . MIN_VALUE || num > Integer . MAX_VALUE ) { throw new ArithmeticException ( "Out of range: " + num ) ; } else { return ( int ) num ; }
public class XmlUtil { /** * Wraps systemId with a " jstl : " prefix to prevent the parser from * thinking that the URI is truly relative and resolving it against * the current directory in the filesystem . */ private static String wrapSystemId ( String systemId ) { } }
if ( systemId == null ) { return "jstl:" ; } else if ( UrlUtil . isAbsoluteUrl ( systemId ) ) { return systemId ; } else { return ( "jstl:" + systemId ) ; }
public class DefaultParserFactory { /** * ( non - Javadoc ) * @ see net . sf . flatpack . PZParserFactory # newFixedWidthParser ( java . sql . Connection , * java . io . InputStream , java . lang . String ) */ @ Override public Parser newFixedLengthParser ( final Connection con , final InputStream dataSourceStream ...
return new DBFixedLengthParser ( con , dataSourceStream , dataDefinition ) ;
public class CSSImportPostProcessor { /** * ( non - Javadoc ) * @ see net . jawr . web . resource . bundle . postprocess . * AbstractChainedResourceBundlePostProcessor # doPostProcessBundle ( net . jawr . * web . resource . bundle . postprocess . BundleProcessingStatus , * java . lang . StringBuffer ) */ @ Over...
String data = bundleData . toString ( ) ; // Rewrite each css url path Matcher matcher = IMPORT_PATTERN . matcher ( data ) ; StringBuffer sb = new StringBuffer ( ) ; while ( matcher . find ( ) ) { String content = getCssPathContent ( matcher . group ( 3 ) , matcher . group ( 4 ) , status ) ; matcher . appendReplacement...
public class Instantiators { /** * Creates a converter for { @ code klass } . */ public static < T > Converter < T > createConverter ( Class < T > klass , InstantiatorModule ... modules ) { } }
return createConverterForType ( klass , modules ) ;
public class ChoiceFormat { /** * Returns pattern with formatted double . * @ param number number to be formatted & substituted . * @ param toAppendTo where text is appended . * @ param status ignore no useful status is returned . */ public StringBuffer format ( double number , StringBuffer toAppendTo , FieldPosi...
// find the number int i ; for ( i = 0 ; i < choiceLimits . length ; ++ i ) { if ( ! ( number >= choiceLimits [ i ] ) ) { // same as number < choiceLimits , except catchs NaN break ; } } -- i ; if ( i < 0 ) i = 0 ; // return either a formatted number , or a string return toAppendTo . append ( choiceFormats [ i ] ) ;
public class GVRVertexBuffer { /** * Retrieves a vertex attribute as an integer array . * The attribute name must be one of the * attributes named in the descriptor passed to the constructor . * @ param attributeName name of the attribute to update * @ throws IllegalArgumentException if attribute name not in de...
int [ ] array = NativeVertexBuffer . getIntArray ( getNative ( ) , attributeName ) ; if ( array == null ) { throw new IllegalArgumentException ( "Attribute name " + attributeName + " cannot be accessed" ) ; } return array ;