signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class V1InstanceGetter { /** * Get links filtered by the criteria specified in the passed in filter .
* @ param filter Limit the items returned . If null , then all items returned .
* @ return Collection of items as specified in the filter . */
public Collection < Link > links ( LinkFilter filter ) { } } | return get ( Link . class , ( filter != null ) ? filter : new LinkFilter ( ) ) ; |
public class StyleCounter { /** * Obtains the most frequent style or styles when multiple of them have the maximal frequency .
* @ return The list of styles with the maximal frequency . */
public List < T > getMostFrequentAll ( ) { } } | List < T > ret = new ArrayList < T > ( ) ; int maxfreq = getMaximalFrequency ( ) ; for ( Map . Entry < T , Integer > entry : styles . entrySet ( ) ) { if ( entry . getValue ( ) == maxfreq ) ret . add ( entry . getKey ( ) ) ; } return ret ; |
public class ExpressRouteConnectionsInner { /** * Deletes a connection to a ExpressRoute circuit .
* @ param resourceGroupName The name of the resource group .
* @ param expressRouteGatewayName The name of the ExpressRoute gateway .
* @ param connectionName The name of the connection subresource .
* @ throws Il... | beginDeleteWithServiceResponseAsync ( resourceGroupName , expressRouteGatewayName , connectionName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class BundlesHandlerFactory { /** * Returns a bundle from its name
* @ param name
* the bundle name
* @ param bundles
* the list of bundle
* @ return a bundle from its name */
private JoinableResourceBundle getBundleFromName ( String name , List < JoinableResourceBundle > bundles ) { } } | JoinableResourceBundle bundle = null ; for ( JoinableResourceBundle aBundle : bundles ) { if ( aBundle . getName ( ) . equals ( name ) ) { bundle = aBundle ; break ; } } return bundle ; |
public class StructuredQueryBuilder { /** * Matches documents that have a value in the specified axis that matches the specified
* periods using the specified operator .
* @ param axes the set of axes of document temporal values used to determine which documents have
* values that match this query
* @ param ope... | if ( axes == null ) throw new IllegalArgumentException ( "axes cannot be null" ) ; if ( operator == null ) throw new IllegalArgumentException ( "operator cannot be null" ) ; if ( periods == null ) throw new IllegalArgumentException ( "periods cannot be null" ) ; return new TemporalPeriodRangeQuery ( axes , operator , p... |
public class AsynchronousRequest { /** * For more info on raids API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / raids " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } methods for... | isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getRaidInfo ( processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ; |
public class ToSolidList { /** * Returns a method that can be used with { @ link solid . stream . Stream # collect ( Func1 ) }
* to convert a stream into a { @ link List } .
* Use this method instead of { @ link # toSolidList ( ) } for better performance on
* streams that can have more than 12 items .
* @ param... | return new Func1 < Iterable < T > , SolidList < T > > ( ) { @ Override public SolidList < T > call ( Iterable < T > iterable ) { ArrayList < T > list = new ArrayList < > ( initialCapacity ) ; for ( T value : iterable ) list . add ( value ) ; return new SolidList < > ( list ) ; } } ; |
public class Framework { /** * Gets the version for a class .
* @ param clazz
* Class for which the version should be determined
* @ return Found version or { @ code null } */
private static String getVersion ( final Class < ? > clazz ) { } } | CodeSource source = clazz . getProtectionDomain ( ) . getCodeSource ( ) ; URL location = source . getLocation ( ) ; try { Path path = Paths . get ( location . toURI ( ) ) ; return Files . isRegularFile ( path ) ? getVersionFromJar ( path ) : getVersionFromPom ( path ) ; } catch ( URISyntaxException ex ) { Logger . erro... |
public class AbstractQueryBuilderFactory { /** * add parser before
* @ param parser
* @ param beforeParser */
public void addRuleParserBefore ( IRuleParser parser , Class < ? extends IRuleParser > beforeParser ) { } } | int index = getIndexOfClass ( ruleParsers , beforeParser ) ; if ( index == - 1 ) { throw new ParserAddException ( "parser " + beforeParser . getSimpleName ( ) + " has not been added" ) ; } ruleParsers . add ( index , parser ) ; |
public class MmtfUtils { /** * Converts the set of experimental techniques to an array of strings .
* @ param experimentalTechniques the input set of experimental techniques
* @ return the array of strings describing the methods used . */
public static String [ ] techniquesToStringArray ( Set < ExperimentalTechniqu... | if ( experimentalTechniques == null ) { return new String [ 0 ] ; } String [ ] outArray = new String [ experimentalTechniques . size ( ) ] ; int index = 0 ; for ( ExperimentalTechnique experimentalTechnique : experimentalTechniques ) { outArray [ index ] = experimentalTechnique . getName ( ) ; index ++ ; } return outAr... |
public class AppMessageHelper { /** * Log an error message .
* @ param key message key for the application manager messages file .
* @ param params message parameters . */
public void error ( String key , Object ... params ) { } } | Tr . error ( tc , key , params ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcStructuralSurfaceAction ( ) { } } | if ( ifcStructuralSurfaceActionEClass == null ) { ifcStructuralSurfaceActionEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 660 ) ; } return ifcStructuralSurfaceActionEClass ; |
public class NetUtils { /** * 解析URL
* @ param url url
* @ return { @ link Map }
* @ since 1.0.8 */
public static Map < String , String > parseUrl ( String url ) { } } | Map < String , String > result = new HashMap < > ( 8 ) ; result . put ( PROTOCOL_KEY , ValueConsts . EMPTY_STRING ) ; result . put ( HOST_KEY , ValueConsts . EMPTY_STRING ) ; result . put ( PATH_KEY , ValueConsts . EMPTY_STRING ) ; if ( Checker . isNotEmpty ( url ) ) { String [ ] pros ; final String protocolSplit = ":/... |
public class SymbolsLineReader { /** * Stops reading at first encountered error , which implies the same
* { @ link org . sonar . ce . task . projectanalysis . source . linereader . LineReader . ReadError } will be returned once an error
* has been encountered and for any then provided { @ link DbFileSources . Line... | if ( readError == null ) { try { processSymbols ( lineBuilder ) ; } catch ( RangeOffsetConverter . RangeOffsetConverterException e ) { readError = new ReadError ( Data . SYMBOLS , lineBuilder . getLine ( ) ) ; LOG . warn ( format ( "Inconsistency detected in Symbols data. Symbols will be ignored for file '%s'" , file .... |
public class VariableNamePattern { /** * Gets a { @ code VariableNamePattern } which matches { @ code plateVariables } in each
* replication of { @ code plateName } . { @ code fixedVariables } are added to each
* match as well .
* @ param plateName
* @ param plateVariables
* @ param fixedVariables
* @ retur... | List < VariableNameMatcher > matchers = Lists . newArrayList ( ) ; for ( String variableName : plateVariables . getVariableNamesArray ( ) ) { matchers . add ( new VariableNameMatcher ( plateName + "/" , "/" + variableName , 0 ) ) ; } return new VariableNamePattern ( matchers , plateVariables , fixedVariables ) ; |
public class RowPriorityResolver { /** * Move rows on top of the row it has priority over . */
private void moveRowsBasedOnPriority ( ) { } } | for ( RowNumber myNumber : overs . keySet ( ) ) { Over over = overs . get ( myNumber ) ; int newIndex = rowOrder . indexOf ( new RowNumber ( over . getOver ( ) ) ) ; rowOrder . remove ( myNumber ) ; rowOrder . add ( newIndex , myNumber ) ; } |
public class HpelSystemStream { /** * Print a character . The character is translated into one or more bytes
* according to the platform ' s default character encoding , and these bytes
* are written in exactly the manner of the < code > { @ link # write ( int ) } < / code >
* method .
* @ param x
* The < cod... | if ( ivSuppress == true ) return ; String writeData = String . valueOf ( x ) ; doPrint ( writeData ) ; |
public class Tap13Representer { /** * Print filler .
* @ param pw Print Writer */
protected void printFiller ( PrintWriter pw ) { } } | if ( this . options . getIndent ( ) > 0 ) { for ( int i = 0 ; i < options . getIndent ( ) ; i ++ ) { pw . append ( ' ' ) ; } } |
public class Utils { /** * Extracts value from map if given value is null .
* @ param value current value
* @ param props properties to extract value from
* @ param key property name to extract
* @ return initial value or value extracted from map */
public static String lookupIfEmpty ( final String value , fina... | return value != null ? value : props . get ( key ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcSolidModel ( ) { } } | if ( ifcSolidModelEClass == null ) { ifcSolidModelEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 609 ) ; } return ifcSolidModelEClass ; |
public class TileSetBundler { /** * Creates a tileset bundle at the location specified by the
* < code > targetPath < / code > parameter , based on the description
* provided via the < code > bundleDesc < / code > parameter .
* @ param idBroker the tileset id broker that will be used to map
* tileset names to t... | // stick an array list on the top of the stack into which we will
// collect parsed tilesets
ArrayList < TileSet > sets = Lists . newArrayList ( ) ; _digester . push ( sets ) ; // parse the tilesets
FileInputStream fin = new FileInputStream ( bundleDesc ) ; try { _digester . parse ( fin ) ; } catch ( SAXException saxe ... |
public class Kerb5Context { /** * { @ inheritDoc }
* @ see jcifs . smb . SSPContext # getFlags ( ) */
@ Override public int getFlags ( ) { } } | int contextFlags = 0 ; if ( this . gssContext . getCredDelegState ( ) ) { contextFlags |= NegTokenInit . DELEGATION ; } if ( this . gssContext . getMutualAuthState ( ) ) { contextFlags |= NegTokenInit . MUTUAL_AUTHENTICATION ; } if ( this . gssContext . getReplayDetState ( ) ) { contextFlags |= NegTokenInit . REPLAY_DE... |
public class ResponseTimeRootCauseServiceMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ResponseTimeRootCauseService responseTimeRootCauseService , ProtocolMarshaller protocolMarshaller ) { } } | if ( responseTimeRootCauseService == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( responseTimeRootCauseService . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( responseTimeRootCauseService . getNames ( ) , NAMES_BINDING ) ... |
public class TzdbZoneRulesProvider { /** * Loads the rules .
* @ param classLoader the class loader to use , not null
* @ return true if updated
* @ throws ZoneRulesException if unable to load */
private boolean load ( ClassLoader classLoader ) { } } | boolean updated = false ; URL url = null ; try { Enumeration < URL > en = classLoader . getResources ( "org/threeten/bp/TZDB.dat" ) ; while ( en . hasMoreElements ( ) ) { url = en . nextElement ( ) ; updated |= load ( url ) ; } } catch ( Exception ex ) { throw new ZoneRulesException ( "Unable to load TZDB time-zone rul... |
public class ActionRequestProcessor { protected ActionResponseReflector createResponseReflector ( ActionRuntime runtime ) { } } | final ActionAdjustmentProvider adjustmentProvider = getAssistantDirector ( ) . assistWebDirection ( ) . assistActionAdjustmentProvider ( ) ; return new ActionResponseReflector ( runtime , getRequestManager ( ) , adjustmentProvider ) ; |
public class FileBatch { /** * Read a FileBatch from the specified file . This method assumes the FileBatch was previously saved to
* zip format using { @ link # writeAsZip ( File ) } or { @ link # writeAsZip ( OutputStream ) }
* @ param file File to read from
* @ return The loaded FileBatch
* @ throws IOExcept... | try ( FileInputStream fis = new FileInputStream ( file ) ) { return readFromZip ( fis ) ; } |
public class RuleHelper { /** * This method gets the name of the supplied fault .
* @ param fault The fault
* @ return The name */
public String faultName ( Object fault ) { } } | FaultDescriptor fd = getFaultDescriptor ( fault ) ; if ( fd != null ) { return fd . getName ( fault ) ; } return fault . getClass ( ) . getSimpleName ( ) ; |
public class PubSubManager { /** * Check if it is possible to create PubSub nodes on this service . It could be possible that the
* PubSub service allows only certain XMPP entities ( clients ) to create nodes and publish items
* to them .
* Note that since XEP - 60 does not provide an API to determine if an XMPP ... | LeafNode leafNode = null ; try { leafNode = createNode ( ) ; } catch ( XMPPErrorException e ) { if ( e . getStanzaError ( ) . getCondition ( ) == StanzaError . Condition . forbidden ) { return false ; } throw e ; } finally { if ( leafNode != null ) { deleteNode ( leafNode . getId ( ) ) ; } } return true ; |
public class Memory { /** * Transfers count bytes from buffer to Memory
* @ param memoryOffset start offset in the memory
* @ param buffer the data buffer */
public void setBytes ( long memoryOffset , ByteBuffer buffer ) { } } | if ( buffer == null ) throw new NullPointerException ( ) ; else if ( buffer . remaining ( ) == 0 ) return ; int bufferOffset = buffer . position ( ) ; checkPosition ( memoryOffset ) ; long end = memoryOffset + buffer . remaining ( ) ; checkPosition ( end - 1 ) ; while ( memoryOffset < end ) { unsafe . putByte ( peer + ... |
public class MultimapJoiner { /** * Appends the string representation of each entry of { @ code map } , using the previously configured separator and
* key - value separator , to { @ code appendable } . */
public < A extends Appendable > A appendTo ( A appendable , Map < ? , ? extends Collection < ? > > map ) throws ... | return appendTo ( appendable , map . entrySet ( ) ) ; |
public class AmazonS3Client { /** * Pre - signs the specified request , using a signature query - string
* parameter .
* @ param request
* The request to sign .
* @ param methodName
* The HTTP method ( GET , PUT , DELETE , HEAD ) for the specified
* request .
* @ param bucketName
* The name of the bucke... | // Run any additional request handlers if present
beforeRequest ( request ) ; String resourcePath = "/" + ( ( bucketName != null ) ? bucketName + "/" : "" ) + ( ( key != null ) ? SdkHttpUtils . urlEncode ( key , true ) : "" ) + ( ( subResource != null ) ? "?" + subResource : "" ) ; // Make sure the resource - path for ... |
public class srecParser { /** * / home / victor / srec / core / src / main / antlr / srec . g : 98:1 : literal : ( NUMBER - > ^ ( LITNUMBER NUMBER ) | BOOLEAN - > ^ ( LITBOOLEAN BOOLEAN ) | STRING - > ^ ( LITSTRING STRING ) | NULL - > LITNIL ) ; */
public final srecParser . literal_return literal ( ) throws Recognition... | srecParser . literal_return retval = new srecParser . literal_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token NUMBER56 = null ; Token BOOLEAN57 = null ; Token STRING58 = null ; Token NULL59 = null ; CommonTree NUMBER56_tree = null ; CommonTree BOOLEAN57_tree = null ; CommonTree STRING5... |
public class ICalComponent { /** * Gets all sub - components of a given class . Changes to the returned list
* will update the parent component object , and vice versa .
* @ param clazz the component class
* @ param < T > the component class
* @ return the sub - components */
public < T extends ICalComponent > ... | return new ICalComponentList < T > ( clazz ) ; |
public class FsJobFileHandler { /** * We write settings to ~ / . fscrawler / { job _ name } / _ status . json
* @ param jobname is the job _ name
* @ param job Status file to write
* @ throws IOException in case of error while reading */
public void write ( String jobname , FsJob job ) throws IOException { } } | writeFile ( jobname , FILENAME , FsJobParser . toJson ( job ) ) ; |
public class EventListenerOrMilestoneActivityBehavior { /** * resume / / / / / */
public void onResume ( CmmnActivityExecution execution ) { } } | ensureTransitionAllowed ( execution , SUSPENDED , AVAILABLE , "resume" ) ; CmmnActivityExecution parent = execution . getParent ( ) ; if ( parent != null ) { if ( ! parent . isActive ( ) ) { String id = execution . getId ( ) ; throw LOG . resumeInactiveCaseException ( "resume" , id ) ; } } resuming ( execution ) ; |
public class SentStructureJsComponent { /** * private void fillFilterAnnotations ( VisualizerInput visInput , int type ) { */
private void fillFilterAnnotations ( VisualizerInput visInput , int type ) { } } | List < String > displayedAnnotations = null ; Map < String , Set < String > > displayedAnnotationsMap = null ; switch ( type ) { case ( 0 ) : { displayedAnnotations = EventExtractor . computeDisplayAnnotations ( visInput , SNode . class ) ; displayedAnnotationsMap = displayedNodeAnnotations ; break ; } case ( 1 ) : { d... |
public class ArrayUtil { /** * Swaps the two specified elements in the specified array . */
private static void swap ( Object [ ] arr , int i , int j ) { } } | Object tmp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = tmp ; |
public class BooleanOperation { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > test against a regular expression < / i > < / div >
* < div color = ' re... | getBooleanOp ( ) . setOperator ( Operator . REGEX ) ; return this . operateOn ( regex ) ; |
public class WampMessageParser { /** * Constructs a String by reading the characters from the Reader
* @ param reader Reader to read from
* @ return String containing the message
* @ throws IOException in case of read failure */
private String convertToString ( Reader reader ) throws IOException { } } | StringBuilder stringBuilder = new StringBuilder ( ) ; int numChars ; char [ ] chars = new char [ 50 ] ; do { numChars = reader . read ( chars , 0 , chars . length ) ; if ( numChars > 0 ) { stringBuilder . append ( chars , 0 , numChars ) ; } } while ( numChars != - 1 ) ; return stringBuilder . toString ( ) ; |
public class Phaser { /** * Possibly blocks and waits for phase to advance unless aborted .
* Call only on root phaser .
* @ param phase current phase
* @ param node if non - null , the wait node to track interrupt and timeout ;
* if null , denotes noninterruptible wait
* @ return current phase */
private int... | // assert root = = this ;
releaseWaiters ( phase - 1 ) ; // ensure old queue clean
boolean queued = false ; // true when node is enqueued
int lastUnarrived = 0 ; // to increase spins upon change
int spins = SPINS_PER_ARRIVAL ; long s ; int p ; while ( ( p = ( int ) ( ( s = state ) >>> PHASE_SHIFT ) ) == phase ) { if ( ... |
public class ElasticSearchFrequentlyRelatedItemSearchProcessor { /** * Creates a query like :
* " size " : 0,
* " timeout " : 5000,
* " query " : {
* " constant _ score " : {
* " filter " : {
* " bool " : {
* " must " : [ {
* " term " : {
* " related - with " : " apparentice you ' re hired "
* " ter... | SearchRequestBuilder sr = searchClient . prepareSearch ( ) ; sr . internalBuilder ( builder . createFrequentlyRelatedContentSearch ( search ) ) ; sr . setIndices ( indexName ) ; return sr ; |
public class ELEvaluator { /** * Gets the parsed form of the given expression string . If the
* parsed form is cached ( and caching is not bypassed ) , return the
* cached form , otherwise parse and cache the value . Returns either
* a String , Expression , or ExpressionString . */
public Object parseExpressionSt... | // See if it ' s an empty String
if ( pExpressionString . length ( ) == 0 ) { return "" ; } if ( ! ( mBypassCache ) && ( sCachedExpressionStrings == null ) ) { createExpressionStringMap ( ) ; } // See if it ' s in the cache
Object ret = mBypassCache ? null : sCachedExpressionStrings . get ( pExpressionString ) ; if ( r... |
public class CmsLocaleManager { /** * Sets the default locale of the Java VM to < code > { @ link Locale # ENGLISH } < / code > if the
* current default has any other language then English set . < p >
* This is required because otherwise the default ( English ) resource bundles
* would not be displayed for the En... | // set the default locale to english
// this is required because otherwise the default ( english ) resource bundles
// would not be displayed for the english locale if a translated locale exists
Locale oldLocale = Locale . getDefault ( ) ; if ( ! ( Locale . ENGLISH . getLanguage ( ) . equals ( oldLocale . getLanguage (... |
public class OAuthProviderProcessingFilter { /** * Whether to skip processing for the specified request .
* @ param request The request .
* @ return Whether to skip processing . */
protected boolean skipProcessing ( HttpServletRequest request ) { } } | return ( ( request . getAttribute ( OAUTH_PROCESSING_HANDLED ) != null ) && ( Boolean . TRUE . equals ( request . getAttribute ( OAUTH_PROCESSING_HANDLED ) ) ) ) ; |
public class DefaultEntityHandler { /** * 文字列型かどうかを判定する
* @ param type JDBC上の型
* @ return 文字列型の場合 < code > true < / code > */
private boolean isStringType ( final JDBCType type ) { } } | return JDBCType . CHAR . equals ( type ) || JDBCType . NCHAR . equals ( type ) || JDBCType . VARCHAR . equals ( type ) || JDBCType . NVARCHAR . equals ( type ) || JDBCType . LONGNVARCHAR . equals ( type ) ; |
public class NetworkAcl { /** * One or more entries ( rules ) in the network ACL .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setEntries ( java . util . Collection ) } or { @ link # withEntries ( java . util . Collection ) } if you want to override
* t... | if ( this . entries == null ) { setEntries ( new com . amazonaws . internal . SdkInternalList < NetworkAclEntry > ( entries . length ) ) ; } for ( NetworkAclEntry ele : entries ) { this . entries . add ( ele ) ; } return this ; |
public class StatisticsInner { /** * Retrieve the statistics for the account .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param filter The filter to apply on the operation .
* @ param serviceCallback the async ServiceCal... | return ServiceFuture . fromResponse ( listByAutomationAccountWithServiceResponseAsync ( resourceGroupName , automationAccountName , filter ) , serviceCallback ) ; |
public class PropertiesConfigHelper { /** * Returns the map of variantSet for the bundle
* @ param bundleName
* the bundle name
* @ return the map of variantSet for the bundle */
public Map < String , VariantSet > getCustomBundleVariantSets ( String bundleName ) { } } | Map < String , VariantSet > variantSets = new HashMap < > ( ) ; StringTokenizer tk = new StringTokenizer ( getCustomBundleProperty ( bundleName , PropertiesBundleConstant . BUNDLE_FACTORY_CUSTOM_VARIANTS , "" ) , ";" ) ; while ( tk . hasMoreTokens ( ) ) { String [ ] mapEntry = tk . nextToken ( ) . trim ( ) . split ( ":... |
public class AiMesh { /** * Returns the y - coordinate of a vertex bitangent .
* @ param vertex the vertex index
* @ return the y coordinate */
public float getTangentY ( int vertex ) { } } | if ( ! hasTangentsAndBitangents ( ) ) { throw new IllegalStateException ( "mesh has no bitangents" ) ; } checkVertexIndexBounds ( vertex ) ; return m_tangents . getFloat ( ( vertex * 3 + 1 ) * SIZEOF_FLOAT ) ; |
public class IoServiceListenerSupport { /** * Calls { @ link IoServiceListener # sessionDestroyed ( IoSession ) } for all registered listeners . */
public void fireSessionDestroyed ( IoSession session ) { } } | // Try to remove the remaining empty session set after removal .
if ( managedSessions . remove ( session . getId ( ) ) == null ) { return ; } // Fire session events .
session . getFilterChain ( ) . fireSessionClosed ( ) ; // Fire listener events .
try { for ( IoServiceListener l : listeners ) { try { l . sessionDestroy... |
public class ntp_sync { /** * < pre >
* Use this operation to get status of ntpd .
* < / pre > */
public static ntp_sync [ ] get ( nitro_service client ) throws Exception { } } | ntp_sync resource = new ntp_sync ( ) ; resource . validate ( "get" ) ; return ( ntp_sync [ ] ) resource . get_resources ( client ) ; |
public class CPOptionValuePersistenceImpl { /** * Removes the cp option value where companyId = & # 63 ; and externalReferenceCode = & # 63 ; from the database .
* @ param companyId the company ID
* @ param externalReferenceCode the external reference code
* @ return the cp option value that was removed */
@ Over... | CPOptionValue cpOptionValue = findByC_ERC ( companyId , externalReferenceCode ) ; return remove ( cpOptionValue ) ; |
public class ModuleItemInfoImpl { /** * Use to register overriding modules . Such complex approach was used because overriding modules
* is the only item that require additional parameter during registration . This parameter may be used
* in disable predicate to differentiate overriding modules from normal modules ... | override . set ( true ) ; try { action . run ( ) ; } finally { override . remove ( ) ; } |
public class LockFile { /** * Retrieves a < tt > LockFile < / tt > instance , initialized with a < tt > File < / tt >
* object whose path is the canonical form of the one specified by the
* given < tt > path < / tt > argument . < p >
* The resulting < tt > LockFile < / tt > instance does not yet hold a lock
* c... | LockFile lockFile = newNIOLockFile ( ) ; if ( lockFile == null ) { lockFile = new LockFile ( ) ; } lockFile . setPath ( path ) ; return lockFile ; |
public class UBL21DocumentTypes { /** * Get the domain object class of the passed namespace .
* @ param sNamespace
* The namespace URI of any UBL 2.1 document type . May be
* < code > null < / code > .
* @ return < code > null < / code > if no such UBL 2.1 document type exists . */
@ Nullable public static Clas... | final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace ( sNamespace ) ; return eDocType == null ? null : eDocType . getImplementationClass ( ) ; |
public class AbstractJsonDeserializer { /** * Convenience method for subclasses .
* @ param paramName the name of the parameter
* @ param errorMessage the errormessage to add to the exception if the param does not exist .
* @ return a stringparameter with given name . If it does not exist and the errormessage is ... | return getIntParam ( paramName , errorMessage , ( Map < String , Object > ) inputParams . get ( ) ) ; |
public class SliceOps { /** * Calculates the sliced size given the current size , number of elements
* skip , and the number of elements to limit .
* @ param size the current size
* @ param skip the number of elements to skip , assumed to be > = 0
* @ param limit the number of elements to limit , assumed to be ... | return size >= 0 ? Math . max ( - 1 , Math . min ( size - skip , limit ) ) : - 1 ; |
public class ParallelClient { /** * Initialize . create the httpClientStore , tcpClientStore */
public void initialize ( ) { } } | if ( isClosed . get ( ) ) { logger . info ( "Initialing Parallel Client Resources: actor system, HttpClientStore, Task Manager ...." ) ; ActorConfig . createAndGetActorSystem ( ) ; httpClientStore . init ( ) ; tcpSshPingResourceStore . init ( ) ; isClosed . set ( false ) ; logger . info ( "Parallel Client Resources has... |
public class ConnectionResource { /** * Prepare statement .
* @ param _ sql the sql
* @ param _ strings the strings
* @ return the prepared statement
* @ throws SQLException the SQL exception */
public PreparedStatement prepareStatement ( final String _sql , final String [ ] _strings ) throws SQLException { } } | return getConnection ( ) . prepareStatement ( _sql , _strings ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */
@ XmlElementDecl... | return new JAXBElement < Object > ( __GenericApplicationPropertyOfIntBridgeInstallation_QNAME , Object . class , null , value ) ; |
public class JsDocInfoParser { /** * Parses a { @ link JSDocInfo } object . This parsing method reads all tokens returned by the { @ link
* JsDocTokenStream # getJsDocToken ( ) } method until the { @ link JsDocToken # EOC } is returned .
* @ return { @ code true } if JSDoc information was correctly parsed , { @ cod... | state = State . SEARCHING_ANNOTATION ; skipEOLs ( ) ; JsDocToken token = next ( ) ; // Always record that we have a comment .
if ( jsdocBuilder . shouldParseDocumentation ( ) ) { ExtractionInfo blockInfo = extractBlockComment ( token ) ; token = blockInfo . token ; if ( ! blockInfo . string . isEmpty ( ) ) { jsdocBuild... |
public class AutoMlClient { /** * Creates a model . Returns a Model in the [ response ] [ google . longrunning . Operation . response ] field
* when it completes . When you create a model , several model evaluations are created for it : a
* global evaluation , and one evaluation for each annotation spec .
* < p >... | return createModelOperationCallable ( ) . futureCall ( request ) ; |
public class ChannelAction { /** * Sets the slowmode value , which limits the amount of time that individual users must wait
* between sending messages in the new TextChannel . This is measured in seconds .
* < p > Note that only { @ link net . dv8tion . jda . core . AccountType # CLIENT CLIENT } type accounts are ... | Checks . check ( slowmode <= 120 && slowmode >= 0 , "Slowmode must be between 0 and 120 (seconds)!" ) ; this . slowmode = slowmode ; return this ; |
public class ChromeCustomTabs { /** * Adds the required extras and flags to an { @ link Intent } for using Chrome Custom Tabs . If
* Chrome Custom Tabs are not available or supported no change will be made to the { @ link Intent } .
* @ param context
* @ param intent The { @ link Intent } to add the extras and fl... | if ( SDK_INT >= JELLY_BEAN_MR2 && ChromeCustomTabs . isAvailable ( context ) ) { Bundle extras = new Bundle ( ) ; extras . putBinder ( "android.support.customtabs.extra.SESSION" , null ) ; intent . putExtras ( extras ) ; intent . addFlags ( Intent . FLAG_ACTIVITY_MULTIPLE_TASK | Intent . FLAG_ACTIVITY_CLEAR_TASK ) ; } ... |
public class Exchanger { /** * Exchange function when arenas enabled . See above for explanation .
* @ param item the ( non - null ) item to exchange
* @ param timed true if the wait is timed
* @ param ns if timed , the maximum wait time , else 0L
* @ return the other thread ' s item ; or null if interrupted ; ... | Node [ ] a = arena ; Node p = participant . get ( ) ; for ( int i = p . index ; ; ) { // access slot at i
int b , m , c ; long j ; // j is raw array offset
Node q = ( Node ) U . getObjectVolatile ( a , j = ( i << ASHIFT ) + ABASE ) ; if ( q != null && U . compareAndSwapObject ( a , j , q , null ) ) { Object v = q . ite... |
public class NumberType { /** * Converts a value to this type */
public Object convertToDefaultType ( SessionInterface session , Object a ) { } } | if ( a == null ) { return a ; } Type otherType ; if ( a instanceof Number ) { if ( a instanceof BigInteger ) { a = new BigDecimal ( ( BigInteger ) a ) ; } else if ( a instanceof Float ) { a = new Double ( ( ( Float ) a ) . doubleValue ( ) ) ; } else if ( a instanceof Byte ) { a = ValuePool . getInt ( ( ( Byte ) a ) . i... |
public class CmsRenameView { /** * Changes the state of the widget . < p >
* @ param state the state to change to */
void changeState ( State state ) { } } | m_state = state ; switch ( state ) { case validationRunning : m_cancelButton . setEnabled ( false ) ; m_okButton . setEnabled ( false ) ; clearValidationError ( ) ; break ; case validationFailed : m_okButton . setEnabled ( false ) ; m_cancelButton . setEnabled ( true ) ; break ; case validationUnknown : default : m_can... |
public class Named { public void copy ( Copier aFrom ) { } } | if ( aFrom == null ) return ; Nameable from = ( Nameable ) aFrom ; this . name = from . getName ( ) ; |
public class Polarizability { /** * Gets the numberOfHydrogen attribute of the Polarizability object .
* @ param atomContainer Description of the Parameter
* @ param atom Description of the Parameter
* @ return The numberOfHydrogen value */
private int getNumberOfHydrogen ( IAtomContainer atomContainer , IAtom at... | java . util . List < IBond > bonds = atomContainer . getConnectedBondsList ( atom ) ; IAtom connectedAtom ; int hCounter = 0 ; for ( IBond bond : bonds ) { connectedAtom = bond . getOther ( atom ) ; if ( connectedAtom . getSymbol ( ) . equals ( "H" ) ) { hCounter += 1 ; } } return hCounter ; |
public class SDVertexParams { /** * Define the inputs to the DL4J SameDiff Vertex with specific names
* @ param inputNames Names of the inputs . Number here also defines the number of vertex inputs
* @ see # defineInputs ( int ) */
public void defineInputs ( String ... inputNames ) { } } | Preconditions . checkArgument ( inputNames != null && inputNames . length > 0 , "Input names must not be null, and must have length > 0: got %s" , inputNames ) ; this . inputs = Arrays . asList ( inputNames ) ; |
public class JKNumbersUtil { /** * Adds the amounts .
* @ param num1 the num 1
* @ param num2 the num 2
* @ return the double */
public static double addAmounts ( final double num1 , final double num2 ) { } } | final BigDecimal b1 = new BigDecimal ( num1 ) ; final BigDecimal b2 = new BigDecimal ( num2 ) ; BigDecimal b3 = b1 . add ( b2 ) ; b3 = b3 . setScale ( 3 , BigDecimal . ROUND_HALF_UP ) ; final double result = b3 . doubleValue ( ) ; return result ; |
public class DiscussionCommentResourcesImpl { /** * Add a comment to a discussion .
* It mirrors to the following Smartsheet REST API method : POST / discussion / { discussionId } / comments < / p >
* @ param sheetId the sheet id
* @ param discussionId the discussion id
* @ param comment the comment to add
* ... | return this . createResource ( "sheets/" + sheetId + "/discussions/" + discussionId + "/comments" , Comment . class , comment ) ; |
public class YamlLoader { /** * Loads a YAML document from an { @ link InputStream } and builds a
* { @ link YamlNode } tree that is under the provided top - level
* { @ code rootName } key . This loading mode requires the topmost level
* of the YAML document to be a mapping .
* @ param inputStream The input st... | try { Object document = getLoad ( ) . loadFromInputStream ( inputStream ) ; return buildDom ( rootName , document ) ; } catch ( Exception ex ) { throw new YamlException ( "An error occurred while loading and parsing the YAML stream" , ex ) ; } |
public class Branch { /** * < p > Initialises a session with the Branch API , passing the { @ link Activity } and assigning a
* { @ link BranchReferralInitListener } to perform an action upon successful initialisation . < / p >
* @ param callback A { @ link BranchReferralInitListener } instance that will be called ... | if ( customReferrableSettings_ == CUSTOM_REFERRABLE_SETTINGS . USE_DEFAULT ) { initUserSessionInternal ( callback , activity , true ) ; } else { boolean isReferrable = customReferrableSettings_ == CUSTOM_REFERRABLE_SETTINGS . REFERRABLE ; initUserSessionInternal ( callback , activity , isReferrable ) ; } return true ; |
public class NewWordDiscover { /** * 提取词语
* @ param doc 大文本
* @ param size 需要提取词语的数量
* @ return 一个词语列表 */
public List < WordInfo > discover ( String doc , int size ) { } } | try { return discover ( new BufferedReader ( new StringReader ( doc ) ) , size ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } |
public class JaroDistanceTextSimilarity { /** * 计算两段文本为了保持相等需要的换位次数
* @ param text1 文本1
* @ param text2 文本2
* @ return 换位次数 */
private int transpositions ( String text1 , String text2 ) { } } | int transpositions = 0 ; for ( int i = 0 ; i < text1 . length ( ) ; i ++ ) { if ( text1 . charAt ( i ) != text2 . charAt ( i ) ) { transpositions ++ ; } } return transpositions ; |
public class ContainerInstance { /** * Adds a new health check , with the default interval ( 60 seconds ) and timeout ( 0 milliseconds ) .
* @ param name the name of the health check
* @ param url the URL of the health check
* @ return a HttpHealthCheck instance representing the health check that has been added
... | return addHealthCheck ( name , url , DEFAULT_HEALTH_CHECK_INTERVAL_IN_SECONDS , DEFAULT_HEALTH_CHECK_TIMEOUT_IN_MILLISECONDS ) ; |
public class JKConversionUtil { /** * To integer .
* @ param value the value
* @ param defaultValue the default value
* @ return the int */
public static int toInteger ( Object value , int defaultValue ) { } } | if ( value == null || value . toString ( ) . trim ( ) . equals ( "" ) ) { return defaultValue ; } if ( value instanceof Integer ) { return ( Integer ) value ; } return ( int ) JKConversionUtil . toDouble ( value ) ; |
public class TheMovieDbApi { /** * This method is used to retrieve all of the basic information about a
* movie collection .
* You can get the ID needed for this method by making a getMovieInfo
* request for the belongs _ to _ collection .
* @ param collectionId collectionId
* @ param language language
* @ ... | return tmdbCollections . getCollectionInfo ( collectionId , language ) ; |
public class BlueprintBeanProxyTargetLocator { /** * { @ inheritDoc } */
@ Override protected BeanReactor < BlueprintContainer > createStrategy ( ) { } } | if ( getBeanName ( ) . isEmpty ( ) ) { throw new IllegalStateException ( "Blueprint requires annotation name" ) ; } if ( overwrites == null || overwrites . size ( ) == 0 || ! overwrites . containsKey ( getBeanName ( ) ) ) { return new BlueprintBeanReactor ( getBeanName ( ) ) ; } return new BlueprintBeanReactor ( overwr... |
public class HttpFields { /** * Get multi headers
* @ return Enumeration of the values , or null if no such header .
* @ param name the case - insensitive field name */
public Enumeration getValues ( String name ) { } } | FieldInfo info = getFieldInfo ( name ) ; final Field field = getField ( info , true ) ; if ( field != null ) { return new Enumeration ( ) { Field f = field ; public boolean hasMoreElements ( ) { while ( f != null && f . _version != _version ) f = f . _next ; return f != null ; } public Object nextElement ( ) throws NoS... |
public class ClassWriter { /** * Write code attribute of method . */
void writeCode ( Code code ) { } } | databuf . appendChar ( code . max_stack ) ; databuf . appendChar ( code . max_locals ) ; databuf . appendInt ( code . cp ) ; databuf . appendBytes ( code . code , 0 , code . cp ) ; databuf . appendChar ( code . catchInfo . length ( ) ) ; for ( List < char [ ] > l = code . catchInfo . toList ( ) ; l . nonEmpty ( ) ; l =... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcCraneRailFShapeProfileDef ( ) { } } | if ( ifcCraneRailFShapeProfileDefEClass == null ) { ifcCraneRailFShapeProfileDefEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 128 ) ; } return ifcCraneRailFShapeProfileDefEClass ; |
public class SegmentGroup { /** * List of dimensions to include or exclude .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDimensions ( java . util . Collection ) } or { @ link # withDimensions ( java . util . Collection ) } if you want to
* override t... | if ( this . dimensions == null ) { setDimensions ( new java . util . ArrayList < SegmentDimensions > ( dimensions . length ) ) ; } for ( SegmentDimensions ele : dimensions ) { this . dimensions . add ( ele ) ; } return this ; |
public class PlaceRecognition { /** * 维特比算法求解最优标签
* @ param roleTagList
* @ return */
public static List < NS > viterbiCompute ( List < EnumItem < NS > > roleTagList ) { } } | return Viterbi . computeEnum ( roleTagList , PlaceDictionary . transformMatrixDictionary ) ; |
public class Pyramid { /** * 该塔中一共有几个8度空间 */
public int buildOctaves ( ImagePixelArray source , float scale , int levelsPerOctave , float octaveSigm , int minSize ) { } } | this . octaves = new ArrayList < OctaveSpace > ( ) ; OctaveSpace downSpace = null ; ImagePixelArray prev = source ; while ( prev != null && prev . width >= minSize && prev . height >= minSize ) { OctaveSpace osp = new OctaveSpace ( ) ; // Create both the gaussian filtered images and the DOG maps
osp . makeGaussianImgs ... |
public class UcumEssenceService { /** * / * ( non - Javadoc )
* @ see org . eclipse . ohf . ucum . UcumServiceEx # getProperties ( ) */
@ Override public Set < String > getProperties ( ) { } } | Set < String > result = new HashSet < String > ( ) ; for ( DefinedUnit unit : model . getDefinedUnits ( ) ) { result . add ( unit . getProperty ( ) ) ; } return result ; |
public class AutoCompleteTextFieldComponent { /** * Shows the validation success icon in the textfield
* @ param text
* the text to store in the UI state object */
public void showValidationSuccesIcon ( final String text ) { } } | validationIcon . setValue ( FontAwesome . CHECK_CIRCLE . getHtml ( ) ) ; validationIcon . setStyleName ( SPUIStyleDefinitions . SUCCESS_ICON ) ; filterManagementUIState . setFilterQueryValue ( text ) ; filterManagementUIState . setIsFilterByInvalidFilterQuery ( Boolean . FALSE ) ; |
public class Vector2d { /** * / * ( non - Javadoc )
* @ see org . joml . Vector2dc # add ( org . joml . Vector2fc , org . joml . Vector2d ) */
public Vector2d add ( Vector2fc v , Vector2d dest ) { } } | dest . x = x + v . x ( ) ; dest . y = y + v . y ( ) ; return dest ; |
public class ThriftService { /** * Choose the next Cassandra host name in the list or a random one . */
private String chooseHost ( String [ ] dbHosts ) { } } | String host = null ; synchronized ( m_lastHostLock ) { if ( dbHosts . length == 1 ) { host = dbHosts [ 0 ] ; } else if ( ! Utils . isEmpty ( m_lastHost ) ) { for ( int index = 0 ; host == null && index < dbHosts . length ; index ++ ) { if ( dbHosts [ index ] . equals ( m_lastHost ) ) { host = dbHosts [ ( ++ index ) % d... |
public class AmBaseSpout { /** * Not use this class ' s key history function , and not use MessageId ( Id identify by storm ) . < br >
* Send message to downstream component with grouping key . < br >
* Use following situation .
* < ol >
* < li > Not use this class ' s key history function . < / li >
* < li >... | this . getCollector ( ) . emit ( new Values ( groupingKey , message ) ) ; |
public class DataRetrievalPolicy { /** * The policy rule . Although this is a list type , currently there must be only one rule , which contains a Strategy
* field and optionally a BytesPerHour field .
* @ param rules
* The policy rule . Although this is a list type , currently there must be only one rule , which... | if ( rules == null ) { this . rules = null ; return ; } this . rules = new java . util . ArrayList < DataRetrievalRule > ( rules ) ; |
public class PortalPropertyEditorRegistrar { /** * / * ( non - Javadoc )
* @ see org . springframework . beans . PropertyEditorRegistrar # registerCustomEditors ( org . springframework . beans . PropertyEditorRegistry ) */
@ Override public void registerCustomEditors ( PropertyEditorRegistry registry ) { } } | if ( this . propertyEditors == null ) { this . logger . warn ( "No PropertyEditors Map configured, returning with no action taken." ) ; return ; } for ( final Map . Entry < Class < ? > , PropertyEditor > editorEntry : this . propertyEditors . entrySet ( ) ) { final Class < ? > requiredType = editorEntry . getKey ( ) ; ... |
public class ControllerRegistry { /** * Register all controller methods in the specified packages .
* @ param packages */
public void register ( Package ... packages ) { } } | List < String > packageNames = Arrays . stream ( packages ) . map ( Package :: getName ) . collect ( Collectors . toList ( ) ) ; register ( packageNames . toArray ( new String [ packageNames . size ( ) ] ) ) ; |
public class LineDataImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . LINE_DATA__LINEDATA : setLinedata ( LINEDATA_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class ComputeNodeDeleteUserOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly .
* @ param ocpDate the ocpDate value to set
* @ return the ComputeNodeDeleteUserOptions object it... | if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ; |
public class syslog_aaa { /** * < pre >
* Use this operation to delete aaa syslog message details . .
* < / pre > */
public static syslog_aaa delete ( nitro_service client , syslog_aaa resource ) throws Exception { } } | resource . validate ( "delete" ) ; return ( ( syslog_aaa [ ] ) resource . delete_resource ( client ) ) [ 0 ] ; |
public class PdfMBeansReport { /** * Affiche l ' arbre des MBeans .
* @ throws DocumentException e */
void writeTree ( ) throws DocumentException { } } | // MBeans pour la plateforme
margin = 0 ; final MBeanNode platformNode = mbeans . get ( 0 ) ; writeTree ( platformNode . getChildren ( ) ) ; for ( final MBeanNode node : mbeans ) { if ( node != platformNode ) { newPage ( ) ; addToDocument ( new Chunk ( node . getName ( ) , boldFont ) ) ; margin = 0 ; writeTree ( node .... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcTShapeProfileDef ( ) { } } | if ( ifcTShapeProfileDefEClass == null ) { ifcTShapeProfileDefEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 694 ) ; } return ifcTShapeProfileDefEClass ; |
public class PluginRegistry { /** * Returns all the plugins for a given repository that are instances
* of a certain class .
* @ param pluginClass the class the plugin must implement to be selected .
* @ return List list of plugins from the repository . */
public List getPlugins ( final Class pluginClass ) { } } | synchronized ( pluginMap ) { List pluginList = new ArrayList ( pluginMap . size ( ) ) ; Iterator iter = pluginMap . values ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Object plugin = iter . next ( ) ; if ( pluginClass . isInstance ( plugin ) ) { pluginList . add ( plugin ) ; } } return pluginList ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.