signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TaskSlotTable { /** * Check whether the timeout with ticket is valid for the given allocation id . * @ param allocationId to check against * @ param ticket of the timeout * @ return True if the timeout is valid ; otherwise false */ public boolean isValidTimeout ( AllocationID allocationId , UUID tick...
checkInit ( ) ; return timerService . isValid ( allocationId , ticket ) ;
public class CmsSqlConsoleResultsForm { /** * Builds the table for the database results . * @ param results the database results * @ return the table */ private Table buildTable ( CmsSqlConsoleResults results ) { } }
IndexedContainer container = new IndexedContainer ( ) ; int numCols = results . getColumns ( ) . size ( ) ; for ( int c = 0 ; c < numCols ; c ++ ) { container . addContainerProperty ( Integer . valueOf ( c ) , results . getColumnType ( c ) , null ) ; } int r = 0 ; for ( List < Object > row : results . getData ( ) ) { I...
public class Inferences { /** * The escaping modes for the print command with the given ID in the order in which they should be * applied . * @ param node a node instance */ public ImmutableList < EscapingMode > getEscapingModesForNode ( SoyNode node ) { } }
ImmutableList < EscapingMode > modes = nodeToEscapingModes . get ( node ) ; if ( modes == null ) { modes = ImmutableList . of ( ) ; } return modes ;
public class JMString { /** * Joining with delimiter string . * @ param delimiter the delimiter * @ param stringList the string list * @ return the string */ public static String joiningWithDelimiter ( CharSequence delimiter , List < String > stringList ) { } }
return joiningWith ( stringList . stream ( ) , delimiter ) ;
public class MRCompactor { /** * Submit an event when completeness verification is successful */ private void submitVerificationSuccessSlaEvent ( Results . Result result ) { } }
try { CompactionSlaEventHelper . getEventSubmitterBuilder ( result . dataset ( ) , Optional . < Job > absent ( ) , this . fs ) . eventSubmitter ( this . eventSubmitter ) . eventName ( CompactionSlaEventHelper . COMPLETION_VERIFICATION_SUCCESS_EVENT_NAME ) . additionalMetadata ( Maps . transformValues ( result . verific...
public class ClassHierarchyManager { /** * Utility method to sort declared beans . Linearizes the hierarchy , * i . e . generates a sequence of declaration such that , if Sub is subclass of * Sup , then the index of Sub will be > than the index of Sup in the * resulting collection . This ensures that superclasses...
taxonomy = new HashMap < QualifiedName , Collection < QualifiedName > > ( ) ; Map < QualifiedName , AbstractClassTypeDeclarationDescr > cache = new HashMap < QualifiedName , AbstractClassTypeDeclarationDescr > ( ) ; for ( AbstractClassTypeDeclarationDescr tdescr : unsortedDescrs ) { cache . put ( tdescr . getType ( ) ,...
public class ParameterUtil { /** * Get used parameters map where the key is the parameter name and the value is the parameter * Not all the report parameters have to be used , some may only be defined for further usage . * The result will contain also the hidden parameters and all parameters used just inside other ...
Set < String > paramNames = new HashSet < String > ( Arrays . asList ( query . getParameterNames ( ) ) ) ; for ( QueryParameter p : allParameters . values ( ) ) { paramNames . addAll ( p . getDependentParameterNames ( ) ) ; } LinkedHashMap < String , QueryParameter > params = new LinkedHashMap < String , QueryParameter...
public class CmsSearchUtil { /** * Slightly modified from org . apache . commons . httpclient . util . DateUtil . parseDate * Parses the date value using the given date formats . * @ param dateValue the date value to parse * @ param dateFormats the date formats to use * @ param startDate During parsing , two di...
if ( dateValue == null ) { throw new IllegalArgumentException ( "dateValue is null" ) ; } if ( dateFormats == null ) { dateFormats = DEFAULT_HTTP_CLIENT_PATTERNS ; } if ( startDate == null ) { startDate = DEFAULT_TWO_DIGIT_YEAR_START ; } // trim single quotes around date if present // see issue # 5279 if ( ( dateValue ...
public class CliParser { /** * Returns the symbolic link depth ( how deeply symbolic links will be * followed ) . * @ return the symbolic link depth */ public int getSymLinkDepth ( ) { } }
int value = 0 ; try { value = Integer . parseInt ( line . getOptionValue ( ARGUMENT . SYM_LINK_DEPTH , "0" ) ) ; if ( value < 0 ) { value = 0 ; } } catch ( NumberFormatException ex ) { LOGGER . debug ( "Symbolic link was not a number" ) ; } return value ;
public class ParadataManager { /** * Return all stats from other submitters for the resource * @ param resourceUrl * @ return * @ throws Exception */ public List < ISubmission > getExternalStats ( String resourceUrl ) throws Exception { } }
return getExternalSubmissions ( resourceUrl , IStats . VERB ) ;
public class SoftwareSystem { /** * Gets the container with the specified ID . * @ param id the { @ link Container # getId ( ) } of the container * @ return the Container instance with the specified ID , or null if it doesn ' t exist * @ throws IllegalArgumentException if the ID is null or empty */ @ Nullable pub...
if ( id == null || id . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "A container ID must be provided." ) ; } for ( Container container : getContainers ( ) ) { if ( container . getId ( ) . equals ( id ) ) { return container ; } } return null ;
public class AbstractContextGenerator { /** * Creates punctuation feature for the specified punctuation at the specified * index based on the punctuation mark . * @ param punct * The punctuation which is in context . * @ param i * The index of the punctuation with relative to the parse . * @ return Punctuat...
final StringBuilder feat = new StringBuilder ( 5 ) ; feat . append ( i ) . append ( "=" ) ; feat . append ( punct . getCoveredText ( ) ) ; return feat . toString ( ) ;
public class BaseMatchMethodPermutationBuilder { /** * Returns a list of type variables for a given type . * < p > There are several cases for what the returned type variables will be : * < ul > * < li > If { @ code t } is a type variable itself , and has no bounds , then a singleton list * containing only { @ ...
return match ( t ) . when ( typeOf ( TypeVariableName . class ) ) . get ( v -> { if ( v . bounds . isEmpty ( ) ) { return ImmutableList . of ( v ) ; } else { return Stream . concat ( Stream . of ( v ) , v . bounds . stream ( ) . map ( b -> getTypeVariables ( b ) ) . flatMap ( b -> b . stream ( ) ) ) . collect ( Collect...
public class AWSGlueClient { /** * Gets all the triggers associated with a job . * @ param getTriggersRequest * @ return Result of the GetTriggers operation returned by the service . * @ throws EntityNotFoundException * A specified entity does not exist * @ throws InvalidInputException * The input provided ...
request = beforeClientExecution ( request ) ; return executeGetTriggers ( request ) ;
public class StorageAccountsInner { /** * Lists all the storage accounts available under the subscription . Note that storage keys are not returned ; use the ListKeys operation for this . * @ return the PagedList < StorageAccountInner > object if successful . */ public PagedList < StorageAccountInner > list ( ) { } }
PageImpl < StorageAccountInner > page = new PageImpl < > ( ) ; page . setItems ( listWithServiceResponseAsync ( ) . toBlocking ( ) . single ( ) . body ( ) ) ; page . setNextPageLink ( null ) ; return new PagedList < StorageAccountInner > ( page ) { @ Override public Page < StorageAccountInner > nextPage ( String nextPa...
public class Tuple15 { /** * Split this tuple into two tuples of degree 13 and 2. */ public final Tuple2 < Tuple13 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 > , Tuple2 < T14 , T15 > > split13 ( ) { } }
return new Tuple2 < > ( limit13 ( ) , skip13 ( ) ) ;
public class MultistepUtil { /** * Adds a step to the given { @ link OperationContext } for each operation included in the given { @ code operations } list , either * using for each step a response node provided in the { @ code responses } list , or if the { @ code responses } list is empty , * creating them and st...
assert responses . isEmpty ( ) || operations . size ( ) == responses . size ( ) ; boolean responsesProvided = ! responses . isEmpty ( ) ; LinkedHashMap < Integer , ModelNode > operationMap = new LinkedHashMap < > ( ) ; Map < Integer , ModelNode > responseMap = new LinkedHashMap < > ( ) ; int i = 0 ; for ( ModelNode op ...
public class CeCPMain { /** * TODO dmyersturnbull : This should probably be in structure - gui */ @ SuppressWarnings ( "unused" ) private static void displayAlignment ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws ClassNotFoundException , NoSuchMethodException , InvocationTargetException , IllegalAccessExce...
Atom [ ] ca1clone = StructureTools . cloneAtomArray ( ca1 ) ; Atom [ ] ca2clone = StructureTools . cloneAtomArray ( ca2 ) ; if ( ! GuiWrapper . isGuiModuleInstalled ( ) ) { System . err . println ( "The biojava-structure-gui and/or JmolApplet modules are not installed. Please install!" ) ; // display alignment in conso...
public class AWSServerMigrationClient { /** * Deletes the specified replication job . * After you delete a replication job , there are no further replication runs . AWS deletes the contents of the Amazon * S3 bucket used to store AWS SMS artifacts . The AMIs created by the replication runs are not deleted . * @ p...
request = beforeClientExecution ( request ) ; return executeDeleteReplicationJob ( request ) ;
public class Reflection { /** * Returns a consumer that sets the value of a selected field . * @ param newValue the value to set * @ return a consumer that sets the value of a selected field . */ public static Consumer < Selection < Field > > setValue ( Object newValue ) { } }
return selection -> factory . createHandler ( selection . result ( ) ) . on ( selection . target ( ) ) . setValue ( newValue ) ;
public class AWSWAFRegionalClient { /** * Inserts or deletes < a > SqlInjectionMatchTuple < / a > objects ( filters ) in a < a > SqlInjectionMatchSet < / a > . For each * < code > SqlInjectionMatchTuple < / code > object , you specify the following values : * < ul > * < li > * < code > Action < / code > : Wheth...
request = beforeClientExecution ( request ) ; return executeUpdateSqlInjectionMatchSet ( request ) ;
public class BshArray { /** * Slice the supplied list for range and step . * @ param list to slice * @ param from start index inclusive * @ param to to index exclusive * @ param step size of step or 0 if no step * @ return a sliced view of the supplied list */ public static Object slice ( List < Object > list...
int length = list . size ( ) ; if ( to > length ) to = length ; if ( 0 > from ) from = 0 ; length = to - from ; if ( 0 >= length ) return list . subList ( 0 , 0 ) ; if ( step == 0 || step == 1 ) return list . subList ( from , to ) ; List < Integer > slices = new ArrayList < > ( ) ; for ( int i = 0 ; i < length ; i ++ )...
public class AptUtils { /** * Get the attribute with the name { @ code name } of the annotation * { @ code anno } . The result is expected to have type { @ code expectedType } . * < em > Note 1 < / em > : The method does not work well for attributes of an array * type ( as it would return a list of { @ link Annot...
Map < ? extends ExecutableElement , ? extends AnnotationValue > valmap = useDefaults ? getElementValuesWithDefaults ( anno ) : anno . getElementValues ( ) ; for ( ExecutableElement elem : valmap . keySet ( ) ) { if ( elem . getSimpleName ( ) . contentEquals ( name ) ) { AnnotationValue val = valmap . get ( elem ) ; ret...
public class SegPrepare { /** * 在FNLPDATA生成 . seg文件 , 然后合并 * @ param args * @ throws Exception */ public static void main ( String [ ] args ) throws Exception { } }
String datapath = "../data" ; String allfile = datapath + "/FNLPDATA/all.seg" ; String testfile = datapath + "/FNLPDATA/test.seg" ; String trainfile = datapath + "/FNLPDATA/train.seg" ; MyFiles . delete ( testfile ) ; MyFiles . delete ( trainfile ) ; MyFiles . delete ( allfile ) ; String dictfile = datapath + "/FNLPDAT...
public class RrdNioBackend { /** * Closes the underlying RRD file . * @ throws IOException Thrown in case of I / O error */ @ Override public synchronized void close ( ) throws IOException { } }
// cancel synchronization try { if ( syncTask != null ) { syncTask . cancel ( ) ; } sync ( ) ; unmapFile ( ) ; } finally { super . close ( ) ; }
public class InterceptionModelInitializer { /** * Constructor - level EJB - style interceptors */ public void initConstructorDeclaredEjbInterceptors ( ) { } }
Class < ? > [ ] constructorDeclaredInterceptors = interceptorsApi . extractInterceptorClasses ( constructor ) ; if ( constructorDeclaredInterceptors != null ) { for ( Class < ? > clazz : constructorDeclaredInterceptors ) { builder . interceptGlobal ( InterceptionType . AROUND_CONSTRUCT , null , Collections . < Intercep...
public class Ellipsoid { /** * Create a new earth ellipsoid with the given parameters . * @ param name the name of the earth ellipsoid model * @ param a the equatorial radius , in meter * @ param b the polar radius , in meter * @ param f the inverse flattening * @ return a new earth ellipsoid with the given p...
return new Ellipsoid ( name , a , b , f ) ;
public class ForkJoinPool { /** * Performs the given task , returning its result upon completion . * If the computation encounters an unchecked Exception or Error , * it is rethrown as the outcome of this invocation . Rethrown * exceptions behave in the same way as regular exceptions , but , * when possible , c...
if ( task == null ) throw new NullPointerException ( ) ; externalSubmit ( task ) ; return task . join ( ) ;
public class InstancePatchStateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstancePatchState instancePatchState , ProtocolMarshaller protocolMarshaller ) { } }
if ( instancePatchState == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instancePatchState . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( instancePatchState . getPatchGroup ( ) , PATCHGROUP_BINDING ) ; protoc...
public class GeneralTimestamp { /** * / * [ deutsch ] * < p > Erzeugt einen neuen Zeitstempel , der aus einer Kalendervariante und einer Uhrzeitkomponente besteht . < / p > * @ param < C > generic type of date component * @ param calendarVariant date component * @ param time time component * @ return general ...
if ( calendarVariant == null ) { throw new NullPointerException ( "Missing date component." ) ; } return new GeneralTimestamp < > ( calendarVariant , null , time ) ;
public class BindableASTTransformation { /** * Creates a statement body similar to : * < code > this . firePropertyChange ( " field " , field , field = value ) < / code > * @ param propertyNode the field node for the property * @ param fieldExpression a field expression for setting the property value * @ return...
// create statementBody return stmt ( callThisX ( "firePropertyChange" , args ( constX ( propertyNode . getName ( ) ) , fieldExpression , assignX ( fieldExpression , varX ( "value" ) ) ) ) ) ;
public class ReminderDatePicker { /** * Sets the Spinners ' date selection as integers considering only day . */ public void setSelectedDate ( int year , int month , int day ) { } }
dateSpinner . setSelectedDate ( new GregorianCalendar ( year , month , day ) ) ; // a custom selection has been set , don ' t select the default date : shouldSelectDefault = false ;
public class TmsClient { /** * Create a map with a local profile and specified crs , bounds and number of zoom levels . The resolution at level 0 * is based on mapping the bounds to a rectangular tile width minimum width and height of minTileSize pixels . * @ param crs * @ param type * @ param bounds * @ para...
MapConfigurationImpl mapConfiguration ; mapConfiguration = new MapConfigurationImpl ( ) ; mapConfiguration . setCrs ( crs , type ) ; double minSize = bounds . getWidth ( ) >= bounds . getHeight ( ) ? bounds . getHeight ( ) : bounds . getWidth ( ) ; List < Double > resolutions = new ArrayList < Double > ( ) ; for ( int ...
public class CorpusLoader { /** * 读取整个目录中的人民日报格式语料 * @ param folderPath 路径 * @ param verbose * @ return */ public static List < Document > convert2DocumentList ( String folderPath , boolean verbose ) { } }
long start = System . currentTimeMillis ( ) ; List < File > fileList = IOUtil . fileList ( folderPath ) ; List < Document > documentList = new LinkedList < Document > ( ) ; int i = 0 ; for ( File file : fileList ) { if ( verbose ) System . out . print ( file ) ; Document document = convert2Document ( file ) ; documentL...
public class InternalXtypeParser { /** * InternalXtype . g : 75:1 : ruleJvmTypeReference returns [ EObject current = null ] : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunction...
EObject current = null ; EObject this_JvmParameterizedTypeReference_0 = null ; EObject this_XFunctionTypeRef_3 = null ; enterRule ( ) ; try { // InternalXtype . g : 81:2 : ( ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) *...
public class Record { /** * Get the field that references this record ( from another record ) . * The field returned must be a ReferenceField , in a key area , and must override getReferenceRecordName ( ) . * @ param record The record to check . * @ return The field which is used to reference this record or null ...
ClearFieldReferenceOnCloseHandler listener = ( ClearFieldReferenceOnCloseHandler ) this . getListener ( ClearFieldReferenceOnCloseHandler . class , true ) ; while ( listener != null ) { BaseField field = listener . getField ( ) ; if ( field instanceof ReferenceField ) if ( ( ( ReferenceField ) field ) . getReferenceRec...
public class AllocatedEvaluatorImpl { /** * Submit Task with configuration strings . * This method should be called from bridge and the configuration strings are * serialized at . Net side . * @ param evaluatorConfiguration * @ param taskConfiguration */ public void submitTask ( final String evaluatorConfigurat...
final Configuration contextConfiguration = ContextConfiguration . CONF . set ( ContextConfiguration . IDENTIFIER , "RootContext_" + this . getId ( ) ) . build ( ) ; final String contextConfigurationString = this . configurationSerializer . toString ( contextConfiguration ) ; this . launchWithConfigurationString ( evalu...
public class SQLRebuilder { /** * Adds a new object . */ private void registerObject ( DigitalObject obj ) throws StorageDeviceException { } }
String pid = obj . getPid ( ) ; String userId = "the userID field is no longer used" ; String label = "the label field is no longer used" ; Connection conn = null ; PreparedStatement s1 = null ; try { String query = "INSERT INTO doRegistry (doPID, ownerId, label) VALUES (?, ?, ?)" ; conn = m_connectionPool . getReadWri...
public class ExecHandler { /** * { @ inheritDoc } */ @ Override protected void checkForRestriction ( JmxExecRequest pRequest ) { } }
if ( ! getRestrictor ( ) . isOperationAllowed ( pRequest . getObjectName ( ) , pRequest . getOperation ( ) ) ) { throw new SecurityException ( "Operation " + pRequest . getOperation ( ) + " forbidden for MBean " + pRequest . getObjectNameAsString ( ) ) ; }
public class DropwizardMeterRegistries { /** * Returns a newly - created { @ link DropwizardMeterRegistry } instance with the specified * { @ link MetricRegistry } and { @ link HierarchicalNameMapper } . */ public static DropwizardMeterRegistry newRegistry ( MetricRegistry registry , HierarchicalNameMapper nameMapper...
return newRegistry ( registry , nameMapper , Clock . SYSTEM ) ;
public class BayesInstance { /** * private static void project ( BayesVariable [ ] sepVars , JunctionTreeNode node , JunctionTreeSeparator sep ) { */ private static void project ( BayesVariable [ ] sepVars , CliqueState clique , SeparatorState separator ) { } }
// JunctionTreeNode node , JunctionTreeSeparator sep BayesVariable [ ] vars = clique . getJunctionTreeClique ( ) . getValues ( ) . toArray ( new BayesVariable [ clique . getJunctionTreeClique ( ) . getValues ( ) . size ( ) ] ) ; int [ ] sepVarPos = PotentialMultiplier . createSubsetVarPos ( vars , sepVars ) ; int sepVa...
public class ReportUtil { /** * Get sql string from report object with parameters values * @ param report * report * @ param parameterValues * parameter values map * @ return sql string from report object with parameters values */ public static String getSql ( Report report , Map < String , Object > parameter...
SimpleDateFormat timeFormat = new SimpleDateFormat ( "dd/MM/yyyy HH:mm:ss" ) ; SimpleDateFormat dayFormat = new SimpleDateFormat ( "dd/MM/yyyy" ) ; String sql = getSql ( report ) ; if ( parameterValues != null ) { for ( String pName : parameterValues . keySet ( ) ) { Object value = parameterValues . get ( pName ) ; Str...
public class OpenstackIaasHandler { /** * Validates the target properties , including storage ones . * @ param targetProperties * @ param appName * @ param instanceName * @ throws TargetException */ static void validateAll ( Map < String , String > targetProperties , String appName , String instanceName ) throw...
// Basic checks validate ( targetProperties ) ; // Storage checks Set < String > mountPoints = new HashSet < > ( ) ; Set < String > volumeNames = new HashSet < > ( ) ; for ( String s : findStorageIds ( targetProperties ) ) { // Unit tests should guarantee there is a default value for the " mount point " . String mountP...
public class SimpleDocTreeVisitor { /** * { @ inheritDoc } This implementation calls { @ code defaultAction } . * @ param node { @ inheritDoc } * @ param p { @ inheritDoc } * @ return the result of { @ code defaultAction } */ @ Override public R visitSerialData ( SerialDataTree node , P p ) { } }
return defaultAction ( node , p ) ;
public class AllWindowedStream { /** * Applies the given window function to each window . The window function is called for each * evaluation of the window for each key individually . The output of the window function is * interpreted as a regular non - windowed stream . * < p > Arriving data is incrementally agg...
TypeInformation < T > inType = input . getType ( ) ; TypeInformation < R > resultType = getAllWindowFunctionReturnType ( function , inType ) ; return apply ( reduceFunction , function , resultType ) ;
public class ProcedurePartitionData { /** * For Testing usage ONLY . * From a partition information string to @ ProcedurePartitionData * string format : * 1 ) String . format ( " % s . % s : % s " , tableName , columnName , parameterNo ) * 1 ) String . format ( " % s . % s : % s , % s . % s : % s " , tableName ...
if ( partitionInfoString == null || partitionInfoString . trim ( ) . isEmpty ( ) ) { return new ProcedurePartitionData ( ) ; } String [ ] partitionInfoParts = new String [ 0 ] ; partitionInfoParts = partitionInfoString . split ( "," ) ; assert ( partitionInfoParts . length <= 2 ) ; if ( partitionInfoParts . length == 2...
public class FluentMatching { /** * Specifies an match on a decomposing matcher with 1 extracted fields and then returns a fluent * interface for specifying the action to take if the value matches this case . */ public < U extends T , A > InitialMatching1 < T , U , A > when ( DecomposableMatchBuilder1 < U , A > decom...
return new InitialMatching1 < > ( decomposableMatchBuilder . build ( ) , value ) ;
public class BottomSheet { /** * Replaces the item at a specific index with another item . * @ param index * The index of the item , which should be replaced , as an { @ link Integer } value * @ param id * The id of the item , which should be added , as an { @ link Integer } value . The id must * be at least ...
Item item = new Item ( getContext ( ) , id , titleId ) ; adapter . set ( index , item ) ; adaptGridViewHeight ( ) ;
public class ConnectionFilter { /** * Wraps sent data , from the application side to the network side */ @ Override public void send ( byte [ ] b , int off , int len ) { } }
handler . send ( b , off , len ) ;
public class ModelDescriptorBuilder { /** * Builds the final instance of { @ link ModelDescriptor } , using information provided by the serialized model and * which corresponding implementations of { @ link hex . genmodel . ModelMojoReader } are able to provide . * @ return A new instance of { @ link ModelDescripto...
return new ModelDescriptor ( ) { @ Override public String [ ] [ ] scoringDomains ( ) { return _domains ; } @ Override public String projectVersion ( ) { return _h2oVersion ; } @ Override public String algoName ( ) { return _algoName ; } @ Override public String algoFullName ( ) { return _algoName ; } @ Override public ...
public class ReleasableInputStream { /** * Wraps the given input stream into a { @ link ReleasableInputStream } if * necessary . Note if the given input stream is a { @ link FileInputStream } , a * { @ link ResettableInputStream } which is a specific subclass of * { @ link ReleasableInputStream } will be returned...
if ( is instanceof ReleasableInputStream ) return ( ReleasableInputStream ) is ; // already wrapped if ( is instanceof FileInputStream ) return ResettableInputStream . newResettableInputStream ( ( FileInputStream ) is ) ; return new ReleasableInputStream ( is ) ;
public class EventMethodsHelper { /** * Retrieves cache provider instance for method */ private static CacheProvider getCacheProvider ( Method javaMethod ) { } }
if ( ! javaMethod . isAnnotationPresent ( Cache . class ) ) { return null ; } Cache an = javaMethod . getAnnotation ( Cache . class ) ; Class < ? extends CacheProvider > cacheClazz = an . value ( ) ; try { Constructor < ? extends CacheProvider > constructor = cacheClazz . getDeclaredConstructor ( ) ; constructor . setA...
public class GetReplicationRunsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetReplicationRunsRequest getReplicationRunsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getReplicationRunsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getReplicationRunsRequest . getReplicationJobId ( ) , REPLICATIONJOBID_BINDING ) ; protocolMarshaller . marshall ( getReplicationRunsRequest . getNextToken ( )...
public class ArrayUtils { /** * Transfer a String List to String array */ public static String [ ] strListToArray ( List < String > list ) { } }
if ( list == null ) return new String [ 0 ] ; return list . toArray ( new String [ list . size ( ) ] ) ;
public class SarlDocumentationParser { /** * Replies the fenced code block formatter . * < p > This code block formatter is usually used by Github . * @ return the formatter . */ public static Function2 < String , String , String > getFencedCodeBlockFormatter ( ) { } }
return ( languageName , content ) -> { /* final StringBuilder result = new StringBuilder ( ) ; result . append ( " < div class = \ \ \ " highlight " ) ; / / $ NON - NLS - 1 $ if ( ! Strings . isNullOrEmpty ( languageName ) ) { result . append ( " highlight - " ) . append ( languageName ) ; / / $ NON - NLS - 1 $ ...
public class Logger { /** * < p > fatal < / p > * @ see Log # fatal * @ param message a { @ link java . lang . String } object . * @ param args a { @ link java . lang . Object } object . */ public void fatal ( String message , Object ... args ) { } }
if ( log . isFatalEnabled ( ) ) { log . fatal ( String . format ( message , args ) ) ; }
public class LoggingDecoratorFactoryFunction { /** * Creates a new decorator with the specified { @ code parameter } . */ @ Override public Function < Service < HttpRequest , HttpResponse > , ? extends Service < HttpRequest , HttpResponse > > newDecorator ( LoggingDecorator parameter ) { } }
return new LoggingServiceBuilder ( ) . requestLogLevel ( parameter . requestLogLevel ( ) ) . successfulResponseLogLevel ( parameter . successfulResponseLogLevel ( ) ) . failureResponseLogLevel ( parameter . failureResponseLogLevel ( ) ) . samplingRate ( parameter . samplingRate ( ) ) . newDecorator ( ) ;
public class CircularList { /** * Removes the first ( inserted ) element of the collection . * @ return Removed element or null if any */ public T removeFirst ( ) { } }
if ( isEmpty ( ) ) { return null ; } T firstElement = elements [ firstIndex ] ; elements [ firstIndex ] = null ; firstIndex = incrementIndex ( firstIndex , 0 ) ; return firstElement ;
public class EmbeddedPostgreSQLController { /** * Each schema set has its own database cluster . The template1 database has the schema preloaded so that * each test case need only create a new database and not re - invoke Migratory . */ private synchronized static Cluster getCluster ( URI baseUrl , String [ ] persona...
final Entry < URI , Set < String > > key = Maps . immutableEntry ( baseUrl , ( Set < String > ) ImmutableSet . copyOf ( personalities ) ) ; Cluster result = CLUSTERS . get ( key ) ; if ( result != null ) { return result ; } result = new Cluster ( EmbeddedPostgreSQL . start ( ) ) ; final DBI dbi = new DBI ( result . get...
public class PropertiesAdapter { /** * Filters the properties from this adapter by name . * @ param filter the { @ link Filter } used to filter the properties of this adapter . * @ return a newly constructed instance of the { @ link PropertiesAdapter } containing only the filtered properties . * @ see org . cp . ...
Properties properties = new Properties ( ) ; for ( String propertyName : this ) { if ( filter . accept ( propertyName ) ) { properties . setProperty ( propertyName , get ( propertyName ) ) ; } } return from ( properties ) ;
public class JobInitializationPoller { /** * Test method used only for testing purposes . */ JobInProgress getInitializingJob ( String queue ) { } }
JobInitializationThread t = threadsToQueueMap . get ( queue ) ; if ( t == null ) { return null ; } else { return t . getInitializingJob ( ) ; }
public class InterceptingServer { /** * New { @ link ConnectionHandler } that echoes all data received . * @ return Connection handler . */ private static ConnectionHandler < ByteBuf , ByteBuf > echoHandler ( ) { } }
return conn -> conn . writeStringAndFlushOnEach ( conn . getInput ( ) . map ( msg -> "echo => " + msg . toString ( Charset . defaultCharset ( ) ) + "\n" ) ) ;
public class IfcPersonImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < String > getPrefixTitles ( ) { } }
return ( EList < String > ) eGet ( Ifc4Package . Literals . IFC_PERSON__PREFIX_TITLES , true ) ;
public class AbstractSettings { /** * Perform post de - serialization modification of the Settings . */ protected final void initialize ( ) { } }
// Enabling development mode forces these settings . This is somewhat inelegant , because to configure one of // these values differently will require disabling development mode and manually configure the remaining values . if ( development ) { loggingSettings . getLoggers ( ) . put ( "org.hibernate.SQL" , Level . DEBU...
public class PluralRanges { /** * Internal method for building . If the start or end are null , it means everything of that type . * @ param rangeStart * plural category for the start of the range * @ param rangeEnd * plural category for the end of the range * @ param result * the resulting plural category ...
if ( isFrozen ) { throw new UnsupportedOperationException ( ) ; } explicit [ result . ordinal ( ) ] = true ; if ( rangeStart == null ) { for ( StandardPlural rs : StandardPlural . values ( ) ) { if ( rangeEnd == null ) { for ( StandardPlural re : StandardPlural . values ( ) ) { matrix . setIfNew ( rs , re , result ) ; ...
public class MavenDependenciesRecorder { /** * Mojos perform different dependency resolution , so we add dependencies for each mojo . */ @ Override public boolean postExecute ( MavenBuildProxy build , MavenProject pom , MojoInfo mojo , BuildListener listener , Throwable error ) { } }
// listener . getLogger ( ) . println ( " [ MavenDependenciesRecorder ] mojo : " + mojo . getClass ( ) + " : " + mojo . getGoal ( ) ) ; // listener . getLogger ( ) . println ( " [ MavenDependenciesRecorder ] dependencies : " + pom . getArtifacts ( ) ) ; recordMavenDependencies ( pom . getArtifacts ( ) ) ; return true ;
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcGridTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class EventRecord { /** * Initializes an event record or updates it with a subsequent event . * @ param timestamp The timestamp in seconds at which and Event occurred . * @ param versionName The Android versionName of the app when the event occurred . * @ param versionCode The Android versionCode of the ap...
last = timestamp ; total ++ ; Long countForVersionName = versionNames . get ( versionName ) ; if ( countForVersionName == null ) { countForVersionName = 0L ; } Long countForVersionCode = versionCodes . get ( versionCode ) ; if ( countForVersionCode == null ) { countForVersionCode = 0L ; } versionNames . put ( versionNa...
public class JobOperations { /** * Disables the specified job . Disabled jobs do not run new tasks , but may be re - enabled later . * @ param jobId The ID of the job . * @ param disableJobOption Specifies what to do with running tasks associated with the job . * @ throws BatchErrorException Exception thrown when...
disableJob ( jobId , disableJobOption , null ) ;
public class SeleniumActionBuilder { /** * Dropdown select single option action . */ public ElementActionBuilder select ( String option ) { } }
DropDownSelectAction action = new DropDownSelectAction ( ) ; action . setOption ( option ) ; action ( action ) ; return new ElementActionBuilder ( action ) ;
public class XMLSerializer { /** * Sets the prefix . * @ param prefix the prefix * @ param namespace the namespace * @ throws IOException Signals that an I / O exception has occurred . */ @ SuppressWarnings ( "unused" ) public void setPrefix ( String prefix , String namespace ) throws IOException { } }
if ( startTagIncomplete ) closeStartTag ( ) ; // assert prefix ! = null ; // assert namespace ! = null ; if ( prefix == null ) { prefix = "" ; } if ( ! namesInterned ) { prefix = prefix . intern ( ) ; // will throw NPE if prefix = = null } else if ( checkNamesInterned ) { checkInterning ( prefix ) ; } else if ( prefix ...
public class AbstractPendingLinkingCandidate { /** * Returns the unresolved string representation of the unresolved type parameters of the feature . The simple names of * the type bounds are used . The string representation includes the angle brackets . */ protected String getFeatureTypeParametersAsString ( boolean s...
List < JvmTypeParameter > typeParameters = getDeclaredTypeParameters ( ) ; if ( ! typeParameters . isEmpty ( ) ) { StringBuilder b = new StringBuilder ( ) ; b . append ( "<" ) ; for ( int i = 0 ; i < typeParameters . size ( ) ; ++ i ) { JvmTypeParameter typeParameter = typeParameters . get ( i ) ; if ( showBounds ) b ....
public class FileSetType { /** * Returns the set of files . */ public boolean isMatch ( PathImpl path , String prefix ) { } }
String suffix = "" ; String fullPath = path . getPath ( ) ; if ( prefix . length ( ) < fullPath . length ( ) ) { suffix = fullPath . substring ( prefix . length ( ) ) ; } for ( int i = 0 ; i < _excludeList . size ( ) ; i ++ ) { PathPatternType pattern = _excludeList . get ( i ) ; if ( pattern . isMatch ( suffix ) ) ret...
public class MtasSpanFullyAlignedWithSpans { /** * ( non - Javadoc ) * @ see org . apache . lucene . search . DocIdSetIterator # advance ( int ) */ @ Override public int advance ( int target ) throws IOException { } }
reset ( ) ; if ( docId == NO_MORE_DOCS ) { return docId ; } else if ( target < docId ) { // should not happen docId = NO_MORE_DOCS ; return docId ; } else { // advance 1 int spans1DocId = spans1 . spans . docID ( ) ; int newTarget = target ; if ( spans1DocId < newTarget ) { spans1DocId = spans1 . spans . advance ( targ...
public class JDBC4PreparedStatement { /** * Sets the designated parameter to the given Java byte value . */ @ Override public void setByte ( int parameterIndex , byte x ) throws SQLException { } }
checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ;
public class ShareActionProviders { /** * Copies a private raw resource content to a publicly readable * file such that the latter can be shared with other applications . */ private void copyPrivateRawResourceToPubliclyAccessibleFile ( ) { } }
InputStream inputStream = null ; FileOutputStream outputStream = null ; try { inputStream = getResources ( ) . openRawResource ( R . raw . robot ) ; outputStream = openFileOutput ( SHARED_FILE_NAME , Context . MODE_WORLD_READABLE | Context . MODE_APPEND ) ; byte [ ] buffer = new byte [ 1024 ] ; int length = 0 ; try { w...
public class LoganSquare { /** * Serialize an object to a JSON String . * @ param object The object to serialize . */ @ SuppressWarnings ( "unchecked" ) public static < E > String serialize ( E object ) throws IOException { } }
return mapperFor ( ( Class < E > ) object . getClass ( ) ) . serialize ( object ) ;
public class AstUtil { /** * Return true if the expression is a constructor call on any of the named classes , with any number of parameters . * @ param expression - the expression * @ param classNames - the possible List of class names * @ return as described */ public static boolean isConstructorCall ( Expressi...
return expression instanceof ConstructorCallExpression && classNames . contains ( expression . getType ( ) . getName ( ) ) ;
public class AuthenticationHelper { /** * Create a copy of the specified byte array . * @ param credToken * @ return A copy of the specified byte array , or null if the input was null . */ public static byte [ ] copyCredToken ( byte [ ] credToken ) { } }
if ( credToken == null ) { return null ; } final int LEN = credToken . length ; if ( LEN == 0 ) { return new byte [ LEN ] ; } byte [ ] newCredToken = new byte [ LEN ] ; System . arraycopy ( credToken , 0 , newCredToken , 0 , LEN ) ; return newCredToken ;
public class WeatherForeCastWSImpl { /** * Parser for forecast * @ param feed * @ return */ private List < String > parseRssFeedForeCast ( String feed ) { } }
String [ ] result = feed . split ( "<br />" ) ; List < String > returnList = new ArrayList < String > ( ) ; String [ ] result2 = result [ 2 ] . split ( "<BR />" ) ; returnList . add ( result2 [ 3 ] + "\n" ) ; returnList . add ( result [ 3 ] + "\n" ) ; returnList . add ( result [ 4 ] + "\n" ) ; returnList . add ( result...
public class Context { /** * Determines the correct URI part if two branches are joined . */ private static UriPart unionUriParts ( UriPart a , UriPart b ) { } }
Preconditions . checkArgument ( a != b ) ; if ( a == UriPart . DANGEROUS_SCHEME || b == UriPart . DANGEROUS_SCHEME ) { // Dangerous schemes ( like javascript : ) are poison - - if either side is dangerous , the whole // thing is . return UriPart . DANGEROUS_SCHEME ; } else if ( a == UriPart . FRAGMENT || b == UriPart ....
public class BinTreeUtil { /** * Executes an action on all nodes from a tree , in inorder . For * trees with sharing , the same tree node object will be visited * multiple times . * @ param root Binary tree root . * @ param binTreeNav Binary tree navigator . * @ param action Action to execute on each tree nod...
for ( Iterator < T > it = inOrder ( root , binTreeNav ) ; it . hasNext ( ) ; ) { T treeVertex = it . next ( ) ; action . action ( treeVertex ) ; }
public class RepositoryApplicationConfiguration { /** * { @ link EventEntityManager } bean . * @ param aware * the tenant aware * @ param entityManager * the entitymanager * @ return a new { @ link EventEntityManager } */ @ Bean @ ConditionalOnMissingBean EventEntityManager eventEntityManager ( final TenantAw...
return new JpaEventEntityManager ( aware , entityManager ) ;
public class OptimizedGetImpl { /** * Add a new GetOperation to get . */ public void addOperation ( GetOperation o ) { } }
getKeys ( ) . addAll ( o . getKeys ( ) ) ; pcb . addCallbacks ( o ) ;
public class DataTracker { /** * that they have been replaced by the provided sstables , which must have been performed by an earlier replaceReaders ( ) call */ public void markCompactedSSTablesReplaced ( Collection < SSTableReader > oldSSTables , Collection < SSTableReader > allReplacements , OperationType compactionT...
removeSSTablesFromTracker ( oldSSTables ) ; releaseReferences ( oldSSTables , false ) ; notifySSTablesChanged ( oldSSTables , allReplacements , compactionType ) ; addNewSSTablesSize ( allReplacements ) ;
public class BruteForceInferencer { /** * Gets this factor as a VarTensor . This will always return a new object . See also safeGetVarTensor ( ) . */ public static VarTensor safeNewVarTensor ( Algebra s , Factor f ) { } }
VarTensor factor ; // Create a VarTensor which the values of this non - explicitly represented factor . factor = new VarTensor ( s , f . getVars ( ) ) ; for ( int c = 0 ; c < factor . size ( ) ; c ++ ) { factor . setValue ( c , s . fromLogProb ( f . getLogUnormalizedScore ( c ) ) ) ; } return factor ;
public class DynamoDBReflector { /** * Returns the setter corresponding to the getter given , or null if no such * setter exists . */ Method getSetter ( Method getter ) { } }
synchronized ( setterCache ) { if ( ! setterCache . containsKey ( getter ) ) { String fieldName = ReflectionUtils . getFieldNameByGetter ( getter , false ) ; String setterName = "set" + fieldName ; Method setter = null ; try { setter = getter . getDeclaringClass ( ) . getMethod ( setterName , getter . getReturnType ( )...
public class UppercaseTransliterator { /** * System registration hook . */ static void register ( ) { } }
Transliterator . registerFactory ( _ID , new Transliterator . Factory ( ) { @ Override public Transliterator getInstance ( String ID ) { return new UppercaseTransliterator ( ULocale . US ) ; } } ) ;
public class CDKRGraph { /** * Projects a CDKRGraph bitset on the source graph G1. * @ param set CDKRGraph BitSet to project * @ return The associate BitSet in G1 */ public BitSet projectG1 ( BitSet set ) { } }
BitSet projection = new BitSet ( getFirstGraphSize ( ) ) ; CDKRNode xNode = null ; for ( int x = set . nextSetBit ( 0 ) ; x >= 0 ; x = set . nextSetBit ( x + 1 ) ) { xNode = getGraph ( ) . get ( x ) ; projection . set ( xNode . getRMap ( ) . getId1 ( ) ) ; } return projection ;
public class MultiDraweeHolder { /** * Convenience method to draw all the top - level drawables in this holder . */ public void draw ( Canvas canvas ) { } }
for ( int i = 0 ; i < mHolders . size ( ) ; ++ i ) { Drawable drawable = get ( i ) . getTopLevelDrawable ( ) ; if ( drawable != null ) { drawable . draw ( canvas ) ; } }
public class TypeConverters { /** * Create a { @ link InternalType } from a { @ link TypeInformation } . * < p > Note : Information may be lost . For example , after Pojo is converted to InternalType , * we no longer know that it is a Pojo and only think it is a Row . * < p > Eg : * { @ link BasicTypeInfo # STR...
InternalType type = TYPE_INFO_TO_INTERNAL_TYPE . get ( typeInfo ) ; if ( type != null ) { return type ; } if ( typeInfo instanceof CompositeType ) { CompositeType compositeType = ( CompositeType ) typeInfo ; return InternalTypes . createRowType ( Stream . iterate ( 0 , x -> x + 1 ) . limit ( compositeType . getArity ( ...
public class CmsSubscriptionManager { /** * Sets the maximum number of visited resources to store per user . < p > * @ param maxVisitedCount the maximum number of visited resources to store per user */ public void setMaxVisitedCount ( String maxVisitedCount ) { } }
if ( m_frozen ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_CONFIG_SUBSCRIPTIONMANAGER_FROZEN_0 ) ) ; } try { int intValue = Integer . parseInt ( maxVisitedCount ) ; m_maxVisitedCount = ( intValue > 0 ) ? intValue : DEFAULT_MAX_VISITEDCOUNT ; } catch ( NumberFormatException e ) { /...
public class CommerceCurrencyServiceBaseImpl { /** * Sets the commerce currency local service . * @ param commerceCurrencyLocalService the commerce currency local service */ public void setCommerceCurrencyLocalService ( com . liferay . commerce . currency . service . CommerceCurrencyLocalService commerceCurrencyLocal...
this . commerceCurrencyLocalService = commerceCurrencyLocalService ;
public class ModificationDate { /** * Finds the most recent modification date from a { @ link ModificationDateProvider } and multiple additional resources * @ param dateProviders Multiple modification date providers * @ return the most recent modification date ( or null if none of the objects has a modification dat...
Date [ ] dates = new Date [ dateProviders . length ] ; for ( int i = 0 ; i < dateProviders . length ; i ++ ) { dates [ i ] = dateProviders [ i ] . getModificationDate ( ) ; } return mostRecent ( dates ) ;
public class RSMonitorDecorator { /** * set timing * @ param monitor * @ param t0 * @ param mtc */ protected void setTiming ( boolean monitor , long t0 , MessageToClient mtc ) { } }
if ( monitor ) { long t1 = System . currentTimeMillis ( ) ; mtc . setTime ( t1 - t0 ) ; }
public class MatchAllDocsQuery { /** * { @ inheritDoc } */ public QueryHits execute ( JcrIndexSearcher searcher , SessionImpl session , Sort sort ) throws IOException { } }
if ( sort . getSort ( ) . length == 0 ) { try { return new NodeTraversingQueryHits ( session . getRootNode ( ) , true , indexConfig ) ; } catch ( RepositoryException e ) { throw Util . createIOException ( e ) ; } } else { return null ; }
public class BaseXMLBuilder { /** * Serialize the XML document to the given writer using the default * { @ link TransformerFactory } and { @ link Transformer } classes . If output * options are provided , these options are provided to the * { @ link Transformer } serializer . * @ param writer * a writer to wh...
this . toWriter ( true , writer , outputProperties ) ;
public class MethodParameter { /** * Return the nested generic type of the method / constructor parameter . * @ return the parameter type ( never { @ code null } ) * @ see # getNestingLevel ( ) */ public Type getNestedGenericParameterType ( ) { } }
if ( this . nestingLevel > 1 ) { Type type = getGenericParameterType ( ) ; for ( int i = 2 ; i <= this . nestingLevel ; i ++ ) { if ( type instanceof ParameterizedType ) { Type [ ] args = ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; Integer index = getTypeIndexForLevel ( i ) ; type = args [ index != nu...
public class PoolsImpl { /** * Gets basic properties of a pool . * @ param poolId The ID of the pool to get . * @ param poolExistsOptions Additional parameters for the operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request is r...
return existsWithServiceResponseAsync ( poolId , poolExistsOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CmsDefaultUsers { /** * Checks if a given group name is the name of one of the OpenCms default groups . < p > * @ param groupName the group name to check * @ return < code > true < / code > if group name is one of OpenCms default groups , < code > false < / code > if it is not * or if < code > groupN...
if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( groupName ) ) { return false ; } // first check without ou prefix , to stay backwards compatible boolean isDefault = m_groupAdministrators . equals ( groupName ) ; isDefault = isDefault || m_groupGuests . equals ( groupName ) ; isDefault = isDefault || m_groupUsers . equal...