signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ConfigDelayedMerge { /** * static method also used by ConfigDelayedMergeObject */ static ResolveResult < ? extends AbstractConfigValue > resolveSubstitutions ( ReplaceableMergeStack replaceable , List < AbstractConfigValue > stack , ResolveContext context , ResolveSource source ) throws NotPossibleToResolv...
if ( ConfigImpl . traceSubstitutionsEnabled ( ) ) { ConfigImpl . trace ( context . depth ( ) , "delayed merge stack has " + stack . size ( ) + " items:" ) ; int count = 0 ; for ( AbstractConfigValue v : stack ) { ConfigImpl . trace ( context . depth ( ) + 1 , count + ": " + v ) ; count += 1 ; } } // to resolve substitu...
public class HalResource { /** * Adds state to the resource . * @ param state Resource state * @ return HAL resource */ public HalResource addState ( ObjectNode state ) { } }
state . fields ( ) . forEachRemaining ( entry -> model . set ( entry . getKey ( ) , entry . getValue ( ) ) ) ; return this ;
public class Tracer { /** * Enters the scope of code where the given { @ link Span } is in the current Context , and returns an * object that represents that scope . The scope is exited when the returned object is closed . * < p > Supports try - with - resource idiom . * < p > Can be called with { @ link BlankSpa...
return CurrentSpanUtils . withSpan ( Utils . checkNotNull ( span , "span" ) , /* endSpan = */ false ) ;
public class BenchmarkInterceptor { /** * This code is executed after the method is called . * @ param object receiver object for the called method * @ param methodName name of the called method * @ param arguments arguments to the called method * @ param result result of the executed method call or result of b...
( ( List ) calls . get ( methodName ) ) . add ( System . currentTimeMillis ( ) ) ; return result ;
public class JsonRpcBasicServer { /** * Returns parameters into an { @ link InputStream } of JSON data . * @ param method the method * @ param id the id * @ param params the base64 encoded params * @ return the { @ link InputStream } * @ throws IOException on error */ static InputStream createInputStream ( St...
StringBuilder envelope = new StringBuilder ( ) ; envelope . append ( "{\"" ) ; envelope . append ( JSONRPC ) ; envelope . append ( "\":\"" ) ; envelope . append ( VERSION ) ; envelope . append ( "\",\"" ) ; envelope . append ( ID ) ; envelope . append ( "\":" ) ; // the ' id ' value is assumed to be numerical . if ( nu...
public class MainActivity { /** * Request notification listener . */ private void requestNotificationListener ( ) { } }
AndPermission . with ( this ) . notification ( ) . listener ( ) . rationale ( new NotifyListenerRationale ( ) ) . onGranted ( new Action < Void > ( ) { @ Override public void onAction ( Void data ) { toast ( R . string . successfully ) ; } } ) . onDenied ( new Action < Void > ( ) { @ Override public void onAction ( Voi...
public class BlackDuckRequestFilter { /** * This will return the filter key / value pairs as Black Duck expects them : [ key1 : value1 , key1 : value2 , key2 : value3 ] etc */ public List < String > getFilterParameters ( ) { } }
final List < String > parameters = new ArrayList < > ( ) ; filterKeysToValues . forEach ( ( filterKey , filterValues ) -> { filterValues . forEach ( filterValue -> { final String parameterString = String . format ( "%s:%s" , filterKey , filterValue ) ; parameters . add ( parameterString ) ; } ) ; } ) ; return parameter...
public class DescribeTableRestoreStatusResult { /** * A list of status details for one or more table restore requests . * @ return A list of status details for one or more table restore requests . */ public java . util . List < TableRestoreStatus > getTableRestoreStatusDetails ( ) { } }
if ( tableRestoreStatusDetails == null ) { tableRestoreStatusDetails = new com . amazonaws . internal . SdkInternalList < TableRestoreStatus > ( ) ; } return tableRestoreStatusDetails ;
public class TurfMeta { /** * Get all coordinates from a { @ link Point } object , returning a { @ code List } of Point objects . * If you have a geometry collection , you need to break it down to individual geometry objects * before using { @ link # coordAll } . * @ param point any { @ link Point } object * @ ...
return coordAll ( new ArrayList < Point > ( ) , point ) ;
public class MapTileApproximater { /** * Try to get a tile bitmap from the pool , otherwise allocate a new one * @ param pTileSizePx * @ return */ public static Bitmap getTileBitmap ( final int pTileSizePx ) { } }
final Bitmap bitmap = BitmapPool . getInstance ( ) . obtainSizedBitmapFromPool ( pTileSizePx , pTileSizePx ) ; if ( bitmap != null ) { return bitmap ; } return Bitmap . createBitmap ( pTileSizePx , pTileSizePx , Bitmap . Config . ARGB_8888 ) ;
public class HandleSuperBuilder { /** * Returns the explicitly requested singular annotation on this node ( field * or parameter ) , or null if there ' s no { @ code @ Singular } annotation on it . * @ param node The node ( field or method param ) to inspect for its name and potential { @ code @ Singular } annotati...
for ( EclipseNode child : node . down ( ) ) { if ( ! annotationTypeMatches ( Singular . class , child ) ) continue ; char [ ] pluralName = node . getKind ( ) == Kind . FIELD ? removePrefixFromField ( node ) : ( ( AbstractVariableDeclaration ) node . get ( ) ) . name ; AnnotationValues < Singular > ann = createAnnotatio...
public class UnifiedClassLoader { /** * { @ inheritDoc } */ @ Override @ FFDCIgnore ( PrivilegedActionException . class ) public Enumeration < URL > getResources ( String name ) throws IOException { } }
/* * The default implementation of getResources never calls getResources on it ' s parent , instead it just calls findResources on all of the loaders parents . We know that our * parent will be a gateway class loader that changes the order that resources are loaded but it does this in getResources ( as that is where ...
public class RuleClassifier { /** * Find best value of entropy for nominal attributes */ public void findBestValEntropyNominalAtt ( AutoExpandVector < DoubleVector > attrib , int attNumValues ) { } }
ArrayList < ArrayList < Double > > distClassValue = new ArrayList < ArrayList < Double > > ( ) ; // System . out . print ( " attrib " + attrib + " \ n " ) ; for ( int z = 0 ; z < attrib . size ( ) ; z ++ ) { distClassValue . add ( new ArrayList < Double > ( ) ) ; } for ( int v = 0 ; v < attNumValues ; v ++ ) { DoubleVe...
public class Ix { /** * Calls the given action to generate a value or terminate whenever the next ( ) * is called on the resulting Ix . iterator ( ) . * The result ' s iterator ( ) doesn ' t support remove ( ) . * The action may call { @ code onNext } at most once to signal the next value per action invocation . ...
return new IxGenerateStateless < T > ( nullCheck ( nextSupplier , "nextSupplier is null" ) ) ;
public class SecurityServiceImpl { /** * Eventually this will be execution context aware and pick the right domain . * Till then , we ' re only accessing the system domain configuration . * @ return SecurityConfiguration representing the " effective " configuration * for the execution context . */ private Securit...
SecurityConfiguration effectiveConfig = configs . getService ( cfgSystemDomain ) ; if ( effectiveConfig == null ) { Tr . error ( tc , "SECURITY_SERVICE_ERROR_BAD_DOMAIN" , cfgSystemDomain , CFG_KEY_SYSTEM_DOMAIN ) ; throw new IllegalArgumentException ( Tr . formatMessage ( tc , "SECURITY_SERVICE_ERROR_BAD_DOMAIN" , cfg...
public class PersistenceUtils { /** * If the given resource points to an AEM page , delete the page using PageManager . * Otherwise delete the resource using ResourceResolver . * @ param resource Resource to delete */ public static void deletePageOrResource ( Resource resource ) { } }
Page configPage = resource . adaptTo ( Page . class ) ; if ( configPage != null ) { try { log . trace ( "! Delete page {}" , configPage . getPath ( ) ) ; PageManager pageManager = configPage . getPageManager ( ) ; pageManager . delete ( configPage , false ) ; } catch ( WCMException ex ) { throw convertWCMException ( "U...
public class HubState { /** * Stops the hub . */ @ CommandArgument public void stop ( ) { } }
try { jobHub . shutdown ( ) ; jobHub = null ; Registry registry = getRegistry ( ) ; registry . unbind ( "AuthenticationService" ) ; System . out . println ( "Hub stopped" ) ; } catch ( Exception e ) { logger . error ( "An error occurred while stopping the hub" , e ) ; System . err . println ( "Hub did not shut down cle...
public class ItemDataTraversingVisitor { /** * Visit all child nodes . */ protected void visitChildNodes ( NodeData node ) throws RepositoryException { } }
if ( isInterrupted ( ) ) return ; for ( NodeData data : dataManager . getChildNodesData ( node ) ) { if ( isInterrupted ( ) ) return ; data . accept ( this ) ; }
public class VersionMonitor { /** * Gets the current VersionMonitor base on a Class that will load it ' s manifest file . * @ param clazz Class that will load the manifest MF file * @ return A { @ link VersionMonitor } pojo with the information . * @ throws IOException If Unable to read the Manifest file . */ pub...
Manifest manifest = new Manifest ( ) ; manifest . read ( clazz . getResourceAsStream ( MANIFEST_PATH ) ) ; return getVersion ( manifest ) ;
public class JsonReader { /** * Reads the next array * @ param < T > the component type of the array * @ param elementType class information for the component type * @ return the array * @ throws IOException Something went wrong reading the array */ public < T > T [ ] nextArray ( @ NonNull Class < T > elementTy...
return nextArray ( StringUtils . EMPTY , elementType ) ;
public class OCommandExecutorSQLCreateProperty { /** * Execute the CREATE PROPERTY . */ public Object execute ( final Map < Object , Object > iArgs ) { } }
if ( type == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; final ODatabaseRecord database = getDatabase ( ) ; final OClassImpl sourceClass = ( OClassImpl ) database . getMetadata ( ) . getSchema ( ) . getClass ( className ) ; if ( sourceClass == null )...
public class RequestBuilder { /** * Add a header to the request . Adds this value to any existing values for this name . * @ param name The name of the header * @ param value The value * @ return The request builder */ public RequestBuilder < T , ID > addHeader ( String name , String value ) { } }
headers . add ( name , value ) ; return this ;
public class XMLConfiguration { protected void initLoginConfig ( XmlParser . Node node ) { } }
XmlParser . Node method = node . get ( "auth-method" ) ; FormAuthenticator _formAuthenticator = null ; if ( method != null ) { Authenticator authenticator = null ; String m = method . toString ( false , true ) ; if ( SecurityConstraint . __FORM_AUTH . equals ( m ) ) authenticator = _formAuthenticator = new FormAuthenti...
public class FeatureOverlayQuery { /** * Perform a query based upon the map click location and build a info message * @ param latLng location * @ param view view * @ param map Google Map * @ return information message on what was clicked , or null */ public String buildMapClickMessage ( LatLng latLng , View vie...
return buildMapClickMessage ( latLng , view , map , null ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcDistributionControlElementType ( ) { } }
if ( ifcDistributionControlElementTypeEClass == null ) { ifcDistributionControlElementTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 160 ) ; } return ifcDistributionControlElementTypeEClass ;
public class ICalTimeZone { /** * Gets the observance information of a date . * @ param year the year * @ param month the month ( 1-12) * @ param day the day of the month * @ param hour the hour * @ param minute the minute * @ param second the second * @ return the observance information or null if none w...
if ( sortedObservances . isEmpty ( ) ) { return null ; } DateValue givenTime = new DateTimeValueImpl ( year , month , day , hour , minute , second ) ; int closestIndex = - 1 ; Observance closest = null ; DateValue closestValue = null ; for ( int i = 0 ; i < sortedObservances . size ( ) ; i ++ ) { Observance observance ...
public class LocalCall { /** * Calls a execution module function on the given target asynchronously and * returns information about the scheduled job that can be used to query the result . * Authentication is done with the token therefore you have to login prior * to using this function . * @ param client SaltC...
return callAsync ( client , target , auth , Optional . empty ( ) ) ;
public class EJBWrapper { /** * Adds the default definition for the Object . hashCode method . * @ param cw ASM ClassWriter to add the method to . * @ param implClassName name of the wrapper class being generated . */ private static void addDefaultHashCodeMethod ( ClassWriter cw , String implClassName ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , INDENT + "adding method : hashCode ()I" ) ; // public int hashCode ( ) final String desc = "()I" ; MethodVisitor mv = cw . visitMethod ( ACC_PUBLIC , "hashCode" , desc , null , null ) ; GeneratorAdapter mg = new GeneratorAdapte...
public class LocaleIDParser { /** * Advance index past language , and accumulate normalized language code in buffer . * Index must be at 0 when this is called . Index is left at a terminator or id * separator . Returns the start of the language code in the buffer . */ private int parseLanguage ( ) { } }
int startLength = buffer . length ( ) ; if ( haveExperimentalLanguagePrefix ( ) ) { append ( AsciiUtil . toLower ( id [ 0 ] ) ) ; append ( HYPHEN ) ; index = 2 ; } char c ; while ( ! isTerminatorOrIDSeparator ( c = next ( ) ) ) { append ( AsciiUtil . toLower ( c ) ) ; } -- index ; // unget if ( buffer . length ( ) - st...
public class ModelsImpl { /** * Get All Entity Roles for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId entity Id * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; EntityRole ...
return getClosedListEntityRolesWithServiceResponseAsync ( appId , versionId , entityId ) . map ( new Func1 < ServiceResponse < List < EntityRole > > , List < EntityRole > > ( ) { @ Override public List < EntityRole > call ( ServiceResponse < List < EntityRole > > response ) { return response . body ( ) ; } } ) ;
public class GeneratorRegistry { /** * Returns the path to use in the " build time process " to generate the * resource path for debug mode . * @ param path * the resource path * @ return the path to use in the " build time process " to generate the * resource path for debug mode . */ public String getDebugMo...
int idx = path . indexOf ( "?" ) ; String debugModeGeneratorPath = path . substring ( 0 , idx ) ; debugModeGeneratorPath = debugModeGeneratorPath . replaceAll ( "\\." , "/" ) ; int jawrGenerationParamIdx = path . indexOf ( JawrRequestHandler . GENERATION_PARAM ) ; String parameter = path . substring ( jawrGenerationPar...
public class CurationManager { /** * Shutdown method * @ throws PluginException * if any errors occur */ @ Override public void shutdown ( ) throws PluginException { } }
if ( storage != null ) { try { storage . shutdown ( ) ; } catch ( PluginException pe ) { log . error ( "Failed to shutdown storage: {}" , pe . getMessage ( ) ) ; throw pe ; } } if ( indexer != null ) { try { indexer . shutdown ( ) ; } catch ( PluginException pe ) { log . error ( "Failed to shutdown indexer: {}" , pe . ...
public class MaterialCameraCapture { /** * Native call to capture the frame of the video stream . */ protected String nativeCaptureToDataURL ( CanvasElement canvas , Element element , String mimeType ) { } }
VideoElement videoElement = ( VideoElement ) element ; int width = videoElement . getVideoWidth ( ) ; int height = videoElement . getVideoHeight ( ) ; if ( Double . isNaN ( width ) || Double . isNaN ( height ) ) { width = videoElement . getClientWidth ( ) ; height = videoElement . getClientHeight ( ) ; } canvas . setWi...
public class ModelControllerImpl { /** * Executes an operation on the controller * @ param operation the operation * @ param handler the handler * @ param control the transaction control * @ param attachments the operation attachments * @ return the result of the operation */ @ Override public ModelNode execu...
SecurityIdentity securityIdentity = securityIdentitySupplier . get ( ) ; OperationResponse or = securityIdentity . runAs ( ( PrivilegedAction < OperationResponse > ) ( ) -> internalExecute ( operation , handler , control , attachments , prepareStep , false , partialModelIndicator . isModelPartial ( ) ) ) ; ModelNode re...
public class JMThread { /** * Run with schedule scheduled future . * @ param delayMillis the delay millis * @ param runnable the runnable * @ return the scheduled future */ public static ScheduledFuture < ? > runWithSchedule ( long delayMillis , Runnable runnable ) { } }
return newSingleScheduledThreadPool ( ) . schedule ( buildRunnableWithLogging ( "runWithSchedule" , runnable , delayMillis ) , delayMillis , TimeUnit . MILLISECONDS ) ;
public class Sql { /** * If this SQL object was created with a Connection then this method commits * the connection . If this SQL object was created from a DataSource then * this method does nothing . * @ throws SQLException if a database access error occurs */ public void commit ( ) throws SQLException { } }
if ( useConnection == null ) { LOG . info ( "Commit operation not supported when using datasets unless using withTransaction or cacheConnection - attempt to commit ignored" ) ; return ; } try { useConnection . commit ( ) ; } catch ( SQLException e ) { LOG . warning ( "Caught exception committing connection: " + e . get...
public class Updater { /** * Update with the given appcast information in the specified targetDir * @ param appcast The appcast content ( containing the file to download ) * @ param targetDir The target directory for downloaded update files * @ return Updated files * @ throws Exception in case of an error */ pu...
Set < Path > files ; if ( appcast == null ) { throw new IllegalArgumentException ( "Appcast cannot be null!" ) ; } LOG . debug ( "Updating application ''{}''..." , appcast . getTitle ( ) ) ; // Download the update and verfiy it Path downloaded = appcastManager . download ( appcast , targetDir ) ; if ( downloaded == nul...
public class TimeoutImpl { /** * Restart the timer on a new thread in synchronous mode . * In this mode , a timeout only causes the thread to be interrupted , it does not directly set the result of the QueuedFuture . * This is needed when doing Retries or Fallback on an async thread . If the result is set directly ...
lock . writeLock ( ) . lock ( ) ; try { if ( this . timeoutTask == null ) { throw new IllegalStateException ( Tr . formatMessage ( tc , "internal.error.CWMFT4999E" ) ) ; } stop ( ) ; this . stopped = false ; long remaining = check ( ) ; Runnable timeoutTask = ( ) -> { newThread . interrupt ( ) ; } ; start ( timeoutTask...
public class Reflector { /** * do nothing when not exist * @ param obj * @ param prop * @ param value * @ throws PageException */ public static void callSetterEL ( Object obj , String prop , Object value ) throws PageException { } }
try { MethodInstance setter = getSetter ( obj , prop , value , null ) ; if ( setter != null ) setter . invoke ( obj ) ; } catch ( InvocationTargetException e ) { Throwable target = e . getTargetException ( ) ; if ( target instanceof PageException ) throw ( PageException ) target ; throw Caster . toPageException ( e . g...
public class BuildController { /** * Deletes a link between a build and another * @ param buildId From this build . . . * @ param targetBuildId . . . to this build * @ return List of builds */ @ RequestMapping ( value = "builds/{buildId}/links/{targetBuildId}" , method = RequestMethod . DELETE ) public Build dele...
Build build = structureService . getBuild ( buildId ) ; Build targetBuild = structureService . getBuild ( targetBuildId ) ; structureService . deleteBuildLink ( build , targetBuild ) ; return build ;
public class CmsDbExportView { /** * Sets the init values for check boxes . < p > */ private void setupCheckBoxes ( ) { } }
m_includeResource . setValue ( new Boolean ( true ) ) ; m_includeUnchanged . setValue ( new Boolean ( true ) ) ; m_includeSystem . setValue ( new Boolean ( true ) ) ; m_recursive . setValue ( new Boolean ( true ) ) ;
public class CreateMASCaseManager { /** * Method to close the file caseManager . It is called just one time , by the * MASReader , once every test and stroy have been added . * @ param caseManager */ public static void closeMASCaseManager ( File caseManager ) { } }
FileWriter caseManagerWriter ; try { caseManagerWriter = new FileWriter ( caseManager , true ) ; caseManagerWriter . write ( "}\n" ) ; caseManagerWriter . flush ( ) ; caseManagerWriter . close ( ) ; } catch ( IOException e ) { Logger logger = Logger . getLogger ( "CreateMASCaseManager.closeMASCaseManager" ) ; logger . ...
public class ExternalKoPeMeRunner { /** * Runs KoPeMe , and returns 0 , if everything works allright * @ return 0 , if everything works allright */ public int run ( ) { } }
try { if ( compile ) { compile ( ) ; } String separator = "/" ; String cpseperator = ":" ; if ( System . getProperty ( "os.name" ) . contains ( "indows" ) ) { separator = "\\" ; cpseperator = ";" ; } String s = fileName . replace ( separator , "." ) ; if ( ".java" . equals ( s . substring ( s . length ( ) - 5 ) ) ) { s...
public class ModuleItem { /** * If more PmiModule . listStatistics methods are implemented , * this method can be simplified as listData ( recursive ) * Leave it alone now . */ public StatsImpl getStats ( int [ ] dataIds , boolean recursive ) { } }
if ( dataIds == null ) return getStats ( recursive ) ; if ( instance == null ) return null ; SpdData [ ] dataList = instance . listData ( dataIds ) ; ModuleItem [ ] items = children ( ) ; ArrayList dataMembers = null ; // return data members ArrayList colMembers = null ; // return subcollection members // convert from ...
public class SassVaadinGenerator { /** * Compile the SASS source to a CSS source * @ param bundle * the bundle * @ param content * the resource content to compile * @ param path * the compiled resource path * @ param context * the generator context * @ return the compiled CSS content */ protected Stri...
try { JawrScssResolver scssResolver = new JawrScssResolver ( bundle , rsHandler ) ; JawrScssStylesheet sheet = new JawrScssStylesheet ( bundle , content , path , scssResolver , context . getCharset ( ) ) ; sheet . compile ( urlMode ) ; String parsedScss = sheet . printState ( ) ; addLinkedResources ( path , context , s...
public class EkstaziCFT { /** * Instrument all classfiles ( files that end with . class ) inside * the given jar and rewrite the existing jar . * This method can be simplified if we move Ekstazi code from Java * 6 to newer version . See * http : / / docs . oracle . com / javase / 7 / docs / technotes / guides /...
File jarFile = new File ( pathToFile ) ; // Use tmp file for output ( in the same directory ) . File newFile = File . createTempFile ( "any" , ".jar" , jarFile . getParentFile ( ) ) ; ZipInputStream zis = null ; ZipOutputStream zos = null ; try { zis = new ZipInputStream ( new FileInputStream ( jarFile ) ) ; zos = new ...
public class Frame { /** * Get the stack slot that will contain given method argument . Assumes that * this frame is at the location ( just before ) a method invocation * instruction . * @ param i * the argument index : 0 for first arg , etc . * @ param numArguments * total number of arguments to the called...
if ( i >= numArguments ) { throw new IllegalArgumentException ( ) ; } return ( slotList . size ( ) - numArguments ) + i ;
public class FastaReader { /** * Return next raw FASTA record or { @ literal null } if end of stream is reached . * < p > This method is thread - safe . < / p > * @ return next raw FASTA record or { @ literal null } if end of stream is reached */ public synchronized RawFastaRecord takeRawRecord ( ) { } }
RawFastaRecord rawFastaRecord ; try { rawFastaRecord = nextRawRecord ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } if ( rawFastaRecord == null ) isFinished = true ; return rawFastaRecord ;
public class TOTPBuilder { /** * Build a Time - based One - time Password { @ link TOTP } using the current * system time ( current time in milliseconds since the UNIX epoch ) . Note * that the builder instance can be reused for subsequent * configuration / generation calls . * @ return a Time - based One - tim...
long time = System . currentTimeMillis ( ) ; return new TOTP ( generateTOTP ( time ) , time , hmacShaAlgorithm , digits , timeStep ) ;
public class ProgressTracker { /** * Add a new Progress to the tracker . * @ param p Progress */ public synchronized void addProgress ( Progress p ) { } }
// Don ' t add more than once . Iterator < WeakReference < Progress > > iter = progresses . iterator ( ) ; while ( iter . hasNext ( ) ) { WeakReference < Progress > ref = iter . next ( ) ; // since we are at it anyway , remove old links . if ( ref . get ( ) == null ) { iter . remove ( ) ; } else { if ( ref . get ( ) ==...
public class LogicUtil { /** * Checks if the object equals one of the other objects given * @ param object to check * @ param objects to use equals against * @ return True if one of the objects equal the object */ public static < A , B > boolean equalsAny ( A object , B ... objects ) { } }
for ( B o : objects ) { if ( bothNullOrEqual ( o , object ) ) { return true ; } } return false ;
public class Log { /** * Register a Context . Factory to create a Log . */ public static void preRegister ( Context context , PrintWriter w ) { } }
context . put ( Log . class , ( Context . Factory < Log > ) ( c -> new Log ( c , w ) ) ) ;
public class TagTrackingCacheEventListener { /** * If the element has a TaggedCacheKey remove the tag associations */ protected void removeElement ( Ehcache cache , Element element ) { } }
final Set < CacheEntryTag > tags = this . getTags ( element ) ; // Check if the key is tagged if ( tags != null && ! tags . isEmpty ( ) ) { final String cacheName = cache . getName ( ) ; final LoadingCache < CacheEntryTag , Set < Object > > cacheKeys = taggedCacheKeys . getIfPresent ( cacheName ) ; // If there are trac...
public class dnsaction { /** * Use this API to add dnsaction . */ public static base_response add ( nitro_service client , dnsaction resource ) throws Exception { } }
dnsaction addresource = new dnsaction ( ) ; addresource . actionname = resource . actionname ; addresource . actiontype = resource . actiontype ; addresource . ipaddress = resource . ipaddress ; addresource . ttl = resource . ttl ; addresource . viewname = resource . viewname ; addresource . preferredloclist = resource...
public class SimpleRequestManager { @ Override public OptionalThing < String > getHeader ( String headerKey ) { } }
return OptionalThing . ofNullable ( getRequest ( ) . getHeader ( headerKey ) , ( ) -> { throw new RequestInfoNotFoundException ( "Not found the header for the request: key=" + headerKey + " path=" + getRequestPath ( ) ) ; } ) ;
public class FileColumn { /** * Set the column attributes from the given string in the format name = value [ : name = value . . . ] * @ param str The string containing the formatted attributes */ public void setAttributes ( String str ) { } }
str = str . trim ( ) ; String delimiter = ":" ; // default is colon delimiter , if ( str . indexOf ( ";" ) != - 1 ) // but use semi - colon with date format parameters ( eg . HH : mm ) delimiter = ";" ; StringTokenizer st = new StringTokenizer ( str , delimiter ) ; while ( st . hasMoreTokens ( ) ) { String token = st ....
public class MeshUtils { /** * Scale the mesh at x , y and z axis . * @ param mesh Mesh to be scaled . * @ param x Scale to be applied on x - axis . * @ param y Scale to be applied on y - axis . * @ param z Scale to be applied on z - axis . */ public static void scale ( GVRMesh mesh , float x , float y , float ...
final float [ ] vertices = mesh . getVertices ( ) ; final int vsize = vertices . length ; for ( int i = 0 ; i < vsize ; i += 3 ) { vertices [ i ] *= x ; vertices [ i + 1 ] *= y ; vertices [ i + 2 ] *= z ; } mesh . setVertices ( vertices ) ;
public class ClientSessionCache { /** * Clean out the cache after commit . * TODO keep hollow objects ? E . g . references to correct , e . t . c ! * @ param retainValues retainValues flag * @ param detachAllOnCommit detachAllOnCommit flag */ public void postCommit ( boolean retainValues , boolean detachAllOnComm...
int logSizeObjBefore = objs . size ( ) ; long t1 = System . nanoTime ( ) ; // TODO later : empty cache ( ? ) if ( ! deletedObjects . isEmpty ( ) ) { for ( ZooPC co : deletedObjects . values ( ) ) { if ( co . jdoZooIsDeleted ( ) ) { objs . remove ( co . jdoZooGetOid ( ) ) ; co . jdoZooGetContext ( ) . notifyEvent ( co ,...
public class PairtreeUtils { /** * Unclean the ID from the Pairtree path . * @ param aID A cleaned ID to unclean * @ return The unclean ID */ public static String decodeID ( final String aID ) { } }
Objects . requireNonNull ( aID , LOGGER . getMessage ( MessageCodes . PT_004 ) ) ; final StringBuilder idBuf = new StringBuilder ( ) ; for ( int index = 0 ; index < aID . length ( ) ; index ++ ) { final char character = aID . charAt ( index ) ; // Decode characters that need to be decoded according to Pairtree specific...
public class FactoryImageDenoise { /** * Denoises an image using VISU Shrink wavelet denoiser . * @ param imageType The type of image being transform . * @ param numLevels Number of levels in the wavelet transform . If not sure , try using 3. * @ param minPixelValue Minimum allowed pixel intensity value * @ par...
ImageDataType info = ImageDataType . classToType ( imageType ) ; WaveletTransform descTran = createDefaultShrinkTransform ( info , numLevels , minPixelValue , maxPixelValue ) ; DenoiseWavelet denoiser = FactoryDenoiseWaveletAlg . visu ( imageType ) ; return new WaveletDenoiseFilter < > ( descTran , denoiser ) ;
public class AnnotationUtil { /** * Attempts to get the riak user metadata from a domain object by looking * for a { @ literal @ RiakUsermeta } annotated field or getter method . * @ param < T > the type of the domain object * @ param metaContainer the RiakUserMetadata container * @ param domainObject the domai...
return AnnotationHelper . getInstance ( ) . getUsermetaData ( metaContainer , domainObject ) ;
public class NaiveBayesClassifier { /** * Read the Naive Bayes Model from HDFS */ public void init ( Configuration conf , Path generatedModel ) throws IOException , InterruptedException { } }
FileSystem fileSystem = FileSystem . get ( conf ) ; for ( Category category : Category . values ( ) ) { wordCountPerCategory . put ( category , new HashMap < String , Integer > ( ) ) ; // init token count } // Use a HashSet to calculate the total vocabulary size Set < String > vocabulary = new HashSet < String > ( ) ; ...
public class RenameHandler { /** * Creates an instance , providing the ability to load types in config files . * This is not normally used as the preferred option is to edit the singleton . * If the flag is set to true , the classpath config files will be used to register types and enums . * @ param loadFromClass...
RenameHandler handler = new RenameHandler ( ) ; if ( loadFromClasspath ) { handler . loadFromClasspath ( ) ; } return handler ;
public class QuickDrawContext { /** * TODO : All other operations can delegate to these ! : - ) */ private void frameShape ( final Shape pShape ) { } }
if ( isPenVisible ( ) ) { setupForPaint ( ) ; Stroke stroke = getStroke ( penSize ) ; Shape shape = stroke . createStrokedShape ( pShape ) ; graphics . draw ( shape ) ; }
public class TotalSupportTree { /** * Returns the set of frequent item sets . * @ param out a print stream for output of frequent item sets . * @ param list a container to store frequent item sets on output . * @ return the number of discovered frequent item sets */ private long getFrequentItemsets ( PrintStream ...
long n = 0 ; if ( root . children != null ) { for ( int i = 0 ; i < root . children . length ; i ++ ) { Node child = root . children [ i ] ; if ( child != null && child . support >= minSupport ) { int [ ] itemset = { child . id } ; n += getFrequentItemsets ( out , list , itemset , i , child ) ; } } } return n ;
public class AWSStorageGatewayClient { /** * Gets a description of a Server Message Block ( SMB ) file share settings from a file gateway . This operation is * only supported for file gateways . * @ param describeSMBSettingsRequest * @ return Result of the DescribeSMBSettings operation returned by the service . ...
request = beforeClientExecution ( request ) ; return executeDescribeSMBSettings ( request ) ;
public class RecursiveObjectWriter { /** * Recursively sets values of some ( all ) object and its subobjects properties . * The object can be a user defined object , map or array . Property values * correspondently are object properties , map key - pairs or array elements with * their indexes . * If some proper...
if ( values == null || values . size ( ) == 0 ) return ; for ( Map . Entry < String , Object > entry : values . entrySet ( ) ) { setProperty ( obj , entry . getKey ( ) , entry . getValue ( ) ) ; }
public class ClusterStateChangeReasonMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ClusterStateChangeReason clusterStateChangeReason , ProtocolMarshaller protocolMarshaller ) { } }
if ( clusterStateChangeReason == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( clusterStateChangeReason . getCode ( ) , CODE_BINDING ) ; protocolMarshaller . marshall ( clusterStateChangeReason . getMessage ( ) , MESSAGE_BINDING ) ; } catc...
public class VirtualMachineScaleSetsInner { /** * Redeploy one or more virtual machines in a VM scale set . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set . * @ param instanceIds The virtual machine scale set instance ids . Omitting the virtual m...
return ServiceFuture . fromResponse ( redeployWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceIds ) , serviceCallback ) ;
public class Symm { /** * Convenience Function * encode String into InputStream and call encode ( InputStream , OutputStream ) * @ param string * @ param out * @ throws IOException */ public void encode ( String string , OutputStream out ) throws IOException { } }
encode ( new ByteArrayInputStream ( string . getBytes ( ) ) , out ) ;
public class PasswordCipher { /** * If the cipher text decodes to an odd number of bytes , we can ' t go on ! */ private static void sanityCheckOnCipherBytes ( String cipherText , byte [ ] cipherBytes ) { } }
if ( cipherBytes . length % 2 != 0 ) { throw new IllegalStateException ( "Ciphered text decodes to an odd number of bytes! Text='" + cipherText + "', decodes to " + cipherBytes . length + " bytes." ) ; }
public class SecStrucTools { /** * Obtain the List of secondary structure elements ( SecStrucElement ) of a * Structure . * @ param s * Structure with SS assignments * @ return List of SecStrucElement objects */ public static List < SecStrucElement > getSecStrucElements ( Structure s ) { } }
List < SecStrucElement > listSSE = new ArrayList < SecStrucElement > ( ) ; GroupIterator iter = new GroupIterator ( s ) ; // SecStruc information - initialize SecStrucType type = SecStrucType . coil ; ResidueNumber previous = new ResidueNumber ( ) ; ResidueNumber start = new ResidueNumber ( ) ; String chainId = "" ; in...
public class AttrPause { /** * Creates a new attribute instance from the provided String . * @ param str string representation of the attribute * @ return attribute instance or { @ code null } if provided string is * { @ code null } * @ throws BOSHException on parse or validation failure */ static AttrPause cre...
if ( str == null ) { return null ; } else { return new AttrPause ( str ) ; }
public class FedoraObjectTripleGenerator_3_0 { /** * For the given datastream , add the triples that are common for all * datastreams . This will include : * < ul > * < li > object < i > view : disseminates < / i > datastream < / li > * < li > datastream < i > view : disseminationType < / i > < / li > * < li ...
URIReference dsURI = new SimpleURIReference ( new URI ( objURI . getURI ( ) . toString ( ) + "/" + ds . DatastreamID ) ) ; add ( objURI , VIEW . DISSEMINATES , dsURI , set ) ; URIReference dsDissType = new SimpleURIReference ( new URI ( FEDORA . uri + "*/" + ds . DatastreamID ) ) ; add ( dsURI , VIEW . DISSEMINATION_TY...
public class CmsSerialDateValue { /** * Extracts the dates from a JSON array . * @ param array the JSON array where the dates are stored in . * @ return list of the extracted dates . */ private SortedSet < Date > readDates ( JSONArray array ) { } }
if ( null != array ) { SortedSet < Date > result = new TreeSet < > ( ) ; for ( int i = 0 ; i < array . length ( ) ; i ++ ) { try { long l = Long . valueOf ( array . getString ( i ) ) . longValue ( ) ; result . add ( new Date ( l ) ) ; } catch ( NumberFormatException | JSONException e ) { LOG . error ( "Could not read d...
public class LogMgr { /** * Sets up a circular chain of pointers to the records in the page . There is * an integer added to the end of each log record whose value is the offset * of the previous log record . The first four bytes of the page contain an * integer whose value is the offset of the integer for the la...
myPage . setVal ( currentPos , new IntegerConstant ( getLastRecordPosition ( ) ) ) ; setPreviousNextRecordPosition ( currentPos + pointerSize ) ; setLastRecordPosition ( currentPos ) ; currentPos += pointerSize ; setNextRecordPosition ( currentPos ) ; // leave for next pointer currentPos += pointerSize ;
public class DeepLinkUtil { /** * Adds remote connection parameter to link GET query , * if parameter yet not present in this link . * @ param link link to add connection parameter * @ return link with remote connection GET parameter */ public static String makeDeepLink ( String link ) { } }
if ( link != null // If getCurrentRemoteConnectionLink ( ) = = null means there is no current remote connection && getCurrentRemoteConnectionLink ( ) != null // If containsRemoteParameter ( link ) is true means link already contain remote connection parameter && ! containsRemoteParameter ( link ) ) { link += ( link . c...
public class MultiAdditionNeighbourhood { /** * Generates a move for the given subset solution that adds a random subset of currently unselected IDs to the * selection . Possible fixed IDs are not considered to be selected . The maximum number of additions \ ( k \ ) and * maximum allowed subset size are respected ....
// get set of candidate IDs for addition ( fixed IDs are discarded ) Set < Integer > addCandidates = getAddCandidates ( solution ) ; // compute maximum number of adds int curMaxAdds = maxAdditions ( addCandidates , solution ) ; // return null if no additions are possible if ( curMaxAdds == 0 ) { return null ; } // pick...
public class BsScheduledJob { @ Override public Map < String , Object > toSource ( ) { } }
Map < String , Object > sourceMap = new HashMap < > ( ) ; if ( available != null ) { addFieldToSource ( sourceMap , "available" , available ) ; } if ( crawler != null ) { addFieldToSource ( sourceMap , "crawler" , crawler ) ; } if ( createdBy != null ) { addFieldToSource ( sourceMap , "createdBy" , createdBy ) ; } if (...
public class IO { /** * Zip a list of files into specified target file . * @ param target * the target file as the zip package * @ param files * the files to be zipped . */ public static void zipInto ( File target , File ... files ) { } }
ZipOutputStream zos = null ; try { zos = new ZipOutputStream ( new BufferedOutputStream ( new FileOutputStream ( target ) ) ) ; byte [ ] buffer = new byte [ 128 ] ; for ( File f : files ) { ZipEntry entry = new ZipEntry ( f . getName ( ) ) ; InputStream is = new BufferedInputStream ( new FileInputStream ( f ) ) ; zos ....
public class DependencyPipe { /** * Create feature alphabets , which maps 64 - bit feature code into * its integer index ( starting from index 0 ) . This method is called * before training a dependency model . * @ param file file path of the training data */ public void createAlphabets ( String file , String conl...
createDictionaries ( file , conllFormat ) ; long start = System . currentTimeMillis ( ) ; logger . debug ( "Creating Alphabet ... " ) ; HashSet < String > posTagSet = new HashSet < > ( ) ; HashSet < String > cposTagSet = new HashSet < > ( ) ; DependencyReader reader = DependencyReader . createDependencyReader ( conllFo...
public class JsonIOUtil { /** * Merges the { @ code message } with the byte array using the given { @ code schema } . */ public static < T > void mergeFrom ( byte [ ] data , int offset , int length , T message , Schema < T > schema , boolean numeric ) throws IOException { } }
final IOContext context = new IOContext ( DEFAULT_JSON_FACTORY . _getBufferRecycler ( ) , data , false ) ; final JsonParser parser = newJsonParser ( null , data , offset , offset + length , false , context ) ; /* final JsonParser parser = DEFAULT _ JSON _ FACTORY . createJsonParser ( data , offset , length ) ; */ try...
public class PHS398FellowshipSupplementalV1_2Generator { /** * This method is used to set additional information data to AdditionalInformation XMLObject from DevelopmentProposal , * ProposalYnq */ private void setAdditionalInformation ( AdditionalInformation additionalInformation ) { } }
Boolean hasInvestigator = false ; additionalInformation . addNewFellowshipTrainingAndCareerGoals ( ) ; additionalInformation . addNewActivitiesPlannedUnderThisAward ( ) ; ProposalPersonContract principalInvestigator = s2SProposalPersonService . getPrincipalInvestigator ( pdDoc ) ; for ( ProposalPersonContract proposalP...
public class MetricCommitter { /** * ~ Methods * * * * * */ @ Override public void run ( ) { } }
while ( ! Thread . currentThread ( ) . isInterrupted ( ) ) { try { List < Metric > dequeuedMetrics = collectionService . commitMetrics ( METRIC_MESSAGES_CHUNK_SIZE , TIMEOUT ) ; int noOfDatapointsCommitted = 0 ; for ( Metric metric : dequeuedMetrics ) { noOfDatapointsCommitted += metric . getDatapoints ( ) . size ( ) ;...
public class MailBuilder { /** * Sets the content of the message , both the plain text and HTML version . * @ param content the content of the message * @ return this builder * @ deprecated use { @ link # content ( Body ) } */ @ Deprecated public MailBuilder content ( net . sargue . mailgun . content . MailConten...
// NOSONAR return text ( content . text ( ) ) . html ( content . html ( ) ) ;
public class Mailer { /** * Actually instantiates and configures the { @ link Session } instance . Delegates resolving transport protocol specific properties to the * { @ link # transportStrategy } in two ways : * < ol > * < li > request an initial property list which the strategy may pre - populate < / li > * ...
Properties props = transportStrategy . generateProperties ( ) ; props . put ( transportStrategy . propertyNameHost ( ) , host ) ; props . put ( transportStrategy . propertyNamePort ( ) , String . valueOf ( port ) ) ; if ( username != null ) { props . put ( transportStrategy . propertyNameUsername ( ) , username ) ; } i...
public class VmlGraphicsContext { /** * Draw a circle on the < code > GraphicsContext < / code > . * @ param parent * parent group object * @ param name * The circle ' s name . * @ param position * The center position as a coordinate . * @ param radius * The circle ' s radius . * @ param style * The...
if ( isAttached ( ) ) { Element circle = helper . createOrUpdateElement ( parent , name , "oval" , style ) ; // Real position is the upper left corner of the circle : applyAbsolutePosition ( circle , new Coordinate ( position . getX ( ) - radius , position . getY ( ) - radius ) ) ; // width and height are both radius *...
public class DataStoreStash { /** * Lists all tables present in Stash . Note that tables that were present in EmoDB but empty during the * Stash operation are not listed . */ public Iterable < StashTable > listStashTables ( ) throws StashNotAvailableException { } }
final StashReader stashReader = _stashReader . getLockedView ( ) ; return new Iterable < StashTable > ( ) { @ Override public Iterator < StashTable > iterator ( ) { return stashReader . listTables ( ) ; } } ;
public class ParameterMetadataProvider { /** * Builds a new { @ link ParameterMetadata } for the given type and name . * @ param < T > * @ param part must not be { @ literal null } . * @ param type parameter type , must not be { @ literal null } . * @ param parameter * @ return */ private < T > ParameterMetad...
Assert . notNull ( type , "Type must not be null!" ) ; ParameterMetadata < T > value = new ParameterMetadata < T > ( type , parameter . getName ( ) . get ( ) , part . getType ( ) , bindableParameterValues == null ? ParameterMetadata . PLACEHOLDER : bindableParameterValues . next ( ) ) ; expressions . add ( value ) ; re...
public class ProcessorsProcessor { /** * / * ( non - Javadoc ) * @ see org . opoo . press . Processor # postGenerate ( org . opoo . press . Site ) */ @ Override public void postGenerate ( Site site ) { } }
if ( processors != null ) { for ( Processor p : processors ) { p . postGenerate ( site ) ; } }
public class FibonacciHeap { /** * { @ inheritDoc } * @ throws IllegalStateException * if the heap has already been used in the right hand side of a * meld */ @ Override @ ConstantTime ( amortized = true ) public AddressableHeap . Handle < K , V > insert ( K key , V value ) { } }
if ( other != this ) { throw new IllegalStateException ( "A heap cannot be used after a meld" ) ; } if ( key == null ) { throw new NullPointerException ( "Null keys not permitted" ) ; } Node < K , V > n = new Node < K , V > ( this , key , value ) ; addToRootList ( n ) ; size ++ ; return n ;
public class ClusterComputeResourceService { /** * Das method gets the current cluster configurations . * @ param connectionResources * @ param clusterMor * @ param clusterName * @ return * @ throws RuntimeFaultFaultMsg * @ throws InvalidPropertyFaultMsg */ private ClusterConfigInfoEx getClusterConfiguratio...
ObjectContent [ ] objectContents = GetObjectProperties . getObjectProperties ( connectionResources , clusterMor , new String [ ] { ClusterParameter . CONFIGURATION_EX . getValue ( ) } ) ; if ( objectContents != null && objectContents . length == 1 ) { List < DynamicProperty > dynamicProperties = objectContents [ 0 ] . ...
public class RoaringBitmap { /** * In - place bitwise AND ( intersection ) operation . The current bitmap is modified . * @ param x2 other bitmap */ public void and ( final RoaringBitmap x2 ) { } }
int pos1 = 0 , pos2 = 0 , intersectionSize = 0 ; final int length1 = highLowContainer . size ( ) , length2 = x2 . highLowContainer . size ( ) ; while ( pos1 < length1 && pos2 < length2 ) { final short s1 = highLowContainer . getKeyAtIndex ( pos1 ) ; final short s2 = x2 . highLowContainer . getKeyAtIndex ( pos2 ) ; if (...
public class PrePopulatedValidationSupport { /** * Add a new CodeSystem resource which will be available to the validator . Note that * { @ link CodeSystem # getUrl ( ) the URL field ) in this resource must contain a value as this * value will be used as the logical URL . */ public void addCodeSystem ( CodeSystem t...
Validate . notBlank ( theCodeSystem . getUrl ( ) , "theCodeSystem.getUrl() must not return a value" ) ; myCodeSystems . put ( theCodeSystem . getUrl ( ) , theCodeSystem ) ;
public class DynamicCounter { /** * Increment a counter specified by a name , and a sequence of ( key , value ) pairs . */ public static void increment ( String name , String ... tags ) { } }
final MonitorConfig . Builder configBuilder = MonitorConfig . builder ( name ) ; Preconditions . checkArgument ( tags . length % 2 == 0 , "The sequence of (key, value) pairs must have even size: one key, one value" ) ; try { for ( int i = 0 ; i < tags . length ; i += 2 ) { configBuilder . withTag ( tags [ i ] , tags [ ...
public class ProcessingContext { /** * Log a info message . */ void logNote ( String msg , Object ... args ) { } }
messager . printMessage ( Diagnostic . Kind . NOTE , String . format ( msg , args ) ) ;
public class SideBarUtils { /** * Gets all side bar sections for the specified UI class . * @ param uiClass the UI class , must not be { @ code null } . * @ return a collection of side bar section descriptors , never { @ code null } . * @ see SideBarSection # ui ( ) */ public Collection < SideBarSectionDescriptor...
List < SideBarSectionDescriptor > supportedSections = new ArrayList < SideBarSectionDescriptor > ( ) ; for ( SideBarSectionDescriptor section : sections ) { if ( section . isAvailableFor ( uiClass ) ) { supportedSections . add ( section ) ; } } return supportedSections ;
public class LongTupleNeighborhoodIterables { /** * Creates an iterable that provides iterators for iterating over the * Moore neighborhood of the given center and the given radius . < br > * < br > * If the given minimum - or maximum are non - < code > null < / code > , * they will be used for clamping the nei...
Objects . requireNonNull ( order , "The order is null" ) ; if ( min != null ) { Utils . checkForEqualSize ( center , min ) ; } if ( max != null ) { Utils . checkForEqualSize ( center , max ) ; } final LongTuple localCenter = LongTuples . copy ( center ) ; final LongTuple localMin = min == null ? null : LongTuples . cop...
public class JvmWildcardTypeReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public int eDerivedStructuralFeatureID ( int baseFeatureID , Class < ? > baseClass ) { } }
if ( baseClass == JvmConstraintOwner . class ) { switch ( baseFeatureID ) { case TypesPackage . JVM_CONSTRAINT_OWNER__CONSTRAINTS : return TypesPackage . JVM_WILDCARD_TYPE_REFERENCE__CONSTRAINTS ; default : return - 1 ; } } return super . eDerivedStructuralFeatureID ( baseFeatureID , baseClass ) ;
public class StandardRoadConnection { /** * Notify the iterators about changes . */ protected void fireIteratorUpdate ( ) { } }
if ( this . listeningIterators != null ) { for ( final IClockwiseIterator iterator : this . listeningIterators ) { if ( iterator != null ) { iterator . dataStructureUpdated ( ) ; } } }