idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
36,300 | protected int position ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "position" , this ) ; int position = _absolutePosition + _buffer . position ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "position" , new Integer ( position ) ) ; return position ; } | Returns the position of the byte cursor for the mapped byte buffer . |
36,301 | protected void position ( int newPosition ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "position" , new Object [ ] { this , new Integer ( newPosition ) } ) ; newPosition -= _absolutePosition ; _buffer . position ( newPosition ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "position" ) ; } | Sets the position of the byte cursor for the mapped byte buffer . |
36,302 | protected void advancePosition ( int bytes ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "advancePosition" , new Object [ ] { this , new Integer ( bytes ) } ) ; final int newPosition = _buffer . position ( ) + bytes ; _buffer . position ( newPosition ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Buffer's... | Moves the current byte cursor position for the mapped byte buffer forwards . |
36,303 | protected void get ( byte [ ] bytes ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "get" , new Object [ ] { this , new Integer ( bytes . length ) } ) ; _buffer . get ( bytes ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , RLSUtils . toHexString ( bytes , RLSUtils . MAX_DISPLAY_BYTES ) ) ; if ( tc . isEntryEn... | Getter method used to read bytes . length bytes from the mapped byte buffer at the current byte cursor position into the supplied byte array . The byte cursor is advanced by bytes . length . |
36,304 | protected int getInt ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getInt" , this ) ; int data = _buffer . getInt ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getInt" , new Integer ( data ) ) ; return data ; } | Getter method used to read an integer from the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of an integer . |
36,305 | protected long getLong ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getLong" , this ) ; long data = _buffer . getLong ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getLong" , new Long ( data ) ) ; return data ; } | Getter method used to a long from the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of a long . |
36,306 | protected short getShort ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getShort" , this ) ; short data = _buffer . getShort ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getShort" , new Short ( data ) ) ; return data ; } | Getter method used to a short from the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of a short . |
36,307 | protected boolean getBoolean ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getBoolean" , this ) ; byte dataByte = _buffer . get ( ) ; boolean data = ( dataByte == TRUE ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getBoolean" , new Boolean ( data ) ) ; return data ; } | Getter method used to a boolean from the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of a boolean . |
36,308 | private Object readItem ( ) { Object itemRead = null ; try { currentChunkStatus . incrementItemsTouchedInCurrentChunk ( ) ; for ( ItemReadListenerProxy readListenerProxy : itemReadListeners ) { readListenerProxy . beforeRead ( ) ; } itemRead = readerProxy . readItem ( ) ; for ( ItemReadListenerProxy readListenerProxy :... | Reads an item from the reader |
36,309 | private void publishCheckpointEvent ( String stepName , long jobInstanceId , long jobExecutionId , long stepExecutionId ) { BatchEventsPublisher publisher = getBatchEventsPublisher ( ) ; if ( publisher != null ) { String correlationId = runtimeWorkUnitExecution . getCorrelationId ( ) ; publisher . publishCheckpointEven... | Helper method to publish checkpoint event |
36,310 | 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 . |
36,311 | 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 . |
36,312 | 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 . |
36,313 | 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 |
36,314 | 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 . |
36,315 | 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 |
36,316 | 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 |
36,317 | 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 . |
36,318 | 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 |
36,319 | 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 . |
36,320 | 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 |
36,321 | 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 . |
36,322 | 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 . |
36,323 | 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 |
36,324 | 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 |
36,325 | 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 . |
36,326 | 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 . |
36,327 | 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 . |
36,328 | 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 . |
36,329 | 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 . |
36,330 | 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 . |
36,331 | 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 . |
36,332 | 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 . |
36,333 | 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 . |
36,334 | 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 . |
36,335 | 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 . |
36,336 | 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 |
36,337 | private void pessimisticFind ( SearchComparator comp , Object searchKey , SearchNode point ) { point . reset ( ) ; synchronized ( this ) { internalFind ( comp , searchKey , point ) ; _pessimisticFinds ++ ; } } | Pessimistic find in a GBS Tree |
36,338 | 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 . |
36,339 | 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 . |
36,340 | 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 . |
36,341 | 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 . |
36,342 | 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 . |
36,343 | 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 . |
36,344 | 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 . |
36,345 | 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 . |
36,346 | 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 . |
36,347 | 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 . |
36,348 | 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 . |
36,349 | 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 . |
36,350 | 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 . |
36,351 | 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 . |
36,352 | 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 . |
36,353 | 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 . |
36,354 | 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 . |
36,355 | 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 . |
36,356 | 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 . |
36,357 | 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 . |
36,358 | 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 . |
36,359 | 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 . |
36,360 | 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 . |
36,361 | 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 . |
36,362 | 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 . |
36,363 | 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 . |
36,364 | 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 . |
36,365 | 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 . |
36,366 | 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 . |
36,367 | 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 . |
36,368 | 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 . |
36,369 | public static ThreadContextDescriptor deserialize ( byte [ ] bytes , Map < String , String > execProps ) throws ClassNotFoundException , IOException { return new ThreadContextDescriptorImpl ( execProps , bytes ) ; } | Deserializes a thread context descriptor . |
36,370 | 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 |
36,371 | 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 |
36,372 | 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 |
36,373 | 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 . |
36,374 | 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 . |
36,375 | 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 . |
36,376 | 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 |
36,377 | 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 . |
36,378 | 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 . |
36,379 | 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 . |
36,380 | 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 . |
36,381 | 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 . |
36,382 | 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 . |
36,383 | 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 . |
36,384 | 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 |
36,385 | 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 |
36,386 | @ 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 |
36,387 | 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 . |
36,388 | 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 . |
36,389 | 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 . |
36,390 | 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 . |
36,391 | 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 . |
36,392 | 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 . |
36,393 | 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 . |
36,394 | 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 . |
36,395 | 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 . |
36,396 | 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 . |
36,397 | 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 . |
36,398 | 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 . |
36,399 | 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 . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.