signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JoinNode { /** * Returns nodes in the order they are joined in the tree by iterating the tree depth - first */
public List < JoinNode > generateAllNodesJoinOrder ( ) { } } | ArrayList < JoinNode > nodes = new ArrayList < > ( ) ; listNodesJoinOrderRecursive ( nodes , true ) ; return nodes ; |
public class DescriptorImporterBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . descriptor . api . DescriptorImporter # from ( java . lang . String ) */
@ Override @ Deprecated public T from ( final String string ) throws IllegalArgumentException , DescriptorImportException { } } | return fromString ( string ) ; |
public class InvalidRequestException { /** * The request omitted one or more required parameters .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRequiredParameters ( java . util . Collection ) } or { @ link # withRequiredParameters ( java . util . Collec... | if ( this . requiredParameters == null ) { setRequiredParameters ( new java . util . ArrayList < String > ( requiredParameters . length ) ) ; } for ( String ele : requiredParameters ) { this . requiredParameters . add ( ele ) ; } return this ; |
public class Downsampling { /** * Calculates the effective index interval after the entry at ` index ` in an IndexSummary . In other words , this
* returns the number of partitions in the primary on - disk index before the next partition that has an entry in
* the index summary . If samplingLevel = = BASE _ SAMPLIN... | assert index >= 0 ; index %= samplingLevel ; List < Integer > originalIndexes = getOriginalIndexes ( samplingLevel ) ; int nextEntryOriginalIndex = ( index == originalIndexes . size ( ) - 1 ) ? BASE_SAMPLING_LEVEL : originalIndexes . get ( index + 1 ) ; return ( nextEntryOriginalIndex - originalIndexes . get ( index ) ... |
public class AbstractHibernateCriteriaBuilder { /** * Adds a projection that allows the criteria to return the distinct property count
* @ param propertyName The name of the property */
public org . grails . datastore . mapping . query . api . ProjectionList countDistinct ( String propertyName ) { } } | return countDistinct ( propertyName , null ) ; |
public class ConfigHelper { /** * may be null if unset */
public static KeyRange getInputKeyRange ( Configuration conf ) { } } | String str = conf . get ( INPUT_KEYRANGE_CONFIG ) ; return str == null ? null : keyRangeFromString ( str ) ; |
public class ListTaskDefinitionsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListTaskDefinitionsRequest listTaskDefinitionsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listTaskDefinitionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listTaskDefinitionsRequest . getFamilyPrefix ( ) , FAMILYPREFIX_BINDING ) ; protocolMarshaller . marshall ( listTaskDefinitionsRequest . getStatus ( ) , STATU... |
public class Continuations { /** * Return a { @ link SanitizedContent } valued continuation . Rendering logic is delegated to the
* { @ link WriteContinuation } , but it is assumed that the builder is the render target . */
static Continuation < SanitizedContent > strictContinuation ( WriteContinuation delegate , fin... | if ( delegate . result ( ) . isDone ( ) ) { return new ResultContinuation < > ( UnsafeSanitizedContentOrdainer . ordainAsSafe ( buffer . toString ( ) , kind ) ) ; } return new AbstractContinuation < SanitizedContent > ( delegate ) { @ Override Continuation < SanitizedContent > nextContinuation ( WriteContinuation next ... |
public class ConditionDateFormatterFactory { /** * { @ link ConditionDateFormatter } インスタンスを作成する 。
* @ param store
* @ return
* @ throws IllegalArgumentException store is null . */
@ Override public ConditionDateFormatter create ( final TokenStore store ) { } } | ArgUtils . notNull ( store , "store" ) ; final ConditionDateFormatter formatter = new ConditionDateFormatter ( store . getConcatenatedToken ( ) ) ; for ( Token token : store . getTokens ( ) ) { if ( token instanceof Token . Condition ) { // 条件の場合
final Token . Condition conditionToken = token . asCondition ( ) ; final ... |
public class H2GISFunctions { /** * Release geometry type
* @ param connection Active h2 connection with DROP DOMAIN and DROP ALIAS rights
* @ throws java . sql . SQLException */
public static void unRegisterGeometryType ( Connection connection ) throws SQLException { } } | Statement st = connection . createStatement ( ) ; DomainInfo [ ] domainInfos = getBuiltInsType ( ) ; for ( DomainInfo domainInfo : domainInfos ) { st . execute ( "DROP DOMAIN IF EXISTS " + domainInfo . getDomainName ( ) ) ; } |
public class InjectorBuilder { /** * Create the injector in the specified stage using the specified InjectorCreator
* strategy . The InjectorCreator will most likely perform additional error handling on top
* of the call to { @ link Guice # createInjector } .
* @ param stage Stage in which the injector is running... | return creator . createInjector ( stage , module ) ; |
public class OmemoService { /** * Returns true , if a rotation of the signed preKey is necessary .
* @ param userDevice our OmemoDevice
* @ return true if rotation is necessary */
private boolean shouldRotateSignedPreKey ( OmemoDevice userDevice ) { } } | if ( ! OmemoConfiguration . getRenewOldSignedPreKeys ( ) ) { return false ; } Date now = new Date ( ) ; Date lastRenewal = getOmemoStoreBackend ( ) . getDateOfLastSignedPreKeyRenewal ( userDevice ) ; if ( lastRenewal == null ) { lastRenewal = new Date ( ) ; getOmemoStoreBackend ( ) . setDateOfLastSignedPreKeyRenewal ( ... |
public class DogmaApi { /** * Get effect information Get information on a dogma effect - - - This route
* expires daily at 11:05
* @ param effectId
* A dogma effect ID ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch... | ApiResponse < DogmaEffectResponse > resp = getDogmaEffectsEffectIdWithHttpInfo ( effectId , datasource , ifNoneMatch ) ; return resp . getData ( ) ; |
public class Datamodel { /** * Creates a { @ link Claim } . It might be more convenient to use
* { @ link # makeStatement } directly if you want to build a statement .
* @ param subject
* the subject the Statement refers to
* @ param mainSnak
* the main Snak of the Statement
* @ param qualifiers
* the qua... | return factory . getClaim ( subject , mainSnak , qualifiers ) ; |
public class BindTableGenerator { /** * Buld indexes .
* @ param entity
* the entity
* @ param List
* @ param unique
* the unique
* @ param counter
* the counter
* @ return the pair */
public static Triple < String , String , String > buldIndexes ( final SQLiteEntity entity , ArrayList < Pair < List < S... | Triple < String , String , String > result = new Triple < > ( ) ; result . value0 = "" ; result . value1 = "" ; result . value2 = "" ; if ( indexList . size ( ) == 0 ) return result ; String uniqueString ; if ( unique ) { uniqueString = "UNIQUE " ; } else { uniqueString = "" ; } List < String > listCreateIndex = new Ar... |
public class WriteFileRecordRequest { /** * addRequest - - add a new record request .
* @ param request Request record */
public void addRequest ( RecordRequest request ) { } } | if ( request . getRequestSize ( ) + getRequestSize ( ) > 248 ) { throw new IllegalArgumentException ( ) ; } if ( records == null ) { records = new RecordRequest [ 1 ] ; } else { RecordRequest old [ ] = records ; records = new RecordRequest [ old . length + 1 ] ; System . arraycopy ( old , 0 , records , 0 , old . length... |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertCRCResourceManagementFmtQualToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class TypeUtils { /** * Checks if a { @ link TypeDef } is an instance of an other { @ link TypeDef } .
* @ param type The type to compare .
* @ param targetType The target type .
* @ param function
* @ return true if match , false otherwise . */
public static boolean isInstanceOf ( TypeRef type , TypeDef... | if ( type instanceof ClassRef ) { ClassRef classRef = ( ClassRef ) type ; TypeDef definition = classRef . getDefinition ( ) ; if ( definition . getFullyQualifiedName ( ) . equals ( targetType . getFullyQualifiedName ( ) ) ) { return true ; } for ( TypeRef i : definition . getImplementsList ( ) ) { if ( function . apply... |
public class ClustersInner { /** * Update the properties of a given cluster .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param clusterName The name of the cluster within the specified resource group . Cluster names can only contain a combination of alphanumeric charac... | return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , clusterName , parameters ) , serviceCallback ) ; |
public class JKSecurityUtil { /** * Encode .
* @ param source the source
* @ return the string */
public static String encode ( final String source ) { } } | if ( source == null ) { return null ; } return encodeInToBase64 ( source . getBytes ( ) ) ; |
public class NS { /** * Returns an < code > IfNotExists < / code > object which represents an < a href =
* " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . Modifying . html "
* > if _ not _ exists ( path , operand ) < / a > function call where path refers to that
*... | return new IfNotExistsFunction < NS > ( this , new LiteralOperand ( defaultValue ) ) ; |
public class ContentExposingResource { /** * Create a checksum URI object . */
protected static URI checksumURI ( final String checksum ) { } } | if ( ! isBlank ( checksum ) ) { return URI . create ( checksum ) ; } return null ; |
public class TransactionManager { /** * Removes all transaction ids started before the given time from invalid list .
* @ param time time in milliseconds
* @ return true if invalid list got changed , false otherwise
* @ throws InvalidTruncateTimeException if there are any in - progress transactions started before... | // guard against changes to the transaction log while processing
txMetricsCollector . rate ( "truncateInvalidTxBefore" ) ; Stopwatch timer = new Stopwatch ( ) . start ( ) ; this . logReadLock . lock ( ) ; try { boolean success ; synchronized ( this ) { ensureAvailable ( ) ; success = doTruncateInvalidTxBefore ( time ) ... |
public class Main { /** * Calculate the sum of the fifth power of the first ' length ' even natural numbers .
* Args :
* length : The number of initial even natural numbers to consider .
* Returns :
* An integer representing the sum of the fifth power of the even natural numbers .
* Examples :
* > > > sum _... | int total_sum = 0 ; for ( int count = 1 ; count <= length ; count ++ ) { int value = 2 * count ; total_sum += Math . pow ( value , 5 ) ; } return total_sum ; |
public class AsmHelper { /** * Extract the package name from a fully qualified ( normalized ) class name , i . e . : converts
* " java . lang . Object " to " java . lang " .
* @ param className
* @ return */
public static final String extractPackageName ( String className ) { } } | if ( className == null || className . trim ( ) . isEmpty ( ) ) { return "" ; } final int idx = className . lastIndexOf ( '.' ) ; if ( idx == - 1 ) { return "" ; } else { return className . substring ( 0 , idx ) ; } |
public class IcedUtils { /** * Deep - copy clone given iced object . */
static public < T extends Iced > T deepCopy ( T iced ) { } } | if ( iced == null ) return null ; AutoBuffer ab = new AutoBuffer ( ) ; iced . write ( ab ) ; ab . flipForReading ( ) ; // Create a new instance
return ( T ) TypeMap . newInstance ( iced . frozenType ( ) ) . read ( ab ) ; |
public class DefaultJsonWebTokenImpl { /** * @ param jwt
* @ return */
private void handleClaims ( String jwt ) { } } | try { if ( claimsUtils == null ) { claimsUtils = new ClaimsUtils ( ) ; } this . claimsSet = claimsUtils . getJwtClaims ( jwt ) ; } catch ( JoseException e ) { Tr . error ( tc , "ERROR_GETTING_CLAIMS_FROM_JWT_STRING" , new Object [ ] { e . getLocalizedMessage ( ) } ) ; } |
public class FactoryDetectPoint { /** * Creates a Fast corner detector with feature intensity for additional pruning . Fast features
* have minimums and maximums .
* @ param configFast Configuration for FAST feature detector
* @ param configDetector Configuration for feature extractor .
* @ param imageType ype ... | if ( configFast == null ) configFast = new ConfigFastCorner ( ) ; configFast . checkValidity ( ) ; FastCornerDetector < T > alg = FactoryIntensityPointAlg . fast ( configFast . pixelTol , configFast . minContinuous , imageType ) ; alg . setMaxFeaturesFraction ( configFast . maxFeatures ) ; GeneralFeatureIntensity < T ,... |
public class SortedMapWritable { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override public void readFields ( DataInput in ) throws IOException { } } | super . readFields ( in ) ; // Read the number of entries in the map
int entries = in . readInt ( ) ; // Then read each key / value pair
for ( int i = 0 ; i < entries ; i ++ ) { WritableComparable key = ( WritableComparable ) ReflectionUtils . newInstance ( getClass ( in . readByte ( ) ) , getConf ( ) ) ; key . readFie... |
public class HopcroftMinimization { /** * Minimizes the given Mealy machine . The result is returned in the form of a { @ link CompactMealy } .
* @ param mealy
* the Mealy machine to minimize
* @ param alphabet
* the input alphabet ( this will be the input alphabet of the resulting Mealy machine )
* @ param p... | return doMinimizeMealy ( mealy , alphabet , new CompactMealy . Creator < > ( ) , pruningMode ) ; |
public class ClientConnection { /** * Opens a new IP communication channel to a remote server .
* The communication state of this object is assumed to be closed state . This method
* is designed to be called only once during the objects lifetime !
* @ param localEP the local endpoint to use for communication chan... | if ( state != CLOSED ) throw new IllegalStateException ( "open connection" ) ; ctrlEndpt = serverCtrlEP ; if ( ctrlEndpt . isUnresolved ( ) ) throw new KNXException ( "server control endpoint is unresolved: " + serverCtrlEP ) ; if ( ctrlEndpt . getAddress ( ) . isMulticastAddress ( ) ) throw new KNXIllegalArgumentExcep... |
public class GoogleCalendarService { /** * Inserts a calendar into the google calendar .
* @ param calendar The calendar to be inserted .
* @ throws IOException For unexpected errors . */
public void insertCalendar ( GoogleCalendar calendar ) throws IOException { } } | com . google . api . services . calendar . model . Calendar cal ; cal = converter . convert ( calendar , com . google . api . services . calendar . model . Calendar . class ) ; cal = dao . calendars ( ) . insert ( cal ) . execute ( ) ; calendar . setId ( cal . getId ( ) ) ; |
public class MetricsImpl { /** * Retrieve metric data .
* Gets metric values for a single metric .
* @ param appId ID of the application . This is Application ID from the API Access settings blade in the Azure portal .
* @ param metricId ID of the metric . This is either a standard AI metric , or an application -... | return getWithServiceResponseAsync ( appId , metricId ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class MathUtils { /** * Calculate string similarity with tfidf weights relative to each character
* frequency and how many times a character appears in a given string
* @ param strings the strings to calculate similarity for
* @ return the cosine similarity between the strings */
public static double strin... | if ( strings == null ) return 0 ; Counter < String > counter = new Counter < > ( ) ; Counter < String > counter2 = new Counter < > ( ) ; for ( int i = 0 ; i < strings [ 0 ] . length ( ) ; i ++ ) counter . incrementCount ( String . valueOf ( strings [ 0 ] . charAt ( i ) ) , 1.0f ) ; for ( int i = 0 ; i < strings [ 1 ] .... |
public class RBBISetBuilder { /** * / CLOVER : OFF */
void printRangeGroups ( ) { } } | RangeDescriptor rlRange ; RangeDescriptor tRange ; int i ; int lastPrintedGroupNum = 0 ; System . out . print ( "\nRanges grouped by Unicode Set Membership...\n" ) ; for ( rlRange = fRangeList ; rlRange != null ; rlRange = rlRange . fNext ) { int groupNum = rlRange . fNum & 0xbfff ; if ( groupNum > lastPrintedGroupNum ... |
public class JsonConverterUtil { /** * Loops through a list of { @ link JsonNode } instances , and stores the given property with given type in the returned list .
* In Java 8 , this probably could be done a lot cooler . */
public static Set < Long > gatherLongPropertyFromJsonNodes ( Iterable < JsonNode > jsonNodes ,... | Set < Long > result = new HashSet < Long > ( ) ; // Using a Set to filter out doubles
for ( JsonNode node : jsonNodes ) { if ( node . has ( propertyName ) ) { Long propertyValue = node . get ( propertyName ) . asLong ( ) ; if ( propertyValue > 0 ) { // Just to be safe
result . add ( propertyValue ) ; } } } return resul... |
public class ListConsCases { /** * Matches a list with a head element and a tail of remaining elements .
* < p > If matched , the { @ code head } value is decomposed to 0 and the { @ code tail } value is decomposed to */
public static < T , ET extends T , B1 > DecomposableMatchBuilder1 < List < T > , B1 > headTail ( ... | List < Matcher < Object > > matchers = Lists . of ( ArgumentMatchers . any ( ) , ArgumentMatchers . any ( ) ) ; return new DecomposableMatchBuilder2 < List < T > , ET , List < T > > ( matchers , Tuple2 . of ( 0 , 1 ) , new ListConsHeadTailFieldExtractor < > ( ) ) . decomposeFirstAndSecond ( head , tail ) ; |
public class ImapRequestLineReader { /** * Sends a server command continuation request ' + ' back to the client ,
* requesting more data to be sent . */
public void commandContinuationRequest ( ) throws ProtocolException { } } | try { output . write ( '+' ) ; output . write ( ' ' ) ; output . write ( 'O' ) ; output . write ( 'K' ) ; output . write ( '\r' ) ; output . write ( '\n' ) ; output . flush ( ) ; } catch ( IOException e ) { throw new ProtocolException ( "Unexpected exception in sending command continuation request." , e ) ; } |
public class JsonParser { /** * Parses an array
* @ return the parsed array
* @ throws IOException if the input stream could not be read or if
* the input stream contained an unexpected token */
public List < Object > parseArray ( ) throws IOException { } } | Type t = lexer . readNextToken ( ) ; if ( t != Type . START_ARRAY ) { throw new IOException ( "Unexpected token: " + t ) ; } return parseArrayInternal ( ) ; |
public class MetricManager { /** * Shut down the background thread that is processing metrics */
public static synchronized void shutdown ( ) { } } | if ( BACKGROUND_SERVICE != null ) { try { BACKGROUND_SERVICE . stop ( ) ; } catch ( Throwable t ) { LOGGER . error ( "Exception stopping Stackify Metrics API service" , t ) ; } INITIALIZED . compareAndSet ( true , false ) ; } |
public class ArrayMath { /** * CASTS - - - - - */
public static float [ ] doubleArrayToFloatArray ( double [ ] a ) { } } | float [ ] result = new float [ a . length ] ; for ( int i = 0 ; i < a . length ; i ++ ) { result [ i ] = ( float ) a [ i ] ; } return result ; |
public class JawrConfigManager { /** * ( non - Javadoc )
* @ see net . jawr . web . config . jmx . JawrConfigManagerMBean # setUseBundleMapping (
* boolean ) */
@ Override public void setUseBundleMapping ( boolean usBundleMapping ) { } } | configProperties . setProperty ( JawrConfig . JAWR_USE_BUNDLE_MAPPING , Boolean . toString ( usBundleMapping ) ) ; |
public class Counters { /** * Returns a map view of the given counter . */
public static < E > Map < E , Double > asMap ( final Counter < E > counter ) { } } | return new AbstractMap < E , Double > ( ) { @ Override public int size ( ) { return counter . size ( ) ; } @ Override public Set < Entry < E , Double > > entrySet ( ) { return counter . entrySet ( ) ; } @ Override @ SuppressWarnings ( "unchecked" ) public boolean containsKey ( Object key ) { return counter . containsKe... |
public class StartAction { /** * { @ inheritDoc } */
@ Override public void execute ( ExecutorService executor ) { } } | _startTime . set ( System . currentTimeMillis ( ) ) ; if ( _tc . isInfoEnabled ( ) ) { AppMessageHelper . get ( _aii . getHandler ( ) ) . info ( "STARTING_APPLICATION" , _config . getName ( ) ) ; } long maxWait = ApplicationStateCoordinator . getApplicationStartTimeout ( ) ; _slowMessageAction . set ( ( ( ScheduledExec... |
public class Authentication { /** * Checks if a given number for 2FA is valid for the given secret
* @ param secret The plaintext secret to use for checking
* @ param number The number entered by the user
* @ return True if number is valid , false otherwise */
public boolean validSecondFactor ( String secret , St... | Objects . requireNonNull ( secret , Required . SECRET . toString ( ) ) ; Objects . requireNonNull ( number , Required . TOTP . toString ( ) ) ; return TotpUtils . verifiedTotp ( secret , number ) ; |
public class FormInputValueHelper { /** * Serializes form inputs and writes the data to the output directory to be used by future
* non - training crawls .
* @ param dir The output directory for the form input data .
* @ return The list of inputs */
public static List < FormInput > deserializeFormInputs ( File di... | List < FormInput > deserialized = new ArrayList < > ( ) ; final File in = new File ( dir , FORMS_JSON_FILE ) ; if ( in . exists ( ) ) { LOGGER . info ( "Reading trained form inputs from " + in . getAbsolutePath ( ) ) ; Gson gson = new GsonBuilder ( ) . create ( ) ; try { deserialized = gson . fromJson ( FileUtils . rea... |
public class KunderaCriteriaBuilder { /** * ( non - Javadoc )
* @ see
* javax . persistence . criteria . CriteriaBuilder # or ( javax . persistence . criteria
* . Expression , javax . persistence . criteria . Expression ) */
@ Override public Predicate or ( Expression < Boolean > arg0 , Expression < Boolean > arg... | // TODO Auto - generated method stub
if ( arg0 != null && arg1 != null ) { if ( arg0 . getClass ( ) . isAssignableFrom ( ComparisonPredicate . class ) && arg1 . getClass ( ) . isAssignableFrom ( ComparisonPredicate . class ) ) { return new DisjunctionPredicate ( ( Predicate ) arg0 , ( Predicate ) arg1 ) ; } } return nu... |
public class BeanMappingConfigRespository { /** * 直接注册为默认mapping
* @ param src
* @ param dest */
public void register ( Class src , Class target ) { } } | List < BeanMappingObject > objects = BeanMappingParser . parseMapping ( src , target ) ; for ( BeanMappingObject object : objects ) { register ( object ) ; } |
public class LongDoubleDenseVector { /** * Updates this vector to be the entrywise sum of this vector with the other . */
public void add ( LongDoubleVector other ) { } } | if ( other instanceof LongDoubleUnsortedVector ) { LongDoubleUnsortedVector vec = ( LongDoubleUnsortedVector ) other ; for ( int i = 0 ; i < vec . top ; i ++ ) { this . add ( vec . idx [ i ] , vec . vals [ i ] ) ; } } else { // TODO : Add special case for LongDoubleDenseVector .
other . iterate ( new SparseBinaryOpAppl... |
public class PropertiesFile { /** * Merge a Map of properties into our Properties object
* The additions will overwrite any existing properties
* @ param additionalProperties Map to merge into our Properties object */
public void addAndOverwriteProperties ( Map < String , String > additionalProperties ) { } } | additionalProperties . values ( ) . removeAll ( Collections . singleton ( null ) ) ; for ( Map . Entry < String , String > additionalPropertiesMap : additionalProperties . entrySet ( ) ) { if ( ! additionalPropertiesMap . getValue ( ) . trim ( ) . isEmpty ( ) ) { properties . setProperty ( additionalPropertiesMap . get... |
public class AutoClassDiscovery { /** * Returns all class names stored in the cache .
* @ return the class names */
public static List < String > getAllClassNames ( ) { } } | List < String > result = new ArrayList < > ( ) ; Iterator < String > pkgs = m_Cache . packages ( ) ; while ( pkgs . hasNext ( ) ) { String pkg = pkgs . next ( ) ; if ( pkg . startsWith ( "moa" ) ) { Set < String > classnames = m_Cache . getClassnames ( pkg ) ; result . addAll ( classnames ) ; } } return result ; |
public class SpringDataRestConfiguration { /** * tag : : alternate - type - builder [ ] */
private Type pageableMixin ( RepositoryRestConfiguration restConfiguration ) { } } | return new AlternateTypeBuilder ( ) . fullyQualifiedClassName ( String . format ( "%s.generated.%s" , Pageable . class . getPackage ( ) . getName ( ) , Pageable . class . getSimpleName ( ) ) ) . withProperties ( Stream . of ( property ( Integer . class , restConfiguration . getPageParamName ( ) ) , property ( Integer .... |
public class ApiClient { /** * Formats the specified collection query parameters to a list of { @ code Pair } objects .
* Note that the values of each of the returned Pair objects are percent - encoded .
* @ param collectionFormat The collection format of the parameter .
* @ param name The name of the parameter .... | List < Pair > params = new ArrayList < Pair > ( ) ; // preconditions
if ( name == null || name . isEmpty ( ) || value == null || value . isEmpty ( ) ) { return params ; } // create the params based on the collection format
if ( "multi" . equals ( collectionFormat ) ) { for ( Object item : value ) { params . add ( new P... |
public class ContainerProperties { /** * A list of data volumes used in a job .
* @ param volumes
* A list of data volumes used in a job . */
public void setVolumes ( java . util . Collection < Volume > volumes ) { } } | if ( volumes == null ) { this . volumes = null ; return ; } this . volumes = new java . util . ArrayList < Volume > ( volumes ) ; |
public class ELKIServiceRegistry { /** * Register a class with the registry .
* @ param parent Parent class
* @ param cname Class name */
protected static void register ( Class < ? > parent , String cname ) { } } | Entry e = data . get ( parent ) ; if ( e == null ) { data . put ( parent , e = new Entry ( ) ) ; } e . addName ( cname ) ; |
public class CompilerThread { /** * Count the number of active sub tasks . */
public synchronized int numActiveSubTasks ( ) { } } | int c = 0 ; for ( Future < ? > f : subTasks ) { if ( ! f . isDone ( ) && ! f . isCancelled ( ) ) { c ++ ; } } return c ; |
public class LazyRemovalCache { /** * Adds all value which have not been marked as removable to the returned set
* @ return */
public Set < V > nonRemovedValues ( ) { } } | return map . values ( ) . stream ( ) . filter ( entry -> ! entry . removable ) . map ( entry -> entry . val ) . collect ( Collectors . toSet ( ) ) ; |
public class CachedResponseImpl { /** * Gets the first header value set for the given header in this response .
* If the header is not set , { @ code null } is returned .
* Useful for headers that don ' t have multiple values , like
* { @ code " Content - Type " } or { @ code " Content - Length " } .
* @ param ... | List < String > values = headers . get ( pHeaderName ) ; return ( values != null && values . size ( ) > 0 ) ? values . get ( 0 ) : null ; |
public class Artifact { /** * Returns the first target that matched the given path based on the defined patterns . Returns null if the argument is
* < code > null < / code > .
* @ param targetPath
* Path to find .
* @ return Target . */
@ Nullable public final Target findTargetFor ( @ Nullable final String targ... | if ( targets == null ) { return null ; } if ( targetPath == null ) { return null ; } for ( final Target target : targets ) { if ( target . matches ( targetPath ) ) { return target ; } } return null ; |
public class IntegerDBIDArrayQuickSort { /** * Sort the array using the given comparator .
* @ param data Data to sort
* @ param start First index
* @ param end Last index ( exclusive )
* @ param comp Comparator */
public static void sort ( int [ ] data , int start , int end , Comparator < ? super DBIDRef > com... | quickSort ( data , start , end - 1 , comp , new IntegerDBIDVar ( ) , new IntegerDBIDVar ( ) , new IntegerDBIDVar ( ) ) ; |
public class IonStructLite { /** * Validates the child and checks locks .
* @ param fieldName may be null
* @ param child must be validated and have field name or id set */
private void _add ( String fieldName , IonValueLite child ) { } } | hasNullFieldName |= fieldName == null ; int size = get_child_count ( ) ; // add this to the Container child collection
add ( size , child ) ; // if we have a hash map we need to update it now
if ( _field_map != null ) { add_field ( fieldName , child . _elementid ( ) ) ; } |
public class XmlEntities { /** * Adds entities to this entity .
* @ param entityArray
* array of entities to be added */
public void addEntities ( String [ ] [ ] entityArray ) { } } | for ( String [ ] anEntityArray : entityArray ) { addEntity ( anEntityArray [ 0 ] , Integer . parseInt ( anEntityArray [ 1 ] ) ) ; } |
public class AbstractModuleIndexWriter { /** * Adds the frame or non - frame module index to the documentation tree .
* @ param body the document tree to which the index will be added */
protected void addIndex ( Content body ) { } } | addIndexContents ( configuration . modules , "doclet.Module_Summary" , configuration . getText ( "doclet.Member_Table_Summary" , configuration . getText ( "doclet.Module_Summary" ) , configuration . getText ( "doclet.modules" ) ) , body ) ; |
public class CoffeeScriptGenerator { /** * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . generator .
* PostInitializationAwareResourceGenerator # afterPropertiesSet ( ) */
@ Override public void afterPropertiesSet ( ) { } } | super . afterPropertiesSet ( ) ; StopWatch stopWatch = new StopWatch ( "initializing JS engine for Coffeescript" ) ; stopWatch . start ( ) ; // Load JavaScript Script Engine
String script = config . getProperty ( JAWR_JS_GENERATOR_COFFEE_SCRIPT_LOCATION , DEFAULT_COFFEE_SCRIPT_JS_LOCATION ) ; jsEngine = new JavascriptE... |
public class Parser { /** * < p > Parses the given resource and evaluates it with the given evaluator . < / p >
* @ param < O > the return type of the evaluator
* @ param resource the resource to evaluate
* @ param evaluator the evaluator to use for transforming expressions
* @ return A list of objects relating... | ExpressionIterator iterator = parse ( resource ) ; List < O > evaluationResults = new ArrayList < > ( ) ; while ( iterator . hasNext ( ) ) { try { evaluationResults . add ( evaluator . eval ( iterator . next ( ) ) ) ; } catch ( Exception e ) { throw new ParseException ( e ) ; } } return evaluationResults ; |
public class PrototypeObjectFactory { /** * Initializes the object with the specified array of arguments providing the object implements the
* ParameterizedInitable interface , or calls the no argument init method if the object implements the Initable
* interface , and finally , does nothing if the object is not In... | if ( object instanceof ParameterizedInitable ) { ( ( ParameterizedInitable ) object ) . init ( args ) ; } else if ( object instanceof Initable ) { ( ( Initable ) object ) . init ( ) ; } return object ; |
public class TaskTracker { /** * Obtain the maximum disk space ( free or total ) in bytes for each volume
* @ param free If true returns free space , else returns capacity
* @ return disk space in bytes
* @ throws IOException */
long getDiskSpace ( boolean free ) throws IOException { } } | long biggestSeenSoFar = 0 ; String [ ] localDirs = getLocalDirsFromConf ( fConf ) ; for ( int i = 0 ; i < localDirs . length ; i ++ ) { DF df = null ; if ( localDirsDf . containsKey ( localDirs [ i ] ) ) { df = localDirsDf . get ( localDirs [ i ] ) ; } else { df = new DF ( new File ( localDirs [ i ] ) , fConf ) ; local... |
public class MaintenanceWindowTaskParameterValueExpressionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( MaintenanceWindowTaskParameterValueExpression maintenanceWindowTaskParameterValueExpression , ProtocolMarshaller protocolMarshaller ) { } } | if ( maintenanceWindowTaskParameterValueExpression == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( maintenanceWindowTaskParameterValueExpression . getValues ( ) , VALUES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException (... |
public class StorageManager { /** * API to a project file into Azkaban Storage
* TODO clean up interface
* @ param project project
* @ param version The new version to be uploaded
* @ param localFile local file
* @ param uploader the user who uploaded */
public void uploadProject ( final Project project , fin... | byte [ ] md5 = null ; if ( ! ( this . storage instanceof DatabaseStorage ) ) { md5 = computeHash ( localFile ) ; } final StorageMetadata metadata = new StorageMetadata ( project . getId ( ) , version , uploader . getUserId ( ) , md5 ) ; log . info ( String . format ( "Adding archive to storage. Meta:%s File: %s[%d byte... |
public class ErrorHandler { /** * < pre >
* Static file content to be served for this error .
* < / pre >
* < code > string static _ file = 2 ; < / code > */
public com . google . protobuf . ByteString getStaticFileBytes ( ) { } } | java . lang . Object ref = staticFile_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; staticFile_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; } |
public class MonoT { /** * Flat Map the wrapped Mono
* @ param f FlatMap function
* @ return MonoT that applies the flatMap function to the wrapped Mono */
public < B > MonoT < W , B > flatMapT ( final Function < ? super T , MonoT < W , B > > f ) { } } | MonoT < W , B > r = of ( run . map ( future -> Mono . from ( future . flatMap ( a -> { Mono < B > m = f . apply ( a ) . run . stream ( ) . toList ( ) . get ( 0 ) ; return m ; } ) ) ) ) ; return r ; |
public class Dj2JrCrosstabBuilder { /** * MOVED INSIDE ExpressionUtils
* protected JRDesignExpression getExpressionForConditionalStyle ( ConditionalStyle condition , String columExpression ) {
* String fieldsMap = " ( ( " + DJDefaultScriptlet . class . getName ( ) + " ) $ P { REPORT _ SCRIPTLET } ) . getCurrentFiel... | return crosstabRow . getTotalStyle ( ) == null ? this . djcross . getRowTotalStyle ( ) : crosstabRow . getTotalStyle ( ) ; |
public class ParquetReader { /** * Retrieve avro schema from parquet file .
* @ param configuration Hadoop configuration .
* @ param filter Filter for Avro metadata .
* @ return avro schema from parquet file .
* @ throws IOException if the Avro schema couldn ' t be parsed from the parquet file . */
private Sche... | final ParquetMetadata footer = ParquetFileReader . readFooter ( configuration , parquetFilePath , filter ) ; final AvroSchemaConverter converter = new AvroSchemaConverter ( ) ; final MessageType schema = footer . getFileMetaData ( ) . getSchema ( ) ; return converter . convert ( schema ) ; |
public class AmazonRedshiftClient { /** * Creates an Amazon Redshift parameter group .
* Creating parameter groups is independent of creating clusters . You can associate a cluster with a parameter group
* when you create the cluster . You can also associate an existing cluster with a parameter group after the clus... | request = beforeClientExecution ( request ) ; return executeCreateClusterParameterGroup ( request ) ; |
public class CommonConfigUtils { /** * Calls { @ code java . lang . String . trim ( ) } on the provided value .
* @ param original
* @ return { @ code null } if { @ code original } is { @ code null } or empty after the { @ code java . lang . String . trim ( ) } operation .
* Otherwise returns the trimmed result .... | if ( original == null ) { return null ; } String result = original . trim ( ) ; if ( result . isEmpty ( ) ) { return null ; } return result ; |
public class JDBC4ResultSetMetaData { /** * Returns an object that implements the given interface to allow access to non - standard methods , or standard methods not exposed by the proxy . */
public < T > T unwrap ( Class < T > iface ) throws SQLException { } } | try { return iface . cast ( this ) ; } catch ( ClassCastException cce ) { throw SQLError . get ( SQLError . ILLEGAL_ARGUMENT , iface . toString ( ) ) ; } |
public class ReflectionUtils { /** * Handle { @ link InvocationTargetException } by logging it and rethrown it as a { @ link ReflectionException }
* @ param methodName method name
* @ param e exception
* @ return wrapped exception */
private static ReflectionException handleException ( String methodName , Invocat... | LOGGER . error ( "Couldn't invoke method " + methodName , e ) ; return new ReflectionException ( e ) ; |
public class ObjectEnvelopeOrdering { /** * Finds edges based to a specific object reference descriptor and
* adds them to the edge map .
* @ param vertex the object envelope vertex holding the object reference
* @ param rds the object reference descriptor */
private void addObjectReferenceEdges ( Vertex vertex ,... | Object refObject = rds . getPersistentField ( ) . get ( vertex . getEnvelope ( ) . getRealObject ( ) ) ; Class refClass = rds . getItemClass ( ) ; for ( int i = 0 ; i < vertices . length ; i ++ ) { Edge edge = null ; // ObjectEnvelope envelope = vertex . getEnvelope ( ) ;
Vertex refVertex = vertices [ i ] ; ObjectEnvel... |
public class CatalogUtil { /** * Validate Snmp Configuration .
* @ param snmpType */
private static void setSnmpInfo ( SnmpType snmpType ) { } } | if ( snmpType == null || ! snmpType . isEnabled ( ) ) { return ; } // Validate Snmp Configuration .
if ( snmpType . getTarget ( ) == null || snmpType . getTarget ( ) . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "Target must be specified for SNMP configuration." ) ; } if ( snmpType . getAuthkey ... |
public class GPXTablesFactory { /** * Creat the track table
* @ param connection
* @ param trackTableName
* @ param isH2 set true if it ' s an H2 database
* @ return
* @ throws SQLException */
public static PreparedStatement createTrackTable ( Connection connection , String trackTableName , boolean isH2 ) thr... | try ( Statement stmt = connection . createStatement ( ) ) { StringBuilder sb = new StringBuilder ( "CREATE TABLE " ) ; sb . append ( trackTableName ) . append ( " (" ) ; if ( isH2 ) { sb . append ( "the_geom MULTILINESTRING CHECK ST_SRID(THE_GEOM) = 4326," ) ; } else { sb . append ( "the_geom GEOMETRY(MULTILINESTRING, ... |
public class P2sVpnServerConfigurationsInner { /** * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan .
* @ param resourceGroupName The resource group name of the VirtualWan .
* @ param virtualWanName The name of the VirtualWan .
* @ throws IllegalArgumentException thrown if parameters fail th... | return listByVirtualWanWithServiceResponseAsync ( resourceGroupName , virtualWanName ) . map ( new Func1 < ServiceResponse < Page < P2SVpnServerConfigurationInner > > , Page < P2SVpnServerConfigurationInner > > ( ) { @ Override public Page < P2SVpnServerConfigurationInner > call ( ServiceResponse < Page < P2SVpnServerC... |
public class InternalXtextParser { /** * InternalXtext . g : 1445:1 : entryRuleEnumLiteralDeclaration : ruleEnumLiteralDeclaration EOF ; */
public final void entryRuleEnumLiteralDeclaration ( ) throws RecognitionException { } } | try { // InternalXtext . g : 1446:1 : ( ruleEnumLiteralDeclaration EOF )
// InternalXtext . g : 1447:1 : ruleEnumLiteralDeclaration EOF
{ before ( grammarAccess . getEnumLiteralDeclarationRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; ruleEnumLiteralDeclaration ( ) ; state . _fsp -- ; after ( grammarAccess . ge... |
public class JvmMemberImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case TypesPackage . JVM_MEMBER__DECLARING_TYPE : return getDeclaringType ( ) != null ; case TypesPackage . JVM_MEMBER__VISIBILITY : return visibility != VISIBILITY_EDEFAULT ; case TypesPackage . JVM_MEMBER__SIMPLE_NAME : return SIMPLE_NAME_EDEFAULT == null ? simpleName != null : ! SIMPLE_NAME_EDE... |
public class HttpClientFactory { /** * The method to use when all the dependencies are resolved .
* It means iPojo guarantees that both the manager and the HTTP
* service are not null .
* @ throws Exception */
public void start ( ) throws Exception { } } | // Is the DM part of the distribution ?
boolean found = false ; for ( Bundle b : this . bundleContext . getBundles ( ) ) { if ( "net.roboconf.dm" . equals ( b . getSymbolicName ( ) ) ) { found = true ; break ; } } // If we are on an agent , we have nothing to do .
// Otherwise , we must register a servlet .
if ( found ... |
public class SmartsFragmentExtractor { /** * Set the mode of SMARTS substructure selection
* @ param mode the mode */
public void setMode ( int mode ) { } } | // check arg
switch ( mode ) { case MODE_EXACT : case MODE_JCOMPOUNDMAPPER : break ; default : throw new IllegalArgumentException ( "Invalid mode specified!" ) ; } this . mode = mode ; // re - gen atom expressions
int numAtoms = mol . getAtomCount ( ) ; for ( int atomIdx = 0 ; atomIdx < numAtoms ; atomIdx ++ ) this . a... |
public class LocalTransformExecutor { /** * Execute the specified TransformProcess with the given < i > sequence < / i > input data < br >
* Note : this method can only be used if the TransformProcess starts with sequence data , but returns < i > non - sequential < / i >
* data ( after reducing or converting sequen... | if ( transformProcess . getFinalSchema ( ) instanceof SequenceSchema ) { throw new IllegalStateException ( "Cannot return sequence data with this method" ) ; } return execute ( null , inputSequence , transformProcess ) . getFirst ( ) ; |
public class StreamEx { /** * Returns a new { @ code StreamEx } which elements are results of reduction of
* all possible n - tuples composed from the elements of supplied collections .
* The whole stream forms an n - fold Cartesian product of input collection
* with itself or n - ary Cartesian power of the input... | if ( n == 0 ) return of ( identity ) ; return of ( new CrossSpliterator . Reducing < > ( Collections . nCopies ( n , source ) , identity , accumulator ) ) ; |
public class AmazonCloudFrontClient { /** * Create a new distribution with tags .
* @ param createDistributionWithTagsRequest
* The request to create a new distribution with tags .
* @ return Result of the CreateDistributionWithTags operation returned by the service .
* @ throws CNAMEAlreadyExistsException
* ... | request = beforeClientExecution ( request ) ; return executeCreateDistributionWithTags ( request ) ; |
public class SiteResourceLoader { /** * Loads the specific resource , from the site - specific jar file if one
* exists and contains the specified resource . If no resource exists
* with that path , null will be returned .
* @ param req the http request for which we are loading a resource
* ( this will be used ... | return getResourceAsStream ( _siteIdent . identifySite ( req ) , path ) ; |
public class DataIO { /** * Check if large files can be mapped into memory .
* For example 32bit JVM can only address 2GB and large files can not be mapped ,
* so for 32bit JVM this function returns false . */
public static boolean JVMSupportsLargeMappedFiles ( ) { } } | String arch = System . getProperty ( "os.arch" ) ; if ( arch == null || ! arch . contains ( "64" ) ) { return false ; } if ( isWindows ( ) ) return false ; // TODO better check for 32bit JVM
return true ; |
public class LoginHandler { /** * The groups of the given person are updated with the information from the
* JAAS login context .
* TODO : no real check or update is done
* @ param _ login JAAS login context
* @ param _ person person for which the groups must be updated
* @ throws EFapsException if a method o... | if ( ! JAASSystem . getAllJAASSystems ( ) . isEmpty ( ) ) { _person . setCompanies ( JAASSystem . getAllJAASSystems ( ) . iterator ( ) . next ( ) , _person . getCompaniesFromDB ( null ) ) ; } |
public class JSON { /** * 将对象转换成json字符串
* @ param obj
* @ return */
public static String toJson ( Object obj ) { } } | try { return objectMapper . writeValueAsString ( obj ) ; } catch ( JsonProcessingException e ) { throw new RuntimeException ( e ) ; } |
public class CmsOuTree { /** * Load and expand given item . < p >
* @ param itemId to be expanded
* @ param type of item */
private void loadAndExpand ( Object itemId , I_CmsOuTreeType type ) { } } | if ( type . isOrgUnit ( ) ) { addChildrenForOUNode ( ( CmsOrganizationalUnit ) itemId ) ; } if ( type . isGroup ( ) ) { addChildrenForGroupsNode ( type , ( String ) itemId ) ; } if ( type . isRole ( ) ) { addChildrenForRolesNode ( ( String ) itemId ) ; } expandItem ( itemId ) ; |
public class InstantWidgetsFragment { /** * Implementation of the OnItemPickerEventListener interface */
@ Override public void onInstantChanged ( FloatingLabelInstantPicker source , Instant instant ) { } } | Toast . makeText ( getActivity ( ) , source . getInstantPrinter ( ) . print ( instant ) , Toast . LENGTH_SHORT ) . show ( ) ; |
public class JschUtil { /** * 执行Shell命令
* @ param session Session会话
* @ param cmd 命令
* @ param charset 发送和读取内容的编码
* @ return { @ link ChannelExec }
* @ since 4.0.3 */
public static String exec ( Session session , String cmd , Charset charset ) { } } | return exec ( session , cmd , charset , System . err ) ; |
public class ParallelIndexSupervisorTask { /** * Allocate a new { @ link SegmentIdWithShardSpec } for a request from { @ link ParallelIndexSubTask } .
* The returned segmentIdentifiers have different { @ code partitionNum } ( thereby different { @ link NumberedShardSpec } )
* per bucket interval . */
@ POST @ Path ... | ChatHandlers . authorizationCheck ( req , Action . READ , getDataSource ( ) , authorizerMapper ) ; if ( toolbox == null ) { return Response . status ( Response . Status . SERVICE_UNAVAILABLE ) . entity ( "task is not running yet" ) . build ( ) ; } try { final SegmentIdWithShardSpec segmentIdentifier = allocateNewSegmen... |
public class JdbcRepository { /** * getConnection . default using current JdbcTransaction ' s connection , if null get a new one .
* @ return { @ link Connection } */
private Connection getConnection ( ) { } } | final JdbcTransaction jdbcTransaction = TX . get ( ) ; if ( null != jdbcTransaction && jdbcTransaction . isActive ( ) ) { return jdbcTransaction . getConnection ( ) ; } Connection ret = CONN . get ( ) ; try { if ( null != ret && ! ret . isClosed ( ) ) { return ret ; } ret = Connections . getConnection ( ) ; } catch ( f... |
public class HttpUtils { /** * Step 1 . prepare PUT request
* @ param path target url
* @ param headers request headers
* @ param parameters to PUT
* @ param timeOutInSeconds time out in seconds or null for default time out
* @ return put response */
public static HttpRequestBase put ( String path , Map < Str... | return put ( path , headers , parameters , null , timeOutInSeconds ) ; |
public class LeaderLatch { /** * Add this instance to the leadership election and attempt to acquire leadership .
* @ throws Exception errors */
public void start ( ) throws Exception { } } | Preconditions . checkState ( state . compareAndSet ( State . LATENT , State . STARTED ) , "Cannot be started more than once" ) ; startTask . set ( AfterConnectionEstablished . execute ( client , new Runnable ( ) { @ Override public void run ( ) { try { internalStart ( ) ; } finally { startTask . set ( null ) ; } } } ) ... |
public class FpUtils { /** * Returns unbiased exponent of a { @ code float } ; for
* subnormal values , the number is treated as if it were
* normalized . That is for all finite , non - zero , positive numbers
* < i > x < / i > , < code > scalb ( < i > x < / i > , - ilogb ( < i > x < / i > ) ) < / code > is
* a... | int exponent = getExponent ( f ) ; switch ( exponent ) { case FloatConsts . MAX_EXPONENT + 1 : // NaN or infinity
if ( isNaN ( f ) ) return ( 1 << 30 ) ; // 2 ^ 30
else // infinite value
return ( 1 << 28 ) ; // 2 ^ 28
case FloatConsts . MIN_EXPONENT - 1 : // zero or subnormal
if ( f == 0.0f ) { return - ( 1 << 28 ) ; /... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.