signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TimeGuard { /** * Process all time points for the current stack level . * @ since 1.0 */ @ Weight ( value = Weight . Unit . VARIABLE , comment = "Depends on the current call stack depth" ) public static void checkPoints ( ) { } }
final long time = System . currentTimeMillis ( ) ; final int stackDepth = ThreadUtils . stackDepth ( ) ; final List < TimeData > list = REGISTRY . get ( ) ; final Iterator < TimeData > iterator = list . iterator ( ) ; while ( iterator . hasNext ( ) ) { final TimeData timeWatchItem = iterator . next ( ) ; if ( timeWatch...
public class ColorHelper { /** * Get HSL Color from RGB * https : / / www . programmingalgorithms . com / algorithm / rgb - to - hsl ? lang = C % 2B % 2B * @ param r * @ param g * @ param b * @ return */ public static float [ ] getHSLArray ( int r , int g , int b ) { } }
float [ ] hsl = new float [ 3 ] ; float h , s , l ; float rf = r / MAX ; float gf = g / MAX ; float bf = b / MAX ; float minRGB = Math . min ( rf , Math . min ( gf , bf ) ) ; float maxRGB = Math . max ( rf , Math . max ( gf , bf ) ) ; float delta = maxRGB - minRGB ; l = ( maxRGB + minRGB ) / 2 ; if ( delta == 0 ) { h =...
public class Name { /** * Invoke the method identified by this name . * Performs caching of method resolution using SignatureKey . * Name contains a wholely unqualfied messy name ; resolve it to * ( object | static prefix ) + method name and invoke . * The interpreter is necessary to support ' this . interprete...
String methodName = Name . suffix ( value , 1 ) ; BshClassManager bcm = interpreter . getClassManager ( ) ; NameSpace namespace = callstack . top ( ) ; // Optimization - If classOfStaticMethod is set then we have already // been here and determined that this is a static method invocation . // Note : maybe factor this o...
public class COSAPIClient { /** * Merge between two paths * @ param hostName * @ param p path * @ param objectKey * @ return merged path */ private String getMergedPath ( String hostName , Path p , String objectKey ) { } }
if ( ( p . getParent ( ) != null ) && ( p . getName ( ) != null ) && ( p . getParent ( ) . toString ( ) . equals ( hostName ) ) ) { if ( objectKey . equals ( p . getName ( ) ) ) { return p . toString ( ) ; } return hostName + objectKey ; } return hostName + objectKey ;
public class JavaCodeInjector { /** * This method will add methods , fields and import statement to existing java file * @ throws IOException * @ throws ParseException */ public void insertCode ( ) throws IOException , ParseException { } }
CompilationUnit cuResult = JavaParser . parse ( baseFile ) ; if ( cuResult . getImports ( ) != null ) { List < ImportDeclaration > importsFromBaseFile = cuResult . getImports ( ) ; for ( ImportDeclaration eachImport : importsFromExtendedFile ) { if ( ! importAlreadyPresent ( importsFromBaseFile , eachImport ) ) { impor...
public class CmsConvertXmlDialog { /** * Builds the file format select widget list . < p > * @ return File format select widget list */ private List buildResourceTypeSelectWidgetList ( ) { } }
List fileFormats = new ArrayList ( ) ; // get all OpenCms resource types List resourceTypes = OpenCms . getResourceManager ( ) . getResourceTypes ( ) ; // put for every resource type type id and name into list object for select widget Iterator iter = resourceTypes . iterator ( ) ; while ( iter . hasNext ( ) ) { I_CmsRe...
public class ProbeWrapper { /** * Add a response URL to the probe . * @ param label the string label for the respondTo address * @ param url the actual URL string */ public void addRespondToURL ( String label , String url ) { } }
RespondToURL respondToURL = new RespondToURL ( ) ; respondToURL . label = label ; respondToURL . url = url ; respondToURLs . add ( respondToURL ) ;
public class QueryRunner { /** * Executes the given INSERT , UPDATE , or DELETE SQL statement with * a single replacement parameter . The < code > Connection < / code > is * retrieved from the < code > DataSource < / code > set in the constructor . * This < code > Connection < / code > must be in auto - commit mo...
return this . update ( sql , new Object [ ] { param } ) ;
public class LoOP { /** * Compute the LOF values , using the pdist distances . * @ param relation Data relation * @ param knn kNN query * @ param pdists Precomputed distances * @ param plofs Storage for PLOFs . * @ return Normalization factor . */ protected double computePLOFs ( Relation < O > relation , KNNQ...
FiniteProgress progressPLOFs = LOG . isVerbose ( ) ? new FiniteProgress ( "PLOFs for objects" , relation . size ( ) , LOG ) : null ; double nplof = 0. ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { final KNNList neighbors = knn . getKNNForDBID ( iditer , kcomp + 1 ) ;...
public class FLACEncoder { /** * Attempts to throw a stored exception that had been caught from a child * thread . This method should be called regularly in any public method to * let the calling thread know a problem occured . * @ throws IOException */ private void checkForThreadErrors ( ) throws IOException { }...
if ( error == true && childException != null ) { error = false ; IOException temp = childException ; childException = null ; throw temp ; }
public class BatcherBuilder { /** * Add a max size component for a batcher . If specified a batcher will call the { @ link BatchListener } * as soon as the size bound is reached . */ public BatcherBuilder sizeBound ( int size ) { } }
checkState ( this . maxSize == UNSET_INT , "Max size already set to %s" , this . maxSize ) ; checkArgument ( size > 0 , "Required to have a size bound greater than 0" ) ; this . maxSize = size ; return this ;
public class PutObjectEncryptedKms { /** * MinioClient . getObject ( ) example . */ public static void main ( String [ ] args ) throws NoSuchAlgorithmException , IOException , InvalidKeyException , XmlPullParserException { } }
try { /* play . min . io for test and development . */ MinioClient minioClient = new MinioClient ( "https://play.min.io:9000" , "Q3AM3UQ867SPQQA43P2F" , "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" ) ; /* Amazon S3: */ // MinioClient minioClient = new MinioClient ( " https : / / s3 . amazonaws . com " , " YOUR - ACCESSKE...
public class EJSHome { /** * LI2281.07 */ final TimedObjectWrapper getTimedObjectWrapper ( BeanId beanId ) { } }
TimedObjectWrapper timedWrapper = null ; // Get timedObject from container pool of timed objects . timedWrapper = ( TimedObjectWrapper ) container . ivTimedObjectPool . get ( ) ; // If the pool was empty , create a new one . . . and set the // invariant fields . if ( timedWrapper == null ) { timedWrapper = new TimedObj...
public class ExportApi { /** * Export users . * Export the specified users with the properties you list in the * * fields * * parameter . * @ param exportFileData Export File Data ( required ) * @ return ExportFileResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserial...
ApiResponse < ExportFileResponse > resp = exportFileWithHttpInfo ( exportFileData ) ; return resp . getData ( ) ;
public class KeyVaultClientBaseImpl { /** * List certificate issuers for a specified key vault . * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault . This operation requires the certificates / manageissuers / getissuers permission . * @ param vaultBaseUr...
return AzureServiceFuture . fromPageResponse ( getCertificateIssuersSinglePageAsync ( vaultBaseUrl , maxresults ) , new Func1 < String , Observable < ServiceResponse < Page < CertificateIssuerItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < CertificateIssuerItem > > > call ( String nextPageLin...
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createRSC ( ) */ @ Override public ResetCircuitMessage createRSC ( ) { } }
ResetCircuitMessage msg = new ResetCircuitMessageImpl ( _RSC_HOLDER . mandatoryCodes , _RSC_HOLDER . mandatoryVariableCodes , _RSC_HOLDER . optionalCodes , _RSC_HOLDER . mandatoryCodeToIndex , _RSC_HOLDER . mandatoryVariableCodeToIndex , _RSC_HOLDER . optionalCodeToIndex ) ; return msg ;
public class FileInstrumentationData { /** * Returns a byte - wise hex string representation of the BitField from * MSB ( Most Significant Byte ) to LSB ( Least Significant Byte ) . * Eg . Single byte : a setting of " 0001 1111 " , returns " 1f " * Eg . Multiple bytes : a setting of " 0000 0010 0001 1111 " , retu...
StringBuilder builder = new StringBuilder ( ) ; // Build the hex string . for ( byte byteEntry : bitSet . toByteArray ( ) ) { // Java bytes are signed , but we want the value as if it were unsigned . int value = UnsignedBytes . toInt ( byteEntry ) ; String hexString = Integer . toHexString ( value ) ; // Pad string to ...
public class ImageCreative { /** * Sets the secondaryImageAssets value for this ImageCreative . * @ param secondaryImageAssets * The list of secondary image assets associated with this creative . * This attribute is optional . * < p > Secondary image assets can be used to store * different resolution versions o...
this . secondaryImageAssets = secondaryImageAssets ;
public class AbstractMSBuildMojo { /** * Run MSBuild for each platform and configuration pair . * @ param targets the build targets to pass to MSBuild * @ param environment optional environment variable Map ( my be null ) * @ throws MojoExecutionException if there is a problem running MSBuild * @ throws MojoFai...
try { MSBuildExecutor msbuild = new MSBuildExecutor ( getLog ( ) , msbuildPath , msbuildMaxCpuCount , projectFile ) ; msbuild . setPlatforms ( platforms ) ; msbuild . setTargets ( targets ) ; msbuild . setEnvironment ( environment ) ; if ( msbuild . execute ( ) != 0 ) { throw new MojoFailureException ( "MSBuild executi...
public class DefaultAndroidApp { /** * ( non - Javadoc ) * @ see io . selendroid . android . impl . AndroidAppA # getMainActivity ( ) */ @ Override public String getMainActivity ( ) throws AndroidSdkException { } }
if ( mainActivity == null ) { try { mainActivity = extractApkDetails ( "launchable-activity: name='(.*?)'" ) ; } catch ( ShellCommandException e ) { throw new SelendroidException ( "The main activity of the apk " + apkFile . getName ( ) + " cannot be extracted." ) ; } } return mainActivity ;
public class JsonRender { /** * 仅对无参 renderJson ( ) 起作用 */ public static void addExcludedAttrs ( String ... attrs ) { } }
if ( attrs != null ) { for ( String attr : attrs ) { excludedAttrs . add ( attr ) ; } }
public class JKTableRecord { public int getColumnIndex ( final String name ) { } }
for ( int i = 0 ; i < this . columnsValues . size ( ) ; i ++ ) { final JKTableColumnValue value = this . columnsValues . get ( i ) ; if ( value . getTableColumn ( ) . getName ( ) . toLowerCase ( ) . equals ( name . toLowerCase ( ) ) ) { return i ; } } return - 1 ;
public class ZipUtil { /** * Copies an existing ZIP file and appends it with one new entry . * @ param zip * an existing ZIP file ( only read ) . * @ param entry * new ZIP entry appended . * @ param destZip * new ZIP file created . */ public static void addEntry ( File zip , ZipEntrySource entry , File dest...
addEntries ( zip , new ZipEntrySource [ ] { entry } , destZip ) ;
public class ArrowSerde { /** * Convert the given { @ link INDArray } * data type to the proper data type for the tensor . * @ param bufferBuilder the buffer builder in use * @ param arr the array to conver tthe data type for */ public static void addTypeTypeRelativeToNDArray ( FlatBufferBuilder bufferBuilder , I...
switch ( arr . data ( ) . dataType ( ) ) { case LONG : case INT : Tensor . addTypeType ( bufferBuilder , Type . Int ) ; break ; case FLOAT : Tensor . addTypeType ( bufferBuilder , Type . FloatingPoint ) ; break ; case DOUBLE : Tensor . addTypeType ( bufferBuilder , Type . Decimal ) ; break ; }
public class CsvEntityLoader { /** * Loads nodes from a CSV file with given labels to an online database , and fills the { @ code idMapping } , * which will be used by the { @ link # loadRelationships ( String , String , GraphDatabaseService , Map ) } * method . * @ param fileName URI of the CSV file representing...
final CountingReader reader = FileUtils . readerFor ( fileName ) ; final String header = readFirstLine ( reader ) ; reader . skip ( clc . getSkipLines ( ) - 1 ) ; final List < CsvHeaderField > fields = CsvHeaderFields . processHeader ( header , clc . getDelimiter ( ) , clc . getQuotationCharacter ( ) ) ; final Optional...
public class DateUtil { /** * 判断指定日期是否在当前时间之前 , 精确到指定单位 * @ param date 指定日期 * @ param format 指定日期的格式 * @ param dateUnit 精确单位 ( 例如传入年就是精确到年 ) * @ return 如果指定日期在当前时间之前返回 < code > true < / code > */ public static boolean beforeNow ( String date , String format , DateUnit dateUnit ) { } }
logger . debug ( "指定日期为:{}" , date ) ; return calc ( new Date ( ) , parse ( date , format ) , dateUnit ) > 0 ;
public class MySqlDdlParser { /** * { @ inheritDoc } * @ see org . modeshape . sequencer . ddl . StandardDdlParser # parseAlterTableStatement ( org . modeshape . sequencer . ddl . DdlTokenStream , * org . modeshape . sequencer . ddl . node . AstNode ) */ @ Override protected AstNode parseAlterTableStatement ( DdlTo...
assert tokens != null ; assert parentNode != null ; // TODO : /* ALTER [ ONLINE | OFFLINE ] [ IGNORE ] TABLE tbl _ name alter _ specification [ , alter _ specification ] . . . alter _ specification : table _ options | ADD [ COLUMN ] col _ name column _ definition [ FIRST | AFTER col _ name ] | ADD [ COLUMN ...
public class ConverterSet { /** * Returns a copy of this set , with the given converter removed . If the * converter was not in the set , the original set is returned . * @ param converter converter to remove , must not be null * @ param removed if not null , element 0 is set to the removed converter * @ throws...
Converter [ ] converters = iConverters ; int length = converters . length ; for ( int i = 0 ; i < length ; i ++ ) { if ( converter . equals ( converters [ i ] ) ) { return remove ( i , removed ) ; } } // Not found . if ( removed != null ) { removed [ 0 ] = null ; } return this ;
public class ImportMatrixXML { public Matrix read ( Reader reader ) throws ParserConfigurationException , SAXException , IOException { } }
SAXParserFactory spf = SAXParserFactory . newInstance ( ) ; spf . setNamespaceAware ( true ) ; SAXParser saxParser = spf . newSAXParser ( ) ; XMLReader xmlReader = saxParser . getXMLReader ( ) ; UJMPContentHandler contentHandler = new UJMPContentHandler ( ) ; xmlReader . setContentHandler ( contentHandler ) ; xmlReader...
public class RocksDBIncrementalCheckpointUtils { /** * Choose the best state handle according to the { @ link # STATE _ HANDLE _ EVALUATOR } * to init the initial db . * @ param restoreStateHandles The candidate state handles . * @ param targetKeyGroupRange The target key group range . * @ return The best candi...
KeyedStateHandle bestStateHandle = null ; double bestScore = 0 ; for ( KeyedStateHandle rawStateHandle : restoreStateHandles ) { double handleScore = STATE_HANDLE_EVALUATOR . apply ( rawStateHandle , targetKeyGroupRange ) ; if ( handleScore > bestScore ) { bestStateHandle = rawStateHandle ; bestScore = handleScore ; } ...
public class WApplication { /** * { @ inheritDoc } */ @ Override public String getNamingContextId ( ) { } }
boolean append = isAppendID ( ) ; if ( ! append ) { // Check if this is the top level name context NamingContextable top = WebUtilities . getParentNamingContext ( this ) ; if ( top != null ) { // Not top context , so always append append = true ; } } if ( append ) { return getId ( ) ; } else { return "" ; }
public class WAB { /** * and kicks off the collision resolution process */ Event createFailedEvent ( Throwable t ) { } }
synchronized ( terminated ) { if ( terminated . get ( ) ) { return null ; } if ( setState ( State . FAILED ) ) { installer . removeWabFromEligibleForCollisionResolution ( this ) ; installer . attemptRedeployOfPreviouslyCollidedContextPath ( this . wabContextPath ) ; return createEvent ( State . FAILED , t , null , null...
public class ConversationState { /** * setConnectionObjectId - sets and stores the connection object id * @ param connectionObjectId */ public void setConnectionObjectId ( short connectionObjectId ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setConnectionObjectId" , Short . valueOf ( connectionObjectId ) ) ; this . connectionObjectId = connectionObjectId ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc...
public class Pause { /** * Enter admin mode * @ param ctx Internal parameter . Not user - accessible . * @ return Standard STATUS table . */ public VoltTable [ ] run ( SystemProcedureExecutionContext ctx ) { } }
// Choose the lowest site ID on this host to actually flip the bit if ( ctx . isLowestSiteId ( ) ) { VoltDBInterface voltdb = VoltDB . instance ( ) ; OperationMode opMode = voltdb . getMode ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "voltdb opmode is " + opMode ) ; } ZooKeeper zk = voltdb . getHostMessenger ...
public class ByteUtil { /** * Calculate the number of bytes need to encode the number * @ param val * - number * @ return number of min bytes used to encode the number */ public static int numBytes ( String val ) { } }
BigInteger bInt = new BigInteger ( val ) ; int bytes = 0 ; while ( ! bInt . equals ( BigInteger . ZERO ) ) { bInt = bInt . shiftRight ( 8 ) ; ++ bytes ; } if ( bytes == 0 ) ++ bytes ; return bytes ;
public class ByteBufQueue { /** * Creates and returns a ByteBuf which contains all bytes from the * queue ' s first ByteBuf if the latter contains { @ code exactSize } of bytes . * Then { @ code first } index is increased by 1 or set to the value 0 if it * has run a full circle of the queue . * Otherwise create...
assert hasRemainingBytes ( exactSize ) ; if ( exactSize == 0 ) return ByteBuf . empty ( ) ; ByteBuf buf = bufs [ first ] ; if ( buf . readRemaining ( ) == exactSize ) { first = next ( first ) ; return buf ; } else if ( exactSize < buf . readRemaining ( ) ) { ByteBuf result = buf . slice ( exactSize ) ; buf . moveHead (...
public class ExecutionChain { /** * Start the chain of execution running . * @ throws IllegalStateException * if the chain of execution has already been started . */ public void execute ( ) { } }
State currentState = state . getAndSet ( State . RUNNING ) ; if ( currentState == State . RUNNING ) { throw new IllegalStateException ( "ExecutionChain is already running!" ) ; } executeRunnable = new ExecuteRunnable ( ) ;
public class EncryptionMaterials { /** * Fluent API to add material description . */ public EncryptionMaterials addDescription ( String name , String value ) { } }
desc . put ( name , value ) ; return this ;
public class Formats { /** * Attempts to extract a name of a missing class loader dependency from an exception such as { @ link NoClassDefFoundError } or { @ link ClassNotFoundException } . */ public static String getNameOfMissingClassLoaderDependency ( Throwable e ) { } }
if ( e instanceof NoClassDefFoundError ) { // NoClassDefFoundError sometimes includes CNFE as the cause . Since CNFE has a better formatted class name // and may also include classloader info , we prefer CNFE ' s over NCDFE ' s message . if ( e . getCause ( ) instanceof ClassNotFoundException ) { return getNameOfMissin...
public class DocumentTemplateRepository { /** * Returns all document templates , ordered by most specific to provided application tenancy first , and then by date ( desc ) . */ public List < DocumentTemplate > findByApplicableToAtPath ( final String atPath ) { } }
final List < DocumentTemplate > templates = repositoryService . allMatches ( new QueryDefault < > ( DocumentTemplate . class , "findByApplicableToAtPath" , "atPath" , atPath ) ) ; removeTemplatesWithSameDocumentType ( templates ) ; return templates ;
public class CSLTool { /** * Sets the command to execute * @ param command the command */ @ CommandDescList ( { } }
@ CommandDesc ( longName = "bibliography" , description = "generate a bibliography" , command = BibliographyCommand . class ) , @ CommandDesc ( longName = "citation" , description = "generate citations" , command = CitationCommand . class ) , @ CommandDesc ( longName = "list" , description = "display sorted list of ava...
public class ShanksAgentMovementCapability { /** * Update the location of the agent in the simulation * @ param simulation * @ param agent * @ param location */ private static void updateLocation ( ShanksSimulation simulation , MobileShanksAgent agent , Double2D location ) { } }
agent . getCurrentLocation ( ) . setLocation2D ( location ) ; ContinuousPortrayal2D devicesPortrayal ; try { devicesPortrayal = ( ContinuousPortrayal2D ) simulation . getScenarioPortrayal ( ) . getPortrayals ( ) . get ( Scenario3DPortrayal . MAIN_DISPLAY_ID ) . get ( ScenarioPortrayal . DEVICES_PORTRAYAL ) ; Continuous...
public class TSProcessor { /** * Computes the median value of timeseries . * @ param series The timeseries . * @ return The median value . */ public double median ( double [ ] series ) { } }
double [ ] clonedSeries = series . clone ( ) ; Arrays . sort ( clonedSeries ) ; double median ; if ( clonedSeries . length % 2 == 0 ) { median = ( clonedSeries [ clonedSeries . length / 2 ] + ( double ) clonedSeries [ clonedSeries . length / 2 - 1 ] ) / 2 ; } else { median = clonedSeries [ clonedSeries . length / 2 ] ;...
public class CPFriendlyURLEntryPersistenceImpl { /** * Returns an ordered range of all the cp friendly url entries where groupId = & # 63 ; and classNameId = & # 63 ; and classPK = & # 63 ; and main = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code...
return findByG_C_C_M ( groupId , classNameId , classPK , main , start , end , orderByComparator , true ) ;
public class DescribeVolumesModificationsRequest { /** * The IDs of the volumes for which in - progress modifications will be described . * @ param volumeIds * The IDs of the volumes for which in - progress modifications will be described . */ public void setVolumeIds ( java . util . Collection < String > volumeIds...
if ( volumeIds == null ) { this . volumeIds = null ; return ; } this . volumeIds = new com . amazonaws . internal . SdkInternalList < String > ( volumeIds ) ;
public class WarUtils { /** * Removes elements by a specified tag name from the xml Element passed in . * @ param doc The xml Element to remove from . * @ param tagname The tag name to remove . */ public static void removeNodesByTagName ( Element doc , String tagname ) { } }
NodeList nodes = doc . getElementsByTagName ( tagname ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; i ++ ) { Node n = nodes . item ( i ) ; doc . removeChild ( n ) ; }
public class GitlabAPI { /** * Get JIRA service settings for a project . * https : / / docs . gitlab . com / ce / api / services . html # get - jira - service - settings * @ param projectId The ID of the project containing the variable . * @ return * @ throws IOException on gitlab api call error */ public Gitla...
String tailUrl = GitlabProject . URL + "/" + projectId + GitlabServiceJira . URL ; return retrieve ( ) . to ( tailUrl , GitlabServiceJira . class ) ;
public class Pubsub { /** * Create a Pub / Sub topic . * @ param canonicalTopic The canonical ( including project ) name of the topic to create . * @ return A future that is completed when this request is completed . */ private PubsubFuture < Topic > createTopic ( final String canonicalTopic ) { } }
validateCanonicalTopic ( canonicalTopic ) ; return put ( "create topic" , canonicalTopic , NO_PAYLOAD , readJson ( Topic . class ) ) ;
public class AsynchronousRequest { /** * For more info on continents API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / continents " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } m...
isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getContinentFloorInfo ( Integer . toString ( continentID ) , processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ;
public class DockerCloud { /** * Counts the number of instances in Docker currently running that are using the specified template . * @ param template If null , then all instances are counted . */ public int countCurrentDockerSlaves ( final DockerSlaveTemplate template ) throws Exception { } }
int count = 0 ; List < Container > containers = getClient ( ) . listContainersCmd ( ) . exec ( ) ; for ( Container container : containers ) { final Map < String , String > labels = container . getLabels ( ) ; if ( labels . containsKey ( DOCKER_CLOUD_LABEL ) && labels . get ( DOCKER_CLOUD_LABEL ) . equals ( getDisplayNa...
public class StencilOperands { /** * Test if left < = right . * @ param left * first value * @ param right * second value * @ return test result . */ public boolean lessThanOrEqual ( Object left , Object right ) { } }
if ( left == right ) { return true ; } else if ( left == null || right == null ) { return false ; } else { return compare ( left , right , "<=" ) <= 0 ; }
public class CHFWBundle { /** * DS method to set a factory provider . * @ param provider */ @ Reference ( service = ChannelFactoryProvider . class , cardinality = ReferenceCardinality . MULTIPLE , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) protected void setFactoryProvider ( ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Add factory provider; " + provider ) ; } this . chfw . registerFactories ( provider ) ;
public class MavenJDOMWriter { /** * Method updateBuildBase . * @ param value * @ param element * @ param counter * @ param xmlTag */ protected void updateBuildBase ( BuildBase value , String xmlTag , Counter counter , Element element ) { } }
boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "defaultGoal" , value . getDefaultGoal ( ) , null ) ; iterateResource...
public class Article { /** * Gets the value of the paginationOrELocationID property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < /...
if ( paginationOrELocationID == null ) { paginationOrELocationID = new ArrayList < java . lang . Object > ( ) ; } return this . paginationOrELocationID ;
public class MCMPInfoUtil { /** * / * matches constants defined in mod _ cluster - 1.3.7 . Final / native / include / context . h */ static int formatStatus ( Context . Status status ) { } }
return status == Context . Status . ENABLED ? 1 : status == Context . Status . DISABLED ? 2 : status == Context . Status . STOPPED ? 3 : - 1 ;
public class CreateFunctionRequest { /** * A list of < a href = " https : / / docs . aws . amazon . com / lambda / latest / dg / configuration - layers . html " > function layers < / a > to * add to the function ' s execution environment . Specify each layer by its ARN , including the version . * @ param layers *...
if ( layers == null ) { this . layers = null ; return ; } this . layers = new com . amazonaws . internal . SdkInternalList < String > ( layers ) ;
public class CommerceNotificationQueueEntryUtil { /** * Returns a range of all the commerce notification queue entries where sentDate & lt ; & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not prim...
return getPersistence ( ) . findByLtS ( sentDate , start , end ) ;
public class CommercePriceListLocalServiceWrapper { /** * Returns the commerce price list matching the UUID and group . * @ param uuid the commerce price list ' s UUID * @ param groupId the primary key of the group * @ return the matching commerce price list * @ throws PortalException if a matching commerce pri...
return _commercePriceListLocalService . getCommercePriceListByUuidAndGroupId ( uuid , groupId ) ;
public class MultiUserChatLight { /** * Set the room configurations . * @ param customConfigs * @ throws NoResponseException * @ throws XMPPErrorException * @ throws NotConnectedException * @ throws InterruptedException */ public void setRoomConfigs ( HashMap < String , String > customConfigs ) throws NoRespo...
setRoomConfigs ( null , customConfigs ) ;
public class CmsDataViewPanel { /** * Gets the check box for the item with the given id . < p > * @ param id the item id * @ return the check box */ private CheckBox getCheckBox ( Object id ) { } }
if ( ! m_checkBoxes . containsKey ( id ) ) { m_checkBoxes . put ( id , new CheckBox ( ) ) ; } return m_checkBoxes . get ( id ) ;
public class TransactionWriteRequest { /** * Adds delete operation ( to be executed on the object represented by key ) to the list of transaction write operations . * transactionWriteExpression is used to conditionally delete the object represented by key . * returnValuesOnConditionCheckFailure specifies which attr...
transactionWriteOperations . add ( new TransactionWriteOperation ( key , TransactionWriteOperationType . Delete , transactionWriteExpression , returnValuesOnConditionCheckFailure ) ) ; return this ;
public class AnnotationVisitor { /** * Visits an annotation by breaking it down into its components and calling * various other visit methods . * @ param value Initial Annotation to visit * @ param param custom parameter * @ return custom result , null by default */ public final R visit ( Annotation value , P p...
return visit ( null , 0 , value , param ) ;
public class CmsAliasManager { /** * Gets the list of aliases for a path in a given site . < p > * This should only return either an empty list or a list with a single element . * @ param cms the current CMS context * @ param siteRoot the site root for which we want the aliases * @ param aliasPath the alias pat...
CmsAlias alias = m_securityManager . readAliasByPath ( cms . getRequestContext ( ) , siteRoot , aliasPath ) ; if ( alias == null ) { return Collections . emptyList ( ) ; } else { return Collections . singletonList ( alias ) ; }
public class POIUtils { /** * 結合を考慮してセルの罫線 ( 上部 ) を取得する 。 * @ param cell セル * @ return { @ literal BorderStyle } * @ throws IllegalArgumentException { @ literal cell is null . } */ public static BorderStyle getBorderTop ( final Cell cell ) { } }
ArgUtils . notNull ( cell , "cell" ) ; final Sheet sheet = cell . getSheet ( ) ; CellRangeAddress mergedRegion = getMergedRegion ( sheet , cell . getRowIndex ( ) , cell . getColumnIndex ( ) ) ; final Cell target ; if ( mergedRegion == null ) { // 結合されていない場合 target = cell ; } else { if ( mergedRegion . getFirstRow ( ) =...
public class OneSelect { /** * Method used to append to the from part of an SQL statement . * @ param _ select SQL select wrapper * @ throws EFapsException on error */ public void append2SQLFrom ( final SQLSelect _select ) throws EFapsException { } }
// for attributes it must be evaluated if the attribute is inside a child table if ( this . valueSelect != null && "attribute" . equals ( this . valueSelect . getValueType ( ) ) ) { final Type type ; if ( this . selectParts . size ( ) > 0 ) { type = this . selectParts . get ( this . selectParts . size ( ) - 1 ) . getTy...
public class CmsDbPoolV11 { /** * If str starts with prefix + ' . ' , return the remaining part , otherwise return null . < p > * @ param prefix the prefix * @ param str the string to remove the prefix from * @ return str with the prefix removed , or null if it didn ' t start with prefix + ' . ' */ public static ...
String realPrefix = prefix + "." ; if ( str . startsWith ( realPrefix ) ) { return str . substring ( realPrefix . length ( ) ) ; } return null ;
public class Matcher { /** * Sets the current search position just after the end of last match . */ public void skip ( ) { } }
int we = wEnd ; if ( wOffset == we ) { // requires special handling // if no variants at ' wOutside ' , advance pointer and clear if ( top == null ) { wOffset ++ ; flush ( ) ; } // otherwise , if there exist a variant , // don ' t clear ( ) , i . e . allow it to match return ; } else { if ( we < 0 ) wOffset = 0 ; else ...
public class NetUtil { /** * 测试端口是否空闲可用 , from Spring SocketUtils */ public static boolean isPortAvailable ( int port ) { } }
try { ServerSocket serverSocket = ServerSocketFactory . getDefault ( ) . createServerSocket ( port , 1 , InetAddress . getByName ( "localhost" ) ) ; serverSocket . close ( ) ; return true ; } catch ( Exception ex ) { // NOSONAR return false ; }
public class CmsModuleImportExportHandler { /** * Gets the module export handler containing all resources used in the module export . < p > * @ param cms the { @ link CmsObject } used by to set up the handler . The object ' s site root might be adjusted to the import site of the module . * @ param module The module...
// check if all resources are valid List < String > resListCopy = new ArrayList < String > ( ) ; String moduleName = module . getName ( ) ; try { cms = OpenCms . initCmsObject ( cms ) ; String importSite = module . getSite ( ) ; if ( ! CmsStringUtil . isEmptyOrWhitespaceOnly ( importSite ) ) { cms . getRequestContext (...
public class TypesafeConfigUtils { /** * Load , Parse & Resolve configurations from a file , specifying parse & resolve options . * @ param parseOptions * @ param resolveOptions * @ param configFile * @ return */ public static Config loadConfig ( ConfigParseOptions parseOptions , ConfigResolveOptions resolveOpt...
return loadConfig ( parseOptions , resolveOptions , new File ( configFile ) ) ;
public class FactoryMultiView { /** * Created an estimator for the P3P problem that selects a single solution by considering additional * observations . * < p > NOTE : Observations are in normalized image coordinates NOT pixels . < / p > * NOTE : EPnP has several tuning parameters and the defaults here might not ...
if ( which == EnumPNP . EPNP ) { PnPLepetitEPnP alg = new PnPLepetitEPnP ( 0.1 ) ; alg . setNumIterations ( numIterations ) ; return new WrapPnPLepetitEPnP ( alg ) ; } else if ( which == EnumPNP . IPPE ) { Estimate1ofEpipolar H = FactoryMultiView . homographyTLS ( ) ; return new IPPE_to_EstimatePnP ( H ) ; } FastQueue ...
public class BitmapIterationBenchmark { /** * This main ( ) is for debugging from the IDE . */ public static void main ( String [ ] args ) { } }
BitmapIterationBenchmark state = new BitmapIterationBenchmark ( ) ; state . bitmapAlgo = "concise" ; state . prob = 0.001 ; state . size = 1000000 ; state . setup ( ) ; BitmapsForIntersection state2 = new BitmapsForIntersection ( ) ; state2 . setup ( state ) ; state . intersectionAndIter ( state2 ) ;
public class OpenSSLFactory { /** * Sets the protocol : + SSLv3 */ public void setProtocol ( String protocol ) throws ConfigException { } }
_protocol = protocol ; String [ ] values = Pattern . compile ( "\\s+" ) . split ( protocol ) ; int protocolFlags = _defaultProtocolFlags ; for ( int i = 0 ; i < values . length ; i ++ ) { if ( values [ i ] . equalsIgnoreCase ( "+all" ) ) { protocolFlags = ~ 0 ; } else if ( values [ i ] . equalsIgnoreCase ( "-all" ) ) {...
public class Chunks { /** * turn this chunked array into a regular int - array , mostly for compatibility * cuts off unused space at the end */ public int [ ] mergeChunks ( ) { } }
int filledChunks = getFilledChunks ( ) ; int [ ] merged = new int [ size ( ) ] ; for ( int i = 0 ; i < filledChunks ; i ++ ) { if ( chunks [ i ] != null ) { System . arraycopy ( chunks [ i ] , 0 , merged , i * chunkSize , chunkSize ) ; } } int remainder = size ( ) % chunkSize ; if ( remainder != 0 && chunks [ filledChu...
public class DeferredSound { /** * Play this sound as a sound effect * @ param pitch The pitch of the play back * @ param gain The gain of the play back * @ param loop True if we should loop * @ param x The x position of the sound * @ param y The y position of the sound * @ param z The z position of the sou...
checkTarget ( ) ; return target . playAsSoundEffect ( pitch , gain , loop , x , y , z ) ;
public class AbstractCacheService { /** * Sends an invalidation event for given < code > cacheName < / code > with specified < code > key < / code > * from mentioned source with < code > sourceUuid < / code > . * @ param cacheNameWithPrefix the name of the cache that invalidation event is sent for * @ param key t...
cacheEventHandler . sendInvalidationEvent ( cacheNameWithPrefix , key , sourceUuid ) ;
public class RegisteredServiceAccessStrategyUtils { /** * Ensure service access is allowed . * @ param service the service * @ param registeredService the registered service * @ param authentication the authentication * @ param retrievePrincipalAttributesFromReleasePolicy retrieve attributes from release policy...
ensureServiceAccessIsAllowed ( service , registeredService ) ; val principal = authentication . getPrincipal ( ) ; val principalAttrs = retrievePrincipalAttributesFromReleasePolicy && registeredService != null && registeredService . getAttributeReleasePolicy ( ) != null ? registeredService . getAttributeReleasePolicy (...
public class HPackHuffman { /** * Decodes a huffman encoded string into the target StringBuilder . There must be enough space left in the buffer * for this method to succeed . * @ param data The byte buffer * @ param length The data length * @ param target The target for the decompressed data */ public static v...
assert data . remaining ( ) >= length ; int treePos = 0 ; boolean eosBits = true ; int eosCount = 0 ; for ( int i = 0 ; i < length ; ++ i ) { byte b = data . get ( ) ; int bitPos = 7 ; while ( bitPos >= 0 ) { int val = DECODING_TABLE [ treePos ] ; if ( ( ( 1 << bitPos ) & b ) == 0 ) { // bit not set , we want the lower...
public class VpnSitesConfigurationsInner { /** * Gives the sas - url to download the configurations for vpn - sites in a resource group . * @ param resourceGroupName The resource group name . * @ param virtualWANName The name of the VirtualWAN for which configuration of all vpn - sites is needed . * @ param reque...
return ServiceFuture . fromResponse ( beginDownloadWithServiceResponseAsync ( resourceGroupName , virtualWANName , request ) , serviceCallback ) ;
public class AuditingInterceptor { /** * Return the access type for this request * @ param theServletRequest * the incoming request * @ return the SecurityEventSourceTypeEnum representing the type of request being made */ protected List < CodingDt > getAccessType ( HttpServletRequest theServletRequest ) { } }
List < CodingDt > types = new ArrayList < CodingDt > ( ) ; if ( theServletRequest . getHeader ( Constants . HEADER_AUTHORIZATION ) != null && theServletRequest . getHeader ( Constants . HEADER_AUTHORIZATION ) . startsWith ( "OAuth" ) ) { types . add ( new CodingDt ( SecurityEventSourceTypeEnum . USER_DEVICE . getSystem...
public class HttpSupport { /** * This method will send the text to a client verbatim . It will not use any layouts . Use it to build app . services * and to support AJAX . * @ param text text of response . * @ return { @ link HttpSupport . HttpBuilder } , to accept additional information . */ protected HttpBuilde...
if ( text == null ) { text = "null" ; } DirectResponse resp = new DirectResponse ( text ) ; RequestContext . setControllerResponse ( resp ) ; return new HttpBuilder ( resp ) ;
public class InterceptorChain { /** * Returns all the interceptors that have the fully qualified name of their class equal with the supplied class * name . */ public List < CommandInterceptor > getInterceptorsWithClass ( Class clazz ) { } }
ArrayList < CommandInterceptor > list = new ArrayList < > ( asyncInterceptorChain . getInterceptors ( ) . size ( ) ) ; asyncInterceptorChain . getInterceptors ( ) . forEach ( ci -> { if ( clazz == ci . getClass ( ) ) { list . add ( ( CommandInterceptor ) ci ) ; } } ) ; return list ;
public class QueueContainer { /** * Returns the item queue on the partition owner . This method * will also move the items from the backup map if this * member has been promoted from a backup replica to the * partition owner and clear the backup map . * @ return the item queue */ public Deque < QueueItem > getI...
if ( itemQueue == null ) { itemQueue = new LinkedList < QueueItem > ( ) ; if ( backupMap != null && ! backupMap . isEmpty ( ) ) { List < QueueItem > values = new ArrayList < QueueItem > ( backupMap . values ( ) ) ; Collections . sort ( values ) ; itemQueue . addAll ( values ) ; QueueItem lastItem = itemQueue . peekLast...
public class BooleanUtils { /** * < p > Performs an or on a set of booleans . < / p > * < pre > * BooleanUtils . or ( true , true ) = true * BooleanUtils . or ( false , false ) = false * BooleanUtils . or ( true , false ) = true * BooleanUtils . or ( true , true , false ) = true * BooleanUtils . or ( true ,...
// Validates input if ( array == null ) { throw new IllegalArgumentException ( "The Array must not be null" ) ; } if ( array . length == 0 ) { throw new IllegalArgumentException ( "Array is empty" ) ; } for ( final boolean element : array ) { if ( element ) { return true ; } } return false ;
public class ReduceInit { /** * < 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 > specify a primitive value like a String or a Number as the initial value of the ...
CollectExpression collXpr = ( CollectExpression ) this . astNode ; ReduceEvalExpression reduceEval = ( ReduceEvalExpression ) ( collXpr ) . getEvalExpression ( ) ; reduceEval . setInitialValue ( value ) ; return new CTerminal ( collXpr ) ;
public class EnvLoader { /** * Returns the local environment . */ public static EnvironmentClassLoader getEnvironmentClassLoader ( ClassLoader loader ) { } }
for ( ; loader != null ; loader = loader . getParent ( ) ) { if ( loader instanceof EnvironmentClassLoader ) return ( EnvironmentClassLoader ) loader ; } return null ;
public class KeenClient { /** * Synchronously sends all queued events for the given project . This method will immediately * publish the events to the Keen server in the current thread . * @ param project The project for which to send queued events . If a default project has been set * on the client this paramete...
if ( ! isActive ) { handleLibraryInactive ( callback ) ; return ; } if ( project == null && defaultProject == null ) { handleFailure ( null , new IllegalStateException ( "No project specified, but no default project found" ) ) ; return ; } if ( ! isNetworkConnected ( ) ) { KeenLogging . log ( "Not sending events becaus...
public class DefaultOutputConnection { /** * Handles a connection pause . */ private void doPause ( long id ) { } }
log . debug ( String . format ( "%s - Paused connection to %s" , this , context . target ( ) ) ) ; paused = true ;
public class VTimeZone { /** * Convert the rule to its equivalent rule using WALL _ TIME mode */ private static DateTimeRule toWallTimeRule ( DateTimeRule rule , int rawOffset , int dstSavings ) { } }
if ( rule . getTimeRuleType ( ) == DateTimeRule . WALL_TIME ) { return rule ; } int wallt = rule . getRuleMillisInDay ( ) ; if ( rule . getTimeRuleType ( ) == DateTimeRule . UTC_TIME ) { wallt += ( rawOffset + dstSavings ) ; } else if ( rule . getTimeRuleType ( ) == DateTimeRule . STANDARD_TIME ) { wallt += dstSavings ...
public class AutomationExecution { /** * The combination of AWS Regions and / or AWS accounts where you want to run the Automation . * @ return The combination of AWS Regions and / or AWS accounts where you want to run the Automation . */ public java . util . List < TargetLocation > getTargetLocations ( ) { } }
if ( targetLocations == null ) { targetLocations = new com . amazonaws . internal . SdkInternalList < TargetLocation > ( ) ; } return targetLocations ;
public class OpenALMODPlayer { /** * Stream one section from the mod / xm into an OpenAL buffer * @ param bufferId The ID of the buffer to fill * @ return True if another section was available */ public boolean stream ( int bufferId ) { } }
int frames = sectionSize ; boolean reset = false ; boolean more = true ; if ( frames > songDuration ) { frames = songDuration ; reset = true ; } ibxm . get_audio ( data , frames ) ; bufferData . clear ( ) ; bufferData . put ( data ) ; bufferData . limit ( frames * 4 ) ; if ( reset ) { if ( loop ) { ibxm . seek ( 0 ) ; ...
public class Transform { /** * Return the Transform dictionary object of an element , but reseting * historical values and setting them to the initial value passed . */ public static Transform getInstance ( Element e , String initial ) { } }
Transform t = GQuery . data ( e , TRANSFORM ) ; if ( t == null || initial != null ) { if ( initial == null ) { initial = GQuery . getSelectorEngine ( ) . getDocumentStyleImpl ( ) . curCSS ( e , transform , false ) ; } t = new Transform ( initial ) ; GQuery . data ( e , TRANSFORM , t ) ; } return t ;
public class Auth { /** * Returns a Cookie object by retrieving data from - Dcookie maven parameter . * @ param domainUrl * the domain on which the cookie is applied * @ return a Cookie with a name , value , domain and path . * @ throws TechnicalException * with a message ( no screenshot , no exception ) */ p...
if ( getInstance ( ) . authCookie == null ) { final String cookieStr = System . getProperty ( SESSION_COOKIE ) ; try { if ( cookieStr != null && ! "" . equals ( cookieStr ) ) { final int indexValue = cookieStr . indexOf ( '=' ) ; final int indexPath = cookieStr . indexOf ( ",path=" ) ; final String cookieName = cookieS...
public class ModalRenderer { /** * This methods generates the HTML code of the current b : modal . * < code > encodeBegin < / code > generates the start of the component . After the , * the JSF framework calls < code > encodeChildren ( ) < / code > to generate the * HTML code between the beginning and the end of ...
if ( ! component . isRendered ( ) ) { return ; } /* * < div id = " myModal " class = " modal fade " tabindex = " - 1 " role = " dialog " * aria - labelledby = " myModalLabel " > < div * class = " modal - dialog " > < div class = " modal - content " > < div * class = " modal - header " > < button type = " button "...
public class ICUHumanize { /** * Same as { @ link # dateFormatInstance ( String ) dateFormatInstance } for the * specified locale . * @ param pattern * Format pattern that follows the conventions of * { @ link com . ibm . icu . text . DateFormat DateFormat } * @ param locale * Target locale * @ return a D...
return withinLocale ( new Callable < DateFormat > ( ) { public DateFormat call ( ) throws Exception { return dateFormatInstance ( pattern ) ; } } , locale ) ;
public class Light { /** * Sets light color * < p > NOTE : you can also use colorless light with shadows , e . g . ( 0,0,0,1) * @ param newColor * RGB set the color and Alpha set intensity * @ see # setColor ( float , float , float , float ) */ public void setColor ( Color newColor ) { } }
if ( newColor != null ) { color . set ( newColor ) ; } else { color . set ( DefaultColor ) ; } colorF = color . toFloatBits ( ) ; if ( staticLight ) dirty = true ;
public class U { /** * Documented , # min */ public static < E extends Comparable < ? super E > > E min ( final Collection < E > collection ) { } }
return Collections . min ( collection ) ;
public class MutationsUtil { /** * Performs a comprehensive translation of mutations present in a nucleotide sequence to effective mutations in * corresponding amino acid sequence . * < p > The resulting array contains : < / p > * < ul > < li > the original nucleotide mutation < / li > < li > " individual " amino...
MutationsWitMapping mutationsWitMapping = nt2aaWithMapping ( seq1 , mutations , translationParameters , maxShiftedTriplets ) ; int [ ] individualMutations = nt2IndividualAA ( seq1 , mutations , translationParameters ) ; MutationNt2AADescriptor [ ] result = new MutationNt2AADescriptor [ mutations . size ( ) ] ; for ( in...
public class Element { /** * Determines if the element is a select . * @ param action - what action is occurring * @ param expected - what is the expected result * @ return Boolean : is the element enabled ? */ private boolean isSelect ( String action , String expected ) { } }
// wait for element to be displayed if ( ! is . select ( ) ) { reporter . fail ( action , expected , Element . CANT_SELECT + prettyOutput ( ) + NOT_A_SELECT ) ; // indicates element not an input return false ; } return true ;
public class SAXmyHtmlHandler { /** * This method gets called when an end tag is encountered . * @ param uri * the Uniform Resource Identifier * @ param lname * the local name ( without prefix ) , or the empty string if * Namespace processing is not being performed . * @ param name * the name of the tag t...
// System . err . println ( " End : " + name ) ; name = name . toLowerCase ( ) ; if ( ElementTags . PARAGRAPH . equals ( name ) ) { try { document . add ( ( Element ) stack . pop ( ) ) ; return ; } catch ( DocumentException e ) { throw new ExceptionConverter ( e ) ; } } if ( HtmlTagMap . isHead ( name ) ) { // we do no...