signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AppFramework { /** * Registers an object with the framework and relevant subsystems ( e . g . , the context manager ) .
* @ param object Object to register
* @ return True if object successfully registered . False if object was already registered . */
public synchronized boolean registerObject ( Object... | if ( ! MiscUtil . containsInstance ( registeredObjects , object ) ) { if ( object instanceof IRegisterEvent ) { IRegisterEvent onRegister = ( IRegisterEvent ) object ; onRegisterList . add ( onRegister ) ; for ( Object obj : registeredObjects ) { onRegister . registerObject ( obj ) ; } } registeredObjects . add ( objec... |
public class TaskState { /** * Adjust job - level metrics when the task gets retried .
* @ param branches number of forked branches */
public void adjustJobMetricsOnRetry ( int branches ) { } } | TaskMetrics metrics = TaskMetrics . get ( this ) ; for ( int i = 0 ; i < branches ; i ++ ) { String forkBranchId = ForkOperatorUtils . getForkId ( this . taskId , i ) ; long recordsWritten = metrics . getCounter ( MetricGroup . TASK . name ( ) , forkBranchId , RECORDS ) . getCount ( ) ; long bytesWritten = metrics . ge... |
public class MetricsSystem { /** * Builds metric registry name for worker instance . The pattern is instance . uniqueId . metricName .
* @ param name the metric name
* @ return the metric registry name */
private static String getWorkerMetricName ( String name ) { } } | String result = CACHED_METRICS . get ( name ) ; if ( result != null ) { return result ; } return CACHED_METRICS . computeIfAbsent ( name , n -> getMetricNameWithUniqueId ( InstanceType . WORKER , name ) ) ; |
public class UpdateFunctionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateFunctionRequest updateFunctionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateFunctionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateFunctionRequest . getApiId ( ) , APIID_BINDING ) ; protocolMarshaller . marshall ( updateFunctionRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller ... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getPGP ( ) { } } | if ( pgpEClass == null ) { pgpEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 313 ) ; } return pgpEClass ; |
public class Context { /** * Set threshold of executed instructions counter that triggers call to
* < code > observeInstructionCount ( ) < / code > .
* When the threshold is zero , instruction counting is disabled ,
* otherwise each time the run - time executes at least the threshold value
* of script instructi... | if ( sealed ) onSealedMutation ( ) ; if ( threshold < 0 ) throw new IllegalArgumentException ( ) ; instructionThreshold = threshold ; setGenerateObserverCount ( threshold > 0 ) ; |
public class ValueNumberDataflow { /** * Build map of value numbers to param indices . The first parameter has
* index 0 , the second has index 1 , etc .
* @ param method
* the method analyzed by the ValueNumberAnalysis
* @ return the value number to parameter index map */
public Map < ValueNumber , Integer > g... | return getValueNumberToParamMap ( method . getSignature ( ) , method . isStatic ( ) ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcTextLiteralWithExtent ( ) { } } | if ( ifcTextLiteralWithExtentEClass == null ) { ifcTextLiteralWithExtentEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 602 ) ; } return ifcTextLiteralWithExtentEClass ; |
public class SpiderParam { /** * Sets the how the spider handles parameters when checking URIs visited .
* @ param handleParametersVisited the new handle parameters visited value */
public void setHandleParameters ( HandleParametersOption handleParametersVisited ) { } } | this . handleParametersVisited = handleParametersVisited ; getConfig ( ) . setProperty ( SPIDER_HANDLE_PARAMETERS , handleParametersVisited . toString ( ) ) ; |
public class EndpointInfoBuilder { /** * Sets the fragment of the { @ code pathMapping } . */
public EndpointInfoBuilder fragment ( String fragment ) { } } | requireNonNull ( fragment , "fragment" ) ; checkState ( regexPathPrefix == null , "fragment cannot be set with regexPathPrefix: %s" , regexPathPrefix ) ; this . fragment = fragment ; return this ; |
public class CommerceOrderPersistenceImpl { /** * Returns the last commerce order in the ordered set where billingAddressId = & # 63 ; .
* @ param billingAddressId the billing address ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matc... | CommerceOrder commerceOrder = fetchByBillingAddressId_Last ( billingAddressId , orderByComparator ) ; if ( commerceOrder != null ) { return commerceOrder ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "billingAddressId=" ) ; msg . append ( billingAddressId )... |
public class ReadIndexSummary { /** * Records the removal of an element of the given size from the given generation .
* @ param size The size of the element to remove .
* @ param generation The generation of the element to remove . */
synchronized void remove ( long size , int generation ) { } } | Preconditions . checkArgument ( size >= 0 , "size must be a non-negative number" ) ; this . totalSize -= size ; if ( this . totalSize < 0 ) { this . totalSize = 0 ; } removeFromGeneration ( generation ) ; |
public class TrainingsImpl { /** * Update a tag .
* @ param projectId The project id
* @ param tagId The id of the target tag
* @ param updatedTag The updated tag model
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Tag object */
public Observable... | return updateTagWithServiceResponseAsync ( projectId , tagId , updatedTag ) . map ( new Func1 < ServiceResponse < Tag > , Tag > ( ) { @ Override public Tag call ( ServiceResponse < Tag > response ) { return response . body ( ) ; } } ) ; |
public class DbxClientV1 { /** * Takes a copy of the file at the given revision and saves it over the current latest copy .
* This will create a new revision , but the file contents will match the revision you
* specified .
* @ param path
* The Dropbox path of the file to restore .
* @ param rev
* The revis... | DbxPathV1 . checkArgNonRoot ( "path" , path ) ; if ( rev == null ) throw new IllegalArgumentException ( "'rev' can't be null" ) ; if ( rev . length ( ) == 0 ) throw new IllegalArgumentException ( "'rev' can't be empty" ) ; String apiPath = "1/restore/auto" + path ; /* @ Nullable */
String [ ] params = { "rev" , rev , }... |
public class ScriptableObject { /** * Defines a property on an object .
* Based on [ [ DefineOwnProperty ] ] from 8.12.10 of the spec .
* @ param cx the current Context
* @ param id the name / index of the property
* @ param desc the new property descriptor , as described in 8.6.1
* @ param checkValid whether... | Slot slot = getSlot ( cx , id , SlotAccess . QUERY ) ; boolean isNew = slot == null ; if ( checkValid ) { ScriptableObject current = slot == null ? null : slot . getPropertyDescriptor ( cx , this ) ; checkPropertyChange ( id , current , desc ) ; } boolean isAccessor = isAccessorDescriptor ( desc ) ; final int attribute... |
public class InetAddress { /** * Returns the address of the local host . This is achieved by retrieving
* the name of the host from the system , then resolving that name into
* an < code > InetAddress < / code > .
* < P > Note : The resolved address may be cached for a short period of time .
* < p > If there is... | String local = Libcore . os . uname ( ) . nodename ; try { return impl . lookupAllHostAddr ( local , NETID_UNSET ) [ 0 ] ; } catch ( UnknownHostException e ) { try { // iOS devices don ' t map the hostname to an ip .
return impl . lookupAllHostAddr ( "127.0.0.1" , NETID_UNSET ) [ 0 ] ; } catch ( UnknownHostException e2... |
public class NetUtils { /** * 是否本地地址 127 . x . x . x 或者 localhost
* @ param host 地址
* @ return 是否本地地址 */
public static boolean isLocalHost ( String host ) { } } | return StringUtils . isNotBlank ( host ) && ( LOCAL_IP_PATTERN . matcher ( host ) . matches ( ) || "localhost" . equalsIgnoreCase ( host ) ) ; |
public class QuadTree { /** * Gets an iterator on the QuadTree . */
public QuadTreeIterator getIterator ( ) { } } | QuadTreeImpl . QuadTreeIteratorImpl iterator = m_impl . getIterator ( ) ; return new QuadTreeIterator ( iterator , false ) ; |
public class Element { /** * Parse a DOM attribute into MessageML element properties . */
void buildAttribute ( org . w3c . dom . Node item ) throws InvalidInputException { } } | switch ( item . getNodeName ( ) ) { case CLASS_ATTR : attributes . put ( CLASS_ATTR , getStringAttribute ( item ) ) ; break ; case STYLE_ATTR : final String styleAttribute = getStringAttribute ( item ) ; Styles . validate ( styleAttribute ) ; attributes . put ( STYLE_ATTR , styleAttribute ) ; break ; default : throw ne... |
public class FileSnap { /** * find the last ( maybe ) valid n snapshots . this does some
* minor checks on the validity of the snapshots . It just
* checks for / at the end of the snapshot . This does
* not mean that the snapshot is truly valid but is
* valid with a high probability . also , the most recent
*... | List < File > files = Util . sortDataDir ( snapDir . listFiles ( ) , "snapshot" , false ) ; int count = 0 ; List < File > list = new ArrayList < File > ( ) ; for ( File f : files ) { // we should catch the exceptions
// from the valid snapshot and continue
// until we find a valid one
try { if ( Util . isValidSnapshot ... |
public class IgnoredResourcesPolicy { /** * Evaluates whether the destination provided matches any of the configured
* rules
* @ param config
* The { @ link IgnoredResourcesConfig } containing the
* rules
* @ param destination
* The destination to evaluate
* @ param verb
* HTTP verb or ' * ' for all ver... | if ( destination == null || destination . trim ( ) . length ( ) == 0 ) { destination = "/" ; // $ NON - NLS - 1 $
} for ( IgnoredResource resource : config . getRules ( ) ) { String resourceVerb = resource . getVerb ( ) ; boolean verbMatches = verb == null || IgnoredResource . VERB_MATCH_ALL . equals ( resourceVerb ) |... |
public class NamingService { /** * Get the naming service for the nodes associated to a model .
* @ param mo the model to look at
* @ return the view if attached . { @ code null } otherwise */
@ SuppressWarnings ( "unchecked" ) public static NamingService < Node > getNodeNames ( Model mo ) { } } | return ( NamingService < Node > ) mo . getView ( ID + Node . TYPE ) ; |
public class SchemaEvolutionValidator { /** * / * package private */
void compareMapTypes ( Schema oldSchema , Schema newSchema , List < Message > messages , String name ) { } } | if ( oldSchema == null || newSchema == null || oldSchema . getType ( ) != Schema . Type . MAP ) { throw new IllegalArgumentException ( "Old schema must be MAP type. Name=" + name + ". Type=" + oldSchema ) ; } if ( newSchema . getType ( ) != Schema . Type . MAP ) { messages . add ( new Message ( Level . ERROR , "Illegal... |
public class CmsDbSettingsPanel { /** * Accesses a property from the DB configuration for the selected DB .
* @ param name the name of the property
* @ return the value of the property */
private String dbProp ( String name ) { } } | String dbType = m_setupBean . getDatabase ( ) ; Object prop = m_setupBean . getDatabaseProperties ( ) . get ( dbType ) . get ( dbType + "." + name ) ; if ( prop == null ) { return "" ; } return prop . toString ( ) ; |
public class CmsConfigurationCache { /** * Removes a published resource from the cache . < p >
* @ param res the published resource */
public void remove ( CmsPublishedResource res ) { } } | remove ( res . getStructureId ( ) , res . getRootPath ( ) , res . getType ( ) ) ; |
public class Util { /** * WARNING : The stream must have read up to the OID length .
* This method reads and decodes the OID after the length . */
private static String readOID ( ByteArrayInputStream bais , int oid_len ) throws IOException { } } | byte [ ] oid_tmp_arr = new byte [ oid_len ] ; bais . read ( oid_tmp_arr , 0 , oid_len ) ; byte [ ] oid_arr = new byte [ oid_len + 2 ] ; oid_arr [ 0 ] = ASN_TAG_OID ; oid_arr [ 1 ] = ( byte ) oid_len ; System . arraycopy ( oid_tmp_arr , 0 , oid_arr , 2 , oid_len ) ; return decodeOID ( oid_arr ) ; |
public class ServicesAmpImpl { /** * newService ( ) creates a new service from a bean */
@ Override public < T > ServiceBuilderAmp newService ( Class < T > type ) { } } | Objects . requireNonNull ( type ) ; return new ServiceBuilderImpl < > ( this , type ) ; |
public class Strands { /** * Disables the current strand for thread scheduling purposes , for up to
* the specified waiting time , unless the permit is available .
* If the permit is available then it is consumed and the call
* returns immediately ; otherwise the current strand becomes disabled
* for scheduling... | try { Strand . parkNanos ( blocker , nanos ) ; } catch ( SuspendExecution e ) { throw RuntimeSuspendExecution . of ( e ) ; } |
public class Ix { /** * Collects the elements of this sequence into a multi - Map where the key is
* determined from each element via the keySelector function .
* @ param < K > the key type
* @ param keySelector the function that receives the current element and returns
* a key for it to be used as the Map key ... | return this . < K > collectToMultimap ( keySelector ) . first ( ) ; |
public class ManifestFileProcessor { /** * Retrieves a map of features definitions associated with the specified product name .
* @ param productName The product name whose feature definitions to return .
* @ return The feature definitions associated with the input product name . */
public Map < String , Provisioni... | if ( productName . equals ( CORE_PRODUCT_NAME ) ) { return getCoreProductFeatureDefinitions ( ) ; } else if ( productName . equals ( USR_PRODUCT_EXT_NAME ) ) { return getUsrProductFeatureDefinitions ( ) ; } else { return getProductExtFeatureDefinitions ( productName ) ; } |
public class TextReport { /** * Suite prologue . */
private void emitSuiteStart ( Description description , long startTimestamp ) throws IOException { } } | String suiteName = description . getDisplayName ( ) ; if ( useSimpleNames ) { if ( suiteName . lastIndexOf ( '.' ) >= 0 ) { suiteName = suiteName . substring ( suiteName . lastIndexOf ( '.' ) + 1 ) ; } } logShort ( shortTimestamp ( startTimestamp ) + "Suite: " + FormattingUtils . padTo ( maxClassNameColumns , suiteName... |
public class VoltCompiler { /** * Simplified interface for loading a ddl file with full support for VoltDB
* extensions ( partitioning , procedures , export ) , but no support for " project file " input .
* This is , at least initially , only a back door to create a fully functional catalog for
* the purposes of ... | m_catalog = new Catalog ( ) ; m_catalog . execute ( "add / clusters cluster" ) ; Database db = initCatalogDatabase ( m_catalog ) ; List < VoltCompilerReader > ddlReaderList = DDLPathsToReaderList ( ddlFilePaths ) ; final VoltDDLElementTracker voltDdlTracker = new VoltDDLElementTracker ( this ) ; InMemoryJarfile jarOutp... |
public class XSLTAttributeDef { /** * Set a value on an attribute .
* @ param handler non - null reference to current StylesheetHandler that is constructing the Templates .
* @ param attrUri The Namespace URI of the attribute , or an empty string .
* @ param attrLocalName The local name ( without prefix ) , or em... | if ( attrRawName . equals ( "xmlns" ) || attrRawName . startsWith ( "xmlns:" ) ) return true ; String setterString = getSetterMethodName ( ) ; // If this is null , then it is a foreign namespace and we
// do not process it .
if ( null != setterString ) { try { Method meth ; Object [ ] args ; if ( setterString . equals ... |
public class Frames { /** * Parse a dataset into a Frame . */
public static Frame parse ( File file ) { } } | Key fkey = NFSFileVec . make ( file ) ; Key dest = Key . make ( file . getName ( ) ) ; Frame frame = ParseDataset2 . parse ( dest , new Key [ ] { fkey } ) ; return frame ; |
public class ChannelFinderClientImpl { /** * Get a list of names of all the tags currently present on the
* channelfinder service .
* @ return a list of names of all the existing { @ link Tag } s . */
public Collection < String > getAllTags ( ) { } } | return wrappedSubmit ( new Callable < Collection < String > > ( ) { @ Override public Collection < String > call ( ) throws Exception { Collection < String > allTags = new HashSet < String > ( ) ; ObjectMapper mapper = new ObjectMapper ( ) ; List < XmlTag > xmltags = new ArrayList < XmlTag > ( ) ; try { xmltags = mappe... |
public class ArgumentProcessor { /** * Process argument array and pass values to given bean
* @ param arguments Arary of arguments
* @ param bean Bean to pass values to
* @ return the processed bean . */
public T process ( String [ ] arguments , T bean ) { } } | return process ( Arrays . asList ( arguments ) , bean ) ; |
public class Tuple2 { /** * Given a value of type < code > A < / code > , produce an instance of this tuple with each slot set to that value .
* @ param a the value to fill the tuple with
* @ param < A > the value type
* @ return the filled tuple */
public static < A > Tuple2 < A , A > fill ( A a ) { } } | return tuple ( a , a ) ; |
public class BoxApiFile { /** * Gets a request that restores a trashed file
* @ param id id of file to restore
* @ return request to restore a file from the trash */
public BoxRequestsFile . RestoreTrashedFile getRestoreTrashedFileRequest ( String id ) { } } | BoxRequestsFile . RestoreTrashedFile request = new BoxRequestsFile . RestoreTrashedFile ( id , getFileInfoUrl ( id ) , mSession ) ; return request ; |
public class MessageSourceMessageResolverAdapter { /** * ( non - Javadoc )
* @ see es . sandbox . ui . messages . resolver . MessageResolverStrategy # resolve ( java . lang . String , java . lang . Object [ ] ) */
@ Override public String resolve ( String code , Object ... arguments ) { } } | return this . messageSourceAccessor . getMessage ( code , arguments , code ) ; |
public class AbstractShapeFileWriter { /** * { @ inheritDoc } */
@ Override public void close ( ) throws IOException { } } | super . close ( ) ; if ( this . shxWriter != null ) { this . shxWriter . close ( ) ; } if ( this . dbfWriter != null ) { this . dbfWriter . close ( ) ; this . attrContainers = null ; } |
public class GreenPepperMacroWithBodyMigrator { /** * { @ inheritDoc } */
public MacroDefinition migrate ( MacroDefinition macroDefinition , ConversionContext context ) { } } | MacroBody body = macroDefinition . getBody ( ) ; WikiStyleRenderer wikiStyleRenderer = ( WikiStyleRenderer ) ContainerManager . getComponent ( "wikiStyleRenderer" ) ; String content = wikiStyleRenderer . convertWikiToXHtml ( new PageContext ( context . getEntity ( ) ) , body . getBody ( ) ) ; MacroBody newBody = new Ri... |
public class SnappyFramedInputStream { /** * { @ inheritDoc } */
@ Override public int read ( ByteBuffer dst ) throws IOException { } } | if ( dst == null ) { throw new IllegalArgumentException ( "dst is null" ) ; } if ( closed ) { throw new ClosedChannelException ( ) ; } if ( dst . remaining ( ) == 0 ) { return 0 ; } if ( ! ensureBuffer ( ) ) { return - 1 ; } final int size = min ( dst . remaining ( ) , available ( ) ) ; dst . put ( buffer , position , ... |
public class XSDocument { /** * $ constraint = " $ defaultValue " */
public XSDocument constraint ( Constraint constraint , String constraintValue ) throws SAXException { } } | if ( constraint != Constraint . NONE ) xml . addAttribute ( constraint . name ( ) . toLowerCase ( ) , constraintValue ) ; return this ; |
public class OnBindViewHolderListenerImpl { /** * is called in onViewDetachedFromWindow when the view is detached from the window
* @ param viewHolder the viewHolder for the type at this position
* @ param position the position of this viewHolder */
@ Override public void onViewDetachedFromWindow ( RecyclerView . V... | IItem item = FastAdapter . getHolderAdapterItemTag ( viewHolder ) ; if ( item != null ) { item . detachFromWindow ( viewHolder ) ; if ( viewHolder instanceof FastAdapter . ViewHolder ) { ( ( FastAdapter . ViewHolder ) viewHolder ) . detachFromWindow ( item ) ; } } |
public class DeploymentParameter { /** * Create a new entry in the database . No commit performed . */
public static DeploymentParameter create ( DbConn cnx , Boolean enabled , Integer nodeId , Integer nbThread , Integer pollingInterval , Integer qId ) { } } | QueryResult r = cnx . runUpdate ( "dp_insert" , enabled , nbThread , pollingInterval , nodeId , qId ) ; DeploymentParameter res = new DeploymentParameter ( ) ; res . id = r . getGeneratedId ( ) ; res . node = nodeId ; res . nbThread = nbThread ; res . pollingInterval = pollingInterval ; res . queue = qId ; return res ; |
public class SRTServletResponse { /** * Adds a date header with the specified time . If this is called more than once ,
* the current value will replace the previous value .
* @ param name The header field name .
* @ param t The time in milliseconds since the epoch . */
public void setDateHeader ( String name , l... | // 311717
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . entering ( CLASS_NAME , "setDateHeader" , " name --> " + name + " value --> " + String . valueOf ( t ) + " [" + this + "]" ) ; } // d151464 - check the include flag
WebAppDis... |
public class DRL5Lexer { /** * $ ANTLR start " OR _ ASSIGN " */
public final void mOR_ASSIGN ( ) throws RecognitionException { } } | try { int _type = OR_ASSIGN ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 176:5 : ( ' | = ' )
// src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 176:7 : ' | = '
{ match ( "|=" ) ; if ( state . failed ) return ; } state . t... |
public class AnnotationSource { /** * Returns true if { @ code annotation } has a single element named " value " , letting us drop the
* ' value = ' prefix in the source code . */
private static boolean hasSingleValueWithDefaultKey ( AnnotationMirror annotation ) { } } | if ( annotation . getElementValues ( ) . size ( ) != 1 ) { return false ; } ExecutableElement key = getOnlyElement ( annotation . getElementValues ( ) . keySet ( ) ) ; return key . getSimpleName ( ) . contentEquals ( "value" ) ; |
public class CmsWorkplaceManager { /** * Sets the Workplace default user settings . < p >
* @ param defaultUserSettings the user settings to set */
public void setDefaultUserSettings ( CmsDefaultUserSettings defaultUserSettings ) { } } | m_defaultUserSettings = defaultUserSettings ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_DEFAULT_USER_SETTINGS_1 , m_defaultUserSettings . getClass ( ) . getName ( ) ) ) ; } |
public class SystemInputJson { /** * Returns the contents of the given JSON array as a list of identifiers . */
private static List < String > toIdentifiers ( JsonArray array ) { } } | return IntStream . range ( 0 , array . size ( ) ) . mapToObj ( i -> validIdentifier ( array . getString ( i ) ) ) . collect ( toList ( ) ) ; |
public class LanguageResourceService { /** * Adds or overlays all languages defined within the / translations
* directory of the given ServletContext . If no such language files exist ,
* nothing is done . If a language is already defined , the strings from the
* will be overlaid on top of the existing strings , ... | // Get the paths of all the translation files
Set < ? > resourcePaths = context . getResourcePaths ( TRANSLATION_PATH ) ; // If no translation files found , nothing to add
if ( resourcePaths == null ) return ; // Iterate through all the found language files and add them to the map
for ( Object resourcePathObject : reso... |
public class QueryUtil { /** * Get a linear scan query for the given similarity query .
* @ param < O > Object type
* @ param simQuery similarity query
* @ return Range query */
public static < O > RangeQuery < O > getLinearScanSimilarityRangeQuery ( SimilarityQuery < O > simQuery ) { } } | // Slight optimizations of linear scans
if ( simQuery instanceof PrimitiveSimilarityQuery ) { final PrimitiveSimilarityQuery < O > pdq = ( PrimitiveSimilarityQuery < O > ) simQuery ; return new LinearScanPrimitiveSimilarityRangeQuery < > ( pdq ) ; } return new LinearScanSimilarityRangeQuery < > ( simQuery ) ; |
public class CloudSpannerXAConnection { /** * Preconditions : 1 . Flags is one of TMSUCCESS , TMFAIL , TMSUSPEND 2 . xid ! = null 3 . Connection is
* associated with transaction xid
* Implementation deficiency preconditions : 1 . Flags is not TMSUSPEND
* Postconditions : 1 . connection is disassociated from the t... | if ( logger . logDebug ( ) ) { debug ( "ending transaction xid = " + xid ) ; } // Check preconditions
if ( flags != XAResource . TMSUSPEND && flags != XAResource . TMFAIL && flags != XAResource . TMSUCCESS ) { throw new CloudSpannerXAException ( CloudSpannerXAException . INVALID_FLAGS , Code . INVALID_ARGUMENT , XAExce... |
public class DefaultXPathEvaluator { /** * Evaluate the XPath as an array of the given type .
* @ param componentType
* Possible values : primitive types ( e . g . Short . Type ) , Projection interfaces , any
* class with a String constructor or a String factory method , and org . w3c . Node
* @ return an array... | Class < ? > callerClass = ReflectionHelper . getDirectCallerClass ( ) ; List < T > list = evaluateMultiValues ( componentType , callerClass ) ; return list . toArray ( ( T [ ] ) java . lang . reflect . Array . newInstance ( componentType , list . size ( ) ) ) ; |
public class ClassInfo { /** * Get the classes that have this class as an annotation .
* @ return A list of standard classes and non - annotation interfaces that are annotated by this class , if this is
* an annotation class , or the empty list if none . Also handles the { @ link Inherited } meta - annotation ,
*... | if ( ! scanResult . scanSpec . enableAnnotationInfo ) { throw new IllegalArgumentException ( "Please call ClassGraph#enableAnnotationInfo() before #scan()" ) ; } if ( ! isAnnotation ) { throw new IllegalArgumentException ( "Class is not an annotation: " + getName ( ) ) ; } // Get classes that have this annotation
final... |
public class MockEC2QueryHandler { /** * Handles " createSubnet " request to create Subnet and returns response with a subnet .
* @ param vpcId vpc Id for subnet .
* @ param cidrBlock VPC cidr block .
* @ return a CreateSubnetResponseType with our new Subnet */
private CreateSubnetResponseType createSubnet ( fina... | CreateSubnetResponseType ret = new CreateSubnetResponseType ( ) ; ret . setRequestId ( UUID . randomUUID ( ) . toString ( ) ) ; MockSubnet mockSubnet = mockSubnetController . createSubnet ( cidrBlock , vpcId ) ; SubnetType subnetType = new SubnetType ( ) ; subnetType . setVpcId ( mockSubnet . getVpcId ( ) ) ; subnetTyp... |
public class AbstractHttpQuery { /** * Returns the value of the given query string parameter .
* If this parameter occurs multiple times in the URL , only the last value
* is returned and others are silently ignored .
* @ param paramname Name of the query string parameter to get .
* @ return The value of the pa... | final List < String > params = getQueryString ( ) . get ( paramname ) ; return params == null ? null : params . get ( params . size ( ) - 1 ) ; |
public class Request { /** * Executes requests that have already been serialized into an HttpURLConnection . No validation is done that the
* contents of the connection actually reflect the serialized requests , so it is the caller ' s responsibility to
* ensure that it will correctly generate the desired responses... | List < Response > responses = Response . fromHttpConnection ( connection , requests ) ; Utility . disconnectQuietly ( connection ) ; int numRequests = requests . size ( ) ; if ( numRequests != responses . size ( ) ) { throw new FacebookException ( String . format ( "Received %d responses while expecting %d" , responses... |
public class SimpleFilteredSentenceBreakIterator { /** * Is there an exception at this point ?
* @ param n
* @ return */
private final boolean breakExceptionAt ( int n ) { } } | // Note : the C + + version of this function is SimpleFilteredSentenceBreakIterator : : breakExceptionAt ( )
int bestPosn = - 1 ; int bestValue = - 1 ; // loops while ' n ' points to an exception
text . setIndex ( n ) ; backwardsTrie . reset ( ) ; int uch ; // Assume a space is following the ' . ' ( so we handle the ca... |
public class Generics { /** * Return the real return type of a method .
* Normally it returns { @ link Method # getReturnType ( ) }
* In case a method is declared in a super type and the return type is declared as a generic { @ link TypeVariable } ,
* when a sub class with type variable implementation presented ,... | Type type = method . getGenericReturnType ( ) ; if ( type == Class . class ) { return $ . cast ( type ) ; } if ( type instanceof TypeVariable ) { Map < String , Class > lookup = Generics . buildTypeParamImplLookup ( theClass ) ; String name = ( ( TypeVariable ) type ) . getName ( ) ; Class < ? > realType = lookup . get... |
public class HyperGeometricDistribution { /** * Uses inversion by chop - down search from the mode when the mean & lt ; 20
* and the patchwork - rejection method when the mean & gt ; 20. */
@ Override public double rand ( ) { } } | int mm = m ; int nn = n ; if ( mm > N / 2 ) { // invert mm
mm = N - mm ; } if ( nn > N / 2 ) { // invert nn
nn = N - nn ; } if ( nn > mm ) { // swap nn and mm
int swap = nn ; nn = mm ; mm = swap ; } if ( rng == null ) { if ( ( double ) nn * mm >= 20 * N ) { // use ratio - of - uniforms method
rng = new Patchwork ( N , ... |
public class ODatabaseDocumentTx { /** * Returns the number of the records of the class iClassName . */
public long countClass ( final String iClassName ) { } } | final OClass cls = getMetadata ( ) . getSchema ( ) . getClass ( iClassName ) ; if ( cls == null ) throw new IllegalArgumentException ( "Class '" + iClassName + "' not found in database" ) ; return cls . count ( ) ; |
public class VariableAssignment { /** * setter for value - sets
* @ generated
* @ param v value to set into the feature */
public void setValue ( float v ) { } } | if ( VariableAssignment_Type . featOkTst && ( ( VariableAssignment_Type ) jcasType ) . casFeat_value == null ) jcasType . jcas . throwFeatMissing ( "value" , "ch.epfl.bbp.uima.types.VariableAssignment" ) ; jcasType . ll_cas . ll_setFloatValue ( addr , ( ( VariableAssignment_Type ) jcasType ) . casFeatCode_value , v ) ; |
public class Base { /** * Adds a batch statement using given < code > java . sql . PreparedStatement < / code > and parameters .
* @ param ps < code > java . sql . PreparedStatement < / code > to add batch to .
* @ param parameters parameters for the query in < code > java . sql . PreparedStatement < / code > . Par... | new DB ( DB . DEFAULT_NAME ) . addBatch ( ps , parameters ) ; |
public class l3param { /** * Use this API to fetch all the l3param resources that are configured on netscaler . */
public static l3param get ( nitro_service service ) throws Exception { } } | l3param obj = new l3param ( ) ; l3param [ ] response = ( l3param [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class AbstractHttpTransport { /** * Returns the value of the requested parameter from the request , or null
* @ param request
* the request object
* @ param aliases
* array of query arg names by which the request may be specified
* @ return the value of the param , or null if it is not specified under ... | final String sourceMethod = "getParameter" ; // $ NON - NLS - 1 $
boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { request . getQueryString ( ) , Arrays . asList ( aliases ) } ) ; } Map < String , String [ ] > params = r... |
public class CmsJSONSearchConfigurationParser { /** * Returns the configured Solr core , or < code > null < / code > if no core is configured .
* @ return The configured Solr core , or < code > null < / code > if no core is configured . */
protected String getCore ( ) { } } | try { return m_configObject . getString ( JSON_KEY_CORE ) ; } catch ( JSONException e ) { if ( null == m_baseConfig ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_NO_CORE_SPECIFIED_0 ) , e ) ; } return null ; } else { return m_baseConfig . getGeneralConfig ( ... |
public class ComponentProxy { /** * Checks if the method is derived from Object . finalize ( )
* @ param method method being tested
* @ return true if the method is defined from Object . finalize ( ) , false otherwise */
protected static boolean isFinalizeMethod ( Method method ) { } } | return method . getReturnType ( ) == void . class && method . getParameterTypes ( ) . length == 0 && method . getName ( ) . equals ( "finalize" ) ; |
public class Matrix4d { /** * Pre - multiply a rotation to this matrix by rotating the given amount of radians
* about the specified < code > ( x , y , z ) < / code > axis .
* The axis described by the three components needs to be a unit vector .
* When used with a right - handed coordinate system , the produced ... | return rotateLocal ( ang , x , y , z , this ) ; |
public class WampSession { /** * Set the value with the given name replacing an existing value ( if any ) .
* @ param name the name of the attribute
* @ param value the value for the attribute */
public void setAttribute ( String name , Object value ) { } } | this . webSocketSession . getAttributes ( ) . put ( name , value ) ; |
public class CPTaxCategoryUtil { /** * Returns a range of all the cp tax categories where groupId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result... | return getPersistence ( ) . findByGroupId ( groupId , start , end ) ; |
public class StorableGenerator { /** * Defines a hashCode method . */
private void addHashCodeMethod ( ) { } } | Modifiers modifiers = Modifiers . PUBLIC . toSynchronized ( true ) ; MethodInfo mi = addMethodIfNotFinal ( modifiers , "hashCode" , TypeDesc . INT , null ) ; if ( mi == null ) { return ; } CodeBuilder b = new CodeBuilder ( mi ) ; boolean mixIn = false ; for ( StorableProperty property : mAllProperties . values ( ) ) { ... |
public class Throwables { /** * Gets a { @ code Throwable } cause chain as a list . The first entry in the list will be { @ code
* throwable } followed by its cause hierarchy . Note that this is a snapshot of the cause chain and
* will not reflect any subsequent changes to the cause chain .
* < p > Here ' s an ex... | checkNotNull ( throwable ) ; List < Throwable > causes = new ArrayList < Throwable > ( 4 ) ; while ( throwable != null ) { causes . add ( throwable ) ; throwable = throwable . getCause ( ) ; } return Collections . unmodifiableList ( causes ) ; |
public class MockPropertyService { /** * Initializes the properties from a multiple resources .
* @ param resources Sources of properties .
* @ throws IOException IO exception . */
public void setResources ( Resource [ ] resources ) throws IOException { } } | clear ( ) ; for ( Resource resource : resources ) { addResource ( resource ) ; } |
public class AbstractDao { /** * - - - transactional methods - - - */
public < R > R withCommitTransaction ( TransFunc < R > transFunc ) throws IOException { } } | return withTransaction ( transFunc , true ) ; |
public class StAXUtils { /** * Extract or create an instance of { @ link XMLStreamReader } from the provided { @ link Source } .
* @ param factory the { @ link XMLStreamReader } to use ( if needed )
* @ param source the source
* @ return the { @ link XMLStreamReader }
* @ throws XMLStreamException when failing ... | XMLStreamReader xmlStreamReader ; if ( source instanceof StAXSource ) { // StAXSource is not supported by standard XMLInputFactory
StAXSource staxSource = ( StAXSource ) source ; if ( staxSource . getXMLStreamReader ( ) != null ) { xmlStreamReader = staxSource . getXMLStreamReader ( ) ; } else { // TODO : add support f... |
public class DomConfigurationWriter { /** * Externalizes a { @ link CsvDatastore } to a XML element .
* @ param datastore the datastore to externalize
* @ param filename the filename / path to use in the XML element . Since the appropriate path will depend on the
* reading application ' s environment ( supported ... | final Element datastoreElement = getDocument ( ) . createElement ( "csv-datastore" ) ; datastoreElement . setAttribute ( "name" , datastore . getName ( ) ) ; final String description = datastore . getDescription ( ) ; if ( ! Strings . isNullOrEmpty ( description ) ) { datastoreElement . setAttribute ( "description" , d... |
public class TypeUtil { /** * Factory method for { @ link Properties } from an even - sized String array .
* @ param _ keysAndVals String array of keys and values , may be null or even - numbered String array
* @ return new Properties object */
public static Properties createProperties ( String ... _keysAndVals ) {... | if ( _keysAndVals != null && _keysAndVals . length % 2 != 0 ) { throw new IllegalArgumentException ( "Even number of String parameters required." ) ; } Properties props = new Properties ( ) ; if ( _keysAndVals != null ) { for ( int i = 0 ; i < _keysAndVals . length ; i += 2 ) { props . setProperty ( _keysAndVals [ i ] ... |
public class User { /** * Validates a token sent for email confirmation .
* @ param token a token
* @ return true if valid */
public final boolean isValidEmailConfirmationToken ( String token ) { } } | Sysprop s = CoreUtils . getInstance ( ) . getDao ( ) . read ( getAppid ( ) , identifier ) ; return isValidToken ( s , Config . _EMAIL_TOKEN , token ) ; |
public class JSONs { /** * Read partitions of VMs .
* @ param mo the associated model to browse
* @ param o the object to parse
* @ param id the key in the map that points to the partitions
* @ return the parsed partition
* @ throws JSONConverterException if the key does not point to partitions of VMs */
publ... | Set < Collection < VM > > vms = new HashSet < > ( ) ; Object x = o . get ( id ) ; if ( ! ( x instanceof JSONArray ) ) { throw new JSONConverterException ( "Set of identifiers sets expected at key '" + id + "'" ) ; } for ( Object obj : ( JSONArray ) x ) { vms . add ( vmsFromJSON ( mo , ( JSONArray ) obj ) ) ; } return v... |
public class LFltFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < R > LFltFunctionBuilder < R > fltFunction ( Consumer < LFltFunction < R > > consumer ... | return new LFltFunctionBuilder ( consumer ) ; |
public class Components { /** * Figure out connectivity and generate Java statements .
* @ param comps */
public static void figureOutConnect ( PrintStream w , Object ... comps ) { } } | // add all the components via Proxy .
List < ComponentAccess > l = new ArrayList < ComponentAccess > ( ) ; for ( Object c : comps ) { l . add ( new ComponentAccess ( c ) ) ; } // find all out slots
for ( ComponentAccess cp_out : l ) { w . println ( "// connect " + objName ( cp_out ) ) ; // over all input slots .
for ( ... |
public class DbUtil { /** * Gets the < code > String < / code > denoting the specified SQL data type .
* @ param type The data type to get the name of . Valid type values
* consist of the static fields of { @ link java . sql . Types } .
* @ param length The length to assign to data types for those types
* that ... | int dataTypeColumn = typeInfo . findColumn ( "DATA_TYPE" ) ; while ( typeInfo . next ( ) ) { if ( typeInfo . getInt ( dataTypeColumn ) == type ) { String typeName = typeInfo . getString ( "TYPE_NAME" ) ; if ( length > 0 ) { if ( typeName . contains ( "()" ) ) { return typeName . replaceAll ( "\\(\\)" , "(" + length + "... |
public class StoreFactory { /** * If the store must be unique , here is it .
* @ return unique storage
* @ throws java . io . IOException in case no temp folder has been found . */
public static Store < InputStream > anonymousStore ( ) throws IOException { } } | File temp = File . createTempFile ( "ops4j-store-anonymous-" , "" ) ; temp . delete ( ) ; temp . mkdir ( ) ; return new TemporaryStore ( temp , true ) ; |
public class AbstractRouter { /** * Gets the url of the route handled by the specified action method . The action does not takes parameters . This
* implementation delegates to { @ link # getReverseRouteFor ( String , String , java . util . Map ) } .
* @ param className the controller class
* @ param method the c... | return getReverseRouteFor ( className , method , null ) ; |
public class SVGEffects { /** * Static method to prepare a SVG document for light gradient effects .
* Invoke this from an appropriate update thread !
* @ param svgp Plot to prepare */
public static void addLightGradient ( SVGPlot svgp ) { } } | Element gradient = svgp . getIdElement ( LIGHT_GRADIENT_ID ) ; if ( gradient == null ) { gradient = svgp . svgElement ( SVGConstants . SVG_LINEAR_GRADIENT_TAG ) ; gradient . setAttribute ( SVGConstants . SVG_ID_ATTRIBUTE , LIGHT_GRADIENT_ID ) ; gradient . setAttribute ( SVGConstants . SVG_X1_ATTRIBUTE , "0" ) ; gradien... |
public class GosuStringUtil { /** * < p > Overlays part of a String with another String . < / p >
* < pre >
* GosuStringUtil . overlayString ( null , * , * , * ) = NullPointerException
* GosuStringUtil . overlayString ( * , null , * , * ) = NullPointerException
* GosuStringUtil . overlayString ( " " , " abc " ,... | return new StringBuffer ( start + overlay . length ( ) + text . length ( ) - end + 1 ) . append ( text . substring ( 0 , start ) ) . append ( overlay ) . append ( text . substring ( end ) ) . toString ( ) ; |
public class AmazonCloudDirectoryClient { /** * Attaches a typed link to a specified source and target object . For more information , see < a href =
* " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / directory _ objects _ links . html # directory _ objects _ links _ typedlink "
... | request = beforeClientExecution ( request ) ; return executeAttachTypedLink ( request ) ; |
public class ApiOvhDbaasqueue { /** * Get one region
* REST : GET / dbaas / queue / { serviceName } / region / { regionId }
* @ param serviceName [ required ] Application ID
* @ param regionId [ required ] Region ID
* API beta */
public OvhRegion serviceName_region_regionId_GET ( String serviceName , String reg... | String qPath = "/dbaas/queue/{serviceName}/region/{regionId}" ; StringBuilder sb = path ( qPath , serviceName , regionId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRegion . class ) ; |
public class KeywordEstimate { /** * Gets the max value for this KeywordEstimate .
* @ return max * The upper bound on the estimated stats .
* < p > This is not a guarantee that actual performance
* will never be higher than
* these stats . */
public com . google . api . ads . adwords . axis . v201809 . o . Sta... | return max ; |
public class RandomVariableDifferentiableAADPathwise { /** * / * ( non - Javadoc )
* @ see net . finmath . stochastic . RandomVariable # getQuantileExpectation ( double , double ) */
@ Override public double getQuantileExpectation ( double quantileStart , double quantileEnd ) { } } | return ( ( RandomVariableDifferentiableAADPathwise ) getValues ( ) ) . getValues ( ) . getQuantileExpectation ( quantileStart , quantileEnd ) ; |
public class PresenterLifecycleDelegate { /** * { @ link ViewWithPresenter # setPresenterFactory ( PresenterFactory ) } */
public void setPresenterFactory ( @ Nullable PresenterFactory < P > presenterFactory ) { } } | if ( presenter != null ) throw new IllegalArgumentException ( "setPresenterFactory() should be called before onResume()" ) ; this . presenterFactory = presenterFactory ; |
public class Key { /** * Builds Key from method ' s generic return type and method ' s qualifying
* annotations . A qualifying annotation is marked with a { @ code @ Qualifier } .
* @ param method method for deriving return type and annotations from
* @ param < T > target type
* @ return instance of a Key */
pu... | return new Key ( method . getGenericReturnType ( ) , qualifiers ( method . getAnnotations ( ) ) ) ; |
public class CalculateSum { /** * This function computes the sum of integers from 1 up to and including n .
* > > > CalculateSum . calculate _ sum ( 30)
* 465
* > > > CalculateSum . calculate _ sum ( 100)
* 5050
* > > > CalculateSum . calculate _ sum ( 5)
* 15
* > > > CalculateSum . calculate _ sum ( 10) ... | return ( n * ( n + 1 ) ) / 2 ; |
public class MarshallUtil { /** * Unmarshal a { @ link Collection } .
* @ param in { @ link ObjectInput } to read .
* @ param builder { @ link CollectionBuilder } builds the concrete { @ link Collection } based on size .
* @ param reader { @ link ElementReader } reads one element from the input .
* @ param < E ... | final int size = unmarshallSize ( in ) ; if ( size == NULL_VALUE ) { return null ; } T collection = Objects . requireNonNull ( builder , "CollectionBuilder must be non-null" ) . build ( size ) ; for ( int i = 0 ; i < size ; ++ i ) { // noinspection unchecked
collection . add ( reader . readFrom ( in ) ) ; } return coll... |
public class HttpRequest { /** * 获取指定的header的int值 , 没有返回默认int值
* @ param radix 进制数
* @ param name header名
* @ param defaultValue 默认int值
* @ return header值 */
public int getIntHeader ( int radix , String name , int defaultValue ) { } } | return header . getIntValue ( radix , name , defaultValue ) ; |
public class SingleObjectBundle { /** * Append a single representation to the object .
* @ param meta Meta for the representation
* @ param data Data to append */
public void append ( SimpleTypeInformation < ? > meta , Object data ) { } } | this . meta . add ( meta ) ; this . contents . add ( data ) ; |
public class MisoScenePanel { /** * This is called when our view position has changed by more than one tile in any direction .
* Herein we do a whole crapload of stuff :
* < ul >
* < li > Queue up loads for any new influential blocks . < / li >
* < li > Flush any blocks that are no longer influential . < / li >... | // recompute our " area of influence "
computeInfluentialBounds ( ) ; // Log . info ( " Rethinking vb : " + StringUtil . toString ( _ vbounds ) +
// " ul : " + StringUtil . toString ( _ ulpos ) +
// " ibounds : " + StringUtil . toString ( _ ibounds ) ) ;
// not to worry if we presently have no scene model
if ( _model =... |
public class Imports { /** * Pass in a possible Theme . If it is " " or null , it will resolve to default Theme set in Imports
* @ param theTheme
* @ return */
@ Override public String themePath ( String theTheme ) { } } | StringBuilder src = dots ( new StringBuilder ( ) ) ; if ( theTheme == null || theTheme . length ( ) == 0 ) { src . append ( theme ) ; if ( theme . length ( ) > 0 ) src . append ( '/' ) ; } else { src . append ( theTheme ) ; src . append ( '/' ) ; } return src . toString ( ) ; |
public class ThymeleafFactory { /** * Constructs the template resolver bean .
* @ param viewsConfiguration The views configuration
* @ param rendererConfiguration The renderer configuration
* @ return The template resolver */
@ Singleton public AbstractConfigurableTemplateResolver templateResolver ( ViewsConfigur... | ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver ( ) ; templateResolver . setPrefix ( viewsConfiguration . getFolder ( ) ) ; templateResolver . setCharacterEncoding ( rendererConfiguration . getCharacterEncoding ( ) ) ; templateResolver . setTemplateMode ( rendererConfiguration . getTempla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.