signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TiffReader { /** * Gets the result of the validation . * @ param profile the TiffIT profile ( 0 : default , 1 : P1 , 2 : P2) * @ return the validation result */ public ValidationResult getTiffITValidation ( int profile ) { } }
TiffITProfile bpit = new TiffITProfile ( tiffModel , profile ) ; bpit . validate ( ) ; return bpit . getValidation ( ) ;
public class _ClassUtils { /** * Gets the ClassLoader associated with the current thread . Returns the class loader associated with the specified * default object if no context loader is associated with the current thread . * @ return ClassLoader */ protected static ClassLoader getContextClassLoader ( ) { } }
if ( System . getSecurityManager ( ) != null ) { try { Object cl = AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws PrivilegedActionException { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } } ) ; return ( ClassLoader ) cl ; } catch ( PrivilegedAction...
public class ListSkillsStoreCategoriesResult { /** * The list of categories . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCategoryList ( java . util . Collection ) } or { @ link # withCategoryList ( java . util . Collection ) } if you want to * overr...
if ( this . categoryList == null ) { setCategoryList ( new java . util . ArrayList < Category > ( categoryList . length ) ) ; } for ( Category ele : categoryList ) { this . categoryList . add ( ele ) ; } return this ;
public class AstyanaxEventReaderDAO { /** * Reads the ordered manifest for a channel . The read can either be weak or strong . A weak read will use CL1 * and may use the cached oldest slab from a previous strong call to improve performance . A strong read will use * CL local _ quorum and will always read the entire...
final ByteBuffer oldestSlab = weak ? _oldestSlab . getIfPresent ( channel ) : null ; final ConsistencyLevel consistency ; RangeBuilder range = new RangeBuilder ( ) . setLimit ( 50 ) ; if ( oldestSlab != null ) { range . setStart ( oldestSlab ) ; consistency = ConsistencyLevel . CL_LOCAL_ONE ; } else { consistency = Con...
public class SibRaConnectionFactory { /** * Creates a connection to a messaging engine . The creation is delegated to * the JCA connection manager . This either creates a new managed connection * or finds an existing one that matches this request . The connection * manager obtains a connection handle to the manag...
if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "createConnection" , new Object [ ] { SibRaUtils . subjectToString ( subject ) , connectionProperties } ) ; } final ConnectionRequestInfo connectionRequestInfo = new SibRaConnectionRequestInfo ( subject , connectionProperties ) ; final SibRaConnection r...
public class DeviceImpl { /** * Get device black box . * It ' s the master method executed when the device black box is requested . * It reads the device black box , update it and return black - box data to the * client * @ param n * The number of actions description which must be returned to * the client ....
Util . out4 . println ( "DeviceImpl.black_box() arrived" ) ; final String [ ] ret = blackbox . read ( n ) ; // Record operation request in black box blackbox . insert_op ( Op_BlackBox ) ; Util . out4 . println ( "Leaving DeviceImpl.black_box()" ) ; return ret ;
public class JxnetAutoConfiguration { /** * Thread pool . * @ return returns { @ link ExecutorService } object . */ @ Bean ( EXECUTOR_SERVICE_BEAN_NAME ) public ExecutorService executorService ( ) { } }
if ( this . properties . getNumberOfThread ( ) == 0 ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Use cached thread pool." ) ; } return Executors . newCachedThreadPool ( ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Use {} fixed thread pool." , this . properties . getNumberOfThread ( ) ) ; }...
public class SystemClock { /** * Waits a given number of milliseconds ( of uptimeMillis ) before returning . * Similar to { @ link java . lang . Thread # sleep ( long ) } , but does not throw * { @ link InterruptedException } ; { @ link Thread # interrupt ( ) } events are * deferred until the next interruptible o...
long start = uptimeMillis ( ) ; long duration = ms ; boolean interrupted = false ; do { try { Thread . sleep ( duration ) ; } catch ( InterruptedException e ) { interrupted = true ; } duration = start + ms - uptimeMillis ( ) ; } while ( duration > 0 ) ; if ( interrupted ) { // Important : we don ' t want to quietly eat...
public class ExceptionSwallower { /** * Transform a Runnable to log and then swallow any thrown exceptions . However , { @ link Error } s are still re - thrown . * @ param in the runnable to wrap * @ return a runnable that will swallow exceptions */ @ SuppressWarnings ( { } }
"PMD.AvoidCatchingThrowable" , "PMD.AvoidInstanceofChecksInCatchClause" } ) public static Runnable swallowExceptions ( Runnable in ) { return ( ) -> { try { in . run ( ) ; } catch ( Error tt ) { LOGGER . error ( "Error (will be rethrown)" , tt ) ; throw tt ; } catch ( Throwable t ) { LOGGER . error ( "Uncaught exceptio...
public class ICalParameters { /** * Gets the FBTYPE ( free busy type ) parameter value . * This parameter is used by the { @ link FreeBusy } property . It defines * whether the person is " free " or " busy " over the time periods that are * specified in the property value . If this parameter is not set , the user...
String value = first ( FBTYPE ) ; return ( value == null ) ? null : FreeBusyType . get ( value ) ;
public class JGTProcessingRegion { /** * Transforms the GRASS bounds strings in metric or degree to decimal . * @ param north the north string . * @ param south the south string . * @ param east the east string . * @ param west the west string . * @ return the array of the bounds in doubles . */ @ SuppressWar...
double no = - 1.0 ; double so = - 1.0 ; double ea = - 1.0 ; double we = - 1.0 ; if ( north . indexOf ( "N" ) != - 1 || north . indexOf ( "n" ) != - 1 ) { north = north . substring ( 0 , north . length ( ) - 1 ) ; no = degreeToNumber ( north ) ; } else if ( north . indexOf ( "S" ) != - 1 || north . indexOf ( "s" ) != - ...
public class XpathQuery { /** * Selects from an XML document using an XPATH query . * @ param xmlDocument XML string or path to xml file * @ param xmlDocumentSource The source type of the xml document . * Valid values : xmlString , xmlPath * Default value : xmlString * @ param xPathQuery XPATH query * @ par...
@ Output ( RETURN_CODE ) , @ Output ( RETURN_RESULT ) , @ Output ( SELECTED_VALUE ) , @ Output ( ERROR_MESSAGE ) } , responses = { @ Response ( text = ResponseNames . SUCCESS , field = RETURN_CODE , value = SUCCESS , matchType = COMPARE_EQUAL ) , @ Response ( text = ResponseNames . FAILURE , field = RETURN_CODE , value...
public class ZkDeployMgrImpl { /** * 获取每个配置级别的Map数据 , Key是配置 , Value是ZK配置数据 * @ return */ public Map < String , ZkDisconfData > getZkDisconfDataMap ( String app , String env , String version ) { } }
return zooKeeperDriver . getDisconfData ( app , env , version ) ;
public class KPipeline { /** * Helper method that creates a pipeline with a set of { @ link KProcedure } . * @ param program * the program that contains the pipelines * @ param procedures * the list of procedures to chain in the sampe pipeline */ public static void pipeline ( KProgram program , KProcedure ... p...
if ( procedures . length < 2 ) { throw new IllegalArgumentException ( MessageKind . E0003 . format ( ) ) ; } KProcedure kLastProcedure = procedures [ procedures . length - 1 ] ; KProcedure previous = null ; boolean isLastPipeline = false ; for ( KProcedure procedure : procedures ) { if ( procedure . equals ( kLastProce...
public class SGDFobos { /** * Initializes all the parameters for optimization . */ @ Override protected void init ( DifferentiableBatchFunction function , IntDoubleVector point ) { } }
super . init ( function , point ) ; this . accumLr = new DoubleArrayList ( ) ; this . iterOfLastStep = new int [ function . getNumDimensions ( ) ] ; Arrays . fill ( iterOfLastStep , - 1 ) ;
public class MagicMimeEntry { /** * Match short . * @ param bbuf the bbuf * @ param bo the bo * @ param needMask the need mask * @ param sMask the s mask * @ return true , if successful * @ throws IOException Signals that an I / O exception has occurred . */ private boolean matchShort ( final ByteBuffer bbu...
bbuf . order ( bo ) ; short got ; final String testContent = getContent ( ) ; if ( testContent . startsWith ( "0x" ) ) { got = ( short ) Integer . parseInt ( testContent . substring ( 2 ) , 16 ) ; } else if ( testContent . startsWith ( "&" ) ) { got = ( short ) Integer . parseInt ( testContent . substring ( 3 ) , 16 ) ...
public class DumpHelper { /** * A help method to log result pojo * @ param result the map contains info that needs to be logged */ static void logResult ( Map < String , Object > result , DumpConfig config ) { } }
Consumer < String > loggerFunc = getLoggerFuncBasedOnLevel ( config . getLogLevel ( ) ) ; if ( config . isUseJson ( ) ) { logResultUsingJson ( result , loggerFunc ) ; } else { int startLevel = - 1 ; StringBuilder sb = new StringBuilder ( "Http request/response information:" ) ; _logResult ( result , startLevel , config...
public class MethodBase { /** * Get the decoded and fixed resource URI . This calls getServletPath ( ) to * obtain the path information . The description of that method is a little * obscure in it ' s meaning . In a request of this form : < br / > < br / > * " GET / ucaldav / user / douglm / calendar / 1302064354...
String uri = req . getServletPath ( ) ; if ( ( uri == null ) || ( uri . length ( ) == 0 ) ) { /* No path specified - set it to root . */ uri = "/" ; } return fixPath ( uri ) ;
public class A_CmsUploadDialog { /** * Shows the overwrite dialog . < p > * @ param infoBean the info bean containing the existing and invalid file names */ private void showOverwriteDialog ( CmsUploadFileBean infoBean ) { } }
// update the dialog m_selectionDone = true ; m_okButton . enable ( ) ; if ( infoBean . getInvalidFileNames ( ) . isEmpty ( ) && infoBean . getExistingDeletedFileNames ( ) . isEmpty ( ) ) { displayDialogInfo ( Messages . get ( ) . key ( Messages . GUI_UPLOAD_INFO_OVERWRITE_0 ) , true ) ; } else { displayDialogInfo ( Me...
public class ScoreSettingsService { /** * Initialize build score settings * If build widget settings are present merge it with default score settings * Initialize settings for children scores in build widget */ private void initBuildScoreSettings ( ) { } }
BuildScoreSettings buildScoreSettings = this . scoreSettings . getBuildWidget ( ) ; if ( null != buildScoreSettings ) { buildScoreSettings . setCriteria ( Utils . mergeCriteria ( this . scoreSettings . getCriteria ( ) , buildScoreSettings . getCriteria ( ) ) ) ; initBuildScoreChildrenSettings ( buildScoreSettings ) ; }
public class DateTimeStaticExtensions { /** * Parse text into a { @ link java . time . ZonedDateTime } using the provided pattern . * @ param type placeholder variable used by Groovy categories ; ignored for default static methods * @ param text String to be parsed to create the date instance * @ param pattern pa...
return ZonedDateTime . parse ( text , DateTimeFormatter . ofPattern ( pattern ) ) ;
public class DefaultIncrementalAttributesMapper { /** * Lookup all values for the specified attribute , looping through the results incrementally if necessary . * @ param ldapOperations The instance to use for performing the actual lookup . * @ param dn The distinguished name of the object to find . * @ param att...
return lookupAttributes ( ldapOperations , LdapUtils . newLdapName ( dn ) , attribute ) ;
public class PtoPInputHandler { /** * Creates an AREYOUFLUSHED message for sending * @ return the new AREYOUFLUSHED message * @ throws SIResourceException if the message can ' t be created . */ protected ControlAreYouFlushed createControlAreYouFlushed ( ) throws SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createControlAreYouFlushed" ) ; ControlAreYouFlushed flushedqMsg = null ; // Create new message try { flushedqMsg = _cmf . createNewControlAreYouFlushed ( ) ; } catch ( MessageCreateFailedException e ) { // FFDC FFDCFilter ...
public class ServerService { /** * Restore a given archived server to a specified group * @ param server server reference * @ param group group reference * @ return OperationFuture wrapper for BaseServerResponse */ public OperationFuture < Link > restore ( Server server , Group group ) { } }
return baseServerResponse ( restore ( server , groupService . findByRef ( group ) . getId ( ) ) ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcConstraint ( ) { } }
if ( ifcConstraintEClass == null ) { ifcConstraintEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 107 ) ; } return ifcConstraintEClass ;
public class JobsInner { /** * Adds a Job that gets executed on a cluster . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param jobName The name of the job within the specified resource group . Job names can only contain a combination of alphanumeric characters along wit...
return createWithServiceResponseAsync ( resourceGroupName , jobName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class BasePool { /** * Can we allocate a value of size ' sizeInBytes ' without exceeding the hard cap on the pool size ? * If allocating this value will take the pool over the hard cap , we will first trim the pool down * to its soft cap , and then check again . * If the current used bytes + this new value...
int hardCap = mPoolParams . maxSizeHardCap ; // even with our best effort we cannot ensure hard cap limit . // Return immediately - no point in trimming any space if ( sizeInBytes > hardCap - mUsed . mNumBytes ) { mPoolStatsTracker . onHardCapReached ( ) ; return false ; } // trim if we need to int softCap = mPoolParam...
public class ArrayUtils { /** * Append an Object at end of array */ public static Object [ ] appendArray ( Object [ ] arr , Object obj ) { } }
Object [ ] newArr = new Object [ arr . length + 1 ] ; System . arraycopy ( arr , 0 , newArr , 0 , arr . length ) ; newArr [ arr . length ] = obj ; return newArr ;
public class PooledServerConnectedObjectManager { /** * Terminates all subscriptions to a given heap from a single session */ private void terminateSubscriptions ( IoSession session , String heapUri , Subscription . CloseReason reason ) { } }
terminateSubscriptions ( session , heapStates . get ( heapUri ) , heapUri , reason ) ;
public class LibraryBuilder { /** * Record any errors while parsing in both the list of errors but also in the library * itself so they can be processed easily by a remote client * @ param e the exception to record */ public void recordParsingException ( CqlTranslatorException e ) { } }
addException ( e ) ; if ( shouldReport ( e . getSeverity ( ) ) ) { CqlToElmError err = af . createCqlToElmError ( ) ; err . setMessage ( e . getMessage ( ) ) ; err . setErrorType ( e instanceof CqlSyntaxException ? ErrorType . SYNTAX : ( e instanceof CqlSemanticException ? ErrorType . SEMANTIC : ErrorType . INTERNAL ) ...
public class HashCodeBuilder { /** * Append a < code > hashCode < / code > for a < code > byte < / code > array . * @ param array * the array to add to the < code > hashCode < / code > * @ return this */ public HashCodeBuilder append ( final byte [ ] array ) { } }
if ( array == null ) { iTotal = iTotal * iConstant ; } else { for ( final byte element : array ) { append ( element ) ; } } return this ;
public class DummyInternalTransaction { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . InternalTransaction # requestCallback ( com . ibm . ws . objectManager . Token ) */ protected synchronized void requestCallback ( Token tokenToPrePrepare ) throws ObjectManagerException { } }
throw new InvalidStateException ( this , InternalTransaction . stateTerminated , InternalTransaction . stateNames [ InternalTransaction . stateTerminated ] ) ;
public class ArchiveBase { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . api . Archive # merge ( org . jboss . shrinkwrap . api . Archive , java . lang . String , * org . jboss . shrinkwrap . api . Filter ) */ @ Override public T merge ( final Archive < ? > source , final String path , final Filter < Ar...
Validate . notNull ( path , "path must be specified" ) ; return this . merge ( source , ArchivePaths . create ( path ) , filter ) ;
public class UIComponentTag { /** * Create a UIComponent . Abstract method getComponentType is invoked to determine the actual type name for the * component to be created . * If this tag has a " binding " attribute , then that is immediately evaluated to store the created component in the * specified property . *...
String componentType = getComponentType ( ) ; if ( componentType == null ) { throw new NullPointerException ( "componentType" ) ; } if ( _binding != null ) { Application application = context . getApplication ( ) ; ValueBinding componentBinding = application . createValueBinding ( _binding ) ; UIComponent component = a...
public class CreateWSDL20 { /** * AddBindingOperationType Method . */ public void addBindingOperationType ( String strVersion , BindingType bindingType , MessageProcessInfo recMessageProcessInfo ) { } }
String interfacens ; String interfacename ; QName qname ; String value ; BindingOperationType bindingOperationType = wsdlFactory . createBindingOperationType ( ) ; bindingType . getOperationOrFaultOrFeature ( ) . add ( wsdlFactory . createBindingTypeOperation ( bindingOperationType ) ) ; interfacens = this . getNamespa...
public class Util { /** * Deletes the given directory and contents recursively using a filter . * @ param dir a directory to delete * @ param pathChecker a security check to validate a path before deleting * @ throws IOException if the operation fails */ @ Restricted ( NoExternalUse . class ) public static void d...
newPathRemover ( pathChecker ) . forceRemoveRecursive ( dir ) ;
public class DfuBaseService { /** * This method allows you to update the notification showing the upload progress . * @ param builder notification builder . */ protected void updateProgressNotification ( @ NonNull final NotificationCompat . Builder builder , final int progress ) { } }
// Add Abort action to the notification if ( progress != PROGRESS_ABORTED && progress != PROGRESS_COMPLETED ) { final Intent abortIntent = new Intent ( BROADCAST_ACTION ) ; abortIntent . putExtra ( EXTRA_ACTION , ACTION_ABORT ) ; final PendingIntent pendingAbortIntent = PendingIntent . getBroadcast ( this , 1 , abortIn...
public class HttpMessage { /** * Adds new cookie to this http message . * @ param cookie The Cookie to set * @ return The altered HttpMessage */ public HttpMessage cookie ( final Cookie cookie ) { } }
this . cookies . put ( cookie . getName ( ) , cookie ) ; setHeader ( HttpMessageHeaders . HTTP_COOKIE_PREFIX + cookie . getName ( ) , cookieConverter . getCookieString ( cookie ) ) ; return this ;
public class SDBaseOps { /** * Get a subset of the specified input , by specifying the first element and the size of the array . < br > * For example , if input is : < br > * [ a , b , c ] < br > * [ d , e , f ] < br > * then slice ( input , begin = [ 0,1 ] , size = [ 2,1 ] will return : < br > * [ b ] < br >...
SDVariable ret = f ( ) . slice ( input , begin , size ) ; return updateVariableNameAndReference ( ret , name ) ;
public class Proposal { /** * Sets the offlineErrors value for this Proposal . * @ param offlineErrors * Errors that occurred during offline processes . If any errors * occur during an offline process , * such as reserving inventory , this field will be populated * with those errors , otherwise this * field w...
this . offlineErrors = offlineErrors ;
public class BaseMessageQueue { /** * Initializes this message queue . * Adds this queue to the message manager . * @ param manager My parent message manager . * @ param strQueueName This queue ' s name . * @ param strQueueType This queue ' s type ( LOCAL / JMS ) . */ public void init ( BaseMessageManager manag...
m_manager = manager ; m_strQueueName = strQueueName ; m_strQueueType = strQueueType ; if ( m_manager != null ) m_manager . addMessageQueue ( this ) ;
public class Errors { /** * Provides a message from the resource bundle < code > activejdbc _ messages < / code > which is merged * with parameters . This methods expects the message in the resource bundle to be parametrized . * This message is configured for a validator using a Fluent Interface when declaring a va...
if ( attributeName == null ) throw new NullPointerException ( "attributeName cannot be null" ) ; return validators . get ( attributeName ) . formatMessage ( locale , params ) ;
public class MBooleanTableCellRenderer { /** * { @ inheritDoc } */ @ Override public Component getTableCellRendererComponent ( final JTable table , final Object value , final boolean isSelected , final boolean hasFocus , final int row , final int column ) { } }
if ( isSelected ) { super . setForeground ( table . getSelectionForeground ( ) ) ; super . setBackground ( table . getSelectionBackground ( ) ) ; } else { super . setForeground ( table . getForeground ( ) ) ; if ( MTable . BICOLOR_LINE != null && row % 2 == 0 ) { super . setBackground ( MTable . BICOLOR_LINE ) ; } else...
public class XmlUtils { /** * Parses an XML string into a DOM . * @ param xml the XML string * @ return the parsed DOM * @ throws SAXException if the string is not valid XML */ public static Document toDocument ( String xml ) throws SAXException { } }
try { return toDocument ( new StringReader ( xml ) ) ; } catch ( IOException e ) { // reading from string throw new RuntimeException ( e ) ; }
public class ExtendedPredicates { /** * Create a predicate to check if a throwable ' s error message contains a specific string . * @ param expected The expected string * @ param caseSensitive Is the comparison going to be case sensitive * @ return True if the throwable ' s message contains the expected string . ...
return new Predicate < Throwable > ( ) { public boolean apply ( Throwable input ) { String actual = input . getMessage ( ) ; String exp = expected ; if ( ! caseSensitive ) { actual = actual . toLowerCase ( ) ; exp = exp . toLowerCase ( ) ; } return actual . contains ( exp ) ; } } ;
public class CompletableFuture { /** * Returns the encoding of a copied outcome ; if exceptional , * rewraps as a CompletionException , else returns argument . */ static Object encodeRelay ( Object r ) { } }
Throwable x ; return ( ( ( r instanceof AltResult ) && ( x = ( ( AltResult ) r ) . ex ) != null && ! ( x instanceof CompletionException ) ) ? new AltResult ( new CompletionException ( x ) ) : r ) ;
public class ImplementingClassResolver { /** * ToDo this result could be cached . . . . */ private < I > Class < ? extends I > handleOneSubType ( final Class < I > interf , final Object o ) { } }
final Class < ? extends I > implClass = ( Class < ? extends I > ) o ; final Set < Class < ? > > producersForInterface = findProducersFor ( interf ) ; final Set < Class < ? > > producersForImpl = findProducersFor ( implClass ) ; // @ formatter : off if ( ! producersForInterface . isEmpty ( ) && ! producersForImpl . isEm...
public class BitVector { /** * Returns whether this BitVector contains all bits that are set to true in * the specified BitSet . * @ param bitset the bits to inspect in this BitVector * @ return true if this BitVector contains all bits that are set to true in * the specified BitSet , false otherwise */ public b...
for ( int i = 0 ; i < bitset . length ; i ++ ) { final long b = bitset [ i ] ; if ( i >= bits . length && b != 0L ) { return false ; } if ( ( b & bits [ i ] ) != b ) { return false ; } } return true ;
public class ConfigurationFile { /** * Given { @ code name } , determine the intended main configuration file . Handles special cases , including * " last " , " initial " , " boot " , " v1 " , and , if persistence to the original file is not supported , absolute paths . * @ param rawName default name for the main c...
assert rawName != null ; String mainName = null ; if ( name == null ) { // Just use the default mainName = rawName ; } else if ( name . equals ( LAST ) || name . equals ( INITIAL ) || name . equals ( BOOT ) ) { // Search for a * single * file in the configuration dir with suffix = = name . xml mainName = findMainFileFr...
public class HttpHeader { /** * Add the header stored in internal hashtable * @ param name * @ param value */ private void addInternalHeaderFields ( String name , String value ) { } }
String key = normalisedHeaderName ( name ) ; Vector < String > v = getHeaders ( key ) ; if ( v == null ) { v = new Vector < > ( ) ; mHeaderFields . put ( key , v ) ; } if ( value != null ) { v . add ( value ) ; } else { mHeaderFields . remove ( key ) ; }
public class DataSiftODP { /** * Send data to DataSift ODP ingestion endpoint using batch upload method . * @ param sourceId the ODP source ID to use for data ingestion * @ param interactions String containing new - line delimited data items * @ return a result containing details on accepted interactions , or err...
FutureData < ODPBatchResponse > future = new FutureData < > ( ) ; URI uri = newParams ( ) . forURL ( config . newIngestionAPIEndpointURI ( sourceId ) ) ; JSONRequest request = config . http ( ) . postJSON ( uri , new PageReader ( newRequestCallback ( future , new ODPBatchResponse ( ) , config ) ) ) . setData ( interact...
public class PropertyAccessor { /** * Retrieves the value of the * < a href = " http : / / docs . oracle . com / javase / tutorial / javabeans / index . html " target = " _ blank " > JavaBeans < / a > property . * Examples : * < pre > * / / import static { @ link org . fest . reflect . core . Reflection # prope...
try { Object value = descriptor . getReadMethod ( ) . invoke ( target ) ; return castSafely ( value , propertyType ) ; } catch ( Throwable t ) { String msg = String . format ( "Failed to get the value of property '%s'" , descriptor . getName ( ) ) ; throw new ReflectionError ( msg , t ) ; }
public class BuildTasksInner { /** * Creates a build task for a container registry with the specified parameters . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildTaskName The name of th...
return beginCreateWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , buildTaskCreateParameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ThreadLocalRandom { /** * Returns a pseudorandom { @ code double } value between 0.0 * ( inclusive ) and the specified bound ( exclusive ) . * @ param bound the upper bound ( exclusive ) . Must be positive . * @ return a pseudorandom { @ code double } value between zero * ( inclusive ) and the boun...
if ( ! ( bound > 0.0 ) ) throw new IllegalArgumentException ( BAD_BOUND ) ; double result = ( mix64 ( nextSeed ( ) ) >>> 11 ) * DOUBLE_UNIT * bound ; return ( result < bound ) ? result : // correct for rounding Double . longBitsToDouble ( Double . doubleToLongBits ( bound ) - 1 ) ;
public class KAFDocument { /** * Hau kendu behar da */ public List < Term > getTermsFromWFs ( List < String > wfIds ) { } }
List < Term > terms = new ArrayList < Term > ( ) ; for ( String wfId : wfIds ) { terms . addAll ( this . wfId2Terms . get ( wfId ) ) ; } return terms ;
public class JsonUtil { /** * Creates or updates one property at a JCR node . * @ param node the node which holds the property * @ param property the property object transformed from JSON * @ return < code > true < / code > if the property is set and available * @ throws RepositoryException if storing was not p...
if ( property != null ) { int type = StringUtils . isNotBlank ( property . type ) ? PropertyType . valueFromName ( property . type ) : PropertyType . STRING ; String name = property . name ; String oldname = property . oldname ; if ( ! StringUtils . isBlank ( oldname ) && ! name . equals ( oldname ) && node . hasProper...
public class Config { /** * Returns the cache config with the given name or { @ code null } if there is none . * The name is matched by pattern to the configuration and by stripping the * partition ID qualifier from the given { @ code name } . * @ param name name of the cache config * @ return the cache configu...
name = getBaseName ( name ) ; return lookupByPattern ( configPatternMatcher , cacheConfigs , name ) ;
public class Dispatching { /** * Adapts a predicate to a binary predicate by ignoring second parameter . * @ param < T1 > the adapted predicate first parameter type * @ param < T2 > the adapted predicate second parameter type * @ param predicate the predicate to be adapted * @ param ignored the adapted predicat...
dbc . precondition ( predicate != null , "cannot ignore parameter of a null predicate" ) ; return ( first , second ) -> predicate . test ( first ) ;
public class OptimizeArgumentsArray { /** * Iterate through all the references to arguments array in the * function to determine the real highestIndex . Returns - 1 when we should not * be replacing any arguments for this scope - we should exit tryReplaceArguments * @ param highestIndex highest index that has bee...
for ( Node ref : currentArgumentsAccesses ) { Node getElem = ref . getParent ( ) ; // Bail on anything but argument [ c ] access where c is a constant . // TODO ( user ) : We might not need to bail out all the time , there might // be more cases that we can cover . if ( ! getElem . isGetElem ( ) || ref != getElem . get...
public class Async { /** * The action will be asynchronously executed in UI thread . * @ param action * @ param delay * @ return */ static ContinuableFuture < Void > executeOnUiThread ( final Try . Runnable < ? extends Exception > action , final long delay ) { } }
return execute ( new FutureTask < Void > ( FN . toCallable ( action ) ) , _UI_EXECUTOR , delay ) ;
public class MiniSat { /** * Returns a new MiniSat solver with a given configuration . * @ param f the formula factory * @ param config the configuration * @ return the solver */ public static MiniSat miniSat ( final FormulaFactory f , final MiniSatConfig config ) { } }
return new MiniSat ( f , SolverStyle . MINISAT , config , null ) ;
public class GoogleMapShapeConverter { /** * Convert a { @ link MultiPolylineOptions } to a { @ link CompoundCurve } * @ param multiPolylineOptions multi polyline options * @ param hasZ has z flag * @ param hasM has m flag * @ return compound curve */ public CompoundCurve toCompoundCurveFromOptions ( MultiPolyl...
CompoundCurve compoundCurve = new CompoundCurve ( hasZ , hasM ) ; for ( PolylineOptions polyline : multiPolylineOptions . getPolylineOptions ( ) ) { LineString lineString = toLineString ( polyline ) ; compoundCurve . addLineString ( lineString ) ; } return compoundCurve ;
public class ComparableItemListImpl { /** * define a comparator which will be used to sort the list " everytime " it is altered * NOTE this will only sort if you " set " a new list or " add " new items ( not if you provide a position for the add function ) * @ param comparator used to sort the list * @ param sort...
this . mComparator = comparator ; // we directly sort the list with the defined comparator if ( mItems != null && mComparator != null && sortNow ) { Collections . sort ( mItems , mComparator ) ; getFastAdapter ( ) . notifyAdapterDataSetChanged ( ) ; } return this ;
public class ConfigCompleteSift { /** * Creates a configuration similar to how it was originally described in the paper */ public static ConfigCompleteSift createPaper ( ) { } }
ConfigCompleteSift config = new ConfigCompleteSift ( ) ; config . scaleSpace = ConfigSiftScaleSpace . createPaper ( ) ; config . detector = ConfigSiftDetector . createPaper ( ) ; config . orientation = ConfigSiftOrientation . createPaper ( ) ; return config ;
public class IdentityByStateClustering { /** * / _ 0 _ _ 1 _ _ 2 _ _ 3 _ _ 4_ * i 0 | - 0 1 3 6 | * 1 | - 2 4 7 | * 2 | - 5 8 | * 3 | - 9 | * ` ( j * ( j - 1 ) ) / 2 ` is the amount of numbers in the triangular matrix before the column ` j ` . * for example , with i = 2 , j = 4: * ( j * ( j - 1 ) ) / 2 = ...
if ( first >= second ) { throw new IllegalArgumentException ( "first (" + first + ") and second (" + second + ") sample indexes, must comply with: 0 <= first < second" ) ; } return ( second * second - second ) / 2 + first ;
public class Lz4Compressor { /** * Resets compressor so that a new set of input data can be processed . */ @ Override public synchronized void reset ( ) { } }
finish = false ; finished = false ; uncompressedDirectBuf . clear ( ) ; uncompressedDirectBufLen = 0 ; compressedDirectBuf . clear ( ) ; compressedDirectBuf . limit ( 0 ) ; userBufOff = userBufLen = 0 ; bytesRead = bytesWritten = 0L ;
public class RegionAutoscalerClient { /** * Returns the specified autoscaler . * < p > Sample code : * < pre > < code > * try ( RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient . create ( ) ) { * ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName . of ( " [ PROJECT ] " , ...
GetRegionAutoscalerHttpRequest request = GetRegionAutoscalerHttpRequest . newBuilder ( ) . setAutoscaler ( autoscaler == null ? null : autoscaler . toString ( ) ) . build ( ) ; return getRegionAutoscaler ( request ) ;
public class InboundHeadersBenchmark { /** * Headers taken from the gRPC spec . */ private static void setupRequestHeaders ( ) { } }
requestHeaders = new AsciiString [ 18 ] ; int i = 0 ; requestHeaders [ i ++ ] = AsciiString . of ( ":method" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "POST" ) ; requestHeaders [ i ++ ] = AsciiString . of ( ":scheme" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "http" ) ; requestHeaders [ i ++ ] = AsciiStrin...
public class HyperParameterAlgorithmSpecificationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( HyperParameterAlgorithmSpecification hyperParameterAlgorithmSpecification , ProtocolMarshaller protocolMarshaller ) { } }
if ( hyperParameterAlgorithmSpecification == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( hyperParameterAlgorithmSpecification . getTrainingImage ( ) , TRAININGIMAGE_BINDING ) ; protocolMarshaller . marshall ( hyperParameterAlgorithmSpeci...
public class UcumEssenceService { /** * / * ( non - Javadoc ) * @ see org . eclipse . ohf . ucum . UcumServiceEx # getCanonicalForm ( org . eclipse . ohf . ucum . UcumEssenceService . Pair ) */ @ Override public Pair getCanonicalForm ( Pair value ) throws UcumException { } }
assert value != null : paramError ( "getCanonicalForm" , "value" , "must not be null" ) ; assert checkStringParam ( value . getCode ( ) ) : paramError ( "getCanonicalForm" , "value.code" , "must not be null or empty" ) ; Term term = new ExpressionParser ( model ) . parse ( value . getCode ( ) ) ; Canonical c = new Conv...
public class Type { /** * Getter method for instance variable { @ link # storeId } . * @ return value of instance variable { @ link # storeId } */ public long getStoreId ( ) { } }
final long ret ; if ( this . storeId == 0 && getParentType ( ) != null ) { ret = getParentType ( ) . getStoreId ( ) ; } else { ret = this . storeId ; } return ret ;
public class CommerceAddressRestrictionUtil { /** * Returns the last commerce address restriction in the ordered set where commerceCountryId = & # 63 ; . * @ param commerceCountryId the commerce country ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ r...
return getPersistence ( ) . fetchByCommerceCountryId_Last ( commerceCountryId , orderByComparator ) ;
public class WebServiceRefProcessor { /** * This method will allow us to create an InjectionBinding instance for @ Resource annotations found on a method or field * that are being used to indicate web service reference types . */ @ Override public InjectionBinding < WebServiceRef > createOverrideInjectionBinding ( Cl...
Class < ? > typeClass = resource . type ( ) ; if ( member != null ) { Class < ? > inferredType = InjectionHelper . getTypeFromMember ( member ) ; if ( typeClass . getName ( ) . equals ( Object . class . getName ( ) ) ) { // default typeClass = inferredType ; } else { if ( ! inferredType . isAssignableFrom ( typeClass )...
public class LogRecorderManager { /** * RSS feed for log entries . */ public void doRss ( StaplerRequest req , StaplerResponse rsp ) throws IOException , ServletException { } }
doRss ( req , rsp , Jenkins . logRecords ) ;
public class Types { /** * Returns an empty value of requested type . This method returns < code > 0 < / code > , < code > false < / code > , empty string , * current date / time , empty collection or empty array if requested type is respectively a number , boolean , string , * date , collection or array . If none ...
if ( byte . class . equals ( t ) || Byte . class . equals ( t ) ) { return ( byte ) 0 ; } if ( short . class . equals ( t ) || Short . class . equals ( t ) ) { return ( short ) 0 ; } if ( int . class . equals ( t ) || Integer . class . equals ( t ) ) { return ( int ) 0 ; } if ( long . class . equals ( t ) || Long . cla...
public class SelectSubPlanAssembler { /** * Given a specific join order , compute all possible sub - plan - graphs for that * join order and add them to the deque of plans . If this doesn ' t add plans , * it doesn ' t mean no more plans can be generated . It ' s possible that the * particular join order it got h...
assert ( joinTree != null ) ; // generate the access paths for all nodes generateAccessPaths ( joinTree ) ; List < JoinNode > nodes = joinTree . generateAllNodesJoinOrder ( ) ; generateSubPlanForJoinNodeRecursively ( joinTree , 0 , nodes ) ;
public class Table { /** * Low level row delete method . Removes the row from the indexes and * from the Cache . */ private void deleteNoCheck ( Session session , Row row ) { } }
if ( row . isDeleted ( session ) ) { return ; } session . addDeleteAction ( this , row ) ;
public class Logger { /** * Check whether this category is enabled for the TRACE Level . * @ return boolean - { @ code true } if this category is enabled for level TRACE , { @ code false } otherwise . * @ since 1.2.12 */ public boolean isTraceEnabled ( ) { } }
return MINIMUM_LEVEL_COVERS_TRACE && provider . isEnabled ( STACKTRACE_DEPTH , null , org . tinylog . Level . TRACE ) ;
public class TransitionStateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TransitionState transitionState , ProtocolMarshaller protocolMarshaller ) { } }
if ( transitionState == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( transitionState . getEnabled ( ) , ENABLED_BINDING ) ; protocolMarshaller . marshall ( transitionState . getLastChangedBy ( ) , LASTCHANGEDBY_BINDING ) ; protocolMarshal...
public class DataEnqueuedInputStream { /** * Signals that no more data is available and an exception should be thrown . */ void endOffering ( IOException exception ) { } }
if ( closed ) { return ; } // closed should never be set by this method - - only the polling side should do it , as it means // that the CLOSED marker has been encountered . if ( this . exception == null ) { this . exception = exception ; } // Since this is an unbounded queue , offer ( ) always succeeds . queue . offer...
public class systemglobal_auditsyslogpolicy_binding { /** * Use this API to fetch a systemglobal _ auditsyslogpolicy _ binding resources . */ public static systemglobal_auditsyslogpolicy_binding [ ] get ( nitro_service service ) throws Exception { } }
systemglobal_auditsyslogpolicy_binding obj = new systemglobal_auditsyslogpolicy_binding ( ) ; systemglobal_auditsyslogpolicy_binding response [ ] = ( systemglobal_auditsyslogpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class Main { /** * Main function . * @ param args * the arguments to this function . */ public final static void main ( String [ ] args ) throws IOException { } }
Writer writer = new OutputStreamWriter ( System . out , "utf-8" ) ; XMLOutputter outputter = new XMLOutputter ( writer , "iso-8859-1" ) ; writeXML ( outputter ) ; System . out . println ( ) ; System . out . println ( ) ; outputter . reset ( writer , "utf-8" ) ; writeXML ( outputter ) ;
public class RestoreManagerImpl { /** * / * ( non - Javadoc ) * @ see org . duracloud . snapshot . restoration . SnapshotRestorationManager # restoreCompleted ( java . lang . String ) */ @ Override public Restoration restoreCompleted ( String restorationId ) throws SnapshotNotFoundException , SnapshotInProcessExcepti...
Restoration restoration = getRestoration ( restorationId ) ; return restoreCompleted ( restoration ) ;
public class WMessages { /** * Adds a success message . * When setting < code > encodeText < / code > to < code > false < / code > , it then becomes the responsibility of the application * to ensure that the text does not contain any characters which need to be escaped . * < b > WARNING : < / b > If you are using...
Message message = new Message ( Message . SUCCESS_MESSAGE , code ) ; addMessage ( successMessages , message , encodeText ) ;
public class ResourceManager { /** * Get the bundle that is active for this thread . This is done by loading * either the specified locale based resource bundle and , if that fails , by * looping through the fallback locales to locate a usable bundle . * @ return the resource bundle */ public ResourceBundle getRe...
// System . out . println ( this + " " + this . locale + " ( " + resourceBundles . size ( ) + " ) " ) ; ResourceBundle bundle = ( ResourceBundle ) resourceBundles . get ( baseName ) ; if ( null == bundle ) { resourceBundles . put ( baseName , bundle = findBundle ( baseName ) ) ; } return bundle ;
public class SelectConfig { /** * XXX : selectLength should be validated ; selectLength should be greater than resolution */ @ Option ( name = "-sl" , aliases = "--select-length" , metaVar = "<length>" , usage = "Length of select in seconds." ) void setSelectLength ( Duration selectLength ) { } }
m_selectLength = selectLength ;
public class ConversionManager { /** * Apply convert across an array * @ param rawString * @ param arrayType * @ return an array of converted T objects . */ public < T > T [ ] convertArray ( String rawString , Class < T > arrayType ) { } }
String [ ] elements = split ( rawString ) ; T [ ] array = convertArray ( elements , arrayType ) ; return array ;
public class GeneratedMessage { /** * For use by generated code only . */ public static < ContainingType extends Message , Type > GeneratedExtension < ContainingType , Type > newMessageScopedGeneratedExtension ( final Message scope , final int descriptorIndex , final Class singularType , final Message defaultInstance )...
// For extensions scoped within a Message , we use the Message to resolve // the outer class ' s descriptor , from which the extension descriptor is // obtained . return new GeneratedExtension < ContainingType , Type > ( new ExtensionDescriptorRetriever ( ) { // @ Override ( Java 1.6 override semantics , but we must su...
public class Properties { /** * File location . . \ bin \ org . jdice . calc . properties * File content : * roundingMode = HALF _ UP * stripTrailingZeros = true * decimalSeparator . out = ' . ' * decimalSeparator . in = ' . ' * numconverter [ 0 ] = org . jdice . calc . test . NumTest $ CustomObject > org ....
File propFile = new File ( getGlobalPropertiesFile ( ) ) ; if ( propFile . createNewFile ( ) || propFile . isFile ( ) ) { java . util . Properties prop = new java . util . Properties ( ) ; if ( getRoundingMode ( ) != null ) prop . put ( "roundingMode" , getRoundingMode ( ) . name ( ) ) ; if ( getScale ( ) != null ) pro...
public class FieldSet { /** * Useful for implementing * { @ link Message # hasField ( Descriptors . FieldDescriptor ) } . */ public boolean hasField ( final FieldDescriptorType descriptor ) { } }
if ( descriptor . isRepeated ( ) ) { throw new IllegalArgumentException ( "hasField() can only be called on non-repeated fields." ) ; } return fields . get ( descriptor ) != null ;
public class DescribeClustersRequest { /** * The names of the DAX clusters being described . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setClusterNames ( java . util . Collection ) } or { @ link # withClusterNames ( java . util . Collection ) } if you wa...
if ( this . clusterNames == null ) { setClusterNames ( new java . util . ArrayList < String > ( clusterNames . length ) ) ; } for ( String ele : clusterNames ) { this . clusterNames . add ( ele ) ; } return this ;
public class Checker { /** * Emit an error with specified locator . * @ param message the error message * @ throws SAXException if something goes wrong */ public void err ( String message , Locator overrideLocator ) throws SAXException { } }
if ( errorHandler != null ) { SAXParseException spe = new SAXParseException ( message , overrideLocator ) ; errorHandler . error ( spe ) ; }
public class DefaultGroovyMethods { /** * Iterates through an aggregate type or data structure , * passing each item to the given closure . Custom types may utilize this * method by simply providing an " iterator ( ) " method . The items returned * from the resulting iterator will be passed to the closure . * <...
each ( InvokerHelper . asIterator ( self ) , closure ) ; return self ;
public class DescribeComplianceByConfigRuleRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeComplianceByConfigRuleRequest describeComplianceByConfigRuleRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeComplianceByConfigRuleRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeComplianceByConfigRuleRequest . getConfigRuleNames ( ) , CONFIGRULENAMES_BINDING ) ; protocolMarshaller . marshall ( describeComplianceByCo...
public class PaymentChannelClientConnection { /** * Increments the total value which we pay the server . * @ param size How many satoshis to increment the payment by ( note : not the new total ) . * @ throws ValueOutOfRangeException If the size is negative or would pay more than this channel ' s total value * ( {...
return channelClient . incrementPayment ( size , null , null ) ;
public class LdapUtils { /** * New connection factory connection factory . * @ param l the l * @ return the connection factory */ public static DefaultConnectionFactory newLdaptiveConnectionFactory ( final AbstractLdapProperties l ) { } }
LOGGER . debug ( "Creating LDAP connection factory for [{}]" , l . getLdapUrl ( ) ) ; val cc = newLdaptiveConnectionConfig ( l ) ; val bindCf = new DefaultConnectionFactory ( cc ) ; if ( l . getProviderClass ( ) != null ) { try { val clazz = ClassUtils . getClass ( l . getProviderClass ( ) ) ; bindCf . setProvider ( Pr...
public class TexFileUtilsImpl { /** * ( non - Javadoc ) * @ see org . m2latex . mojo . TexFileUtils # copyLatexSrcToTempDir ( java . io . File , java . io . File ) */ public void copyLatexSrcToTempDir ( File texDirectory , File tempDirectory ) throws MojoExecutionException { } }
try { if ( tempDirectory . exists ( ) ) { log . info ( "Deleting existing directory " + tempDirectory . getPath ( ) ) ; FileUtils . deleteDirectory ( tempDirectory ) ; } log . debug ( "Copying TeX source directory (" + texDirectory . getPath ( ) + ") to temporary directory (" + tempDirectory + ")" ) ; FileUtils . copyD...
public class OrientModelGraph { /** * Checks if a model is already visited in the path search algorithm . Needed for the loop detection . */ private boolean alreadyVisited ( ODocument neighbor , ODocument [ ] steps ) { } }
for ( ODocument step : steps ) { ODocument out = graph . getOutVertex ( step ) ; if ( out . equals ( neighbor ) ) { return true ; } } return false ;
public class WisdomExecutor { /** * Launches the Wisdom server in background using the { @ literal chameleon . sh } scripts . * This method works only on Linux and Mac OS X . * @ param mojo the mojo * @ throws MojoExecutionException if the Wisdom instance cannot be started . */ public void executeInBackground ( A...
File script = new File ( mojo . getWisdomRootDirectory ( ) , "chameleon.sh" ) ; if ( ! script . isFile ( ) ) { throw new MojoExecutionException ( "The 'chameleon.sh' file does not exist in " + mojo . getWisdomRootDirectory ( ) . getAbsolutePath ( ) + " - cannot launch Wisdom" ) ; } // Remove the RUNNING _ PID file if e...
public class LoggerRepositoryExImpl { /** * Set the name of this repository . * Note that once named , a repository cannot be rerenamed . * @ param repoName name of hierarchy */ public void setName ( final String repoName ) { } }
if ( name == null ) { name = repoName ; } else if ( ! name . equals ( repoName ) ) { throw new IllegalStateException ( "Repository [" + name + "] cannot be renamed as [" + repoName + "]." ) ; }