signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ResourceLoader { /** * Finds a resource with a given name . This is a convenience method for accessing a resource * from a channel or from the uPortal framework . If a well - formed URL is passed in , this method * will use that URL unchanged to find the resource . If the URL is not well - formed , thi...
final Tuple < Class < ? > , String > cacheKey = new Tuple < Class < ? > , String > ( requestingClass , resource ) ; // Look for a cached URL final Map < Tuple < Class < ? > , String > , URL > resourceUrlCache = ResourceLoader . resourceUrlCache ; URL resourceURL = resourceUrlCache != null ? resourceUrlCache . get ( cac...
public class LambdaInvokerFactory { /** * Creates a new Lambda invoker implementing the given interface and wrapping the given { @ code AWSLambda } client . * @ param interfaceClass the interface to implement * @ param awsLambda the lambda client to use for making remote calls * @ deprecated Use { @ link LambdaIn...
return build ( interfaceClass , awsLambda , new LambdaInvokerFactoryConfig ( ) ) ;
public class AbstractExtendedSet { /** * { @ inheritDoc } */ @ Override public T get ( int i ) { } }
int size = size ( ) ; if ( i < 0 || i >= size ) throw new IndexOutOfBoundsException ( ) ; Iterator < T > itr ; if ( i < ( size / 2 ) ) { itr = iterator ( ) ; for ( int j = 0 ; j <= i - 1 ; j ++ ) itr . next ( ) ; } else { itr = descendingIterator ( ) ; for ( int j = size - 1 ; j >= i + 1 ; j -- ) itr . next ( ) ; } ret...
public class PropertiesUtils { /** * Loads a comma - separated list of integers from Properties . The list cannot include any whitespace . */ public static int [ ] getIntArray ( Properties props , String key ) { } }
Integer [ ] result = MetaClass . cast ( props . getProperty ( key ) , Integer [ ] . class ) ; return ArrayUtils . toPrimitive ( result ) ;
public class ChannelFinderClientImpl { /** * Set tag < tt > tag < / tt > on the set of channels { channels } and remove it from * all others . * @ param tag * - the tag to be set . * @ param channelNames * - the list of channels to which this tag will be added and * removed from all others . * @ throws Ch...
wrappedSubmit ( new SetTag ( tag . toXml ( ) , channelNames ) ) ;
public class ApiOvhMe { /** * Get this object properties * REST : GET / me / bill / { billId } * @ param billId [ required ] */ public OvhBill bill_billId_GET ( String billId ) throws IOException { } }
String qPath = "/me/bill/{billId}" ; StringBuilder sb = path ( qPath , billId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhBill . class ) ;
public class ConfigSettings { /** * Applies the default single thread configuration of the DiffTool to this * settings . */ public void defaultConfiguration ( ) { } }
clear ( ) ; setConfigParameter ( ConfigurationKeys . VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING , 12 ) ; setConfigParameter ( ConfigurationKeys . COUNTER_FULL_REVISION , 1000 ) ; setConfigParameter ( ConfigurationKeys . LIMIT_TASK_SIZE_REVISIONS , 5000000l ) ; setConfigParameter ( ConfigurationKeys . LIMIT_TASK_SIZE_DIFFS ...
public class AuthIdentificationResult { /** * Factory method for success authentication . * @ param aAuthToken * The auth token . May not be < code > null < / code > . * @ return Never < code > null < / code > . */ @ Nonnull public static AuthIdentificationResult createSuccess ( @ Nonnull final IAuthToken aAuthTo...
ValueEnforcer . notNull ( aAuthToken , "AuthToken" ) ; return new AuthIdentificationResult ( aAuthToken , null ) ;
public class SerializedFormBuilder { /** * Build the serialization overview for the given class . * @ param classDoc the class to print the overview for . * @ param classContentTree content tree to which the documentation will be added */ public void buildFieldSerializationOverview ( ClassDoc classDoc , Content cla...
if ( classDoc . definesSerializableFields ( ) ) { FieldDoc serialPersistentField = classDoc . serializableFields ( ) [ 0 ] ; // Check to see if there are inline comments , tags or deprecation // information to be printed . if ( fieldWriter . shouldPrintOverview ( serialPersistentField ) ) { Content serializableFieldsTr...
public class OAHashSet { /** * Adds the specified element to this set if it is not already present . * This variant of { @ link # add ( Object ) } acts as an optimisation to * enable avoiding { @ link # hashCode ( ) } calls if the hash is already * known on the caller side . * @ param elementToAdd element to be...
checkNotNull ( elementToAdd ) ; int index = hash & mask ; // using the hashes array for looping and comparison if possible , hence we ' re cache friendly while ( hashes [ index ] != 0 || table [ index ] != null ) { if ( hash == hashes [ index ] && elementToAdd . equals ( table [ index ] ) ) { return false ; } index = +...
public class Nodes { /** * Replace node of given name . * @ return { @ code true } if node was replaced . * @ since 2.8 */ public boolean replaceNode ( final Node oldOne , final @ Nonnull Node newOne ) throws IOException { } }
if ( oldOne == nodes . get ( oldOne . getNodeName ( ) ) ) { // use the queue lock until Nodes has a way of directly modifying a single node . Queue . withLock ( new Runnable ( ) { public void run ( ) { Nodes . this . nodes . remove ( oldOne . getNodeName ( ) ) ; Nodes . this . nodes . put ( newOne . getNodeName ( ) , n...
public class ConsistencyCheck { /** * Convert a key - version - nodeSet information to string * @ param key The key * @ param versionMap mapping versions to set of PrefixNodes * @ param storeName store ' s name * @ param partitionId partition scanned * @ return a string that describe the information passed in...
StringBuilder record = new StringBuilder ( ) ; for ( Map . Entry < Value , Set < ClusterNode > > versionSet : versionMap . entrySet ( ) ) { Value value = versionSet . getKey ( ) ; Set < ClusterNode > nodeSet = versionSet . getValue ( ) ; record . append ( "BAD_KEY," ) ; record . append ( storeName + "," ) ; record . ap...
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 6649:1 : ruleValidID returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : this _ ID _ 0 = RULE _ ID ; */ public final AntlrDatatypeRuleToken ruleValidID ( ) throws RecognitionException { } }
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token this_ID_0 = null ; enterRule ( ) ; try { // InternalXbaseWithAnnotations . g : 6655:2 : ( this _ ID _ 0 = RULE _ ID ) // InternalXbaseWithAnnotations . g : 6656:2 : this _ ID _ 0 = RULE _ ID { this_ID_0 = ( Token ) match ( input , RULE_ID , FOLLOW_...
public class FacesContext { /** * < p class = " changed _ added _ 2_0 " > Return < code > true < / code > if the * current { @ link ProjectStage } as returned by the { @ link * Application } instance is equal to < code > stage < / code > , otherwise * return < code > false < / code > < / p > * @ param stage the...
if ( stage == null ) { throw new NullPointerException ( ) ; } return ( stage . equals ( getApplication ( ) . getProjectStage ( ) ) ) ;
public class CommerceDiscountRelServiceBaseImpl { /** * Sets the commerce discount rel local service . * @ param commerceDiscountRelLocalService the commerce discount rel local service */ public void setCommerceDiscountRelLocalService ( com . liferay . commerce . discount . service . CommerceDiscountRelLocalService c...
this . commerceDiscountRelLocalService = commerceDiscountRelLocalService ;
public class SchemaTableTree { /** * Constructs the from clause with the required selected fields needed to make the join between the previous and the next SchemaTable * @ param columnList * @ param distinctQueryStack / / * @ param firstSchemaTableTree This is the first SchemaTable in the current sql stack . If it ...
SchemaTableTree firstSchemaTableTree = distinctQueryStack . getFirst ( ) ; SchemaTableTree lastSchemaTableTree = distinctQueryStack . getLast ( ) ; SchemaTable firstSchemaTable = firstSchemaTableTree . getSchemaTable ( ) ; SchemaTable lastSchemaTable = lastSchemaTableTree . getSchemaTable ( ) ; Preconditions . checkSta...
public class ParaClient { /** * Refreshes the JWT access token . This requires a valid existing token . * Call { @ link # signIn ( java . lang . String , java . lang . String ) } first . * @ return true if token was refreshed */ protected boolean refreshToken ( ) { } }
long now = System . currentTimeMillis ( ) ; boolean notExpired = tokenKeyExpires != null && tokenKeyExpires > now ; boolean canRefresh = tokenKeyNextRefresh != null && ( tokenKeyNextRefresh < now || tokenKeyNextRefresh > tokenKeyExpires ) ; // token present and NOT expired if ( tokenKey != null && notExpired && canRefr...
public class ClusTree { /** * insert newPoint into the tree using the BreadthFirst strategy , i . e . : insert into * the closest entry in a leaf node . * @ param newPoint * @ param budget * @ param timestamp * @ return */ private Entry insertBreadthFirst ( ClusKernel newPoint , Budget budget , long timestamp...
// check all leaf nodes and get the one with the closest entry to newPoint Node bestFit = findBestLeafNode ( newPoint ) ; bestFit . makeOlder ( timestamp , negLambda ) ; Entry parent = bestFit . getEntries ( ) [ 0 ] . getParentEntry ( ) ; // Search for an Entry with a weight under the threshold . Entry irrelevantEntry ...
public class GraphAnalysisLoader { /** * Finds the next { @ code ' $ ' } in a class name which can be changed to a { @ code ' . ' } when computing * a canonical class name . */ private static int nextDollar ( String className , CharSequence current , int searchStart ) { } }
while ( true ) { int index = className . indexOf ( '$' , searchStart ) ; if ( index == - 1 ) { return - 1 ; } // We ' ll never have two dots nor will a type name end or begin with dot . So no need to // consider dollars at the beginning , end , or adjacent to dots . if ( index == 0 || index == className . length ( ) - ...
public class Endpoint { /** * Creates a new { @ link Endpoint } instance with an additional path segment . * Typical usage is to add an ID to an endpoint path , which is why this method returns a new instance , rather than modifying the existing one . * This allows you add different ID at different times without af...
Endpoint configured = new Endpoint ( this ) ; if ( StringUtils . isNotBlank ( segment ) ) { configured . path . add ( segment ) ; } return configured ;
public class VariantMetadataManager { /** * Retrieve the pedigree objects related to the input study ID . * @ param studyId Study ID * @ return List of Pedigree objects */ public List < Pedigree > getPedigree ( String studyId ) { } }
Member dest ; Map < String , Pedigree > pedigreeMap = new HashMap < > ( ) ; Map < String , Member > individualMap = new HashMap < > ( ) ; VariantStudyMetadata variantStudyMetadata = getVariantStudyMetadata ( studyId ) ; if ( variantStudyMetadata != null ) { // first loop for ( org . opencb . biodata . models . metadata...
public class CalendarCodeGenerator { /** * Build a method that will format a date and time ( named or skeleton ) in a * localized wrapper . */ private MethodSpec buildWrapperMethod ( Format format ) { } }
MethodSpec . Builder method = MethodSpec . methodBuilder ( "formatWrapped" ) . addAnnotation ( Override . class ) . addModifiers ( PUBLIC ) . addParameter ( CALENDAR_FORMAT , "wrapperType" ) . addParameter ( CALENDAR_FORMAT , "dateType" ) . addParameter ( CALENDAR_FORMAT , "timeType" ) . addParameter ( String . class ,...
public class ScriptRuntime { /** * Convert the value to an object . * See ECMA 9.9. */ public static Scriptable toObject ( Context cx , Scriptable scope , Object val ) { } }
if ( val == null ) { throw typeError0 ( "msg.null.to.object" ) ; } if ( Undefined . isUndefined ( val ) ) { throw typeError0 ( "msg.undef.to.object" ) ; } if ( isSymbol ( val ) ) { NativeSymbol result = new NativeSymbol ( ( NativeSymbol ) val ) ; setBuiltinProtoAndParent ( result , scope , TopLevel . Builtins . Symbol ...
public class BerkeleyDbStorageProvider { /** * Cleans the parent directory of this storage provider . This action will * delete all previous collection storages made in this directory , and thus * it should only be invoked either before any collections has been made or * when all collections are ensured to be unu...
File [ ] directories = _parentDirectory . listFiles ( new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { return name . startsWith ( DIRECTORY_PREFIX ) ; } } ) ; for ( File directory : directories ) { delete ( directory ) ; }
public class Try { /** * Creates a CompletionStage that , when it completes , will capture into a Try whether the given completionStage * was successful or not * @ param completionStage the completion stage that will complete * @ param < V > the value type * @ return a Try which is the result of the call */ pub...
return completionStage . handle ( ( value , throwable ) -> { if ( throwable != null ) { return failed ( throwable ) ; } return succeeded ( value ) ; } ) ;
public class Expressions { /** * Create a new Template expression * @ param cl type of expression * @ param template template * @ param args template parameters * @ return template expression */ public static < T extends Enum < T > > EnumTemplate < T > enumTemplate ( Class < ? extends T > cl , Template template...
return enumTemplate ( cl , template , ImmutableList . copyOf ( args ) ) ;
public class RNAToAminoAcidTranslator { /** * Performs the trimming of stop codons and the conversion of a valid start * amino acid to M */ @ Override protected void postProcessCompoundLists ( List < List < AminoAcidCompound > > compoundLists ) { } }
for ( List < AminoAcidCompound > compounds : compoundLists ) { if ( trimStops ) { trimStop ( compounds ) ; } }
public class managed_device { /** * < pre > * Converts API response of bulk operation into object and returns the object array in case of get request . * < / pre > */ protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } }
managed_device_responses result = ( managed_device_responses ) service . get_payload_formatter ( ) . string_to_resource ( managed_device_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . me...
public class Index { /** * Get settings of this index * @ param requestOptions Options to pass to this request */ public JSONObject getSettings ( RequestOptions requestOptions ) throws AlgoliaException { } }
return client . getRequest ( "/1/indexes/" + encodedIndexName + "/settings?getVersion=2" , false , requestOptions ) ;
public class CountryCodeSelectorView { /** * Sets the current Country to the one given . * @ param country the country to set . */ public void setSelectedCountry ( @ NonNull Country country ) { } }
Log . d ( TAG , "Selected country changed to " + country . getDisplayName ( ) ) ; countryNameTextView . setText ( country . getDisplayName ( ) ) ; countryCodeTextView . setText ( country . getDialCode ( ) ) ; selectedCountry = country ;
public class StyleUtils { /** * Create new polyline options populated with the feature row style * @ param geoPackage GeoPackage * @ param featureRow feature row * @ param density display density : { @ link android . util . DisplayMetrics # density } * @ return polyline options populated with the feature style ...
PolylineOptions polylineOptions = new PolylineOptions ( ) ; setFeatureStyle ( polylineOptions , geoPackage , featureRow , density ) ; return polylineOptions ;
public class BaseNeo4jAssociationQueries { /** * Example : MATCH ( owner : ENTITY : table { id : { 0 } } ) */ private static String initMatchOwnerEntityNode ( EntityKeyMetadata ownerEntityKeyMetadata ) { } }
StringBuilder queryBuilder = new StringBuilder ( ) ; appendMatchOwnerEntityNode ( queryBuilder , ownerEntityKeyMetadata ) ; return queryBuilder . toString ( ) ;
public class LookaheadChainingListener { /** * { @ inheritDoc } * @ since 2.0RC1 */ @ Override public void endDefinitionList ( Map < String , String > parameters ) { } }
this . previousEvents . endDefinitionList ( parameters ) ; firePreviousEvent ( ) ;
public class APIClient { /** * Copy an existing index . * @ param srcIndexName the name of index to copy . * @ param dstIndexName the new index name that will contains a copy of srcIndexName ( destination will be overriten if it already exist ) . * @ param scopes the list of scopes to copy */ public JSONObject co...
return operationOnIndex ( "copy" , srcIndexName , dstIndexName , scopes , RequestOptions . empty ) ;
public class NfsGetAttrResponse { /** * ( non - Javadoc ) * @ see com . emc . ecs . nfsclient . nfs . NfsResponseBase # unmarshalling ( com . emc . ecs . * nfsclient . rpc . Xdr ) */ public void unmarshalling ( Xdr xdr ) throws RpcException { } }
super . unmarshalling ( xdr ) ; if ( stateIsOk ( ) ) { unmarshallingAttributes ( xdr , true ) ; }
public class CollectionUtils { /** * Adapts the { @ link Enumeration } into an instance of the { @ link Iterator } interface . * @ param < T > Class type of the elements in the { @ link Enumeration } . * @ param enumeration { @ link Enumeration } to adapt into an { @ link Iterator } . * @ return an { @ link Itera...
return ( enumeration == null ? Collections . emptyIterator ( ) : new Iterator < T > ( ) { @ Override public boolean hasNext ( ) { return enumeration . hasMoreElements ( ) ; } @ Override public T next ( ) { return enumeration . nextElement ( ) ; } } ) ;
public class OpenTSDBMain { /** * The OpenTSDB fat - jar main entry point * @ param args See usage banner { @ link OpenTSDBMain # mainUsage ( PrintStream ) } */ public static void main ( String [ ] args ) { } }
log . info ( "Starting." ) ; log . info ( BuildData . revisionString ( ) ) ; log . info ( BuildData . buildString ( ) ) ; try { System . in . close ( ) ; // Release a FD we don ' t need . } catch ( Exception e ) { log . warn ( "Failed to close stdin" , e ) ; } if ( args . length == 0 ) { log . error ( "No command suppl...
public class EvalFuncDodcfg { /** * This subroutine computes the function psi ( t ) and the scaled * functions psi ' ( t ) / t and psi ' ' ( t ) / t for the optimal design * with composite materials problem . * @ param t * @ param mu1 * @ param mu2 * @ param t1 * @ param t2 * @ param option * @ param ...
double sqrtt ; double result = Double . NaN ; sqrtt = Math . sqrt ( t ) ; if ( option == 0 ) { if ( sqrtt <= t1 ) result = p5 * mu2 * t ; else if ( sqrtt > t1 && sqrtt < t2 ) result = mu2 * t1 * sqrtt - lambda * mu1 ; else if ( sqrtt >= t2 ) result = p5 * mu1 * t + lambda * ( mu2 - mu1 ) ; } else if ( option == 1 ) { i...
public class CompareComply { /** * Submit a batch - processing request . * Run Compare and Comply methods over a collection of input documents . * * * Important : * * Batch processing requires the use of the [ IBM Cloud Object Storage * service ] ( https : / / cloud . ibm . com / docs / services / cloud - object ...
Validator . notNull ( createBatchOptions , "createBatchOptions cannot be null" ) ; String [ ] pathSegments = { "v1/batches" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > ...
public class ElasticsearchRestClientFactoryBean { /** * Init mapping if needed . * < p > Note that you can force to reinit mapping using { @ link # setForceMapping ( boolean ) } */ private void initMappings ( ) throws Exception { } }
checkClient ( ) ; // We extract indexes and mappings to manage from mappings definition if ( mappings != null && mappings . length > 0 ) { Map < String , Collection < String > > indices = getIndexMappings ( mappings ) ; // Let ' s initialize indexes and mappings if needed for ( String index : indices . keySet ( ) ) { c...
public class StringParser { /** * Parse the given { @ link String } as { @ link BigDecimal } . * @ param sStr * The String to parse . May be < code > null < / code > . * @ param nScale * The scaling ( decimal places ) to be used for the result . Must be & ge ; * @ param eRoundingMode * The rounding mode to ...
return parseBigDecimal ( sStr , nScale , eRoundingMode , null ) ;
public class JobApi { /** * Get a list of jobs in a project . * < pre > < code > GitLab Endpoint : GET / projects / : id / jobs < / code > < / pre > * @ param projectIdOrPath id , path of the project , or a Project instance holding the project ID or path to get the jobs for * @ param scope the scope of jobs , one...
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "scope" , scope ) ; return ( new Pager < Job > ( this , Job . class , itemsPerPage , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" ) ) ;
public class MvelExpression { /** * { @ inheritDoc } */ public T evaluate ( Object target , Map < String , Object > variables ) { } }
return ( T ) MVEL . executeExpression ( getCompiledExpression ( ) , target , variables ) ;
public class AtomicDoubleArray { /** * Atomically adds the given value to the element at index { @ code i } . * @ param i the index * @ param delta the value to add * @ return the previous value */ public double getAndAdd ( int i , double delta ) { } }
while ( true ) { double orig = get ( i ) ; double newVal = orig + delta ; if ( compareAndSet ( i , orig , newVal ) ) return orig ; }
public class InternalLocaleBuilder { /** * Reset Builder ' s internal state with the given language tag */ public InternalLocaleBuilder setLanguageTag ( LanguageTag langtag ) { } }
clear ( ) ; if ( langtag . getExtlangs ( ) . size ( ) > 0 ) { _language = langtag . getExtlangs ( ) . get ( 0 ) ; } else { String language = langtag . getLanguage ( ) ; if ( ! language . equals ( LanguageTag . UNDETERMINED ) ) { _language = language ; } } _script = langtag . getScript ( ) ; _region = langtag . getRegio...
public class OAuth20Utils { /** * Gets response mode type . * @ param context the context * @ return the response type */ public static OAuth20ResponseModeTypes getResponseModeType ( final J2EContext context ) { } }
val responseType = context . getRequestParameter ( OAuth20Constants . RESPONSE_MODE ) ; val type = Arrays . stream ( OAuth20ResponseModeTypes . values ( ) ) . filter ( t -> t . getType ( ) . equalsIgnoreCase ( responseType ) ) . findFirst ( ) . orElse ( OAuth20ResponseModeTypes . NONE ) ; LOGGER . debug ( "OAuth respon...
public class TaxinvoiceServiceImp { /** * / * ( non - Javadoc ) * @ see com . popbill . api . TaxinvoiceService # sendEmail ( java . lang . String , com . popbill . api . taxinvoice . MgtKeyType , java . lang . String , java . lang . String ) */ @ Override public Response sendEmail ( String CorpNum , MgtKeyType KeyTy...
return sendEmail ( CorpNum , KeyType , MgtKey , Receiver , null ) ;
public class BeanParserFactory { /** * 获取 { @ link BeanParser } */ public static BeanParser getBeanParser ( Method method ) { } }
Type returnType = method . getReturnType ( ) ; if ( isCompletableFutureType ( method . getReturnType ( ) ) ) { returnType = getActualReturnType ( method ) ; } BeanParser beanParser = typeBeanParserMap . get ( returnType ) ; if ( beanParser != null ) { return beanParser ; } return defaultBeanParser ;
public class PermissionsBuilder { /** * Sets the state for the given types to { @ link PermissionState # UNSET } . * @ param types The types to change . * @ return The current instance in order to chain call methods . */ public PermissionsBuilder setUnset ( PermissionType ... types ) { } }
for ( PermissionType type : types ) { setState ( type , PermissionState . UNSET ) ; } return this ;
public class StorePackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getDatabaseInformationItem ( ) { } }
if ( databaseInformationItemEClass == null ) { databaseInformationItemEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 26 ) ; } return databaseInformationItemEClass ;
public class Syslog { /** * destroyInstance ( ) gracefully shuts down the specified Syslog protocol and * removes the instance from Syslog4j . * @ param protocol - the Syslog protocol to destroy * @ throws SyslogRuntimeException */ public synchronized static final void destroyInstance ( String protocol ) throws S...
if ( protocol == null || "" . equals ( protocol . trim ( ) ) ) { return ; } String _protocol = protocol . toLowerCase ( ) ; if ( instances . containsKey ( _protocol ) ) { SyslogUtility . sleep ( SyslogConstants . THREAD_LOOP_INTERVAL_DEFAULT ) ; SyslogIF syslog = ( SyslogIF ) instances . get ( _protocol ) ; try { syslo...
public class SwingApplication { /** * Popup menu will become invisible popup menu listener . * @ param consumer the consumer * @ return the popup menu listener */ public static PopupMenuListener popupMenuWillBecomeInvisible ( @ NonNull Consumer < PopupMenuEvent > consumer ) { } }
return new PopupMenuListener ( ) { @ Override public void popupMenuCanceled ( PopupMenuEvent e ) { } @ Override public void popupMenuWillBecomeInvisible ( PopupMenuEvent e ) { consumer . accept ( e ) ; } @ Override public void popupMenuWillBecomeVisible ( PopupMenuEvent e ) { } } ;
public class LicenseResolver { /** * Attempts to perform high - confidence license resolution with unstructured text as input . * @ param licenseString the license string ( not the actual license text ) * @ return a LicenseChoice object if resolved , otherwise null */ private static LicenseChoice resolveViaAlternat...
if ( licenseString == null ) { return null ; } try { for ( final Map . Entry < String , List < String > > mapping : mappings . entrySet ( ) ) { final List < String > names = mapping . getValue ( ) ; if ( names != null ) { for ( final String name : names ) { if ( licenseString . equalsIgnoreCase ( name ) ) { return reso...
public class QueryUtil { /** * return the value at the given position ( row ) , returns the default empty value ( " " or null ) for * wrong row or null values . this method only exist for backward compatibility and should not be * used for new functinality * @ param column * @ param row * @ return * @ depre...
// print . ds ( ) ; if ( NullSupportHelper . full ( ) ) return column . get ( row , null ) ; Object v = column . get ( row , "" ) ; return v == null ? "" : v ;
public class SegmentIndexBufferFileIO { /** * Writes to the specified segment index buffer file . * @ param sib - the segment index buffer * @ param sibFile - the segment index buffer file to write to * @ throws IOException */ @ Override public int write ( SegmentIndexBuffer sib , File sibFile ) throws IOExceptio...
create ( sibFile ) ; RandomAccessFile raf = new RandomAccessFile ( sibFile , "rw" ) ; FileChannel channel = raf . getChannel ( ) ; writeVersion ( channel ) ; int length = sib . write ( channel ) ; length += STORAGE_VERSION_LENGTH ; raf . setLength ( length ) ; channel . force ( true ) ; channel . close ( ) ; raf . clos...
public class ImageModerationsImpl { /** * Fuzzily match an image against one of your custom Image Lists . You can create and manage your custom image lists using & lt ; a href = " / docs / services / 578ff44d2703741568569ab9 / operations / 578ff7b12703741568569abe " & gt ; this & lt ; / a & gt ; API . * Returns ID an...
return matchFileInputWithServiceResponseAsync ( imageStream , matchFileInputOptionalParameter ) . map ( new Func1 < ServiceResponse < MatchResponse > , MatchResponse > ( ) { @ Override public MatchResponse call ( ServiceResponse < MatchResponse > response ) { return response . body ( ) ; } } ) ;
public class GeometryPainter { /** * The actual painting function . Draws the circles with the object ' s id . * @ param paintable * A { @ link org . geomajas . gwt . client . gfx . paintable . Text } object . * @ param group * The group where the object resides in ( optional ) . * @ param context * A MapCo...
if ( paintable != null ) { GfxGeometry gfxGeometry = ( GfxGeometry ) paintable ; Geometry geometry = gfxGeometry . getGeometry ( ) ; ShapeStyle shapeStyle = gfxGeometry . getStyle ( ) ; if ( geometry instanceof LineString ) { context . getVectorContext ( ) . drawLine ( group , gfxGeometry . getId ( ) , ( LineString ) g...
public class FileUtil { /** * Filters files based on their file extension . * @ return Object for filtering files */ public static FileFilter getFileFilter ( ) { } }
return new FileFilter ( ) { @ Override public boolean accept ( File pathname ) { // Accept if input is a non - hidden file with registered extension // or if a non - hidden and not - ignored directory return ! pathname . isHidden ( ) && ( pathname . isFile ( ) && Engines . getRecognizedExtensions ( ) . contains ( fileE...
public class KeywordUtils { /** * Retrieves the given keyword ' s parameter description . * @ param keyword keyword name * @ param context Spring application context * @ param beanMap keyword name to bean name mapping * @ return the parameter description string of the given keyword , or { " * args " } if unavai...
KeywordInfo keywordInfo = getKeywordInfo ( keyword , context , beanMap ) ; return keywordInfo == null ? DEFAULT_PARAMS : keywordInfo . parameters ( ) ;
public class OCommandExecutorSQLDropClass { /** * Execute the DROP CLASS . */ public Object execute ( final Map < Object , Object > iArgs ) { } }
if ( className == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; final ODatabaseRecord database = getDatabase ( ) ; final OClass oClass = database . getMetadata ( ) . getSchema ( ) . getClass ( className ) ; if ( oClass == null ) return null ; for ( fin...
public class Frustum { /** * Sets the planes and bounding box of the frustum based on its vertices . */ protected void updateDerivedState ( ) { } }
_planes [ 0 ] . fromPoints ( _vertices [ 0 ] , _vertices [ 1 ] , _vertices [ 2 ] ) ; // near _planes [ 1 ] . fromPoints ( _vertices [ 5 ] , _vertices [ 4 ] , _vertices [ 7 ] ) ; // far _planes [ 2 ] . fromPoints ( _vertices [ 1 ] , _vertices [ 5 ] , _vertices [ 6 ] ) ; // left _planes [ 3 ] . fromPoints ( _vertices [ 4...
public class AmebaFeature { /** * < p > subscribeSystemEvent . < / p > * @ param eventClass a { @ link java . lang . Class } object . * @ param listenerClass a { @ link java . lang . Class } object . * @ return a { @ link ameba . event . Listener } object . * @ since 0.1.6e * @ param < E > a E object . */ pro...
Listener < E > listener = locator . createAndInitialize ( listenerClass ) ; SystemEventBus . subscribe ( eventClass , listener ) ; return listener ;
public class MalisisCore { /** * Pre - initialization event * @ param event the event */ @ EventHandler public void preInit ( FMLPreInitializationEvent event ) { } }
asmDataTable = event . getAsmData ( ) ; autoLoadClasses ( ) ; // register this to the EVENT _ BUS for onGuiClose ( ) MinecraftForge . EVENT_BUS . register ( this ) ; settings = new MalisisCoreSettings ( event . getSuggestedConfigurationFile ( ) ) ; Registries . processFMLStateEvent ( event ) ;
public class ValidationResult { /** * Adds a validation result to this . * @ param validation the validation to add */ public void add ( ValidationResult validation ) { } }
correct &= validation . correct ; if ( ! validate ) return ; errors . addAll ( validation . errors ) ; warnings . addAll ( validation . warnings ) ;
public class ReferenceCountingResourceHolder { /** * Decrements the reference count by 1 . If it reaches to 0 , then closes { @ link # closer } . */ @ Override public void close ( ) { } }
if ( closed . compareAndSet ( false , true ) ) { decrement ( ) ; } else { log . warn ( new ISE ( "Already closed" ) , "Already closed" ) ; }
public class ErrorReporter { /** * For CompilationFailedException . */ protected void report ( CompilationFailedException e , boolean child ) { } }
println ( e . toString ( ) ) ; stacktrace ( e , false ) ;
public class JobUploader { /** * Convenience override for int ids . * @ param finalJobFolderPath * @ return * @ throws IOException */ public JobFolder createJobFolder ( final String finalJobFolderPath ) throws IOException { } }
LOG . log ( Level . FINE , "Final job submission Directory: " + finalJobFolderPath ) ; return new JobFolder ( this . fileSystem , new Path ( finalJobFolderPath ) ) ;
public class AsynchronousRequest { /** * For more info on transactions API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / commerce / transactions " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , ...
isParamValid ( new ParamChecker ( ParamType . API , API ) ) ; if ( time == null || type == null ) throw new GuildWars2Exception ( ErrorCode . TransTime , "Transaction time/type cannot be empty" ) ; gw2API . getTPTransaction ( time . getValue ( ) , type . getValue ( ) , API ) . enqueue ( callback ) ;
public class ShapeAppearanceModel { /** * Sets the corner treatment for the top - left corner . * @ param cornerFamily the family to use to create the corner treatment * @ param cornerSize the size to use to create the corner treatment */ public void setTopLeftCorner ( @ CornerFamily int cornerFamily , @ Dimension ...
setTopLeftCorner ( MaterialShapeUtils . createCornerTreatment ( cornerFamily , cornerSize ) ) ;
public class AbstractBaseProcessLauncher { /** * Shuts down the instance represented by this launcher . Uses the { @ link ProcessHandlerFactory } to find sub * processes . */ public void shutdown ( ) { } }
shutdownCalled = true ; if ( isRunning ( ) ) { watchdog . waitForProcessStarted ( ) ; watchdog . destroyProcess ( ) ; watchdog . waitForTerminationAfterDestroy ( 2 , SECONDS ) ; if ( isRunning ( ) ) { watchdog . destroyProcessForcefully ( ) ; watchdog . waitForTerminationAfterDestroy ( 1 , SECONDS ) ; if ( isRunning ( ...
public class ClassLoaderResolver { /** * This method selects the best classloader instance to be used for * class / resource loading by whoever calls this method . The decision * typically involves choosing between the caller ' s current , thread context , * system , and other classloaders in the JVM and is made ...
final Class caller = getCallerClass ( 0 ) ; final ClassLoadContext ctx = new ClassLoadContext ( caller ) ; return s_strategy . getClassLoader ( ctx ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getMFCMFCScpe ( ) { } }
if ( mfcmfcScpeEEnum == null ) { mfcmfcScpeEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 49 ) ; } return mfcmfcScpeEEnum ;
public class XlsUtil { /** * workbook转换为list * @ param config 配置 * @ param wb excel * @ return * @ throws Exception */ public static List < ? > workbook2List ( ExcelConfig config , Workbook wb ) throws Exception { } }
String [ ] names = config . getNames ( ) ; String [ ] types = config . getTypes ( ) ; Field key = config . getKey ( ) ; List < Object > list = new ArrayList < Object > ( ) ; Sheet sheet = wb . getSheet ( config . getSheetNum ( ) ) ; int length = sheet . getColumns ( ) < names . length ? sheet . getColumns ( ) : names ....
public class AmebaFeature { /** * < p > subscribeSystemEvent . < / p > * @ param eventClass a { @ link java . lang . Class } object . * @ param listener a { @ link ameba . event . Listener } object . * @ since 0.1.6e * @ param < E > a E object . */ protected < E extends Event > void subscribeSystemEvent ( Class...
locator . inject ( listener ) ; locator . postConstruct ( listener ) ; SystemEventBus . subscribe ( eventClass , listener ) ;
public class ComponentUtils { /** * Algorithm works as follows ; * - If it ' s an input component , submitted value is checked first since it ' d be the value to be used in case validation errors * terminates jsf lifecycle * - Finally the value of the component is retrieved from backing bean and if there ' s a co...
if ( component instanceof ValueHolder ) { if ( component instanceof EditableValueHolder ) { EditableValueHolder input = ( EditableValueHolder ) component ; Object submittedValue = input . getSubmittedValue ( ) ; PrimeConfiguration config = PrimeApplicationContext . getCurrentInstance ( context ) . getConfig ( ) ; if ( ...
public class CmpUtil { /** * Lexicographically compares two { @ link Iterable } s , whose element types are comparable . */ public static < U extends Comparable < ? super U > > int lexCompare ( Iterable < ? extends U > o1 , Iterable < ? extends U > o2 ) { } }
Iterator < ? extends U > it1 = o1 . iterator ( ) , it2 = o2 . iterator ( ) ; while ( it1 . hasNext ( ) && it2 . hasNext ( ) ) { int cmp = it1 . next ( ) . compareTo ( it2 . next ( ) ) ; if ( cmp != 0 ) { return cmp ; } } if ( it1 . hasNext ( ) ) { return 1 ; } else if ( it2 . hasNext ( ) ) { return - 1 ; } return 0 ;
public class PackedSpriteSheet { /** * Get a single named sprite from the sheet * @ param name The name of the sprite to retrieve * @ return The sprite requested ( image of ) */ public Image getSprite ( String name ) { } }
Section section = ( Section ) sections . get ( name ) ; if ( section == null ) { throw new RuntimeException ( "Unknown sprite from packed sheet: " + name ) ; } return image . getSubImage ( section . x , section . y , section . width , section . height ) ;
public class WordVectorSerializer { /** * This method restores ParagraphVectors model previously saved with writeParagraphVectors ( ) * @ return */ public static ParagraphVectors readParagraphVectors ( InputStream stream ) throws IOException { } }
File tmpFile = DL4JFileUtils . createTempFile ( "restore" , "paravec" ) ; try { FileUtils . copyInputStreamToFile ( stream , tmpFile ) ; return readParagraphVectors ( tmpFile ) ; } finally { tmpFile . delete ( ) ; }
public class ScriptableUtils { /** * Deep - hash of an object . * < em > DOES NOT DEAL WITH CIRCULAR REFERENCES ! < / em > * @ param jsObj * @ return { @ code o1 } ' s hash code . */ public static int jsHash ( Object jsObj ) { } }
if ( jsObj == null ) { return 1 ; } // Concatenated strings in Rhino have a different type . We need to manually // resolve to String semantics , which is what the following lines do . if ( jsObj instanceof ConsString ) { return jsObj . toString ( ) . hashCode ( ) ; } return ( jsObj instanceof ScriptableObject ) ? jsSc...
public class DefaultEntityManager { /** * Returns the effective namespace . If a namespace was specified using { @ link Tenant } , it will be * returned . Otherwise , the namespace of this EntityManager is returned . * @ return the effective namespace . */ String getEffectiveNamespace ( ) { } }
String namespace = Tenant . getNamespace ( ) ; if ( namespace == null ) { namespace = datastore . getOptions ( ) . getNamespace ( ) ; } return namespace ;
public class ClearIdentityVisitor { /** * Visits any Visitable object implementing the Identifiable interface , clearing the Identifiable objects identifier . * @ param visitable the Visitable object visited by this Visitor . * @ see org . cp . elements . lang . Identifiable # setId ( Comparable ) * @ see org . c...
if ( visitable instanceof Identifiable ) { ( ( Identifiable ) visitable ) . setId ( null ) ; }
public class CmsPushButton { /** * Disables the button and changes the button title attribute to the disabled reason . < p > * @ param disabledReason the disabled reason */ public void disable ( String disabledReason ) { } }
setDown ( false ) ; setEnabled ( false ) ; m_disabledReason = disabledReason ; super . setTitle ( disabledReason ) ;
public class NumberList { /** * unchecked but we know we can go from Map < String , Long > to Map < String , Object > */ @ SuppressWarnings ( "unchecked" ) public static NumberList delta ( NumberList currentMap , NumberList previousMap ) { } }
return delta ( ( Map ) currentMap . numbers , ( Map ) previousMap . numbers ) ;
public class CPDefinitionSpecificationOptionValueUtil { /** * Returns the first cp definition specification option value in the ordered set where CPOptionCategoryId = & # 63 ; . * @ param CPOptionCategoryId the cp option category ID * @ param orderByComparator the comparator to order the set by ( optionally < code ...
return getPersistence ( ) . findByCPOptionCategoryId_First ( CPOptionCategoryId , orderByComparator ) ;
public class OfflineImageDecompressor { /** * Process image file . */ private void go ( ) throws IOException { } }
long start = System . currentTimeMillis ( ) ; System . out . println ( "Decompressing image file: " + inputFile + " to " + outputFile ) ; DataInputStream in = null ; DataOutputStream out = null ; try { // setup in PositionTrackingInputStream ptis = new PositionTrackingInputStream ( new FileInputStream ( new File ( inpu...
public class JSONObject { /** * Put a key / double pair in the JSONObject . * @ param key A key string . * @ param value A double which is the value . * @ return this * @ throws JSONException If the key is null or if the number is invalid . */ public JSONObject put ( String key , double value ) throws JSONExcep...
put ( key , Double . valueOf ( value ) ) ; return this ;
public class SpringUtil { /** * Returns a property value from the application context . * @ param name Property name . * @ return Property value , or null if not found . */ public static String getProperty ( String name ) { } }
if ( propertyProvider == null ) { initPropertyProvider ( ) ; } return propertyProvider . getProperty ( name ) ;
public class vrid_binding { /** * Use this API to fetch vrid _ binding resource of given name . */ public static vrid_binding get ( nitro_service service , Long id ) throws Exception { } }
vrid_binding obj = new vrid_binding ( ) ; obj . set_id ( id ) ; vrid_binding response = ( vrid_binding ) obj . get_resource ( service ) ; return response ;
public class Configuration { /** * Extracts the specified file from this configuration ' s zip file , if applicable . * @ param targetFile * The target file . The file name without the path information is taken in order to * identify the zip entry to extract . * @ param forceOverwrite * If { @ code true } , a...
if ( zipArchive != null ) { ZipEntry entry = zipArchive . getEntry ( targetFile . getName ( ) ) ; if ( entry != null ) { if ( ! targetFile . exists ( ) ) { try { targetFile . createNewFile ( ) ; } catch ( IOException ex ) { throw new JFunkException ( "Error creating file: " + targetFile , ex ) ; } } else if ( ! forceOv...
public class Utils { /** * Converts spaces to dashes . * @ param str a string with spaces * @ param replaceWith a string to replace spaces with * @ return a string with dashes */ public static String noSpaces ( String str , String replaceWith ) { } }
return StringUtils . isBlank ( str ) ? "" : str . trim ( ) . replaceAll ( "[\\p{C}\\p{Z}]+" , StringUtils . trimToEmpty ( replaceWith ) ) . toLowerCase ( ) ;
public class DListImpl { /** * Creates a new < code > DList < / code > object that contains the contents of this * < code > DList < / code > object concatenated * with the contents of the < code > otherList < / code > object . * @ paramotherListThe list whose elements are placed at the end of the list * returne...
DListImpl result = new DListImpl ( pbKey ) ; result . addAll ( this ) ; result . addAll ( otherList ) ; return result ;
public class DomainRuntimeView { /** * / * @ Override * public void onClearActiveSelection ( ClearFinderSelectionEvent event ) { * serverColWidget . getElement ( ) . removeClassName ( " active " ) ; * subsysColWidget . getElement ( ) . removeClassName ( " active " ) ; * statusColWidget . getElement ( ) . remove...
serverColumn = new FinderColumn < Server > ( FinderColumn . FinderId . RUNTIME , "Server" , new FinderColumn . Display < Server > ( ) { @ Override public boolean isFolder ( Server data ) { return data . isStarted ( ) ; } @ Override public SafeHtml render ( String baseCss , Server server ) { String context = presenter ....
public class Mutation { /** * Specify a column family name and the corresponding column * family object . * param @ cf - column family name * param @ columnFamily - the column family . */ public void add ( ColumnFamily columnFamily ) { } }
assert columnFamily != null ; ColumnFamily prev = modifications . put ( columnFamily . id ( ) , columnFamily ) ; if ( prev != null ) // developer error throw new IllegalArgumentException ( "ColumnFamily " + columnFamily + " already has modifications in this mutation: " + prev ) ;
public class StringUtilities { /** * Returns < CODE > true < / CODE > if the given string matches the given regular expression . * @ param str The string against which the expression is to be matched * @ param expr The regular expression to match with the input string * @ param whole Indicates that a whole word m...
return getWildcardMatcher ( str , expr , whole ) . find ( ) ;
public class BasicFunctionsRuntime { /** * Returns the largest ( closest to positive infinity ) integer value that is less than or equal to * the argument . */ public static long floor ( SoyValue arg ) { } }
if ( arg instanceof IntegerData ) { return ( ( IntegerData ) arg ) . longValue ( ) ; } else { return ( long ) Math . floor ( arg . floatValue ( ) ) ; }
public class Compose { /** * Transformation operation * @ param fn Transformation function * @ param ds Datastructure to transform * @ return Transformed data structure */ public < T , R > Higher < CRE , Higher < C2 , R > > map ( Function < ? super T , ? extends R > fn , Higher < CRE , Higher < C2 , T > > ds ) { ...
return f . map ( h -> g . map ( fn , h ) , ds ) ;
public class ClassScanner { /** * Find all classes that match the class name pattern . * @ param classNamePattern the class name pattern * @ param scannedClasses the Map for scanned classes * @ throws IOException if an I / O error has occurred */ public void scan ( String classNamePattern , final Map < String , C...
scan ( classNamePattern , scannedClasses :: put ) ;
public class AbnormalFinallyBlockReturn { /** * overrides the visitor to find return / exceptions from the finally block . * @ param seen * the opcode that is being visited */ @ Override public void sawOpcode ( int seen ) { } }
FinallyBlockInfo fbi = fbInfo . get ( 0 ) ; if ( getPC ( ) < fbi . startPC ) { return ; } if ( getPC ( ) == fbi . startPC ) { if ( OpcodeUtils . isAStore ( seen ) ) { fbi . exReg = RegisterUtils . getAStoreReg ( this , seen ) ; } else { removeEarliestFinallyBlock ( ) ; sawOpcode ( seen ) ; return ; } return ; } if ( se...
public class ColumnListEditor { /** * Checks that if only single column used in data set - > it cannot be unselected . */ private boolean checkSingleColumnEditorDisabled ( ) { } }
final int size = listEditor . getList ( ) . size ( ) ; final boolean hasEditors = ! listEditor . getEditors ( ) . isEmpty ( ) ; if ( size == 1 && hasEditors ) { setEditorEnabled ( 0 , false , DataSetEditorConstants . INSTANCE . dataSetMustHaveAtLeastOneColumn ( ) ) ; return true ; } return false ;
public class TransactionSavedRecentResult { protected String deriveOtherTypeValueTitle ( BehaviorCommandMeta meta ) { } }
final String valueTitle ; if ( meta . isInsert ( ) ) { valueTitle = "inserted" ; } else if ( meta . isUpdate ( ) ) { valueTitle = "updated" ; } else if ( meta . isDelete ( ) ) { valueTitle = "deleted" ; } else if ( meta . isSelectCount ( ) ) { valueTitle = "count" ; } else { valueTitle = "value" ; } return valueTitle ;