signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CompressBackupUtil { /** * Adds the file to the tar archive represented by output stream . It ' s caller ' s responsibility to close output stream * properly . * @ param out target archive . * @ param source file to be added . * @ param fileSize size of the file ( which is known in most cases ) . ...
if ( ! source . hasContent ( ) ) { throw new IllegalArgumentException ( "Provided source is not a file: " + source . getPath ( ) ) ; } // noinspection ChainOfInstanceofChecks if ( out instanceof TarArchiveOutputStream ) { final TarArchiveEntry entry = new TarArchiveEntry ( source . getPath ( ) + source . getName ( ) ) ...
public class StringUtility { /** * Creates a < code > String [ ] < / code > by calling the toString ( ) method of each object in a list . * @ deprecated Please use List . toArray ( Object [ ] ) * @ see List # toArray ( Object [ ] ) */ @ Deprecated public static String [ ] getStringArray ( List < ? > V ) { } }
if ( V == null ) return null ; int len = V . size ( ) ; String [ ] SA = new String [ len ] ; for ( int c = 0 ; c < len ; c ++ ) { Object O = V . get ( c ) ; SA [ c ] = O == null ? null : O . toString ( ) ; } return SA ;
public class PackratParser { /** * This message just generates a parser exception message to be returned * containing the maximum position where the parser could not proceed . This * should be in most cases the position where the error within the text is * located . * @ return */ private String getParserErrorMe...
StringBuffer code = new StringBuffer ( text ) ; code = code . insert ( maxPosition , " >><< " ) ; String codeString = code . substring ( maxPosition - 100 < 0 ? 0 : maxPosition - 100 , maxPosition + 100 >= code . length ( ) ? code . length ( ) : maxPosition + 100 ) ; return "Could not parse the input string near '" + c...
public class SubCommandSet { /** * Add a sub - command to the sub - command - set . * @ param subCommand The sub - command to add . * @ return The sub - command - set . */ public SubCommandSet add ( SubCommand < SubCommandDef > subCommand ) { } }
if ( subCommandMap . containsKey ( subCommand . getName ( ) ) ) { throw new IllegalArgumentException ( "SubCommand with name " + subCommand . getName ( ) + " already exists" ) ; } this . subCommands . add ( subCommand ) ; this . subCommandMap . put ( subCommand . getName ( ) , subCommand ) ; for ( String alias : subCom...
public class UITextArea { /** * Called when a cursor is updated . < br > * Offsets the content to make sure the cursor is still visible . */ @ Override protected void onCursorUpdated ( ) { } }
if ( getParent ( ) == null ) return ; startTimer = System . currentTimeMillis ( ) ; Integer yOffset = null ; if ( text . length ( ) == 0 ) yOffset = 0 ; else if ( cursor . y < - offset ( ) . y ( ) ) yOffset = - cursor . y + 2 ; else if ( cursor . y + cursor . height > innerSize ( ) . height ( ) - offset ( ) . y ( ) ) y...
public class ExtinctionCoefficient { /** * method to calculate the extinction coefficient for the whole HELM molecule * @ param helm2notation input HELM2Notation * @ param unitType Unit of the extinction coefficient * @ return extinction coefficient * @ throws ExtinctionCoefficientException if the HELM contains...
LOG . debug ( "ExtinctionCalculation is starting with the unitType: " + unitType ) ; float result = 0.0f ; List < PolymerNotation > polymerNodes = helm2notation . getListOfPolymers ( ) ; for ( PolymerNotation polymerNode : polymerNodes ) { String polymerType = polymerNode . getPolymerID ( ) . getType ( ) ; float ext = ...
public class BaseFilterQueryBuilder { /** * Add a Field Search Condition that will search a field for a specified value using the following SQL logic : * { @ code lower ( field ) = ' value ' } * @ param propertyName The name of the field as defined in the Entity mapping class . * @ param value The value to search...
final Expression < String > propertyNameField = getCriteriaBuilder ( ) . lower ( getRootPath ( ) . get ( propertyName ) . as ( String . class ) ) ; fieldConditions . add ( getCriteriaBuilder ( ) . equal ( propertyNameField , value . toString ( ) ) ) ;
public class MetaGraphDef { /** * < code > optional . tensorflow . MetaGraphDef . MetaInfoDef meta _ info _ def = 1 ; < / code > */ public org . tensorflow . framework . MetaGraphDef . MetaInfoDef getMetaInfoDef ( ) { } }
return metaInfoDef_ == null ? org . tensorflow . framework . MetaGraphDef . MetaInfoDef . getDefaultInstance ( ) : metaInfoDef_ ;
public class IFixCompareCommandTask { /** * This will print the map of APARs to iFixes by giving a line to each APAR listing which iFixes it is in * @ param console The console to print to * @ param aparToIFixMap The map to print */ private void printAparIFixInfo ( CommandConsole console , Map < String , Set < Stri...
for ( Map . Entry < String , Set < String > > aparIFixInfo : aparToIFixMap . entrySet ( ) ) { console . printlnInfoMessage ( getMessage ( "compare.ifix.apar.info" , aparIFixInfo . getKey ( ) , aparIFixInfo . getValue ( ) ) ) ; }
public class BoundedLocalCache { /** * Evicts entries from the main space if the cache exceeds the maximum capacity . The main space * determines whether admitting an entry ( coming from the window space ) is preferable to retaining * the eviction policy ' s victim . This is decision is made using a frequency filte...
int victimQueue = PROBATION ; Node < K , V > victim = accessOrderProbationDeque ( ) . peekFirst ( ) ; Node < K , V > candidate = accessOrderProbationDeque ( ) . peekLast ( ) ; while ( weightedSize ( ) > maximum ( ) ) { // Stop trying to evict candidates and always prefer the victim if ( candidates == 0 ) { candidate = ...
public class HeatChart { /** * Draws the bars of the x - axis and y - axis . */ private void drawAxisBars ( Graphics2D chartGraphics ) { } }
if ( axisThickness > 0 ) { chartGraphics . setColor ( axisColour ) ; // Draw x - axis . int x = heatMapTL . x - axisThickness ; int y = heatMapBR . y ; int width = heatMapSize . width + axisThickness ; int height = axisThickness ; chartGraphics . fillRect ( x , y , width , height ) ; // Draw y - axis . x = heatMapTL . ...
public class AbstractBeanDefinition { /** * Obtains an optional bean for the method at the given index and the argument at the given index * Warning : this method is used by internal generated code and should not be called by user code . * @ param resolutionContext The resolution context * @ param context The con...
return resolveBeanWithGenericsFromMethodArgument ( resolutionContext , injectionPoint , argument , ( beanType , qualifier ) -> ( ( DefaultBeanContext ) context ) . findBean ( resolutionContext , beanType , qualifier ) ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link FunctionType } { @ code > } } */ @ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" , name = "Function" , substitutionHeadNamespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" , subs...
return new JAXBElement < FunctionType > ( _Function_QNAME , FunctionType . class , null , value ) ;
public class PropertiesManagerCore { /** * Add GeoPackage * @ param geoPackage * GeoPackage */ public void addGeoPackage ( T geoPackage ) { } }
PropertiesCoreExtension < T , ? , ? , ? > propertiesExtension = getPropertiesExtension ( geoPackage ) ; propertiesMap . put ( geoPackage . getName ( ) , propertiesExtension ) ;
public class XARecorderRecovery { /** * / * ( non - Javadoc ) * @ see org . csc . phynixx . loggersystem . logrecord . IXARecoderRecovery # destroy ( ) */ @ Override public synchronized void destroy ( ) throws IOException { } }
Set < IXADataRecorder > recoveredXADataRecorders = this . getRecoveredXADataRecorders ( ) ; for ( IXADataRecorder dataRecorder : recoveredXADataRecorders ) { dataRecorder . destroy ( ) ; }
public class ADTUtil { /** * Build a single trace ADS from the given information . * @ param input * the input sequence of the trace * @ param output * the output sequence of the trace * @ param finalState * the hypothesis state that should be referenced in the leaf of the ADS * @ param < S > * ( hypoth...
if ( input . size ( ) != output . size ( ) ) { throw new IllegalArgumentException ( "Arguments differ in length" ) ; } final Iterator < I > inputIterator = input . iterator ( ) ; final Iterator < O > outputIterator = output . iterator ( ) ; final ADTNode < S , I , O > result = new ADTSymbolNode < > ( null , inputIterat...
public class DefaultImportationLinker { /** * Update the Target Filter of the ImporterService . * Apply the induce modifications on the links of the ImporterService * @ param serviceReference */ @ Modified ( id = "importerServices" ) void modifiedImporterService ( ServiceReference < ImporterService > serviceReferen...
try { importersManager . modified ( serviceReference ) ; } catch ( InvalidFilterException invalidFilterException ) { LOG . error ( "The ServiceProperty \"" + TARGET_FILTER_PROPERTY + "\" of the ImporterService " + bundleContext . getService ( serviceReference ) + " doesn't provides a valid Filter." + " To be used, it m...
public class CharArrayBuffer { /** * Returns a substring of this buffer with leading and trailing whitespace * omitted . The substring begins with the first non - whitespace character * from { @ code beginIndex } and extends to the last * non - whitespace character with the index lesser than * { @ code endIndex...
if ( beginIndex < 0 ) { throw new IndexOutOfBoundsException ( "Negative beginIndex: " + beginIndex ) ; } if ( endIndex > this . len ) { throw new IndexOutOfBoundsException ( "endIndex: " + endIndex + " > length: " + this . len ) ; } if ( beginIndex > endIndex ) { throw new IndexOutOfBoundsException ( "beginIndex: " + b...
public class PortletFilterChainProxy { /** * Sets the mapping of URL patterns to filter chains . * The map keys should be the paths and the values should be arrays of { @ code PortletFilter } objects . * It ' s VERY important that the type of map used preserves ordering - the order in which the iterator * returns...
filterChains = new ArrayList < PortletSecurityFilterChain > ( filterChainMap . size ( ) ) ; for ( Map . Entry < RequestMatcher , List < PortletFilter > > entry : filterChainMap . entrySet ( ) ) { filterChains . add ( new DefaultPortletSecurityFilterChain ( entry . getKey ( ) , entry . getValue ( ) ) ) ; }
public class Options { /** * Check that the memory management option wasn ' t previously set to a * different value . If okay , then set the option . */ private void checkMemoryManagementOption ( MemoryManagementOption option ) { } }
if ( memoryManagementOption != null && memoryManagementOption != option ) { usage ( "Multiple memory management options cannot be set." ) ; } setMemoryManagementOption ( option ) ;
public class AbstractAppender { /** * Handles a configure failure . */ protected void handleConfigureResponseFailure ( RaftMemberContext member , ConfigureRequest request , Throwable error ) { } }
// Log the failed attempt to contact the member . failAttempt ( member , request , error ) ;
public class AbstractExpression { /** * Replace avg expression with sum / count for optimization . * @ return */ public AbstractExpression replaceAVG ( ) { } }
if ( getExpressionType ( ) == ExpressionType . AGGREGATE_AVG ) { AbstractExpression child = getLeft ( ) ; AbstractExpression left = new AggregateExpression ( ExpressionType . AGGREGATE_SUM ) ; left . setLeft ( child . clone ( ) ) ; AbstractExpression right = new AggregateExpression ( ExpressionType . AGGREGATE_COUNT ) ...
public class ExceptionImposter { /** * < p > imposterize . < / p > * @ param t a { @ link java . lang . Throwable } object . * @ return a { @ link java . lang . RuntimeException } object . */ public static RuntimeException imposterize ( Throwable t ) { } }
if ( t instanceof RuntimeException ) return ( RuntimeException ) t ; return new ExceptionImposter ( t ) ;
public class PlayRecordContext { /** * If set to true , initial prompt is not interruptible by either voice or digits . * < b > Defaults to false . < / b > Valid values are the text strings " true " and " false " . * @ return */ public boolean getNonInterruptibleAudio ( ) { } }
String value = Optional . fromNullable ( getParameter ( SignalParameters . NON_INTERRUPTIBLE_PLAY . symbol ( ) ) ) . or ( "false" ) ; return Boolean . parseBoolean ( value ) ;
public class GrassLegacyUtilities { /** * Returns the list of files involved in the raster map issues . If for example a map has to be * deleted , then all these files have to . * @ param mapsetPath - the path of the mapset * @ param mapname - the name of the map * @ return the array of strings containing the f...
String filesOfRaster [ ] = new String [ ] { mapsetPath + File . separator + GrassLegacyConstans . FCELL + File . separator + mapname , mapsetPath + File . separator + GrassLegacyConstans . CELL + File . separator + mapname , mapsetPath + File . separator + GrassLegacyConstans . CATS + File . separator + mapname , mapse...
public class OrthogonalPolyLine { /** * When tail is NONE it needs to try multiple directions to determine which gives the least number of corners , and then selects that as the final direction . * @ param points * @ param buffer * @ param lastDirection * @ param tailDirection * @ param correction * @ param...
final double offset = pline . getHeadOffset ( ) + correction ; switch ( tailDirection ) { case NONE : { final double dx = ( p1x - p0x ) ; final double dy = ( p1y - p0y ) ; int bestPoints = 0 ; if ( dx > offset ) { tailDirection = WEST ; bestPoints = drawTail ( points , buffer , lastDirection , WEST , correction , pline...
public class SpatialUtil { /** * Returns a clone of the minimum hyper point . * @ param box spatial object * @ return the minimum hyper point */ public static double [ ] getMin ( SpatialComparable box ) { } }
final int dim = box . getDimensionality ( ) ; double [ ] min = new double [ dim ] ; for ( int i = 0 ; i < dim ; i ++ ) { min [ i ] = box . getMin ( i ) ; } return min ;
public class ProxiedFileSystemWrapper { /** * Get token from the token sequence file . * @ param authPath * @ param proxyUserName * @ return Token for proxyUserName if it exists . * @ throws IOException */ private static Optional < Token < ? > > getTokenFromSeqFile ( String authPath , String proxyUserName ) thr...
try ( Closer closer = Closer . create ( ) ) { FileSystem localFs = FileSystem . getLocal ( new Configuration ( ) ) ; SequenceFile . Reader tokenReader = closer . register ( new SequenceFile . Reader ( localFs , new Path ( authPath ) , localFs . getConf ( ) ) ) ; Text key = new Text ( ) ; Token < ? > value = new Token <...
public class QueryParameters { /** * Returns Key by searching key assigned to that position * @ param position Position which would be searched * @ return Key */ public String getNameByPosition ( Integer position ) { } }
String name = null ; name = this . order . get ( position ) ; return name ;
public class SubModel { /** * Clone this model using a { @ link DefaultModel } . * @ return a mutable clone */ @ Override public Model copy ( ) { } }
DefaultModel m = new DefaultModel ( eb . copy ( ) ) ; MappingUtils . fill ( sm , m . getMapping ( ) ) ; for ( ModelView rc : parent . getViews ( ) ) { m . attach ( rc . copy ( ) ) ; } m . setAttributes ( this . getAttributes ( ) . copy ( ) ) ; return m ;
public class MockupTypeEnumerator { /** * Returns the url given the mockup type . * @ param mockupType The mockup type . * @ return The url pattern , or null if not found . */ public String getUrl ( String mockupType ) { } }
return mockupType == null ? null : mockupTypes . getProperty ( mockupType ) ;
public class DescribeAggregateComplianceByConfigRulesResult { /** * Returns a list of AggregateComplianceByConfigRule object . * @ param aggregateComplianceByConfigRules * Returns a list of AggregateComplianceByConfigRule object . */ public void setAggregateComplianceByConfigRules ( java . util . Collection < Aggre...
if ( aggregateComplianceByConfigRules == null ) { this . aggregateComplianceByConfigRules = null ; return ; } this . aggregateComplianceByConfigRules = new com . amazonaws . internal . SdkInternalList < AggregateComplianceByConfigRule > ( aggregateComplianceByConfigRules ) ;
public class GeoPackageCoreImpl { /** * { @ inheritDoc } */ @ Override public boolean createExtendedRelationsTable ( ) { } }
verifyWritable ( ) ; boolean created = false ; ExtendedRelationsDao dao = getExtendedRelationsDao ( ) ; try { if ( ! dao . isTableExists ( ) ) { created = tableCreator . createExtendedRelations ( ) > 0 ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to check if " + ExtendedRelation . class . ge...
public class IdType { /** * Creates a new instance of this ID which is identical , but refers to the * specific version of this resource ID noted by theVersion . * @ param theVersion The actual version string , e . g . " 1 " . If theVersion is blank or null , returns the same as { @ link # toVersionless ( ) } } *...
if ( isBlank ( theVersion ) ) { return toVersionless ( ) ; } if ( isLocal ( ) || isUrn ( ) ) { return new IdType ( getValueAsString ( ) ) ; } String existingValue = getValue ( ) ; int i = existingValue . indexOf ( "_history" ) ; String value ; if ( i > 1 ) { value = existingValue . substring ( 0 , i - 1 ) ; } else { va...
public class Vector3d { /** * Sets the values of this vector to those of v1. * @ param v1 * vector whose values are copied */ public void set ( Vector3d v1 ) { } }
x = v1 . x ; y = v1 . y ; z = v1 . z ;
public class BatchedTimeoutManager { /** * Method to close this timer forever */ public void close ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "close" ) ; btmLockManager . lockExclusive ( ) ; try { stopTimer ( ) ; activeEntries = null ; } finally { btmLockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Si...
public class MultiPartParser { private void handleField ( ) { } }
if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "parsedField: _fieldName={} _fieldValue={} {}" , _fieldName , _fieldValue , this ) ; if ( _fieldName != null && _fieldValue != null ) _handler . parsedField ( _fieldName , _fieldValue ) ; _fieldName = _fieldValue = null ;
public class InternationalizationServiceSingleton { /** * Retrieves the ETAG for the given locale . * @ param locale the locale * @ return the computed etag , must not be { @ code null } or empty */ @ Override public String etag ( Locale locale ) { } }
String etag = etags . get ( locale ) ; if ( etag == null ) { // We don ' t have a stored etag , that means we don ' t have messages . We returns 0. // There is a potential race condition here : // We retrieve the etag get 0 , but when we retrieve the messages , we get messages . The browser receives 0 // as etag , whic...
public class AmazonAlexaForBusinessClient { /** * Retrieves the configured values for the user enrollment invitation email template . * @ param getInvitationConfigurationRequest * @ return Result of the GetInvitationConfiguration operation returned by the service . * @ throws NotFoundException * The resource is...
request = beforeClientExecution ( request ) ; return executeGetInvitationConfiguration ( request ) ;
public class SimulatorTaskTracker { /** * Updates the progress indicator of a task if it is running . * @ param tip simulator task in progress whose progress is to be updated * @ param now current simulation time */ private void progressTaskStatus ( SimulatorTaskInProgress tip , long now ) { } }
TaskStatus status = tip . getTaskStatus ( ) ; if ( status . getRunState ( ) != State . RUNNING ) { return ; // nothing to be done } boolean isMap = tip . isMapTask ( ) ; // Time when the user space code started long startTime = - 1 ; // Time spent in map or just in the REDUCE phase of a reduce task long runTime = tip ....
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CategoryExtentType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link CategoryExtentType } { @ code...
return new JAXBElement < CategoryExtentType > ( _CategoryExtent_QNAME , CategoryExtentType . class , null , value ) ;
public class Postconditions { /** * < p > Evaluate the given { @ code predicate } using { @ code value } as input . < / p > * < p > The function throws { @ link PostconditionViolationException } if the * predicate is false . < / p > * @ param value The value * @ param condition The predicate * @ param < T > T...
return checkPostcondition ( value , condition . predicate ( ) , condition . describer ( ) ) ;
public class TransactionManager { /** * add session to the end of queue when a transaction starts * ( depending on isolation mode ) */ public void beginAction ( Session session , Statement cs ) { } }
synchronized ( liveTransactionTimestamps ) { session . actionTimestamp = nextChangeTimestamp ( ) ; if ( ! session . isTransaction ) { session . transactionTimestamp = session . actionTimestamp ; session . isTransaction = true ; liveTransactionTimestamps . addLast ( session . actionTimestamp ) ; try { if ( this . mvcc )...
public class DoubleUtils { /** * Returns the maximum value in the array within the specified bounds . If the supplied range is * empty or invalid , an { @ link IllegalArgumentException } is thrown . */ public static double max ( final double [ ] data , final int startInclusive , final int endExclusive ) { } }
checkArgument ( endExclusive > startInclusive ) ; checkArgument ( startInclusive >= 0 ) ; checkArgument ( endExclusive <= data . length ) ; double maxValue = Double . NEGATIVE_INFINITY ; for ( int i = startInclusive ; i < endExclusive ; ++ i ) { maxValue = Math . max ( maxValue , data [ i ] ) ; } return maxValue ;
public class Table { /** * returns if a table contains a certain element * @ param searchElement the searchElement of the table element on which the search is done * @ return if a table contains a certain element */ public boolean isRowPresent ( String searchElement ) { } }
ready ( ) ; Cell cell = getCell ( searchElement ) ; return cell . isElementPresent ( ) ;
public class XSLTElementProcessor { /** * Receive notification of an unparsed entity declaration . * @ param handler non - null reference to current StylesheetHandler that is constructing the Templates . * @ param name The entity name . * @ param publicId The entity public identifier , or null if not * availabl...
// no op
public class ConfigEvaluator { /** * Converts a list of raw configuration values to a string array . * @ param attrDef a string - based attribute definition , or null if this is a simple evaluation * @ return the array of converted values , or null if all values are unresolved */ private String [ ] convertListToStr...
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) Collection < String > collection = ( Collection ) convertListToVector ( rawValues , attrDef , context , ignoreWarnings ) ; return collection == null ? null : collection . toArray ( new String [ collection . size ( ) ] ) ;
public class Db { /** * Find record by id with default primary key . * < pre > * Example : * Record user = Db . findById ( " user " , 15 ) ; * < / pre > * @ param tableName the table name of the table * @ param idValue the id value of the record */ public static Record findById ( String tableName , Object i...
return MAIN . findById ( tableName , idValue ) ;
public class WaveHandlerBase { /** * Retrieve the custom wave handler method . * @ param wave the wave to be handled * @ return the custom handler method or null if none exists */ private Method retrieveCustomMethod ( final Wave wave ) { } }
Method customMethod = null ; // Search the wave handler method to call customMethod = this . defaultMethod == null // Method computed according to wave prefix and wave type action // name ? ClassUtility . retrieveMethodList ( getWaveReady ( ) . getClass ( ) , wave . waveType ( ) . toString ( ) ) . stream ( ) . filter (...
public class BatchXMLDescriptorImpl { /** * Adds a new namespace * @ return the current instance of < code > BatchXMLDescriptor < / code > */ public BatchXMLDescriptor addNamespace ( String name , String value ) { } }
model . attribute ( name , value ) ; return this ;
public class AnalyzedTokenReadings { /** * Checks if the token has a particular POS tag . * @ param posTag POS tag to look for */ public boolean hasPosTag ( String posTag ) { } }
boolean found = false ; for ( AnalyzedToken reading : anTokReadings ) { if ( reading . getPOSTag ( ) != null ) { found = posTag . equals ( reading . getPOSTag ( ) ) ; if ( found ) { break ; } } } return found ;
public class TrxMessageListener { /** * Constructor . */ public void init ( BaseMessageFilter messageFilter , Application application , String strProcessClassName , Map < String , Object > properties ) { } }
m_application = application ; m_strProcessClassName = strProcessClassName ; m_properties = properties ; super . init ( null , messageFilter ) ;
public class JoinableResourceBundlePropertySerializer { /** * Serialize the variant sets . * @ param map * the map to serialize * @ return the serialized variant sets */ private static String serializeVariantSets ( Map < String , VariantSet > map ) { } }
StringBuilder result = new StringBuilder ( ) ; for ( Entry < String , VariantSet > entry : map . entrySet ( ) ) { result . append ( entry . getKey ( ) ) . append ( ":" ) ; VariantSet variantSet = ( VariantSet ) entry . getValue ( ) ; result . append ( variantSet . getDefaultVariant ( ) ) . append ( ":" ) ; result . app...
public class RequestContext { /** * Gets a parameter specified by the given name from request body form or query string . * @ param name the given name * @ return parameter , returns { @ code null } if not found */ public String param ( final String name ) { } }
try { return request . getParameter ( name ) ; } catch ( final Exception e ) { LOGGER . log ( Level . ERROR , "Can't parse request parameter [uri=" + request . getRequestURI ( ) + ", method=" + request . getMethod ( ) + ", parameterName=" + name + "]: " + e . getMessage ( ) ) ; return null ; }
public class CommandHelper { /** * Convert the value according the type of DeviceData . * @ param value * the value to insert on DeviceData * @ param deviceDataArgin * the DeviceData attribute to write * @ param dataType * the type of inserted data * @ throws DevFailed */ public static void insertFromDevV...
if ( dataType == TangoConst . Tango_DEVVAR_LONGSTRINGARRAY ) { deviceDataArgin . insert ( value ) ; } else { Except . throw_exception ( "TANGO_WRONG_DATA_ERROR" , "input type " + deviceDataArgin . getType ( ) + " not supported" , "CommandHelper.insertFromDevVarLongStringArray(DevVarLongStringArray value,deviceDataArgin...
public class GlobalizationPreferences { /** * Explicitly set the collator for this object . * @ param collator The collator object to be passed . * @ return this , for chaining * @ hide draft / provisional / internal are hidden on Android */ public GlobalizationPreferences setCollator ( Collator collator ) { } }
if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify immutable object" ) ; } try { this . collator = ( Collator ) collator . clone ( ) ; // clone for safety } catch ( CloneNotSupportedException e ) { throw new ICUCloneNotSupportedException ( "Error in cloning collator" , e ) ; } return thi...
public class IteratorFactory { /** * Create a new { @ link Iterator } for the supplied object . * @ param object the object to build an iterator from * @ return an { @ link Iterator } for the < code > object < / code > or < code > null < / code > if the value is null . */ public static final Iterator createIterator...
LOGGER . debug ( "Create an iterator for class: " + ( object == null ? "null" : object . getClass ( ) . getName ( ) ) ) ; if ( object == null ) return null ; if ( object instanceof Iterator ) { return ( Iterator ) object ; } else if ( object instanceof Collection ) { Collection collection = ( Collection ) object ; retu...
public class Attachment { /** * Get the URL of the file containing the contents . * This property is somewhat deprecated and is made available only for use with platform APIs that * require file paths / URLs , e . g . some media playback APIs . Whenever possible , use the ` getContent ( ) ` * method to get the in...
try { return internalAttachment ( ) . getContentURL ( ) ; } catch ( MalformedURLException e ) { Log . w ( Database . TAG , e . toString ( ) ) ; } catch ( CouchbaseLiteException e ) { Log . w ( Database . TAG , e . toString ( ) ) ; } return null ;
public class UtcOffset { /** * Parses a UTC offset from a string . * @ param text the text to parse ( e . g . " - 0500 " ) * @ return the parsed UTC offset * @ throws IllegalArgumentException if the text cannot be parsed */ public static UtcOffset parse ( String text ) { } }
Pattern timeZoneRegex = Pattern . compile ( "^([-\\+])?(\\d{1,2})(:?(\\d{2}))?(:?(\\d{2}))?$" ) ; Matcher m = timeZoneRegex . matcher ( text ) ; if ( ! m . find ( ) ) { throw Messages . INSTANCE . getIllegalArgumentException ( 21 , text ) ; } String signStr = m . group ( 1 ) ; boolean positive = ! "-" . equals ( signSt...
public class SqlQueryImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . fluent . SqlQuery # collect ( java . lang . Class ) */ @ Override public < T > List < T > collect ( final Class < T > type ) { } }
try ( Stream < T > stream = stream ( new EntityResultSetConverter < > ( type , new PropertyMapperManager ( ) ) ) ) { return stream . collect ( Collectors . toList ( ) ) ; }
public class AbstractCounterFactory { /** * Destroys and removes a counter from the cache . * @ param counter * @ since 0.2.0 */ protected void destroyCounter ( ICounter counter ) { } }
try { if ( counter instanceof AbstractCounter ) { ( ( AbstractCounter ) counter ) . destroy ( ) ; } } catch ( Exception e ) { }
public class WanPublisherConfigDTO { /** * Deserializes the aliased discovery config nested under the { @ code tag } in the provided JSON . * @ param json the JSON object containing the serialized config * @ param tag the tag under which the config is nested * @ return the deserialized config or { @ code null } i...
JsonValue configJson = json . get ( tag ) ; if ( configJson != null && ! configJson . isNull ( ) ) { AliasedDiscoveryConfigDTO dto = new AliasedDiscoveryConfigDTO ( tag ) ; dto . fromJson ( configJson . asObject ( ) ) ; return dto . getConfig ( ) ; } return null ;
public class InterceptorContext { /** * Instantiates an interceptor , based on the class name in the given InterceptorConfig , and adds it to the * given collection of interceptors . * @ param config the InterceptorConfig used to determine the interceptor class . * @ param baseClassOrInterface the required base c...
Interceptor interceptor = createInterceptor ( config , baseClassOrInterface ) ; if ( interceptor != null ) interceptors . add ( interceptor ) ; return interceptor ;
public class NetworkBuffer { /** * Returns the network buffer for the given installation ID . * @ param installationID installation ID for the network buffer * @ return the network buffer , or < code > null < / code > if no buffer found */ public static synchronized NetworkBuffer getBuffer ( String installationID )...
for ( final Iterator i = buffers . iterator ( ) ; i . hasNext ( ) ; ) { final NetworkBuffer db = ( NetworkBuffer ) i . next ( ) ; if ( db . inst . equals ( installationID ) ) return db ; } return null ;
public class HttpBody { /** * Sets the current length of the body . If the current content is longer , the excessive data will be truncated . * @ param length the new length to set . */ public void setLength ( int length ) { } }
if ( length < 0 || body . length == length ) { return ; } int oldPos = pos ; pos = Math . min ( pos , length ) ; byte [ ] newBody = new byte [ length ] ; System . arraycopy ( body , 0 , newBody , 0 , pos ) ; body = newBody ; if ( oldPos > pos ) { cachedString = null ; }
public class GrammarFile { /** * This is the central reading routine which starts all sub routines like * lexer , parser and converter . * @ throws IOException * @ throws GrammarException */ private void read ( ) throws IOException , GrammarException { } }
try { logger . debug ( "Read grammar file..." ) ; logger . debug ( "Starting lexer..." ) ; Lexer lexer = new RegExpLexer ( uhuraGrammar ) ; TokenStream tokenStream = lexer . lex ( SourceCode . read ( reader , new UnspecifiedSourceCodeLocation ( ) ) ) ; logger . debug ( "Starting parser..." ) ; parse ( tokenStream ) ; l...
public class JdbcUtil { /** * Safely closes resources and logs errors . * @ param rs ResultSet to close */ public static void close ( ResultSet rs ) { } }
if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException ex ) { logger . error ( "" , ex ) ; } }
public class CommerceTaxMethodLocalServiceWrapper { /** * Creates a new commerce tax method with the primary key . Does not add the commerce tax method to the database . * @ param commerceTaxMethodId the primary key for the new commerce tax method * @ return the new commerce tax method */ @ Override public com . li...
return _commerceTaxMethodLocalService . createCommerceTaxMethod ( commerceTaxMethodId ) ;
public class PackageFrameWriter { /** * Generate a package summary page for the left - hand bottom frame . Construct * the PackageFrameWriter object and then uses it generate the file . * @ param configuration the current configuration of the doclet . * @ param packageDoc The package for which " pacakge - frame ....
PackageFrameWriter packgen ; try { packgen = new PackageFrameWriter ( configuration , packageDoc ) ; String pkgName = Util . getPackageName ( packageDoc ) ; Content body = packgen . getBody ( false , packgen . getWindowTitle ( pkgName ) ) ; Content pkgNameContent = new StringContent ( pkgName ) ; Content heading = Html...
public class CmsSiteMatcher { /** * Sets the hostname ( e . g . localhost ) which is required to access this site . < p > * Setting the hostname to " * " is a wildcard that matches all hostnames * @ param serverName the hostname ( e . g . localhost ) which is required to access this site */ protected void setServer...
if ( CmsStringUtil . isEmpty ( serverName ) || ( WILDCARD . equals ( serverName ) ) ) { m_serverName = WILDCARD ; } else { m_serverName = serverName . trim ( ) ; }
public class OCSPResponseBuilder { /** * List Certificate authority url information . * @ param userCertificate User ' s own certificate . * @ return AIA Locations * @ throws CertificateVerificationException If an error occurs while getting the AIA locations from the certificate . */ public static List < String >...
List < String > locations ; // List the AIA locations from the certificate . Those are the URL ' s of CA s . try { locations = OCSPVerifier . getAIALocations ( userCertificate ) ; } catch ( CertificateVerificationException e ) { throw new CertificateVerificationException ( "Failed to find AIA locations in the cetificat...
public class CommerceRegionPersistenceImpl { /** * Returns an ordered range of all the commerce regions where commerceCountryId = & # 63 ; and active = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > a...
boolean pagination = true ; FinderPath finderPath = null ; Object [ ] finderArgs = null ; if ( ( start == QueryUtil . ALL_POS ) && ( end == QueryUtil . ALL_POS ) && ( orderByComparator == null ) ) { pagination = false ; finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_C_A ; finderArgs = new Object [ ] { commerceCoun...
public class JobInProgress { /** * Remove a reduce TIP from the list for running - reduces * Called when a reduce fails / completes * @ param tip the tip that needs to be retired */ private synchronized void retireReduce ( TaskInProgress tip ) { } }
if ( runningReduces == null ) { LOG . warn ( "Running list for reducers missing!! " + "Job details are missing." ) ; return ; } runningReduces . remove ( tip ) ;
public class Where { /** * Reset the Where object so it can be re - used . */ public Where < T , ID > reset ( ) { } }
for ( int i = 0 ; i < clauseStackLevel ; i ++ ) { // help with gc clauseStack [ i ] = null ; } clauseStackLevel = 0 ; return this ;
public class ExportManager { /** * Indicate to associated { @ link ExportGeneration } s to become * masters for the given partition id * @ param partitionId */ synchronized public void takeMastership ( int partitionId ) { } }
m_masterOfPartitions . add ( partitionId ) ; ExportGeneration generation = m_generation . get ( ) ; if ( generation == null ) { return ; } generation . takeMastership ( partitionId ) ;
public class ConnectionManager { /** * 获取连接 * @ param address * @ return */ protected Connection getConnection ( InetSocketAddress address ) { } }
Connection conn = null ; try { // 获取连接 conn = pool . borrowObject ( address ) ; } catch ( FdfsException e ) { throw e ; } catch ( Exception e ) { LOGGER . error ( "Unable to borrow buffer from pool" , e ) ; throw new RuntimeException ( "Unable to borrow buffer from pool" , e ) ; } return conn ;
public class GraphHelper { /** * finds the instance ( s ) that correspond to the given vertex */ private Collection < IndexedInstance > getInstancesForVertex ( Map < String , AttributeValueMap > map , AtlasVertex foundVertex ) { } }
// loop through the unique attributes . For each attribute , check to see if the vertex property that // corresponds to that attribute has a value from one or more of the instances that were passed in . for ( Map . Entry < String , AttributeValueMap > entry : map . entrySet ( ) ) { String propertyName = entry . getKey ...
public class Utils { /** * Concatenate string with the specified delimiter . * @ param strings * Strings to be concatenated . * @ param delimiter * A delimiter used between strings . If { @ code null } or an empty * string is given , delimiters are not inserted between strings . * @ return * A concatenate...
if ( strings == null ) { return null ; } if ( strings . length == 0 ) { return "" ; } boolean useDelimiter = ( delimiter != null && delimiter . length ( ) != 0 ) ; StringBuilder sb = new StringBuilder ( ) ; for ( String string : strings ) { sb . append ( string ) ; if ( useDelimiter ) ; { sb . append ( delimiter ) ; } ...
public class ContainerSetupScript { /** * desroy Application container * @ param context * ServletContext */ public synchronized void destroyed ( AppContextWrapper context ) { } }
try { ContainerRegistryBuilder cb = ( ContainerRegistryBuilder ) context . getAttribute ( ContainerRegistryBuilder . APPLICATION_CONTEXT_ATTRIBUTE_NAME ) ; if ( cb != null ) { ContainerDirector cd = new ContainerDirector ( cb ) ; cd . shutdown ( ) ; context . removeAttribute ( ContainerRegistryBuilder . APPLICATION_CON...
public class GraphDOT { /** * Renders a { @ link Graph } in the GraphVIZ DOT format . * @ param graph * the graph to render * @ param a * the appendable to write to . * @ param additionalHelpers * additional helpers for providing visualization properties . * @ throws IOException * if writing to { @ code...
final List < VisualizationHelper < N , ? super E > > helpers = new ArrayList < > ( additionalHelpers . size ( ) + 1 ) ; helpers . add ( graph . getVisualizationHelper ( ) ) ; helpers . addAll ( additionalHelpers ) ; writeRaw ( graph , a , toDOTVisualizationHelper ( helpers ) ) ;
public class ConfigEvaluator { /** * Evaluate a string to a value of the target attribute type . * @ see # convertListToArray */ private Object evaluateString ( String strVal , ExtendedAttributeDefinition attrDef , EvaluationContext context ) throws ConfigEvaluatorException { } }
if ( attrDef == null ) { return strVal ; } int type = attrDef . getType ( ) ; if ( type == AttributeDefinition . BOOLEAN ) { return Boolean . valueOf ( strVal ) ; } else if ( type == AttributeDefinition . BYTE ) { return Byte . valueOf ( strVal ) ; } else if ( type == AttributeDefinition . CHARACTER ) { return Characte...
public class ThriftMultigetSubSliceQuery { /** * Set the supercolumn to run the slice query on */ @ Override public MultigetSubSliceQuery < K , SN , N , V > setSuperColumn ( SN superColumn ) { } }
Assert . notNull ( superColumn , "supercolumn may not be null" ) ; this . superColumn = superColumn ; return this ;
public class CmsLabel { /** * Returns the title to be displayed , which is either produced by a title generator , * or is equal to the original text if no title generator is set and the label is being * truncated . < p > * @ param truncating true if the label is being truncated * @ return the title to display *...
if ( m_titleGenerator != null ) { return m_titleGenerator . getTitle ( m_originalText ) ; } if ( truncating ) { return getText ( ) ; } else { return super . getTitle ( ) ; }
public class ResourceGroovyMethods { /** * Creates a buffered input stream for this URL . * @ param url a URL * @ return a BufferedInputStream for the URL * @ throws MalformedURLException is thrown if the URL is not well formed * @ throws IOException if an I / O error occurs while creating the input stream * ...
return new BufferedInputStream ( configuredInputStream ( null , url ) ) ;
public class KeyPairCache { /** * Returns a key pair of size < code > bits < / code > . The same key pair * may be returned several times within a period of the cache * lifetime . * If lifetime was set to zero or less than zero , no keys are cached . * @ param bits the keysize . This is an algorithm - specific ...
if ( this . lifetime < 1 ) { logger . debug ( "Cache lifetime is less than 1, generating new " + "keypair each time" ) ; KeyPairGenerator generator = KeyPairGenerator . getInstance ( this . algorithm , this . provider ) ; generator . initialize ( bits ) ; return generator . generateKeyPair ( ) ; } long st = System . cu...
public class TargetEncoder { /** * Overloaded for the case when user had not specified the noise parameter */ public Frame applyTargetEncoding ( Frame data , String targetColumnName , Map < String , Frame > targetEncodingMap , byte dataLeakageHandlingStrategy , String foldColumn , boolean withBlendedAvg , boolean imput...
double defaultNoiseLevel = 0.01 ; int targetIndex = data . find ( targetColumnName ) ; Vec targetVec = data . vec ( targetIndex ) ; double noiseLevel = targetVec . isNumeric ( ) ? defaultNoiseLevel * ( targetVec . max ( ) - targetVec . min ( ) ) : defaultNoiseLevel ; return applyTargetEncoding ( data , targetColumnName...
public class PercentEscaper { /** * Escapes a string with the current settings on the escaper . * @ param original the origin string to escape * @ return the escaped string */ public String escape ( String original ) { } }
StringBuilder output = new StringBuilder ( ) ; for ( int i = 0 ; i != utf16ToAscii ( original ) . length ( ) ; i ++ ) { char c = original . charAt ( i ) ; if ( c == ' ' ) { output . append ( usePlusForSpace ? "+" : HEX [ ' ' ] ) ; } else if ( c >= 'a' && c <= 'z' ) { output . append ( c ) ; } else if ( c >= 'A' && c <=...
public class LocalDate { /** * Returns a copy of this { @ code LocalDate } with the year altered . * If the day - of - month is invalid for the year , it will be changed to the last valid day of the month . * This instance is immutable and unaffected by this method call . * @ param year the year to set in the res...
if ( this . year == year ) { return this ; } YEAR . checkValidValue ( year ) ; return resolvePreviousValid ( year , month , day ) ;
public class AbstractAzkabanServlet { /** * Retrieves a success message from a cookie . azkaban . success . message */ protected String getSuccessMessageFromCookie ( final HttpServletRequest request ) { } }
final Cookie cookie = getCookieByName ( request , AZKABAN_SUCCESS_MESSAGE ) ; if ( cookie == null ) { return null ; } return cookie . getValue ( ) ;
public class DRL5Expressions { /** * $ ANTLR start synpred11 _ DRL5Expressions */ public final void synpred11_DRL5Expressions_fragment ( ) throws RecognitionException { } }
// src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 424:8 : ( squareArguments shiftExpression ) // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 424:9 : squareArguments shiftExpression { pushFollow ( FOLLOW_squareArguments_in_synpred11_DRL5Expressions1984...
public class Main { /** * Creates a new instance of this class using the arguments specified , gives * it any extra user properties which have been specified , and then runs the * build using the classloader provided . * @ param args Command line arguments . Must not be < code > null < / code > . * @ param addi...
final Main m = new Main ( ) ; m . startAnt ( args , additionalUserProperties , coreLoader ) ;
public class ProvFactory { /** * Creates a new { @ link Agent } with provided identifier * @ param ag a { @ link QualifiedName } for the agent * @ return an object of type { @ link Agent } */ public Agent newAgent ( QualifiedName ag ) { } }
Agent res = of . createAgent ( ) ; res . setId ( ag ) ; return res ;
public class ST_RemoveHoles { /** * Remove any holes from the geometry . If the geometry doesn ' t contain any * holes , return it unchanged . * @ param geometry Geometry * @ return Geometry with no holes * */ public static Geometry removeHoles ( Geometry geometry ) { } }
if ( geometry == null ) { return null ; } if ( geometry instanceof Polygon ) { return removeHolesPolygon ( ( Polygon ) geometry ) ; } else if ( geometry instanceof MultiPolygon ) { return removeHolesMultiPolygon ( ( MultiPolygon ) geometry ) ; } else if ( geometry instanceof GeometryCollection ) { Geometry [ ] geometri...
public class MPrinter { /** * Affiche le document . < br / > * Les implémentations peuvent surcharger cette méthode . * @ param targetFile * File * @ throws IOException * Erreur disque */ protected void showDocument ( final File targetFile ) throws IOException { } }
try { Desktop . getDesktop ( ) . open ( targetFile ) ; } catch ( final IOException e ) { throw new IOException ( "Is there an associated application for \"" + targetFile . getName ( ) + "\"?\n" + e . getMessage ( ) , e ) ; } // on pourrait imprimer le fichier directement ( par exemple CSV avec Excel ) en supposant que ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcTimeSeriesDataTypeEnum ( ) { } }
if ( ifcTimeSeriesDataTypeEnumEEnum == null ) { ifcTimeSeriesDataTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1088 ) ; } return ifcTimeSeriesDataTypeEnumEEnum ;
public class LanguageUtils { /** * Sets the default language map . It is the basis language template which is to be translated . * @ param deflang the default language map */ public void setDefaultLanguage ( Map < String , String > deflang ) { } }
if ( deflang != null && ! deflang . isEmpty ( ) ) { LANG_CACHE . put ( getDefaultLanguageCode ( ) , deflang ) ; }
public class BitmexTradeServiceRaw { /** * See { @ link Bitmex # getOrders } * @ return List of { @ link BitmexPrivateOrder } s . */ public List < BitmexPrivateOrder > getBitmexOrders ( @ Nullable String symbol , @ Nullable String filter , @ Nullable String columns , @ Nullable Date startTime , @ Nullable Date endTim...
ArrayList < BitmexPrivateOrder > orders = new ArrayList < > ( ) ; for ( int i = 0 ; orders . size ( ) % 500 == 0 ; i ++ ) { final int j = i ; List < BitmexPrivateOrder > orderResponse = updateRateLimit ( ( ) -> bitmex . getOrders ( apiKey , exchange . getNonceFactory ( ) , signatureCreator , symbol , filter , columns ,...
public class AbstractNumberPickerPreference { /** * Obtains , whether the selection wheel of the selection wheel of the preference ' s { @ link * NumberPicker } should be wrapped , or not , from a specific typed array . * @ param typedArray * The typed array , which should be used to retrieve , whether the select...
boolean defaultValue = getContext ( ) . getResources ( ) . getBoolean ( R . bool . number_picker_preference_default_wrap_selector_wheel ) ; wrapSelectorWheel ( typedArray . getBoolean ( R . styleable . AbstractNumberPickerPreference_wrapSelectorWheel , defaultValue ) ) ;
public class LinearClassifierFactory { /** * Trains the linear classifier using Generalized Expectation criteria as described in * < tt > Generalized Expectation Criteria for Semi Supervised Learning of Conditional Random Fields < / tt > , Mann and McCallum , ACL 2008. * The original algorithm is proposed for CRFs ...
List < F > GEFeatures = getHighPrecisionFeatures ( labeledDataset , 0.9 , 10 ) ; return trainSemiSupGE ( labeledDataset , unlabeledDataList , GEFeatures , 0.5 ) ;
public class ByteArrayList { /** * Sets the i ' th element of the array list to the given value . * @ param i The index to set . * @ param value The value to set . */ public void set ( int i , byte value ) { } }
if ( i < 0 || i >= size ) { throw new IndexOutOfBoundsException ( ) ; } elements [ i ] = value ;