idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
160,000
private int initStepTransactionTimeout ( ) { logger . entering ( sourceClass , "initStepTransactionTimeout" ) ; Properties p = runtimeStepExecution . getProperties ( ) ; int timeout = DEFAULT_TRAN_TIMEOUT_SECONDS ; if ( p != null && ! p . isEmpty ( ) ) { String propertyTimeOut = p . getProperty ( "javax.transaction.glo...
Note we can rely on the StepContext properties already having been set at this point .
160,001
private static String replaceWhitespace ( String value ) { final int length = value . length ( ) ; for ( int i = 0 ; i < length ; ++ i ) { char c = value . charAt ( i ) ; if ( c < 0x20 && ( c == 0x9 || c == 0xA || c == 0xD ) ) { return replace0 ( value , i , length ) ; } } return value ; }
Replaces all occurrences of 0x9 0xA and 0xD with 0x20 .
160,002
private void setMessagingEngineUuid ( SIBUuid8 uuid ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setMessagingEngineUuid" , new Object [ ] { uuid } ) ; messagingEngineUuid = uuid ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setMessagingEngineUuid" ) ; }
Set the messagingEngineUuid .
160,003
public static Map < String , List < Map < String , Object > > > nest ( Map < String , Object > map , String ... keys ) { Map < String , List < Map < String , Object > > > result = new HashMap < String , List < Map < String , Object > > > ( keys . length ) ; String keyMatch = "" ; for ( String key : keys ) { result . pu...
Extracts all sub configurations starting with any of the specified keys
160,004
private static String getUserHome ( ) { String home ; if ( platformType == SelfExtractUtils . PlatformType_CYGWIN ) { home = System . getenv ( "HOME" ) ; } else { home = System . getProperty ( "user.home" ) ; } return home ; }
Determine user home based on platform type . Java user . home property is correct in all cases except for cygwin . For cygwin user . home is Windows home so use HOME env var instead .
160,005
private static String createIfNeeded ( String dir ) { File f = new File ( dir ) ; if ( f . exists ( ) ) { return dir ; } else { boolean success = f . mkdirs ( ) ; if ( success ) return dir ; else return null ; } }
Create input directory if it does not exist
160,006
private static String jarFileName ( ) { createExtractor ( ) ; String fullyQualifiedFileName = extractor . container . getName ( ) ; int lastSeparator = fullyQualifiedFileName . lastIndexOf ( File . separatorChar ) ; String simpleFileName = fullyQualifiedFileName . substring ( lastSeparator + 1 ) ; int dotIdx = simpleFi...
Return jar file name from input archive
160,007
private static void disable2PC ( String extractDirectory , String serverName ) throws IOException { String fileName = extractDirectory + File . separator + "wlp" + File . separator + "usr" + File . separator + "servers" + File . separator + serverName + File . separator + "jvm.options" ; BufferedReader br = null ; Buff...
Write property into jvm . options to disable 2PC transactions . 2PC transactions are disabled by default because default transaction log is stored in extract directory and therefore foils transaction recovery if the server terminates unexpectedly .
160,008
private static int runServer ( String extractDirectory , String serverName , String [ ] args ) throws IOException , InterruptedException { int rc = 0 ; Runtime rt = Runtime . getRuntime ( ) ; String action = "run" ; if ( System . getenv ( "WLP_JAR_DEBUG" ) != null ) action = "debug" ; if ( System . getenv ( "WLP_JAR_EN...
Run server extracted from jar If environment variable WLP_JAR_DEBUG is set use server debug instead
160,009
private void isInitialized ( boolean condition , String propName ) { if ( condition == true ) { IllegalStateException e = new IllegalStateException ( "J2CGlobalConfigProperties: internal error. Set once property already set." ) ; Tr . error ( tc , "SET_ONCE_PROP_ALREADY_SET_J2CA0159" , ( Object ) null ) ; throw e ; } ...
Utility method for set once methods .
160,010
public synchronized final void applyRequestGroupConfigChanges ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "applyRequestGroupConfigChanges" ) ; changeSupport . firePropertyChange ( "applyRequestGroupConfigChanges" , false , true ) ; if ( TraceComponent . isAn...
Request Stat variable group
160,011
public Object get ( int key ) throws SIErrorException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "get" ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "key: " + key ) ; captiveComparitorKey . setValue ( key ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "captiveComparitorKey: " + captiveComp...
Retrives the object associated with a particular key from the map .
160,012
public Object remove ( int key ) throws SIErrorException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remove" , "" + key ) ; captiveComparitorKey . setValue ( key ) ; Object retObject = map . remove ( captiveComparitorKey ) ; if ( retObject == null ) { throw new SIErrorException ( nls . getFormattedMessage ( ...
Removes an object from the map .
160,013
public Iterator iterator ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "iterator" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "iterator" ) ; return map . values ( ) . iterator ( ) ; }
Returns an iterator with which to browse the values
160,014
public boolean containsKey ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "get" , "" + id ) ; captiveComparitorKey . setValue ( id ) ; final boolean result = map . containsKey ( captiveComparitorKey ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "get" , "" + result ) ; return result ; }
Determines if the specified id is present in the IdToObjectMap
160,015
public static Object checkCast ( Object value , Object object , String valueClassName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { ClassLoader valueLoader = value == null ? null : AccessController . doPrivileged ( new GetClassLoaderPrivileged ( value . getClass ( ) ) ) ; ClassLoader ...
Called by JIT - deployed code that is performing a checkcast . For the convenience of generated code the input value is returned directly .
160,016
GBSNode getNode ( Object newKey ) { GBSNode p ; if ( _nodePool == null ) p = new GBSNode ( this , newKey ) ; else { p = _nodePool ; _nodePool = p . rightChild ( ) ; p . reset ( newKey ) ; } return p ; }
Allocate a new node for the tree .
160,017
public void prePopulate ( int x ) { for ( int i = 0 ; i < x ; i ++ ) { GBSNode p = new GBSNode ( this ) ; releaseNode ( p ) ; } }
Add some number of free nodes to the node pool for testing .
160,018
public int maximumFringeImbalance ( ) { int maxBal ; GBSNode q = root ( ) ; if ( q . leftChild ( ) == null ) { maxBal = kFactor ( ) - 1 ; if ( maxBal < 3 ) maxBal = 3 ; } else { if ( ( kFactor ( ) % 3 ) == 0 ) maxBal = kFactor ( ) + 2 ; else maxBal = kFactor ( ) + 1 ; } return maxBal ; }
Return the maximum imbalance allowed for a fringe .
160,019
private int calcTZeroDepth ( int proposedK ) { int d = - 1 ; if ( ( proposedK >= 0 ) && ( proposedK < _t0_d . length ) ) d = _t0_d [ proposedK ] ; if ( d < 0 ) { String x = "K Factor (" + proposedK + ") is invalid.\n" + "Valid K factors are: " + kFactorString ( ) + "." ; throw new IllegalArgumentException ( x ) ; } ret...
Set the depth of a T0 sub - tree .
160,020
static boolean checkForPossibleIndexChange ( int v1 , int v2 , Throwable exc , String msg ) { if ( v1 != v2 ) return pessimisticNeeded ; else { GBSTreeException x = new GBSTreeException ( msg + ", v1 = " + v1 , exc ) ; throw x ; } }
Process an exception that may have occurred while the index was changing .
160,021
public Iterator iterator ( ) { GBSIterator x = new GBSIterator ( this ) ; Iterator q = ( Iterator ) x ; return q ; }
Create and return an Iterator positioned on the beginning of the tree .
160,022
public Object searchEqual ( Object searchKey ) { SearchComparator comp = searchComparator ( SearchComparator . EQ ) ; Object p = find ( comp , searchKey ) ; return p ; }
Find the first key in the index that is equal to the given key .
160,023
public Object searchGreater ( Object searchKey ) { SearchComparator comp = searchComparator ( SearchComparator . GT ) ; Object p = find ( comp , searchKey ) ; return p ; }
Find the first key in the index that is greater than the given key .
160,024
public Object searchGreaterOrEqual ( Object searchKey ) { SearchComparator comp = searchComparator ( SearchComparator . GE ) ; Object p = find ( comp , searchKey ) ; return p ; }
Find the first key in the index that is greater than or equal to the given key .
160,025
private SearchNode getSearchNode ( ) { Object x = _searchNode . get ( ) ; SearchNode g = null ; if ( x != null ) { g = ( SearchNode ) x ; g . reset ( ) ; } else { g = new SearchNode ( ) ; x = ( Object ) g ; _searchNode . set ( x ) ; } return g ; }
Find a SearchNode for use by the current thread .
160,026
private boolean optimisticFind ( SearchComparator comp , Object searchKey , SearchNode point ) { point . reset ( ) ; int v1 = _vno ; if ( root ( ) != null ) { if ( ( v1 & 1 ) != 0 ) return pessimisticNeeded ; synchronized ( point ) { } try { internalFind ( comp , searchKey , point ) ; } catch ( NullPointerException npe...
Optimistic find in a GBS Tree
160,027
private void pessimisticFind ( SearchComparator comp , Object searchKey , SearchNode point ) { point . reset ( ) ; synchronized ( this ) { internalFind ( comp , searchKey , point ) ; _pessimisticFinds ++ ; } }
Pessimistic find in a GBS Tree
160,028
synchronized Object iteratorFind ( DeleteStack stack , SearchComparator comp , Object searchKey , SearchNode point ) { point . reset ( ) ; GBSNode p = root ( ) ; GBSNode l = null ; GBSNode r = null ; int lx = 0 ; int rx = 0 ; Object ret = null ; stack . start ( dummyTopNode ( ) , "GBSTree.iteratorFind" ) ; while ( p !=...
Search the index from an Iterator .
160,029
private void leftSearch ( SearchComparator comp , GBSNode p , GBSNode r , Object searchKey , SearchNode point ) { if ( r == null ) { int idx = p . searchLeft ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) point . setFound ( p , idx ) ; } else { int xcc = comp . compare ( searchKey , r . rightMostKey ( ) ) ; if ( xcc == 0 ...
Search after falling off a left edge .
160,030
private void rightSearch ( SearchComparator comp , GBSNode p , GBSNode l , Object searchKey , SearchNode point ) { int xcc = comp . compare ( searchKey , p . rightMostKey ( ) ) ; if ( xcc == 0 ) point . setFound ( p , 0 ) ; else if ( xcc < 0 ) { int idx = p . searchRight ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) poin...
Search after falling off a right edge .
160,031
private InsertStack getInsertStack ( ) { Object x = _insertStack . get ( ) ; InsertStack g = null ; if ( x != null ) { g = ( InsertStack ) x ; g . reset ( ) ; } else { g = new InsertStack ( this ) ; x = ( Object ) g ; _insertStack . set ( x ) ; } return g ; }
Find an InsertStack for use by the current thread .
160,032
public boolean insert ( Object new1 ) { boolean result ; InsertStack stack = getInsertStack ( ) ; if ( root ( ) == null ) pessimisticInsert ( stack , new1 ) ; else { boolean didit = optimisticInsert ( stack , new1 ) ; if ( didit == pessimisticNeeded ) pessimisticInsert ( stack , new1 ) ; } if ( stack . isDuplicate ( ) ...
Insert into a GBS Tree .
160,033
private boolean optimisticInsert ( InsertStack stack , Object new1 ) { InsertNodes point = stack . insertNodes ( ) ; int v1 = _vno ; if ( root ( ) == null ) return pessimisticNeeded ; if ( ( v1 & 1 ) != 0 ) return pessimisticNeeded ; synchronized ( stack ) { } try { findInsert ( point , stack , new1 ) ; } catch ( NullP...
Optimistic insert into a GBS Tree .
160,034
private synchronized boolean pessimisticInsert ( InsertStack stack , Object new1 ) { _vno ++ ; if ( ( _vno & 1 ) == 1 ) { if ( root ( ) == null ) { addFirstNode ( new1 ) ; _population ++ ; } else { InsertNodes point = stack . insertNodes ( ) ; findInsert ( point , stack , new1 ) ; if ( point . isDuplicate ( ) ) stack ....
Pessimistic insert into a GBS Tree .
160,035
private void findInsert ( InsertNodes point , InsertStack stack , Object new1 ) { java . util . Comparator comp = insertComparator ( ) ; NodeInsertPoint ip = stack . nodeInsertPoint ( ) ; GBSNode p ; int xcc ; GBSNode l_last = null ; GBSNode r_last = null ; p = root ( ) ; stack . start ( dummyTopNode ( ) , "GBSTree.fin...
Find the insert point within the tree .
160,036
private void leftAdd ( GBSNode p , GBSNode r , Object new1 , NodeInsertPoint ip , InsertNodes point ) { if ( r == null ) leftAddNoPredecessor ( p , new1 , ip , point ) ; else leftAddWithPredecessor ( p , r , new1 , ip , point ) ; }
Add to predecssor or current .
160,037
private void leftAddNoPredecessor ( GBSNode p , Object new1 , NodeInsertPoint ip , InsertNodes point ) { p . findInsertPointInLeft ( new1 , ip ) ; point . setInsert ( p , ip ) ; }
Add to left side with no predecessor present .
160,038
private void leftAddWithPredecessor ( GBSNode p , GBSNode r , Object new1 , NodeInsertPoint ip , InsertNodes point ) { java . util . Comparator comp = r . insertComparator ( ) ; int xcc = comp . compare ( new1 , r . rightMostKey ( ) ) ; if ( xcc > 0 ) { p . findInsertPointInLeft ( new1 , ip ) ; point . setInsert ( p , ...
Add to left side with an upper predecessor present .
160,039
private void rightAdd ( GBSNode p , GBSNode l , Object new1 , NodeInsertPoint ip , InsertNodes point ) { if ( l == null ) rightAddNoSuccessor ( p , new1 , ip , point ) ; else rightAddWithSuccessor ( p , l , new1 , ip , point ) ; }
Add to current or successor .
160,040
private void rightAddNoSuccessor ( GBSNode p , Object new1 , NodeInsertPoint ip , InsertNodes point ) { if ( p . lessThanHalfFull ( ) ) point . setInsert ( p , p . rightMostIndex ( ) ) ; else { p . findInsertPointInRight ( new1 , ip ) ; point . setInsert ( p , ip ) ; } }
Add to right side with no upper successor present .
160,041
private void rightAddWithSuccessor ( GBSNode p , GBSNode l , Object new1 , NodeInsertPoint ip , InsertNodes point ) { java . util . Comparator comp = l . insertComparator ( ) ; int xcc = comp . compare ( new1 , l . leftMostKey ( ) ) ; if ( xcc < 0 ) { if ( p . lessThanHalfFull ( ) ) point . setInsert ( p , p . rightMos...
Add to right side with an upper successor present .
160,042
private void finishInsert ( InsertNodes point , InsertStack stack , Object new1 ) { Object insertKey = new1 ; if ( point . positionNode ( ) != null ) { GBSNode p = point . positionNode ( ) ; int ix = point . positionIndex ( ) ; if ( point . rightSide ( ) ) insertKey = p . insertByRightShift ( ix , insertKey ) ; else in...
Do the write phase of the insert .
160,043
private void insertFringeMigrate ( InsertStack stack , GBSNode p , Object mkey ) { GBSNode endp = p ; int endIndex = stack . index ( ) ; int maxBal = maximumFringeImbalance ( ) ; stack . setMigratingKey ( mkey ) ; if ( mkey != null ) { stack . processSubFringe ( p ) ; endp = stack . lastNode ( ) ; endIndex = stack . la...
Migrate a key from a partial leaf through to the proper place in its fringe adding a node to the right side of the fringe if necessary .
160,044
private void insertCheckFringeBalance ( InsertStack stack , GBSNode endp , int endIndex , int maxBal ) { GBSNode fpoint = null ; int fDepth = 0 ; int fpidx = 0 ; if ( ( endp . isFull ( ) ) && ( endp . leftChild ( ) == null ) ) { fDepth = 1 ; for ( int j = endIndex ; j > 0 ; j -- ) { GBSNode q = stack . node ( j ) ; if ...
Check to see if fringe balancing is necessary and do it if needed .
160,045
private DeleteStack getDeleteStack ( ) { Object x = _deleteStack . get ( ) ; DeleteStack g = null ; if ( x != null ) { g = ( DeleteStack ) x ; g . reset ( ) ; } else { g = new DeleteStack ( this ) ; x = ( Object ) g ; _deleteStack . set ( x ) ; } return g ; }
Find a DeleteStack for use by the current thread .
160,046
private boolean optimisticDelete ( DeleteStack stack , Object deleteKey ) { DeleteNode point = stack . deleteNode ( ) ; int v1 = _vno ; if ( ( v1 & 1 ) != 0 ) return pessimisticNeeded ; synchronized ( stack ) { } try { findDelete ( point , stack , deleteKey ) ; } catch ( NullPointerException npe ) { _nullPointerExcepti...
Optimistic delete from a GBS Tree .
160,047
void iteratorSpecialDelete ( Iterator iter , GBSNode node , int index ) { _vno ++ ; if ( ( _vno & 1 ) == 1 ) { node . deleteByLeftShift ( index ) ; node . adjustMedian ( ) ; _population -- ; } synchronized ( iter ) { } _vno ++ ; }
Allow an Iterator to delete an item by direct removal from a single node .
160,048
private void finishDelete ( DeleteNode point , DeleteStack stack , Object deleteKey ) { adjustTarget ( point ) ; point . deleteNode ( ) . deleteByLeftShift ( point . deleteIndex ( ) ) ; deleteFringeMigrate ( stack , point . deleteNode ( ) ) ; }
Do the write phase of the delete .
160,049
private void findDelete ( DeleteNode point , DeleteStack stack , Object deleteKey ) { java . util . Comparator comp = deleteComparator ( ) ; GBSNode p ; int xcc ; GBSNode l_last = null ; GBSNode r_last = null ; p = root ( ) ; stack . start ( dummyTopNode ( ) , "GBSTree.findDelete" ) ; while ( p != null ) { xcc = comp ....
Find the delete point within the tree .
160,050
private void midDelete ( DeleteStack stack , GBSNode p , DeleteNode point ) { point . setDelete ( p , p . middleIndex ( ) ) ; GBSNode q = p . lowerPredecessor ( stack ) ; if ( q != null ) { point . setDelete ( q , q . rightMostIndex ( ) ) ; point . setTarget ( p , p . middleIndex ( ) , DeleteNode . ADD_LEFT ) ; } else ...
Delete a key with an equal match .
160,051
private void leftDelete ( GBSNode p , GBSNode r , Object deleteKey , DeleteNode point ) { if ( r == null ) leftDeleteNoPredecessor ( p , deleteKey , point ) ; else leftDeleteWithPredecessor ( p , r , deleteKey , point ) ; }
Delete from current or predecessor .
160,052
private void leftDeleteNoPredecessor ( GBSNode p , Object deleteKey , DeleteNode point ) { int idx = p . findDeleteInLeft ( deleteKey ) ; if ( idx >= 0 ) point . setDelete ( p , idx ) ; }
Delete from left side with no upper predecessor .
160,053
private void leftDeleteWithPredecessor ( GBSNode p , GBSNode r , Object deleteKey , DeleteNode point ) { java . util . Comparator comp = p . deleteComparator ( ) ; int xcc = comp . compare ( deleteKey , r . rightMostKey ( ) ) ; if ( xcc == 0 ) { point . setDelete ( p , 0 ) ; point . setTarget ( r , r . rightMostIndex (...
Delete from left side with an upper predecessor present .
160,054
private void rightDelete ( GBSNode p , GBSNode l , Object deleteKey , DeleteNode point ) { if ( l == null ) rightDeleteNoSuccessor ( p , deleteKey , point ) ; else rightDeleteWithSuccessor ( p , l , deleteKey , point ) ; }
Delete from current or successor .
160,055
private void rightDeleteNoSuccessor ( GBSNode p , Object deleteKey , DeleteNode point ) { int idx = p . findDeleteInRight ( deleteKey ) ; if ( idx >= 0 ) point . setDelete ( p , idx ) ; }
Delete from right side with no successor .
160,056
private void rightDeleteWithSuccessor ( GBSNode p , GBSNode l , Object deleteKey , DeleteNode point ) { java . util . Comparator comp = p . deleteComparator ( ) ; int xcc = comp . compare ( deleteKey , l . leftMostKey ( ) ) ; if ( xcc == 0 ) { point . setDelete ( p , p . rightMostIndex ( ) ) ; point . setTarget ( l , 0...
Delete from right side with successor node present .
160,057
private void deleteFringeMigrate ( DeleteStack stack , GBSNode p ) { GBSNode endp = p ; int endIndex = stack . index ( ) ; stack . add ( 0 , p ) ; int maxBal = maximumFringeImbalance ( ) ; stack . processSubFringe ( p ) ; endp = stack . lastNode ( ) ; endIndex = stack . lastIndex ( ) ; deleteCheckFringeBalance ( stack ...
Migrate a hole from a partial leaf through to the proper place in its fringe deleting a node from the right side of the fringe if necessary .
160,058
private void deleteCheckFringeBalance ( DeleteStack stack , GBSNode endp , int endIndex , int maxBal ) { int fDepth = 0 ; fDepth = 0 ; if ( endp . leftChild ( ) == null ) { fDepth = 1 ; for ( int j = endIndex ; j > 0 ; j -- ) { GBSNode q = stack . node ( j ) ; if ( q . leftChild ( ) == null ) fDepth ++ ; else break ; }...
Check to see if fringe balancing is required following a delete and do the fringe rebalancing if needed .
160,059
public static ThreadContextDescriptor deserialize ( byte [ ] bytes , Map < String , String > execProps ) throws ClassNotFoundException , IOException { return new ThreadContextDescriptorImpl ( execProps , bytes ) ; }
Deserializes a thread context descriptor .
160,060
public static File [ ] listFiles ( final File target , final List < Pattern > patterns , final boolean include ) { if ( patterns == null || patterns . isEmpty ( ) ) return target . listFiles ( ) ; return target . listFiles ( new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { for ( Pattern patte...
List files according to the patterns and the pattern type
160,061
public static void copyFile ( File dest , File source ) throws IOException { InputStream input = null ; try { input = new FileInputStream ( source ) ; createFile ( dest , input ) ; } finally { Utils . tryToClose ( input ) ; } }
Copy from one file to the other
160,062
public static void createFile ( final File dest , final InputStream sourceInput ) throws IOException { if ( sourceInput == null || dest == null ) return ; FileOutputStream fos = null ; try { if ( ! dest . getParentFile ( ) . exists ( ) ) { if ( ! dest . getParentFile ( ) . mkdirs ( ) ) { throw new FileNotFoundException...
Read the content from an inputStream and write out to the other file
160,063
public static void copyDir ( File from , File to ) throws FileNotFoundException , IOException { File [ ] files = from . listFiles ( ) ; if ( files != null ) { for ( File ff : files ) { File tf = new File ( to , ff . getName ( ) ) ; if ( ff . isDirectory ( ) ) { if ( tf . mkdir ( ) ) { copyDir ( ff , tf ) ; } } else if ...
Recursively copy the files from one dir to the other .
160,064
public static boolean isUnderDirectory ( File child , File parent ) { if ( child == null || parent == null ) return false ; URI childUri = child . toURI ( ) ; URI relativeUri = parent . toURI ( ) . relativize ( childUri ) ; return relativeUri . equals ( childUri ) ? false : true ; }
If child is under parent will return true otherwise return false .
160,065
public static String normalizeEntryPath ( String entryPath ) { if ( entryPath == null || entryPath . isEmpty ( ) ) return "" ; entryPath = entryPath . replace ( "\\" , "/" ) ; if ( entryPath . startsWith ( "/" ) ) { if ( entryPath . length ( ) == 1 ) { entryPath = "" ; } else { entryPath = entryPath . substring ( 1 , e...
Normalize a relative entry path so that it can be used in an archive .
160,066
public static String normalizeDirPath ( String dirPath ) { if ( dirPath == null || dirPath . isEmpty ( ) ) return "" ; dirPath = dirPath . replace ( "\\" , "/" ) ; if ( ! dirPath . endsWith ( "/" ) ) { dirPath = dirPath + "/" ; } return dirPath ; }
Normalize a path that represents a directory
160,067
private static final boolean contains ( Collection < String > list , String value ) { for ( String item : list ) if ( item . contains ( value ) ) return true ; return false ; }
Utility method that determines if some text is found as a substring within the contents of a list .
160,068
static String getConnectionPoolDataSourceClassName ( String vendorPropertiesPID ) { String [ ] classNames = classNamesByPID . get ( vendorPropertiesPID ) ; return classNames == null ? null : classNames [ 1 ] ; }
Infer the vendor implementation class name for javax . sql . ConnectionPoolDataSource based on the PID of the vendor properties . A best effort is made for the known vendors .
160,069
static String getDataSourceClassName ( Collection < String > fileNames ) { for ( Map . Entry < String , String [ ] > entry : classNamesByKey . entrySet ( ) ) if ( contains ( fileNames , entry . getKey ( ) ) ) { String [ ] classNames = entry . getValue ( ) ; return classNames == null ? null : classNames [ 0 ] ; } return...
Infer the vendor implementation class name for javax . sql . DataSource based on the JAR or ZIP names . A best effort is made for the known vendors .
160,070
static String getDataSourceClassName ( String vendorPropertiesPID ) { String [ ] classNames = classNamesByPID . get ( vendorPropertiesPID ) ; return classNames == null ? null : classNames [ 0 ] ; }
Infer the vendor implementation class name for javax . sql . DataSource based on the PID of the vendor properties . A best effort is made for the known vendors .
160,071
static String getXADataSourceClassName ( String vendorPropertiesPID ) { String [ ] classNames = classNamesByPID . get ( vendorPropertiesPID ) ; return classNames == null ? null : classNames [ 2 ] ; }
Infer the vendor implementation class name for javax . sql . XADataSource based on the PID of the vendor properties . A best effort is made for the known vendors .
160,072
private static String tryToLoad ( Class < ? > type , ClassLoader loader , String ... classNames ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; for ( String className : classNames ) try { Class < ? > c = loader . loadClass ( className ) ; boolean isInstance = type . isAssignableFrom ( c ) ; if ( tr...
Attempt to load the specified class names returning the first that successfully loads and is an instance of the specified type .
160,073
protected final String [ ] getAttributes ( String key ) { ArrayList < String > array = this . _attributes . get ( key ) ; if ( array != null && array . size ( ) > 0 ) { String [ ] type = new String [ array . size ( ) ] ; return array . toArray ( type ) ; } return null ; }
Get the attribute value based on the named value . A string array is returned containing all values of the attribute previously set .
160,074
public Object handleOperation ( String operation , Object [ ] params ) throws IOException { if ( OPERATION_DOWNLOAD . equals ( operation ) ) { if ( params . length == 2 ) { downloadFile ( ( String ) params [ 0 ] , ( String ) params [ 1 ] ) ; } else { return downloadFile ( ( String ) params [ 0 ] , ( String ) params [ 1...
Handle MBean invocation requests
160,075
public long read ( long numBytes , int timeout ) throws IOException { long readCount = 0 ; H2StreamProcessor p = muxLink . getStreamProcessor ( streamID ) ; try { p . getReadLatch ( ) . await ( timeout , TimeUnit . MILLISECONDS ) ; readCount = p . readCount ( numBytes , this . getBuffers ( ) ) ; } catch ( InterruptedEx...
Get bytes from the stream processor associated with this read context
160,076
@ FFDCIgnore ( PrivilegedActionException . class ) private String getConfigNameForRef ( final String ref ) { String name = null ; if ( ref != null ) { final ConfigurationAdmin configAdmin = configAdminRef . getService ( ) ; Configuration config ; try { config = AccessController . doPrivileged ( new PrivilegedExceptionA...
Use the config admin service to get the name for a given service reference
160,077
public static synchronized void addConfig ( String id , String uri , Map < String , String > params ) { uriMap . put ( id , uri ) ; configInfo . put ( uri , params ) ; resolvedConfigInfo . clear ( ) ; if ( uri . endsWith ( "*" ) ) { wildcardsPresentInConfigInfo = true ; } }
add a configuration for a URL We d like a set of hashmaps keyed by URL however when osgi calls deactivate we have no arguments so we have to associate a url with the object id of the service . That allows us to remove the right one .
160,078
public String generateSessionId ( ) { byte random [ ] = new byte [ 16 ] ; StringBuilder buffer = new StringBuilder ( ) ; int resultLenBytes = 0 ; while ( resultLenBytes < sessionIdLength ) { getRandomBytes ( random ) ; for ( int j = 0 ; j < random . length && resultLenBytes < sessionIdLength ; j ++ ) { byte b1 = ( byte...
Generate and return a new session identifier .
160,079
public boolean containsKey ( Object key ) { FastHashtableEntry tab [ ] = table ; int hash = key . hashCode ( ) ; int index = ( hash & 0x7FFFFFFF ) % tab . length ; for ( FastHashtableEntry e = tab [ index ] ; e != null ; e = e . next ) { if ( ( e . hash == hash ) && e . key . equals ( key ) ) { return true ; } } return...
Tests if the specified object is a key in this hashtable .
160,080
private boolean ableToFilter ( ) { if ( filter == null ) return false ; for ( int i = table . length ; i -- > 0 ; ) { FastHashtableEntry newContents = null , next = null ; for ( FastHashtableEntry e = table [ i ] ; e != null ; e = next ) { next = e . next ; if ( filter . shouldRetain ( e . key , e . value ) ) { e . nex...
Avoids the need to rehash when some entries can be filtered out of the Hashtable by an upcall to a separate decision routine .
160,081
private void readObject ( java . io . ObjectInputStream s ) throws IOException , ClassNotFoundException { s . defaultReadObject ( ) ; int origlength = s . readInt ( ) ; int elements = s . readInt ( ) ; int length = ( int ) ( elements * loadFactor ) + ( elements / 20 ) + 3 ; if ( length > elements && ( length & 1 ) == 0...
readObject is called to restore the state of the hashtable from a stream . Only the keys and values are serialized since the hash values may be different when the contents are restored . Read count elements and insert into the hashtable .
160,082
public boolean getBooleanProperty ( String propertyName ) { boolean booleanValue = false ; Object objectValue = this . properties . get ( propertyName ) ; if ( objectValue != null ) { if ( objectValue instanceof Boolean ) { booleanValue = ( ( Boolean ) objectValue ) . booleanValue ( ) ; } else if ( objectValue instance...
Query the boolean property value of the input name .
160,083
public String getStringProperty ( String propertyName ) { Object value = this . properties . get ( propertyName ) ; if ( null != value && value instanceof String ) { return ( String ) value ; } return null ; }
Query the properties for the input name the value will be null if not found or was not a String object .
160,084
private boolean getBooleanProperty ( String key , String defaultValue , StringBuilder errors ) { boolean booleanValue = false ; String stringValue = null ; boolean valueCorrect = false ; Object objectValue = this . properties . get ( key ) ; if ( objectValue != null ) { if ( objectValue instanceof Boolean ) { booleanVa...
Extract String value from property list and convert to boolean .
160,085
private int getIntProperty ( String key , boolean defaultProvided , int defaultValue , StringBuilder errors ) { String value = getStringProperty ( key ) ; if ( null != value ) { try { int realValue = Integer . parseInt ( value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug (...
Extract an integer property from the stored values . This might use a default value if provided and the property was not found .
160,086
public synchronized void lockExclusive ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "lockExclusive" , this ) ; boolean interrupted = false ; while ( ! tryLockExclusive ( ) ) { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) )...
This method locks the mutex so no other lockers can get the lock .
160,087
public int getLocalBusinessInterfaceIndex ( String interfaceName ) { if ( ivBusinessLocalInterfaceClasses != null ) { for ( int i = 0 ; i < ivBusinessLocalInterfaceClasses . length ; i ++ ) { String bInterfaceName = ivBusinessLocalInterfaceClasses [ i ] . getName ( ) ; if ( bInterfaceName . equals ( interfaceName ) ) {...
Gets the index of the local business interface .
160,088
public int getRequiredLocalBusinessInterfaceIndex ( String interfaceName ) throws IllegalStateException { int interfaceIndex = getLocalBusinessInterfaceIndex ( interfaceName ) ; if ( interfaceIndex == - 1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getRequiredLocalB...
Gets the index of the local busines interface . This method will throw an IllegalStateException if a local interface could not be matched . If it is known that a match must occur on a local business interface then this method should be used .
160,089
public int getRemoteBusinessInterfaceIndex ( String interfaceName ) { if ( ivBusinessRemoteInterfaceClasses != null ) { for ( int i = 0 ; i < ivBusinessRemoteInterfaceClasses . length ; i ++ ) { String bInterface = ivBusinessRemoteInterfaceClasses [ i ] . getName ( ) ; if ( bInterface . equals ( interfaceName ) ) { if ...
Gets the index of the remote business interface .
160,090
public int getRequiredRemoteBusinessInterfaceIndex ( String interfaceName ) throws IllegalStateException { int interfaceIndex = getRemoteBusinessInterfaceIndex ( interfaceName ) ; if ( interfaceIndex == - 1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getRequiredRemo...
Gets the index of the remote busines interface . This method will throw an IllegalStateException if a remte interface could not be matched . If it is known that a match must occur on a remote business interface then this method should be used .
160,091
public String [ ] [ ] getMethodLevelCustomFinderMethodSignatures ( String cfprocessstring ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getMethodLevelCustomFinderMethodSignatures:" + cfprocessstring ) ; StringTokenizer st = new StringTokenizer ( cfprocessstring , ":" ...
d112604 . 1
160,092
public JsMessage transcribeToJmf ( ) throws MessageCopyFailedException , IncorrectMessageTypeException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "transcribeToJmf" ) ; JsMsgObject newJmo = null ; try { if ( this instanceof JsJm...
Transcribe this message to pure JMF
160,093
public int getApproximateLength ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getApproximateLength" ) ; if ( approxLength == - 1 ) approxLength = guessApproxLength ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exi...
Return an approximate size for the flattened message . It is important that this method is quick and cheap rather than highly accurate .
160,094
private final JsMessageImpl createNew ( ) throws MessageCopyFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createNew" ) ; JsMessageImpl newMsg = null ; Class msgClass = this . getClass ( ) ; try { newMsg = ( JsMessageImpl ) msgClass . newInstanc...
Return a new Jsmessage of the same specialization as this containing the given JsMsgObject .
160,095
private final JsMessageImpl createNewGeneralized ( JsMsgObject newJmo ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createNewGeneralized" ) ; JsMessageImpl newMsg = null ; newMsg = new JsMessageImpl ( newJmo ) ; if ( TraceComponent . isAnyTracingEnabled ( ) ...
Return a new JsMessage generalizing the message to just be a JsMessageImpl . The new message contains the given JsMsgObject .
160,096
@ SuppressWarnings ( "rawtypes" ) public static Hashtable parsePostData ( ServletInputStream in , String encoding , boolean multireadPropertyEnabled ) throws IOException { int inputLen ; byte [ ] postedBytes = null ; String postedBody ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . i...
begin 231634 Support posts with query parms in chunked body WAS . webcontainer
160,097
public final Item findOldestItem ( ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findOldestItem" ) ; ItemCollection ic = ( ( ItemCollection ) _getMembership ( ) ) ; if ( null == ic ) { if ( TraceComponent . isAnyTracingEnabled ( ...
Find the item that has been known to the stream for longest . The item returned may be in any of the states defined in the state model . The caller should not assume that the item can be used for any particular purpose .
160,098
protected void abort ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Aborting connection" ) ; } this . aborted = true ; }
Abort this context to trigger immediate exceptions on future IO requests .
160,099
protected void setTimeoutTime ( int time ) { int timeout = time ; if ( timeout == TCPRequestContext . NO_TIMEOUT ) { this . timeoutTime = TCPRequestContext . NO_TIMEOUT ; this . timeoutInterval = 0 ; } else { if ( timeout == TCPRequestContext . USE_CHANNEL_TIMEOUT ) { timeout = getConfig ( ) . getInactivityTimeout ( ) ...
Sets the timeout value returned by getTimeoutTime .