id
stringlengths
11
15
language
stringclasses
1 value
question
stringlengths
13
844
answer
stringlengths
1
900
code
stringlengths
162
27.4k
code_original
stringlengths
162
26k
code_word_count
int64
51
5.96k
java-test-457
java
Does the code obtain the decimalstyle for the specified locale ?
Yes
public static Decimal Style of ( Locale locale ) { Objects . require Non Null ( locale , STRING ) ; Decimal Style info = CACHE . get ( locale ) ; if ( info == null ) { info = create ( locale ) ; CACHE . put If Absent ( locale , info ) ; info = CACHE . get ( locale ) ; } return info ; }
public static DecimalStyle of ( Locale locale ) { Objects . requireNonNull ( locale , STRING ) ; DecimalStyle info = CACHE . get ( locale ) ; if ( info == null ) { info = create ( locale ) ; CACHE . putIfAbsent ( locale , info ) ; info = CACHE . get ( locale ) ; } return info ; }
71
java-test-458
java
What does this method provide ?
access to locale sensitive decimal style symbols
public static Decimal Style of ( Locale locale ) { Objects . require Non Null ( locale , STRING ) ; Decimal Style info = CACHE . get ( locale ) ; if ( info == null ) { info = create ( locale ) ; CACHE . put If Absent ( locale , info ) ; info = CACHE . get ( locale ) ; } return info ; }
public static DecimalStyle of ( Locale locale ) { Objects . requireNonNull ( locale , STRING ) ; DecimalStyle info = CACHE . get ( locale ) ; if ( info == null ) { info = create ( locale ) ; CACHE . putIfAbsent ( locale , info ) ; info = CACHE . get ( locale ) ; } return info ; }
71
java-test-461
java
What does the code write to a file in the csv format ?
the result set of a query
public int write ( Connection conn , String output File Name , String sql , String charset ) throws SQL Exception { Statement stat = conn . create Statement ( ) ; Result Set rs = stat . execute Query ( sql ) ; int rows = write ( output File Name , rs , charset ) ; stat . close ( ) ; return rows ; }
public int write ( Connection conn , String outputFileName , String sql , String charset ) throws SQLException { Statement stat = conn . createStatement ( ) ; ResultSet rs = stat . executeQuery ( sql ) ; int rows = write ( outputFileName , rs , charset ) ; stat . close ( ) ; return rows ; }
68
java-test-462
java
Does the code write the result set of a query to a file in the csv format ?
Yes
public int write ( Connection conn , String output File Name , String sql , String charset ) throws SQL Exception { Statement stat = conn . create Statement ( ) ; Result Set rs = stat . execute Query ( sql ) ; int rows = write ( output File Name , rs , charset ) ; stat . close ( ) ; return rows ; }
public int write ( Connection conn , String outputFileName , String sql , String charset ) throws SQLException { Statement stat = conn . createStatement ( ) ; ResultSet rs = stat . executeQuery ( sql ) ; int rows = write ( outputFileName , rs , charset ) ; stat . close ( ) ; return rows ; }
68
java-test-463
java
How does the code create a header ?
by reading the information from the input stream
public static Header read Header ( Array Data Input dis ) throws Truncated File Exception , IO Exception { Header my Header = new Header ( ) ; try { my Header . read ( dis ) ; } catch ( EOF Exception e ) { if ( e . get Cause ( ) instanceof Truncated File Exception ) { throw e ; } return null ; } return my Header ; }
public static Header readHeader ( ArrayDataInput dis ) throws TruncatedFileException , IOException { Header myHeader = new Header ( ) ; try { myHeader . read ( dis ) ; } catch ( EOFException e ) { if ( e . getCause ( ) instanceof TruncatedFileException ) { throw e ; } return null ; } return myHeader ; }
73
java-test-464
java
Does the code create a header by reading the information from the input stream ?
Yes
public static Header read Header ( Array Data Input dis ) throws Truncated File Exception , IO Exception { Header my Header = new Header ( ) ; try { my Header . read ( dis ) ; } catch ( EOF Exception e ) { if ( e . get Cause ( ) instanceof Truncated File Exception ) { throw e ; } return null ; } return my Header ; }
public static Header readHeader ( ArrayDataInput dis ) throws TruncatedFileException , IOException { Header myHeader = new Header ( ) ; try { myHeader . read ( dis ) ; } catch ( EOFException e ) { if ( e . getCause ( ) instanceof TruncatedFileException ) { throw e ; } return null ; } return myHeader ; }
73
java-test-467
java
What does the code get ?
the entity at the specified revision
@ Nullable public T ENTITY find Revision ( int id , int revision Number ) { T ENTITY result = null ; try { begin ( ) ; Audit Reader reader = Audit Reader Factory . get ( get Entity Manager ( ) ) ; result = reader . find ( entity Class , id , revision Number ) ; commit ( ) ; } catch ( No Result Exception e ) { rollback ( ) ; LOG . warn ( STRING + revision Number + STRING + id ) ; } finally { cleanup ( ) ; } return result ; }
@ Nullable public T_ENTITY findRevision ( int id , int revisionNumber ) { T_ENTITY result = null ; try { begin ( ) ; AuditReader reader = AuditReaderFactory . get ( getEntityManager ( ) ) ; result = reader . find ( entityClass , id , revisionNumber ) ; commit ( ) ; } catch ( NoResultException e ) { rollback ( ) ; LOG . warn ( STRING + revisionNumber + STRING + id ) ; } finally { cleanup ( ) ; } return result ; }
103
java-test-468
java
Does the code get the entity at the specified revision ?
Yes
@ Nullable public T ENTITY find Revision ( int id , int revision Number ) { T ENTITY result = null ; try { begin ( ) ; Audit Reader reader = Audit Reader Factory . get ( get Entity Manager ( ) ) ; result = reader . find ( entity Class , id , revision Number ) ; commit ( ) ; } catch ( No Result Exception e ) { rollback ( ) ; LOG . warn ( STRING + revision Number + STRING + id ) ; } finally { cleanup ( ) ; } return result ; }
@ Nullable public T_ENTITY findRevision ( int id , int revisionNumber ) { T_ENTITY result = null ; try { begin ( ) ; AuditReader reader = AuditReaderFactory . get ( getEntityManager ( ) ) ; result = reader . find ( entityClass , id , revisionNumber ) ; commit ( ) ; } catch ( NoResultException e ) { rollback ( ) ; LOG . warn ( STRING + revisionNumber + STRING + id ) ; } finally { cleanup ( ) ; } return result ; }
103
java-test-471
java
When does a scheduleitem place ?
later in the schedule
public void move Item Down ( Schedule Item si ) { int sequence Id = si . get Sequence Id ( ) ; if ( sequence Id + NUM > sequence Num ) { si . set Sequence Id ( NUM ) ; resequence Ids ( ) ; } else { Schedule Item replace Si = get Item By Sequence Id ( sequence Id + NUM ) ; if ( replace Si != null ) { replace Si . set Sequence Id ( sequence Id ) ; si . set Sequence Id ( sequence Id + NUM ) ; } else { resequence Ids ( ) ; } } set Dirty And Fire Property Change ( LISTCHANGE CHANGED PROPERTY , null , Integer . to String ( sequence Id ) ) ; }
public void moveItemDown ( ScheduleItem si ) { int sequenceId = si . getSequenceId ( ) ; if ( sequenceId + _NUM > _sequenceNum ) { si . setSequenceId ( _NUM ) ; resequenceIds ( ) ; } else { ScheduleItem replaceSi = getItemBySequenceId ( sequenceId + _NUM ) ; if ( replaceSi != null ) { replaceSi . setSequenceId ( sequenceId ) ; si . setSequenceId ( sequenceId + _NUM ) ; } else { resequenceIds ( ) ; } } setDirtyAndFirePropertyChange ( LISTCHANGE_CHANGED_PROPERTY , null , Integer . toString ( sequenceId ) ) ; }
133
java-test-480
java
What determines whether that state is currently active ?
the code given a time when a particular state changes from inactive to active , and a time when a particular state changes from active to inactive
private boolean is Active ( Calendar active Start , Calendar inactive Start ) { if ( inactive Start != null && active Start != null && inactive Start . before ( active Start ) ) return ! is Active ( inactive Start , active Start ) ; Calendar current = Calendar . get Instance ( ) ; return ! ( active Start != null && current . before ( active Start ) ) && ! ( inactive Start != null && current . after ( inactive Start ) ) ; }
private boolean isActive ( Calendar activeStart , Calendar inactiveStart ) { if ( inactiveStart != null && activeStart != null && inactiveStart . before ( activeStart ) ) return ! isActive ( inactiveStart , activeStart ) ; Calendar current = Calendar . getInstance ( ) ; return ! ( activeStart != null && current . before ( activeStart ) ) && ! ( inactiveStart != null && current . after ( inactiveStart ) ) ; }
91
java-test-481
java
What did the code given a time when a particular state changes from inactive to active , and a time when a particular state changes from active to inactive determine ?
whether that state is currently active
private boolean is Active ( Calendar active Start , Calendar inactive Start ) { if ( inactive Start != null && active Start != null && inactive Start . before ( active Start ) ) return ! is Active ( inactive Start , active Start ) ; Calendar current = Calendar . get Instance ( ) ; return ! ( active Start != null && current . before ( active Start ) ) && ! ( inactive Start != null && current . after ( inactive Start ) ) ; }
private boolean isActive ( Calendar activeStart , Calendar inactiveStart ) { if ( inactiveStart != null && activeStart != null && inactiveStart . before ( activeStart ) ) return ! isActive ( inactiveStart , activeStart ) ; Calendar current = Calendar . getInstance ( ) ; return ! ( activeStart != null && current . before ( activeStart ) ) && ! ( inactiveStart != null && current . after ( inactiveStart ) ) ; }
91
java-test-482
java
Did the code given a time when a particular state changes from inactive to active , and a time when a particular state changes from active to inactive determine ?
Yes
private boolean is Active ( Calendar active Start , Calendar inactive Start ) { if ( inactive Start != null && active Start != null && inactive Start . before ( active Start ) ) return ! is Active ( inactive Start , active Start ) ; Calendar current = Calendar . get Instance ( ) ; return ! ( active Start != null && current . before ( active Start ) ) && ! ( inactive Start != null && current . after ( inactive Start ) ) ; }
private boolean isActive ( Calendar activeStart , Calendar inactiveStart ) { if ( inactiveStart != null && activeStart != null && inactiveStart . before ( activeStart ) ) return ! isActive ( inactiveStart , activeStart ) ; Calendar current = Calendar . getInstance ( ) ; return ! ( activeStart != null && current . before ( activeStart ) ) && ! ( inactiveStart != null && current . after ( inactiveStart ) ) ; }
91
java-test-483
java
What does the code request until a read operation can be performed safely ?
the read lock . block
public synchronized void read Request ( ) { if ( current Writers == NUM && writer Locks . size ( ) == NUM ) { ++ current Readers ; } else { ++ queued Readers ; try { wait ( ) ; } catch ( Interrupted Exception e ) { } } }
public synchronized void readRequest ( ) { if ( currentWriters == _NUM && writerLocks . size ( ) == _NUM ) { ++ currentReaders ; } else { ++ queuedReaders ; try { wait ( ) ; } catch ( InterruptedException e ) { } } }
53
java-test-484
java
Does the code request the read lock . block until a read operation can be performed safely ?
Yes
public synchronized void read Request ( ) { if ( current Writers == NUM && writer Locks . size ( ) == NUM ) { ++ current Readers ; } else { ++ queued Readers ; try { wait ( ) ; } catch ( Interrupted Exception e ) { } } }
public synchronized void readRequest ( ) { if ( currentWriters == _NUM && writerLocks . size ( ) == _NUM ) { ++ currentReaders ; } else { ++ queuedReaders ; try { wait ( ) ; } catch ( InterruptedException e ) { } } }
53
java-test-485
java
Till when does the code request the read lock . block ?
until a read operation can be performed safely
public synchronized void read Request ( ) { if ( current Writers == NUM && writer Locks . size ( ) == NUM ) { ++ current Readers ; } else { ++ queued Readers ; try { wait ( ) ; } catch ( Interrupted Exception e ) { } } }
public synchronized void readRequest ( ) { if ( currentWriters == _NUM && writerLocks . size ( ) == _NUM ) { ++ currentReaders ; } else { ++ queuedReaders ; try { wait ( ) ; } catch ( InterruptedException e ) { } } }
53
java-test-487
java
How do file process ?
with actions ( delete , move , archive ) specified
private void process File Action ( ) throws IO Exception { switch ( file Action . to Lower Case ( ) ) { case STRING : fs . delete ( file , BOOL ) ; break ; case STRING : Path target File Move Path = new Path ( target Folder , file . get Name ( ) ) ; fs . rename ( file , target File Move Path ) ; break ; case STRING : try ( FS Data Output Stream archived Stream = fs . create ( new Path ( target Folder , file . get Name ( ) + STRING ) ) ; Zip Output Stream zip Archived Stream = new Zip Output Stream ( archived Stream ) ; FS Data Input Stream fd Data Input Stream = fs . open ( file ) ) { zip Archived Stream . put Next Entry ( new Zip Entry ( file . get Name ( ) ) ) ; int length ; byte [ ] buffer = new byte [ NUM ] ; while ( ( length = fd Data Input Stream . read ( buffer ) ) > NUM ) { zip Archived Stream . write ( buffer , NUM , length ) ; } zip Archived Stream . close Entry ( ) ; } fs . delete ( file , BOOL ) ; break ; default : break ; } }
private void processFileAction ( ) throws IOException { switch ( fileAction . toLowerCase ( ) ) { case STRING : fs . delete ( file , _BOOL ) ; break ; case STRING : Path targetFileMovePath = new Path ( targetFolder , file . getName ( ) ) ; fs . rename ( file , targetFileMovePath ) ; break ; case STRING : try ( FSDataOutputStream archivedStream = fs . create ( new Path ( targetFolder , file . getName ( ) + STRING ) ) ; ZipOutputStream zipArchivedStream = new ZipOutputStream ( archivedStream ) ; FSDataInputStream fdDataInputStream = fs . open ( file ) ) { zipArchivedStream . putNextEntry ( new ZipEntry ( file . getName ( ) ) ) ; int length ; byte [ ] buffer = new byte [ _NUM ] ; while ( ( length = fdDataInputStream . read ( buffer ) ) > _NUM ) { zipArchivedStream . write ( buffer , _NUM , length ) ; } zipArchivedStream . closeEntry ( ) ; } fs . delete ( file , _BOOL ) ; break ; default : break ; } }
235
java-test-489
java
What does the code calculate using the blend method ?
the " stop parameter " for this attribute
private double stop Prob Using Blend ( ) { int itcount = NUM ; double stop Prob , aimfor ; double lower , upper , tstop ; K Star Wrapper botvals = new K Star Wrapper ( ) ; K Star Wrapper upvals = new K Star Wrapper ( ) ; K Star Wrapper vals = new K Star Wrapper ( ) ; int testvalue = ( int ) m Test . value ( m Attr Index ) ; aimfor = ( m Total Count - m Distribution [ testvalue ] ) * ( double ) m Blend Factor / NUM + m Distribution [ testvalue ] ; tstop = NUM - m Blend Factor / NUM ; lower = NUM + ROOT FINDER ACCURACY / NUM ; upper = NUM - ROOT FINDER ACCURACY / NUM ; calculate Sphere Size ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculate Sphere Size ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avg Prob == NUM ) { calculate Sphere Size ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > NUM ) { tstop = upper ; vals . avg Prob = upvals . avg Prob ; } else { for ( ; ; ) { itcount ++ ; calculate Sphere Size ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT FINDER ACCURACY || itcount >= ROOT FINDER MAX ITER ) { break ; } if ( vals . sphere > NUM ) { lower = tstop ; tstop = ( upper + lower ) / NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / NUM ; } } } m Smallest Prob = vals . min Prob ; m Average Prob = vals . avg Prob ; switch ( m Missing Mode ) { case M DELETE : m Missing Prob = NUM ; break ; case M NORMAL : m Missing Prob = NUM ; break ; case M MAXDIFF : m Missing Prob = m Smallest Prob ; break ; case M AVERAGE : m Missing Prob = m Average Prob ; break ; } if ( Math . abs ( vals . avg Prob - m Total Count ) < EPSILON ) { stop Prob = NUM ; } else { stop Prob = tstop ; } return stop Prob ; }
private double stopProbUsingBlend ( ) { int itcount = _NUM ; double stopProb , aimfor ; double lower , upper , tstop ; KStarWrapper botvals = new KStarWrapper ( ) ; KStarWrapper upvals = new KStarWrapper ( ) ; KStarWrapper vals = new KStarWrapper ( ) ; int testvalue = ( int ) m_Test . value ( m_AttrIndex ) ; aimfor = ( m_TotalCount - m_Distribution [ testvalue ] ) * ( double ) m_BlendFactor / _NUM + m_Distribution [ testvalue ] ; tstop = _NUM - m_BlendFactor / _NUM ; lower = _NUM + ROOT_FINDER_ACCURACY / _NUM ; upper = _NUM - ROOT_FINDER_ACCURACY / _NUM ; calculateSphereSize ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculateSphereSize ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avgProb == _NUM ) { calculateSphereSize ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > _NUM ) { tstop = upper ; vals . avgProb = upvals . avgProb ; } else { for ( ; ; ) { itcount ++ ; calculateSphereSize ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT_FINDER_ACCURACY || itcount >= ROOT_FINDER_MAX_ITER ) { break ; } if ( vals . sphere > _NUM ) { lower = tstop ; tstop = ( upper + lower ) / _NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / _NUM ; } } } m_SmallestProb = vals . minProb ; m_AverageProb = vals . avgProb ; switch ( m_MissingMode ) { case M_DELETE : m_MissingProb = _NUM ; break ; case M_NORMAL : m_MissingProb = _NUM ; break ; case M_MAXDIFF : m_MissingProb = m_SmallestProb ; break ; case M_AVERAGE : m_MissingProb = m_AverageProb ; break ; } if ( Math . abs ( vals . avgProb - m_TotalCount ) < EPSILON ) { stopProb = _NUM ; } else { stopProb = tstop ; } return stopProb ; }
432
java-test-490
java
How is the value computed ?
using a root finder algorithm
private double stop Prob Using Blend ( ) { int itcount = NUM ; double stop Prob , aimfor ; double lower , upper , tstop ; K Star Wrapper botvals = new K Star Wrapper ( ) ; K Star Wrapper upvals = new K Star Wrapper ( ) ; K Star Wrapper vals = new K Star Wrapper ( ) ; int testvalue = ( int ) m Test . value ( m Attr Index ) ; aimfor = ( m Total Count - m Distribution [ testvalue ] ) * ( double ) m Blend Factor / NUM + m Distribution [ testvalue ] ; tstop = NUM - m Blend Factor / NUM ; lower = NUM + ROOT FINDER ACCURACY / NUM ; upper = NUM - ROOT FINDER ACCURACY / NUM ; calculate Sphere Size ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculate Sphere Size ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avg Prob == NUM ) { calculate Sphere Size ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > NUM ) { tstop = upper ; vals . avg Prob = upvals . avg Prob ; } else { for ( ; ; ) { itcount ++ ; calculate Sphere Size ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT FINDER ACCURACY || itcount >= ROOT FINDER MAX ITER ) { break ; } if ( vals . sphere > NUM ) { lower = tstop ; tstop = ( upper + lower ) / NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / NUM ; } } } m Smallest Prob = vals . min Prob ; m Average Prob = vals . avg Prob ; switch ( m Missing Mode ) { case M DELETE : m Missing Prob = NUM ; break ; case M NORMAL : m Missing Prob = NUM ; break ; case M MAXDIFF : m Missing Prob = m Smallest Prob ; break ; case M AVERAGE : m Missing Prob = m Average Prob ; break ; } if ( Math . abs ( vals . avg Prob - m Total Count ) < EPSILON ) { stop Prob = NUM ; } else { stop Prob = tstop ; } return stop Prob ; }
private double stopProbUsingBlend ( ) { int itcount = _NUM ; double stopProb , aimfor ; double lower , upper , tstop ; KStarWrapper botvals = new KStarWrapper ( ) ; KStarWrapper upvals = new KStarWrapper ( ) ; KStarWrapper vals = new KStarWrapper ( ) ; int testvalue = ( int ) m_Test . value ( m_AttrIndex ) ; aimfor = ( m_TotalCount - m_Distribution [ testvalue ] ) * ( double ) m_BlendFactor / _NUM + m_Distribution [ testvalue ] ; tstop = _NUM - m_BlendFactor / _NUM ; lower = _NUM + ROOT_FINDER_ACCURACY / _NUM ; upper = _NUM - ROOT_FINDER_ACCURACY / _NUM ; calculateSphereSize ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculateSphereSize ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avgProb == _NUM ) { calculateSphereSize ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > _NUM ) { tstop = upper ; vals . avgProb = upvals . avgProb ; } else { for ( ; ; ) { itcount ++ ; calculateSphereSize ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT_FINDER_ACCURACY || itcount >= ROOT_FINDER_MAX_ITER ) { break ; } if ( vals . sphere > _NUM ) { lower = tstop ; tstop = ( upper + lower ) / _NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / _NUM ; } } } m_SmallestProb = vals . minProb ; m_AverageProb = vals . avgProb ; switch ( m_MissingMode ) { case M_DELETE : m_MissingProb = _NUM ; break ; case M_NORMAL : m_MissingProb = _NUM ; break ; case M_MAXDIFF : m_MissingProb = m_SmallestProb ; break ; case M_AVERAGE : m_MissingProb = m_AverageProb ; break ; } if ( Math . abs ( vals . avgProb - m_TotalCount ) < EPSILON ) { stopProb = _NUM ; } else { stopProb = tstop ; } return stopProb ; }
432
java-test-491
java
What does it set to an attribute with a missing value also ?
the transformation probability
private double stop Prob Using Blend ( ) { int itcount = NUM ; double stop Prob , aimfor ; double lower , upper , tstop ; K Star Wrapper botvals = new K Star Wrapper ( ) ; K Star Wrapper upvals = new K Star Wrapper ( ) ; K Star Wrapper vals = new K Star Wrapper ( ) ; int testvalue = ( int ) m Test . value ( m Attr Index ) ; aimfor = ( m Total Count - m Distribution [ testvalue ] ) * ( double ) m Blend Factor / NUM + m Distribution [ testvalue ] ; tstop = NUM - m Blend Factor / NUM ; lower = NUM + ROOT FINDER ACCURACY / NUM ; upper = NUM - ROOT FINDER ACCURACY / NUM ; calculate Sphere Size ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculate Sphere Size ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avg Prob == NUM ) { calculate Sphere Size ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > NUM ) { tstop = upper ; vals . avg Prob = upvals . avg Prob ; } else { for ( ; ; ) { itcount ++ ; calculate Sphere Size ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT FINDER ACCURACY || itcount >= ROOT FINDER MAX ITER ) { break ; } if ( vals . sphere > NUM ) { lower = tstop ; tstop = ( upper + lower ) / NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / NUM ; } } } m Smallest Prob = vals . min Prob ; m Average Prob = vals . avg Prob ; switch ( m Missing Mode ) { case M DELETE : m Missing Prob = NUM ; break ; case M NORMAL : m Missing Prob = NUM ; break ; case M MAXDIFF : m Missing Prob = m Smallest Prob ; break ; case M AVERAGE : m Missing Prob = m Average Prob ; break ; } if ( Math . abs ( vals . avg Prob - m Total Count ) < EPSILON ) { stop Prob = NUM ; } else { stop Prob = tstop ; } return stop Prob ; }
private double stopProbUsingBlend ( ) { int itcount = _NUM ; double stopProb , aimfor ; double lower , upper , tstop ; KStarWrapper botvals = new KStarWrapper ( ) ; KStarWrapper upvals = new KStarWrapper ( ) ; KStarWrapper vals = new KStarWrapper ( ) ; int testvalue = ( int ) m_Test . value ( m_AttrIndex ) ; aimfor = ( m_TotalCount - m_Distribution [ testvalue ] ) * ( double ) m_BlendFactor / _NUM + m_Distribution [ testvalue ] ; tstop = _NUM - m_BlendFactor / _NUM ; lower = _NUM + ROOT_FINDER_ACCURACY / _NUM ; upper = _NUM - ROOT_FINDER_ACCURACY / _NUM ; calculateSphereSize ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculateSphereSize ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avgProb == _NUM ) { calculateSphereSize ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > _NUM ) { tstop = upper ; vals . avgProb = upvals . avgProb ; } else { for ( ; ; ) { itcount ++ ; calculateSphereSize ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT_FINDER_ACCURACY || itcount >= ROOT_FINDER_MAX_ITER ) { break ; } if ( vals . sphere > _NUM ) { lower = tstop ; tstop = ( upper + lower ) / _NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / _NUM ; } } } m_SmallestProb = vals . minProb ; m_AverageProb = vals . avgProb ; switch ( m_MissingMode ) { case M_DELETE : m_MissingProb = _NUM ; break ; case M_NORMAL : m_MissingProb = _NUM ; break ; case M_MAXDIFF : m_MissingProb = m_SmallestProb ; break ; case M_AVERAGE : m_MissingProb = m_AverageProb ; break ; } if ( Math . abs ( vals . avgProb - m_TotalCount ) < EPSILON ) { stopProb = _NUM ; } else { stopProb = tstop ; } return stopProb ; }
432
java-test-492
java
How does the code calculate the " stop parameter " for this attribute ?
using the blend method
private double stop Prob Using Blend ( ) { int itcount = NUM ; double stop Prob , aimfor ; double lower , upper , tstop ; K Star Wrapper botvals = new K Star Wrapper ( ) ; K Star Wrapper upvals = new K Star Wrapper ( ) ; K Star Wrapper vals = new K Star Wrapper ( ) ; int testvalue = ( int ) m Test . value ( m Attr Index ) ; aimfor = ( m Total Count - m Distribution [ testvalue ] ) * ( double ) m Blend Factor / NUM + m Distribution [ testvalue ] ; tstop = NUM - m Blend Factor / NUM ; lower = NUM + ROOT FINDER ACCURACY / NUM ; upper = NUM - ROOT FINDER ACCURACY / NUM ; calculate Sphere Size ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculate Sphere Size ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avg Prob == NUM ) { calculate Sphere Size ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > NUM ) { tstop = upper ; vals . avg Prob = upvals . avg Prob ; } else { for ( ; ; ) { itcount ++ ; calculate Sphere Size ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT FINDER ACCURACY || itcount >= ROOT FINDER MAX ITER ) { break ; } if ( vals . sphere > NUM ) { lower = tstop ; tstop = ( upper + lower ) / NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / NUM ; } } } m Smallest Prob = vals . min Prob ; m Average Prob = vals . avg Prob ; switch ( m Missing Mode ) { case M DELETE : m Missing Prob = NUM ; break ; case M NORMAL : m Missing Prob = NUM ; break ; case M MAXDIFF : m Missing Prob = m Smallest Prob ; break ; case M AVERAGE : m Missing Prob = m Average Prob ; break ; } if ( Math . abs ( vals . avg Prob - m Total Count ) < EPSILON ) { stop Prob = NUM ; } else { stop Prob = tstop ; } return stop Prob ; }
private double stopProbUsingBlend ( ) { int itcount = _NUM ; double stopProb , aimfor ; double lower , upper , tstop ; KStarWrapper botvals = new KStarWrapper ( ) ; KStarWrapper upvals = new KStarWrapper ( ) ; KStarWrapper vals = new KStarWrapper ( ) ; int testvalue = ( int ) m_Test . value ( m_AttrIndex ) ; aimfor = ( m_TotalCount - m_Distribution [ testvalue ] ) * ( double ) m_BlendFactor / _NUM + m_Distribution [ testvalue ] ; tstop = _NUM - m_BlendFactor / _NUM ; lower = _NUM + ROOT_FINDER_ACCURACY / _NUM ; upper = _NUM - ROOT_FINDER_ACCURACY / _NUM ; calculateSphereSize ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculateSphereSize ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avgProb == _NUM ) { calculateSphereSize ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > _NUM ) { tstop = upper ; vals . avgProb = upvals . avgProb ; } else { for ( ; ; ) { itcount ++ ; calculateSphereSize ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT_FINDER_ACCURACY || itcount >= ROOT_FINDER_MAX_ITER ) { break ; } if ( vals . sphere > _NUM ) { lower = tstop ; tstop = ( upper + lower ) / _NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / _NUM ; } } } m_SmallestProb = vals . minProb ; m_AverageProb = vals . avgProb ; switch ( m_MissingMode ) { case M_DELETE : m_MissingProb = _NUM ; break ; case M_NORMAL : m_MissingProb = _NUM ; break ; case M_MAXDIFF : m_MissingProb = m_SmallestProb ; break ; case M_AVERAGE : m_MissingProb = m_AverageProb ; break ; } if ( Math . abs ( vals . avgProb - m_TotalCount ) < EPSILON ) { stopProb = _NUM ; } else { stopProb = tstop ; } return stopProb ; }
432
java-test-493
java
When does the smallest and average transformation probabilities compute ?
once the stop factor is obtained
private double stop Prob Using Blend ( ) { int itcount = NUM ; double stop Prob , aimfor ; double lower , upper , tstop ; K Star Wrapper botvals = new K Star Wrapper ( ) ; K Star Wrapper upvals = new K Star Wrapper ( ) ; K Star Wrapper vals = new K Star Wrapper ( ) ; int testvalue = ( int ) m Test . value ( m Attr Index ) ; aimfor = ( m Total Count - m Distribution [ testvalue ] ) * ( double ) m Blend Factor / NUM + m Distribution [ testvalue ] ; tstop = NUM - m Blend Factor / NUM ; lower = NUM + ROOT FINDER ACCURACY / NUM ; upper = NUM - ROOT FINDER ACCURACY / NUM ; calculate Sphere Size ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculate Sphere Size ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avg Prob == NUM ) { calculate Sphere Size ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > NUM ) { tstop = upper ; vals . avg Prob = upvals . avg Prob ; } else { for ( ; ; ) { itcount ++ ; calculate Sphere Size ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT FINDER ACCURACY || itcount >= ROOT FINDER MAX ITER ) { break ; } if ( vals . sphere > NUM ) { lower = tstop ; tstop = ( upper + lower ) / NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / NUM ; } } } m Smallest Prob = vals . min Prob ; m Average Prob = vals . avg Prob ; switch ( m Missing Mode ) { case M DELETE : m Missing Prob = NUM ; break ; case M NORMAL : m Missing Prob = NUM ; break ; case M MAXDIFF : m Missing Prob = m Smallest Prob ; break ; case M AVERAGE : m Missing Prob = m Average Prob ; break ; } if ( Math . abs ( vals . avg Prob - m Total Count ) < EPSILON ) { stop Prob = NUM ; } else { stop Prob = tstop ; } return stop Prob ; }
private double stopProbUsingBlend ( ) { int itcount = _NUM ; double stopProb , aimfor ; double lower , upper , tstop ; KStarWrapper botvals = new KStarWrapper ( ) ; KStarWrapper upvals = new KStarWrapper ( ) ; KStarWrapper vals = new KStarWrapper ( ) ; int testvalue = ( int ) m_Test . value ( m_AttrIndex ) ; aimfor = ( m_TotalCount - m_Distribution [ testvalue ] ) * ( double ) m_BlendFactor / _NUM + m_Distribution [ testvalue ] ; tstop = _NUM - m_BlendFactor / _NUM ; lower = _NUM + ROOT_FINDER_ACCURACY / _NUM ; upper = _NUM - ROOT_FINDER_ACCURACY / _NUM ; calculateSphereSize ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculateSphereSize ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avgProb == _NUM ) { calculateSphereSize ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > _NUM ) { tstop = upper ; vals . avgProb = upvals . avgProb ; } else { for ( ; ; ) { itcount ++ ; calculateSphereSize ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT_FINDER_ACCURACY || itcount >= ROOT_FINDER_MAX_ITER ) { break ; } if ( vals . sphere > _NUM ) { lower = tstop ; tstop = ( upper + lower ) / _NUM ; } else { upper = tstop ; tstop = ( upper + lower ) / _NUM ; } } } m_SmallestProb = vals . minProb ; m_AverageProb = vals . avgProb ; switch ( m_MissingMode ) { case M_DELETE : m_MissingProb = _NUM ; break ; case M_NORMAL : m_MissingProb = _NUM ; break ; case M_MAXDIFF : m_MissingProb = m_SmallestProb ; break ; case M_AVERAGE : m_MissingProb = m_AverageProb ; break ; } if ( Math . abs ( vals . avgProb - m_TotalCount ) < EPSILON ) { stopProb = _NUM ; } else { stopProb = tstop ; } return stopProb ; }
432
java-test-494
java
How does a jdbc connection string return ?
using the current configuration and url
public String connection String ( String url Pattern ) { Properties props = config . as Properties ( ) ; return find And Replace ( url Pattern , props , Jdbc Configuration . DATABASE , Jdbc Configuration . HOSTNAME , Jdbc Configuration . PORT , Jdbc Configuration . USER , Jdbc Configuration . PASSWORD ) ; }
public String connectionString ( String urlPattern ) { Properties props = config . asProperties ( ) ; return findAndReplace ( urlPattern , props , JdbcConfiguration . DATABASE , JdbcConfiguration . HOSTNAME , JdbcConfiguration . PORT , JdbcConfiguration . USER , JdbcConfiguration . PASSWORD ) ; }
57
java-test-495
java
Why can we not rely on the input file sizes in contrast to mr ?
because inputs might be passed via rdds
public static boolean check CP Reblock ( Execution Context ec , String varin ) throws DML Runtime Exception { Cacheable Data < ? > obj = ec . get Cacheable Data ( varin ) ; Matrix Characteristics mc = ec . get Matrix Characteristics ( varin ) ; long rows = mc . get Rows ( ) ; long cols = mc . get Cols ( ) ; long nnz = mc . get Non Zeros ( ) ; if ( ! Configuration Manager . is Dynamic Recompilation ( ) || ! Optimizer Utils . is Hybrid Execution Mode ( ) ) { return BOOL ; } Matrix Format Meta Data iimd = ( Matrix Format Meta Data ) obj . get Meta Data ( ) ; if ( obj . get RDD Handle ( ) != null && iimd . get Input Info ( ) != Input Info . Binary Block Input Info && iimd . get Input Info ( ) != Input Info . Binary Cell Input Info ) { return BOOL ; } if ( rows <= NUM || cols <= NUM ) { return BOOL ; } double sp = Optimizer Utils . get Sparsity ( rows , cols , nnz ) ; double mem = Matrix Block . estimate Size In Memory ( rows , cols , sp ) ; if ( ! Optimizer Utils . is Valid CP Dimensions ( rows , cols ) || ! Optimizer Utils . is Valid CP Matrix Size ( rows , cols , sp ) || mem >= Optimizer Utils . get Local Mem Budget ( ) ) { return BOOL ; } long est Filesize = ( long ) ( NUM * mem ) ; long cp Threshold = CP REBLOCK THRESHOLD SIZE * Optimizer Utils . get Parallel Text Read Parallelism ( ) ; return ( est Filesize < cp Threshold ) ; }
public static boolean checkCPReblock ( ExecutionContext ec , String varin ) throws DMLRuntimeException { CacheableData < ? > obj = ec . getCacheableData ( varin ) ; MatrixCharacteristics mc = ec . getMatrixCharacteristics ( varin ) ; long rows = mc . getRows ( ) ; long cols = mc . getCols ( ) ; long nnz = mc . getNonZeros ( ) ; if ( ! ConfigurationManager . isDynamicRecompilation ( ) || ! OptimizerUtils . isHybridExecutionMode ( ) ) { return _BOOL ; } MatrixFormatMetaData iimd = ( MatrixFormatMetaData ) obj . getMetaData ( ) ; if ( obj . getRDDHandle ( ) != null && iimd . getInputInfo ( ) != InputInfo . BinaryBlockInputInfo && iimd . getInputInfo ( ) != InputInfo . BinaryCellInputInfo ) { return _BOOL ; } if ( rows <= _NUM || cols <= _NUM ) { return _BOOL ; } double sp = OptimizerUtils . getSparsity ( rows , cols , nnz ) ; double mem = MatrixBlock . estimateSizeInMemory ( rows , cols , sp ) ; if ( ! OptimizerUtils . isValidCPDimensions ( rows , cols ) || ! OptimizerUtils . isValidCPMatrixSize ( rows , cols , sp ) || mem >= OptimizerUtils . getLocalMemBudget ( ) ) { return _BOOL ; } long estFilesize = ( long ) ( _NUM * mem ) ; long cpThreshold = CP_REBLOCK_THRESHOLD_SIZE * OptimizerUtils . getParallelTextReadParallelism ( ) ; return ( estFilesize < cpThreshold ) ; }
318
java-test-496
java
How might inputs be passed ?
via rdds
public static boolean check CP Reblock ( Execution Context ec , String varin ) throws DML Runtime Exception { Cacheable Data < ? > obj = ec . get Cacheable Data ( varin ) ; Matrix Characteristics mc = ec . get Matrix Characteristics ( varin ) ; long rows = mc . get Rows ( ) ; long cols = mc . get Cols ( ) ; long nnz = mc . get Non Zeros ( ) ; if ( ! Configuration Manager . is Dynamic Recompilation ( ) || ! Optimizer Utils . is Hybrid Execution Mode ( ) ) { return BOOL ; } Matrix Format Meta Data iimd = ( Matrix Format Meta Data ) obj . get Meta Data ( ) ; if ( obj . get RDD Handle ( ) != null && iimd . get Input Info ( ) != Input Info . Binary Block Input Info && iimd . get Input Info ( ) != Input Info . Binary Cell Input Info ) { return BOOL ; } if ( rows <= NUM || cols <= NUM ) { return BOOL ; } double sp = Optimizer Utils . get Sparsity ( rows , cols , nnz ) ; double mem = Matrix Block . estimate Size In Memory ( rows , cols , sp ) ; if ( ! Optimizer Utils . is Valid CP Dimensions ( rows , cols ) || ! Optimizer Utils . is Valid CP Matrix Size ( rows , cols , sp ) || mem >= Optimizer Utils . get Local Mem Budget ( ) ) { return BOOL ; } long est Filesize = ( long ) ( NUM * mem ) ; long cp Threshold = CP REBLOCK THRESHOLD SIZE * Optimizer Utils . get Parallel Text Read Parallelism ( ) ; return ( est Filesize < cp Threshold ) ; }
public static boolean checkCPReblock ( ExecutionContext ec , String varin ) throws DMLRuntimeException { CacheableData < ? > obj = ec . getCacheableData ( varin ) ; MatrixCharacteristics mc = ec . getMatrixCharacteristics ( varin ) ; long rows = mc . getRows ( ) ; long cols = mc . getCols ( ) ; long nnz = mc . getNonZeros ( ) ; if ( ! ConfigurationManager . isDynamicRecompilation ( ) || ! OptimizerUtils . isHybridExecutionMode ( ) ) { return _BOOL ; } MatrixFormatMetaData iimd = ( MatrixFormatMetaData ) obj . getMetaData ( ) ; if ( obj . getRDDHandle ( ) != null && iimd . getInputInfo ( ) != InputInfo . BinaryBlockInputInfo && iimd . getInputInfo ( ) != InputInfo . BinaryCellInputInfo ) { return _BOOL ; } if ( rows <= _NUM || cols <= _NUM ) { return _BOOL ; } double sp = OptimizerUtils . getSparsity ( rows , cols , nnz ) ; double mem = MatrixBlock . estimateSizeInMemory ( rows , cols , sp ) ; if ( ! OptimizerUtils . isValidCPDimensions ( rows , cols ) || ! OptimizerUtils . isValidCPMatrixSize ( rows , cols , sp ) || mem >= OptimizerUtils . getLocalMemBudget ( ) ) { return _BOOL ; } long estFilesize = ( long ) ( _NUM * mem ) ; long cpThreshold = CP_REBLOCK_THRESHOLD_SIZE * OptimizerUtils . getParallelTextReadParallelism ( ) ; return ( estFilesize < cpThreshold ) ; }
318
java-test-497
java
What will this draw to the graphics context ?
the node i d
@ Override public void draw Node ( Graphics g , int w , int h ) { if ( ( m type & PURE INPUT ) == PURE INPUT ) { g . set Color ( Color . green ) ; } else { g . set Color ( Color . orange ) ; } Font Metrics fm = g . get Font Metrics ( ) ; int l = ( int ) ( m x * w ) - fm . string Width ( m id ) / NUM ; int t = ( int ) ( m y * h ) - fm . get Height ( ) / NUM ; g . fill 3 D Rect ( l , t , fm . string Width ( m id ) + NUM , fm . get Height ( ) + fm . get Descent ( ) + NUM , BOOL ) ; g . set Color ( Color . black ) ; g . draw String ( m id , l + NUM , t + fm . get Height ( ) + NUM ) ; }
@ Override public void drawNode ( Graphics g , int w , int h ) { if ( ( m_type & PURE_INPUT ) == PURE_INPUT ) { g . setColor ( Color . green ) ; } else { g . setColor ( Color . orange ) ; } FontMetrics fm = g . getFontMetrics ( ) ; int l = ( int ) ( m_x * w ) - fm . stringWidth ( m_id ) / _NUM ; int t = ( int ) ( m_y * h ) - fm . getHeight ( ) / _NUM ; g . fill3DRect ( l , t , fm . stringWidth ( m_id ) + _NUM , fm . getHeight ( ) + fm . getDescent ( ) + _NUM , _BOOL ) ; g . setColor ( Color . black ) ; g . drawString ( m_id , l + _NUM , t + fm . getHeight ( ) + _NUM ) ; }
189
java-test-498
java
When is the annotation correct ?
when an object is marshalled
private URL [ ] do Get UR Ls ( Class Loader cl ) { if ( disable Smart Get Url ) { return super . get UR Ls ( ) ; } URL [ ] urls = null ; if ( cl . equals ( this ) ) { urls = super . get UR Ls ( ) ; } else { if ( cl instanceof Service Class Loader ) { Service Class Loader scl = ( Service Class Loader ) cl ; urls = scl . get UR Ls ( ) ; } else { urls = super . get UR Ls ( ) ; } } return ( urls ) ; }
private URL [ ] doGetURLs ( ClassLoader cl ) { if ( disableSmartGetUrl ) { return super . getURLs ( ) ; } URL [ ] urls = null ; if ( cl . equals ( this ) ) { urls = super . getURLs ( ) ; } else { if ( cl instanceof ServiceClassLoader ) { ServiceClassLoader scl = ( ServiceClassLoader ) cl ; urls = scl . getURLs ( ) ; } else { urls = super . getURLs ( ) ; } } return ( urls ) ; }
114
java-test-499
java
What does the code compute ?
the hyperbolic tangent of a number
public static double tanh ( double x ) { boolean negate = BOOL ; if ( Double . is Na N ( x ) ) { return x ; } if ( x > NUM ) { return NUM ; } if ( x < - NUM ) { return - NUM ; } if ( x == NUM ) { return x ; } if ( x < NUM ) { x = - x ; negate = BOOL ; } double result ; if ( x >= NUM ) { double hi Prec [ ] = new double [ NUM ] ; exp ( x * NUM , NUM , hi Prec ) ; double ya = hi Prec [ NUM ] + hi Prec [ NUM ] ; double yb = - ( ya - hi Prec [ NUM ] - hi Prec [ NUM ] ) ; double na = - NUM + ya ; double nb = - ( na + NUM - ya ) ; double temp = na + yb ; nb += - ( temp - na - yb ) ; na = temp ; double da = NUM + ya ; double db = - ( da - NUM - ya ) ; temp = da + yb ; db += - ( temp - da - yb ) ; da = temp ; temp = da * HEX 40000000 ; double daa = da + temp - temp ; double dab = da - daa ; double ratio = na / da ; temp = ratio * HEX 40000000 ; double ratioa = ratio + temp - temp ; double ratiob = ratio - ratioa ; ratiob += ( na - daa * ratioa - daa * ratiob - dab * ratioa - dab * ratiob ) / da ; ratiob += nb / da ; ratiob += - db * na / da / da ; result = ratioa + ratiob ; } else { double hi Prec [ ] = new double [ NUM ] ; expm 1 ( x * NUM , hi Prec ) ; double ya = hi Prec [ NUM ] + hi Prec [ NUM ] ; double yb = - ( ya - hi Prec [ NUM ] - hi Prec [ NUM ] ) ; double na = ya ; double nb = yb ; double da = NUM + ya ; double db = - ( da - NUM - ya ) ; double temp = da + yb ; db += - ( temp - da - yb ) ; da = temp ; temp = da * HEX 40000000 ; double daa = da + temp - temp ; double dab = da - daa ; double ratio = na / da ; temp = ratio * HEX 40000000 ; double ratioa = ratio + temp - temp ; double ratiob = ratio - ratioa ; ratiob += ( na - daa * ratioa - daa * ratiob - dab * ratioa - dab * ratiob ) / da ; ratiob += nb / da ; ratiob += - db * na / da / da ; result = ratioa + ratiob ; } if ( negate ) { result = - result ; } return result ; }
public static double tanh ( double x ) { boolean negate = _BOOL ; if ( Double . isNaN ( x ) ) { return x ; } if ( x > _NUM ) { return _NUM ; } if ( x < - _NUM ) { return - _NUM ; } if ( x == _NUM ) { return x ; } if ( x < _NUM ) { x = - x ; negate = _BOOL ; } double result ; if ( x >= _NUM ) { double hiPrec [ ] = new double [ _NUM ] ; exp ( x * _NUM , _NUM , hiPrec ) ; double ya = hiPrec [ _NUM ] + hiPrec [ _NUM ] ; double yb = - ( ya - hiPrec [ _NUM ] - hiPrec [ _NUM ] ) ; double na = - _NUM + ya ; double nb = - ( na + _NUM - ya ) ; double temp = na + yb ; nb += - ( temp - na - yb ) ; na = temp ; double da = _NUM + ya ; double db = - ( da - _NUM - ya ) ; temp = da + yb ; db += - ( temp - da - yb ) ; da = temp ; temp = da * HEX_40000000 ; double daa = da + temp - temp ; double dab = da - daa ; double ratio = na / da ; temp = ratio * HEX_40000000 ; double ratioa = ratio + temp - temp ; double ratiob = ratio - ratioa ; ratiob += ( na - daa * ratioa - daa * ratiob - dab * ratioa - dab * ratiob ) / da ; ratiob += nb / da ; ratiob += - db * na / da / da ; result = ratioa + ratiob ; } else { double hiPrec [ ] = new double [ _NUM ] ; expm1 ( x * _NUM , hiPrec ) ; double ya = hiPrec [ _NUM ] + hiPrec [ _NUM ] ; double yb = - ( ya - hiPrec [ _NUM ] - hiPrec [ _NUM ] ) ; double na = ya ; double nb = yb ; double da = _NUM + ya ; double db = - ( da - _NUM - ya ) ; double temp = da + yb ; db += - ( temp - da - yb ) ; da = temp ; temp = da * HEX_40000000 ; double daa = da + temp - temp ; double dab = da - daa ; double ratio = na / da ; temp = ratio * HEX_40000000 ; double ratioa = ratio + temp - temp ; double ratiob = ratio - ratioa ; ratiob += ( na - daa * ratioa - daa * ratiob - dab * ratioa - dab * ratiob ) / da ; ratiob += nb / da ; ratiob += - db * na / da / da ; result = ratioa + ratiob ; } if ( negate ) { result = - result ; } return result ; }
561
java-test-500
java
What be the code handle ?
the error of a channelinfo request result
private void handle Channel Info Result Error ( String stream , Request Type type , int response Code ) { if ( type == Request Type . CHANNEL ) { if ( response Code == NUM ) { result Listener . received Channel Info ( stream , null , Request Result . NOT FOUND ) ; } else { result Listener . received Channel Info ( stream , null , Request Result . FAILED ) ; } } else { if ( response Code == NUM ) { result Listener . put Channel Info Result ( Request Result . NOT FOUND ) ; } else if ( response Code == NUM || response Code == NUM ) { LOGGER . warning ( STRING ) ; result Listener . put Channel Info Result ( Request Result . ACCESS DENIED ) ; access Denied ( ) ; } else if ( response Code == NUM ) { LOGGER . warning ( STRING ) ; result Listener . put Channel Info Result ( Request Result . INVALID STREAM STATUS ) ; } else { LOGGER . warning ( STRING + response Code + STRING ) ; result Listener . put Channel Info Result ( Request Result . FAILED ) ; } } }
private void handleChannelInfoResultError ( String stream , RequestType type , int responseCode ) { if ( type == RequestType . CHANNEL ) { if ( responseCode == _NUM ) { resultListener . receivedChannelInfo ( stream , null , RequestResult . NOT_FOUND ) ; } else { resultListener . receivedChannelInfo ( stream , null , RequestResult . FAILED ) ; } } else { if ( responseCode == _NUM ) { resultListener . putChannelInfoResult ( RequestResult . NOT_FOUND ) ; } else if ( responseCode == _NUM || responseCode == _NUM ) { LOGGER . warning ( STRING ) ; resultListener . putChannelInfoResult ( RequestResult . ACCESS_DENIED ) ; accessDenied ( ) ; } else if ( responseCode == _NUM ) { LOGGER . warning ( STRING ) ; resultListener . putChannelInfoResult ( RequestResult . INVALID_STREAM_STATUS ) ; } else { LOGGER . warning ( STRING + responseCode + STRING ) ; resultListener . putChannelInfoResult ( RequestResult . FAILED ) ; } } }
210
java-test-501
java
When do the reader close ?
while closing are ignored
public static long copy And Close Input ( Reader in , Writer out , long length ) throws IO Exception { try { long copied = NUM ; int len = ( int ) Math . min ( length , Constants . IO BUFFER SIZE ) ; char [ ] buffer = new char [ len ] ; while ( length > NUM ) { len = in . read ( buffer , NUM , len ) ; if ( len < NUM ) { break ; } if ( out != null ) { out . write ( buffer , NUM , len ) ; } length -= len ; len = ( int ) Math . min ( length , Constants . IO BUFFER SIZE ) ; copied += len ; } return copied ; } catch ( Exception e ) { throw Db Exception . convert To IO Exception ( e ) ; } finally { in . close ( ) ; } }
public static long copyAndCloseInput ( Reader in , Writer out , long length ) throws IOException { try { long copied = _NUM ; int len = ( int ) Math . min ( length , Constants . IO_BUFFER_SIZE ) ; char [ ] buffer = new char [ len ] ; while ( length > _NUM ) { len = in . read ( buffer , _NUM , len ) ; if ( len < _NUM ) { break ; } if ( out != null ) { out . write ( buffer , _NUM , len ) ; } length -= len ; len = ( int ) Math . min ( length , Constants . IO_BUFFER_SIZE ) ; copied += len ; } return copied ; } catch ( Exception e ) { throw DbException . convertToIOException ( e ) ; } finally { in . close ( ) ; } }
167
java-test-504
java
What does the code process ?
a log event
private void process Event ( Event Log Control check , final String name , final DTN Host host 1 , final DTN Host host 2 , final Message message ) { String desc String ; if ( ! check . show Event ( ) ) { return ; } desc String = name + STRING + ( host 1 != null ? host 1 : STRING ) + ( host 2 != null ? ( HOST DELIM + host 2 ) : STRING ) + ( message != null ? STRING + message : STRING ) ; if ( reg Exp != null && ! desc String . matches ( reg Exp ) ) { return ; } if ( check . pause On Event ( ) ) { gui . set Paused ( BOOL ) ; if ( host 1 != null ) { gui . set Focus ( host 1 ) ; } } add Event ( name , host 1 , host 2 , message , check . pause On Event ( ) ) ; }
private void processEvent ( EventLogControl check , final String name , final DTNHost host1 , final DTNHost host2 , final Message message ) { String descString ; if ( ! check . showEvent ( ) ) { return ; } descString = name + STRING + ( host1 != null ? host1 : STRING ) + ( host2 != null ? ( HOST_DELIM + host2 ) : STRING ) + ( message != null ? STRING + message : STRING ) ; if ( regExp != null && ! descString . matches ( regExp ) ) { return ; } if ( check . pauseOnEvent ( ) ) { gui . setPaused ( _BOOL ) ; if ( host1 != null ) { gui . setFocus ( host1 ) ; } } addEvent ( name , host1 , host2 , message , check . pauseOnEvent ( ) ) ; }
179
java-test-505
java
What does the code get ?
the log of the factorial of a number . upto 32
public static double ln Factorial ( int x ) { if ( x < NUM ) throw new Illegal Argument Exception ( STRING + x ) ; else if ( x > NUM ) return ln Gamma ( x + NUM ) ; else { int l = factorials Buffer . size ( ) ; for ( int i = l ; i <= x ; i ++ ) { factorials Buffer . add ( log ( i ) + factorials Buffer . get ( i - NUM ) ) ; } return factorials Buffer . get ( x ) ; } }
public static double lnFactorial ( int x ) { if ( x < _NUM ) throw new IllegalArgumentException ( STRING + x ) ; else if ( x > _NUM ) return lnGamma ( x + _NUM ) ; else { int l = factorialsBuffer . size ( ) ; for ( int i = l ; i <= x ; i ++ ) { factorialsBuffer . add ( log ( i ) + factorialsBuffer . get ( i - _NUM ) ) ; } return factorialsBuffer . get ( x ) ; } }
103
java-test-506
java
Why is the gamma function used ?
because the numbers can ' t be represented anyway
public static double ln Factorial ( int x ) { if ( x < NUM ) throw new Illegal Argument Exception ( STRING + x ) ; else if ( x > NUM ) return ln Gamma ( x + NUM ) ; else { int l = factorials Buffer . size ( ) ; for ( int i = l ; i <= x ; i ++ ) { factorials Buffer . add ( log ( i ) + factorials Buffer . get ( i - NUM ) ) ; } return factorials Buffer . get ( x ) ; } }
public static double lnFactorial ( int x ) { if ( x < _NUM ) throw new IllegalArgumentException ( STRING + x ) ; else if ( x > _NUM ) return lnGamma ( x + _NUM ) ; else { int l = factorialsBuffer . size ( ) ; for ( int i = l ; i <= x ; i ++ ) { factorialsBuffer . add ( log ( i ) + factorialsBuffer . get ( i - _NUM ) ) ; } return factorialsBuffer . get ( x ) ; } }
103
java-test-509
java
How did populated attribute values load ?
from provided inputstream property file
public static Service Configuration create ( Input Stream in Stream ) throws IO Exception , Illegal Argument Exception { try { check Not Null ( in Stream ) ; Properties properties = new Properties ( ) ; properties . load ( in Stream ) ; return ( create ( properties ) ) ; } finally { if ( in Stream != null ) { in Stream . close ( ) ; } } }
public static ServiceConfiguration create ( InputStream inStream ) throws IOException , IllegalArgumentException { try { checkNotNull ( inStream ) ; Properties properties = new Properties ( ) ; properties . load ( inStream ) ; return ( create ( properties ) ) ; } finally { if ( inStream != null ) { inStream . close ( ) ; } } }
74
java-test-510
java
What does it load ?
with populated attribute values loaded from provided inputstream property file
public static Service Configuration create ( Input Stream in Stream ) throws IO Exception , Illegal Argument Exception { try { check Not Null ( in Stream ) ; Properties properties = new Properties ( ) ; properties . load ( in Stream ) ; return ( create ( properties ) ) ; } finally { if ( in Stream != null ) { in Stream . close ( ) ; } } }
public static ServiceConfiguration create ( InputStream inStream ) throws IOException , IllegalArgumentException { try { checkNotNull ( inStream ) ; Properties properties = new Properties ( ) ; properties . load ( inStream ) ; return ( create ( properties ) ) ; } finally { if ( inStream != null ) { inStream . close ( ) ; } } }
74
java-test-511
java
What do the knowledgeedge ' s represent ?
required edges
public final Iterator < Knowledge Edge > required Edges Iterator ( ) { Set < Knowledge Edge > edges = new Hash Set < > ( ) ; for ( Ordered Pair < Set < My Node > > o : required Rules Specs ) { final Set < My Node > first = o . get First ( ) ; for ( My Node s1 : first ) { final Set < My Node > second = o . get Second ( ) ; for ( My Node s2 : second ) { if ( ! s1 . equals ( s2 ) ) { edges . add ( new Knowledge Edge ( s1 . get Name ( ) , s2 . get Name ( ) ) ) ; } } } } return edges . iterator ( ) ; }
public final Iterator < KnowledgeEdge > requiredEdgesIterator ( ) { Set < KnowledgeEdge > edges = new HashSet < > ( ) ; for ( OrderedPair < Set < MyNode > > o : requiredRulesSpecs ) { final Set < MyNode > first = o . getFirst ( ) ; for ( MyNode s1 : first ) { final Set < MyNode > second = o . getSecond ( ) ; for ( MyNode s2 : second ) { if ( ! s1 . equals ( s2 ) ) { edges . add ( new KnowledgeEdge ( s1 . getName ( ) , s2 . getName ( ) ) ) ; } } } } return edges . iterator ( ) ; }
141
java-test-512
java
What is representing required edges ?
the knowledgeedge ' s
public final Iterator < Knowledge Edge > required Edges Iterator ( ) { Set < Knowledge Edge > edges = new Hash Set < > ( ) ; for ( Ordered Pair < Set < My Node > > o : required Rules Specs ) { final Set < My Node > first = o . get First ( ) ; for ( My Node s1 : first ) { final Set < My Node > second = o . get Second ( ) ; for ( My Node s2 : second ) { if ( ! s1 . equals ( s2 ) ) { edges . add ( new Knowledge Edge ( s1 . get Name ( ) , s2 . get Name ( ) ) ) ; } } } } return edges . iterator ( ) ; }
public final Iterator < KnowledgeEdge > requiredEdgesIterator ( ) { Set < KnowledgeEdge > edges = new HashSet < > ( ) ; for ( OrderedPair < Set < MyNode > > o : requiredRulesSpecs ) { final Set < MyNode > first = o . getFirst ( ) ; for ( MyNode s1 : first ) { final Set < MyNode > second = o . getSecond ( ) ; for ( MyNode s2 : second ) { if ( ! s1 . equals ( s2 ) ) { edges . add ( new KnowledgeEdge ( s1 . getName ( ) , s2 . getName ( ) ) ) ; } } } } return edges . iterator ( ) ; }
141
java-test-513
java
What does this force it ?
to be two digits long
private static String force Number String To Two Digits ( String text ) { while ( text . length ( ) < NUM ) { text = STRING + text ; } if ( text . length ( ) > NUM ) { text = text . substring ( text . length ( ) - NUM , text . length ( ) ) ; } return text ; }
private static String forceNumberStringToTwoDigits ( String text ) { while ( text . length ( ) < _NUM ) { text = STRING + text ; } if ( text . length ( ) > _NUM ) { text = text . substring ( text . length ( ) - _NUM , text . length ( ) ) ; } return text ; }
69
java-test-514
java
For what purpose is it zero padded if there is only one digit ?
to enforce a two digit string result
private static String force Number String To Two Digits ( String text ) { while ( text . length ( ) < NUM ) { text = STRING + text ; } if ( text . length ( ) > NUM ) { text = text . substring ( text . length ( ) - NUM , text . length ( ) ) ; } return text ; }
private static String forceNumberStringToTwoDigits ( String text ) { while ( text . length ( ) < _NUM ) { text = STRING + text ; } if ( text . length ( ) > _NUM ) { text = text . substring ( text . length ( ) - _NUM , text . length ( ) ) ; } return text ; }
69
java-test-515
java
What does this take ?
a string of digits
private static String force Number String To Two Digits ( String text ) { while ( text . length ( ) < NUM ) { text = STRING + text ; } if ( text . length ( ) > NUM ) { text = text . substring ( text . length ( ) - NUM , text . length ( ) ) ; } return text ; }
private static String forceNumberStringToTwoDigits ( String text ) { while ( text . length ( ) < _NUM ) { text = STRING + text ; } if ( text . length ( ) > _NUM ) { text = text . substring ( text . length ( ) - _NUM , text . length ( ) ) ; } return text ; }
69
java-test-516
java
What do you try ?
to unlock from another thread
@ Deprecated public void unlock ( Lock State < T > lock State ) { if ( lock State == null ) { throw new Illegal Argument Exception ( STRING ) ; } if ( lock State . set Lock != this ) { throw new Illegal Argument Exception ( STRING ) ; } if ( lock State . thread != Thread . current Thread ( ) ) { throw new Illegal Argument Exception ( STRING ) ; } thread Set . remove ( Thread . current Thread ( ) ) ; for ( Reentrant Lock lock : lock State . locks ) { lock . unlock ( ) ; } }
@ Deprecated public void unlock ( LockState < T > lockState ) { if ( lockState == null ) { throw new IllegalArgumentException ( STRING ) ; } if ( lockState . setLock != this ) { throw new IllegalArgumentException ( STRING ) ; } if ( lockState . thread != Thread . currentThread ( ) ) { throw new IllegalArgumentException ( STRING ) ; } threadSet . remove ( Thread . currentThread ( ) ) ; for ( ReentrantLock lock : lockState . locks ) { lock . unlock ( ) ; } }
112
java-test-518
java
How does jpa entities find ?
by their primary keys
public static < E extends Identifiable > List < E > find By Primary Keys ( Entity Manager em , List < Big Integer > ids , Class < E > type ) { require Argument ( em != null , STRING ) ; require Argument ( ids != null && ! ids . is Empty ( ) , STRING ) ; require Argument ( type != null , STRING ) ; Typed Query < E > query = em . create Named Query ( STRING , type ) ; query . set Hint ( STRING , STRING ) ; try { query . set Parameter ( STRING , ids ) ; query . set Parameter ( STRING , BOOL ) ; return query . get Result List ( ) ; } catch ( No Result Exception ex ) { return new Array List < > ( NUM ) ; } }
public static < E extends Identifiable > List < E > findByPrimaryKeys ( EntityManager em , List < BigInteger > ids , Class < E > type ) { requireArgument ( em != null , STRING ) ; requireArgument ( ids != null && ! ids . isEmpty ( ) , STRING ) ; requireArgument ( type != null , STRING ) ; TypedQuery < E > query = em . createNamedQuery ( STRING , type ) ; query . setHint ( STRING , STRING ) ; try { query . setParameter ( STRING , ids ) ; query . setParameter ( STRING , _BOOL ) ; return query . getResultList ( ) ; } catch ( NoResultException ex ) { return new ArrayList < > ( _NUM ) ; } }
152
java-test-519
java
When must a remote object be have exported ?
before it can have any calls in progress
static void increment Keep Alive Count ( ) { synchronized ( keep Alive Lock ) { keep Alive Count ++ ; if ( reaper == null ) { reaper = Access Controller . do Privileged ( new New Thread Action ( new Reaper ( ) , STRING , BOOL ) ) ; reaper . start ( ) ; } if ( gc Latency Request == null ) { gc Latency Request = GC . request Latency ( gc Interval ) ; } } }
static void incrementKeepAliveCount ( ) { synchronized ( keepAliveLock ) { keepAliveCount ++ ; if ( reaper == null ) { reaper = AccessController . doPrivileged ( new NewThreadAction ( new Reaper ( ) , STRING , _BOOL ) ) ; reaper . start ( ) ; } if ( gcLatencyRequest == null ) { gcLatencyRequest = GC . requestLatency ( gcInterval ) ; } } }
84
java-test-520
java
What can it have ?
any calls in progress
static void increment Keep Alive Count ( ) { synchronized ( keep Alive Lock ) { keep Alive Count ++ ; if ( reaper == null ) { reaper = Access Controller . do Privileged ( new New Thread Action ( new Reaper ( ) , STRING , BOOL ) ) ; reaper . start ( ) ; } if ( gc Latency Request == null ) { gc Latency Request = GC . request Latency ( gc Interval ) ; } } }
static void incrementKeepAliveCount ( ) { synchronized ( keepAliveLock ) { keepAliveCount ++ ; if ( reaper == null ) { reaper = AccessController . doPrivileged ( new NewThreadAction ( new Reaper ( ) , STRING , _BOOL ) ) ; reaper . start ( ) ; } if ( gcLatencyRequest == null ) { gcLatencyRequest = GC . requestLatency ( gcInterval ) ; } } }
84
java-test-521
java
What have calls in progress still ?
non - permanent remote objects
static void increment Keep Alive Count ( ) { synchronized ( keep Alive Lock ) { keep Alive Count ++ ; if ( reaper == null ) { reaper = Access Controller . do Privileged ( new New Thread Action ( new Reaper ( ) , STRING , BOOL ) ) ; reaper . start ( ) ; } if ( gc Latency Request == null ) { gc Latency Request = GC . request Latency ( gc Interval ) ; } } }
static void incrementKeepAliveCount ( ) { synchronized ( keepAliveLock ) { keepAliveCount ++ ; if ( reaper == null ) { reaper = AccessController . doPrivileged ( new NewThreadAction ( new Reaper ( ) , STRING , _BOOL ) ) ; reaper . start ( ) ; } if ( gcLatencyRequest == null ) { gcLatencyRequest = GC . requestLatency ( gcInterval ) ; } } }
84
java-test-522
java
What do non - permanent remote objects have still ?
calls in progress
static void increment Keep Alive Count ( ) { synchronized ( keep Alive Lock ) { keep Alive Count ++ ; if ( reaper == null ) { reaper = Access Controller . do Privileged ( new New Thread Action ( new Reaper ( ) , STRING , BOOL ) ) ; reaper . start ( ) ; } if ( gc Latency Request == null ) { gc Latency Request = GC . request Latency ( gc Interval ) ; } } }
static void incrementKeepAliveCount ( ) { synchronized ( keepAliveLock ) { keepAliveCount ++ ; if ( reaper == null ) { reaper = AccessController . doPrivileged ( new NewThreadAction ( new Reaper ( ) , STRING , _BOOL ) ) ; reaper . start ( ) ; } if ( gcLatencyRequest == null ) { gcLatencyRequest = GC . requestLatency ( gcInterval ) ; } } }
84
java-test-523
java
When is the vm kept alive ?
while the keep - alive count is greater than zero
static void increment Keep Alive Count ( ) { synchronized ( keep Alive Lock ) { keep Alive Count ++ ; if ( reaper == null ) { reaper = Access Controller . do Privileged ( new New Thread Action ( new Reaper ( ) , STRING , BOOL ) ) ; reaper . start ( ) ; } if ( gc Latency Request == null ) { gc Latency Request = GC . request Latency ( gc Interval ) ; } } }
static void incrementKeepAliveCount ( ) { synchronized ( keepAliveLock ) { keepAliveCount ++ ; if ( reaper == null ) { reaper = AccessController . doPrivileged ( new NewThreadAction ( new Reaper ( ) , STRING , _BOOL ) ) ; reaper . start ( ) ; } if ( gcLatencyRequest == null ) { gcLatencyRequest = GC . requestLatency ( gcInterval ) ; } } }
84
java-test-524
java
When did garbage collect ?
while exported
static void increment Keep Alive Count ( ) { synchronized ( keep Alive Lock ) { keep Alive Count ++ ; if ( reaper == null ) { reaper = Access Controller . do Privileged ( new New Thread Action ( new Reaper ( ) , STRING , BOOL ) ) ; reaper . start ( ) ; } if ( gc Latency Request == null ) { gc Latency Request = GC . request Latency ( gc Interval ) ; } } }
static void incrementKeepAliveCount ( ) { synchronized ( keepAliveLock ) { keepAliveCount ++ ; if ( reaper == null ) { reaper = AccessController . doPrivileged ( new NewThreadAction ( new Reaper ( ) , STRING , _BOOL ) ) ; reaper . start ( ) ; } if ( gcLatencyRequest == null ) { gcLatencyRequest = GC . requestLatency ( gcInterval ) ; } } }
84
java-test-525
java
What does the code open ?
a ftp connection
private AFTP Client action Open ( ) throws IO Exception , Page Exception { required ( STRING , server ) ; required ( STRING , username ) ; required ( STRING , password ) ; AFTP Client client = get Client ( ) ; write Cfftp ( client ) ; return client ; }
private AFTPClient actionOpen ( ) throws IOException , PageException { required ( STRING , server ) ; required ( STRING , username ) ; required ( STRING , password ) ; AFTPClient client = getClient ( ) ; writeCfftp ( client ) ; return client ; }
54
java-test-527
java
How does the code update the filename field ?
to the new value
public synchronized void rename File ( JDBC Sequential File file , String new File Name ) throws SQL Exception { try { connection . set Auto Commit ( BOOL ) ; rename File . set String ( NUM , new File Name ) ; rename File . set Int ( NUM , file . get Id ( ) ) ; rename File . execute Update ( ) ; connection . commit ( ) ; } catch ( SQL Exception e ) { connection . rollback ( ) ; throw e ; } }
public synchronized void renameFile ( JDBCSequentialFile file , String newFileName ) throws SQLException { try { connection . setAutoCommit ( _BOOL ) ; renameFile . setString ( _NUM , newFileName ) ; renameFile . setInt ( _NUM , file . getId ( ) ) ; renameFile . executeUpdate ( ) ; connection . commit ( ) ; } catch ( SQLException e ) { connection . rollback ( ) ; throw e ; } }
93
java-test-528
java
What does the code update to the new value ?
the filename field
public synchronized void rename File ( JDBC Sequential File file , String new File Name ) throws SQL Exception { try { connection . set Auto Commit ( BOOL ) ; rename File . set String ( NUM , new File Name ) ; rename File . set Int ( NUM , file . get Id ( ) ) ; rename File . execute Update ( ) ; connection . commit ( ) ; } catch ( SQL Exception e ) { connection . rollback ( ) ; throw e ; } }
public synchronized void renameFile ( JDBCSequentialFile file , String newFileName ) throws SQLException { try { connection . setAutoCommit ( _BOOL ) ; renameFile . setString ( _NUM , newFileName ) ; renameFile . setInt ( _NUM , file . getId ( ) ) ; renameFile . executeUpdate ( ) ; connection . commit ( ) ; } catch ( SQLException e ) { connection . rollback ( ) ; throw e ; } }
93
java-test-529
java
What do keys construct ?
the key statements
protected List < String > prepare Sort Key Statements ( List < Sort Key > sort Keys ) { List < String > keys = new Array List < String > ( ) ; for ( int i = NUM ; i < sort Keys . size ( ) ; i ++ ) { Sort Key sort Key = sort Keys . get ( i ) ; keys . add ( explicit Mapping . get Db Column Name ( sort Key . get Field ( ) ) + ( sort Key . is Ascending Order ( ) ? STRING : STRING ) ) ; } return keys ; }
protected List < String > prepareSortKeyStatements ( List < SortKey > sortKeys ) { List < String > keys = new ArrayList < String > ( ) ; for ( int i = _NUM ; i < sortKeys . size ( ) ; i ++ ) { SortKey sortKey = sortKeys . get ( i ) ; keys . add ( explicitMapping . getDbColumnName ( sortKey . getField ( ) ) + ( sortKey . isAscendingOrder ( ) ? STRING : STRING ) ) ; } return keys ; }
109
java-test-531
java
What listed in the supplied file ?
all the sequences
protected void transfer From File ( File id File ) throws IO Exception { try ( Buffered Reader br = new Buffered Reader ( new File Reader ( id File ) ) ) { String line ; while ( ( line = br . read Line ( ) ) != null ) { line = line . trim ( ) ; if ( line . length ( ) > NUM ) { transfer ( line ) ; } } } }
protected void transferFromFile ( File idFile ) throws IOException { try ( BufferedReader br = new BufferedReader ( new FileReader ( idFile ) ) ) { String line ; while ( ( line = br . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( line . length ( ) > _NUM ) { transfer ( line ) ; } } } }
81
java-test-532
java
Where did all the sequences list ?
in the supplied file
protected void transfer From File ( File id File ) throws IO Exception { try ( Buffered Reader br = new Buffered Reader ( new File Reader ( id File ) ) ) { String line ; while ( ( line = br . read Line ( ) ) != null ) { line = line . trim ( ) ; if ( line . length ( ) > NUM ) { transfer ( line ) ; } } } }
protected void transferFromFile ( File idFile ) throws IOException { try ( BufferedReader br = new BufferedReader ( new FileReader ( idFile ) ) ) { String line ; while ( ( line = br . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( line . length ( ) > _NUM ) { transfer ( line ) ; } } } }
81
java-test-533
java
What does the code generate ?
the hostname for a node
public static String generate Host Name ( String vm Name , String host Id ) { String hostname = vm Name + STRING + host Id ; Preconditions . check State ( hostname . equals ( hostname . to Lower Case ( ) ) , STRING ) ; return hostname ; }
public static String generateHostName ( String vmName , String hostId ) { String hostname = vmName + STRING + hostId ; Preconditions . checkState ( hostname . equals ( hostname . toLowerCase ( ) ) , STRING ) ; return hostname ; }
52
java-test-535
java
What converts to corresponding outputindex ?
parameter index
private int index To Output Index ( int parameter Index ) throws SQL Exception { try { if ( output Parameter Mapper [ parameter Index - NUM ] == - NUM ) { throw new SQL Exception ( STRING + parameter Index + STRING ) ; } return output Parameter Mapper [ parameter Index - NUM ] ; } catch ( Array Index Out Of Bounds Exception array Index Out Of Bounds Exception ) { if ( parameter Index < NUM ) { throw new SQL Exception ( STRING + parameter Index + STRING ) ; } throw new SQL Exception ( STRING + parameter Index + STRING + params . size ( ) ) ; } }
private int indexToOutputIndex ( int parameterIndex ) throws SQLException { try { if ( outputParameterMapper [ parameterIndex - _NUM ] == - _NUM ) { throw new SQLException ( STRING + parameterIndex + STRING ) ; } return outputParameterMapper [ parameterIndex - _NUM ] ; } catch ( ArrayIndexOutOfBoundsException arrayIndexOutOfBoundsException ) { if ( parameterIndex < _NUM ) { throw new SQLException ( STRING + parameterIndex + STRING ) ; } throw new SQLException ( STRING + parameterIndex + STRING + params . size ( ) ) ; } }
118
java-test-536
java
What do parameter index convert ?
to corresponding outputindex
private int index To Output Index ( int parameter Index ) throws SQL Exception { try { if ( output Parameter Mapper [ parameter Index - NUM ] == - NUM ) { throw new SQL Exception ( STRING + parameter Index + STRING ) ; } return output Parameter Mapper [ parameter Index - NUM ] ; } catch ( Array Index Out Of Bounds Exception array Index Out Of Bounds Exception ) { if ( parameter Index < NUM ) { throw new SQL Exception ( STRING + parameter Index + STRING ) ; } throw new SQL Exception ( STRING + parameter Index + STRING + params . size ( ) ) ; } }
private int indexToOutputIndex ( int parameterIndex ) throws SQLException { try { if ( outputParameterMapper [ parameterIndex - _NUM ] == - _NUM ) { throw new SQLException ( STRING + parameterIndex + STRING ) ; } return outputParameterMapper [ parameterIndex - _NUM ] ; } catch ( ArrayIndexOutOfBoundsException arrayIndexOutOfBoundsException ) { if ( parameterIndex < _NUM ) { throw new SQLException ( STRING + parameterIndex + STRING ) ; } throw new SQLException ( STRING + parameterIndex + STRING + params . size ( ) ) ; } }
118
java-test-537
java
What imitates operation of old prior to the time zone fix ?
non - time zone - ware operation
protected void enable Non Tz Aware Mode ( ) throws Replicator Exception { logger . info ( STRING ) ; String sql = STRING ; try { conn . execute ( sql ) ; } catch ( SQL Exception e ) { throw new Replicator Exception ( STRING + sql + STRING + e . get Localized Message ( ) ) ; } Time Zone host Tz = runtime . get Host Time Zone ( ) ; logger . info ( STRING + host Tz . get Display Name ( ) ) ; date Time Formatter . set Time Zone ( host Tz ) ; date Formatter . set Time Zone ( host Tz ) ; time Formatter . set Time Zone ( host Tz ) ; non Tz Aware Mode = BOOL ; }
protected void enableNonTzAwareMode ( ) throws ReplicatorException { logger . info ( STRING ) ; String sql = STRING ; try { conn . execute ( sql ) ; } catch ( SQLException e ) { throw new ReplicatorException ( STRING + sql + STRING + e . getLocalizedMessage ( ) ) ; } TimeZone hostTz = runtime . getHostTimeZone ( ) ; logger . info ( STRING + hostTz . getDisplayName ( ) ) ; dateTimeFormatter . setTimeZone ( hostTz ) ; dateFormatter . setTimeZone ( hostTz ) ; timeFormatter . setTimeZone ( hostTz ) ; nonTzAwareMode = _BOOL ; }
135
java-test-538
java
When does non - time zone - ware operation imitate operation of old ?
prior to the time zone fix
protected void enable Non Tz Aware Mode ( ) throws Replicator Exception { logger . info ( STRING ) ; String sql = STRING ; try { conn . execute ( sql ) ; } catch ( SQL Exception e ) { throw new Replicator Exception ( STRING + sql + STRING + e . get Localized Message ( ) ) ; } Time Zone host Tz = runtime . get Host Time Zone ( ) ; logger . info ( STRING + host Tz . get Display Name ( ) ) ; date Time Formatter . set Time Zone ( host Tz ) ; date Formatter . set Time Zone ( host Tz ) ; time Formatter . set Time Zone ( host Tz ) ; non Tz Aware Mode = BOOL ; }
protected void enableNonTzAwareMode ( ) throws ReplicatorException { logger . info ( STRING ) ; String sql = STRING ; try { conn . execute ( sql ) ; } catch ( SQLException e ) { throw new ReplicatorException ( STRING + sql + STRING + e . getLocalizedMessage ( ) ) ; } TimeZone hostTz = runtime . getHostTimeZone ( ) ; logger . info ( STRING + hostTz . getDisplayName ( ) ) ; dateTimeFormatter . setTimeZone ( hostTz ) ; dateFormatter . setTimeZone ( hostTz ) ; timeFormatter . setTimeZone ( hostTz ) ; nonTzAwareMode = _BOOL ; }
135
java-test-539
java
What does non - time zone - ware operation imitate prior to the time zone fix ?
operation of old
protected void enable Non Tz Aware Mode ( ) throws Replicator Exception { logger . info ( STRING ) ; String sql = STRING ; try { conn . execute ( sql ) ; } catch ( SQL Exception e ) { throw new Replicator Exception ( STRING + sql + STRING + e . get Localized Message ( ) ) ; } Time Zone host Tz = runtime . get Host Time Zone ( ) ; logger . info ( STRING + host Tz . get Display Name ( ) ) ; date Time Formatter . set Time Zone ( host Tz ) ; date Formatter . set Time Zone ( host Tz ) ; time Formatter . set Time Zone ( host Tz ) ; non Tz Aware Mode = BOOL ; }
protected void enableNonTzAwareMode ( ) throws ReplicatorException { logger . info ( STRING ) ; String sql = STRING ; try { conn . execute ( sql ) ; } catch ( SQLException e ) { throw new ReplicatorException ( STRING + sql + STRING + e . getLocalizedMessage ( ) ) ; } TimeZone hostTz = runtime . getHostTimeZone ( ) ; logger . info ( STRING + hostTz . getDisplayName ( ) ) ; dateTimeFormatter . setTimeZone ( hostTz ) ; dateFormatter . setTimeZone ( hostTz ) ; timeFormatter . setTimeZone ( hostTz ) ; nonTzAwareMode = _BOOL ; }
135
java-test-540
java
What does the code remove from a nested getter expression ?
the outermost property
private static String unwrap ( String expression ) { if ( expression . starts With ( STRING ) ) { expression = expression . substring ( expression . index Of ( STRING ) + NUM , expression . length ( ) - NUM ) ; if ( expression . ends With ( STRING ) ) { expression = expression . substring ( NUM , expression . last Index Of ( STRING ) ) ; } else { expression = expression . substring ( NUM , expression . last Index Of ( STRING ) ) ; } } return expression ; }
private static String unwrap ( String expression ) { if ( expression . startsWith ( STRING ) ) { expression = expression . substring ( expression . indexOf ( STRING ) + _NUM , expression . length ( ) - _NUM ) ; if ( expression . endsWith ( STRING ) ) { expression = expression . substring ( _NUM , expression . lastIndexOf ( STRING ) ) ; } else { expression = expression . substring ( _NUM , expression . lastIndexOf ( STRING ) ) ; } } return expression ; }
101
java-test-541
java
Why be the first time this is called realcallbacks be null ?
as there is no just - completed step in the internal auth module
private int inject Callbacks ( final Callback [ ] real Callbacks , final int state ) throws Auth Login Exception { if ( authentication Context . has More Requirements ( ) ) { if ( real Callbacks != null ) { authentication Context . submit Requirements ( real Callbacks ) ; } if ( authentication Context . has More Requirements ( ) ) { return inject And Return ( state ) ; } else { return finish Login Module ( state ) ; } } return process Error ( bundle . get String ( STRING ) , STRING ) ; }
private int injectCallbacks ( final Callback [ ] realCallbacks , final int state ) throws AuthLoginException { if ( authenticationContext . hasMoreRequirements ( ) ) { if ( realCallbacks != null ) { authenticationContext . submitRequirements ( realCallbacks ) ; } if ( authenticationContext . hasMoreRequirements ( ) ) { return injectAndReturn ( state ) ; } else { return finishLoginModule ( state ) ; } } return processError ( bundle . getString ( STRING ) , STRING ) ; }
101
java-test-542
java
What is this called the first time ?
realcallbacks
private int inject Callbacks ( final Callback [ ] real Callbacks , final int state ) throws Auth Login Exception { if ( authentication Context . has More Requirements ( ) ) { if ( real Callbacks != null ) { authentication Context . submit Requirements ( real Callbacks ) ; } if ( authentication Context . has More Requirements ( ) ) { return inject And Return ( state ) ; } else { return finish Login Module ( state ) ; } } return process Error ( bundle . get String ( STRING ) , STRING ) ; }
private int injectCallbacks ( final Callback [ ] realCallbacks , final int state ) throws AuthLoginException { if ( authenticationContext . hasMoreRequirements ( ) ) { if ( realCallbacks != null ) { authenticationContext . submitRequirements ( realCallbacks ) ; } if ( authenticationContext . hasMoreRequirements ( ) ) { return injectAndReturn ( state ) ; } else { return finishLoginModule ( state ) ; } } return processError ( bundle . getString ( STRING ) , STRING ) ; }
101
java-test-546
java
What does the code create ?
a new project tree component
public C Project Tree ( final J Frame parent , final C Database Manager database Manager ) { Preconditions . check Not Null ( database Manager , STRING ) ; m tree Model = new C Project Tree Model ( this ) ; set Model ( m tree Model ) ; C Project Tree Drag Handler Initializer . initialize ( parent , this , database Manager ) ; add Mouse Listener ( new Internal Mouse Listener ( ) ) ; set Scrolls On Expand ( BOOL ) ; set Root Visible ( BOOL ) ; m root Node = new C Root Node ( this , database Manager ) ; m tree Model . set Root ( m root Node ) ; set Cell Renderer ( new Icon Node Renderer ( ) ) ; m popup . add ( C Action Proxy . proxy ( new C Add Database Action ( this ) ) ) ; }
public CProjectTree ( final JFrame parent , final CDatabaseManager databaseManager ) { Preconditions . checkNotNull ( databaseManager , STRING ) ; m_treeModel = new CProjectTreeModel ( this ) ; setModel ( m_treeModel ) ; CProjectTreeDragHandlerInitializer . initialize ( parent , this , databaseManager ) ; addMouseListener ( new InternalMouseListener ( ) ) ; setScrollsOnExpand ( _BOOL ) ; setRootVisible ( _BOOL ) ; m_rootNode = new CRootNode ( this , databaseManager ) ; m_treeModel . setRoot ( m_rootNode ) ; setCellRenderer ( new IconNodeRenderer ( ) ) ; m_popup . add ( CActionProxy . proxy ( new CAddDatabaseAction ( this ) ) ) ; }
157
java-test-549
java
What does the code generate ?
a random name with the specified prefix
public static String generate Random Name ( String prefix ) { String Builder sb = new String Builder ( ) ; Random random = new Random ( ) ; sb . append ( prefix ) ; for ( int i = NUM ; i < NUM ; i ++ ) { sb . append ( STRING + random . next Int ( NUM ) ) ; } return sb . to String ( ) ; }
public static String generateRandomName ( String prefix ) { StringBuilder sb = new StringBuilder ( ) ; Random random = new Random ( ) ; sb . append ( prefix ) ; for ( int i = _NUM ; i < _NUM ; i ++ ) { sb . append ( STRING + random . nextInt ( _NUM ) ) ; } return sb . toString ( ) ; }
76
java-test-550
java
What haves a receiver already ?
the graphicloader doesn ' t
public void hook Up Graphic Loader With Layer ( Graphic Loader gl ) { if ( gl != null ) { Graphic Loader Plug In glpi = new Graphic Loader Plug In ( ) ; gl . set Receiver ( glpi ) ; glpi . set Graphic Loader ( gl ) ; Layer Handler lh = get Layer Handler ( ) ; Plug In Layer pl = new Plug In Layer ( ) ; pl . set Plug In ( glpi ) ; pl . set Name ( gl . get Name ( ) ) ; pl . set Visible ( new Layer Visible ) ; if ( lh != null ) { lh . add Layer ( pl , new Layer Index ) ; } else { if ( orphan Graphic Loader Plug Ins == null ) { orphan Graphic Loader Plug Ins = new Linked List ( ) ; } orphan Graphic Loader Plug Ins . add ( pl ) ; } } }
public void hookUpGraphicLoaderWithLayer ( GraphicLoader gl ) { if ( gl != null ) { GraphicLoaderPlugIn glpi = new GraphicLoaderPlugIn ( ) ; gl . setReceiver ( glpi ) ; glpi . setGraphicLoader ( gl ) ; LayerHandler lh = getLayerHandler ( ) ; PlugInLayer pl = new PlugInLayer ( ) ; pl . setPlugIn ( glpi ) ; pl . setName ( gl . getName ( ) ) ; pl . setVisible ( newLayerVisible ) ; if ( lh != null ) { lh . addLayer ( pl , newLayerIndex ) ; } else { if ( orphanGraphicLoaderPlugIns == null ) { orphanGraphicLoaderPlugIns = new LinkedList ( ) ; } orphanGraphicLoaderPlugIns . add ( pl ) ; } } }
166
java-test-551
java
For what purpose does the pluginlayer hand to the layerhandler then ?
to get set on the map
public void hook Up Graphic Loader With Layer ( Graphic Loader gl ) { if ( gl != null ) { Graphic Loader Plug In glpi = new Graphic Loader Plug In ( ) ; gl . set Receiver ( glpi ) ; glpi . set Graphic Loader ( gl ) ; Layer Handler lh = get Layer Handler ( ) ; Plug In Layer pl = new Plug In Layer ( ) ; pl . set Plug In ( glpi ) ; pl . set Name ( gl . get Name ( ) ) ; pl . set Visible ( new Layer Visible ) ; if ( lh != null ) { lh . add Layer ( pl , new Layer Index ) ; } else { if ( orphan Graphic Loader Plug Ins == null ) { orphan Graphic Loader Plug Ins = new Linked List ( ) ; } orphan Graphic Loader Plug Ins . add ( pl ) ; } } }
public void hookUpGraphicLoaderWithLayer ( GraphicLoader gl ) { if ( gl != null ) { GraphicLoaderPlugIn glpi = new GraphicLoaderPlugIn ( ) ; gl . setReceiver ( glpi ) ; glpi . setGraphicLoader ( gl ) ; LayerHandler lh = getLayerHandler ( ) ; PlugInLayer pl = new PlugInLayer ( ) ; pl . setPlugIn ( glpi ) ; pl . setName ( gl . getName ( ) ) ; pl . setVisible ( newLayerVisible ) ; if ( lh != null ) { lh . addLayer ( pl , newLayerIndex ) ; } else { if ( orphanGraphicLoaderPlugIns == null ) { orphanGraphicLoaderPlugIns = new LinkedList ( ) ; } orphanGraphicLoaderPlugIns . add ( pl ) ; } } }
166
java-test-552
java
What do the graphicloader doesn ' t already have a receiver create ?
a graphicloaderplugin , and a pluginlayer
public void hook Up Graphic Loader With Layer ( Graphic Loader gl ) { if ( gl != null ) { Graphic Loader Plug In glpi = new Graphic Loader Plug In ( ) ; gl . set Receiver ( glpi ) ; glpi . set Graphic Loader ( gl ) ; Layer Handler lh = get Layer Handler ( ) ; Plug In Layer pl = new Plug In Layer ( ) ; pl . set Plug In ( glpi ) ; pl . set Name ( gl . get Name ( ) ) ; pl . set Visible ( new Layer Visible ) ; if ( lh != null ) { lh . add Layer ( pl , new Layer Index ) ; } else { if ( orphan Graphic Loader Plug Ins == null ) { orphan Graphic Loader Plug Ins = new Linked List ( ) ; } orphan Graphic Loader Plug Ins . add ( pl ) ; } } }
public void hookUpGraphicLoaderWithLayer ( GraphicLoader gl ) { if ( gl != null ) { GraphicLoaderPlugIn glpi = new GraphicLoaderPlugIn ( ) ; gl . setReceiver ( glpi ) ; glpi . setGraphicLoader ( gl ) ; LayerHandler lh = getLayerHandler ( ) ; PlugInLayer pl = new PlugInLayer ( ) ; pl . setPlugIn ( glpi ) ; pl . setName ( gl . getName ( ) ) ; pl . setVisible ( newLayerVisible ) ; if ( lh != null ) { lh . addLayer ( pl , newLayerIndex ) ; } else { if ( orphanGraphicLoaderPlugIns == null ) { orphanGraphicLoaderPlugIns = new LinkedList ( ) ; } orphanGraphicLoaderPlugIns . add ( pl ) ; } } }
166
java-test-553
java
How has content provider returns a file ?
using the content : / / scheme
private boolean is Pdf File From Content Provider Without Extension ( String local Path , String mime Type ) { return local Path . starts With ( Uri Utils . URI CONTENT SCHEME ) && mime Type . equals ( MIME TYPE PDF ) && ! local Path . ends With ( FILE EXTENSION PDF ) ; }
private boolean isPdfFileFromContentProviderWithoutExtension ( String localPath , String mimeType ) { return localPath . startsWith ( UriUtils . URI_CONTENT_SCHEME ) && mimeType . equals ( MIME_TYPE_PDF ) && ! localPath . endsWith ( FILE_EXTENSION_PDF ) ; }
58
java-test-554
java
What do content provider use ?
the content : / / scheme
private boolean is Pdf File From Content Provider Without Extension ( String local Path , String mime Type ) { return local Path . starts With ( Uri Utils . URI CONTENT SCHEME ) && mime Type . equals ( MIME TYPE PDF ) && ! local Path . ends With ( FILE EXTENSION PDF ) ; }
private boolean isPdfFileFromContentProviderWithoutExtension ( String localPath , String mimeType ) { return localPath . startsWith ( UriUtils . URI_CONTENT_SCHEME ) && mimeType . equals ( MIME_TYPE_PDF ) && ! localPath . endsWith ( FILE_EXTENSION_PDF ) ; }
58
java-test-555
java
What notifys that a change occurred in the lists ?
all registered listeners
@ Suppress Warnings ( { STRING , STRING } ) private void notify List Listeners ( ) { if ( ! list Listeners . is Empty ( ) ) { List temp = new Array List ( sensor Data Objects . values ( ) ) ; temp . add All ( object Storages . values ( ) ) ; for ( List Listener < ? > list Listener : list Listeners ) { list Listener . content Changed ( temp ) ; } } }
@ SuppressWarnings ( { STRING , STRING } ) private void notifyListListeners ( ) { if ( ! listListeners . isEmpty ( ) ) { List temp = new ArrayList ( sensorDataObjects . values ( ) ) ; temp . addAll ( objectStorages . values ( ) ) ; for ( ListListener < ? > listListener : listListeners ) { listListener . contentChanged ( temp ) ; } } }
85
java-test-556
java
What do all registered listeners notify ?
that a change occurred in the lists
@ Suppress Warnings ( { STRING , STRING } ) private void notify List Listeners ( ) { if ( ! list Listeners . is Empty ( ) ) { List temp = new Array List ( sensor Data Objects . values ( ) ) ; temp . add All ( object Storages . values ( ) ) ; for ( List Listener < ? > list Listener : list Listeners ) { list Listener . content Changed ( temp ) ; } } }
@ SuppressWarnings ( { STRING , STRING } ) private void notifyListListeners ( ) { if ( ! listListeners . isEmpty ( ) ) { List temp = new ArrayList ( sensorDataObjects . values ( ) ) ; temp . addAll ( objectStorages . values ( ) ) ; for ( ListListener < ? > listListener : listListeners ) { listListener . contentChanged ( temp ) ; } } }
85
java-test-557
java
Where do a change occur ?
in the lists
@ Suppress Warnings ( { STRING , STRING } ) private void notify List Listeners ( ) { if ( ! list Listeners . is Empty ( ) ) { List temp = new Array List ( sensor Data Objects . values ( ) ) ; temp . add All ( object Storages . values ( ) ) ; for ( List Listener < ? > list Listener : list Listeners ) { list Listener . content Changed ( temp ) ; } } }
@ SuppressWarnings ( { STRING , STRING } ) private void notifyListListeners ( ) { if ( ! listListeners . isEmpty ( ) ) { List temp = new ArrayList ( sensorDataObjects . values ( ) ) ; temp . addAll ( objectStorages . values ( ) ) ; for ( ListListener < ? > listListener : listListeners ) { listListener . contentChanged ( temp ) ; } } }
85
java-test-563
java
What did we create when ?
the full copies with a name of bar
protected List < Block Object > sort Full Copy Source List ( List < Block Object > fc Source Objects ) { List < Block Object > sorted Source Objects = new Array List < Block Object > ( ) ; Map < String , Block Object > fc Sourc Objects Map = new Hash Map < String , Block Object > ( ) ; for ( Block Object fc Source Object : fc Source Objects ) { fc Sourc Objects Map . put ( fc Source Object . get Label ( ) , fc Source Object ) ; } List < String > fc Source Labels = new Array List < String > ( fc Sourc Objects Map . key Set ( ) ) ; Collections . sort ( fc Source Labels ) ; for ( String fc Source Label : fc Source Labels ) { sorted Source Objects . add ( fc Sourc Objects Map . get ( fc Source Label ) ) ; } return sorted Source Objects ; }
protected List < BlockObject > sortFullCopySourceList ( List < BlockObject > fcSourceObjects ) { List < BlockObject > sortedSourceObjects = new ArrayList < BlockObject > ( ) ; Map < String , BlockObject > fcSourcObjectsMap = new HashMap < String , BlockObject > ( ) ; for ( BlockObject fcSourceObject : fcSourceObjects ) { fcSourcObjectsMap . put ( fcSourceObject . getLabel ( ) , fcSourceObject ) ; } List < String > fcSourceLabels = new ArrayList < String > ( fcSourcObjectsMap . keySet ( ) ) ; Collections . sort ( fcSourceLabels ) ; for ( String fcSourceLabel : fcSourceLabels ) { sortedSourceObjects . add ( fcSourcObjectsMap . get ( fcSourceLabel ) ) ; } return sortedSourceObjects ; }
173
java-test-564
java
What do you have ?
a cg with two volumes foo - 1 and foo - 2
protected List < Block Object > sort Full Copy Source List ( List < Block Object > fc Source Objects ) { List < Block Object > sorted Source Objects = new Array List < Block Object > ( ) ; Map < String , Block Object > fc Sourc Objects Map = new Hash Map < String , Block Object > ( ) ; for ( Block Object fc Source Object : fc Source Objects ) { fc Sourc Objects Map . put ( fc Source Object . get Label ( ) , fc Source Object ) ; } List < String > fc Source Labels = new Array List < String > ( fc Sourc Objects Map . key Set ( ) ) ; Collections . sort ( fc Source Labels ) ; for ( String fc Source Label : fc Source Labels ) { sorted Source Objects . add ( fc Sourc Objects Map . get ( fc Source Label ) ) ; } return sorted Source Objects ; }
protected List < BlockObject > sortFullCopySourceList ( List < BlockObject > fcSourceObjects ) { List < BlockObject > sortedSourceObjects = new ArrayList < BlockObject > ( ) ; Map < String , BlockObject > fcSourcObjectsMap = new HashMap < String , BlockObject > ( ) ; for ( BlockObject fcSourceObject : fcSourceObjects ) { fcSourcObjectsMap . put ( fcSourceObject . getLabel ( ) , fcSourceObject ) ; } List < String > fcSourceLabels = new ArrayList < String > ( fcSourcObjectsMap . keySet ( ) ) ; Collections . sort ( fcSourceLabels ) ; for ( String fcSourceLabel : fcSourceLabels ) { sortedSourceObjects . add ( fcSourcObjectsMap . get ( fcSourceLabel ) ) ; } return sortedSourceObjects ; }
173
java-test-565
java
What did you get when ?
the volumes in the cg
protected List < Block Object > sort Full Copy Source List ( List < Block Object > fc Source Objects ) { List < Block Object > sorted Source Objects = new Array List < Block Object > ( ) ; Map < String , Block Object > fc Sourc Objects Map = new Hash Map < String , Block Object > ( ) ; for ( Block Object fc Source Object : fc Source Objects ) { fc Sourc Objects Map . put ( fc Source Object . get Label ( ) , fc Source Object ) ; } List < String > fc Source Labels = new Array List < String > ( fc Sourc Objects Map . key Set ( ) ) ; Collections . sort ( fc Source Labels ) ; for ( String fc Source Label : fc Source Labels ) { sorted Source Objects . add ( fc Sourc Objects Map . get ( fc Source Label ) ) ; } return sorted Source Objects ; }
protected List < BlockObject > sortFullCopySourceList ( List < BlockObject > fcSourceObjects ) { List < BlockObject > sortedSourceObjects = new ArrayList < BlockObject > ( ) ; Map < String , BlockObject > fcSourcObjectsMap = new HashMap < String , BlockObject > ( ) ; for ( BlockObject fcSourceObject : fcSourceObjects ) { fcSourcObjectsMap . put ( fcSourceObject . getLabel ( ) , fcSourceObject ) ; } List < String > fcSourceLabels = new ArrayList < String > ( fcSourcObjectsMap . keySet ( ) ) ; Collections . sort ( fcSourceLabels ) ; for ( String fcSourceLabel : fcSourceLabels ) { sortedSourceObjects . add ( fcSourcObjectsMap . get ( fcSourceLabel ) ) ; } return sortedSourceObjects ; }
173
java-test-566
java
What do you create then ?
a full copy of one of these volumes
protected List < Block Object > sort Full Copy Source List ( List < Block Object > fc Source Objects ) { List < Block Object > sorted Source Objects = new Array List < Block Object > ( ) ; Map < String , Block Object > fc Sourc Objects Map = new Hash Map < String , Block Object > ( ) ; for ( Block Object fc Source Object : fc Source Objects ) { fc Sourc Objects Map . put ( fc Source Object . get Label ( ) , fc Source Object ) ; } List < String > fc Source Labels = new Array List < String > ( fc Sourc Objects Map . key Set ( ) ) ; Collections . sort ( fc Source Labels ) ; for ( String fc Source Label : fc Source Labels ) { sorted Source Objects . add ( fc Sourc Objects Map . get ( fc Source Label ) ) ; } return sorted Source Objects ; }
protected List < BlockObject > sortFullCopySourceList ( List < BlockObject > fcSourceObjects ) { List < BlockObject > sortedSourceObjects = new ArrayList < BlockObject > ( ) ; Map < String , BlockObject > fcSourcObjectsMap = new HashMap < String , BlockObject > ( ) ; for ( BlockObject fcSourceObject : fcSourceObjects ) { fcSourcObjectsMap . put ( fcSourceObject . getLabel ( ) , fcSourceObject ) ; } List < String > fcSourceLabels = new ArrayList < String > ( fcSourcObjectsMap . keySet ( ) ) ; Collections . sort ( fcSourceLabels ) ; for ( String fcSourceLabel : fcSourceLabels ) { sortedSourceObjects . add ( fcSourcObjectsMap . get ( fcSourceLabel ) ) ; } return sortedSourceObjects ; }
173
java-test-572
java
What do handles create ?
server to server configuration xml request
public void handle Button 1 Request ( Request Invocation Event event ) throws Model Control Exception { Server Site Model model = ( Server Site Model ) get Model ( ) ; String server Name = ( String ) get Page Session Attribute ( Server Edit View Bean Base . PG ATTR SERVER NAME ) ; String server Group Type = ( String ) get Page Session Attribute ( PG ATTR SERVER GROUP TYPE ) ; String name = ( String ) get Display Field Value ( TF NAME ) ; name = name . trim ( ) ; String host = ( String ) get Display Field Value ( TF HOST ) ; host = host . trim ( ) ; String port = ( String ) get Display Field Value ( TF PORT ) ; port = port . trim ( ) ; String type = ( String ) get Display Field Value ( CHOICE TYPE ) ; if ( ( name . length ( ) > NUM ) && ( port . length ( ) > NUM ) && ( host . length ( ) > NUM ) ) { try { Server Config XML xml Obj = model . get Server Config Object ( server Name ) ; Server Config XML . Server Group server Group = ( server Group Type . equals ( DS Config Mgr . DEFAULT ) ) ? xml Obj . get Default Server Group ( ) : xml Obj . get SMS Server Group ( ) ; server Group . add Host ( name , host , port , type ) ; model . set Server Config XML ( server Name , xml Obj . to XML ( ) ) ; back Trail ( ) ; Server Config XML View Bean vb = ( Server Config XML View Bean ) get View Bean ( Server Config XML View Bean . class ) ; remove Page Session Attribute ( PG ATTR SERVER GROUP TYPE ) ; pass Pg Session Map ( vb ) ; vb . forward To ( get Request Context ( ) ) ; } catch ( Configuration Exception e ) { set Inline Alert Message ( CC Alert . TYPE ERROR , STRING , e . get Message ( ) ) ; forward To ( ) ; } catch ( AM Console Exception e ) { set Inline Alert Message ( CC Alert . TYPE ERROR , STRING , e . get Message ( ) ) ; forward To ( ) ; } } else { set Inline Alert Message ( CC Alert . TYPE ERROR , STRING , STRING ) ; forward To ( ) ; } }
public void handleButton1Request ( RequestInvocationEvent event ) throws ModelControlException { ServerSiteModel model = ( ServerSiteModel ) getModel ( ) ; String serverName = ( String ) getPageSessionAttribute ( ServerEditViewBeanBase . PG_ATTR_SERVER_NAME ) ; String serverGroupType = ( String ) getPageSessionAttribute ( PG_ATTR_SERVER_GROUP_TYPE ) ; String name = ( String ) getDisplayFieldValue ( TF_NAME ) ; name = name . trim ( ) ; String host = ( String ) getDisplayFieldValue ( TF_HOST ) ; host = host . trim ( ) ; String port = ( String ) getDisplayFieldValue ( TF_PORT ) ; port = port . trim ( ) ; String type = ( String ) getDisplayFieldValue ( CHOICE_TYPE ) ; if ( ( name . length ( ) > _NUM ) && ( port . length ( ) > _NUM ) && ( host . length ( ) > _NUM ) ) { try { ServerConfigXML xmlObj = model . getServerConfigObject ( serverName ) ; ServerConfigXML . ServerGroup serverGroup = ( serverGroupType . equals ( DSConfigMgr . DEFAULT ) ) ? xmlObj . getDefaultServerGroup ( ) : xmlObj . getSMSServerGroup ( ) ; serverGroup . addHost ( name , host , port , type ) ; model . setServerConfigXML ( serverName , xmlObj . toXML ( ) ) ; backTrail ( ) ; ServerConfigXMLViewBean vb = ( ServerConfigXMLViewBean ) getViewBean ( ServerConfigXMLViewBean . class ) ; removePageSessionAttribute ( PG_ATTR_SERVER_GROUP_TYPE ) ; passPgSessionMap ( vb ) ; vb . forwardTo ( getRequestContext ( ) ) ; } catch ( ConfigurationException e ) { setInlineAlertMessage ( CCAlert . TYPE_ERROR , STRING , e . getMessage ( ) ) ; forwardTo ( ) ; } catch ( AMConsoleException e ) { setInlineAlertMessage ( CCAlert . TYPE_ERROR , STRING , e . getMessage ( ) ) ; forwardTo ( ) ; } } else { setInlineAlertMessage ( CCAlert . TYPE_ERROR , STRING , STRING ) ; forwardTo ( ) ; } }
450
java-test-573
java
What does the code delete ?
the content between start ( included ) and end ( excluded )
public Span Manager delete ( int start , int end ) { sb . delete ( start , end ) ; adjust Lists ( start , start - end ) ; if ( calculate Src Positions ) for ( int i = NUM ; i < end - start ; i ++ ) ib . remove ( start ) ; return this ; }
public SpanManager delete ( int start , int end ) { sb . delete ( start , end ) ; adjustLists ( start , start - end ) ; if ( calculateSrcPositions ) for ( int i = _NUM ; i < end - start ; i ++ ) ib . remove ( start ) ; return this ; }
64
java-test-574
java
What does the code instantiate ?
a new adds
public Movie Set Add Action ( boolean with Title ) { if ( with Title ) { put Value ( NAME , BUNDLE . get String ( STRING ) ) ; } put Value ( LARGE ICON KEY , Icon Manager . LIST ADD ) ; put Value ( SMALL ICON , Icon Manager . LIST ADD ) ; put Value ( SHORT DESCRIPTION , BUNDLE . get String ( STRING ) ) ; }
public MovieSetAddAction ( boolean withTitle ) { if ( withTitle ) { putValue ( NAME , BUNDLE . getString ( STRING ) ) ; } putValue ( LARGE_ICON_KEY , IconManager . LIST_ADD ) ; putValue ( SMALL_ICON , IconManager . LIST_ADD ) ; putValue ( SHORT_DESCRIPTION , BUNDLE . getString ( STRING ) ) ; }
75
java-test-576
java
When will 1000 , 2 , true return ?
1 , 000
public static String format Number ( final Big Decimal number , final int fraction Digits , final boolean use Grouping ) { final Number Format number Format = Number Format . get Instance ( ) ; number Format . set Minimum Fraction Digits ( fraction Digits ) ; number Format . set Maximum Fraction Digits ( fraction Digits ) ; number Format . set Grouping Used ( use Grouping ) ; return number Format . format ( number . double Value ( ) ) ; }
public static String formatNumber ( final BigDecimal number , final int fractionDigits , final boolean useGrouping ) { final NumberFormat numberFormat = NumberFormat . getInstance ( ) ; numberFormat . setMinimumFractionDigits ( fractionDigits ) ; numberFormat . setMaximumFractionDigits ( fractionDigits ) ; numberFormat . setGroupingUsed ( useGrouping ) ; return numberFormat . format ( number . doubleValue ( ) ) ; }
86
java-test-577
java
What does the code create ?
a name from a sequence of camel strings
public static Name any Camel ( String ... pieces ) { List < Name Piece > name Pieces = new Array List < > ( ) ; for ( String piece : pieces ) { validate Camel ( piece , Check Case . NO CHECK ) ; Case Format format = Case Format . LOWER CAMEL ; if ( Character . is Upper Case ( piece . char At ( NUM ) ) ) { format = Case Format . UPPER CAMEL ; } name Pieces . add ( new Name Piece ( piece , format ) ) ; } return new Name ( name Pieces ) ; }
public static Name anyCamel ( String ... pieces ) { List < NamePiece > namePieces = new ArrayList < > ( ) ; for ( String piece : pieces ) { validateCamel ( piece , CheckCase . NO_CHECK ) ; CaseFormat format = CaseFormat . LOWER_CAMEL ; if ( Character . isUpperCase ( piece . charAt ( _NUM ) ) ) { format = CaseFormat . UPPER_CAMEL ; } namePieces . add ( new NamePiece ( piece , format ) ) ; } return new Name ( namePieces ) ; }
109
java-test-578
java
What do the current access control context have ?
all of the permissions necessary to load classes from this loader
private void check Permissions ( ) { Security Manager sm = System . get Security Manager ( ) ; if ( sm != null ) { Enumeration < Permission > enum = permissions . elements ( ) ; while ( enum . has More Elements ( ) ) { sm . check Permission ( enum . next Element ( ) ) ; } } }
private void checkPermissions ( ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { Enumeration < Permission > enum_ = permissions . elements ( ) ; while ( enum_ . hasMoreElements ( ) ) { sm . checkPermission ( enum_ . nextElement ( ) ) ; } } }
65
java-test-579
java
What does the code add to the registry returning a new membership key ?
membership
void add ( Membership Key Impl key ) { Inet Address group = key . group ( ) ; List < Membership Key Impl > keys ; if ( groups == null ) { groups = new Hash Map < Inet Address , List < Membership Key Impl > > ( ) ; keys = null ; } else { keys = groups . get ( group ) ; } if ( keys == null ) { keys = new Linked List < Membership Key Impl > ( ) ; groups . put ( group , keys ) ; } keys . add ( key ) ; }
void add ( MembershipKeyImpl key ) { InetAddress group = key . group ( ) ; List < MembershipKeyImpl > keys ; if ( groups == null ) { groups = new HashMap < InetAddress , List < MembershipKeyImpl > > ( ) ; keys = null ; } else { keys = groups . get ( group ) ; } if ( keys == null ) { keys = new LinkedList < MembershipKeyImpl > ( ) ; groups . put ( group , keys ) ; } keys . add ( key ) ; }
108
java-test-580
java
What does the code return ?
a new membership key
void add ( Membership Key Impl key ) { Inet Address group = key . group ( ) ; List < Membership Key Impl > keys ; if ( groups == null ) { groups = new Hash Map < Inet Address , List < Membership Key Impl > > ( ) ; keys = null ; } else { keys = groups . get ( group ) ; } if ( keys == null ) { keys = new Linked List < Membership Key Impl > ( ) ; groups . put ( group , keys ) ; } keys . add ( key ) ; }
void add ( MembershipKeyImpl key ) { InetAddress group = key . group ( ) ; List < MembershipKeyImpl > keys ; if ( groups == null ) { groups = new HashMap < InetAddress , List < MembershipKeyImpl > > ( ) ; keys = null ; } else { keys = groups . get ( group ) ; } if ( keys == null ) { keys = new LinkedList < MembershipKeyImpl > ( ) ; groups . put ( group , keys ) ; } keys . add ( key ) ; }
108
java-test-584
java
What does the code create ?
a zookeeper client
private Optional < Curator Framework > create Client ( String zookeeper Url ) { if ( String Utils . is Not Blank ( zookeeper Url ) ) { Curator Framework client = Configurations Utils . get Client ( zookeeper Url ) ; client . start ( ) ; return Optional . of ( client ) ; } else { return Optional . empty ( ) ; } }
private Optional < CuratorFramework > createClient ( String zookeeperUrl ) { if ( StringUtils . isNotBlank ( zookeeperUrl ) ) { CuratorFramework client = ConfigurationsUtils . getClient ( zookeeperUrl ) ; client . start ( ) ; return Optional . of ( client ) ; } else { return Optional . empty ( ) ; } }
68
java-test-585
java
What does the code write to the given data block ?
a property name
private void write Prop Name ( String prop Name , Byte Array Builder bab ) { Byte Buffer text Buf = Column Impl . encode Uncompressed Text ( prop Name , database . get Charset ( ) ) ; bab . put Short ( ( short ) text Buf . remaining ( ) ) ; bab . put ( text Buf ) ; }
private void writePropName ( String propName , ByteArrayBuilder bab ) { ByteBuffer textBuf = ColumnImpl . encodeUncompressedText ( propName , _database . getCharset ( ) ) ; bab . putShort ( ( short ) textBuf . remaining ( ) ) ; bab . put ( textBuf ) ; }
64
java-test-586
java
What do measurement map ?
to a defined measurement name , where the key is the measurement name and the value is the reqex the measurement should be mapped by
public Builder measurement Mappings ( Map < String , String > measurement Mappings ) { Map < String , Pattern > mappings By Pattern = new Hash Map < String , Pattern > ( ) ; for ( Map . Entry < String , String > entry : measurement Mappings . entry Set ( ) ) { try { final Pattern pattern = Pattern . compile ( entry . get Value ( ) ) ; mappings By Pattern . put ( entry . get Key ( ) , pattern ) ; } catch ( Pattern Syntax Exception e ) { throw new Runtime Exception ( STRING + entry . get Value ( ) , e ) ; } } this . measurement Mappings = mappings By Pattern ; return this ; }
public Builder measurementMappings ( Map < String , String > measurementMappings ) { Map < String , Pattern > mappingsByPattern = new HashMap < String , Pattern > ( ) ; for ( Map . Entry < String , String > entry : measurementMappings . entrySet ( ) ) { try { final Pattern pattern = Pattern . compile ( entry . getValue ( ) ) ; mappingsByPattern . put ( entry . getKey ( ) , pattern ) ; } catch ( PatternSyntaxException e ) { throw new RuntimeException ( STRING + entry . getValue ( ) , e ) ; } } this . measurementMappings = mappingsByPattern ; return this ; }
132
java-test-587
java
Where is the key the measurement name ?
a defined measurement name
public Builder measurement Mappings ( Map < String , String > measurement Mappings ) { Map < String , Pattern > mappings By Pattern = new Hash Map < String , Pattern > ( ) ; for ( Map . Entry < String , String > entry : measurement Mappings . entry Set ( ) ) { try { final Pattern pattern = Pattern . compile ( entry . get Value ( ) ) ; mappings By Pattern . put ( entry . get Key ( ) , pattern ) ; } catch ( Pattern Syntax Exception e ) { throw new Runtime Exception ( STRING + entry . get Value ( ) , e ) ; } } this . measurement Mappings = mappings By Pattern ; return this ; }
public Builder measurementMappings ( Map < String , String > measurementMappings ) { Map < String , Pattern > mappingsByPattern = new HashMap < String , Pattern > ( ) ; for ( Map . Entry < String , String > entry : measurementMappings . entrySet ( ) ) { try { final Pattern pattern = Pattern . compile ( entry . getValue ( ) ) ; mappingsByPattern . put ( entry . getKey ( ) , pattern ) ; } catch ( PatternSyntaxException e ) { throw new RuntimeException ( STRING + entry . getValue ( ) , e ) ; } } this . measurementMappings = mappingsByPattern ; return this ; }
132
java-test-588
java
In which direction does the code traverse the graph ?
from token
private void traverse ( int distance , Word Token token , Immutable Stack < Word Token > history , Traverse Predicate predicate ) { final int new Distance = distance - NUM ; if ( new Distance <= NUM ) { return ; } for ( final Edge e : edges . get ( token ) ) { final Word Token other = e . get Other ( token ) ; if ( ! history . contains ( other ) && predicate . test ( e . get Dependency ( ) , token , other , history ) ) { final Immutable Stack < Word Token > stack = history . push ( other ) ; traverse ( new Distance , other , stack , predicate ) ; } } }
private void traverse ( int distance , WordToken token , ImmutableStack < WordToken > history , TraversePredicate predicate ) { final int newDistance = distance - _NUM ; if ( newDistance <= _NUM ) { return ; } for ( final Edge e : edges . get ( token ) ) { final WordToken other = e . getOther ( token ) ; if ( ! history . contains ( other ) && predicate . test ( e . getDependency ( ) , token , other , history ) ) { final ImmutableStack < WordToken > stack = history . push ( other ) ; traverse ( newDistance , other , stack , predicate ) ; } } }
131
java-test-591
java
What does we use ?
the same name that is in the barnes code
public final void hack Gravity ( double rsize , Node root ) { Math Vector pos 0 = ( Math Vector ) pos . clone ( ) ; HG hg = new HG ( this , pos ) ; hg = root . walk Sub Tree ( rsize * rsize , hg ) ; phi = hg . phi 0 ; new Acc = hg . acc 0 ; }
public final void hackGravity ( double rsize , Node root ) { MathVector pos0 = ( MathVector ) pos . clone ( ) ; HG hg = new HG ( this , pos ) ; hg = root . walkSubTree ( rsize * rsize , hg ) ; phi = hg . phi0 ; newAcc = hg . acc0 ; }
70
java-test-592
java
What evaluates on the body ?
gravitational field
public final void hack Gravity ( double rsize , Node root ) { Math Vector pos 0 = ( Math Vector ) pos . clone ( ) ; HG hg = new HG ( this , pos ) ; hg = root . walk Sub Tree ( rsize * rsize , hg ) ; phi = hg . phi 0 ; new Acc = hg . acc 0 ; }
public final void hackGravity ( double rsize , Node root ) { MathVector pos0 = ( MathVector ) pos . clone ( ) ; HG hg = new HG ( this , pos ) ; hg = root . walkSubTree ( rsize * rsize , hg ) ; phi = hg . phi0 ; newAcc = hg . acc0 ; }
70
java-test-593
java
Where do gravitational field evaluate ?
on the body
public final void hack Gravity ( double rsize , Node root ) { Math Vector pos 0 = ( Math Vector ) pos . clone ( ) ; HG hg = new HG ( this , pos ) ; hg = root . walk Sub Tree ( rsize * rsize , hg ) ; phi = hg . phi 0 ; new Acc = hg . acc 0 ; }
public final void hackGravity ( double rsize , Node root ) { MathVector pos0 = ( MathVector ) pos . clone ( ) ; HG hg = new HG ( this , pos ) ; hg = root . walkSubTree ( rsize * rsize , hg ) ; phi = hg . phi0 ; newAcc = hg . acc0 ; }
70
java-test-596
java
What do all threads reach ?
this barrier
public void await ( int ID ) throws Interrupted Exception { if ( parties == NUM ) return ; final boolean start Condition = competition Condition ; int competing For = ( locks . length * NUM - NUM - ID ) / NUM ; while ( competing For >= NUM ) { final Lock node = locks [ competing For ] ; if ( node . try Lock ( ) ) { synchronized ( node ) { while ( competition Condition == start Condition ) node . wait ( ) ; } node . unlock ( ) ; wake Up Target ( competing For * NUM + NUM ) ; wake Up Target ( competing For * NUM + NUM ) ; return ; } else { if ( competing For == NUM ) break ; competing For = ( competing For - NUM ) / NUM ; } } competition Condition = ! competition Condition ; wake Up Target ( NUM ) ; }
public void await ( int ID ) throws InterruptedException { if ( parties == _NUM ) return ; final boolean startCondition = competitionCondition ; int competingFor = ( locks . length * _NUM - _NUM - ID ) / _NUM ; while ( competingFor >= _NUM ) { final Lock node = locks [ competingFor ] ; if ( node . tryLock ( ) ) { synchronized ( node ) { while ( competitionCondition == startCondition ) node . wait ( ) ; } node . unlock ( ) ; wakeUpTarget ( competingFor * _NUM + _NUM ) ; wakeUpTarget ( competingFor * _NUM + _NUM ) ; return ; } else { if ( competingFor == _NUM ) break ; competingFor = ( competingFor - _NUM ) / _NUM ; } } competitionCondition = ! competitionCondition ; wakeUpTarget ( _NUM ) ; }
166
java-test-597
java
How does the revocation status of a list of certificates check ?
using ocsp
static OCSP Response check ( List < Cert Id > cert Ids , URI responder URI , X509 Certificate issuer Cert , X509 Certificate responder Cert , Date date , List < Extension > extensions ) throws IO Exception , Cert Path Validator Exception { byte [ ] bytes = null ; OCSP Request request = null ; try { request = new OCSP Request ( cert Ids , extensions ) ; bytes = request . encode Bytes ( ) ; } catch ( IO Exception ioe ) { throw new Cert Path Validator Exception ( STRING , ioe ) ; } Input Stream in = null ; Output Stream out = null ; byte [ ] response = null ; try { URL url = responder URI . to URL ( ) ; if ( debug != null ) { debug . println ( STRING + url ) ; } Http URL Connection con = ( Http URL Connection ) url . open Connection ( ) ; con . set Connect Timeout ( CONNECT TIMEOUT ) ; con . set Read Timeout ( CONNECT TIMEOUT ) ; con . set Do Output ( BOOL ) ; con . set Do Input ( BOOL ) ; con . set Request Method ( STRING ) ; con . set Request Property ( STRING , STRING ) ; con . set Request Property ( STRING , String . value Of ( bytes . length ) ) ; out = con . get Output Stream ( ) ; out . write ( bytes ) ; out . flush ( ) ; if ( debug != null && con . get Response Code ( ) != Http URL Connection . HTTP OK ) { debug . println ( STRING + con . get Response Code ( ) + STRING + con . get Response Message ( ) ) ; } in = con . get Input Stream ( ) ; int content Length = con . get Content Length ( ) ; if ( content Length == - NUM ) { content Length = Integer . MAX VALUE ; } response = new byte [ content Length > NUM ? NUM : content Length ] ; int total = NUM ; while ( total < content Length ) { int count = in . read ( response , total , response . length - total ) ; if ( count < NUM ) break ; total += count ; if ( total >= response . length && total < content Length ) { response = Arrays . copy Of ( response , total * NUM ) ; } } response = Arrays . copy Of ( response , total ) ; } catch ( IO Exception ioe ) { throw new Cert Path Validator Exception ( STRING , ioe , null , - NUM , Basic Reason . UNDETERMINED REVOCATION STATUS ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IO Exception ioe ) { throw ioe ; } } if ( out != null ) { try { out . close ( ) ; } catch ( IO Exception ioe ) { throw ioe ; } } } OCSP Response ocsp Response = null ; try { ocsp Response = new OCSP Response ( response ) ; } catch ( IO Exception ioe ) { throw new Cert Path Validator Exception ( ioe ) ; } ocsp Response . verify ( cert Ids , issuer Cert , responder Cert , date , request . get Nonce ( ) ) ; return ocsp Response ; }
static OCSPResponse check ( List < CertId > certIds , URI responderURI , X509Certificate issuerCert , X509Certificate responderCert , Date date , List < Extension > extensions ) throws IOException , CertPathValidatorException { byte [ ] bytes = null ; OCSPRequest request = null ; try { request = new OCSPRequest ( certIds , extensions ) ; bytes = request . encodeBytes ( ) ; } catch ( IOException ioe ) { throw new CertPathValidatorException ( STRING , ioe ) ; } InputStream in = null ; OutputStream out = null ; byte [ ] response = null ; try { URL url = responderURI . toURL ( ) ; if ( debug != null ) { debug . println ( STRING + url ) ; } HttpURLConnection con = ( HttpURLConnection ) url . openConnection ( ) ; con . setConnectTimeout ( CONNECT_TIMEOUT ) ; con . setReadTimeout ( CONNECT_TIMEOUT ) ; con . setDoOutput ( _BOOL ) ; con . setDoInput ( _BOOL ) ; con . setRequestMethod ( STRING ) ; con . setRequestProperty ( STRING , STRING ) ; con . setRequestProperty ( STRING , String . valueOf ( bytes . length ) ) ; out = con . getOutputStream ( ) ; out . write ( bytes ) ; out . flush ( ) ; if ( debug != null && con . getResponseCode ( ) != HttpURLConnection . HTTP_OK ) { debug . println ( STRING + con . getResponseCode ( ) + STRING + con . getResponseMessage ( ) ) ; } in = con . getInputStream ( ) ; int contentLength = con . getContentLength ( ) ; if ( contentLength == - _NUM ) { contentLength = Integer . MAX_VALUE ; } response = new byte [ contentLength > _NUM ? _NUM : contentLength ] ; int total = _NUM ; while ( total < contentLength ) { int count = in . read ( response , total , response . length - total ) ; if ( count < _NUM ) break ; total += count ; if ( total >= response . length && total < contentLength ) { response = Arrays . copyOf ( response , total * _NUM ) ; } } response = Arrays . copyOf ( response , total ) ; } catch ( IOException ioe ) { throw new CertPathValidatorException ( STRING , ioe , null , - _NUM , BasicReason . UNDETERMINED_REVOCATION_STATUS ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IOException ioe ) { throw ioe ; } } if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioe ) { throw ioe ; } } } OCSPResponse ocspResponse = null ; try { ocspResponse = new OCSPResponse ( response ) ; } catch ( IOException ioe ) { throw new CertPathValidatorException ( ioe ) ; } ocspResponse . verify ( certIds , issuerCert , responderCert , date , request . getNonce ( ) ) ; return ocspResponse ; }
616
java-test-605
java
What has the " content - type " set to json ?
the supplied data
private Response require JSON ( IHTTP Session session ) { final Map < String , String > headers = session . get Headers ( ) ; if ( ! APPLICATION JSON . equals ( headers . get ( CONTENT TYPE ) ) ) { return new Fixed Length Response ( Response . Status . NOT ACCEPTABLE , MIME PLAINTEXT , STRING ) ; } else { return null ; } }
private Response requireJSON ( IHTTPSession session ) { final Map < String , String > headers = session . getHeaders ( ) ; if ( ! APPLICATION_JSON . equals ( headers . get ( CONTENT_TYPE ) ) ) { return newFixedLengthResponse ( Response . Status . NOT_ACCEPTABLE , MIME_PLAINTEXT , STRING ) ; } else { return null ; } }
71
java-test-606
java
What does the supplied data have ?
the " content - type " set to json
private Response require JSON ( IHTTP Session session ) { final Map < String , String > headers = session . get Headers ( ) ; if ( ! APPLICATION JSON . equals ( headers . get ( CONTENT TYPE ) ) ) { return new Fixed Length Response ( Response . Status . NOT ACCEPTABLE , MIME PLAINTEXT , STRING ) ; } else { return null ; } }
private Response requireJSON ( IHTTPSession session ) { final Map < String , String > headers = session . getHeaders ( ) ; if ( ! APPLICATION_JSON . equals ( headers . get ( CONTENT_TYPE ) ) ) { return newFixedLengthResponse ( Response . Status . NOT_ACCEPTABLE , MIME_PLAINTEXT , STRING ) ; } else { return null ; } }
71
java-test-607
java
What does it set also ?
the correct colour of the indicator led
public void disconnect ( ) { connected = BOOL ; synchronized ( conn Lost Wait ) { conn Lost Wait . notify ( ) ; } if ( mqtt != null ) { try { mqtt . disconnect ( ) ; } catch ( Exception ex ) { set Title Text ( STRING ) ; ex . print Stack Trace ( ) ; System . exit ( NUM ) ; } } if ( led . is Flashing ( ) ) { led . set Flash ( ) ; } led . set Red ( ) ; set Connected ( BOOL ) ; synchronized ( this ) { write Logln ( STRING ) ; } }
public void disconnect ( ) { connected = _BOOL ; synchronized ( connLostWait ) { connLostWait . notify ( ) ; } if ( mqtt != null ) { try { mqtt . disconnect ( ) ; } catch ( Exception ex ) { setTitleText ( STRING ) ; ex . printStackTrace ( ) ; System . exit ( _NUM ) ; } } if ( led . isFlashing ( ) ) { led . setFlash ( ) ; } led . setRed ( ) ; setConnected ( _BOOL ) ; synchronized ( this ) { writeLogln ( STRING ) ; } }
116
java-test-608
java
When does the code start the publishing monitor ?
once and only once
public void start ( ) { if ( monitor Thread != null ) { if ( ! monitor Thread . is Alive ( ) ) { start Monitor Thread ( ) ; } else { LOG . error ( STRING ) ; } } else { start Monitor Thread ( ) ; } }
public void start ( ) { if ( monitorThread != null ) { if ( ! monitorThread . isAlive ( ) ) { startMonitorThread ( ) ; } else { LOG . error ( STRING ) ; } } else { startMonitorThread ( ) ; } }
54
java-test-609
java
What does the code start once and only once ?
the publishing monitor
public void start ( ) { if ( monitor Thread != null ) { if ( ! monitor Thread . is Alive ( ) ) { start Monitor Thread ( ) ; } else { LOG . error ( STRING ) ; } } else { start Monitor Thread ( ) ; } }
public void start ( ) { if ( monitorThread != null ) { if ( ! monitorThread . isAlive ( ) ) { startMonitorThread ( ) ; } else { LOG . error ( STRING ) ; } } else { startMonitorThread ( ) ; } }
54
java-test-612
java
What does the code add to this ?
the information held by another nullinforegistry instance
public Null Info Registry add ( Null Info Registry other ) { if ( ( other . tag Bits & NULL FLAG MASK ) == NUM ) { return this ; } this . tag Bits |= NULL FLAG MASK ; this . null Bit 1 |= other . null Bit 1 ; this . null Bit 2 |= other . null Bit 2 ; this . null Bit 3 |= other . null Bit 3 ; this . null Bit 4 |= other . null Bit 4 ; if ( other . extra != null ) { if ( this . extra == null ) { this . extra = new long [ extra Length ] [ ] ; for ( int i = NUM , length = other . extra [ NUM ] . length ; i < extra Length ; i ++ ) { System . arraycopy ( other . extra [ i ] , NUM , ( this . extra [ i ] = new long [ length ] ) , NUM , length ) ; } } else { int length = this . extra [ NUM ] . length , other Length = other . extra [ NUM ] . length ; if ( other Length > length ) { for ( int i = NUM ; i < extra Length ; i ++ ) { System . arraycopy ( this . extra [ i ] , NUM , ( this . extra [ i ] = new long [ other Length ] ) , NUM , length ) ; System . arraycopy ( other . extra [ i ] , length , this . extra [ i ] , length , other Length - length ) ; } } else if ( other Length < length ) { length = other Length ; } for ( int i = NUM ; i < extra Length ; i ++ ) { for ( int j = NUM ; j < length ; j ++ ) { this . extra [ i ] [ j ] |= other . extra [ i ] [ j ] ; } } } } return this ; }
public NullInfoRegistry add ( NullInfoRegistry other ) { if ( ( other . tagBits & NULL_FLAG_MASK ) == _NUM ) { return this ; } this . tagBits |= NULL_FLAG_MASK ; this . nullBit1 |= other . nullBit1 ; this . nullBit2 |= other . nullBit2 ; this . nullBit3 |= other . nullBit3 ; this . nullBit4 |= other . nullBit4 ; if ( other . extra != null ) { if ( this . extra == null ) { this . extra = new long [ extraLength ] [ ] ; for ( int i = _NUM , length = other . extra [ _NUM ] . length ; i < extraLength ; i ++ ) { System . arraycopy ( other . extra [ i ] , _NUM , ( this . extra [ i ] = new long [ length ] ) , _NUM , length ) ; } } else { int length = this . extra [ _NUM ] . length , otherLength = other . extra [ _NUM ] . length ; if ( otherLength > length ) { for ( int i = _NUM ; i < extraLength ; i ++ ) { System . arraycopy ( this . extra [ i ] , _NUM , ( this . extra [ i ] = new long [ otherLength ] ) , _NUM , length ) ; System . arraycopy ( other . extra [ i ] , length , this . extra [ i ] , length , otherLength - length ) ; } } else if ( otherLength < length ) { length = otherLength ; } for ( int i = _NUM ; i < extraLength ; i ++ ) { for ( int j = _NUM ; j < length ; j ++ ) { this . extra [ i ] [ j ] |= other . extra [ i ] [ j ] ; } } } } return this ; }
370