signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TinyPlugzConfigurator { /** * Sets up a { @ link TinyPlugz } instance which uses the Classloader which * loaded the { @ link TinyPlugzConfigurator } class as parent Classloader . * This Classloader will be used for several purposes . First , it serves as * parent Classloader for the plugin Classloade...
final ClassLoader cl = Require . nonNull ( TinyPlugzConfigurator . class . getClassLoader ( ) ) ; return new Impl ( cl ) ;
public class FastStreamingKMeans { /** * Clusters the rows of the provided matrix into the specified number of * clusters in a single pass using the parameters to guide how clusters are * formed . Note that due to the streaming nature of the algorithm , fewer * than { @ code numClusters } may be returned . * @ ...
int rows = matrix . rows ( ) ; int cols = matrix . columns ( ) ; // f is the facility cost ; double f = 1d / ( numClusters * ( 1 + Math . log ( rows ) ) ) ; // This list contains at most kappa facilities . List < CandidateCluster > facilities = new ArrayList < CandidateCluster > ( kappa ) ; for ( int r = 0 ; r < rows ;...
public class ThrottledApiHandler { /** * Retrieve a specific item * This method does not count towards the rate limit and is not affected by the throttle * @ param id The id of the item * @ param data Additional information to retrieve * @ return The item * @ see < a href = https : / / developer . riotgames ....
return new DummyFuture < > ( handler . getItem ( id , data ) ) ;
public class CreateTableUtil { /** * 检查表结构是否已存在 . * @ return */ protected static boolean checkTableExist ( Jdbc jdbc , String tableName ) { } }
String sql = "select 1 from " + tableName + " limit 1;" ; try { jdbc . queryForInt ( sql ) ; return true ; } catch ( BadSqlGrammarException e ) { return false ; }
public class GeoJsonToAssembler { /** * Converts a multipoint to its corresponding Transfer Object * @ param input the multipoint * @ return a transfer object for the multipoint */ public MultiPointTo toTransferObject ( MultiPoint input ) { } }
MultiPointTo result = new MultiPointTo ( ) ; result . setCrs ( GeoJsonTo . createCrsTo ( "EPSG:" + input . getSRID ( ) ) ) ; result . setCoordinates ( getPoints ( input ) ) ; return result ;
public class WSkipLinksExample { /** * Creates a panel for the example . * @ param title the panel title . * @ param accessKey the panel access key * @ return a panel for use in the example . */ private WPanel buildPanel ( final String title , final char accessKey ) { } }
WPanel panel = buildPanel ( title ) ; panel . setAccessKey ( accessKey ) ; return panel ;
public class RESTRegistryService { /** * Returns the corresponding registry entry which wraps a node of type " exo : registryEntry " * @ param entryPath The relative path to the registry entry * @ response * { code } * " entryStream " : the output stream corresponding registry entry which wraps a node of type "...
SessionProvider sessionProvider = sessionProviderService . getSessionProvider ( null ) ; try { RegistryEntry entry ; entry = regService . getEntry ( sessionProvider , normalizePath ( entryPath ) ) ; return Response . ok ( new DOMSource ( entry . getDocument ( ) ) ) . build ( ) ; } catch ( PathNotFoundException e ) { re...
public class AS2ClientBuilder { /** * Set the key store file and password for the AS2 client . The key store must * be an existing file of type PKCS12 containing at least the key alias of the * sender ( see { @ link # setSenderAS2ID ( String ) } ) . The key store file must be * writable as dynamically certificate...
return setKeyStore ( EKeyStoreType . PKCS12 , aKeyStoreFile , sKeyStorePassword ) ;
public class Calendar { /** * Compute the Gregorian calendar year , month , and day of month from * the given Julian day . These values are not stored in fields , but in * member variables gregorianXxx . Also compute the DAY _ OF _ WEEK and * DOW _ LOCAL fields . */ private final void computeGregorianAndDOWFields...
computeGregorianFields ( julianDay ) ; // Compute day of week : JD 0 = Monday int dow = fields [ DAY_OF_WEEK ] = julianDayToDayOfWeek ( julianDay ) ; // Calculate 1 - based localized day of week int dowLocal = dow - getFirstDayOfWeek ( ) + 1 ; if ( dowLocal < 1 ) { dowLocal += 7 ; } fields [ DOW_LOCAL ] = dowLocal ;
public class MustacheResolver { /** * Scans given template for mustache keys ( syntax { { value } } ) . * @ return empty list if no mustache key is found . */ public static List < String > getMustacheKeys ( final String template ) { } }
final Set < String > keys = new HashSet < > ( ) ; if ( StringUtils . isNotEmpty ( template ) ) { final Matcher matcher = MUSTACHE_PATTERN . matcher ( template ) ; while ( matcher . find ( ) ) { keys . add ( matcher . group ( 1 ) ) ; } } return new ArrayList < > ( keys ) ;
public class DescribeTapesResult { /** * An array of virtual tape descriptions . * @ return An array of virtual tape descriptions . */ public java . util . List < Tape > getTapes ( ) { } }
if ( tapes == null ) { tapes = new com . amazonaws . internal . SdkInternalList < Tape > ( ) ; } return tapes ;
public class PhasedBackoffWaitStrategy { /** * Construct { @ link PhasedBackoffWaitStrategy } with fallback to { @ link BlockingWaitStrategy } * @ param spinTimeout The maximum time in to busy spin for . * @ param yieldTimeout The maximum time in to yield for . * @ param units Time units used for the timeout valu...
return new PhasedBackoffWaitStrategy ( spinTimeout , yieldTimeout , units , new BlockingWaitStrategy ( ) ) ;
public class WebDriverHelper { /** * Authenticates the user using the given username and password . This will * work only if the credentials are requested through an alert window . * @ param username * the user name * @ param password * the password */ public void authenticateOnNextAlert ( String username , S...
Credentials credentials = new UserAndPassword ( username , password ) ; Alert alert = driver . switchTo ( ) . alert ( ) ; alert . authenticateUsing ( credentials ) ;
public class TrimmedEstimator { /** * Local copy , see ArrayLikeUtil . toPrimitiveDoubleArray . * @ param data Data * @ param adapter Adapter * @ return Copy of the data , as { @ code double [ ] } */ public static < A > double [ ] toPrimitiveDoubleArray ( A data , NumberArrayAdapter < ? , A > adapter ) { } }
if ( adapter == DoubleArrayAdapter . STATIC ) { return ( ( double [ ] ) data ) . clone ( ) ; } final int len = adapter . size ( data ) ; double [ ] x = new double [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { x [ i ] = adapter . getDouble ( data , i ) ; } return x ;
public class RequestParameterBuilder { /** * Encodes given value with a proper encoding . This is a convenient method for primitive , plain data types . Value will not be converted to JSON . Note : Value * can be null . * @ param value value to be encoded * @ return String encoded value * @ throws UnsupportedEn...
if ( value == null ) { return null ; } return URLEncoder . encode ( value . toString ( ) , encoding ) ;
public class ClassGraphException { /** * Static factory method to stop IDEs from auto - completing ClassGraphException after " new ClassGraph " . * @ param message * the message * @ param cause * the cause * @ return the ClassGraphException * @ throws ClassGraphException * the class graph exception */ pub...
return new ClassGraphException ( message , cause ) ;
public class InstanceFactory { /** * 这是一个阻塞方法 , 直到context初始化完成 */ public synchronized static void waitUtilInitialized ( ) { } }
if ( initialized . get ( ) ) return ; while ( true ) { if ( initialized . get ( ) ) break ; try { Thread . sleep ( 1000 ) ; } catch ( Exception e ) { } long waiting = System . currentTimeMillis ( ) - timeStarting ; if ( waiting > 60 * 1000 ) throw new RuntimeException ( "Spring Initialize failture" ) ; System . out . p...
public class ActiveMqQueue { /** * Get the { @ link Session } dedicated for consuming messages . * @ return * @ throws JMSException */ protected Session getConsumerSession ( ) throws JMSException { } }
if ( consumerSession == null ) { synchronized ( this ) { if ( consumerSession == null ) { consumerSession = createSession ( Session . AUTO_ACKNOWLEDGE ) ; } } } return consumerSession ;
public class RESTService { /** * Register a set of application REST commands as belonging to the given storage * service owner . The commands are defined via a set of { @ link RESTCallback } objects , * which must use the { @ link Description } annotation to provide metadata about the * commands . * @ param cal...
m_cmdRegistry . registerCallbacks ( service , cmdClasses ) ;
public class RIMBeanServerRegistrationUtility { /** * Checks whether an ObjectName is already registered . * @ throws javax . cache . CacheException - all exceptions are wrapped in * CacheException */ static < K , V > boolean isRegistered ( AbstractJCache < K , V > cache , ObjectNameType objectNameType ) { } }
Set < ObjectName > registeredObjectNames ; MBeanServer mBeanServer = cache . getMBeanServer ( ) ; if ( mBeanServer != null ) { ObjectName objectName = calculateObjectName ( cache , objectNameType ) ; registeredObjectNames = SecurityActions . queryNames ( objectName , null , mBeanServer ) ; return ! registeredObjectName...
public class NumberColumn { /** * { @ inheritDoc } */ @ Override protected void dumpData ( PrintWriter pw ) { } }
pw . println ( " [Data" ) ; for ( Object item : m_data ) { pw . println ( " " + item ) ; } pw . println ( " ]" ) ;
public class LabelingJobStoppingConditionsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LabelingJobStoppingConditions labelingJobStoppingConditions , ProtocolMarshaller protocolMarshaller ) { } }
if ( labelingJobStoppingConditions == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( labelingJobStoppingConditions . getMaxHumanLabeledObjectCount ( ) , MAXHUMANLABELEDOBJECTCOUNT_BINDING ) ; protocolMarshaller . marshall ( labelingJobStopp...
public class DiSH { /** * Builds the cluster hierarchy . * @ param clustering Clustering we process * @ param clusters the sorted list of clusters * @ param dimensionality the dimensionality of the data * @ param database the database containing the data objects */ private void buildHierarchy ( Relation < V > d...
StringBuilder msg = LOG . isDebugging ( ) ? new StringBuilder ( ) : null ; final int db_dim = RelationUtil . dimensionality ( database ) ; Hierarchy < Cluster < SubspaceModel > > hier = clustering . getClusterHierarchy ( ) ; for ( int i = 0 ; i < clusters . size ( ) - 1 ; i ++ ) { Cluster < SubspaceModel > c_i = cluste...
public class DataVecSparkUtil { /** * This is a convenience method to combine data from separate files together ( intended to write to a sequence file , using * { @ link org . apache . spark . api . java . JavaPairRDD # saveAsNewAPIHadoopFile ( String , Class , Class , Class ) } ) < br > * A typical use case is to ...
JavaPairRDD < String , PortableDataStream > first = sc . binaryFiles ( path1 ) ; JavaPairRDD < String , PortableDataStream > second = sc . binaryFiles ( path2 ) ; // Now : process keys ( paths ) so that they can be merged JavaPairRDD < String , Tuple3 < String , Integer , PortableDataStream > > first2 = first . mapToPa...
public class ConversionManager { /** * Convert a String to a Type using registered converters for the Type * @ param < T > * @ param rawString * @ param type * @ return */ public Object convert ( String rawString , Type type ) { } }
Object value = convert ( rawString , type , null ) ; return value ;
public class ScriptActionsInner { /** * Gets the script execution detail for the given script execution ID . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ param scriptExecutionId The script execution Id * @ param serviceCallback the async Servic...
return ServiceFuture . fromResponse ( getExecutionDetailWithServiceResponseAsync ( resourceGroupName , clusterName , scriptExecutionId ) , serviceCallback ) ;
public class DefaultErrorWebExceptionHandler { /** * Determine if the stacktrace attribute should be included . * @ param request the source request * @ param produces the media type produced ( or { @ code MediaType . ALL } ) * @ return if the stacktrace attribute should be included */ protected boolean isInclude...
ErrorProperties . IncludeStacktrace include = this . errorProperties . getIncludeStacktrace ( ) ; if ( include == ErrorProperties . IncludeStacktrace . ALWAYS ) { return true ; } if ( include == ErrorProperties . IncludeStacktrace . ON_TRACE_PARAM ) { return isTraceEnabled ( request ) ; } return false ;
public class AmazonNeptuneClient { /** * Creates a new DB cluster parameter group . * Parameters in a DB cluster parameter group apply to all of the instances in a DB cluster . * A DB cluster parameter group is initially created with the default parameters for the database engine used by * instances in the DB clu...
request = beforeClientExecution ( request ) ; return executeCreateDBClusterParameterGroup ( request ) ;
public class AWSSdkClient { /** * Create a launch configuration that can be later used to create { @ link AmazonAutoScaling } groups * @ param launchConfigName Desired launch config name * @ param imageId AMI image id to use * @ param instanceType EC2 instance type to use * @ param keyName Key name * @ param ...
final AmazonAutoScaling autoScaling = getAmazonAutoScalingClient ( ) ; CreateLaunchConfigurationRequest createLaunchConfigurationRequest = new CreateLaunchConfigurationRequest ( ) . withLaunchConfigurationName ( launchConfigName ) . withImageId ( imageId ) . withInstanceType ( instanceType ) . withSecurityGroups ( SPLI...
public class UntagResourceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UntagResourceRequest untagResourceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( untagResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( untagResourceRequest . getResourceArn ( ) , RESOURCEARN_BINDING ) ; protocolMarshaller . marshall ( untagResourceRequest . getTagKeys ( ) , TAGKEYS_BINDING ) ; } ca...
public class FixedPrioritiesPriorityQueue { public static void main ( String [ ] args ) { } }
FixedPrioritiesPriorityQueue < String > pq = new FixedPrioritiesPriorityQueue < String > ( ) ; System . out . println ( pq ) ; pq . add ( "one" , 1 ) ; System . out . println ( pq ) ; pq . add ( "three" , 3 ) ; System . out . println ( pq ) ; pq . add ( "one" , 1.1 ) ; System . out . println ( pq ) ; pq . add ( "two" ,...
public class CreateIssueParams { /** * Sets the issue estimate hours . * @ param estimatedHours the issue estimate hours * @ return CreateIssueParams instance */ public CreateIssueParams estimatedHours ( BigDecimal estimatedHours ) { } }
if ( estimatedHours == null ) { parameters . add ( new NameValuePair ( "estimatedHours" , "" ) ) ; } else { parameters . add ( new NameValuePair ( "estimatedHours" , estimatedHours . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) . toPlainString ( ) ) ) ; } return this ;
public class JdbcEndpointAdapterController { /** * Executes the given update * @ param updateSql The update statement to be executed * @ throws JdbcServerException In case that the execution was not successful */ @ Override public int executeUpdate ( String updateSql ) throws JdbcServerException { } }
log . info ( "Received execute update request: " + updateSql ) ; Message response = handleMessageAndCheckResponse ( JdbcMessage . execute ( updateSql ) ) ; return Optional . ofNullable ( response . getHeader ( JdbcMessageHeaders . JDBC_ROWS_UPDATED ) ) . map ( Object :: toString ) . map ( Integer :: valueOf ) . orElse ...
public class JavaMailSender { /** * Initialize the session and create the mime message . * @ return the mime message */ private MimeMessage createMimeMessage ( ) { } }
// prepare the message Session session = Session . getInstance ( properties , authenticator ) ; return new MimeMessage ( session ) ;
public class CmsModelPageHelper { /** * Returns the local model group pages . < p > * @ return the model group pages */ public List < CmsModelPageEntry > getModelGroups ( ) { } }
List < CmsModelPageEntry > result = new ArrayList < CmsModelPageEntry > ( ) ; CmsResourceTypeConfig config = m_adeConfig . getResourceType ( CmsResourceTypeXmlContainerPage . MODEL_GROUP_TYPE_NAME ) ; if ( ( config != null ) && ! config . isDisabled ( ) ) { String modelGroupFolderPath = config . getFolderPath ( m_cms ,...
public class LocalExtensionStorage { /** * Get file path in the local extension repository . * @ param id the extension id * @ param fileExtension the file extension * @ return the encoded file path */ private String getFilePath ( ExtensionId id , String fileExtension ) { } }
String encodedId = PathUtils . encode ( id . getId ( ) ) ; String encodedVersion = PathUtils . encode ( id . getVersion ( ) . toString ( ) ) ; String encodedType = PathUtils . encode ( fileExtension ) ; return encodedId + File . separator + encodedVersion + File . separator + encodedId + '-' + encodedVersion + '.' + en...
public class BinaryEllipseDetectorPixel { /** * In a binary image the contour on the right and bottom is off by one pixel . This is because the block region * extends the entire pixel not just the lower extent which is where it is indexed from . */ protected void adjustElipseForBinaryBias ( EllipseRotated_F64 ellipse...
ellipse . center . x += 0.5 ; ellipse . center . y += 0.5 ; ellipse . a += 0.5 ; ellipse . b += 0.5 ;
public class AbstractMatcher { /** * Obtain all the matching resources with the URIs of { @ code origin } within the range of MatchTypes provided , both inclusive . * @ param origins URIs to match * @ param minType the minimum MatchType we want to obtain * @ param maxType the maximum MatchType we want to obtain ...
ImmutableTable . Builder < URI , URI , MatchResult > builder = ImmutableTable . builder ( ) ; Map < URI , MatchResult > matches ; for ( URI origin : origins ) { matches = this . listMatchesWithinRange ( origin , minType , maxType ) ; for ( Map . Entry < URI , MatchResult > match : matches . entrySet ( ) ) { builder . p...
public class RunResults { /** * returns null if not found */ public RootMethodRunResult getRunResultByRootMethod ( TestMethod rootMethod ) { } }
if ( rootMethod == null ) { throw new NullPointerException ( ) ; } return getRunResultByRootMethodKey ( rootMethod . getKey ( ) ) ;
public class FileHelper { /** * Delete a file ignoring failures . * @ param file file to delete */ public static final void deleteQuietly ( File file ) { } }
if ( file != null ) { if ( file . isDirectory ( ) ) { File [ ] children = file . listFiles ( ) ; if ( children != null ) { for ( File child : children ) { deleteQuietly ( child ) ; } } } file . delete ( ) ; }
public class FileDescriptor { /** * Open a new { @ link FileDescriptor } for the given path . */ public static FileDescriptor from ( String path ) throws IOException { } }
checkNotNull ( path , "path" ) ; int res = open ( path ) ; if ( res < 0 ) { throw newIOException ( "open" , res ) ; } return new FileDescriptor ( res ) ;
public class Dialog { /** * Set the background drawable of all action buttons . * @ param drawable The background drawable . * @ return The Dialog for chaining methods . */ public Dialog actionBackground ( Drawable drawable ) { } }
positiveActionBackground ( drawable ) ; negativeActionBackground ( drawable ) ; neutralActionBackground ( drawable ) ; return this ;
public class UrlPatternAnalyzer { protected UrlPatternChosenBox adjustUrlPatternMethodPrefix ( Method executeMethod , String sourceUrlPattern , String methodName , boolean specified ) { } }
final String keywordMark = getMethodKeywordMark ( ) ; if ( methodName . equals ( "index" ) ) { // e . g . index ( pageNumber ) , urlPattern = " { } " if ( sourceUrlPattern . contains ( keywordMark ) ) { throwUrlPatternMethodKeywordMarkButIndexMethodException ( executeMethod , sourceUrlPattern , keywordMark ) ; } return...
public class NFA { /** * Constructs a dfa from using first nfa state as starting state . * @ param scope * @ return */ public DFA < T > constructDFA ( Scope < DFAState < T > > scope ) { } }
return new DFA < > ( first . constructDFA ( scope ) , scope . count ( ) ) ;
public class CacheToMapAdapter { /** * Factory method used to construct a new instance of { @ link CacheToMapAdapter } initialized with * the given { @ link Cache } used to back the { @ link Map } . * @ param < KEY > { @ link Class type } of keys used by the { @ link Map } . * @ param < VALUE > { @ link Class typ...
return new CacheToMapAdapter < > ( cache ) ;
public class MetadataApiService { /** * POST / metadata / { projectName } / tokens * < p > Adds a { @ link Token } to the specified { @ code projectName } . */ @ Post ( "/metadata/{projectName}/tokens" ) public CompletableFuture < Revision > addToken ( @ Param ( "projectName" ) String projectName , IdentifierWithRole...
final ProjectRole role = toProjectRole ( request . role ( ) ) ; return mds . findTokenByAppId ( request . id ( ) ) . thenCompose ( token -> mds . addToken ( author , projectName , token . appId ( ) , role ) ) ;
public class CSSMinifierMojo { /** * Cleans the output file if any . * @ param file the file * @ return { @ literal false } if the pipeline processing must be interrupted for this event . Most watchers should * return { @ literal true } to let other watchers be notified . * @ throws org . wisdom . maven . Watch...
if ( isNotMinified ( file ) ) { File minified = getMinifiedFile ( file ) ; FileUtils . deleteQuietly ( minified ) ; File map = new File ( minified . getParentFile ( ) , minified . getName ( ) + ".map" ) ; FileUtils . deleteQuietly ( map ) ; } return true ;
public class LambdaToMethod { /** * Translate qualified ` this ' references within a lambda to the mapped identifier * @ param tree */ @ Override public void visitSelect ( JCFieldAccess tree ) { } }
if ( context == null || ! analyzer . lambdaFieldAccessFilter ( tree ) ) { super . visitSelect ( tree ) ; } else { int prevPos = make . pos ; try { make . at ( tree ) ; LambdaTranslationContext lambdaContext = ( LambdaTranslationContext ) context ; JCTree ltree = lambdaContext . translate ( tree ) ; if ( ltree != null )...
public class SibRaManagedConnection { /** * Returns a connection handle for this managed connection . The resource * adapter does not support re - authentication so * < code > matchManagedConnection < / code > should already have checked that * the < code > Subject < / code > and request information are suitable ...
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "getConnection" , new Object [ ] { SibRaUtils . subjectToString ( containerSubject ) , requestInfo } ) ; } SibRaConnection connection = null ; if ( requestInfo instanceof SibRaConnectionRequestInfo ) { final S...
public class VirtualListViewControlDirContextProcessor { /** * @ see org . springframework . ldap . control . AbstractRequestControlDirContextProcessor # createRequestControl ( ) */ public Control createRequestControl ( ) { } }
Control control ; if ( offsetPercentage ) { control = super . createRequestControl ( new Class [ ] { int . class , int . class , boolean . class } , new Object [ ] { Integer . valueOf ( targetOffset ) , Integer . valueOf ( pageSize ) , Boolean . valueOf ( CRITICAL_CONTROL ) } ) ; } else { control = super . createReques...
public class Evaluator { /** * Attribute . * @ param _ select the select * @ return the attribute * @ throws EFapsException the e faps exception */ protected Attribute attribute ( final Select _select ) throws EFapsException { } }
Attribute ret = null ; final AbstractElement < ? > element = _select . getElements ( ) . get ( _select . getElements ( ) . size ( ) - 1 ) ; if ( element instanceof AttributeElement ) { ret = ( ( AttributeElement ) element ) . getAttribute ( ) ; } return ret ;
public class Chunk { /** * Fetch the missing - status the slow way . */ public final boolean isNA ( long i ) { } }
long x = i - ( _start > 0 ? _start : 0 ) ; if ( 0 <= x && x < _len ) return isNA0 ( ( int ) x ) ; throw new ArrayIndexOutOfBoundsException ( getClass ( ) . getSimpleName ( ) + " " + _start + " <= " + i + " < " + ( _start + _len ) ) ;
public class ResourceAdapterModuleMBeanImpl { /** * ( non - Javadoc ) * @ see com . ibm . websphere . jca . mbean . ResourceAdapterModuleMBean # getresourceAdapters ( ) */ @ Override public String [ ] getresourceAdapters ( ) { } }
final String methodName = "getresourceAdapters" ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( tc , methodName , this ) ; final Collection < ResourceAdapterMBeanImpl > c = raMBeanChildrenList . values ( ) ; final int size = c . size ( ) ; final St...
public class Sequence { /** * Overridden so we can create appropriate sized buffer before making * string . * @ see uk . ac . ebi . embl . api . entry . sequence . AbstractSequence # getSequence ( java . lang . Long , * java . lang . Long ) */ @ Deprecated @ Override public String getSequence ( Long beginPosition...
if ( beginPosition == null || endPosition == null || ( beginPosition > endPosition ) || beginPosition < 1 || endPosition > getLength ( ) ) { return null ; } int length = ( int ) ( endPosition . longValue ( ) - beginPosition . longValue ( ) ) + 1 ; int offset = beginPosition . intValue ( ) - 1 ; String subSequence = nul...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.citygml.org/ade/sub/0.9.0" , name = "_GenericApplicationPropertyOfClosureSurface" ) public JAXBElement < Object > create_GenericApplicationPropertyO...
return new JAXBElement < Object > ( __GenericApplicationPropertyOfClosureSurface_QNAME , Object . class , null , value ) ;
public class DbxClientV2 { /** * Returns a new { @ link DbxClientV2 } that performs requests against Dropbox API * user endpoints relative to a namespace without including the namespace as * part of the path variable for every request . * ( < a href = " https : / / www . dropbox . com / developers / reference / n...
if ( pathRoot == null ) { throw new IllegalArgumentException ( "'pathRoot' should not be null" ) ; } return new DbxClientV2 ( _client . withPathRoot ( pathRoot ) ) ;
public class ClassApi { /** * Creates new instance of class , rethrowing all exceptions in runtime . * @ param clazz type * @ param < T > class generic * @ return instance object */ public static < T > T newInstance ( final Class < T > clazz ) { } }
try { return clazz . newInstance ( ) ; } catch ( InstantiationException | IllegalAccessException e ) { throw new ClassApiException ( e ) ; }
public class FixedSizeBitSet { /** * Sets the bit specified by the index to { @ code false } . * @ param index the index of the bit to be cleared . * @ throws IndexOutOfBoundsException if the specified index is negative . */ public void clear ( int index ) { } }
if ( index < 0 || index >= size ) throw new IndexOutOfBoundsException ( "index: " + index ) ; int wordIndex = wordIndex ( index ) ; words [ wordIndex ] &= ~ ( 1L << index ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getMCF1RG ( ) { } }
if ( mcf1RGEClass == null ) { mcf1RGEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 427 ) ; } return mcf1RGEClass ;
public class AlignedBox3d { /** * Set the y bounds of the box . * @ param min the min value for the y axis . * @ param max the max value for the y axis . */ @ Override public void setY ( double min , double max ) { } }
if ( min <= max ) { this . minyProperty . set ( min ) ; this . maxyProperty . set ( max ) ; } else { this . minyProperty . set ( max ) ; this . maxyProperty . set ( min ) ; }
public class SchemaConfiguration { /** * Return schema manager for pu . * @ param persistenceUnit * @ return */ private SchemaManager getSchemaManagerForPu ( final String persistenceUnit ) { } }
SchemaManager schemaManager = null ; Map < String , Object > externalProperties = KunderaCoreUtils . getExternalProperties ( persistenceUnit , externalPropertyMap , persistenceUnits ) ; if ( getSchemaProperty ( persistenceUnit , externalProperties ) != null && ! getSchemaProperty ( persistenceUnit , externalProperties ...
public class OperationsApi { /** * Post users . * postUsers * @ return ApiResponse & lt ; PostUsers & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < PostUsers > postUsersWithHttpInfo ( ) throws ApiException { } }
com . squareup . okhttp . Call call = postUsersValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostUsers > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class TxUtils { /** * Returns the write pointer for the first " short " transaction that in the in - progress set , or * { @ link Transaction # NO _ TX _ IN _ PROGRESS } if none . */ public static long getFirstShortInProgress ( Map < Long , TransactionManager . InProgressTx > inProgress ) { } }
long firstShort = Transaction . NO_TX_IN_PROGRESS ; for ( Map . Entry < Long , TransactionManager . InProgressTx > entry : inProgress . entrySet ( ) ) { if ( ! entry . getValue ( ) . isLongRunning ( ) ) { firstShort = entry . getKey ( ) ; break ; } } return firstShort ;
public class Configs { /** * Get self config decimal . Config key include prefix . * Example : < br > * If key . getKeyString ( ) is " test " , < br > * getSelfConfigDecimal ( " 1 . " , key ) ; * will return " 1 . test " config value in { @ linkplain IConfigKeyWithPath # getConfigPath ( ) path } set in key . ...
String configAbsoluteClassPath = key . getConfigPath ( ) ; return getSelfConfigDecimal ( configAbsoluteClassPath , keyPrefix , key ) ;
public class FPSCounter { /** * Computes execution time * @ param extra */ public static void timeCheck ( String extra ) { } }
if ( startCheckTime > 0 ) { long now = System . currentTimeMillis ( ) ; long diff = now - nextCheckTime ; nextCheckTime = now ; Log . d ( Log . SUBSYSTEM . TRACING , "FPSCounter" , "[%d, %d] timeCheck: %s" , now , diff , extra ) ; }
public class PriceGraduation { /** * Create a simple price graduation that contains one item with the minimum * quantity of 1. * @ param aPrice * The price to use . May not be < code > null < / code > . * @ return Never < code > null < / code > . */ @ Nonnull public static IMutablePriceGraduation createSimple (...
final PriceGraduation ret = new PriceGraduation ( aPrice . getCurrency ( ) ) ; ret . addItem ( new PriceGraduationItem ( 1 , aPrice . getNetAmount ( ) . getValue ( ) ) ) ; return ret ;
public class MongoDBQueryUtils { /** * Auxiliary method to check if the operator of each of the values in the queryParamList matches the operator passed . * @ param type QueryParam type . * @ param queryParamList List of values . * @ param operator Operator to be checked . * @ return boolean indicating whether ...
for ( String queryItem : queryParamList ) { Matcher matcher = getPattern ( type ) . matcher ( queryItem ) ; String op = "" ; if ( matcher . find ( ) ) { op = matcher . group ( 1 ) ; } if ( operator != getComparisonOperator ( op , type ) ) { return false ; } } return true ;
public class Chronology { /** * Obtains a local date in this chronology from the era , year - of - era , * month - of - year and day - of - month fields . * @ param era the era of the correct type for the chronology , not null * @ param yearOfEra the chronology year - of - era * @ param month the chronology mon...
return date ( prolepticYear ( era , yearOfEra ) , month , dayOfMonth ) ;
public class Apptentive { /** * This method takes a unique event string , stores a record of that event having been visited , * determines if there is an interaction that is able to run for this event , and then runs it . If * more than one interaction can run , then the most appropriate interaction takes precedenc...
engage ( context , event , null , customData , ( ExtendedData [ ] ) null ) ;
public class Pipeline { /** * Annotates a document with the given annotation types . * @ param textDocument the document to be the annotate * @ param annotationTypes the annotation types to be annotated */ public static void process ( @ NonNull Document textDocument , AnnotatableType ... annotationTypes ) { } }
if ( annotationTypes == null || annotationTypes . length == 0 ) { return ; } for ( AnnotatableType annotationType : annotationTypes ) { if ( annotationType == null ) { continue ; } if ( textDocument . getAnnotationSet ( ) . isCompleted ( annotationType ) ) { continue ; } if ( log . isLoggable ( Level . FINEST ) ) { log...
public class IOUtils { /** * Create a folder , If the folder exists is not created . * @ param folderPath folder path . * @ return True : success , or false : failure . */ public static boolean createFolder ( String folderPath ) { } }
if ( ! StringUtils . isEmpty ( folderPath ) ) { File folder = new File ( folderPath ) ; return createFolder ( folder ) ; } return false ;
public class BatchArtifactsImpl { /** * If not already created , a new < code > ref < / code > element will be created and returned . * Otherwise , the first existing < code > ref < / code > element will be returned . * @ return the instance defined for the element < code > ref < / code > */ public BatchArtifactRef...
List < Node > nodeList = childNode . get ( "ref" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new BatchArtifactRefImpl < BatchArtifacts < T > > ( this , "ref" , childNode , nodeList . get ( 0 ) ) ; } return createRef ( ) ;
public class MSwingUtilities { /** * Retourne l ' instance courante de la classe componentClass contenant l ' élément component . < br / > * Cette méthode peut - être très utile pour récupérer une référence à un parent éloigné ( ancêtre ) , en l ' absence de référence directe du type attribut . * < b...
return ( T ) SwingUtilities . getAncestorOfClass ( componentClass , component ) ;
public class JvmTypesBuilder { /** * Attaches the given compile strategy to the given { @ link JvmExecutable } such that the compiler knows how to * implement the { @ link JvmExecutable } when it is translated to Java source code . * @ param executable the operation or constructor to add the method body to . If < c...
removeExistingBody ( executable ) ; setCompilationStrategy ( executable , strategy ) ;
public class Searcher { /** * Loads more results with the same query . * Note that this method won ' t do anything if { @ link Searcher # hasMoreHits } returns false . * @ return this { @ link Searcher } for chaining . */ @ NonNull public Searcher loadMore ( ) { } }
if ( ! hasMoreHits ( ) ) { return this ; } query . setPage ( ++ lastRequestPage ) ; final int currentRequestId = ++ lastRequestId ; EventBus . getDefault ( ) . post ( new SearchEvent ( this , query , currentRequestId ) ) ; pendingRequests . put ( currentRequestId , triggerSearch ( new CompletionHandler ( ) { @ Override...
public class HashCodeBuilder { /** * Uses reflection to build a valid hash code from the fields of { @ code object } . * This constructor uses two hard coded choices for the constants needed to build a hash code . * It uses < code > AccessibleObject . setAccessible < / code > to gain access to private fields . This...
return reflectionHashCode ( DEFAULT_INITIAL_VALUE , DEFAULT_MULTIPLIER_VALUE , object , testTransients , null ) ;
public class CPDefinitionLinkPersistenceImpl { /** * Removes the cp definition link with the primary key from the database . Also notifies the appropriate model listeners . * @ param primaryKey the primary key of the cp definition link * @ return the cp definition link that was removed * @ throws NoSuchCPDefiniti...
Session session = null ; try { session = openSession ( ) ; CPDefinitionLink cpDefinitionLink = ( CPDefinitionLink ) session . get ( CPDefinitionLinkImpl . class , primaryKey ) ; if ( cpDefinitionLink == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw ...
public class CompilerWrapper { /** * < p > addField . < / p > * @ param fieldName a { @ link java . lang . String } object . * @ param fildType a { @ link java . lang . Class } object . * @ param isPublic a boolean . * @ param isStatic a boolean . * @ param isFinal a boolean . * @ throws javassist . CannotC...
addField ( fieldName , fildType , isPublic , isStatic , isFinal , null ) ;
public class HawkbitCommonUtil { /** * Create lazy query container for DS type . * @ param queryFactory * @ return LazyQueryContainer */ public static LazyQueryContainer createDSLazyQueryContainer ( final BeanQueryFactory < ? extends AbstractBeanQuery < ? > > queryFactory ) { } }
queryFactory . setQueryConfiguration ( Collections . emptyMap ( ) ) ; return new LazyQueryContainer ( new LazyQueryDefinition ( true , 20 , "tagIdName" ) , queryFactory ) ;
public class SibRaCommonEndpointActivation { /** * A session error has occured on the connection , drop the connection and , if necessary , * try to create a new connection */ @ Override void sessionError ( SibRaMessagingEngineConnection connection , ConsumerSession session , Throwable throwable ) { } }
final String methodName = "sessionError" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { connection , session } ) ; } final SIDestinationAddress destination = session . getDestinationAddress ( ) ; SibTr . warning ( TRACE , "C...
public class CharacterManager { /** * Returns the estimated memory usage in bytes for all images * currently cached by the cached action frames . */ protected long getEstimatedCacheMemoryUsage ( ) { } }
long size = 0 ; Iterator < CompositedMultiFrameImage > iter = _frameCache . values ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { size += iter . next ( ) . getEstimatedMemoryUsage ( ) ; } return size ;
public class Reflect { /** * Creates an instance of Reflect associated with a class * @ param clazz The class for reflection as string * @ return The Reflect object * @ throws Exception the exception */ public static Reflect onClass ( String clazz ) throws Exception { } }
return new Reflect ( null , ReflectionUtils . getClassForName ( clazz ) ) ;
public class Bugsnag { /** * Set the endpoints to send data to . By default we ' ll send error reports to * https : / / notify . bugsnag . com , and sessions to https : / / sessions . bugsnag . com , but you can * override this if you are using Bugsnag Enterprise to point to your own Bugsnag endpoint . * Please n...
config . setEndpoints ( notify , sessions ) ;
public class CmsLuceneIndexWriter { /** * @ see org . opencms . search . I _ CmsIndexWriter # optimize ( ) * As optimize is deprecated with Lucene 3.5 , this implementation * actually calls { @ link IndexWriter # forceMerge ( int ) } . < p > */ public void optimize ( ) throws IOException { } }
if ( ( m_index != null ) && LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_INDEX_WRITER_MSG_OPTIMIZE_2 , m_index . getName ( ) , m_index . getPath ( ) ) ) ; } int oldPriority = Thread . currentThread ( ) . getPriority ( ) ; // we don ' t want the priority too low as t...
public class SessionManager { /** * DS method to deactivate this component . * @ param context */ public void deactivate ( ComponentContext context ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Deactivating" ) ; } if ( null != this . future ) { synchronized ( this . timerLock ) { if ( null != this . future ) { this . future . cancel ( true ) ; this . future = null ; } } // end - sync } // TODO purge the grou...
public class ManagedIndex { /** * Required by IndexEntryAccessor interface . */ public void copyFromMaster ( Storable indexEntry , S master ) throws FetchException { } }
mAccessor . copyFromMaster ( indexEntry , master ) ;
public class Interaction { /** * Fetches values using the popular dot notation * i . e . tumblr . author . id would return the id ( 12345 ) value in a structure similar to * < pre > * { " tumblr " : { * " author " : { * " id " : 12345 * < / pre > * @ param str a JSON dot notation string * @ return null ...
String [ ] parts = str . split ( "\\." ) ; JsonNode retval = data . get ( parts [ 0 ] ) ; for ( int i = 1 ; i <= parts . length - 1 ; i ++ ) { if ( retval == null ) { return null ; } else { retval = retval . get ( parts [ i ] ) ; } } return retval ;
public class NetworkInterface { /** * The IP addresses associated with the network interface . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setIpv6Addresses ( java . util . Collection ) } or { @ link # withIpv6Addresses ( java . util . Collection ) } if yo...
if ( this . ipv6Addresses == null ) { setIpv6Addresses ( new java . util . ArrayList < String > ( ipv6Addresses . length ) ) ; } for ( String ele : ipv6Addresses ) { this . ipv6Addresses . add ( ele ) ; } return this ;
public class NumberMap { /** * Creates a NumberMap for Shorts . * @ param < K > * @ return NumberMap < K > */ public static < K > NumberMap < K , Short > newShortMap ( ) { } }
return new NumberMap < K , Short > ( ) { @ Override public void add ( K key , Short addend ) { put ( key , containsKey ( key ) ? ( short ) ( get ( key ) + addend ) : addend ) ; } @ Override public void sub ( K key , Short subtrahend ) { put ( key , ( short ) ( ( containsKey ( key ) ? get ( key ) : 0 ) - subtrahend ) ) ...
public class JSONObject { /** * Internal method to write out a proper JSON attribute string . * @ param writer The writer to use while serializing * @ param attrs The attributes in a properties object to write out * @ param depth How far to indent the JSON text . * @ param compact Whether or not to use pretty i...
if ( logger . isLoggable ( Level . FINER ) ) logger . entering ( className , "writeAttributes(Writer, Properties, int, boolean)" ) ; if ( attrs != null ) { Enumeration props = attrs . propertyNames ( ) ; if ( props != null && props . hasMoreElements ( ) ) { while ( props . hasMoreElements ( ) ) { String prop = ( String...
public class ICalComponent { /** * Gets the first sub - component of a given class . * @ param clazz the component class * @ param < T > the component class * @ return the sub - component or null if not found */ public < T extends ICalComponent > T getComponent ( Class < T > clazz ) { } }
return clazz . cast ( components . first ( clazz ) ) ;
public class CqlDataReaderDAO { /** * Asynchronously executes the provided statement . Although the iterator is returned immediately the actual results * may still be loading in the background . The statement must query the delta table as returned from * { @ link com . bazaarvoice . emodb . sor . db . astyanax . De...
return doDeltaQuery ( placement , statement , singleRow , true , errorContext , errorContextArgs ) ;
public class AbstractRsJs { /** * Get resource * @ return * @ throws IOException */ @ GET @ Produces ( Constants . JSTYPE ) public Response getJs ( ) throws IOException { } }
return Response . ok ( ( Object ) getSequenceInputStream ( getStreams ( ) ) ) . build ( ) ;
public class Encoder { /** * Recovers a corrupt block in a parity file to an output stream . * The encoder generates codec . parityLength parity blocks for a source file stripe . * Since there is only one output provided , some blocks are written out to * files before being written out to the output . * @ param...
OutputStream [ ] tmpOuts = new OutputStream [ codec . parityLength ] ; // One parity block can be written directly to out , rest to local files . tmpOuts [ 0 ] = out ; File [ ] tmpFiles = new File [ codec . parityLength - 1 ] ; for ( int i = 0 ; i < codec . parityLength - 1 ; i ++ ) { tmpFiles [ i ] = File . createTemp...
public class SearchableString { /** * Returns all indices where the literal argument can be found in this String . Results are cached for better * performance . * @ param literal The string that should be found * @ return all indices where the literal argument can be found in this String . */ int [ ] getIndices (...
// Check whether the answer is already in the cache final int index = literal . getIndex ( ) ; final int [ ] cached = myIndices [ index ] ; if ( cached != null ) { return cached ; } // Find all indices final int [ ] values = findIndices ( literal ) ; myIndices [ index ] = values ; return values ;
public class RestUtils { /** * Batch create response as JSON . * @ param app the current App object * @ param is entity input stream * @ return a status code 200 or 400 */ public static Response getBatchCreateResponse ( final App app , InputStream is ) { } }
try ( final Metrics . Context context = Metrics . time ( app == null ? null : app . getAppid ( ) , RestUtils . class , "batch" , "create" ) ) { if ( app != null ) { final LinkedList < ParaObject > newObjects = new LinkedList < > ( ) ; Response entityRes = getEntity ( is , List . class ) ; if ( entityRes . getStatusInfo...
public class AtlasClient { /** * Search using dsl / full text * @ param searchQuery * @ param limit number of rows to be returned in the result , used for pagination . maxlimit > limit > 0 . - 1 maps to atlas . search . defaultlimit property value * @ param offset offset to the results returned , used for paginat...
JSONObject result = callAPIWithRetries ( API . SEARCH , null , new ResourceCreator ( ) { @ Override public WebResource createResource ( ) { WebResource resource = getResource ( API . SEARCH ) ; resource = resource . queryParam ( QUERY , searchQuery ) ; resource = resource . queryParam ( LIMIT , String . valueOf ( limit...
public class NotExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } }
switch ( featureID ) { case SimpleAntlrPackage . NOT_EXPRESSION__VALUE : return basicSetValue ( null , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ;
public class Response { /** * Return the Response nameID ( user identifier ) * @ return String user nameID * @ throws Exception */ public String getNameId ( ) throws Exception { } }
NodeList nodes = xmlDoc . getElementsByTagNameNS ( "urn:oasis:names:tc:SAML:2.0:assertion" , "NameID" ) ; if ( nodes . getLength ( ) == 0 ) { throw new Exception ( "No name id found in document" ) ; } return nodes . item ( 0 ) . getTextContent ( ) ;
public class StageState { /** * The state of the stage . * @ param actionStates * The state of the stage . */ public void setActionStates ( java . util . Collection < ActionState > actionStates ) { } }
if ( actionStates == null ) { this . actionStates = null ; return ; } this . actionStates = new java . util . ArrayList < ActionState > ( actionStates ) ;