signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DatabaseUtils { /** * Reads a Long out of a field in a Cursor and writes it to a Map . * @ param cursor The cursor to read from * @ param field The INTEGER field to read * @ param values The { @ link ContentValues } to put the value into * @ param key The key to store the value with in the map */ public static void cursorLongToContentValues ( Cursor cursor , String field , ContentValues values , String key ) { } }
int colIndex = cursor . getColumnIndex ( field ) ; if ( ! cursor . isNull ( colIndex ) ) { Long value = Long . valueOf ( cursor . getLong ( colIndex ) ) ; values . put ( key , value ) ; } else { values . put ( key , ( Long ) null ) ; }
public class SeleniumBrowser { /** * Creates temporary storage . * @ return */ private Path createTemporaryStorage ( ) { } }
try { Path tempDir = Files . createTempDirectory ( "selenium" ) ; tempDir . toFile ( ) . deleteOnExit ( ) ; log . info ( "Download storage location is: " + tempDir . toString ( ) ) ; return tempDir ; } catch ( IOException e ) { throw new CitrusRuntimeException ( "Could not create temporary storage" , e ) ; }
public class CoordinatesUtils { /** * Find the furthest coordinate in a geometry from a base coordinate * @ param base * @ param coords * @ return the base coordinate and the target coordinate */ public static Coordinate [ ] getFurthestCoordinate ( Coordinate base , Coordinate [ ] coords ) { } }
double distanceMax = Double . MIN_VALUE ; Coordinate farCoordinate = null ; for ( Coordinate coord : coords ) { double distance = coord . distance ( base ) ; if ( distance > distanceMax ) { distanceMax = distance ; farCoordinate = coord ; } } if ( farCoordinate != null ) { return new Coordinate [ ] { base , farCoordinate } ; } else { return null ; }
public class DateTimeUtils { /** * Gets the default map of time zone names . * This can be changed by { @ link # setDefaultTimeZoneNames } . * The default set of short time zone names is as follows : * < ul > * < li > UT - UTC * < li > UTC - UTC * < li > GMT - UTC * < li > EST - America / New _ York * < li > EDT - America / New _ York * < li > CST - America / Chicago * < li > CDT - America / Chicago * < li > MST - America / Denver * < li > MDT - America / Denver * < li > PST - America / Los _ Angeles * < li > PDT - America / Los _ Angeles * < / ul > * @ return the unmodifiable map of abbreviations to zones , not null * @ since 2.2 */ public static final Map < String , DateTimeZone > getDefaultTimeZoneNames ( ) { } }
Map < String , DateTimeZone > names = cZoneNames . get ( ) ; if ( names == null ) { names = buildDefaultTimeZoneNames ( ) ; if ( ! cZoneNames . compareAndSet ( null , names ) ) { names = cZoneNames . get ( ) ; } } return names ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link PixelInCellType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link PixelInCellType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "pixelInCell" ) public JAXBElement < PixelInCellType > createPixelInCell ( PixelInCellType value ) { } }
return new JAXBElement < PixelInCellType > ( _PixelInCell_QNAME , PixelInCellType . class , null , value ) ;
public class WebMBeanServerAdapter { /** * Get the { @ link Set } of MBean names from the { @ link MBeanServer } . The names are HTML sanitized . * @ return the { @ link Set } of HTML sanitized MBean names . */ public Set < String > getMBeanNames ( ) { } }
Set < String > nameSet = new TreeSet < String > ( ) ; for ( ObjectInstance instance : mBeanServer . queryMBeans ( null , null ) ) { nameSet . add ( sanitizer . escapeValue ( instance . getObjectName ( ) . getCanonicalName ( ) ) ) ; } return nameSet ;
public class ApiOvhEmaildomain { /** * Change mailing list options * REST : POST / email / domain / { domain } / mailingList / { name } / changeOptions * @ param options [ required ] Options of mailing list * @ param domain [ required ] Name of your domain name * @ param name [ required ] Name of mailing list */ public OvhTaskMl domain_mailingList_name_changeOptions_POST ( String domain , String name , OvhDomainMlOptionsStruct options ) throws IOException { } }
String qPath = "/email/domain/{domain}/mailingList/{name}/changeOptions" ; StringBuilder sb = path ( qPath , domain , name ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "options" , options ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTaskMl . class ) ;
public class PersonIdentifierTypeBuilder { /** * { @ inheritDoc } */ @ Override public PersonIdentifierType buildObject ( String namespaceURI , String localName , String namespacePrefix ) { } }
return new PersonIdentifierTypeImpl ( namespaceURI , localName , namespacePrefix ) ;
public class CurrentGpsInfo { /** * Method to add a new { @ link GLLSentence } . * @ param gll the sentence to add . */ public void addGLL ( GLLSentence gll ) { } }
try { if ( gll . isValid ( ) ) position = gll . getPosition ( ) ; } catch ( Exception e ) { // ignore it , this should be handled in the isValid , // if an exception is thrown , we can ' t deal with it here . }
public class FactoryDetectPoint { /** * Detects Kitchen and Rosenfeld corners . * @ param configDetector Configuration for feature detector . * @ param derivType Type of derivative image . * @ see boofcv . alg . feature . detect . intensity . KitRosCornerIntensity */ public static < T extends ImageGray < T > , D extends ImageGray < D > > GeneralFeatureDetector < T , D > createKitRos ( @ Nullable ConfigGeneralDetector configDetector , Class < D > derivType ) { } }
if ( configDetector == null ) configDetector = new ConfigGeneralDetector ( ) ; GeneralFeatureIntensity < T , D > intensity = new WrapperKitRosCornerIntensity < > ( derivType ) ; return createGeneral ( intensity , configDetector ) ;
public class ApacheHTTPClient { /** * This function appends the parameters text to the base URL . * @ param buffer * The buffer to update * @ param parameters * The parameters line */ protected void appendParameters ( StringBuilder buffer , String parameters ) { } }
if ( ( parameters != null ) && ( parameters . length ( ) > 0 ) ) { String updatedParameters = parameters ; if ( parameters . startsWith ( "?" ) ) { updatedParameters = parameters . substring ( 1 ) ; } if ( updatedParameters . length ( ) > 0 ) { int currentLength = buffer . length ( ) ; if ( ( currentLength > 0 ) && ( buffer . charAt ( currentLength - 1 ) == '/' ) ) { int length = currentLength ; buffer . delete ( length - 1 , length ) ; } // add separator buffer . append ( "?" ) ; try { String [ ] parameterPairs = updatedParameters . split ( "&" ) ; int amount = parameterPairs . length ; String parameterPair = null ; String [ ] values = null ; boolean addedParameters = false ; for ( int index = 0 ; index < amount ; index ++ ) { // get next element parameterPair = parameterPairs [ index ] ; // split to key / value values = parameterPair . split ( "=" ) ; if ( values . length == 2 ) { if ( addedParameters ) { buffer . append ( "&" ) ; } buffer . append ( URLEncoder . encode ( values [ 0 ] , "UTF-8" ) ) ; buffer . append ( "=" ) ; buffer . append ( URLEncoder . encode ( values [ 1 ] , "UTF-8" ) ) ; // set flag addedParameters = true ; } } } catch ( Exception exception ) { throw new FaxException ( "Unable to encode parameters." , exception ) ; } } }
public class MetricRegistry { /** * Given a metric set , registers them with the given prefix prepended to their names . * @ param prefix a name prefix * @ param metrics a set of metrics * @ throws IllegalArgumentException if any of the names are already registered */ public void registerAll ( String prefix , MetricSet metrics ) throws IllegalArgumentException { } }
for ( Map . Entry < String , Metric > entry : metrics . getMetrics ( ) . entrySet ( ) ) { if ( entry . getValue ( ) instanceof MetricSet ) { registerAll ( name ( prefix , entry . getKey ( ) ) , ( MetricSet ) entry . getValue ( ) ) ; } else { register ( name ( prefix , entry . getKey ( ) ) , entry . getValue ( ) ) ; } }
public class ProductPartitionNode { /** * Removes the specified key from the custom parameters map . The key < em > must < / em > be present in * the map . * < p > Since this method follows the standard builder pattern and returns { @ code this } , there is no * way to indicate if the remove operation failed besides throwing an exception . * @ param key the key to remove . This must not be { @ code null } . * @ throws IllegalStateException if this node is not a biddable UNIT node * @ throws IllegalArgumentException if there is no entry for { @ code key } in the map */ public ProductPartitionNode removeCustomParameter ( String key ) { } }
if ( ! nodeState . supportsCustomParameters ( ) ) { throw new IllegalStateException ( String . format ( "Cannot remove custom parameters on a %s node" , nodeState . getNodeType ( ) ) ) ; } Preconditions . checkNotNull ( key , "Null key" ) ; if ( ! nodeState . getCustomParams ( ) . containsKey ( key ) ) { throw new IllegalArgumentException ( "No custom parameter exists for key: " + key ) ; } this . nodeState . getCustomParams ( ) . remove ( key ) ; return this ;
public class TypeRefFactory { /** * Wraps the actual class with a proxy . */ @ Override public ITypeRef create ( IType type ) { } }
// already a proxy ? return as is then if ( type instanceof ITypeRef ) { return ( ITypeRef ) type ; } if ( type instanceof INonLoadableType ) { throw new UnsupportedOperationException ( "Type references are not supported for nonloadable types: " + type . getName ( ) ) ; } String strTypeName = TypeLord . getNameWithQualifiedTypeVariables ( type , true ) ; if ( strTypeName == null || strTypeName . length ( ) == 0 ) { throw new IllegalStateException ( "Type has no name" ) ; } ITypeRef ref ; if ( ExecutionMode . isRuntime ( ) ) { ref = getRefTheFastWay ( type , strTypeName ) ; } else { ref = getRefTheSafeWay ( type , strTypeName ) ; } return ref ;
public class CollectionUtil { /** * Creates an array containing a subset of the original array . * If the { @ code pLength } parameter is negative , it will be ignored . * If there are not { @ code pLength } elements in the original array * after { @ code pStart } , the { @ code pLength } parameter will be * ignored . * If the sub array is same length as the original , the original array will * be returned . * @ param pArray the original array * @ param pStart the start index of the original array * @ param pLength the length of the new array * @ return a subset of the original array , or the original array itself , * if { @ code pStart } is 0 and { @ code pLength } is either * negative , or greater or equal to { @ code pArray . length } . * @ throws IllegalArgumentException if { @ code pArray } is { @ code null } or * if { @ code pArray } is not an array . * @ throws ArrayIndexOutOfBoundsException if { @ code pStart } < 0 */ @ SuppressWarnings ( { } }
"SuspiciousSystemArraycopy" } ) public static Object subArray ( Object pArray , int pStart , int pLength ) { Validate . notNull ( pArray , "array" ) ; // Get component type Class type ; // Sanity check start index if ( pStart < 0 ) { throw new ArrayIndexOutOfBoundsException ( pStart + " < 0" ) ; } // Check if argument is array else if ( ( type = pArray . getClass ( ) . getComponentType ( ) ) == null ) { // NOTE : No need to test class . isArray ( ) , really throw new IllegalArgumentException ( "Not an array: " + pArray ) ; } // Store original length int originalLength = Array . getLength ( pArray ) ; // Find new length , stay within bounds int newLength = ( pLength < 0 ) ? Math . max ( 0 , originalLength - pStart ) : Math . min ( pLength , Math . max ( 0 , originalLength - pStart ) ) ; // Store result Object result ; if ( newLength < originalLength ) { // Create sub array & copy into result = Array . newInstance ( type , newLength ) ; System . arraycopy ( pArray , pStart , result , 0 , newLength ) ; } else { // Just return original array // NOTE : This can ONLY happen if pStart = = 0 result = pArray ; } // Return return result ;
public class SRTServletRequest { /** * verify the InputStreamData Map object contains required value . * throws IllegalStateException if there is any missing values . */ @ SuppressWarnings ( "rawtypes" ) protected void validateInputStreamData ( Map isd ) throws IllegalStateException { } }
String message = null ; if ( isd != null ) { if ( isd . size ( ) <= 3 ) { boolean type = isd . containsKey ( INPUT_STREAM_CONTENT_TYPE ) ; boolean length = isd . containsKey ( INPUT_STREAM_CONTENT_DATA_LENGTH ) ; boolean data = isd . containsKey ( INPUT_STREAM_CONTENT_DATA ) ; if ( type && length && data ) { // valid . return ; } else { message = "One of required values of InputStreamData is missing. type : " + type + " length : " + length + " data : " + data ; } } else { message = "InputStreamData contains an unrecognized item." ; } } else { message = "InputStreamData is null." ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "validateInputStreamData" , message ) ; throw new IllegalStateException ( message ) ;
public class CmsRequestContext { /** * Returns the adjusted site root for a resource using the provided site root as a base . < p > * Usually , this would be the site root for the current site . * However , if a resource from the < code > / system / < / code > folder is requested , * this will be the empty String . < p > * @ param siteRoot the site root of the current site * @ param resourcename the resource name to get the adjusted site root for * @ return the adjusted site root for the resource */ public static String getAdjustedSiteRoot ( String siteRoot , String resourcename ) { } }
if ( resourcename . startsWith ( CmsWorkplace . VFS_PATH_SYSTEM ) || OpenCms . getSiteManager ( ) . startsWithShared ( resourcename ) || ( resourcename . startsWith ( CmsWorkplace . VFS_PATH_SITES ) && ! resourcename . startsWith ( siteRoot ) ) ) { return "" ; } else { return siteRoot ; }
public class SARLValidator { /** * Check the container for the SARL capacities . * @ param capacity the capacity . */ @ Check public void checkContainerType ( SarlCapacity capacity ) { } }
final XtendTypeDeclaration declaringType = capacity . getDeclaringType ( ) ; if ( declaringType != null ) { final String name = canonicalName ( declaringType ) ; assert name != null ; error ( MessageFormat . format ( Messages . SARLValidator_30 , name ) , capacity , null , INVALID_NESTED_DEFINITION ) ; }
public class ProxySelectorImpl { /** * Returns the proxy identified by the { @ code hostKey } system property , or * null . */ private Proxy lookupProxy ( String hostKey , String portKey , Proxy . Type type , int defaultPort ) { } }
String host = System . getProperty ( hostKey ) ; if ( host == null || host . isEmpty ( ) ) { return null ; } int port = getSystemPropertyInt ( portKey , defaultPort ) ; return new Proxy ( type , InetSocketAddress . createUnresolved ( host , port ) ) ;
public class MPP12Reader { /** * This method extracts and collates resource assignment data . * @ throws IOException */ private void processAssignmentData ( ) throws IOException { } }
FieldMap fieldMap = new FieldMap12 ( m_file . getProjectProperties ( ) , m_file . getCustomFields ( ) ) ; fieldMap . createAssignmentFieldMap ( m_projectProps ) ; FieldMap enterpriseCustomFieldMap = new FieldMap12 ( m_file . getProjectProperties ( ) , m_file . getCustomFields ( ) ) ; enterpriseCustomFieldMap . createEnterpriseCustomFieldMap ( m_projectProps , AssignmentField . class ) ; DirectoryEntry assnDir = ( DirectoryEntry ) m_projectDir . getEntry ( "TBkndAssn" ) ; VarMeta assnVarMeta = new VarMeta12 ( new DocumentInputStream ( ( ( DocumentEntry ) assnDir . getEntry ( "VarMeta" ) ) ) ) ; Var2Data assnVarData = new Var2Data ( assnVarMeta , new DocumentInputStream ( ( ( DocumentEntry ) assnDir . getEntry ( "Var2Data" ) ) ) ) ; FixedMeta assnFixedMeta = new FixedMeta ( new DocumentInputStream ( ( ( DocumentEntry ) assnDir . getEntry ( "FixedMeta" ) ) ) , 34 ) ; // MSP 20007 seems to write 142 byte blocks , MSP 2010 writes 110 byte blocks // We need to identify any cases where the meta data count does not correctly identify the block size FixedData assnFixedData = new FixedData ( assnFixedMeta , m_inputStreamFactory . getInstance ( assnDir , "FixedData" ) ) ; FixedData assnFixedData2 = new FixedData ( 48 , m_inputStreamFactory . getInstance ( assnDir , "Fixed2Data" ) ) ; ResourceAssignmentFactory factory = new ResourceAssignmentFactory ( ) ; factory . process ( m_file , fieldMap , enterpriseCustomFieldMap , m_reader . getUseRawTimephasedData ( ) , m_reader . getPreserveNoteFormatting ( ) , assnVarMeta , assnVarData , assnFixedMeta , assnFixedData , assnFixedData2 , assnFixedMeta . getAdjustedItemCount ( ) ) ;
public class MessageValidatorRegistryParser { /** * Parses all variable definitions and adds those to the bean definition * builder as property value . * @ param builder the target bean definition builder . * @ param element the source element . */ private void parseValidators ( BeanDefinitionBuilder builder , Element element ) { } }
ManagedList validators = new ManagedList ( ) ; for ( Element validator : DomUtils . getChildElementsByTagName ( element , "validator" ) ) { if ( validator . hasAttribute ( "ref" ) ) { validators . add ( new RuntimeBeanReference ( validator . getAttribute ( "ref" ) ) ) ; } else { validators . add ( BeanDefinitionBuilder . rootBeanDefinition ( validator . getAttribute ( "class" ) ) . getBeanDefinition ( ) ) ; } } if ( ! validators . isEmpty ( ) ) { builder . addPropertyValue ( "messageValidators" , validators ) ; }
public class OptionsScannerPanel { /** * This method initializes sliderHostPerScan * @ return javax . swing . JSlider */ private JSlider getSliderHostPerScan ( ) { } }
if ( sliderHostPerScan == null ) { sliderHostPerScan = new JSlider ( ) ; sliderHostPerScan . setMaximum ( 5 ) ; sliderHostPerScan . setMinimum ( 1 ) ; sliderHostPerScan . setMinorTickSpacing ( 1 ) ; sliderHostPerScan . setPaintTicks ( true ) ; sliderHostPerScan . setPaintLabels ( true ) ; sliderHostPerScan . setName ( "" ) ; sliderHostPerScan . setMajorTickSpacing ( 1 ) ; sliderHostPerScan . setSnapToTicks ( true ) ; sliderHostPerScan . setPaintTrack ( true ) ; } return sliderHostPerScan ;
public class AntiAffinityService { /** * Update Anti - affinity policy * @ param policyRef policy reference * @ param modifyConfig update policy config * @ return OperationFuture wrapper for AntiAffinityPolicy */ public OperationFuture < AntiAffinityPolicy > modify ( AntiAffinityPolicy policyRef , AntiAffinityPolicyConfig modifyConfig ) { } }
client . modifyAntiAffinityPolicy ( findByRef ( policyRef ) . getId ( ) , new AntiAffinityPolicyRequest ( ) . name ( modifyConfig . getName ( ) ) ) ; return new OperationFuture < > ( policyRef , new NoWaitingJobFuture ( ) ) ;
public class PrimitiveUtils { /** * Read integer . * @ param value the value * @ param defaultValue the default value * @ return the integer */ public static Integer readInteger ( String value , Integer defaultValue ) { } }
if ( ! StringUtils . hasText ( value ) ) return defaultValue ; return Integer . valueOf ( value ) ;
public class TFileDumper { /** * Dump information about TFile . * @ param file * Path string of the TFile * @ param out * PrintStream to output the information . * @ param conf * The configuration object . * @ throws IOException */ static public void dumpInfo ( String file , PrintStream out , Configuration conf ) throws IOException { } }
final int maxKeySampleLen = 16 ; Path path = new Path ( file ) ; FileSystem fs = path . getFileSystem ( conf ) ; long length = fs . getFileStatus ( path ) . getLen ( ) ; FSDataInputStream fsdis = fs . open ( path ) ; TFile . Reader reader = new TFile . Reader ( fsdis , length , conf ) ; try { LinkedHashMap < String , String > properties = new LinkedHashMap < String , String > ( ) ; int blockCnt = reader . readerBCF . getBlockCount ( ) ; int metaBlkCnt = reader . readerBCF . metaIndex . index . size ( ) ; properties . put ( "BCFile Version" , reader . readerBCF . version . toString ( ) ) ; properties . put ( "TFile Version" , reader . tfileMeta . version . toString ( ) ) ; properties . put ( "File Length" , Long . toString ( length ) ) ; properties . put ( "Data Compression" , reader . readerBCF . getDefaultCompressionName ( ) ) ; properties . put ( "Record Count" , Long . toString ( reader . getEntryCount ( ) ) ) ; properties . put ( "Sorted" , Boolean . toString ( reader . isSorted ( ) ) ) ; if ( reader . isSorted ( ) ) { properties . put ( "Comparator" , reader . getComparatorName ( ) ) ; } properties . put ( "Data Block Count" , Integer . toString ( blockCnt ) ) ; long dataSize = 0 , dataSizeUncompressed = 0 ; if ( blockCnt > 0 ) { for ( int i = 0 ; i < blockCnt ; ++ i ) { BlockRegion region = reader . readerBCF . dataIndex . getBlockRegionList ( ) . get ( i ) ; dataSize += region . getCompressedSize ( ) ; dataSizeUncompressed += region . getRawSize ( ) ; } properties . put ( "Data Block Bytes" , Long . toString ( dataSize ) ) ; if ( reader . readerBCF . getDefaultCompressionName ( ) != "none" ) { properties . put ( "Data Block Uncompressed Bytes" , Long . toString ( dataSizeUncompressed ) ) ; properties . put ( "Data Block Compression Ratio" , String . format ( "1:%.1f" , ( double ) dataSizeUncompressed / dataSize ) ) ; } } properties . put ( "Meta Block Count" , Integer . toString ( metaBlkCnt ) ) ; long metaSize = 0 , metaSizeUncompressed = 0 ; if ( metaBlkCnt > 0 ) { Collection < MetaIndexEntry > metaBlks = reader . readerBCF . metaIndex . index . values ( ) ; boolean calculateCompression = false ; for ( Iterator < MetaIndexEntry > it = metaBlks . iterator ( ) ; it . hasNext ( ) ; ) { MetaIndexEntry e = it . next ( ) ; metaSize += e . getRegion ( ) . getCompressedSize ( ) ; metaSizeUncompressed += e . getRegion ( ) . getRawSize ( ) ; if ( e . getCompressionAlgorithm ( ) != Compression . Algorithm . NONE ) { calculateCompression = true ; } } properties . put ( "Meta Block Bytes" , Long . toString ( metaSize ) ) ; if ( calculateCompression ) { properties . put ( "Meta Block Uncompressed Bytes" , Long . toString ( metaSizeUncompressed ) ) ; properties . put ( "Meta Block Compression Ratio" , String . format ( "1:%.1f" , ( double ) metaSizeUncompressed / metaSize ) ) ; } } properties . put ( "Meta-Data Size Ratio" , String . format ( "1:%.1f" , ( double ) dataSize / metaSize ) ) ; long leftOverBytes = length - dataSize - metaSize ; long miscSize = BCFile . Magic . size ( ) * 2 + Long . SIZE / Byte . SIZE + Version . size ( ) ; long metaIndexSize = leftOverBytes - miscSize ; properties . put ( "Meta Block Index Bytes" , Long . toString ( metaIndexSize ) ) ; properties . put ( "Headers Etc Bytes" , Long . toString ( miscSize ) ) ; // Now output the properties table . int maxKeyLength = 0 ; Set < Map . Entry < String , String > > entrySet = properties . entrySet ( ) ; for ( Iterator < Map . Entry < String , String > > it = entrySet . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry < String , String > e = it . next ( ) ; if ( e . getKey ( ) . length ( ) > maxKeyLength ) { maxKeyLength = e . getKey ( ) . length ( ) ; } } for ( Iterator < Map . Entry < String , String > > it = entrySet . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry < String , String > e = it . next ( ) ; out . printf ( "%s : %s\n" , Align . format ( e . getKey ( ) , maxKeyLength , Align . LEFT ) , e . getValue ( ) ) ; } out . println ( ) ; reader . checkTFileDataIndex ( ) ; if ( blockCnt > 0 ) { String blkID = "Data-Block" ; int blkIDWidth = Align . calculateWidth ( blkID , blockCnt ) ; int blkIDWidth2 = Align . calculateWidth ( "" , blockCnt ) ; String offset = "Offset" ; int offsetWidth = Align . calculateWidth ( offset , length ) ; String blkLen = "Length" ; int blkLenWidth = Align . calculateWidth ( blkLen , dataSize / blockCnt * 10 ) ; String rawSize = "Raw-Size" ; int rawSizeWidth = Align . calculateWidth ( rawSize , dataSizeUncompressed / blockCnt * 10 ) ; String records = "Records" ; int recordsWidth = Align . calculateWidth ( records , reader . getEntryCount ( ) / blockCnt * 10 ) ; String endKey = "End-Key" ; int endKeyWidth = Math . max ( endKey . length ( ) , maxKeySampleLen * 2 + 5 ) ; out . printf ( "%s %s %s %s %s %s\n" , Align . format ( blkID , blkIDWidth , Align . CENTER ) , Align . format ( offset , offsetWidth , Align . CENTER ) , Align . format ( blkLen , blkLenWidth , Align . CENTER ) , Align . format ( rawSize , rawSizeWidth , Align . CENTER ) , Align . format ( records , recordsWidth , Align . CENTER ) , Align . format ( endKey , endKeyWidth , Align . LEFT ) ) ; for ( int i = 0 ; i < blockCnt ; ++ i ) { BlockRegion region = reader . readerBCF . dataIndex . getBlockRegionList ( ) . get ( i ) ; TFileIndexEntry indexEntry = reader . tfileIndex . getEntry ( i ) ; out . printf ( "%s %s %s %s %s " , Align . format ( Align . format ( i , blkIDWidth2 , Align . ZERO_PADDED ) , blkIDWidth , Align . LEFT ) , Align . format ( region . getOffset ( ) , offsetWidth , Align . LEFT ) , Align . format ( region . getCompressedSize ( ) , blkLenWidth , Align . LEFT ) , Align . format ( region . getRawSize ( ) , rawSizeWidth , Align . LEFT ) , Align . format ( indexEntry . kvEntries , recordsWidth , Align . LEFT ) ) ; byte [ ] key = indexEntry . key ; boolean asAscii = true ; int sampleLen = Math . min ( maxKeySampleLen , key . length ) ; for ( int j = 0 ; j < sampleLen ; ++ j ) { byte b = key [ j ] ; if ( ( b < 32 && b != 9 ) || ( b == 127 ) ) { asAscii = false ; } } if ( ! asAscii ) { out . print ( "0X" ) ; for ( int j = 0 ; j < sampleLen ; ++ j ) { byte b = key [ i ] ; out . printf ( "%X" , b ) ; } } else { out . print ( new String ( key , 0 , sampleLen ) ) ; } if ( sampleLen < key . length ) { out . print ( "..." ) ; } out . println ( ) ; } } out . println ( ) ; if ( metaBlkCnt > 0 ) { String name = "Meta-Block" ; int maxNameLen = 0 ; Set < Map . Entry < String , MetaIndexEntry > > metaBlkEntrySet = reader . readerBCF . metaIndex . index . entrySet ( ) ; for ( Iterator < Map . Entry < String , MetaIndexEntry > > it = metaBlkEntrySet . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry < String , MetaIndexEntry > e = it . next ( ) ; if ( e . getKey ( ) . length ( ) > maxNameLen ) { maxNameLen = e . getKey ( ) . length ( ) ; } } int nameWidth = Math . max ( name . length ( ) , maxNameLen ) ; String offset = "Offset" ; int offsetWidth = Align . calculateWidth ( offset , length ) ; String blkLen = "Length" ; int blkLenWidth = Align . calculateWidth ( blkLen , metaSize / metaBlkCnt * 10 ) ; String rawSize = "Raw-Size" ; int rawSizeWidth = Align . calculateWidth ( rawSize , metaSizeUncompressed / metaBlkCnt * 10 ) ; String compression = "Compression" ; int compressionWidth = compression . length ( ) ; out . printf ( "%s %s %s %s %s\n" , Align . format ( name , nameWidth , Align . CENTER ) , Align . format ( offset , offsetWidth , Align . CENTER ) , Align . format ( blkLen , blkLenWidth , Align . CENTER ) , Align . format ( rawSize , rawSizeWidth , Align . CENTER ) , Align . format ( compression , compressionWidth , Align . LEFT ) ) ; for ( Iterator < Map . Entry < String , MetaIndexEntry > > it = metaBlkEntrySet . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry < String , MetaIndexEntry > e = it . next ( ) ; String blkName = e . getValue ( ) . getMetaName ( ) ; BlockRegion region = e . getValue ( ) . getRegion ( ) ; String blkCompression = e . getValue ( ) . getCompressionAlgorithm ( ) . getName ( ) ; out . printf ( "%s %s %s %s %s\n" , Align . format ( blkName , nameWidth , Align . LEFT ) , Align . format ( region . getOffset ( ) , offsetWidth , Align . LEFT ) , Align . format ( region . getCompressedSize ( ) , blkLenWidth , Align . LEFT ) , Align . format ( region . getRawSize ( ) , rawSizeWidth , Align . LEFT ) , Align . format ( blkCompression , compressionWidth , Align . LEFT ) ) ; } } } finally { IOUtils . cleanup ( LOG , reader , fsdis ) ; }
public class GeneratorParameter { /** * Add a preference . * @ param preference The preference to add . * @ return The generator parameter itself . */ public GeneratorParameter add ( Preference preference ) { } }
preferences . add ( preference ) ; Collections . sort ( preferences ) ; return this ;
public class StringUtil { /** * this is the public entry point for the replaceMap ( ) method * @ param input - the string on which the replacements should be performed . * @ param map - a java . util . Map with key / value pairs where the key is the substring to find and the * value is the substring with which to replace the matched key * @ param ignoreCase - if true then matches will not be case sensitive * @ return * @ throws PageException */ public static String replaceMap ( String input , Map map , boolean ignoreCase ) throws PageException { } }
return replaceMap ( input , map , ignoreCase , true ) ;
public class HttpClientMockBuilder { /** * Adds parameter condition . Parameter value must match . * @ param name parameter name * @ param matcher parameter value matcher * @ return condition builder */ public HttpClientMockBuilder withParameter ( String name , Matcher < String > matcher ) { } }
ruleBuilder . addParameterCondition ( name , matcher ) ; return this ;
public class MicroProfileClientProxyImpl { /** * Liberty change start */ private void init ( ExecutorService executorService , Configuration configuration ) { } }
cfg . getRequestContext ( ) . put ( EXECUTOR_SERVICE_PROPERTY , executorService ) ; cfg . getRequestContext ( ) . putAll ( configuration . getProperties ( ) ) ; List < Interceptor < ? extends Message > > inboundChain = cfg . getInInterceptors ( ) ; inboundChain . add ( new MPAsyncInvocationInterceptorPostAsyncImpl ( ) ) ; inboundChain . add ( new MPAsyncInvocationInterceptorRemoveContextImpl ( ) ) ;
public class DataNode { /** * { @ inheritDoc } */ @ Override public List < String > getReconfigurableProperties ( ) { } }
List < String > changeable = Arrays . asList ( "dfs.data.dir" ) ; return changeable ;
public class OfferService { /** * Remove an offer . * @ param offer the { @ link Offer } . * @ param removeWithSubscriptions if true , the plan and all subscriptions associated with it will be deleted . If * false , only the plan will be deleted . */ public void delete ( Offer offer , boolean removeWithSubscriptions ) { } }
ParameterMap < String , String > params = new ParameterMap < String , String > ( ) ; params . add ( "remove_with_subscriptions" , String . valueOf ( removeWithSubscriptions ) ) ; RestfulUtils . delete ( OfferService . PATH , offer , params , Offer . class , super . httpClient ) ;
public class ImageInserter { /** * Specify the images that you want to overlay on your video . The images must be PNG or TGA files . * @ param insertableImages * Specify the images that you want to overlay on your video . The images must be PNG or TGA files . */ public void setInsertableImages ( java . util . Collection < InsertableImage > insertableImages ) { } }
if ( insertableImages == null ) { this . insertableImages = null ; return ; } this . insertableImages = new java . util . ArrayList < InsertableImage > ( insertableImages ) ;
public class ContinuousDistributions { /** * Calculates the probability from 0 to X under Exponential Distribution * @ param x * @ param lamda * @ return */ public static double exponentialCdf ( double x , double lamda ) { } }
if ( x < 0 || lamda <= 0 ) { throw new IllegalArgumentException ( "All the parameters must be positive." ) ; } double probability = 1.0 - Math . exp ( - lamda * x ) ; return probability ;
public class CoreBiGramTableDictionary { /** * 获取共现频次 * @ param idA 第一个词的id * @ param idB 第二个词的id * @ return 共现频次 */ public static int getBiFrequency ( int idA , int idB ) { } }
// 负数id表示来自用户词典的词语的词频 ( 用户自定义词语没有id ) , 返回正值增加其亲和度 if ( idA < 0 ) { return - idA ; } if ( idB < 0 ) { return - idB ; } int index = binarySearch ( pair , start [ idA ] , start [ idA + 1 ] - start [ idA ] , idB ) ; if ( index < 0 ) return 0 ; index <<= 1 ; return pair [ index + 1 ] ;
public class IntBitSet { /** * Changes data to have data . length > = s components . All data * components that fit into the new size are preserved . * @ param s new data size wanted */ private void resize ( int s ) { } }
int [ ] n ; int count ; n = new int [ s ] ; count = ( s < data . length ) ? s : data . length ; System . arraycopy ( data , 0 , n , 0 , count ) ; data = n ;
public class Navigator { /** * Check the app is exiting * @ param sender The sender */ private void checkAppExit ( Object sender ) { } }
NavLocation curLocation = navigationManager . getModel ( ) . getCurrentLocation ( ) ; if ( curLocation == null ) { navigationManager . postEvent2C ( new NavigationManager . Event . OnAppExit ( sender ) ) ; }
public class PagedStorage { /** * - - - - - Non - Contiguous API ( tiling required ) - - - - - */ void initAndSplit ( int leadingNulls , @ NonNull List < T > multiPageList , int trailingNulls , int positionOffset , int pageSize , @ NonNull Callback callback ) { } }
int pageCount = ( multiPageList . size ( ) + ( pageSize - 1 ) ) / pageSize ; for ( int i = 0 ; i < pageCount ; i ++ ) { int beginInclusive = i * pageSize ; int endExclusive = Math . min ( multiPageList . size ( ) , ( i + 1 ) * pageSize ) ; List < T > sublist = multiPageList . subList ( beginInclusive , endExclusive ) ; if ( i == 0 ) { // Trailing nulls for first page includes other pages in multiPageList int initialTrailingNulls = trailingNulls + multiPageList . size ( ) - sublist . size ( ) ; init ( leadingNulls , sublist , initialTrailingNulls , positionOffset ) ; } else { int insertPosition = leadingNulls + beginInclusive ; insertPage ( insertPosition , sublist , null ) ; } } callback . onInitialized ( size ( ) ) ;
public class URLImpl { /** * check if this url can serve the refUrl . * @ param refUrl a URL object * @ return boolean true can serve */ @ Override public boolean canServe ( URL refUrl ) { } }
if ( refUrl == null || ! this . getPath ( ) . equals ( refUrl . getPath ( ) ) ) { return false ; } if ( ! protocol . equals ( refUrl . getProtocol ( ) ) ) { return false ; } if ( ! Constants . NODE_TYPE_SERVICE . equals ( this . getParameter ( URLParamType . nodeType . getName ( ) ) ) ) { return false ; } String version = getParameter ( URLParamType . version . getName ( ) , URLParamType . version . getValue ( ) ) ; String refVersion = refUrl . getParameter ( URLParamType . version . getName ( ) , URLParamType . version . getValue ( ) ) ; if ( ! version . equals ( refVersion ) ) { return false ; } // check serialize String serialize = getParameter ( URLParamType . serialize . getName ( ) , URLParamType . serialize . getValue ( ) ) ; String refSerialize = refUrl . getParameter ( URLParamType . serialize . getName ( ) , URLParamType . serialize . getValue ( ) ) ; if ( ! serialize . equals ( refSerialize ) ) { return false ; } // Not going to check group as cross group call is needed return true ;
public class Utils { /** * リストに要素のインデックスを指定して追加します 。 * < p > リストのサイズが足りない場合は 、 サイズを自動的に変更します 。 < / p > * @ since 2.0 * @ param list リスト * @ param element 追加する要素 。 値はnullでもよい 。 * @ param index 追加する要素のインデックス番号 ( 0以上 ) * @ throws IllegalArgumentException { @ literal list = = null . } * @ throws IllegalArgumentException { @ literal index < 0 . } */ public static < P > void addListWithIndex ( final List < P > list , final P element , final int index ) { } }
ArgUtils . notNull ( list , "list" ) ; ArgUtils . notMin ( index , 0 , "index" ) ; final int listSize = list . size ( ) ; if ( listSize < index ) { // 足りない場合は 、 要素を追加する 。 final int lackSize = index - listSize ; for ( int i = 0 ; i < lackSize ; i ++ ) { list . add ( null ) ; } list . add ( element ) ; } else if ( listSize == index ) { // 最後の要素に追加する list . add ( element ) ; } else { // リストのサイズが足りている場合 list . set ( index , element ) ; }
public class ElementEditor { /** * Sets as an Document created from a String . * @ throws IllegalArgumentException A parse exception occured */ @ Override public void setAsText ( String text ) { } }
if ( BeanUtils . isNull ( text ) ) { setValue ( null ) ; return ; } setValue ( getAsDocument ( text ) . getDocumentElement ( ) ) ;
public class MongoDBClientFactory { /** * ( non - Javadoc ) * @ see * com . impetus . kundera . loader . GenericClientFactory # instantiateClient ( java * . lang . String ) */ @ Override protected Client instantiateClient ( String persistenceUnit ) { } }
return new MongoDBClient ( mongoDB , indexManager , reader , persistenceUnit , externalProperties , clientMetadata , kunderaMetadata ) ;
public class hqlParser { /** * hql . g : 295:1 : fromClassOrOuterQueryPath : path ( asAlias ) ? ( propertyFetch ) ? - > ^ ( RANGE path ( asAlias ) ? ( propertyFetch ) ? ) ; */ public final hqlParser . fromClassOrOuterQueryPath_return fromClassOrOuterQueryPath ( ) throws RecognitionException { } }
hqlParser . fromClassOrOuterQueryPath_return retval = new hqlParser . fromClassOrOuterQueryPath_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; ParserRuleReturnScope path92 = null ; ParserRuleReturnScope asAlias93 = null ; ParserRuleReturnScope propertyFetch94 = null ; RewriteRuleSubtreeStream stream_propertyFetch = new RewriteRuleSubtreeStream ( adaptor , "rule propertyFetch" ) ; RewriteRuleSubtreeStream stream_path = new RewriteRuleSubtreeStream ( adaptor , "rule path" ) ; RewriteRuleSubtreeStream stream_asAlias = new RewriteRuleSubtreeStream ( adaptor , "rule asAlias" ) ; try { // hql . g : 296:2 : ( path ( asAlias ) ? ( propertyFetch ) ? - > ^ ( RANGE path ( asAlias ) ? ( propertyFetch ) ? ) ) // hql . g : 296:4 : path ( asAlias ) ? ( propertyFetch ) ? { pushFollow ( FOLLOW_path_in_fromClassOrOuterQueryPath1329 ) ; path92 = path ( ) ; state . _fsp -- ; stream_path . add ( path92 . getTree ( ) ) ; WeakKeywords ( ) ; // hql . g : 296:29 : ( asAlias ) ? int alt34 = 2 ; int LA34_0 = input . LA ( 1 ) ; if ( ( LA34_0 == AS || LA34_0 == IDENT ) ) { alt34 = 1 ; } switch ( alt34 ) { case 1 : // hql . g : 296:30 : asAlias { pushFollow ( FOLLOW_asAlias_in_fromClassOrOuterQueryPath1334 ) ; asAlias93 = asAlias ( ) ; state . _fsp -- ; stream_asAlias . add ( asAlias93 . getTree ( ) ) ; } break ; } // hql . g : 296:40 : ( propertyFetch ) ? int alt35 = 2 ; int LA35_0 = input . LA ( 1 ) ; if ( ( LA35_0 == FETCH ) ) { alt35 = 1 ; } switch ( alt35 ) { case 1 : // hql . g : 296:41 : propertyFetch { pushFollow ( FOLLOW_propertyFetch_in_fromClassOrOuterQueryPath1339 ) ; propertyFetch94 = propertyFetch ( ) ; state . _fsp -- ; stream_propertyFetch . add ( propertyFetch94 . getTree ( ) ) ; } break ; } // AST REWRITE // elements : asAlias , propertyFetch , path // token labels : // rule labels : retval // token list labels : // rule list labels : // wildcard labels : retval . tree = root_0 ; RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream ( adaptor , "rule retval" , retval != null ? retval . getTree ( ) : null ) ; root_0 = ( CommonTree ) adaptor . nil ( ) ; // 297:3 : - > ^ ( RANGE path ( asAlias ) ? ( propertyFetch ) ? ) { // hql . g : 297:6 : ^ ( RANGE path ( asAlias ) ? ( propertyFetch ) ? ) { CommonTree root_1 = ( CommonTree ) adaptor . nil ( ) ; root_1 = ( CommonTree ) adaptor . becomeRoot ( adaptor . create ( RANGE , "RANGE" ) , root_1 ) ; adaptor . addChild ( root_1 , stream_path . nextTree ( ) ) ; // hql . g : 297:19 : ( asAlias ) ? if ( stream_asAlias . hasNext ( ) ) { adaptor . addChild ( root_1 , stream_asAlias . nextTree ( ) ) ; } stream_asAlias . reset ( ) ; // hql . g : 297:28 : ( propertyFetch ) ? if ( stream_propertyFetch . hasNext ( ) ) { adaptor . addChild ( root_1 , stream_propertyFetch . nextTree ( ) ) ; } stream_propertyFetch . reset ( ) ; adaptor . addChild ( root_0 , root_1 ) ; } } retval . tree = root_0 ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving } return retval ;
public class Element { /** * ( non - Javadoc ) * @ see qc . automation . framework . widget . IElement # isElementVisible ( ) */ @ Override public boolean isElementVisible ( ) throws WidgetException { } }
try { return isVisible ( ) && ( getLocationX ( ) > 0 ) && ( getLocationY ( ) > 0 ) ; } catch ( Exception e ) { throw new WidgetException ( "Error while determining whether element is visible" , locator , e ) ; }
public class DdlGenerator { /** * get component class by component property string * @ param pc * @ param propertyString * @ return */ private Class < ? > getPropertyType ( PersistentClass pc , String propertyString ) { } }
String [ ] properties = split ( propertyString , '.' ) ; Property p = pc . getProperty ( properties [ 0 ] ) ; Component cp = ( ( Component ) p . getValue ( ) ) ; int i = 1 ; for ( ; i < properties . length ; i ++ ) { p = cp . getProperty ( properties [ i ] ) ; cp = ( ( Component ) p . getValue ( ) ) ; } return cp . getComponentClass ( ) ;
public class ResourcePendingMaintenanceActionsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResourcePendingMaintenanceActions resourcePendingMaintenanceActions , ProtocolMarshaller protocolMarshaller ) { } }
if ( resourcePendingMaintenanceActions == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resourcePendingMaintenanceActions . getResourceIdentifier ( ) , RESOURCEIDENTIFIER_BINDING ) ; protocolMarshaller . marshall ( resourcePendingMaintenanceActions . getPendingMaintenanceActionDetails ( ) , PENDINGMAINTENANCEACTIONDETAILS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class FieldErrorAttributeProcessor { /** * If Type - Convertion Error found at Struts2 , overwrite request - * parameter same name . * @ param fieldname parameter - name * @ return request - parameter - value ( if convertion error occurs , return from struts2 , not else thymeleaf . ) */ protected String getOverwriteValue ( String fieldname ) { } }
ActionContext ctx = ServletActionContext . getContext ( ) ; ValueStack stack = ctx . getValueStack ( ) ; Map < Object , Object > overrideMap = stack . getExprOverrides ( ) ; // If convertion error has not , do nothing . if ( overrideMap == null || overrideMap . isEmpty ( ) ) { return null ; } if ( ! overrideMap . containsKey ( fieldname ) ) { return null ; } String convertionValue = ( String ) overrideMap . get ( fieldname ) ; // Struts2 - Conponent is wrapped String quote , which erase for output value . String altString = StringEscapeUtils . unescapeJava ( convertionValue ) ; altString = altString . substring ( 1 , altString . length ( ) - 1 ) ; return altString ;
public class Aggregated { /** * Returns the parameters of the term * @ return ` " aggregation minimum maximum terms " ` */ @ Override public String parameters ( ) { } }
FllExporter exporter = new FllExporter ( ) ; StringBuilder result = new StringBuilder ( ) ; result . append ( String . format ( "%s %s %s" , Op . str ( minimum ) , Op . str ( maximum ) , exporter . toString ( aggregation ) ) ) ; for ( Term term : terms ) { result . append ( " " ) . append ( exporter . toString ( term ) ) ; } return result . toString ( ) ;
public class ResourceType { /** * Converts the resource type to an absolute path . If it does not start with " / " the resource is resolved * via search paths using resource resolver . If not matching resource is found it is returned unchanged . * @ param resourceType Resource type * @ param resourceResolver Resource resolver * @ return Absolute resource type */ public static @ NotNull String makeAbsolute ( @ NotNull String resourceType , @ NotNull ResourceResolver resourceResolver ) { } }
if ( StringUtils . isEmpty ( resourceType ) || StringUtils . startsWith ( resourceType , "/" ) ) { return resourceType ; } // first try to resolve path via component manager - because on publish instance the original resource may not accessible ComponentManager componentManager = resourceResolver . adaptTo ( ComponentManager . class ) ; if ( componentManager != null ) { Component component = componentManager . getComponent ( resourceType ) ; if ( component != null ) { return component . getPath ( ) ; } else { return resourceType ; } } // otherwise use resource resolver directly Resource resource = resourceResolver . getResource ( resourceType ) ; if ( resource != null ) { return resource . getPath ( ) ; } else { return resourceType ; }
public class GISTreeSetUtil { /** * Replies if the given region contains the given point . * @ param region is the index of the region . * @ param cutX is the cut line of the region parent . * @ param cutY is the cut line of the region parent . * @ param pointX is the coordinate of the point to classify . * @ param pointY is the coordinate of the point to classify . * @ return < code > true < / code > if the point is inside the given region , * otherwise < code > false < / code > */ @ Pure static boolean contains ( int region , double cutX , double cutY , double pointX , double pointY ) { } }
switch ( IcosepQuadTreeZone . values ( ) [ region ] ) { case SOUTH_WEST : return pointX <= cutX && pointY <= cutY ; case SOUTH_EAST : return pointX >= cutX && pointY <= cutY ; case NORTH_WEST : return pointX <= cutX && pointY >= cutY ; case NORTH_EAST : return pointX >= cutX && pointY >= cutY ; case ICOSEP : return true ; default : } return false ;
public class HFCACertificateRequest { /** * Get certificates that have been revoked after this date * @ param revokedStart Revoked after date * @ throws InvalidArgumentException Date can ' t be null */ public void setRevokedStart ( Date revokedStart ) throws InvalidArgumentException { } }
if ( revokedStart == null ) { throw new InvalidArgumentException ( "Date can't be null" ) ; } queryParms . put ( "revoked_start" , Util . dateToString ( revokedStart ) ) ;
public class ArrivalsThreadGroup { /** * Graceful shutdown of test calls this , then # verifyThreadsStopped */ @ Override public void tellThreadsToStop ( ) { } }
super . tellThreadsToStop ( ) ; for ( DynamicThread thread : poolThreads ) { stopThread ( thread . getThreadName ( ) , true ) ; }
public class DescribeStacksResult { /** * An array of < code > Stack < / code > objects that describe the stacks . * @ param stacks * An array of < code > Stack < / code > objects that describe the stacks . */ public void setStacks ( java . util . Collection < Stack > stacks ) { } }
if ( stacks == null ) { this . stacks = null ; return ; } this . stacks = new com . amazonaws . internal . SdkInternalList < Stack > ( stacks ) ;
public class UserControl { /** * Set up the screen input fields . */ public void setupFields ( ) { } }
FieldInfo field = null ; field = new FieldInfo ( this , ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ; field . setHidden ( true ) ; field = new FieldInfo ( this , LAST_CHANGED , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Date . class ) ; field . setHidden ( true ) ; field = new FieldInfo ( this , DELETED , 10 , null , new Boolean ( false ) ) ; field . setDataClass ( Boolean . class ) ; field . setHidden ( true ) ; field = new FieldInfo ( this , ANON_USER_GROUP_ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ; field = new FieldInfo ( this , ANON_USER_INFO_ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ; field = new FieldInfo ( this , TEMPLATE_USER_ID , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; field . setDataClass ( Integer . class ) ;
public class AnnotationAttribute { /** * Reads the { @ link Annotation } attribute ' s value from the given { @ link AnnotatedElement } . * @ param annotatedElement must not be { @ literal null } . * @ return */ @ Nullable public String getValueFrom ( AnnotatedElement annotatedElement ) { } }
Assert . notNull ( annotatedElement , "Annotated element must not be null!" ) ; Annotation annotation = annotatedElement . getAnnotation ( annotationType ) ; return annotation == null ? null : getValueFrom ( annotation ) ;
public class ActionDefinition { /** * syntactic sugar */ public ActionDefinitionCustomizationComponent addCustomization ( ) { } }
ActionDefinitionCustomizationComponent t = new ActionDefinitionCustomizationComponent ( ) ; if ( this . customization == null ) this . customization = new ArrayList < ActionDefinitionCustomizationComponent > ( ) ; this . customization . add ( t ) ; return t ;
public class ParameterizedSpecRunner { /** * - 1 = > unknown */ private int estimateNumIterations ( Object [ ] dataProviders ) { } }
if ( runStatus != OK ) return - 1 ; if ( dataProviders . length == 0 ) return 1 ; int result = Integer . MAX_VALUE ; for ( Object prov : dataProviders ) { if ( prov instanceof Iterator ) // unbelievably , DGM provides a size ( ) method for Iterators , // although it is of course destructive ( i . e . it exhausts the Iterator ) continue ; Object rawSize = GroovyRuntimeUtil . invokeMethodQuietly ( prov , "size" ) ; if ( ! ( rawSize instanceof Number ) ) continue ; int size = ( ( Number ) rawSize ) . intValue ( ) ; if ( size < 0 || size >= result ) continue ; result = size ; } return result == Integer . MAX_VALUE ? - 1 : result ;
public class DataFlowAnalysis { /** * Finds a fixed - point solution . The function has the side effect of replacing * the existing node annotations with the computed solutions using { @ link * com . google . javascript . jscomp . graph . GraphNode # setAnnotation ( Annotation ) } . * < p > Initially , each node ' s input and output flow state contains the value * given by { @ link # createInitialEstimateLattice ( ) } ( with the exception of the * entry node of the graph which takes on the { @ link # createEntryLattice ( ) } * value . Each node will use the output state of its predecessor and compute a * output state according to the instruction . At that time , any nodes that * depends on the node ' s newly modified output value will need to recompute * their output state again . Each step will perform a computation at one node * until no extra computation will modify any existing output state anymore . * @ param maxSteps Max number of iterations before the method stops and throw * a { @ link MaxIterationsExceededException } . This will prevent the * analysis from going into a infinite loop . */ final void analyze ( int maxSteps ) { } }
initialize ( ) ; int step = 0 ; while ( ! orderedWorkSet . isEmpty ( ) ) { if ( step > maxSteps ) { throw new MaxIterationsExceededException ( "Analysis did not terminate after " + maxSteps + " iterations" ) ; } DiGraphNode < N , Branch > curNode = orderedWorkSet . iterator ( ) . next ( ) ; orderedWorkSet . remove ( curNode ) ; joinInputs ( curNode ) ; if ( flow ( curNode ) ) { // If there is a change in the current node , we want to grab the list // of nodes that this node affects . List < DiGraphNode < N , Branch > > nextNodes = isForward ( ) ? cfg . getDirectedSuccNodes ( curNode ) : cfg . getDirectedPredNodes ( curNode ) ; for ( DiGraphNode < N , Branch > nextNode : nextNodes ) { if ( nextNode != cfg . getImplicitReturn ( ) ) { orderedWorkSet . add ( nextNode ) ; } } } step ++ ; } if ( isForward ( ) ) { joinInputs ( getCfg ( ) . getImplicitReturn ( ) ) ; }
public class COSInputStream { /** * Perform lazy seek and adjust stream to correct position for reading . * @ param targetPos position from where data should be read * @ param len length of the content that needs to be read */ private void lazySeek ( long targetPos , long len ) throws IOException { } }
// For lazy seek seekInStream ( targetPos , len ) ; // re - open at specific location if needed if ( wrappedStream == null ) { reopen ( "read from new offset" , targetPos , len ) ; }
public class JdbcKAMLoaderImpl { /** * { @ inheritDoc } */ @ Override public void loadStatementAnnotationMap ( StatementAnnotationMapTable samt ) throws SQLException { } }
Map < Integer , Set < AnnotationPair > > sidAnnotationIndex = samt . getStatementAnnotationPairsIndex ( ) ; PreparedStatement saps = getPreparedStatement ( STATEMENT_ANNOTATION_SQL ) ; final Set < Entry < Integer , Set < AnnotationPair > > > entries = sidAnnotationIndex . entrySet ( ) ; for ( final Entry < Integer , Set < AnnotationPair > > entry : entries ) { final Integer sid = entry . getKey ( ) ; for ( final AnnotationPair annotation : entry . getValue ( ) ) { // XXX offset saps . setInt ( 1 , sid + 1 ) ; // XXX offset saps . setInt ( 2 , annotation . getAnnotationValueId ( ) + 1 ) ; saps . addBatch ( ) ; } } saps . executeBatch ( ) ;
public class LoadBalancerManager { /** * Get the ServiceQueryRRLoadBalancer . * @ param serviceName * the service name . * @ param query * the ServiceInstanceQuery . * @ return * the ServiceQueryRRLoadBalancer . */ public ServiceQueryRRLoadBalancer getServiceQueryRRLoadBalancer ( String serviceName , ServiceInstanceQuery query ) { } }
for ( ServiceQueryRRLoadBalancer lb : svcQueryLBList ) { if ( lb . getServiceName ( ) . equals ( serviceName ) && lb . getServiceInstanceQuery ( ) . equals ( query ) ) { return lb ; } } ServiceQueryRRLoadBalancer lb = new ServiceQueryRRLoadBalancer ( lookupService , serviceName , query ) ; svcQueryLBList . add ( lb ) ; return lb ;
public class Validator { /** * Reverses a set of properties mapped using the description ' s configuration to property mapping , or the same input * if the description has no mapping * @ param input input map * @ param desc plugin description * @ return mapped values */ public static Map < String , String > demapProperties ( final Map < String , String > input , final Description desc ) { } }
final Map < String , String > mapping = desc . getPropertiesMapping ( ) ; return demapProperties ( input , mapping , true ) ;
public class Cache { /** * / / / / / Op handling / / / / / */ private Object handleOpGet ( CacheLine line , Op . Type type , Object data , short nodeHint , Transaction txn , int change ) { } }
if ( ( change & ( LINE_STATE_CHANGED | LINE_OWNER_CHANGED | ( synchronous ? LINE_MODIFIED_CHANGED : 0 ) ) ) == 0 ) return PENDING ; if ( line . is ( CacheLine . DELETED ) ) handleDeleted ( line ) ; if ( ! transitionToS ( line , nodeHint ) ) { if ( type != Op . Type . GETS && line . version > 0 && ! isPossibleInconsistencies ( line ) ) { if ( data != null ) { readData ( line , ( Persistable ) data ) ; return null ; } else return readData ( line ) ; } else return PENDING ; } if ( type == Op . Type . GETS ) lockLine ( line , txn ) ; if ( data != null ) { readData ( line , ( Persistable ) data ) ; return null ; } else return readData ( line ) ;
public class PathUtil { /** * create a path from an array of components * @ param components path components strings * @ return a path */ public static Path pathFromComponents ( String [ ] components ) { } }
if ( null == components || components . length == 0 ) { return null ; } return new PathImpl ( pathStringFromComponents ( components ) ) ;
public class RestCall { /** * Fixme : Need refactoring to remove code duplication . */ protected HttpClient getHttpClient ( ) { } }
HttpClient client = new HttpClient ( ) ; if ( Jenkins . getInstance ( ) != null ) { ProxyConfiguration proxy = Jenkins . getInstance ( ) . proxy ; if ( useProxy && ( proxy != null ) ) { client . getHostConfiguration ( ) . setProxy ( proxy . name , proxy . port ) ; String username = proxy . getUserName ( ) ; String password = proxy . getPassword ( ) ; if ( ! StringUtils . isEmpty ( username . trim ( ) ) && ! StringUtils . isEmpty ( password . trim ( ) ) ) { logger . info ( "Using proxy authentication (user=" + username + ")" ) ; client . getState ( ) . setProxyCredentials ( AuthScope . ANY , new UsernamePasswordCredentials ( username . trim ( ) , password . trim ( ) ) ) ; } } } return client ;
public class TernaryTreeNode { /** * Set the left child of this node . * @ param newChild the new child . * @ return < code > true < / code > on success , otherwise < code > false < / code > */ public boolean setLeftChild ( N newChild ) { } }
final N oldChild = this . left ; if ( oldChild == newChild ) { return false ; } if ( oldChild != null ) { oldChild . setParentNodeReference ( null , true ) ; -- this . notNullChildCount ; firePropertyChildRemoved ( 0 , oldChild ) ; } if ( newChild != null ) { final N oldParent = newChild . getParentNode ( ) ; if ( oldParent != this ) { newChild . removeFromParent ( ) ; } } this . left = newChild ; if ( newChild != null ) { newChild . setParentNodeReference ( toN ( ) , true ) ; ++ this . notNullChildCount ; firePropertyChildAdded ( 0 , newChild ) ; } return true ;
public class Crawler { /** * This method calls the index state . It should be called once per crawl in order to setup the * crawl . * @ return The initial state . */ public StateVertex crawlIndex ( ) { } }
LOG . debug ( "Setting up vertex of the index page" ) ; if ( basicAuthUrl != null ) { browser . goToUrl ( basicAuthUrl ) ; } browser . goToUrl ( url ) ; // Run url first load plugin to clear the application state plugins . runOnUrlFirstLoadPlugins ( context ) ; plugins . runOnUrlLoadPlugins ( context ) ; StateVertex index = vertexFactory . createIndex ( url . toString ( ) , browser . getStrippedDom ( ) , stateComparator . getStrippedDom ( browser ) , browser ) ; Preconditions . checkArgument ( index . getId ( ) == StateVertex . INDEX_ID , "It seems some the index state is crawled more than once." ) ; LOG . debug ( "Parsing the index for candidate elements" ) ; ImmutableList < CandidateElement > extract = candidateExtractor . extract ( index ) ; plugins . runPreStateCrawlingPlugins ( context , extract , index ) ; candidateActionCache . addActions ( extract , index ) ; return index ;
public class FlowUtils { /** * Generates a queue consumer groupId for the given flowlet in the given program id . */ public static long generateConsumerGroupId ( String flowId , String flowletId ) { } }
return Hashing . md5 ( ) . newHasher ( ) . putString ( flowId ) . putString ( flowletId ) . hash ( ) . asLong ( ) ;
public class CmsAreaSelectPanel { /** * Sets the selection area . < p > * @ param relative < code > true < / code > if provided position is relative to the select area , not absolute to the page * @ param pos the area position to select */ public void setAreaPosition ( boolean relative , CmsPositionBean pos ) { } }
if ( pos == null ) { return ; } m_state = State . SELECTED ; showSelect ( true ) ; m_currentSelection = new CmsPositionBean ( ) ; m_firstX = pos . getLeft ( ) ; m_firstY = pos . getTop ( ) ; if ( ! relative ) { m_firstX -= getElement ( ) . getAbsoluteLeft ( ) ; m_firstY -= getElement ( ) . getAbsoluteTop ( ) ; } // setSelectPosition ( m _ firstX , m _ firstY , 0 , 0 ) ; setSelectPosition ( m_firstX , m_firstY , pos . getHeight ( ) , pos . getWidth ( ) ) ;
public class CommerceNotificationTemplateLocalServiceUtil { /** * Returns the commerce notification template matching the UUID and group . * @ param uuid the commerce notification template ' s UUID * @ param groupId the primary key of the group * @ return the matching commerce notification template , or < code > null < / code > if a matching commerce notification template could not be found */ public static com . liferay . commerce . notification . model . CommerceNotificationTemplate fetchCommerceNotificationTemplateByUuidAndGroupId ( String uuid , long groupId ) { } }
return getService ( ) . fetchCommerceNotificationTemplateByUuidAndGroupId ( uuid , groupId ) ;
public class HttpStreamWrapper { /** * Read data from the connection . If the request hasn ' t yet been sent * to the server , send it . */ public int read ( byte [ ] buf , int offset , int length ) throws IOException { } }
if ( _stream != null ) return _stream . read ( buf , offset , length ) ; else return - 1 ;
public class Annotation { /** * Serializes the object in a uniform matter for storage . Needed for * successful CAS calls * @ return The serialized object as a byte array */ @ VisibleForTesting byte [ ] getStorageJSON ( ) { } }
// TODO - precalculate size final ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; try { final JsonGenerator json = JSON . getFactory ( ) . createGenerator ( output ) ; json . writeStartObject ( ) ; if ( tsuid != null && ! tsuid . isEmpty ( ) ) { json . writeStringField ( "tsuid" , tsuid ) ; } json . writeNumberField ( "startTime" , start_time ) ; json . writeNumberField ( "endTime" , end_time ) ; json . writeStringField ( "description" , description ) ; json . writeStringField ( "notes" , notes ) ; if ( custom == null ) { json . writeNullField ( "custom" ) ; } else { final TreeMap < String , String > sorted_custom = new TreeMap < String , String > ( custom ) ; json . writeObjectField ( "custom" , sorted_custom ) ; } json . writeEndObject ( ) ; json . close ( ) ; return output . toByteArray ( ) ; } catch ( IOException e ) { throw new RuntimeException ( "Unable to serialize Annotation" , e ) ; }
public class Path { /** * Calculates the distance and time of the specified edgeId . Also it adds the edgeId to the path list . * @ param prevEdgeId here the edge that comes before edgeId is necessary . I . e . for the reverse search we need the * next edge . */ protected void processEdge ( int edgeId , int adjNode , int prevEdgeId ) { } }
EdgeIteratorState iter = graph . getEdgeIteratorState ( edgeId , adjNode ) ; distance += iter . getDistance ( ) ; time += weighting . calcMillis ( iter , false , prevEdgeId ) ; addEdge ( edgeId ) ;
public class InternalLogger { /** * Logs a caught exception with a custom text message . * @ param level * Severity level * @ param message * Plain text message * @ param exception * Caught exception */ public static void log ( final Level level , final Throwable exception , final String message ) { } }
String nameOfException = exception . getClass ( ) . getName ( ) ; String messageOfException = exception . getMessage ( ) ; StringBuilder builder = new StringBuilder ( BUFFER_SIZE ) ; builder . append ( level ) ; builder . append ( ": " ) ; builder . append ( message ) ; builder . append ( " (" ) ; builder . append ( nameOfException ) ; if ( messageOfException != null && ! messageOfException . isEmpty ( ) ) { builder . append ( ": " ) ; builder . append ( messageOfException ) ; } builder . append ( ")" ) ; System . err . println ( builder ) ;
public class ExceptionUtil { /** * Finds the root cause of a Throwable that occured . This routine will continue to * look through chained Throwables until it cannot find another chained Throwable * and return the last one in the chain as the root cause . * @ param throwable must be a non - null reference of a Throwable object * to be processed . */ static public Throwable findRootCause ( Throwable throwable ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "findRootCause: " + throwable ) ; } Throwable root = throwable ; Throwable next = root ; while ( next != null ) { root = next ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "finding cause of: " + root . getClass ( ) . getName ( ) ) ; } if ( root instanceof java . rmi . RemoteException ) { next = ( ( java . rmi . RemoteException ) root ) . detail ; } else if ( root instanceof WsNestedException ) // d162976 { next = ( ( WsNestedException ) root ) . getCause ( ) ; // d162976 } else if ( root instanceof TransactionRolledbackLocalException ) // d180095 begin { next = ( ( TransactionRolledbackLocalException ) root ) . getCause ( ) ; } else if ( root instanceof AccessLocalException ) { next = ( ( AccessLocalException ) root ) . getCause ( ) ; } else if ( root instanceof NoSuchObjectLocalException ) { next = ( ( NoSuchObjectLocalException ) root ) . getCause ( ) ; } else if ( root instanceof TransactionRequiredLocalException ) { next = ( ( TransactionRequiredLocalException ) root ) . getCause ( ) ; } // else if ( root instanceof InvalidActivityLocalException ) // root = ( ( InvalidActivityLocalException ) root ) . getCause ( ) ; // else if ( root instanceof ActivityRequiredLocalException ) // root = ( ( ActivityRequiredLocalException ) root ) . getCause ( ) ; // else if ( root instanceof ActivityCompletedLocalException ) // next = ( ( ActivityCompletedLocalException ) root ) . getCause ( ) ; / / d180095 end else if ( root instanceof NamingException ) { next = ( ( NamingException ) root ) . getRootCause ( ) ; } else if ( root instanceof InvocationTargetException ) { next = ( ( InvocationTargetException ) root ) . getTargetException ( ) ; } else if ( root instanceof org . omg . CORBA . portable . UnknownException ) { next = ( ( org . omg . CORBA . portable . UnknownException ) root ) . originalEx ; } else if ( root instanceof InjectionException ) // d436080 { next = root . getCause ( ) ; } else { next = null ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "findRootCause returning: " + root ) ; return root ;
public class DefaultEndpoint { /** * Drain commands from a queue and return only active commands . * @ param source the source queue . * @ return List of commands . */ private static List < RedisCommand < ? , ? , ? > > drainCommands ( Queue < ? extends RedisCommand < ? , ? , ? > > source ) { } }
List < RedisCommand < ? , ? , ? > > target = new ArrayList < > ( source . size ( ) ) ; RedisCommand < ? , ? , ? > cmd ; while ( ( cmd = source . poll ( ) ) != null ) { if ( ! cmd . isDone ( ) ) { target . add ( cmd ) ; } } return target ;
public class Parser { /** * < p > Parses the given resource and evaluates it with the given evaluator . Requires that the parse result in a single * expression . < / p > * @ param < O > the return type of the evaluator * @ param resource the resource to evaluate * @ param evaluator the evaluator to use for transforming expressions * @ return the single return values from the evaluator * @ throws ParseException Something went wrong parsing */ public < O > O evaluate ( @ NonNull Resource resource , @ NonNull Evaluator < ? extends O > evaluator ) throws ParseException { } }
ExpressionIterator iterator = parse ( resource ) ; Expression expression = iterator . next ( ) ; if ( iterator . hasNext ( ) ) { throw new ParseException ( "Did not fully parse token stream" ) ; } try { return evaluator . eval ( expression ) ; } catch ( Exception e ) { throw new ParseException ( e ) ; }
public class ExpressRouteCircuitConnectionsInner { /** * Creates or updates a Express Route Circuit Connection in the specified express route circuits . * @ param resourceGroupName The name of the resource group . * @ param circuitName The name of the express route circuit . * @ param peeringName The name of the peering . * @ param connectionName The name of the express route circuit connection . * @ param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit circuit connection operation . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < ExpressRouteCircuitConnectionInner > beginCreateOrUpdateAsync ( String resourceGroupName , String circuitName , String peeringName , String connectionName , ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters , final ServiceCallback < ExpressRouteCircuitConnectionInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , circuitName , peeringName , connectionName , expressRouteCircuitConnectionParameters ) , serviceCallback ) ;
public class PathManagerService { /** * Adds an entry for a path and sends an { @ link org . jboss . as . controller . services . path . PathManager . Event # ADDED } * notification to any registered { @ linkplain org . jboss . as . controller . services . path . PathManager . Callback callbacks } . * @ param pathName the logical name of the path within the model . Cannot be { @ code null } * @ param path the value of the path within the model . This is either an absolute path or * the relative portion of the path . Cannot be { @ code null } * @ param relativeTo the name of the path this path is relative to . If { @ code null } this is an absolute path * @ param readOnly { @ code true } if the path is immutable , and cannot be removed or modified via a management operation * @ return the entry that represents the path * @ throws RuntimeException if an entry with the given { @ code pathName } is already registered */ final PathEntry addPathEntry ( final String pathName , final String path , final String relativeTo , final boolean readOnly ) { } }
PathEntry pathEntry ; synchronized ( pathEntries ) { if ( pathEntries . containsKey ( pathName ) ) { throw ControllerLogger . ROOT_LOGGER . pathEntryAlreadyExists ( pathName ) ; } pathEntry = new PathEntry ( pathName , path , relativeTo , readOnly , relativeTo == null ? absoluteResolver : relativeResolver ) ; pathEntries . put ( pathName , pathEntry ) ; if ( relativeTo != null ) { addDependent ( pathName , relativeTo ) ; } } triggerCallbacksForEvent ( pathEntry , Event . ADDED ) ; return pathEntry ;
public class ListDocumentsRequest { /** * One or more filters . Use a filter to return a more specific list of results . * @ param filters * One or more filters . Use a filter to return a more specific list of results . */ public void setFilters ( java . util . Collection < DocumentKeyValuesFilter > filters ) { } }
if ( filters == null ) { this . filters = null ; return ; } this . filters = new com . amazonaws . internal . SdkInternalList < DocumentKeyValuesFilter > ( filters ) ;
public class SummernoteKeyUpEvent { /** * Fires a summernote key up event on all registered handlers in the handler * manager . If no such handlers exist , this method will do nothing . * @ param source the source of the handlers * @ param keyUpEvent native key up event */ public static void fire ( final HasSummernoteKeyUpHandlers source , NativeEvent nativeEvent ) { } }
if ( TYPE != null ) { SummernoteKeyUpEvent event = new SummernoteKeyUpEvent ( nativeEvent ) ; source . fireEvent ( event ) ; }
public class TextLoader { /** * Load a text from the specified reader and put it in the provided StringBuffer . * @ param source source reader . * @ param buffer buffer to load text into . * @ return the buffer * @ throws IOException if there is a problem to deal with . */ public StringBuffer append ( Reader source , StringBuffer buffer ) throws IOException { } }
BufferedReader _bufferedReader = new BufferedReader ( source ) ; char [ ] _buffer = new char [ getBufferSize ( ) ] ; // load by chunk of 4 ko try { for ( int _countReadChars = 0 ; _countReadChars >= 0 ; ) { buffer . append ( _buffer , 0 , _countReadChars ) ; _countReadChars = _bufferedReader . read ( _buffer ) ; } } finally { _bufferedReader . close ( ) ; } return buffer ;
public class CPFriendlyURLEntryUtil { /** * Returns the first cp friendly url entry in the ordered set where groupId = & # 63 ; and classNameId = & # 63 ; and classPK = & # 63 ; . * @ param groupId the group ID * @ param classNameId the class name ID * @ param classPK the class pk * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp friendly url entry , or < code > null < / code > if a matching cp friendly url entry could not be found */ public static CPFriendlyURLEntry fetchByG_C_C_First ( long groupId , long classNameId , long classPK , OrderByComparator < CPFriendlyURLEntry > orderByComparator ) { } }
return getPersistence ( ) . fetchByG_C_C_First ( groupId , classNameId , classPK , orderByComparator ) ;
public class CacheHashMap { /** * Loads all the session attributes . * Copied from DatabaseHashMapMR . */ @ Trivial // return value contains customer data @ FFDCIgnore ( Exception . class ) // manually logged Object getAllValues ( BackedSession sess ) { } }
@ SuppressWarnings ( "static-access" ) final boolean hideValues = _smc . isHideSessionValues ( ) ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getAllValues" , sess ) ; String id = sess . getId ( ) ; long startTime = System . nanoTime ( ) ; long readSize = 0 ; Hashtable < String , Object > h = new Hashtable < String , Object > ( ) ; try { if ( trace && tc . isDebugEnabled ( ) ) tcInvoke ( tcSessionMetaCache , "get" , id ) ; ArrayList < ? > list = sessionMetaCache . get ( id ) ; if ( trace && tc . isDebugEnabled ( ) ) tcReturn ( tcSessionMetaCache , "get" , list ) ; Set < String > propIds = list == null ? null : new SessionInfo ( list ) . getSessionPropertyIds ( ) ; if ( propIds != null ) { for ( String propId : propIds ) { // If an attribute is already in appDataRemovals or appDataChanges , then the attribute was already retrieved from the cache . Skip retrieval from the cache here . if ( sess . appDataRemovals != null && sess . appDataRemovals . containsKey ( propId ) ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Found property " + propId + " in appDataRemovals, skipping query for this prop" ) ; continue ; } else if ( sess . appDataChanges != null && sess . appDataChanges . containsKey ( propId ) ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Found property " + propId + " in appDataChanges, skipping query for this prop" ) ; continue ; } String attributeKey = createSessionAttributeKey ( id , propId ) ; if ( trace && tc . isDebugEnabled ( ) ) tcInvoke ( tcSessionAttrCache , "get" , attributeKey ) ; byte [ ] b = sessionAttributeCache . get ( attributeKey ) ; if ( b == null ) { if ( trace && tc . isDebugEnabled ( ) ) tcReturn ( tcSessionAttrCache , "get" , "null" ) ; } else { Object value ; try { value = deserialize ( b ) ; readSize += b . length ; if ( trace && tc . isDebugEnabled ( ) ) if ( hideValues ) tcReturn ( tcSessionAttrCache , "get" , "byte[" + b . length + "]" ) ; else tcReturn ( tcSessionAttrCache , "get" , b , value ) ; } catch ( Exception x ) { if ( trace && tc . isDebugEnabled ( ) ) tcReturn ( tcSessionAttrCache , "get" , hideValues ? ( "byte[" + b . length + "]" ) : b ) ; FFDCFilter . processException ( x , getClass ( ) . getName ( ) , "91" , sess , new Object [ ] { hideValues ? "byte[" + b . length + "]" : TypeConversion . limitedBytesToString ( b ) } ) ; throw x ; } if ( value != null ) { h . put ( propId , value ) ; } } } } SessionStatistics pmiStats = _iStore . getSessionStatistics ( ) ; if ( pmiStats != null ) { pmiStats . readTimes ( readSize , TimeUnit . NANOSECONDS . toMillis ( System . nanoTime ( ) - startTime ) ) ; } } catch ( Exception ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.session.store.cache.CacheHashMap.getAllValues" , "448" , this , new Object [ ] { sess } ) ; Tr . error ( tc , "LOAD_VALUE_ERROR" , ex ) ; throw new RuntimeException ( Tr . formatMessage ( tc , "INTERNAL_SERVER_ERROR" ) ) ; } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getAllValues" , hideValues ? h . keySet ( ) : h ) ; return h ;
public class QueryController { /** * Get the current query as it is defined by the current { @ link QueryUIState } . * @ return */ public DisplayedResultQuery getSearchQuery ( ) { } }
return QueryGenerator . displayed ( ) . query ( state . getAql ( ) . getValue ( ) ) . corpora ( state . getSelectedCorpora ( ) . getValue ( ) ) . left ( state . getLeftContext ( ) . getValue ( ) ) . right ( state . getRightContext ( ) . getValue ( ) ) . segmentation ( state . getContextSegmentation ( ) . getValue ( ) ) . baseText ( state . getVisibleBaseText ( ) . getValue ( ) ) . limit ( state . getLimit ( ) . getValue ( ) ) . offset ( state . getOffset ( ) . getValue ( ) ) . order ( state . getOrder ( ) . getValue ( ) ) . selectedMatches ( state . getSelectedMatches ( ) . getValue ( ) ) . build ( ) ;
public class UtilImpl_InternMap { /** * Validate a string against a value type . Answer null if the string is * valid . Answer a message ID describing the validation failure if the * string is not valid for the value type . * @ return Null for a valid value ; a non - null message ID for a non - valid value . */ @ Trivial public static String doValidate ( String value , ValueType valueType ) { } }
String vMsg = null ; switch ( valueType ) { case VT_CLASS_RESOURCE : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( ! value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_EXPECTED_CLASS" ; } break ; case VT_CLASS_REFERENCE : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_CLASS_NAME : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . contains ( "/" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_FIELD_NAME : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . contains ( "/" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_METHOD_NAME : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . contains ( "/" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_OTHER : break ; default : vMsg = "ANNO_UTIL_UNRECOGNIZED_TYPE" ; break ; } return vMsg ;
public class DBFUtils { /** * Test if the data in the array is pure ASCII * @ param data data to check * @ return true if there are only ASCII characters */ public static boolean isPureAscii ( byte [ ] data ) { } }
if ( data == null ) { return false ; } for ( byte b : data ) { if ( b < 0x20 ) { return false ; } } return true ;
public class ModbusSlaveFactory { /** * Returns the running slave listening on the given serial port * @ param port Port to check for running slave * @ return Null or ModbusSlave */ public static ModbusSlave getSlave ( String port ) { } }
return ModbusUtil . isBlank ( port ) ? null : slaves . get ( port ) ;
public class RPUtils { /** * Get the search candidates as indices given the input * and similarity function * @ param x the input data to search with * @ param trees the trees to search * @ param similarityFunction the function to use for similarity * @ return the list of indices as the search results */ public static INDArray getAllCandidates ( INDArray x , List < RPTree > trees , String similarityFunction ) { } }
List < Integer > candidates = getCandidates ( x , trees , similarityFunction ) ; Collections . sort ( candidates ) ; int prevIdx = - 1 ; int idxCount = 0 ; List < Pair < Integer , Integer > > scores = new ArrayList < > ( ) ; for ( int i = 0 ; i < candidates . size ( ) ; i ++ ) { if ( candidates . get ( i ) == prevIdx ) { idxCount ++ ; } else if ( prevIdx != - 1 ) { scores . add ( Pair . of ( idxCount , prevIdx ) ) ; idxCount = 1 ; } prevIdx = i ; } scores . add ( Pair . of ( idxCount , prevIdx ) ) ; INDArray arr = Nd4j . create ( scores . size ( ) ) ; for ( int i = 0 ; i < scores . size ( ) ; i ++ ) { arr . putScalar ( i , scores . get ( i ) . getSecond ( ) ) ; } return arr ;
public class DescribeImageBuildersRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeImageBuildersRequest describeImageBuildersRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeImageBuildersRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeImageBuildersRequest . getNames ( ) , NAMES_BINDING ) ; protocolMarshaller . marshall ( describeImageBuildersRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeImageBuildersRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ByteBuddy { /** * Creates a new { @ link Annotation } type . Annotation properties are implemented as non - static , public methods with the * property type being defined as the return type . * < b > Note < / b > : Byte Buddy does not cache previous subclasses but will attempt the generation of a new subclass . For caching * types , a external cache or { @ link TypeCache } should be used . * @ return A type builder that creates a new { @ link Annotation } type . */ public DynamicType . Builder < ? extends Annotation > makeAnnotation ( ) { } }
return new SubclassDynamicTypeBuilder < Annotation > ( instrumentedTypeFactory . subclass ( namingStrategy . subclass ( TypeDescription . Generic . ANNOTATION ) , ModifierContributor . Resolver . of ( Visibility . PUBLIC , TypeManifestation . ANNOTATION ) . resolve ( ) , TypeDescription . Generic . OBJECT ) . withInterfaces ( new TypeList . Generic . Explicit ( TypeDescription . Generic . ANNOTATION ) ) , classFileVersion , auxiliaryTypeNamingStrategy , annotationValueFilterFactory , annotationRetention , implementationContextFactory , methodGraphCompiler , typeValidation , visibilityBridgeStrategy , classWriterStrategy , ignoredMethods , ConstructorStrategy . Default . NO_CONSTRUCTORS ) ;
public class NotificationManager { /** * Build the notification with the internal { @ link android . app . Notification . Builder } * @ return notification ready to be displayed . */ private Notification buildNotification ( ) { } }
Notification notification = mNotificationBuilder . build ( ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) { notification . bigContentView = mNotificationExpandedView ; } return notification ;
public class ClassInfo { /** * Get ClassInfo by type . * It search from cache , when failure build it and put it into cache . */ public static final ClassInfo get ( Class < ? > type ) { } }
ClassInfo exist = cache . get ( type ) ; if ( null != exist ) return exist ; synchronized ( cache ) { exist = cache . get ( type ) ; if ( null != exist ) return exist ; Set < MethodInfo > methods = CollectUtils . newHashSet ( ) ; Class < ? > nextClass = type ; int index = 0 ; Map < String , Class < ? > > nextParamTypes = null ; while ( null != nextClass && Object . class != nextClass ) { Method [ ] declaredMethods = nextClass . getDeclaredMethods ( ) ; for ( int i = 0 , n = declaredMethods . length ; i < n ; i ++ ) { Method method = declaredMethods [ i ] ; if ( ! goodMethod ( method ) ) continue ; Type [ ] types = method . getGenericParameterTypes ( ) ; Class < ? > [ ] paramsTypes = new Class < ? > [ types . length ] ; for ( int j = 0 ; j < types . length ; j ++ ) { Type t = types [ j ] ; if ( t instanceof ParameterizedType ) { paramsTypes [ j ] = ( Class < ? > ) ( ( ParameterizedType ) t ) . getRawType ( ) ; } else if ( t instanceof TypeVariable ) { paramsTypes [ j ] = nextParamTypes . get ( ( ( TypeVariable < ? > ) t ) . getName ( ) ) ; } else { paramsTypes [ j ] = ( Class < ? > ) t ; } if ( null == paramsTypes [ j ] ) paramsTypes [ j ] = Object . class ; } if ( ! methods . add ( new MethodInfo ( index ++ , method , paramsTypes ) ) ) index -- ; } Type nextType = nextClass . getGenericSuperclass ( ) ; nextClass = nextClass . getSuperclass ( ) ; if ( nextType instanceof ParameterizedType ) { Map < String , Class < ? > > tmp = CollectUtils . newHashMap ( ) ; Type [ ] ps = ( ( ParameterizedType ) nextType ) . getActualTypeArguments ( ) ; TypeVariable < ? > [ ] tvs = nextClass . getTypeParameters ( ) ; for ( int k = 0 ; k < ps . length ; k ++ ) { if ( ps [ k ] instanceof Class < ? > ) { tmp . put ( tvs [ k ] . getName ( ) , ( Class < ? > ) ps [ k ] ) ; } else if ( ps [ k ] instanceof TypeVariable ) { tmp . put ( tvs [ k ] . getName ( ) , nextParamTypes . get ( ( ( TypeVariable < ? > ) ps [ k ] ) . getName ( ) ) ) ; } } nextParamTypes = tmp ; } else { nextParamTypes = Collections . emptyMap ( ) ; } } exist = new ClassInfo ( methods ) ; cache . put ( type , exist ) ; return exist ; }
public class BugsnagSpringConfiguration { /** * If using Logback , stop any configured appender from creating Bugsnag reports for Spring log * messages as they effectively duplicate error reports for unhandled exceptions . */ @ PostConstruct @ SuppressWarnings ( "checkstyle:emptycatchblock" ) void excludeLoggers ( ) { } }
try { // Exclude Tomcat logger when processing HTTP requests via a servlet . // Regex specified to match the servlet variable parts of the logger name , e . g . // the Spring Boot default is : // [ Tomcat ] . [ localhost ] . [ / ] . [ dispatcherServlet ] // but could be something like : // [ Tomcat - 1 ] . [ 127.0.0.1 ] . [ / subdomain / ] . [ customDispatcher ] BugsnagAppender . addExcludedLoggerPattern ( "org.apache.catalina.core.ContainerBase." + "\\[Tomcat.*\\][.]\\[.*\\][.]\\[/.*\\][.]\\[.*\\]" ) ; // Exclude Jetty logger when processing HTTP requests via the HttpChannel BugsnagAppender . addExcludedLoggerPattern ( "org.eclipse.jetty.server.HttpChannel" ) ; // Exclude Undertow logger when processing HTTP requests BugsnagAppender . addExcludedLoggerPattern ( "io.undertow.request" ) ; } catch ( NoClassDefFoundError ignored ) { // logback was not in classpath , ignore throwable to allow further initialisation }
public class AvroUtils { /** * Given an avro Schema . Field instance , make a clone of it . * @ param field * The field to clone . * @ return The cloned field . */ public static Field cloneField ( Field field ) { } }
return new Field ( field . name ( ) , field . schema ( ) , field . doc ( ) , field . defaultValue ( ) ) ;
public class RepeatedRecordHandler { /** * { @ inheritDoc } */ @ Override public List < Record > signalShutdown ( ) { } }
List < Record > willReturn = new ArrayList < Record > ( ) ; flush ( current , willReturn ) ; return willReturn ;
public class ManageTagsDialog { /** * This method initializes jPanel * @ return javax . swing . JPanel */ private JPanel getJPanel ( ) { } }
if ( jPanel == null ) { GridBagConstraints gridBagConstraints00 = new GridBagConstraints ( ) ; GridBagConstraints gridBagConstraints10 = new GridBagConstraints ( ) ; GridBagConstraints gridBagConstraints11 = new GridBagConstraints ( ) ; GridBagConstraints gridBagConstraints20 = new GridBagConstraints ( ) ; GridBagConstraints gridBagConstraints30 = new GridBagConstraints ( ) ; GridBagConstraints gridBagConstraints31 = new GridBagConstraints ( ) ; GridBagConstraints gridBagConstraints40 = new GridBagConstraints ( ) ; GridBagConstraints gridBagConstraints41 = new GridBagConstraints ( ) ; jPanel = new JPanel ( ) ; jPanel . setLayout ( new GridBagLayout ( ) ) ; jPanel . setPreferredSize ( new java . awt . Dimension ( panelWidth , panelHeight ) ) ; jPanel . setMinimumSize ( new java . awt . Dimension ( panelWidth , panelHeight ) ) ; gridBagConstraints00 . gridy = 0 ; gridBagConstraints00 . gridx = 0 ; gridBagConstraints00 . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints00 . weightx = 1.0D ; gridBagConstraints00 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints10 . gridy = 1 ; gridBagConstraints10 . gridx = 0 ; gridBagConstraints10 . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints10 . weightx = 1.0D ; gridBagConstraints10 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints11 . gridy = 1 ; gridBagConstraints11 . gridx = 1 ; gridBagConstraints11 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints11 . anchor = java . awt . GridBagConstraints . EAST ; gridBagConstraints20 . gridy = 2 ; gridBagConstraints20 . gridx = 0 ; gridBagConstraints20 . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints20 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints30 . weightx = 1.0D ; gridBagConstraints30 . weighty = 1.0D ; gridBagConstraints30 . fill = java . awt . GridBagConstraints . BOTH ; gridBagConstraints30 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints30 . gridy = 3 ; gridBagConstraints30 . gridx = 0 ; gridBagConstraints30 . anchor = java . awt . GridBagConstraints . NORTHWEST ; gridBagConstraints30 . ipadx = 0 ; gridBagConstraints30 . ipady = 10 ; gridBagConstraints31 . gridy = 3 ; gridBagConstraints31 . gridx = 1 ; gridBagConstraints31 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints31 . anchor = java . awt . GridBagConstraints . NORTHEAST ; gridBagConstraints40 . gridy = 4 ; gridBagConstraints40 . gridx = 0 ; gridBagConstraints40 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints40 . anchor = java . awt . GridBagConstraints . EAST ; gridBagConstraints41 . gridy = 4 ; gridBagConstraints41 . gridx = 1 ; gridBagConstraints41 . insets = new java . awt . Insets ( 2 , 2 , 2 , 2 ) ; gridBagConstraints41 . anchor = java . awt . GridBagConstraints . EAST ; jPanel . add ( new JLabel ( Constant . messages . getString ( "history.managetags.label.addtag" ) ) , gridBagConstraints00 ) ; jPanel . add ( this . getTxtTagAdd ( ) , gridBagConstraints10 ) ; jPanel . add ( getBtnAdd ( ) , gridBagConstraints11 ) ; jPanel . add ( new JLabel ( Constant . messages . getString ( "history.managetags.label.currenttags" ) ) , gridBagConstraints20 ) ; jPanel . add ( getJScrollPane ( ) , gridBagConstraints30 ) ; jPanel . add ( getBtnDelete ( ) , gridBagConstraints31 ) ; jPanel . add ( getBtnCancel ( ) , gridBagConstraints40 ) ; jPanel . add ( getBtnSave ( ) , gridBagConstraints41 ) ; } return jPanel ;
public class DeviceImpl { public AttributeConfig_2 [ ] get_attribute_config_2 ( final String [ ] names ) throws DevFailed , SystemException { } }
Util . out4 . println ( "Device_2Impl.get_attribute_config_2 arrived" ) ; // Allocate memory for the AttributeConfig structures int nb_attr = names . length ; boolean all_attr = false ; // Record operation request in black box blackbox . insert_op ( Op_Get_Attr_Config_2 ) ; // Get attribute number final int nb_dev_attr = dev_attr . get_attr_nb ( ) ; // Check if the caller want to get config for all attribute final String in_name = names [ 0 ] ; if ( nb_attr == 1 && in_name . equals ( Tango_AllAttr ) ) { nb_attr = nb_dev_attr ; all_attr = true ; } final AttributeConfig_2 [ ] back = new AttributeConfig_2 [ nb_attr ] ; // Fill in these structures for ( int i = 0 ; i < nb_attr ; i ++ ) { if ( all_attr == true ) { final Attribute attr = dev_attr . get_attr_by_ind ( i ) ; back [ i ] = attr . get_properties_2 ( ) ; } else { final Attribute attr = dev_attr . get_attr_by_name ( names [ i ] ) ; back [ i ] = attr . get_properties_2 ( ) ; } } Util . out4 . println ( "Leaving Device_2Impl.get_attribute_config_2" ) ; return back ;
public class ElmBaseClinicalVisitor { /** * Visit a BinaryExpression . This method will be called for * every node in the tree that is a BinaryExpression . * @ param elm the ELM tree * @ param context the context passed to the visitor * @ return the visitor result */ @ Override public T visitBinaryExpression ( BinaryExpression elm , C context ) { } }
if ( elm instanceof CalculateAgeAt ) return visitCalculateAgeAt ( ( CalculateAgeAt ) elm , context ) ; else return super . visitBinaryExpression ( elm , context ) ;
public class ExecuteMethodValidatorChecker { public void checkLonelyValidatorAnnotation ( Field field , Map < String , Class < ? > > genericMap ) { } }
doCheckLonelyValidatorAnnotation ( field , deriveFieldType ( field , genericMap ) ) ;
public class StreamingGeometryGenerator { /** * TODO add color ? ? */ int hash ( ByteBuffer indices , ByteBuffer vertices , ByteBuffer normals , ByteBuffer colors ) { } }
int hashCode = 0 ; hashCode += indices . hashCode ( ) ; hashCode += vertices . hashCode ( ) ; hashCode += normals . hashCode ( ) ; hashCode += colors . hashCode ( ) ; return hashCode ;