idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
159,600
private static String convertToAbsoluteUrlIfNeeded ( String conduitName , String lastURL , String newURL , Message message ) throws IOException { if ( newURL != null && ! newURL . startsWith ( "http" ) ) { if ( MessageUtils . isTrue ( message . getContextualProperty ( AUTO_REDIRECT_ALLOW_REL_URI ) ) ) { return URI . cr...
Relative Location values are also supported
165
7
159,601
private void resumeTran ( Transaction tran ) { if ( tran != null ) { try { tranMgr . resume ( tran ) ; } catch ( Exception e ) { throw new BatchRuntimeException ( "Failed to resume transaction after JobOperator method" , e ) ; } } }
Resume the given tran .
65
7
159,602
private void addAndSortReaders ( List < ProviderInfo < MessageBodyReader < ? > > > newReaders , boolean forceSort ) { Comparator < ProviderInfo < MessageBodyReader < ? > > > comparator = null ; if ( ! customComparatorAvailable ( MessageBodyReader . class ) ) { comparator = new MessageBodyReaderComparator ( readerMediaT...
Liberty code change start
104
5
159,603
private static Type [ ] getGenericInterfaces ( Class < ? > cls , Class < ? > expectedClass , Class < ? > commonBaseCls ) { if ( Object . class == cls ) { return emptyType ; } Type [ ] cachedTypes = getTypes ( cls , expectedClass , commonBaseCls ) ; if ( cachedTypes != null ) return cachedTypes ; if ( expectedClass != n...
Add the result to cache before return
387
7
159,604
void onCompletion ( Collection < ApplicationDependency > dependencies ) { if ( ! dependencies . isEmpty ( ) ) { for ( ApplicationDependency dependency : dependencies ) { dependency . onCompletion ( this ) ; } } }
final Field Semantics .
49
5
159,605
@ Override public boolean hasObjectWithPrefix ( JavaColonNamespace namespace , String name ) throws NamingException { JavaColonNamespaceBindings < EJBBinding > bindings ; boolean result = false ; Lock readLock = null ; ComponentMetaData cmd = null ; try { // This helper only provides support for java:global, java:app, ...
can suppress warning - if cmd is null NamingException will be thrown by getComponentMetaData
365
19
159,606
public void removeGlobalBindings ( List < String > names ) { Lock writeLock = javaColonLock . writeLock ( ) ; writeLock . lock ( ) ; try { for ( String name : names ) { javaColonGlobalBindings . unbind ( name ) ; } } finally { writeLock . unlock ( ) ; } }
Remove names from the global mapping .
71
7
159,607
private JavaColonNamespaceBindings < EJBBinding > getAppBindingMap ( ApplicationMetaData amd ) { @ SuppressWarnings ( "unchecked" ) JavaColonNamespaceBindings < EJBBinding > bindingMap = ( JavaColonNamespaceBindings < EJBBinding > ) amd . getMetaData ( amdSlot ) ; if ( bindingMap == null ) { bindingMap = new JavaColonN...
Get the EJBBinding map from the application meta data . Initialize if it is null .
140
20
159,608
private JavaColonNamespaceBindings < EJBBinding > getModuleBindingMap ( ModuleMetaData mmd ) { @ SuppressWarnings ( "unchecked" ) JavaColonNamespaceBindings < EJBBinding > bindingMap = ( JavaColonNamespaceBindings < EJBBinding > ) mmd . getMetaData ( mmdSlot ) ; if ( bindingMap == null ) { bindingMap = new JavaColonNam...
Get the EJBBinding map from the module meta data . Initialize if it is null .
145
20
159,609
public void removeAppBindings ( ModuleMetaData mmd , List < String > names ) { ApplicationMetaData amd = mmd . getApplicationMetaData ( ) ; Lock writeLock = javaColonLock . writeLock ( ) ; writeLock . lock ( ) ; try { JavaColonNamespaceBindings < EJBBinding > bindings = getAppBindingMap ( amd ) ; // getAppBindings retu...
Remove names from the application mapping . If all the bindings have been removed for an application remove the application mapping .
122
22
159,610
private void throwCannotInstanciateUnsupported ( EJBBinding binding , JavaColonNamespace jndiType , String lookupName , String messageId ) throws NameNotFoundException { J2EEName j2eeName = getJ2EEName ( binding ) ; String jndiName = jndiType . toString ( ) + "/" + lookupName ; String msgTxt = Tr . formatMessage ( tc ,...
Internal method to throw a NameNotFoundException for unsupported Home and Remote interfaces .
155
16
159,611
protected void unsetVirtualHost ( VirtualHost vhost ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unset vhost: " , vhost ) ; } secureVirtualHost = null ; }
Unset required VirtualHost . This will be called after deactivate
61
13
159,612
private synchronized void createJMXWorkAreaResourceIfChanged ( VirtualHost vhost ) { // Make sure our context root has been registered... String contextRoot = registeredContextRoot ; if ( contextRoot != null ) { // Make sure that we are dealing with the secure port before writing the file... String newAppURLString = vh...
Called to create the work area resource . Only re - generate the file if this is the first time or something in the url has changed .
419
29
159,613
@ Reference ( service = WsLocationAdmin . class , policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MANDATORY ) protected void setLocationService ( WsLocationAdmin locationService ) { this . locationService = locationService ; if ( restJMXAddressWorkareaFile == null ) { restJMXAddressWorkareaFil...
Set the dynamic reference to the WsLocationAdmin service . If the service is replaced the new service will be set before the old is removed .
121
29
159,614
public final List < String > getConnectionFactoryInterfaceNames ( ) { return cfInterfaceNames instanceof String ? Collections . singletonList ( ( String ) cfInterfaceNames ) // : cfInterfaceNames instanceof String [ ] ? Arrays . asList ( ( String [ ] ) cfInterfaceNames ) // : Collections . < String > emptyList ( ) ; }
This method is provided for the connection factory validator .
74
11
159,615
private void destroyConnectionFactories ( boolean destroyImmediately ) { lock . writeLock ( ) . lock ( ) ; try { if ( isInitialized . get ( ) ) { // Mark all connection factories as disabled isInitialized . set ( false ) ; // Destroy the connection factories conMgrSvc . deleteObserver ( this ) ; conMgrSvc . destroyConn...
Utility method to destroy connection factory instances .
107
9
159,616
@ Override @ Trivial public boolean getReauthenticationSupport ( ) { return Boolean . TRUE . equals ( bootstrapContextRef . getReference ( ) . getProperty ( REAUTHENTICATION_SUPPORT ) ) ; }
Indicates whether or not reauthentication of connections is enabled .
50
13
159,617
@ Override public TransactionSupportLevel getTransactionSupport ( ) { // If ManagedConnectionFactory implements TransactionSupport, that takes priority TransactionSupportLevel transactionSupport = mcf instanceof TransactionSupport ? ( ( TransactionSupport ) mcf ) . getTransactionSupport ( ) : null ; // Otherwise get th...
Indicates the level of transaction support .
305
8
159,618
public StackNode < E > clean ( ) { do { final StackNode < E > oldTop = top . get ( ) ; if ( top . compareAndSet ( oldTop , null ) ) return oldTop ; } while ( true ) ; }
Remove all nodes from stack and return the old top node .
52
12
159,619
public E pop ( ) { StackNode < E > oldTop , newTop ; while ( true ) { oldTop = top . get ( ) ; if ( oldTop == null ) return null ; newTop = oldTop . next ; if ( top . compareAndSet ( oldTop , newTop ) ) break ; } return oldTop . data ; }
Pop data from the Stack .
74
6
159,620
public void push ( E d ) { StackNode < E > oldTop , newTop ; newTop = new StackNode < E > ( d ) ; while ( true ) { oldTop = top . get ( ) ; newTop . next = oldTop ; if ( oldTop != null ) newTop . index = oldTop . index + 1 ; else newTop . index = 0 ; if ( top . compareAndSet ( oldTop , newTop ) ) return ; } }
Push data onto Stack .
100
5
159,621
public E peek ( ) { final StackNode < E > oldTop = top . get ( ) ; if ( oldTop == null ) { return null ; } else { return oldTop . data ; } }
Return copy of the top data on the Stack
43
9
159,622
public void setSizeRefsByMsgSize ( boolean sizeByMsgSize ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSizeRefsByMsgSize" , Boolean . valueOf ( sizeByMsgSize ) ) ; this . _sizeRefsByMsgSize = sizeByMsgSize ; if ( TraceComponent . isAnyTracingEnabled ( ) &...
PK57207 Called when adding this reference to a reference stream when to specify that sib . msgstore . jdbcSpillSizeRefsByMsgSize has been enabled
128
36
159,623
public int getInMemoryDataSize ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getInMemoryDataSize" ) ; int dataSize ; // If tuning has requested return the size of the message we reference, // then delegate to the message. Otherwise call our parent to get a...
PK57207 Returns an estimated size for this message reference
276
11
159,624
public void begin ( ) throws SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "begin" ) ; // Are we currently in use? do we have work // we still need to commit? if ( _state == TransactionState . STATE_ACTIVE && _workList != null ) { SIInc...
Begin a new local transaction by readying this object for re - use by the ItemStream interfaces .
314
20
159,625
public void rollback ( ) throws SIIncorrectCallException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "rollback" ) ; if ( _state != TransactionState . STATE_ACTIVE ) { SIIncorrectCallException sie = new SIIncorrectCallException ( nls . ge...
Rollback all work associated with this local transaction .
764
10
159,626
static void setInjectionEngine ( InternalInjectionEngine ie ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setInjectionEngine : " + ie ) ; svInstance = ie ; }
F46994 . 2
58
5
159,627
public static boolean isRemoteable ( Class < ? > valueClass , int rmicCompatible ) { // NOTE: This logic must be kept in sync with write_value. return valueClass . isInterface ( ) && valueClass != Serializable . class && valueClass != Externalizable . class && ( isCORBAObject ( valueClass , rmicCompatible ) || Remote ....
Determines whether a value of the specified type could be a remote object reference . This should return true if read_Object or read_abstract_interface is used for this type .
105
38
159,628
public static boolean hasJNDIScheme ( String jndiName ) { int colonIndex = jndiName . indexOf ( ' ' ) ; int slashIndex = jndiName . indexOf ( ' ' ) ; return colonIndex != - 1 && ( slashIndex == - 1 || colonIndex < slashIndex ) ; }
Return true if a JNDI name has a scheme .
71
12
159,629
private List < WsByteBuffer > writeHeader ( List < WsByteBuffer > list ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Writing gzip header information" ) ; } WsByteBuffer hdr = HttpDispatcher . getBufferManager ( ) . allocateDirect ( GZIP_Header . length ) ; hdr . put...
Write the gzip header onto the output list .
129
10
159,630
private WsByteBuffer makeBuffer ( int len ) { WsByteBuffer buffer = HttpDispatcher . getBufferManager ( ) . allocateDirect ( len ) ; buffer . put ( this . buf , 0 , len ) ; buffer . flip ( ) ; return buffer ; }
Create the output bytebuffer based on the output compressed storage .
59
12
159,631
private void writeInt ( int value , byte [ ] data , int offset ) { int index = offset ; data [ index ++ ] = ( byte ) ( value & 0xff ) ; data [ index ++ ] = ( byte ) ( ( value >> 8 ) & 0xff ) ; data [ index ++ ] = ( byte ) ( ( value >> 16 ) & 0xff ) ; data [ index ++ ] = ( byte ) ( ( value >> 24 ) & 0xff ) ; }
Write an integer into the output space starting at the input offset .
99
13
159,632
protected Object getInjectedObjectFromCXF ( Class < ? > classType , Type genericType , Annotation [ ] memberAnnotations , ParamInjectionMetadata paramInjectionMetadata ) { Parameter p = ResourceUtils . getParameter ( 0 , memberAnnotations , classType ) ; Object injectedObject = null ; Message message = paramInjectionMe...
real create the paramter object based CXF implementation
249
11
159,633
private void setBufferSize ( int size ) { this . amountToBuffer = size ; this . bbSize = ( 49152 < size ) ? 32768 : 8192 ; int numBuffers = ( size / this . bbSize ) ; if ( 0 == size || 0 != ( size % this . bbSize ) ) { numBuffers ++ ; } this . _output = new WsByteBuffer [ numBuffers ] ; if ( TraceComponent . isAnyTraci...
Set the amount of data to buffer internally before the stream itself initiates a flush . A zero size means no buffer is done each write call will flush data .
139
32
159,634
private void clear ( ) { if ( null != this . _output ) { for ( int i = 0 ; i < this . _output . length ; i ++ ) { if ( null != this . _output [ i ] ) { this . _output [ i ] . release ( ) ; this . _output [ i ] = null ; } } } this . outputIndex = 0 ; this . bufferedCount = 0 ; this . bytesWritten = 0L ; this . setWriteL...
Release any current buffer content in the stream .
109
9
159,635
@ Reference ( service = Application . class , cardinality = ReferenceCardinality . MULTIPLE , policy = ReferencePolicy . DYNAMIC , target = "(application.state=STARTED)" ) protected void addStartedApplication ( ServiceReference < Application > ref ) { ExecutorService executor ; String appName = ( String ) ref . getProp...
Declarative Services method for setting a started Application instance
175
11
159,636
@ Reference ( service = Application . class , cardinality = ReferenceCardinality . MULTIPLE , policy = ReferencePolicy . DYNAMIC , target = "(application.state=STARTING)" ) protected void addStartingApplication ( ServiceReference < Application > ref ) { String appName = ( String ) ref . getProperty ( NAME ) ; lock . wr...
Declarative Services method for setting a starting Application instance
130
11
159,637
boolean isStarted ( String appName ) { lock . readLock ( ) . lock ( ) ; try { return appStates . get ( appName ) == ApplicationState . STARTED ; } finally { lock . readLock ( ) . unlock ( ) ; } }
Returns true if the application with the specified name is started otherwise false .
56
14
159,638
protected void removeStartedApplication ( ServiceReference < Application > ref ) { String appName = ( String ) ref . getProperty ( NAME ) ; lock . writeLock ( ) . lock ( ) ; try { appStates . remove ( appName ) ; } finally { lock . writeLock ( ) . unlock ( ) ; } }
Declarative Services method for unsetting a started Application instance
68
12
159,639
String objectsToString ( String key , Object objects ) { java . io . StringWriter stringWriter = new java . io . StringWriter ( ) ; stringWriter . write ( key ) ; stringWriter . write ( ":" ) ; if ( objects == null ) { stringWriter . write ( "\n" ) ; } else if ( objects instanceof Object [ ] ) { for ( int i = 0 ; i < (...
Create a simple default formatted string .
208
7
159,640
private static String getPID ( ) { String name = ManagementFactory . getRuntimeMXBean ( ) . getName ( ) ; int index = name . indexOf ( ' ' ) ; if ( index == - 1 ) { return null ; } String pid = name . substring ( 0 , index ) ; if ( ! pid . matches ( "[0-9]+" ) ) { return null ; } return pid ; }
Return the current process ID .
89
6
159,641
private File createNewFile ( File outputDir , String prefix , String extension ) throws IOException { String dateTime = new SimpleDateFormat ( "yyyyMMdd.HHmmss" ) . format ( new Date ( ) ) ; File outputFile ; do { String pid = PID == null ? "" : PID + ' ' ; int sequenceNumber = nextSequenceNumber . getAndIncrement ( ) ...
Create a dump file with a unique name .
144
9
159,642
private File createThreadDump ( File outputDir ) { // Determine if we're using Java Attach (VirtualMachine.remoteDataDump) // or the DiagnosticCommand MBean. Java Attach is only available on // JREs (not JDKs) and sometimes fails to connect, but we prefer it when // available because DiagnosticCommand returns the entir...
Create a thread dump . This is the same output normally printed to the console when a kill - QUIT or Ctrl - Break is sent to the process .
600
31
159,643
private synchronized VirtualMachine getAttachedVirtualMachine ( ) throws VirtualMachineException { if ( PID == null ) { // Java Attach requires a PID. return null ; } if ( vm == null ) { vm = createVirtualMachine ( ) ; } return vm . isAttached ( ) ? vm : null ; }
Returns sun . tools . attach . HotSpotVirtualMachine if possible .
65
14
159,644
private VirtualMachine createVirtualMachine ( ) throws VirtualMachineException { ClassLoader toolsClassLoader ; File toolsJar = getToolsJar ( ) ; if ( toolsJar == null ) { // The attach classes are on the boot classpath on Mac. toolsClassLoader = HotSpotJavaDumperImpl . class . getClassLoader ( ) ; } else { try { tools...
Create a VirtualMachine wrapper .
339
6
159,645
public List < com . ibm . wsspi . security . wim . model . IdentifierType > getManager ( ) { if ( manager == null ) { manager = new ArrayList < com . ibm . wsspi . security . wim . model . IdentifierType > ( ) ; } return this . manager ; }
Gets the value of the manager property .
71
9
159,646
public List < com . ibm . wsspi . security . wim . model . IdentifierType > getSecretary ( ) { if ( secretary == null ) { secretary = new ArrayList < com . ibm . wsspi . security . wim . model . IdentifierType > ( ) ; } return this . secretary ; }
Gets the value of the secretary property .
71
9
159,647
public List < com . ibm . wsspi . security . wim . model . AddressType > getHomeAddress ( ) { if ( homeAddress == null ) { homeAddress = new ArrayList < com . ibm . wsspi . security . wim . model . AddressType > ( ) ; } return this . homeAddress ; }
Gets the value of the homeAddress property .
73
10
159,648
public List < com . ibm . wsspi . security . wim . model . AddressType > getBusinessAddress ( ) { if ( businessAddress == null ) { businessAddress = new ArrayList < com . ibm . wsspi . security . wim . model . AddressType > ( ) ; } return this . businessAddress ; }
Gets the value of the businessAddress property .
73
10
159,649
public static ModuleMetaData getModuleMetaData ( ) { ComponentMetaData cmd = getComponentMetaData ( ) ; ModuleMetaData mmd = null ; if ( cmd != null ) { mmd = cmd . getModuleMetaData ( ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "ModuleMetaData object is " + ( mmd != null ? mmd . toString ( ) : "null!" ) )...
Gets the metadata for the module
103
7
159,650
void setDelete ( GBSNode deleteNode , int deleteIndex ) { _deleteNode = deleteNode ; _deleteIndex = deleteIndex ; _notFound = false ; }
Remember the information about the delete point .
36
8
159,651
void setTarget ( GBSNode targetNode , int targetIndex , int type ) { _targetNode = targetNode ; _targetIndex = targetIndex ; _type = type ; }
Remember the information about the target point .
38
8
159,652
void reset ( ) { _deleteNode = null ; _deleteIndex = 0 ; _targetNode = null ; _targetIndex = 0 ; _type = NONE ; _notFound = true ; }
Return this object to its original post - construction state .
42
11
159,653
private String getPID ( String dir , String serverName ) { String pid = null ; if ( platformType == SelfExtractUtils . PlatformType_CYGWIN ) { String pidFile = dir + File . separator + "wlp" + File . separator + "usr" + File . separator + "servers" + File . separator + ".pid" + File . separator + serverName + ".pid" ; ...
Return PID from server directory for cygwin environment only .
221
12
159,654
private void stopServer ( ) throws IOException { // build stop command for Unix platforms String cmd = dir + File . separator + "wlp" + File . separator + "bin" + File . separator + "server stop " + serverName ; if ( platformType == SelfExtractUtils . PlatformType_UNIX ) { // use command as-is } else if ( platformType ...
Run server stop command
186
4
159,655
private void startAsyncDelete ( ) throws IOException { Runtime rt = Runtime . getRuntime ( ) ; File scriptFile = null ; if ( platformType == SelfExtractUtils . PlatformType_UNIX ) { scriptFile = writeCleanupFile ( SelfExtractUtils . PlatformType_UNIX ) ; rt . exec ( "chmod 750 " + scriptFile . getAbsolutePath ( ) ) ; r...
Start async deletion using background script
327
6
159,656
private void writeWindowsCleanup ( File file , BufferedWriter bw ) throws IOException { bw . write ( "set max=30\n" ) ; bw . write ( "set cnt=0\n" ) ; bw . write ( "set dir=" + dir + "\n" ) ; bw . write ( "echo delete %dir%\n" ) ; bw . write ( ":while\n" ) ; bw . write ( " if exist %dir% (\n" ) ; bw . write ( " rmdir /...
Write logic for windows cleanup script
251
6
159,657
private void writeUnixCleanup ( File file , BufferedWriter bw ) throws IOException { bw . write ( "echo begin delete" + "\n" ) ; bw . write ( "n=0" + "\n" ) ; bw . write ( "while [ $n -ne 1 ]; do" + "\n" ) ; bw . write ( " sleep 3" + "\n" ) ; bw . write ( " if [ -e " + dir . replace ( ' ' , ' ' ) + " ]; then" + "\n" ) ...
Write logic for Unix cleanup script
277
6
159,658
private void writeCygwinCleanup ( File file , BufferedWriter bw ) throws IOException { // Under cygwin, must explicitly kill the process that runs // the server. It simply does not die on its own. And it's // JVM holds file locks which will prevent cleanup of extraction // directory. So kill it. String pid = getPID ( d...
Write logic for Cygwin cleanup script
117
8
159,659
public void run ( ) { try { stopServer ( ) ; // first, stop server // wait on error/output stream threads to complete // note on Windows the streams never close, so wait with brief timeout if ( ! System . getProperty ( "os.name" ) . startsWith ( "Win" ) ) { out . join ( ) ; err . join ( ) ; } else { // windows, so use ...
Main method for shutdown hook . Job of this hook is to stop server and delete extraction directory .
148
19
159,660
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 .
74
13
159,661
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 .
83
14
159,662
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 .
120
14
159,663
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 .
121
37
159,664
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 .
74
32
159,665
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 .
74
31
159,666
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 .
74
31
159,667
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 .
87
31
159,668
private Object readItem ( ) { Object itemRead = null ; try { currentChunkStatus . incrementItemsTouchedInCurrentChunk ( ) ; // call read listeners before and after the actual read for ( ItemReadListenerProxy readListenerProxy : itemReadListeners ) { readListenerProxy . beforeRead ( ) ; } itemRead = readerProxy . readIt...
Reads an item from the reader
560
7
159,669
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
97
6
159,670
private int initStepTransactionTimeout ( ) { logger . entering ( sourceClass , "initStepTransactionTimeout" ) ; Properties p = runtimeStepExecution . getProperties ( ) ; int timeout = DEFAULT_TRAN_TIMEOUT_SECONDS ; // default as per spec. if ( p != null && ! p . isEmpty ( ) ) { String propertyTimeOut = p . getProperty ...
Note we can rely on the StepContext properties already having been set at this point .
212
17
159,671
@ Trivial 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 .
98
20
159,672
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 .
92
7
159,673
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
287
13
159,674
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 .
66
43
159,675
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
60
8
159,676
private static String jarFileName ( ) { // do this first so we can access extractor, ok to invoke more than once createExtractor ( ) ; // get <name> from path/<name>.jar String fullyQualifiedFileName = extractor . container . getName ( ) ; int lastSeparator = fullyQualifiedFileName . lastIndexOf ( File . separatorChar ...
Return jar file name from input archive
163
7
159,677
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 .
362
42
159,678
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" ; // unless user specifies to enable...
Run server extracted from jar If environment variable WLP_JAR_DEBUG is set use server debug instead
507
21
159,679
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 .
89
8
159,680
public synchronized final void applyRequestGroupConfigChanges ( ) { // Note: on the following call the "false,true" forces the change notification // to be sent. The listener will then pick up all property values in the // group. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( th...
Request Stat variable group
145
4
159,681
public Object get ( int key ) throws SIErrorException // D214655 { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "get" ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "key: " + key ) ; // f174137 captiveComparitorKey . setValue ( key ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "captiveComparit...
Retrives the object associated with a particular key from the map .
240
14
159,682
public Object remove ( int key ) throws SIErrorException // D214655 { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remove" , "" + key ) ; captiveComparitorKey . setValue ( key ) ; // Start D214655 Object retObject = map . remove ( captiveComparitorKey ) ; if ( retObject == null ) { // If no object existed this ...
Removes an object from the map .
176
8
159,683
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
65
9
159,684
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
93
15
159,685
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 .
332
28
159,686
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 .
69
9
159,687
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 .
46
13
159,688
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 .
102
9
159,689
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 .
111
11
159,690
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 .
71
13
159,691
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 .
34
14
159,692
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 .
42
15
159,693
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 .
42
15
159,694
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 .
45
18
159,695
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 .
79
11
159,696
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
210
9
159,697
private void pessimisticFind ( SearchComparator comp , Object searchKey , SearchNode point ) { point . reset ( ) ; synchronized ( this ) { internalFind ( comp , searchKey , point ) ; _pessimisticFinds ++ ; } }
Pessimistic find in a GBS Tree
51
9
159,698
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 .
440
8
159,699
private void leftSearch ( SearchComparator comp , GBSNode p , GBSNode r , Object searchKey , SearchNode point ) { if ( r == null ) /* There is no upper predecessor */ { int idx = p . searchLeft ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) point . setFound ( p , idx ) ; } else /* There is an upper predecessor */ { int xc...
Search after falling off a left edge .
268
8