signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ExtCompatibilityUtils { /** * Checks that amend extensions strictly compatible with descriptor object . * Used for amend annotations defined on method . * @ param descriptorType method descriptor type * @ param extensions amend extension annotations */ public static void checkAmendExtensionsCompatibi...
final List < Class < ? extends AmendMethodExtension > > exts = Lists . transform ( extensions , new Function < Annotation , Class < ? extends AmendMethodExtension > > ( ) { @ Nonnull @ Override public Class < ? extends AmendMethodExtension > apply ( @ Nonnull final Annotation input ) { return input . annotationType ( )...
public class BoundedOverlay { /** * Set the bounding box , provided as the indicated projection * @ param boundingBox bounding box * @ param projection projection */ public void setBoundingBox ( BoundingBox boundingBox , Projection projection ) { } }
ProjectionTransform projectionToWebMercator = projection . getTransformation ( ProjectionConstants . EPSG_WEB_MERCATOR ) ; webMercatorBoundingBox = boundingBox . transform ( projectionToWebMercator ) ;
public class AbstractArangoQuery { /** * Merges AqlQueryOptions derived from @ QueryOptions with dynamically passed AqlQueryOptions which takes priority * @ param oldStatic * @ param newDynamic * @ return */ protected AqlQueryOptions mergeQueryOptions ( final AqlQueryOptions oldStatic , final AqlQueryOptions newD...
if ( oldStatic == null ) { return newDynamic ; } if ( newDynamic == null ) { return oldStatic ; } final Integer batchSize = newDynamic . getBatchSize ( ) ; if ( batchSize != null ) { oldStatic . batchSize ( batchSize ) ; } final Integer maxPlans = newDynamic . getMaxPlans ( ) ; if ( maxPlans != null ) { oldStatic . max...
public class Interceptors { /** * Creates an interceptor chain . * @ param < T > the function parameter type * @ param < R > the function result type * @ param < I > the interceptor type * @ param innermost the function to be intercepted * @ param interceptors an iterable of interceptor * @ return the resul...
dbc . precondition ( interceptors != null , "cannot create an interceptor chain with a null iterable of interceptors" ) ; return new InterceptorChain < > ( innermost , interceptors . iterator ( ) ) ;
public class View { /** * Deletes this view . */ @ RequirePOST public synchronized void doDoDelete ( StaplerRequest req , StaplerResponse rsp ) throws IOException , ServletException { } }
checkPermission ( DELETE ) ; owner . deleteView ( this ) ; rsp . sendRedirect2 ( req . getContextPath ( ) + "/" + owner . getUrl ( ) ) ;
public class ClassPredicates { /** * Checks if a candidate class has at least one public constructor . * @ return the predicate . */ public static Predicate < Class < ? > > atLeastOneConstructorIsPublic ( ) { } }
return candidate -> candidate != null && Classes . from ( candidate ) . constructors ( ) . anyMatch ( executableModifierIs ( Modifier . PUBLIC ) ) ;
public class DiskStorageCache { /** * Commits the provided temp file to the cache , renaming it to match * the cache ' s hashing convention . */ private BinaryResource endInsert ( final DiskStorage . Inserter inserter , final CacheKey key , String resourceId ) throws IOException { } }
synchronized ( mLock ) { BinaryResource resource = inserter . commit ( key ) ; mResourceIndex . add ( resourceId ) ; mCacheStats . increment ( resource . size ( ) , 1 ) ; return resource ; }
public class ActionModeHelper { /** * implements the basic behavior of a CAB and multi select behavior onLongClick * @ param act the current Activity * @ param position the position of the clicked item * @ return the initialized ActionMode or null if nothing was done */ public ActionMode onLongClick ( AppCompatAc...
if ( mActionMode == null && mFastAdapter . getItem ( position ) . isSelectable ( ) ) { // may check if actionMode is already displayed mActionMode = act . startSupportActionMode ( mInternalCallback ) ; // we have to select this on our own as we will consume the event mSelectExtension . select ( position ) ; // update t...
public class Noun { /** * / * - - - - - [ Translate ] - - - - - */ private static String translate ( String word , List < Replacer > replacers ) { } }
// Scan uncountables and leave alone for ( String uncountable : uncountables ) { if ( uncountable . equals ( word ) ) return word ; } // Scan our patterns for a match and return the correct replacement for ( Replacer replacer : replacers ) { Matcher matcher = replacer . pattern . matcher ( word ) ; if ( matcher . match...
public class DefaultAssociatedEntityKeyMetadata { /** * Returns the name of the column in the target entity key corresponding to the given association key column . * E . g . let there be an entity key comprising the columns { @ code id . countryCode } and { @ code id . sequenceNo } which is * referenced by the colu...
int i = 0 ; for ( String column : associationKeyColumns ) { if ( associationKeyColumn . equals ( column ) ) { return entityKeyMetadata . getColumnNames ( ) [ i ] ; } i ++ ; } return null ;
public class PagerIndicator { /** * set the visibility of indicator . * @ param visibility */ public void setIndicatorVisibility ( IndicatorVisibility visibility ) { } }
if ( visibility == IndicatorVisibility . Visible ) { setVisibility ( View . VISIBLE ) ; } else { setVisibility ( View . INVISIBLE ) ; } resetDrawable ( ) ;
public class AbstractNlsBundleGenerator { /** * Generates an implementation of an { @ link NlsBundle } - method . * @ param sourceWriter is the { @ link SourceWriter } . * @ param logger is the { @ link TreeLogger } . * @ param context is the { @ link GeneratorContext } . * @ param method is the { @ link NlsBun...
generateSourcePublicMethodDeclaration ( sourceWriter , method ) ; generateMethodBody ( sourceWriter , logger , context , method ) ; generateSourceCloseBlock ( sourceWriter ) ;
public class InvertedCompareUtils { /** * return 1 if solution 2 is better */ public static int CrowdingDistanceCompare ( Solution solution1 , Solution solution2 ) { } }
double crowding1 = solution1 . getCrowdingDistance ( ) ; double crowding2 = solution2 . getCrowdingDistance ( ) ; if ( crowding1 > crowding2 ) { return - 1 ; } else if ( crowding1 < crowding2 ) { return 1 ; } else { return 0 ; }
public class AuthorizationDao { /** * Loads all the permissions granted to anonymous for the specified project < strong > stored in * _ ROLES * tables < / strong > . * An empty Set is returned if anonymous user has no permissions on the project . * < strong > This method does not support public components < / str...
return mapper ( dbSession ) . selectProjectPermissionsOfAnonymous ( projectUuid ) ;
public class Index { /** * delete a collection * @ throws PageException * @ throws SearchException */ private void doDelete ( ) throws PageException , SearchException { } }
required ( "index" , action , "collection" , collection ) ; if ( type != SearchIndex . TYPE_CUSTOM ) required ( "index" , action , "key" , key ) ; // no type defined if ( type == - 1 ) { if ( query != null ) { type = SearchIndex . TYPE_CUSTOM ; } else { Resource file = null ; try { file = ResourceUtil . toResourceExist...
public class DockerAssemblyManager { /** * visible for testing */ @ SuppressWarnings ( "deprecation" ) DockerFileBuilder createDockerFileBuilder ( BuildImageConfiguration buildConfig , AssemblyConfiguration assemblyConfig ) { } }
DockerFileBuilder builder = new DockerFileBuilder ( ) . env ( buildConfig . getEnv ( ) ) . labels ( buildConfig . getLabels ( ) ) . expose ( buildConfig . getPorts ( ) ) . run ( buildConfig . getRunCmds ( ) ) . volumes ( buildConfig . getVolumes ( ) ) . user ( buildConfig . getUser ( ) ) ; if ( buildConfig . getMaintai...
public class GravatarUrlBuilder { /** * Helper method to create MD5 encoded < code > String < / code > objects . * @ param message message to be encoded * @ return An MD5 encoded version of the input string */ private static String md5Hex ( String message ) { } }
try { final MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; final byte [ ] array = md . digest ( message . getBytes ( "UTF-8" ) ) ; final StringBuilder sb = new StringBuilder ( ) ; for ( final byte b : array ) { sb . append ( Integer . toHexString ( ( b & 0xFF ) | 0x100 ) . substring ( 1 , 3 ) ) ; } return s...
public class JavaMethod { /** * exports the method . */ public JavaMethod export ( JavaClass source , JavaClass target ) { } }
JavaMethod method = new JavaMethod ( _loader ) ; method . setName ( _name ) ; method . setDescriptor ( _descriptor ) ; method . setAccessFlags ( _accessFlags ) ; target . getConstantPool ( ) . addUTF8 ( _name ) ; target . getConstantPool ( ) . addUTF8 ( _descriptor ) ; for ( int i = 0 ; i < _attributes . size ( ) ; i +...
public class Mediawiki { /** * get a String from a given URL * @ param urlString * @ return */ public static String getStringFromUrl ( String urlString ) { } }
ApacheHttpClient lclient = ApacheHttpClient . create ( ) ; WebResource webResource = lclient . resource ( urlString ) ; ClientResponse response = webResource . get ( ClientResponse . class ) ; if ( response . getStatus ( ) != 200 ) { throw new RuntimeException ( "HTTP error code : " + response . getStatus ( ) ) ; } Str...
public class Utils { /** * Compute the CRC32 of the segment of the byte array given by the * specificed size and offset * @ param bytes The bytes to checksum * @ param offset the offset at which to begin checksumming * @ param size the number of bytes to checksum * @ return The CRC32 */ public static long crc...
CRC32 crc = new CRC32 ( ) ; crc . update ( bytes , offset , size ) ; return crc . getValue ( ) ;
public class ExecutionJobVertex { public StringifiedAccumulatorResult [ ] getAggregatedUserAccumulatorsStringified ( ) { } }
Map < String , OptionalFailure < Accumulator < ? , ? > > > userAccumulators = new HashMap < > ( ) ; for ( ExecutionVertex vertex : taskVertices ) { Map < String , Accumulator < ? , ? > > next = vertex . getCurrentExecutionAttempt ( ) . getUserAccumulators ( ) ; if ( next != null ) { AccumulatorHelper . mergeInto ( user...
public class PeerManager { /** * Registers a stale cache observer . */ public void addStaleCacheObserver ( String cache , StaleCacheObserver observer ) { } }
ObserverList < StaleCacheObserver > list = _cacheobs . get ( cache ) ; if ( list == null ) { list = ObserverList . newFastUnsafe ( ) ; _cacheobs . put ( cache , list ) ; } list . add ( observer ) ;
public class QYWeixinSupport { /** * 自定义的消息事件处理 * @ param msg 微信消息 * @ return 响应结果 */ private QYBaseRespMsg processMessageHandle ( QYBaseReqMsg msg ) { } }
if ( CollectionUtil . isEmpty ( messageHandles ) ) { synchronized ( LOCK ) { messageHandles = this . initMessageHandles ( ) ; } } if ( CollectionUtil . isNotEmpty ( messageHandles ) ) { for ( QYMessageHandle messageHandle : messageHandles ) { QYBaseRespMsg resultMsg = null ; boolean result ; try { result = messageHandl...
public class PLPageSetPrepareResult { /** * Set the page header height . * @ param fHeaderHeight * Height without margin , border and padding . */ void setHeaderHeight ( final float fHeaderHeight ) { } }
// Set the maximum value only if ( Float . isNaN ( m_fHeaderHeight ) ) m_fHeaderHeight = fHeaderHeight ; else m_fHeaderHeight = Math . max ( m_fHeaderHeight , fHeaderHeight ) ;
public class Stripe { /** * Blocking method to create a { @ link Token } . Do not call this on the UI thread or your app * will crash . * @ param card the { @ link Card } to use for this token * @ param publishableKey the publishable key to use with this request * @ return a { @ link Token } that can be used fo...
validateKey ( publishableKey ) ; RequestOptions requestOptions = RequestOptions . builder ( publishableKey , mStripeAccount , RequestOptions . TYPE_QUERY ) . build ( ) ; return mApiHandler . createToken ( mStripeNetworkUtils . hashMapFromCard ( card ) , requestOptions , Token . TYPE_CARD ) ;
public class RolloverLogBase { /** * Closes the log , flushing the results . */ public void close ( ) throws IOException { } }
_isClosed = true ; _rolloverWorker . wake ( ) ; _rolloverWorker . close ( ) ; synchronized ( _logLock ) { closeLogStream ( ) ; } Alarm alarm = _rolloverAlarm ; _rolloverAlarm = null ; if ( alarm != null ) alarm . dequeue ( ) ;
public class FileDescriptorLimit { /** * * List all the open file descriptors . For Unix systems this information can be obtained by * * going to / proc / self / fd . This will translate self to the correct PID of the current java * * process . Each file in the folder is a symlink to the location of the file descri...
writer . println ( ) ; writer . println ( "All open files" ) ; writer . println ( "==============" ) ; File [ ] files = new File ( "/proc/self/fd" ) . listFiles ( ) ; if ( files != null ) { for ( File file : files ) { try { writer . println ( Util . resolveSymlink ( file ) ) ; } catch ( IOException e ) { // If we fail ...
public class ClientHandler { /** * Handle the client connection as follows : * < ul > * < li > read the object sent by client using { @ link ObjectInputStream } < / li > * < li > Check if the sent object is instance of { @ link MethodCallInfo } , if not * warn the user and then return < / li > * < li > Create...
try { ClientHandler . logger . info ( "hanlding client request" ) ; final ObjectInputStream in = new ObjectInputStream ( this . client . getInputStream ( ) ) ; final Object object = in . readObject ( ) ; if ( object instanceof MethodCallInfo ) { ClientHandler . logger . info ( "request received : " + object ) ; final M...
public class AmazonEC2Client { /** * Describes one or more flow logs . To view the information in your flow logs ( the log streams for the network * interfaces ) , you must use the CloudWatch Logs console or the CloudWatch Logs API . * @ param describeFlowLogsRequest * @ return Result of the DescribeFlowLogs oper...
request = beforeClientExecution ( request ) ; return executeDescribeFlowLogs ( request ) ;
public class CmsJspContentAccessValueWrapper { /** * Returns a lazy initialized Map that provides the Lists of sub values directly below * the current value from the XML content . < p > * The provided Map key is assumed to be a String that represents the relative xpath to the value . * Use this method in case you...
if ( m_subValueList == null ) { m_subValueList = CmsCollectionsGenericWrapper . createLazyMap ( new CmsSubValueListTransformer ( ) ) ; } return m_subValueList ;
public class ProcessClosureProvidesAndRequires { /** * Registers ProvidedNames for prefix namespaces if they haven ' t already been defined . The prefix * namespaces must be registered in order from shortest to longest . * @ param ns The namespace whose prefixes may need to be provided . * @ param node The EXPR o...
int pos = ns . indexOf ( '.' ) ; while ( pos != - 1 ) { String prefixNs = ns . substring ( 0 , pos ) ; pos = ns . indexOf ( '.' , pos + 1 ) ; if ( providedNames . containsKey ( prefixNs ) ) { providedNames . get ( prefixNs ) . addProvide ( node , module , /* explicit = */ false ) ; } else { providedNames . put ( prefix...
public class ClassUtils { /** * Get the Class from the class name . * @ param name * the class name . * @ param cl * the class loader to use , if null then the defining class loader of this class will * be utilized . * @ return the Class , otherwise null if the class cannot be found . * @ throws ClassNotF...
if ( cl != null ) { try { return Class . forName ( name , false , cl ) ; } catch ( final ClassNotFoundException | NoClassDefFoundError e ) { // fall through and try with default classloader } } return Class . forName ( name ) ;
public class AlphabeticIndex { /** * Clear the index . * @ return this , for chaining */ public AlphabeticIndex < V > clearRecords ( ) { } }
if ( inputList != null && ! inputList . isEmpty ( ) ) { inputList . clear ( ) ; buckets = null ; } return this ;
public class Scan { /** * Gets the value of the precursorMz property . * This accessor method returns a reference to the live list , not a snapshot . Therefore any * modification you make to the returned list will be present inside the JAXB object . This is why * there is not a < CODE > set < / CODE > method for ...
if ( precursorMz == null ) { precursorMz = new ArrayList < Scan . PrecursorMz > ( ) ; } return this . precursorMz ;
public class CmsDriverManager { /** * Reads the manager group of a project . < p > * @ param dbc the current database context * @ param project the project to read from * @ return the group of a resource */ public CmsGroup readManagerGroup ( CmsDbContext dbc , CmsProject project ) { } }
try { return readGroup ( dbc , project . getManagerGroupId ( ) ) ; } catch ( CmsException exc ) { // the group does not exist any more - return a dummy - group return new CmsGroup ( CmsUUID . getNullUUID ( ) , CmsUUID . getNullUUID ( ) , project . getManagerGroupId ( ) + "" , "deleted group" , 0 ) ; }
public class ResourceGroovyMethods { /** * Processes each descendant file in this directory and any sub - directories . * Processing consists of potentially calling < code > closure < / code > passing it the current * file ( which may be a normal file or subdirectory ) and then if a subdirectory was encountered , ...
Number maxDepthNumber = DefaultGroovyMethods . asType ( options . remove ( "maxDepth" ) , Number . class ) ; int maxDepth = maxDepthNumber == null ? - 1 : maxDepthNumber . intValue ( ) ; Boolean visitRoot = DefaultGroovyMethods . asType ( get ( options , "visitRoot" , false ) , Boolean . class ) ; Boolean preRoot = Def...
public class DashboardEndpoint { /** * GET dashboard data * @ param request the request * @ return { @ link DashboardData } for the given user */ @ GET @ Produces ( MediaType . APPLICATION_JSON ) public Response totalApplications ( @ Context HttpServletRequest request ) { } }
final DashboardData dataForUser = service . getSearchService ( ) . loadDashboardData ( ) ; return Response . ok ( dataForUser ) . build ( ) ;
public class MultipartHttpMessageConverter { /** * Generate a multipart boundary . * < p > The default implementation returns a random boundary . * Can be overridden in subclasses . */ private String generateMultipartBoundary ( ) { } }
byte [ ] boundary = new byte [ this . random . nextInt ( 11 ) + 30 ] ; for ( int i = 0 ; i < boundary . length ; i ++ ) { boundary [ i ] = BOUNDARY_CHARS [ this . random . nextInt ( BOUNDARY_CHARS . length ) ] ; } final String constructedBoundry = "----" + new String ( boundary , Charsets . US_ASCII ) ; return construc...
public class AddOnLoader { /** * Returns all the { @ code Extension } s of all the installed add - ons . * The discovery of { @ code Extension } s is done by resorting to the { @ link AddOn # MANIFEST _ FILE _ NAME manifest file } bundled in * the add - ons . * Extensions with unfulfilled dependencies are not be ...
List < Extension > list = new ArrayList < Extension > ( ) ; for ( AddOn addOn : getAddOnCollection ( ) . getAddOns ( ) ) { list . addAll ( getExtensions ( addOn ) ) ; } return list ;
public class BlurDialogEngine { /** * Retrieve action bar height . * @ return action bar height in px . */ private int getActionBarHeight ( ) { } }
int actionBarHeight = 0 ; try { if ( mToolbar != null ) { actionBarHeight = mToolbar . getHeight ( ) ; } else if ( mHoldingActivity instanceof ActionBarActivity ) { ActionBar supportActionBar = ( ( ActionBarActivity ) mHoldingActivity ) . getSupportActionBar ( ) ; if ( supportActionBar != null ) { actionBarHeight = sup...
public class IdentityArrayList { /** * Inserts the specified element at the specified position in this * list . Shifts the element currently at that position ( if any ) and * any subsequent elements to the right ( adds one to their indices ) . * @ param index index at which the specified element is to be inserted...
rangeCheckForAdd ( index ) ; ensureCapacity ( size + 1 ) ; // Increments modCount ! ! System . arraycopy ( elementData , index , elementData , index + 1 , size - index ) ; elementData [ index ] = element ; size ++ ;
public class PortalEventDimensionPopulatorImpl { /** * Populate the term / quarter data for dimensions that are missing the data */ final void doUpdateDateDimensions ( ) { } }
final List < DateDimension > dateDimensions = this . dateDimensionDao . getDateDimensionsWithoutTerm ( ) ; final List < AcademicTermDetail > academicTermDetails = this . eventAggregationManagementDao . getAcademicTermDetails ( ) ; for ( final DateDimension dateDimension : dateDimensions ) { final DateMidnight date = da...
public class DeletePendingAggregationRequestRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeletePendingAggregationRequestRequest deletePendingAggregationRequestRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deletePendingAggregationRequestRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deletePendingAggregationRequestRequest . getRequesterAccountId ( ) , REQUESTERACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( deletePendingA...
public class DomXmlMessageValidator { /** * Handle element node . * @ param received * @ param source * @ param validationContext */ private void doElement ( Node received , Node source , XmlMessageValidationContext validationContext , NamespaceContext namespaceContext , TestContext context ) { } }
doElementNameValidation ( received , source ) ; doElementNamespaceValidation ( received , source ) ; // check if element is ignored either by xpath or by ignore placeholder in source message if ( XmlValidationUtils . isElementIgnored ( source , received , validationContext . getIgnoreExpressions ( ) , namespaceContext ...
public class CircuitBreaker { /** * Specifies the failure tolerance limit for the { @ link * DefaultFailureInterpreter } that comes with a { @ link * CircuitBreaker } by default . * @ see DefaultFailureInterpreter * @ param limit the number of tolerated failures in a window */ public void setLimit ( int limit )...
FailureInterpreter fi = getFailureInterpreter ( ) ; if ( ! ( fi instanceof DefaultFailureInterpreter ) ) { throw new IllegalStateException ( "setLimit() not supported: this CircuitBreaker's FailureInterpreter isn't a DefaultFailureInterpreter." ) ; } ( ( DefaultFailureInterpreter ) fi ) . setLimit ( limit ) ;
public class CameraEncoder { /** * Sets the requested flash mode and restarts the * camera preview . This will take effect immediately * or as soon as the camera preview becomes active . * Called from UI thread */ public void requestFlash ( String desiredFlash ) { } }
mDesiredFlash = desiredFlash ; /* If mCamera for some reason is null now flash mode will be applied * next time the camera opens through mDesiredFlash . */ if ( mCamera == null ) { Log . w ( TAG , "Ignoring requestFlash: Camera isn't available now." ) ; return ; } Parameters params = mCamera . getParameters ( ) ; Lis...
public class TableUtilities { /** * Suffix a TableLocation * @ param inputTable Input table * @ param suffix Suffix * @ return suffixed TableLocation */ public static TableLocation suffixTableLocation ( TableLocation inputTable , String suffix ) { } }
return new TableLocation ( inputTable . getCatalog ( ) , inputTable . getSchema ( ) , inputTable . getTable ( ) + suffix ) ;
public class BsCrawlingInfoCB { public CrawlingInfoCB acceptPK ( String id ) { } }
assertObjectNotNull ( "id" , id ) ; BsCrawlingInfoCB cb = this ; cb . query ( ) . docMeta ( ) . setId_Equal ( id ) ; return ( CrawlingInfoCB ) this ;
public class RingBufferLogHandler { /** * Returns the list view of { @ link LogRecord } s in the ring buffer . * New records are always placed early in the list . */ public List < LogRecord > getView ( ) { } }
return new AbstractList < LogRecord > ( ) { public LogRecord get ( int index ) { // flip the order synchronized ( RingBufferLogHandler . this ) { return records [ ( start + ( size - ( index + 1 ) ) ) % records . length ] ; } } public int size ( ) { return size ; } } ;
public class UpdateGlobalTableSettingsRequest { /** * Represents the settings of a global secondary index for a global table that will be modified . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setGlobalTableGlobalSecondaryIndexSettingsUpdate ( java . util...
if ( this . globalTableGlobalSecondaryIndexSettingsUpdate == null ) { setGlobalTableGlobalSecondaryIndexSettingsUpdate ( new java . util . ArrayList < GlobalTableGlobalSecondaryIndexSettingsUpdate > ( globalTableGlobalSecondaryIndexSettingsUpdate . length ) ) ; } for ( GlobalTableGlobalSecondaryIndexSettingsUpdate ele ...
public class LanguageProfileReader { /** * Reads all built - in language profiles from the " languages " folder ( shipped with the jar ) . */ public List < LanguageProfile > readAllBuiltIn ( ) throws IOException { } }
List < LanguageProfile > loaded = new ArrayList < > ( ) ; for ( LdLocale locale : BuiltInLanguages . getLanguages ( ) ) { loaded . add ( readBuiltIn ( locale ) ) ; } return loaded ;
public class CircuitBreakerStatus { /** * Copy the current immutable object by setting a value for the { @ link AbstractCircuitBreakerStatus # getTotalSuccessCount ( ) totalSuccessCount } attribute . * A value equality check is used to prevent copying of the same value by returning { @ code this } . * @ param value...
if ( this . totalSuccessCount == value ) return this ; long newValue = value ; return new CircuitBreakerStatus ( this . id , this . timestamp , this . state , newValue , this . totalFailureCount , this . latencyMicros , this . throughputOneMinute , this . failedThroughputOneMinute ) ;
public class SlideStackModel { /** * Get the animation to use between slides . * @ param isReverse true for reverse mode * @ param previousSlideModel the previous slide model * @ param selectedSlideModel the current slide model * @ return the animation to show */ private ParallelTransition buildSlideTransition ...
final ParallelTransition slideAnimation = ParallelTransitionBuilder . create ( ) . build ( ) ; if ( previousSlideModel != null ) { final Animation a = isReverse ? previousSlideModel . getShowAnimation ( ) : previousSlideModel . getHideAnimation ( ) ; if ( a != null ) { slideAnimation . getChildren ( ) . add ( a ) ; } }...
public class TaxonomyParser { /** * Return true if at least one of the values is not null / empty . * @ param label the label text * @ param score the sentiment score * @ return true if at least one of the values is not null / empty */ private boolean isValidTaxonomy ( final String label , final Double score ) { ...
return ! StringUtils . isBlank ( label ) || score != null ;
public class EllipticCurveProvider { /** * Transcodes the JCA ASN . 1 / DER - encoded signature into the concatenated * R + S format expected by ECDSA JWS . * @ param derSignature The ASN1 . / DER - encoded . Must not be { @ code null } . * @ param outputLength The expected length of the ECDSA JWS signature . *...
if ( derSignature . length < 8 || derSignature [ 0 ] != 48 ) { throw new JwtException ( "Invalid ECDSA signature format" ) ; } int offset ; if ( derSignature [ 1 ] > 0 ) { offset = 2 ; } else if ( derSignature [ 1 ] == ( byte ) 0x81 ) { offset = 3 ; } else { throw new JwtException ( "Invalid ECDSA signature format" ) ;...
public class NetworkInterface { /** * A list of the private IP addresses associated with the network interface . Includes the privateDnsName and * privateIpAddress . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPrivateIpAddresses ( java . util . Colle...
if ( this . privateIpAddresses == null ) { setPrivateIpAddresses ( new java . util . ArrayList < PrivateIp > ( privateIpAddresses . length ) ) ; } for ( PrivateIp ele : privateIpAddresses ) { this . privateIpAddresses . add ( ele ) ; } return this ;
public class FSNamesystem { /** * Increment number of blocks that reached minimal replication . * @ param replication current replication * @ param skipCheck if true the safemode will not be checked - * used for processing initial block reports to skip the * check for every block - at the end checkSafeMode ( ) ...
if ( safeMode != null && safeMode . isOn ( ) ) { if ( ( int ) replication == minReplication ) { this . blocksSafe ++ ; if ( ! skipCheck ) { safeMode . checkMode ( ) ; } } }
public class GenJsCodeVisitor { /** * Example : * < pre > * / / This file was automatically generated from my - templates . soy . * / / Please don ' t edit this file by hand . * if ( typeof boo = = ' undefined ' ) { var boo = { } ; } * if ( typeof boo . foo = = ' undefined ' ) { boo . foo = { } ; } * < / pr...
StringBuilder file = new StringBuilder ( ) ; file . append ( "// This file was automatically generated from " ) . append ( node . getFileName ( ) ) . append ( ".\n" ) ; file . append ( "// Please don't edit this file by hand.\n" ) ; // Output a section containing optionally - parsed compiler directives in comments . Si...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getEPT ( ) { } }
if ( eptEClass == null ) { eptEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 258 ) ; } return eptEClass ;
public class PartitionReplicaSyncRequest { /** * Checks if we are the primary owner of the partition . */ private boolean checkPartitionOwner ( ) { } }
InternalPartitionServiceImpl partitionService = getService ( ) ; PartitionStateManager partitionStateManager = partitionService . getPartitionStateManager ( ) ; InternalPartitionImpl partition = partitionStateManager . getPartitionImpl ( getPartitionId ( ) ) ; PartitionReplica owner = partition . getOwnerReplicaOrNull ...
public class WordNet { /** * Gets relation . * @ param from the from * @ param to the to * @ return the relation */ public WordNetRelation getRelation ( Sense from , Sense to ) { } }
if ( from == null || to == null ) { return null ; } return db . getRelation ( from , to ) ;
public class FastStringBuffer { /** * Directly set how much of the FastStringBuffer ' s storage is to be * considered part of its content . This is a fast but hazardous * operation . It is not protected against negative values , or values * greater than the amount of storage currently available . . . and even *...
m_lastChunk = l >>> m_chunkBits ; if ( m_lastChunk == 0 && m_innerFSB != null ) { // Replace this FSB with the appropriate inner FSB , truncated m_innerFSB . setLength ( l , this ) ; } else { m_firstFree = l & m_chunkMask ; // There ' s an edge case if l is an exact multiple of m _ chunkBits , which risks leaving // us...
public class ActionUtil { /** * Adds / removes an action listener to / from a component using the default click trigger event . * @ param component Component to be associated with the action . * @ param action Action to invoke when listener event is triggered . If null , dissociates the * event listener from the ...
return addAction ( component , action , ClickEvent . TYPE ) ;
public class BoxFile { /** * Gets a list of any comments on this file . * @ return a list of comments on this file . */ public List < BoxComment . Info > getComments ( ) { } }
URL url = GET_COMMENTS_URL_TEMPLATE . build ( this . getAPI ( ) . getBaseURL ( ) , this . getID ( ) ) ; BoxAPIRequest request = new BoxAPIRequest ( this . getAPI ( ) , url , "GET" ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; JsonObject responseJSON = JsonObject . readFrom ( response . getJSON...
public class CpdReporter { /** * Also set second field to trim leading whitespaces . * < i > Information : < / i > Use reflection because neither proper constructor for setting both fields nor setter are * available . */ private void setTrimLeadingWhitespacesByReflection ( Renderer result , boolean trimLeadingCommo...
String fieldName = "trimLeadingWhitespace" ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Try setting '{}' field to '{}' for '{}' by reflection." , fieldName , trimLeadingCommonSourceWhitespaces , result ) ; } try { Field field = SimpleRenderer . class . getDeclaredField ( fieldName ) ; field . setAccessible ...
public class BinaryLog { /** * The parseCmdLineArgs method . * This method parses the cmd line args and stores them into the local variables . * @ param args * - command line arguments to LogViewer */ @ Override protected boolean parseCmdLineArgs ( String [ ] args ) throws IllegalArgumentException { } }
if ( action . equals ( ACTION_HELP ) ) { if ( args . length == 0 ) helpAction ( null ) ; else helpAction ( args [ 0 ] ) ; return true ; } if ( action . equals ( ACTION_VIEW ) ) { parseOptions ( args , viewActionOptions ) ; return false ; } else if ( action . equals ( ACTION_LISTINSTANCES ) ) { parseOptions ( args , lis...
public class Utils { /** * same as ARFF dense format but without headers * */ public static File writeUCI ( TrainingCorpus corpus , Lexicon lexicon , boolean b , String vector_location , Map < Integer , Integer > attributeMapping ) throws IOException { } }
File vectorFile = new File ( vector_location ) ; PrintWriter out = null ; out = new PrintWriter ( new FileWriter ( vectorFile ) ) ; // dump the content of the lexicon file int attributeNum = lexicon . getAttributesNum ( ) ; // get an iterator on the Corpus // and retrieve the documents one by one Iterator < Document > ...
public class MemcachedClient { /** * Get the values for multiple keys from the cache . * @ param < T > * @ param keyIter Iterator that produces the keys * @ param tc the transcoder to serialize and unserialize value * @ return a map of the values ( for each value that exists ) * @ throws OperationTimeoutExcep...
try { return asyncGetBulk ( keyIter , tc ) . get ( operationTimeout , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Interrupted getting bulk values" , e ) ; } catch ( ExecutionException e ) { if ( e . getCause ( ) instanceof CancellationException ) { throw ( Cancellation...
public class ConverterRegistry { /** * Registers a converter . * @ param < T > Tag type to convert from . * @ param < V > Value type to convert to . * @ param tag Tag type class to register the converter to . * @ param type Value type class to register the converter to . * @ param converter Converter to regis...
if ( tagToConverter . containsKey ( tag ) ) { throw new ConverterRegisterException ( "Type conversion to tag " + tag . getName ( ) + " is already registered." ) ; } if ( typeToConverter . containsKey ( type ) ) { throw new ConverterRegisterException ( "Tag conversion to type " + type . getName ( ) + " is already regist...
public class JMessageClient { /** * Get admins by appkey * @ param start The start index of the list * @ param count The number that how many you want to get from list * @ return admin user info list * @ throws APIConnectionException connect exception * @ throws APIRequestException request exception */ public...
return _userClient . getAdminListByAppkey ( start , count ) ;
public class KAMStoreImpl { /** * { @ inheritDoc } */ @ Override public List < TermParameter > getTermParameters ( final KamInfo ki , final BelTerm belTerm ) { } }
if ( ki == null ) throw new InvalidArgument ( "missing KAM info" ) ; if ( belTerm == null ) throw new InvalidArgument ( "missing BEL term" ) ; if ( ! exists ( ki ) ) return null ; try { return kamStoreDao ( ki ) . getTermParameters ( belTerm ) ; } catch ( SQLException e ) { final String fmt = "error getting term parame...
public class CleaningWeakReferenceMap { /** * Removes all cleared entries from this map ( i . e . entries whose value * is a cleared { @ link WeakReference } ) . */ private void clean ( ) { } }
Iterator < Entry < K , WeakReference < V > > > iter = entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Entry < K , WeakReference < V > > e = iter . next ( ) ; if ( e != null && e . getValue ( ) != null && e . getValue ( ) . get ( ) == null ) { iter . remove ( ) ; } }
public class JarBuilder { /** * Builds a JAR from the given option . * @ return file URI referencing the JAR in a temporary directory */ public URI buildJar ( ) { } }
if ( option . getName ( ) == null ) { option . name ( UUID . randomUUID ( ) . toString ( ) ) ; } try { File explodedJarDir = getExplodedJarDir ( ) ; File probeJar = new File ( tempDir , option . getName ( ) + ".jar" ) ; ZipBuilder builder = new ZipBuilder ( probeJar ) ; builder . addDirectory ( explodedJarDir , "" ) ; ...
public class SnappyServer { /** * Define a REST endpoint mapped to HTTP HEAD with default path " / " as url * @ param endpoint The endpoint handler * @ param mediaTypes ( Optional ) The accepted and returned types for this endpoint */ public static void head ( HttpConsumer < HttpExchange > endpoint , MediaTypes ......
addResource ( Methods . HEAD , HandlerUtil . BASE_PATH , endpoint , mediaTypes ) ;
public class ScanningModuleBuilder { /** * Exclude specific classes from the classpath scanning . * @ param packages Top packages to exclude * @ return Builder for chaining */ public ScanningModuleBuilder excludePackages ( String ... packages ) { } }
return excludeClassesWhen ( cls -> { for ( String pkg : packages ) { if ( cls . getPackage ( ) . getName ( ) . startsWith ( pkg ) ) { return true ; } ; } return false ; } ) ;
public class SocketHubReceiver { /** * Returns true if the receiver is the same class and they are * configured for the same properties , and super class also considers * them to be equivalent . This is used by PluginRegistry when determining * if the a similarly configured receiver is being started . * @ param...
if ( testPlugin != null && testPlugin instanceof SocketHubReceiver ) { SocketHubReceiver sReceiver = ( SocketHubReceiver ) testPlugin ; return ( port == sReceiver . getPort ( ) && host . equals ( sReceiver . getHost ( ) ) && reconnectionDelay == sReceiver . getReconnectionDelay ( ) && super . isEquivalent ( testPlugin ...
public class ConcurrentLRUCache { /** * Returns ' n ' number of oldest accessed entries present in this cache . * This uses a TreeSet to collect the ' n ' oldest items ordered by ascending last access time * and returns a LinkedHashMap containing ' n ' or less than ' n ' entries . * @ param n the number of oldest...
Map < Long , V > result = new LinkedHashMap < Long , V > ( ) ; if ( n <= 0 ) return result ; TreeSet < CacheEntry < Long , V > > tree = new TreeSet < CacheEntry < Long , V > > ( ) ; markAndSweepLock . lock ( ) ; try { for ( Map . Entry < Long , CacheEntry < Long , V > > entry : map . entrySet ( ) ) { CacheEntry < Long ...
public class JenkinsLogs { /** * Returns the root directory for logs ( historically always found under < code > $ JENKINS _ HOME / logs < / code > . * Configurable since Jenkins 2.114. * @ see hudson . triggers . SafeTimerTask # LOGS _ ROOT _ PATH _ PROPERTY * @ return the root directory for logs . */ private Fil...
final String overriddenLogsRoot = System . getProperty ( "hudson.triggers.SafeTimerTask.logsTargetDir" ) ; if ( overriddenLogsRoot == null ) { return new File ( Jenkins . get ( ) . getRootDir ( ) , "logs" ) ; } else { return new File ( overriddenLogsRoot ) ; }
public class VisibleAssertions { /** * Assert that a value is null . * If the assertion passes , a green tick will be shown . If the assertion fails , a red cross will be shown . * @ param message message to display alongside the assertion outcome * @ param o value to test */ public static void assertNull ( Strin...
if ( o == null ) { pass ( message ) ; } else { fail ( message , "'" + o + "' is not null" ) ; }
public class BinaryIndexedSortable { /** * check if we need request next index memory . */ protected boolean checkNextIndexOffset ( ) { } }
if ( this . currentSortIndexOffset > this . lastIndexEntryOffset ) { MemorySegment returnSegment = nextMemorySegment ( ) ; if ( returnSegment != null ) { this . currentSortIndexSegment = returnSegment ; this . sortIndex . add ( this . currentSortIndexSegment ) ; this . currentSortIndexOffset = 0 ; } else { return false...
public class CommerceOrderNoteUtil { /** * Returns the first commerce order note in the ordered set where commerceOrderId = & # 63 ; . * @ param commerceOrderId the commerce order ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matchin...
return getPersistence ( ) . findByCommerceOrderId_First ( commerceOrderId , orderByComparator ) ;
public class Datasets { /** * Update a { @ link Dataset } for the given dataset or view URI . * You can add columns , remove columns , or change the data type of columns * in your dataset , provided you don ' t attempt a change that is incompatible * with written data . Avro defines rules for compatible schema ev...
return Datasets . < GenericRecord , D > update ( uri , descriptor , GenericRecord . class ) ;
public class IOAsInputStream { /** * Get an instance for the given IO . */ public static InputStream get ( IO . Readable io , boolean closeAsync ) { } }
if ( io instanceof IOFromInputStream ) return ( ( IOFromInputStream ) io ) . getInputStream ( ) ; if ( io instanceof IO . Readable . Buffered ) return new BufferedToInputStream ( ( IO . Readable . Buffered ) io , closeAsync ) ; return new IOAsInputStream ( io ) ;
public class FDBigInt { /** * Multiply a FDBigInt by an int . * Result is a new FDBigInt . */ public FDBigInt mult ( int iv ) { } }
long v = iv ; int r [ ] ; long p ; // guess adequate size of r . r = new int [ ( v * ( ( long ) data [ nWords - 1 ] & 0xffffffffL ) > 0xfffffffL ) ? nWords + 1 : nWords ] ; p = 0L ; for ( int i = 0 ; i < nWords ; i ++ ) { p += v * ( ( long ) data [ i ] & 0xffffffffL ) ; r [ i ] = ( int ) p ; p >>>= 32 ; } if ( p == 0L ...
public class IRDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . IRD__IMDATA : return getIMdata ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class AWSAppSyncClient { /** * Creates a < code > Type < / code > object . * @ param createTypeRequest * @ return Result of the CreateType operation returned by the service . * @ throws BadRequestException * The request is not well formed . For example , a value is invalid or a required field is missing ...
request = beforeClientExecution ( request ) ; return executeCreateType ( request ) ;
public class ByServicePropertiesServiceTracker { /** * Deregister the instance of { @ link ServiceInfo } from the { @ link ServiceAgent } , * effectively unregistering the SLP service URL . * @ param reference The reference to the OSGi service that implicitly registered the SLP service URL . * @ param service The...
LOGGER . entering ( CLASS_NAME , "removedService" , new Object [ ] { reference , service } ) ; context . ungetService ( reference ) ; ServiceInfo serviceInfo = ( ServiceInfo ) service ; serviceAgent . deregister ( serviceInfo . getServiceURL ( ) , serviceInfo . getLanguage ( ) ) ; LOGGER . exiting ( CLASS_NAME , "remov...
public class XGlobalAttributeNameMap { /** * Maps an attribute safely , using the given attribute mapping . * Safe mapping attempts to map the attribute using the given * mapping first . If this does not succeed , the standard mapping * ( EN ) will be used for mapping . If no mapping is available in * the stand...
return mapSafely ( attributeKey , mappings . get ( mappingName ) ) ;
public class Script { /** * < p > If the program somehow pays to a hash , returns the hash . < / p > * < p > Otherwise this method throws a ScriptException . < / p > */ public byte [ ] getPubKeyHash ( ) throws ScriptException { } }
if ( ScriptPattern . isP2PKH ( this ) ) return ScriptPattern . extractHashFromP2PKH ( this ) ; else if ( ScriptPattern . isP2SH ( this ) ) return ScriptPattern . extractHashFromP2SH ( this ) ; else if ( ScriptPattern . isP2WH ( this ) ) return ScriptPattern . extractHashFromP2WH ( this ) ; else throw new ScriptExceptio...
public class NioSqlManagerImpl { /** * 指定されたPath配下のファイルを順次追跡し 、 sqlInfosに格納 、 または削除を行う 。 < br > * また 、 監視対象指定があり 、 Pathがディレクトリの場合は 、 監視サービスに登録する 。 * @ param path 追跡を行うディレクトリ 、 またはファイルのPath * @ param watch 監視対象指定 。 < code > true < / code > の場合監視対象 * @ param remove 削除指定 。 < code > true < / code > の場合 、 指定のPa...
log . debug ( "traverse start. path : {}, watch : {}, remove : {}" , path , watch , remove ) ; if ( Files . notExists ( path ) ) { return ; } if ( Files . isDirectory ( path ) ) { if ( validPath ( path ) ) { try ( DirectoryStream < Path > ds = Files . newDirectoryStream ( path ) ) { if ( watch ) { WatchKey key = path ....
public class ContextXmlReader { /** * Read through the keys of the multi - map , adding to the map as we go . */ private void readMultiMapKeys ( XMLEventReader reader , MultiValueMap < String > map ) throws XMLStreamException , JournalException { } }
while ( true ) { XMLEvent event2 = reader . nextTag ( ) ; if ( isStartTagEvent ( event2 , QNAME_TAG_MULTI_VALUE_MAP_KEY ) ) { // if we find a key tag , get the name String key = getRequiredAttributeValue ( event2 . asStartElement ( ) , QNAME_ATTR_NAME ) ; // read as many values as we find . String [ ] values = readMult...
public class ShellBasedGroupsMapping { /** * Invoked once immediately after construction * @ param storm _ conf Storm configuration */ @ Override public void prepare ( Map storm_conf ) { } }
int timeout = Utils . getInt ( storm_conf . get ( Config . STORM_GROUP_MAPPING_SERVICE_CACHE_DURATION_SECS ) ) ; cachedGroups = new TimeCacheMap < String , Set < String > > ( timeout ) ;
public class SparseVector { /** * Normalize a vector . */ void normalize ( ) { } }
double nrm = norm ( ) ; for ( Map . Entry < Integer , Double > d : entrySet ( ) ) { d . setValue ( d . getValue ( ) / nrm ) ; }
public class AWSMediaConnectClient { /** * Deletes a flow . Before you can delete a flow , you must stop the flow . * @ param deleteFlowRequest * @ return Result of the DeleteFlow operation returned by the service . * @ throws BadRequestException * The request that you submitted is not valid . * @ throws Inte...
request = beforeClientExecution ( request ) ; return executeDeleteFlow ( request ) ;
public class MainClassFinder { /** * Find the main class from a given folder . * @ param rootFolder the root folder to search * @ return the main class or { @ code null } * @ throws IOException if the folder cannot be read */ public static String findMainClass ( File rootFolder ) throws IOException { } }
return doWithMainClasses ( rootFolder , new ClassNameCallback < String > ( ) { @ Override public String doWith ( String className ) { return className ; } } ) ;
public class DefaultClusterEventService { /** * Purges tombstones from the subscription list . */ private void purgeTombstones ( ) { } }
long minTombstoneTime = membershipService . getMembers ( ) . stream ( ) . map ( node -> updateTimes . getOrDefault ( node . id ( ) , 0L ) ) . reduce ( Math :: min ) . orElse ( 0L ) ; for ( InternalTopic topic : topics . values ( ) ) { topic . purgeTombstones ( minTombstoneTime ) ; }
public class SecurityAwareConfigurer { /** * Broadcast a Logout event to all the LoginAware beans . * @ param authentication token */ protected void broadcastLogout ( Authentication authentication ) { } }
if ( logger . isDebugEnabled ( ) ) logger . debug ( "BROADCAST logout: token=" + authentication ) ; final Iterator iter = getBeansToUpdate ( LoginAware . class ) . iterator ( ) ; while ( iter . hasNext ( ) ) { ( ( LoginAware ) iter . next ( ) ) . userLogout ( authentication ) ; }
public class MediaManagementApi { /** * Move a bulk of interactions to a queue * Move a bulk of interactions to specified queue * @ param mgtMoveToQueue ( required ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deseriali...
com . squareup . okhttp . Call call = mgtMoveToQueueValidateBeforeCall ( mgtMoveToQueue , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class IntegerArrayType { /** * Supports both int [ ] and Integer [ ] , yay ! */ @ Override public void nullSafeSet ( PreparedStatement preparedStatement , Object value , int i , SharedSessionContractImplementor sessionImplementor ) throws HibernateException , SQLException { } }
// use JDBC array type , which is fairly new , so tread carefully if ( value == null ) { preparedStatement . setNull ( i , java . sql . Types . ARRAY ) ; } else if ( value instanceof Integer [ ] ) { Integer [ ] myArray = ( Integer [ ] ) value ; Array inArray = preparedStatement . getConnection ( ) . createArrayOf ( "in...
public class ClassFile { /** * Returns the static initializer defined in this class or null if there * isn ' t one . */ public MethodInfo getInitializer ( ) { } }
int size = mMethods . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { MethodInfo method = mMethods . get ( i ) ; if ( "<clinit>" . equals ( method . getName ( ) ) ) { return method ; } } return null ;