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-325 | java | Did we need to when ? | No | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Highest Child Top ( ) ; final int start = get List Padding Top ( ) ; final int end = ( get Top ( ) - get Bottom ( ) ) - get List Padding Bottom ( ) ; int top Offset = first Top - start ; final int last Bottom = get Lowest Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { int next Position = last Position + NUM ; fill Down ( next Position , get Next Child Downs Top ( next Position ) ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getHighestChildTop ( ) ; final int start = getListPaddingTop ( ) ; final int end = ( getTop ( ) - getBottom ( ) ) - getListPaddingBottom ( ) ; int topOffset = firstTop - start ; final int lastBottom = getLowestChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } offsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { int nextPosition = lastPosition + _NUM ; fillDown ( nextPosition , getNextChildDownsTop ( nextPosition ) ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 243 |
java-test-326 | java | Does the code evaluate a subset of attributes ? | Yes | @ Override public double evaluate Subset ( Bit Set subset ) throws Exception { double num = NUM ; double denom = NUM ; float corr ; int larger , smaller ; for ( int i = NUM ; i < m num Attribs ; i ++ ) { if ( i != m class Index ) { if ( subset . get ( i ) ) { if ( i > m class Index ) { larger = i ; smaller = m class Index ; } else { smaller = i ; larger = m class Index ; } if ( m corr matrix [ larger ] [ smaller ] == - NUM ) { corr = correlate ( i , m class Index ) ; m corr matrix [ larger ] [ smaller ] = corr ; num += ( m std devs [ i ] * corr ) ; } else { num += ( m std devs [ i ] * m corr matrix [ larger ] [ smaller ] ) ; } } } } for ( int i = NUM ; i < m num Attribs ; i ++ ) { if ( i != m class Index ) { if ( subset . get ( i ) ) { denom += ( NUM * m std devs [ i ] * m std devs [ i ] ) ; for ( int j = NUM ; j < m corr matrix [ i ] . length - NUM ; j ++ ) { if ( subset . get ( j ) ) { if ( m corr matrix [ i ] [ j ] == - NUM ) { corr = correlate ( i , j ) ; m corr matrix [ i ] [ j ] = corr ; denom += ( NUM * m std devs [ i ] * m std devs [ j ] * corr ) ; } else { denom += ( NUM * m std devs [ i ] * m std devs [ j ] * m corr matrix [ i ] [ j ] ) ; } } } } } } if ( denom < NUM ) { denom *= - NUM ; } if ( denom == NUM ) { return ( NUM ) ; } double merit = ( num / Math . sqrt ( denom ) ) ; if ( merit < NUM ) { merit *= - NUM ; } return merit ; } | @ Override public double evaluateSubset ( BitSet subset ) throws Exception { double num = _NUM ; double denom = _NUM ; float corr ; int larger , smaller ; for ( int i = _NUM ; i < m_numAttribs ; i ++ ) { if ( i != m_classIndex ) { if ( subset . get ( i ) ) { if ( i > m_classIndex ) { larger = i ; smaller = m_classIndex ; } else { smaller = i ; larger = m_classIndex ; } if ( m_corr_matrix [ larger ] [ smaller ] == - _NUM ) { corr = correlate ( i , m_classIndex ) ; m_corr_matrix [ larger ] [ smaller ] = corr ; num += ( m_std_devs [ i ] * corr ) ; } else { num += ( m_std_devs [ i ] * m_corr_matrix [ larger ] [ smaller ] ) ; } } } } for ( int i = _NUM ; i < m_numAttribs ; i ++ ) { if ( i != m_classIndex ) { if ( subset . get ( i ) ) { denom += ( _NUM * m_std_devs [ i ] * m_std_devs [ i ] ) ; for ( int j = _NUM ; j < m_corr_matrix [ i ] . length - _NUM ; j ++ ) { if ( subset . get ( j ) ) { if ( m_corr_matrix [ i ] [ j ] == - _NUM ) { corr = correlate ( i , j ) ; m_corr_matrix [ i ] [ j ] = corr ; denom += ( _NUM * m_std_devs [ i ] * m_std_devs [ j ] * corr ) ; } else { denom += ( _NUM * m_std_devs [ i ] * m_std_devs [ j ] * m_corr_matrix [ i ] [ j ] ) ; } } } } } } if ( denom < _NUM ) { denom *= - _NUM ; } if ( denom == _NUM ) { return ( _NUM ) ; } double merit = ( num / Math . sqrt ( denom ) ) ; if ( merit < _NUM ) { merit *= - _NUM ; } return merit ; } | 426 |
java-test-327 | java | What does the code evaluate ? | a subset of attributes | @ Override public double evaluate Subset ( Bit Set subset ) throws Exception { double num = NUM ; double denom = NUM ; float corr ; int larger , smaller ; for ( int i = NUM ; i < m num Attribs ; i ++ ) { if ( i != m class Index ) { if ( subset . get ( i ) ) { if ( i > m class Index ) { larger = i ; smaller = m class Index ; } else { smaller = i ; larger = m class Index ; } if ( m corr matrix [ larger ] [ smaller ] == - NUM ) { corr = correlate ( i , m class Index ) ; m corr matrix [ larger ] [ smaller ] = corr ; num += ( m std devs [ i ] * corr ) ; } else { num += ( m std devs [ i ] * m corr matrix [ larger ] [ smaller ] ) ; } } } } for ( int i = NUM ; i < m num Attribs ; i ++ ) { if ( i != m class Index ) { if ( subset . get ( i ) ) { denom += ( NUM * m std devs [ i ] * m std devs [ i ] ) ; for ( int j = NUM ; j < m corr matrix [ i ] . length - NUM ; j ++ ) { if ( subset . get ( j ) ) { if ( m corr matrix [ i ] [ j ] == - NUM ) { corr = correlate ( i , j ) ; m corr matrix [ i ] [ j ] = corr ; denom += ( NUM * m std devs [ i ] * m std devs [ j ] * corr ) ; } else { denom += ( NUM * m std devs [ i ] * m std devs [ j ] * m corr matrix [ i ] [ j ] ) ; } } } } } } if ( denom < NUM ) { denom *= - NUM ; } if ( denom == NUM ) { return ( NUM ) ; } double merit = ( num / Math . sqrt ( denom ) ) ; if ( merit < NUM ) { merit *= - NUM ; } return merit ; } | @ Override public double evaluateSubset ( BitSet subset ) throws Exception { double num = _NUM ; double denom = _NUM ; float corr ; int larger , smaller ; for ( int i = _NUM ; i < m_numAttribs ; i ++ ) { if ( i != m_classIndex ) { if ( subset . get ( i ) ) { if ( i > m_classIndex ) { larger = i ; smaller = m_classIndex ; } else { smaller = i ; larger = m_classIndex ; } if ( m_corr_matrix [ larger ] [ smaller ] == - _NUM ) { corr = correlate ( i , m_classIndex ) ; m_corr_matrix [ larger ] [ smaller ] = corr ; num += ( m_std_devs [ i ] * corr ) ; } else { num += ( m_std_devs [ i ] * m_corr_matrix [ larger ] [ smaller ] ) ; } } } } for ( int i = _NUM ; i < m_numAttribs ; i ++ ) { if ( i != m_classIndex ) { if ( subset . get ( i ) ) { denom += ( _NUM * m_std_devs [ i ] * m_std_devs [ i ] ) ; for ( int j = _NUM ; j < m_corr_matrix [ i ] . length - _NUM ; j ++ ) { if ( subset . get ( j ) ) { if ( m_corr_matrix [ i ] [ j ] == - _NUM ) { corr = correlate ( i , j ) ; m_corr_matrix [ i ] [ j ] = corr ; denom += ( _NUM * m_std_devs [ i ] * m_std_devs [ j ] * corr ) ; } else { denom += ( _NUM * m_std_devs [ i ] * m_std_devs [ j ] * m_corr_matrix [ i ] [ j ] ) ; } } } } } } if ( denom < _NUM ) { denom *= - _NUM ; } if ( denom == _NUM ) { return ( _NUM ) ; } double merit = ( num / Math . sqrt ( denom ) ) ; if ( merit < _NUM ) { merit *= - _NUM ; } return merit ; } | 426 |
java-test-328 | java | What does the code add ? | an interface ref constant | public Interface Method Ref Constant add Interface Ref ( String class Name , String name , String type ) { Interface Method Ref Constant entry = get Interface Ref ( class Name , name , type ) ; if ( entry != null ) return entry ; Class Constant class Entry = add Class ( class Name ) ; Name And Type Constant type Entry = add Name And Type ( name , type ) ; entry = new Interface Method Ref Constant ( this , entries . size ( ) , class Entry . get Index ( ) , type Entry . get Index ( ) ) ; add Constant ( entry ) ; return entry ; } | public InterfaceMethodRefConstant addInterfaceRef ( String className , String name , String type ) { InterfaceMethodRefConstant entry = getInterfaceRef ( className , name , type ) ; if ( entry != null ) return entry ; ClassConstant classEntry = addClass ( className ) ; NameAndTypeConstant typeEntry = addNameAndType ( name , type ) ; entry = new InterfaceMethodRefConstant ( this , _entries . size ( ) , classEntry . getIndex ( ) , typeEntry . getIndex ( ) ) ; addConstant ( entry ) ; return entry ; } | 119 |
java-test-329 | java | Does the code add an interface ref constant ? | Yes | public Interface Method Ref Constant add Interface Ref ( String class Name , String name , String type ) { Interface Method Ref Constant entry = get Interface Ref ( class Name , name , type ) ; if ( entry != null ) return entry ; Class Constant class Entry = add Class ( class Name ) ; Name And Type Constant type Entry = add Name And Type ( name , type ) ; entry = new Interface Method Ref Constant ( this , entries . size ( ) , class Entry . get Index ( ) , type Entry . get Index ( ) ) ; add Constant ( entry ) ; return entry ; } | public InterfaceMethodRefConstant addInterfaceRef ( String className , String name , String type ) { InterfaceMethodRefConstant entry = getInterfaceRef ( className , name , type ) ; if ( entry != null ) return entry ; ClassConstant classEntry = addClass ( className ) ; NameAndTypeConstant typeEntry = addNameAndType ( name , type ) ; entry = new InterfaceMethodRefConstant ( this , _entries . size ( ) , classEntry . getIndex ( ) , typeEntry . getIndex ( ) ) ; addConstant ( entry ) ; return entry ; } | 119 |
java-test-330 | java | What does the code associate the remote txstate ? | with the thread processing this message | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-331 | java | What operates the txstate ? | this thread | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-332 | java | What should some messages like sizemessage not create ? | a new txstate | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-333 | java | What do we acquire ? | a lock on the txstate , on which this thread operates | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-334 | java | Where does this thread operate ? | the txstate | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-335 | java | Should some messages like sizemessage create a new txstate ? | No | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-336 | java | Does this thread operate the txstate ? | Yes | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-337 | java | What should not create a new txstate ? | some messages like sizemessage | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-338 | java | What does the code associate with the thread processing this message ? | the remote txstate | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-339 | java | Does the code associate the remote txstate with the thread processing this message ? | Yes | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-340 | java | Do we acquire a lock on the txstate , on which this thread operates ? | Yes | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-341 | java | Does the code associate with the thread processing this message the remote txstate ? | Yes | public TX State Proxy masquerade As ( Transaction Message msg ) throws Interrupted Exception { if ( msg . get TX Uniq Id ( ) == NOTX || ! msg . can Participate In Transaction ( ) ) { return null ; } TX Id key = new TX Id ( msg . get Member To Masquerade As ( ) , msg . get TX Uniq Id ( ) ) ; TX State Proxy val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { boolean success = get Lock ( val , key ) ; while ( ! success ) { val = get Or Set Hosted TX State ( key , msg ) ; if ( val != null ) { success = get Lock ( val , key ) ; } else { break ; } } } set TX State ( val ) ; return val ; } | public TXStateProxy masqueradeAs ( TransactionMessage msg ) throws InterruptedException { if ( msg . getTXUniqId ( ) == NOTX || ! msg . canParticipateInTransaction ( ) ) { return null ; } TXId key = new TXId ( msg . getMemberToMasqueradeAs ( ) , msg . getTXUniqId ( ) ) ; TXStateProxy val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { boolean success = getLock ( val , key ) ; while ( ! success ) { val = getOrSetHostedTXState ( key , msg ) ; if ( val != null ) { success = getLock ( val , key ) ; } else { break ; } } } setTXState ( val ) ; return val ; } | 162 |
java-test-342 | java | For what purpose do http : / / www . idrsolutions . com / access - pdf - viewer - features - from - your - code see ? | for full | @ Override @ Suppress Warnings ( STRING ) public Object execute Command ( final int command ID , final Object [ ] args ) { if ( ! is Setup ) { throw new Runtime Exception ( STRING ) ; } return current Commands . execute Command ( command ID , args ) ; } | @ Override @ SuppressWarnings ( STRING ) public Object executeCommand ( final int commandID , final Object [ ] args ) { if ( ! isSetup ) { throw new RuntimeException ( STRING ) ; } return currentCommands . executeCommand ( commandID , args ) ; } | 55 |
java-test-343 | java | For what purpose does { " http : / / www . cs . bham . ac . uk / ~ axj / pub / papers / handy1 . pdf arg ? | for full details | @ Override @ Suppress Warnings ( STRING ) public Object execute Command ( final int command ID , final Object [ ] args ) { if ( ! is Setup ) { throw new Runtime Exception ( STRING ) ; } return current Commands . execute Command ( command ID , args ) ; } | @ Override @ SuppressWarnings ( STRING ) public Object executeCommand ( final int commandID , final Object [ ] args ) { if ( ! isSetup ) { throw new RuntimeException ( STRING ) ; } return currentCommands . executeCommand ( commandID , args ) ; } | 55 |
java-test-344 | java | Do a vector3 contain the smallest x , y , and z values ? | Yes | public static Vector 3 min ( Vector 3 o1 , Vector 3 o2 ) { return new Vector 3 ( Math . min ( o1 . x , o2 . x ) , Math . min ( o1 . y , o2 . y ) , Math . min ( o1 . z , o2 . z ) ) ; } | public static Vector3 min ( Vector3 o1 , Vector3 o2 ) { return new Vector3 ( Math . min ( o1 . x , o2 . x ) , Math . min ( o1 . y , o2 . y ) , Math . min ( o1 . z , o2 . z ) ) ; } | 61 |
java-test-345 | java | What do a vector3 contain ? | the smallest x , y , and z values | public static Vector 3 min ( Vector 3 o1 , Vector 3 o2 ) { return new Vector 3 ( Math . min ( o1 . x , o2 . x ) , Math . min ( o1 . y , o2 . y ) , Math . min ( o1 . z , o2 . z ) ) ; } | public static Vector3 min ( Vector3 o1 , Vector3 o2 ) { return new Vector3 ( Math . min ( o1 . x , o2 . x ) , Math . min ( o1 . y , o2 . y ) , Math . min ( o1 . z , o2 . z ) ) ; } | 61 |
java-test-348 | java | When do _ autoengineer become null ? | during wait | protected void wait Until Stopped ( ) { boolean done Waiting = BOOL ; while ( ! done Waiting ) { if ( auto Engineer != null ) { done Waiting = auto Engineer . is Stopped ( ) ; } else { done Waiting = BOOL ; } if ( ! done Waiting ) { try { Thread . sleep ( NUM ) ; } catch ( Interrupted Exception e ) { } } } } | protected void waitUntilStopped ( ) { boolean doneWaiting = _BOOL ; while ( ! doneWaiting ) { if ( _autoEngineer != null ) { doneWaiting = _autoEngineer . isStopped ( ) ; } else { doneWaiting = _BOOL ; } if ( ! doneWaiting ) { try { Thread . sleep ( _NUM ) ; } catch ( InterruptedException e ) { } } } } | 77 |
java-test-352 | java | What does the code create ? | a d3d - based backbuffer | @ Override public Volatile Image create Back Buffer ( W Component Peer peer ) { Component target = ( Component ) peer . get Target ( ) ; int w = Math . max ( NUM , target . get Width ( ) ) ; int h = Math . max ( NUM , target . get Height ( ) ) ; return new Sun Volatile Image ( target , w , h , Boolean . TRUE ) ; } | @ Override public VolatileImage createBackBuffer ( WComponentPeer peer ) { Component target = ( Component ) peer . getTarget ( ) ; int w = Math . max ( _NUM , target . getWidth ( ) ) ; int h = Math . max ( _NUM , target . getHeight ( ) ) ; return new SunVolatileImage ( target , w , h , Boolean . TRUE ) ; } | 80 |
java-test-353 | java | Does the code create a d3d - based backbuffer ? | Yes | @ Override public Volatile Image create Back Buffer ( W Component Peer peer ) { Component target = ( Component ) peer . get Target ( ) ; int w = Math . max ( NUM , target . get Width ( ) ) ; int h = Math . max ( NUM , target . get Height ( ) ) ; return new Sun Volatile Image ( target , w , h , Boolean . TRUE ) ; } | @ Override public VolatileImage createBackBuffer ( WComponentPeer peer ) { Component target = ( Component ) peer . getTarget ( ) ; int w = Math . max ( _NUM , target . getWidth ( ) ) ; int h = Math . max ( _NUM , target . getHeight ( ) ) ; return new SunVolatileImage ( target , w , h , Boolean . TRUE ) ; } | 80 |
java-test-354 | java | Does the code return the image wrapper ? | Yes | @ Override public Volatile Image create Back Buffer ( W Component Peer peer ) { Component target = ( Component ) peer . get Target ( ) ; int w = Math . max ( NUM , target . get Width ( ) ) ; int h = Math . max ( NUM , target . get Height ( ) ) ; return new Sun Volatile Image ( target , w , h , Boolean . TRUE ) ; } | @ Override public VolatileImage createBackBuffer ( WComponentPeer peer ) { Component target = ( Component ) peer . getTarget ( ) ; int w = Math . max ( _NUM , target . getWidth ( ) ) ; int h = Math . max ( _NUM , target . getHeight ( ) ) ; return new SunVolatileImage ( target , w , h , Boolean . TRUE ) ; } | 80 |
java-test-355 | java | What does an intent create ? | a shortcut to launch the provided script in a terminal | public static Intent build Terminal Shortcut Intent ( File script , Parcelable icon Resource ) { Intent intent = new Intent ( ) ; intent . put Extra ( Intent . EXTRA SHORTCUT INTENT , build Start In Terminal Intent ( script ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT NAME , script . get Name ( ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT ICON RESOURCE , icon Resource ) ; return intent ; } | public static Intent buildTerminalShortcutIntent ( File script , Parcelable iconResource ) { Intent intent = new Intent ( ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_INTENT , buildStartInTerminalIntent ( script ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_NAME , script . getName ( ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_ICON_RESOURCE , iconResource ) ; return intent ; } | 84 |
java-test-356 | java | Does an intent create a shortcut to launch the provided script in a terminal ? | Yes | public static Intent build Terminal Shortcut Intent ( File script , Parcelable icon Resource ) { Intent intent = new Intent ( ) ; intent . put Extra ( Intent . EXTRA SHORTCUT INTENT , build Start In Terminal Intent ( script ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT NAME , script . get Name ( ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT ICON RESOURCE , icon Resource ) ; return intent ; } | public static Intent buildTerminalShortcutIntent ( File script , Parcelable iconResource ) { Intent intent = new Intent ( ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_INTENT , buildStartInTerminalIntent ( script ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_NAME , script . getName ( ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_ICON_RESOURCE , iconResource ) ; return intent ; } | 84 |
java-test-357 | java | What launchs in a terminal ? | the provided script | public static Intent build Terminal Shortcut Intent ( File script , Parcelable icon Resource ) { Intent intent = new Intent ( ) ; intent . put Extra ( Intent . EXTRA SHORTCUT INTENT , build Start In Terminal Intent ( script ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT NAME , script . get Name ( ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT ICON RESOURCE , icon Resource ) ; return intent ; } | public static Intent buildTerminalShortcutIntent ( File script , Parcelable iconResource ) { Intent intent = new Intent ( ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_INTENT , buildStartInTerminalIntent ( script ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_NAME , script . getName ( ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_ICON_RESOURCE , iconResource ) ; return intent ; } | 84 |
java-test-358 | java | Do the provided script launch in a terminal a shortcut ? | Yes | public static Intent build Terminal Shortcut Intent ( File script , Parcelable icon Resource ) { Intent intent = new Intent ( ) ; intent . put Extra ( Intent . EXTRA SHORTCUT INTENT , build Start In Terminal Intent ( script ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT NAME , script . get Name ( ) ) ; intent . put Extra ( Intent . EXTRA SHORTCUT ICON RESOURCE , icon Resource ) ; return intent ; } | public static Intent buildTerminalShortcutIntent ( File script , Parcelable iconResource ) { Intent intent = new Intent ( ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_INTENT , buildStartInTerminalIntent ( script ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_NAME , script . getName ( ) ) ; intent . putExtra ( Intent . EXTRA_SHORTCUT_ICON_RESOURCE , iconResource ) ; return intent ; } | 84 |
java-test-361 | java | What does the code add ? | an exceptional successor | public void add Exceptional Successor ( Block Impl b , Type Mirror cause ) { if ( exceptional Successors == null ) { exceptional Successors = new Hash Map < > ( ) ; } Set < Block > blocks = exceptional Successors . get ( cause ) ; if ( blocks == null ) { blocks = new Hash Set < Block > ( ) ; exceptional Successors . put ( cause , blocks ) ; } blocks . add ( b ) ; b . add Predecessor ( this ) ; } | public void addExceptionalSuccessor ( BlockImpl b , TypeMirror cause ) { if ( exceptionalSuccessors == null ) { exceptionalSuccessors = new HashMap < > ( ) ; } Set < Block > blocks = exceptionalSuccessors . get ( cause ) ; if ( blocks == null ) { blocks = new HashSet < Block > ( ) ; exceptionalSuccessors . put ( cause , blocks ) ; } blocks . add ( b ) ; b . addPredecessor ( this ) ; } | 94 |
java-test-362 | java | Does the code add an exceptional successor ? | Yes | public void add Exceptional Successor ( Block Impl b , Type Mirror cause ) { if ( exceptional Successors == null ) { exceptional Successors = new Hash Map < > ( ) ; } Set < Block > blocks = exceptional Successors . get ( cause ) ; if ( blocks == null ) { blocks = new Hash Set < Block > ( ) ; exceptional Successors . put ( cause , blocks ) ; } blocks . add ( b ) ; b . add Predecessor ( this ) ; } | public void addExceptionalSuccessor ( BlockImpl b , TypeMirror cause ) { if ( exceptionalSuccessors == null ) { exceptionalSuccessors = new HashMap < > ( ) ; } Set < Block > blocks = exceptionalSuccessors . get ( cause ) ; if ( blocks == null ) { blocks = new HashSet < Block > ( ) ; exceptionalSuccessors . put ( cause , blocks ) ; } blocks . add ( b ) ; b . addPredecessor ( this ) ; } | 94 |
java-test-366 | java | When does cleanup handle ? | when an upstream step disconnects | @ Override public void disconnection Notification ( String event Name , Object source ) { if ( source == m first Input ) { m first Input = null ; m first Input Connection Type = STRING ; } else if ( source == m second Input ) { m second Input = null ; m second Input Connection Type = STRING ; } if ( m first Input != null && m second Input != null ) { if ( m first Input Connection Type . length ( ) > NUM || m second Input Connection Type . length ( ) > NUM ) { if ( ! m first Input Connection Type . equals ( STRING ) && ! m second Input Connection Type . equals ( STRING ) ) { m incoming Batch Connections = BOOL ; } else { m incoming Batch Connections = BOOL ; } } else { m incoming Batch Connections = BOOL ; } } } | @ Override public void disconnectionNotification ( String eventName , Object source ) { if ( source == m_firstInput ) { m_firstInput = null ; m_firstInputConnectionType = STRING ; } else if ( source == m_secondInput ) { m_secondInput = null ; m_secondInputConnectionType = STRING ; } if ( m_firstInput != null && m_secondInput != null ) { if ( m_firstInputConnectionType . length ( ) > _NUM || m_secondInputConnectionType . length ( ) > _NUM ) { if ( ! m_firstInputConnectionType . equals ( STRING ) && ! m_secondInputConnectionType . equals ( STRING ) ) { m_incomingBatchConnections = _BOOL ; } else { m_incomingBatchConnections = _BOOL ; } } else { m_incomingBatchConnections = _BOOL ; } } } | 164 |
java-test-367 | java | Does the code load the handles database from disk ? | Yes | public void load ( Input Stream in Stream ) throws IO Exception { Properties properties = new Properties ( ) ; properties . load ( in Stream ) ; for ( Map . Entry < Object , Object > property : properties . entry Set ( ) ) { String handle Id = ( String ) property . get Key ( ) ; String value = ( String ) property . get Value ( ) ; Property Table handle Properties = new Property Table ( ) ; JSON Object json Object = ( JSON Object ) JSON Value . parse ( value ) ; if ( json Object != null ) { handle Properties . put All ( json Object ) ; } Handle handle = new Handle ( ) ; handle . set Id ( handle Id ) ; handle . set Properties ( handle Properties ) ; handles . put ( handle Id , handle ) ; } } | public void load ( InputStream inStream ) throws IOException { Properties properties = new Properties ( ) ; properties . load ( inStream ) ; for ( Map . Entry < Object , Object > property : properties . entrySet ( ) ) { String handleId = ( String ) property . getKey ( ) ; String value = ( String ) property . getValue ( ) ; PropertyTable handleProperties = new PropertyTable ( ) ; JSONObject jsonObject = ( JSONObject ) JSONValue . parse ( value ) ; if ( jsonObject != null ) { handleProperties . putAll ( jsonObject ) ; } Handle handle = new Handle ( ) ; handle . setId ( handleId ) ; handle . setProperties ( handleProperties ) ; handles . put ( handleId , handle ) ; } } | 161 |
java-test-368 | java | In which direction does the code load the handles database ? | from disk | public void load ( Input Stream in Stream ) throws IO Exception { Properties properties = new Properties ( ) ; properties . load ( in Stream ) ; for ( Map . Entry < Object , Object > property : properties . entry Set ( ) ) { String handle Id = ( String ) property . get Key ( ) ; String value = ( String ) property . get Value ( ) ; Property Table handle Properties = new Property Table ( ) ; JSON Object json Object = ( JSON Object ) JSON Value . parse ( value ) ; if ( json Object != null ) { handle Properties . put All ( json Object ) ; } Handle handle = new Handle ( ) ; handle . set Id ( handle Id ) ; handle . set Properties ( handle Properties ) ; handles . put ( handle Id , handle ) ; } } | public void load ( InputStream inStream ) throws IOException { Properties properties = new Properties ( ) ; properties . load ( inStream ) ; for ( Map . Entry < Object , Object > property : properties . entrySet ( ) ) { String handleId = ( String ) property . getKey ( ) ; String value = ( String ) property . getValue ( ) ; PropertyTable handleProperties = new PropertyTable ( ) ; JSONObject jsonObject = ( JSONObject ) JSONValue . parse ( value ) ; if ( jsonObject != null ) { handleProperties . putAll ( jsonObject ) ; } Handle handle = new Handle ( ) ; handle . setId ( handleId ) ; handle . setProperties ( handleProperties ) ; handles . put ( handleId , handle ) ; } } | 161 |
java-test-369 | java | What does the code load from disk ? | the handles database | public void load ( Input Stream in Stream ) throws IO Exception { Properties properties = new Properties ( ) ; properties . load ( in Stream ) ; for ( Map . Entry < Object , Object > property : properties . entry Set ( ) ) { String handle Id = ( String ) property . get Key ( ) ; String value = ( String ) property . get Value ( ) ; Property Table handle Properties = new Property Table ( ) ; JSON Object json Object = ( JSON Object ) JSON Value . parse ( value ) ; if ( json Object != null ) { handle Properties . put All ( json Object ) ; } Handle handle = new Handle ( ) ; handle . set Id ( handle Id ) ; handle . set Properties ( handle Properties ) ; handles . put ( handle Id , handle ) ; } } | public void load ( InputStream inStream ) throws IOException { Properties properties = new Properties ( ) ; properties . load ( inStream ) ; for ( Map . Entry < Object , Object > property : properties . entrySet ( ) ) { String handleId = ( String ) property . getKey ( ) ; String value = ( String ) property . getValue ( ) ; PropertyTable handleProperties = new PropertyTable ( ) ; JSONObject jsonObject = ( JSONObject ) JSONValue . parse ( value ) ; if ( jsonObject != null ) { handleProperties . putAll ( jsonObject ) ; } Handle handle = new Handle ( ) ; handle . setId ( handleId ) ; handle . setProperties ( handleProperties ) ; handles . put ( handleId , handle ) ; } } | 161 |
java-test-370 | java | How does a custom language model reset ? | by removing all corpora and words from the model | public Service Call < Void > reset Customization ( String customization Id ) { Validator . not Null ( customization Id , STRING ) ; Request Builder request Builder = Request Builder . post ( String . format ( PATH RESET , customization Id ) ) ; return create Service Call ( request Builder . build ( ) , Response Converter Utils . get Void ( ) ) ; } | public ServiceCall < Void > resetCustomization ( String customizationId ) { Validator . notNull ( customizationId , STRING ) ; RequestBuilder requestBuilder = RequestBuilder . post ( String . format ( PATH_RESET , customizationId ) ) ; return createServiceCall ( requestBuilder . build ( ) , ResponseConverterUtils . getVoid ( ) ) ; } | 70 |
java-test-371 | java | Do resetting a custom model initialize the model to its state when it was first created ? | Yes | public Service Call < Void > reset Customization ( String customization Id ) { Validator . not Null ( customization Id , STRING ) ; Request Builder request Builder = Request Builder . post ( String . format ( PATH RESET , customization Id ) ) ; return create Service Call ( request Builder . build ( ) , Response Converter Utils . get Void ( ) ) ; } | public ServiceCall < Void > resetCustomization ( String customizationId ) { Validator . notNull ( customizationId , STRING ) ; RequestBuilder requestBuilder = RequestBuilder . post ( String . format ( PATH_RESET , customizationId ) ) ; return createServiceCall ( requestBuilder . build ( ) , ResponseConverterUtils . getVoid ( ) ) ; } | 70 |
java-test-372 | java | What initializes the model to its state when it was first created ? | resetting a custom model | public Service Call < Void > reset Customization ( String customization Id ) { Validator . not Null ( customization Id , STRING ) ; Request Builder request Builder = Request Builder . post ( String . format ( PATH RESET , customization Id ) ) ; return create Service Call ( request Builder . build ( ) , Response Converter Utils . get Void ( ) ) ; } | public ServiceCall < Void > resetCustomization ( String customizationId ) { Validator . notNull ( customizationId , STRING ) ; RequestBuilder requestBuilder = RequestBuilder . post ( String . format ( PATH_RESET , customizationId ) ) ; return createServiceCall ( requestBuilder . build ( ) , ResponseConverterUtils . getVoid ( ) ) ; } | 70 |
java-test-373 | java | When do resetting a custom model initialize the model to its state ? | when it was first created | public Service Call < Void > reset Customization ( String customization Id ) { Validator . not Null ( customization Id , STRING ) ; Request Builder request Builder = Request Builder . post ( String . format ( PATH RESET , customization Id ) ) ; return create Service Call ( request Builder . build ( ) , Response Converter Utils . get Void ( ) ) ; } | public ServiceCall < Void > resetCustomization ( String customizationId ) { Validator . notNull ( customizationId , STRING ) ; RequestBuilder requestBuilder = RequestBuilder . post ( String . format ( PATH_RESET , customizationId ) ) ; return createServiceCall ( requestBuilder . build ( ) , ResponseConverterUtils . getVoid ( ) ) ; } | 70 |
java-test-374 | java | How does the code join the given list of strings ? | using the given delimiter delim | public String join ( List < String > list , String delim ) { String Builder sb = new String Builder ( ) ; String loop Delim = STRING ; for ( String s : list ) { sb . append ( loop Delim ) ; sb . append ( s ) ; loop Delim = delim ; } return sb . to String ( ) ; } | public String join ( List < String > list , String delim ) { StringBuilder sb = new StringBuilder ( ) ; String loopDelim = STRING ; for ( String s : list ) { sb . append ( loopDelim ) ; sb . append ( s ) ; loopDelim = delim ; } return sb . toString ( ) ; } | 68 |
java-test-375 | java | Does the code join the given list of strings using the given delimiter delim ? | Yes | public String join ( List < String > list , String delim ) { String Builder sb = new String Builder ( ) ; String loop Delim = STRING ; for ( String s : list ) { sb . append ( loop Delim ) ; sb . append ( s ) ; loop Delim = delim ; } return sb . to String ( ) ; } | public String join ( List < String > list , String delim ) { StringBuilder sb = new StringBuilder ( ) ; String loopDelim = STRING ; for ( String s : list ) { sb . append ( loopDelim ) ; sb . append ( s ) ; loopDelim = delim ; } return sb . toString ( ) ; } | 68 |
java-test-378 | java | Where has the table name exist already ? | in the table_schema | private boolean is Value Exists ( Cursor cursor , String table Name ) { boolean exist = BOOL ; if ( cursor . move To First ( ) ) { do { String name = cursor . get String ( cursor . get Column Index Or Throw ( Const . Table Schema . COLUMN NAME ) ) ; if ( name . equals Ignore Case ( table Name ) ) { exist = BOOL ; break ; } } while ( cursor . move To Next ( ) ) ; } return exist ; } | private boolean isValueExists ( Cursor cursor , String tableName ) { boolean exist = _BOOL ; if ( cursor . moveToFirst ( ) ) { do { String name = cursor . getString ( cursor . getColumnIndexOrThrow ( Const . TableSchema . COLUMN_NAME ) ) ; if ( name . equalsIgnoreCase ( tableName ) ) { exist = _BOOL ; break ; } } while ( cursor . moveToNext ( ) ) ; } return exist ; } | 95 |
java-test-379 | java | Has the table name exist in the table_schema already ? | Yes | private boolean is Value Exists ( Cursor cursor , String table Name ) { boolean exist = BOOL ; if ( cursor . move To First ( ) ) { do { String name = cursor . get String ( cursor . get Column Index Or Throw ( Const . Table Schema . COLUMN NAME ) ) ; if ( name . equals Ignore Case ( table Name ) ) { exist = BOOL ; break ; } } while ( cursor . move To Next ( ) ) ; } return exist ; } | private boolean isValueExists ( Cursor cursor , String tableName ) { boolean exist = _BOOL ; if ( cursor . moveToFirst ( ) ) { do { String name = cursor . getString ( cursor . getColumnIndexOrThrow ( Const . TableSchema . COLUMN_NAME ) ) ; if ( name . equalsIgnoreCase ( tableName ) ) { exist = _BOOL ; break ; } } while ( cursor . moveToNext ( ) ) ; } return exist ; } | 95 |
java-test-380 | java | How do header pack ? | by fastdfs transfer protocol | public static byte [ ] pack Header ( byte cmd , long pkg len , byte errno ) throws Unsupported Encoding Exception { byte [ ] header ; byte [ ] hex len ; header = new byte [ FDFS PROTO PKG LEN SIZE + NUM ] ; Arrays . fill ( header , ( byte ) NUM ) ; hex len = Proto Common . long 2 buff ( pkg len ) ; System . arraycopy ( hex len , NUM , header , NUM , hex len . length ) ; header [ PROTO HEADER CMD INDEX ] = cmd ; header [ PROTO HEADER STATUS INDEX ] = errno ; return header ; } | public static byte [ ] packHeader ( byte cmd , long pkg_len , byte errno ) throws UnsupportedEncodingException { byte [ ] header ; byte [ ] hex_len ; header = new byte [ FDFS_PROTO_PKG_LEN_SIZE + _NUM ] ; Arrays . fill ( header , ( byte ) _NUM ) ; hex_len = ProtoCommon . long2buff ( pkg_len ) ; System . arraycopy ( hex_len , _NUM , header , _NUM , hex_len . length ) ; header [ PROTO_HEADER_CMD_INDEX ] = cmd ; header [ PROTO_HEADER_STATUS_INDEX ] = errno ; return header ; } | 117 |
java-test-387 | java | Does the code handle the response data for creating a simple resource with content ? | Yes | private void handle Simple Resource ( final String target Uri , final Handler < Resource Node > handler , final Buffer data , final String e Tag ) { String resource Name = Expansion Delta Util . extract Collection From Path ( target Uri ) ; if ( log . is Trace Enabled ( ) ) { log . trace ( STRING + resource Name ) ; } handler . handle ( new Resource Node ( resource Name , data , e Tag , target Uri ) ) ; } | private void handleSimpleResource ( final String targetUri , final Handler < ResourceNode > handler , final Buffer data , final String eTag ) { String resourceName = ExpansionDeltaUtil . extractCollectionFromPath ( targetUri ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( STRING + resourceName ) ; } handler . handle ( new ResourceNode ( resourceName , data , eTag , targetUri ) ) ; } | 90 |
java-test-388 | java | What does the code handle ? | the response data for creating a simple resource with content | private void handle Simple Resource ( final String target Uri , final Handler < Resource Node > handler , final Buffer data , final String e Tag ) { String resource Name = Expansion Delta Util . extract Collection From Path ( target Uri ) ; if ( log . is Trace Enabled ( ) ) { log . trace ( STRING + resource Name ) ; } handler . handle ( new Resource Node ( resource Name , data , e Tag , target Uri ) ) ; } | private void handleSimpleResource ( final String targetUri , final Handler < ResourceNode > handler , final Buffer data , final String eTag ) { String resourceName = ExpansionDeltaUtil . extractCollectionFromPath ( targetUri ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( STRING + resourceName ) ; } handler . handle ( new ResourceNode ( resourceName , data , eTag , targetUri ) ) ; } | 90 |
java-test-391 | java | Does the user open a file ? | Yes | void open ( ) { if ( ! main Frame . can Navigate Away ( ) ) { return ; } if ( ask To Save ( ) ) { return ; } boolean loading = BOOL ; Save Type file Type ; try Again : while ( loading ) { int value = save Open File Chooser . show Open Dialog ( main Frame ) ; if ( value != J File Chooser . APPROVE OPTION ) { return ; } loading = BOOL ; file Type = convert Filter To Type ( save Open File Chooser . get File Filter ( ) ) ; final File f = save Open File Chooser . get Selected File ( ) ; if ( ! file Type . is Valid ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING , STRING , J Option Pane . WARNING MESSAGE ) ; loading = BOOL ; continue ; } switch ( file Type ) { case XML ANALYSIS : if ( ! f . get Name ( ) . ends With ( STRING ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , L10 N . get Local String ( STRING , STRING ) ) ; loading = BOOL ; continue try Again ; } if ( ! main Frame . open Analysis ( f , file Type ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; case FBP FILE : if ( ! open FBP File ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; case FBA FILE : if ( ! open FBA File ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; default : assert BOOL ; } } } | void open ( ) { if ( ! mainFrame . canNavigateAway ( ) ) { return ; } if ( askToSave ( ) ) { return ; } boolean loading = _BOOL ; SaveType fileType ; tryAgain : while ( loading ) { int value = saveOpenFileChooser . showOpenDialog ( mainFrame ) ; if ( value != JFileChooser . APPROVE_OPTION ) { return ; } loading = _BOOL ; fileType = convertFilterToType ( saveOpenFileChooser . getFileFilter ( ) ) ; final File f = saveOpenFileChooser . getSelectedFile ( ) ; if ( ! fileType . isValid ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING , STRING , JOptionPane . WARNING_MESSAGE ) ; loading = _BOOL ; continue ; } switch ( fileType ) { case XML_ANALYSIS : if ( ! f . getName ( ) . endsWith ( STRING ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , L10N . getLocalString ( STRING , STRING ) ) ; loading = _BOOL ; continue tryAgain ; } if ( ! mainFrame . openAnalysis ( f , fileType ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; case FBP_FILE : if ( ! openFBPFile ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; case FBA_FILE : if ( ! openFBAFile ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; default : assert _BOOL ; } } } | 363 |
java-test-392 | java | Does the user want to open a file when ? | Yes | void open ( ) { if ( ! main Frame . can Navigate Away ( ) ) { return ; } if ( ask To Save ( ) ) { return ; } boolean loading = BOOL ; Save Type file Type ; try Again : while ( loading ) { int value = save Open File Chooser . show Open Dialog ( main Frame ) ; if ( value != J File Chooser . APPROVE OPTION ) { return ; } loading = BOOL ; file Type = convert Filter To Type ( save Open File Chooser . get File Filter ( ) ) ; final File f = save Open File Chooser . get Selected File ( ) ; if ( ! file Type . is Valid ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING , STRING , J Option Pane . WARNING MESSAGE ) ; loading = BOOL ; continue ; } switch ( file Type ) { case XML ANALYSIS : if ( ! f . get Name ( ) . ends With ( STRING ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , L10 N . get Local String ( STRING , STRING ) ) ; loading = BOOL ; continue try Again ; } if ( ! main Frame . open Analysis ( f , file Type ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; case FBP FILE : if ( ! open FBP File ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; case FBA FILE : if ( ! open FBA File ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; default : assert BOOL ; } } } | void open ( ) { if ( ! mainFrame . canNavigateAway ( ) ) { return ; } if ( askToSave ( ) ) { return ; } boolean loading = _BOOL ; SaveType fileType ; tryAgain : while ( loading ) { int value = saveOpenFileChooser . showOpenDialog ( mainFrame ) ; if ( value != JFileChooser . APPROVE_OPTION ) { return ; } loading = _BOOL ; fileType = convertFilterToType ( saveOpenFileChooser . getFileFilter ( ) ) ; final File f = saveOpenFileChooser . getSelectedFile ( ) ; if ( ! fileType . isValid ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING , STRING , JOptionPane . WARNING_MESSAGE ) ; loading = _BOOL ; continue ; } switch ( fileType ) { case XML_ANALYSIS : if ( ! f . getName ( ) . endsWith ( STRING ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , L10N . getLocalString ( STRING , STRING ) ) ; loading = _BOOL ; continue tryAgain ; } if ( ! mainFrame . openAnalysis ( f , fileType ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; case FBP_FILE : if ( ! openFBPFile ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; case FBA_FILE : if ( ! openFBAFile ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; default : assert _BOOL ; } } } | 363 |
java-test-393 | java | What does the user want when ? | to open a file | void open ( ) { if ( ! main Frame . can Navigate Away ( ) ) { return ; } if ( ask To Save ( ) ) { return ; } boolean loading = BOOL ; Save Type file Type ; try Again : while ( loading ) { int value = save Open File Chooser . show Open Dialog ( main Frame ) ; if ( value != J File Chooser . APPROVE OPTION ) { return ; } loading = BOOL ; file Type = convert Filter To Type ( save Open File Chooser . get File Filter ( ) ) ; final File f = save Open File Chooser . get Selected File ( ) ; if ( ! file Type . is Valid ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING , STRING , J Option Pane . WARNING MESSAGE ) ; loading = BOOL ; continue ; } switch ( file Type ) { case XML ANALYSIS : if ( ! f . get Name ( ) . ends With ( STRING ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , L10 N . get Local String ( STRING , STRING ) ) ; loading = BOOL ; continue try Again ; } if ( ! main Frame . open Analysis ( f , file Type ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; case FBP FILE : if ( ! open FBP File ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; case FBA FILE : if ( ! open FBA File ( f ) ) { J Option Pane . show Message Dialog ( save Open File Chooser , STRING ) ; loading = BOOL ; continue try Again ; } break ; default : assert BOOL ; } } } | void open ( ) { if ( ! mainFrame . canNavigateAway ( ) ) { return ; } if ( askToSave ( ) ) { return ; } boolean loading = _BOOL ; SaveType fileType ; tryAgain : while ( loading ) { int value = saveOpenFileChooser . showOpenDialog ( mainFrame ) ; if ( value != JFileChooser . APPROVE_OPTION ) { return ; } loading = _BOOL ; fileType = convertFilterToType ( saveOpenFileChooser . getFileFilter ( ) ) ; final File f = saveOpenFileChooser . getSelectedFile ( ) ; if ( ! fileType . isValid ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING , STRING , JOptionPane . WARNING_MESSAGE ) ; loading = _BOOL ; continue ; } switch ( fileType ) { case XML_ANALYSIS : if ( ! f . getName ( ) . endsWith ( STRING ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , L10N . getLocalString ( STRING , STRING ) ) ; loading = _BOOL ; continue tryAgain ; } if ( ! mainFrame . openAnalysis ( f , fileType ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; case FBP_FILE : if ( ! openFBPFile ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; case FBA_FILE : if ( ! openFBAFile ( f ) ) { JOptionPane . showMessageDialog ( saveOpenFileChooser , STRING ) ; loading = _BOOL ; continue tryAgain ; } break ; default : assert _BOOL ; } } } | 363 |
java-test-394 | java | Have two containers contain same things ? | Yes | public boolean has Non Empty Intersection ( Pt Sens Visitor < Var Type > other ) { for ( Map . Entry < Node , List < Var Type > > entry : table View . entry Set ( ) ) { Node var = entry . get Key ( ) ; List < Var Type > list 1 = entry . get Value ( ) ; List < Var Type > list 2 = other . get CS List ( var ) ; if ( list 1 . size ( ) == NUM || list 2 . size ( ) == NUM ) continue ; for ( Var Type cv 1 : list 1 ) { for ( Var Type cv 2 : list 2 ) if ( cv 1 . intersect ( cv 2 ) ) return BOOL ; } } return BOOL ; } | public boolean hasNonEmptyIntersection ( PtSensVisitor < VarType > other ) { for ( Map . Entry < Node , List < VarType > > entry : tableView . entrySet ( ) ) { Node var = entry . getKey ( ) ; List < VarType > list1 = entry . getValue ( ) ; List < VarType > list2 = other . getCSList ( var ) ; if ( list1 . size ( ) == _NUM || list2 . size ( ) == _NUM ) continue ; for ( VarType cv1 : list1 ) { for ( VarType cv2 : list2 ) if ( cv1 . intersect ( cv2 ) ) return _BOOL ; } } return _BOOL ; } | 147 |
java-test-395 | java | What can be used to answer the alias query ? | tests if two containers have contain same things . | public boolean has Non Empty Intersection ( Pt Sens Visitor < Var Type > other ) { for ( Map . Entry < Node , List < Var Type > > entry : table View . entry Set ( ) ) { Node var = entry . get Key ( ) ; List < Var Type > list 1 = entry . get Value ( ) ; List < Var Type > list 2 = other . get CS List ( var ) ; if ( list 1 . size ( ) == NUM || list 2 . size ( ) == NUM ) continue ; for ( Var Type cv 1 : list 1 ) { for ( Var Type cv 2 : list 2 ) if ( cv 1 . intersect ( cv 2 ) ) return BOOL ; } } return BOOL ; } | public boolean hasNonEmptyIntersection ( PtSensVisitor < VarType > other ) { for ( Map . Entry < Node , List < VarType > > entry : tableView . entrySet ( ) ) { Node var = entry . getKey ( ) ; List < VarType > list1 = entry . getValue ( ) ; List < VarType > list2 = other . getCSList ( var ) ; if ( list1 . size ( ) == _NUM || list2 . size ( ) == _NUM ) continue ; for ( VarType cv1 : list1 ) { for ( VarType cv2 : list2 ) if ( cv1 . intersect ( cv2 ) ) return _BOOL ; } } return _BOOL ; } | 147 |
java-test-396 | java | What have contain same things ? | two containers | public boolean has Non Empty Intersection ( Pt Sens Visitor < Var Type > other ) { for ( Map . Entry < Node , List < Var Type > > entry : table View . entry Set ( ) ) { Node var = entry . get Key ( ) ; List < Var Type > list 1 = entry . get Value ( ) ; List < Var Type > list 2 = other . get CS List ( var ) ; if ( list 1 . size ( ) == NUM || list 2 . size ( ) == NUM ) continue ; for ( Var Type cv 1 : list 1 ) { for ( Var Type cv 2 : list 2 ) if ( cv 1 . intersect ( cv 2 ) ) return BOOL ; } } return BOOL ; } | public boolean hasNonEmptyIntersection ( PtSensVisitor < VarType > other ) { for ( Map . Entry < Node , List < VarType > > entry : tableView . entrySet ( ) ) { Node var = entry . getKey ( ) ; List < VarType > list1 = entry . getValue ( ) ; List < VarType > list2 = other . getCSList ( var ) ; if ( list1 . size ( ) == _NUM || list2 . size ( ) == _NUM ) continue ; for ( VarType cv1 : list1 ) { for ( VarType cv2 : list2 ) if ( cv1 . intersect ( cv2 ) ) return _BOOL ; } } return _BOOL ; } | 147 |
java-test-397 | java | Can tests if two containers have contain same things . be used to answer the alias query ? | Yes | public boolean has Non Empty Intersection ( Pt Sens Visitor < Var Type > other ) { for ( Map . Entry < Node , List < Var Type > > entry : table View . entry Set ( ) ) { Node var = entry . get Key ( ) ; List < Var Type > list 1 = entry . get Value ( ) ; List < Var Type > list 2 = other . get CS List ( var ) ; if ( list 1 . size ( ) == NUM || list 2 . size ( ) == NUM ) continue ; for ( Var Type cv 1 : list 1 ) { for ( Var Type cv 2 : list 2 ) if ( cv 1 . intersect ( cv 2 ) ) return BOOL ; } } return BOOL ; } | public boolean hasNonEmptyIntersection ( PtSensVisitor < VarType > other ) { for ( Map . Entry < Node , List < VarType > > entry : tableView . entrySet ( ) ) { Node var = entry . getKey ( ) ; List < VarType > list1 = entry . getValue ( ) ; List < VarType > list2 = other . getCSList ( var ) ; if ( list1 . size ( ) == _NUM || list2 . size ( ) == _NUM ) continue ; for ( VarType cv1 : list1 ) { for ( VarType cv2 : list2 ) if ( cv1 . intersect ( cv2 ) ) return _BOOL ; } } return _BOOL ; } | 147 |
java-test-398 | java | What can tests if two containers have contain same things . be used ? | to answer the alias query | public boolean has Non Empty Intersection ( Pt Sens Visitor < Var Type > other ) { for ( Map . Entry < Node , List < Var Type > > entry : table View . entry Set ( ) ) { Node var = entry . get Key ( ) ; List < Var Type > list 1 = entry . get Value ( ) ; List < Var Type > list 2 = other . get CS List ( var ) ; if ( list 1 . size ( ) == NUM || list 2 . size ( ) == NUM ) continue ; for ( Var Type cv 1 : list 1 ) { for ( Var Type cv 2 : list 2 ) if ( cv 1 . intersect ( cv 2 ) ) return BOOL ; } } return BOOL ; } | public boolean hasNonEmptyIntersection ( PtSensVisitor < VarType > other ) { for ( Map . Entry < Node , List < VarType > > entry : tableView . entrySet ( ) ) { Node var = entry . getKey ( ) ; List < VarType > list1 = entry . getValue ( ) ; List < VarType > list2 = other . getCSList ( var ) ; if ( list1 . size ( ) == _NUM || list2 . size ( ) == _NUM ) continue ; for ( VarType cv1 : list1 ) { for ( VarType cv2 : list2 ) if ( cv1 . intersect ( cv2 ) ) return _BOOL ; } } return _BOOL ; } | 147 |
java-test-399 | java | What have two containers contain ? | same things | public boolean has Non Empty Intersection ( Pt Sens Visitor < Var Type > other ) { for ( Map . Entry < Node , List < Var Type > > entry : table View . entry Set ( ) ) { Node var = entry . get Key ( ) ; List < Var Type > list 1 = entry . get Value ( ) ; List < Var Type > list 2 = other . get CS List ( var ) ; if ( list 1 . size ( ) == NUM || list 2 . size ( ) == NUM ) continue ; for ( Var Type cv 1 : list 1 ) { for ( Var Type cv 2 : list 2 ) if ( cv 1 . intersect ( cv 2 ) ) return BOOL ; } } return BOOL ; } | public boolean hasNonEmptyIntersection ( PtSensVisitor < VarType > other ) { for ( Map . Entry < Node , List < VarType > > entry : tableView . entrySet ( ) ) { Node var = entry . getKey ( ) ; List < VarType > list1 = entry . getValue ( ) ; List < VarType > list2 = other . getCSList ( var ) ; if ( list1 . size ( ) == _NUM || list2 . size ( ) == _NUM ) continue ; for ( VarType cv1 : list1 ) { for ( VarType cv2 : list2 ) if ( cv1 . intersect ( cv2 ) ) return _BOOL ; } } return _BOOL ; } | 147 |
java-test-401 | java | What does the code compute iteratively ? | the distance between two points on an ellipsoid | public static double ellipsoidal Distance ( Lat Lon p1 , Lat Lon p2 , double equatorial Radius , double polar Radius ) { final double F = ( equatorial Radius - polar Radius ) / equatorial Radius ; final double R = NUM - F ; final double EPS = NUM ; if ( p1 == null || p2 == null ) { throw new Illegal Argument Exception ( STRING ) ; } double GLAT 1 = p1 . get Latitude ( ) . radians ; double GLAT 2 = p2 . get Latitude ( ) . radians ; double TU 1 = R * Math . sin ( GLAT 1 ) / Math . cos ( GLAT 1 ) ; double TU 2 = R * Math . sin ( GLAT 2 ) / Math . cos ( GLAT 2 ) ; double CU 1 = NUM / Math . sqrt ( TU 1 * TU 1 + NUM ) ; double SU 1 = CU 1 * TU 1 ; double CU 2 = NUM / Math . sqrt ( TU 2 * TU 2 + NUM ) ; double S = CU 1 * CU 2 ; double BAZ = S * TU 2 ; double FAZ = BAZ * TU 1 ; double GLON 1 = p1 . get Longitude ( ) . radians ; double GLON 2 = p2 . get Longitude ( ) . radians ; double X = GLON 2 - GLON 1 ; double D , SX , CX , SY , CY , Y , SA , C2 A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU 1 = CU 2 * SX ; TU 2 = BAZ - SU 1 * CU 2 * CX ; SY = Math . sqrt ( TU 1 * TU 1 + TU 2 * TU 2 ) ; CY = S * CX + FAZ ; Y = Math . atan 2 ( SY , CY ) ; SA = S * SX / SY ; C2 A = - SA * SA + NUM ; CZ = FAZ + FAZ ; if ( C2 A > NUM ) { CZ = - CZ / C2 A + CY ; } E = CZ * CZ * NUM - NUM ; C = ( ( - NUM * C2 A + NUM ) * F + NUM ) * C2 A * F / NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( NUM - C ) * X * F + GLON 2 - GLON 1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( NUM / R / R - NUM ) * C2 A + NUM ) + NUM ; X = ( X - NUM ) / X ; C = NUM - X ; C = ( X * X / NUM + NUM ) / C ; D = ( NUM * X * X - NUM ) * X ; X = E * CY ; S = NUM - E - E ; S = ( ( ( ( SY * SY * NUM - NUM ) * S * CZ * D / NUM - X ) * D / NUM + CZ ) * SY * D + Y ) * C * equatorial Radius * R ; return S ; } | public static double ellipsoidalDistance ( LatLon p1 , LatLon p2 , double equatorialRadius , double polarRadius ) { final double F = ( equatorialRadius - polarRadius ) / equatorialRadius ; final double R = _NUM - F ; final double EPS = _NUM ; if ( p1 == null || p2 == null ) { throw new IllegalArgumentException ( STRING ) ; } double GLAT1 = p1 . getLatitude ( ) . radians ; double GLAT2 = p2 . getLatitude ( ) . radians ; double TU1 = R * Math . sin ( GLAT1 ) / Math . cos ( GLAT1 ) ; double TU2 = R * Math . sin ( GLAT2 ) / Math . cos ( GLAT2 ) ; double CU1 = _NUM / Math . sqrt ( TU1 * TU1 + _NUM ) ; double SU1 = CU1 * TU1 ; double CU2 = _NUM / Math . sqrt ( TU2 * TU2 + _NUM ) ; double S = CU1 * CU2 ; double BAZ = S * TU2 ; double FAZ = BAZ * TU1 ; double GLON1 = p1 . getLongitude ( ) . radians ; double GLON2 = p2 . getLongitude ( ) . radians ; double X = GLON2 - GLON1 ; double D , SX , CX , SY , CY , Y , SA , C2A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU1 = CU2 * SX ; TU2 = BAZ - SU1 * CU2 * CX ; SY = Math . sqrt ( TU1 * TU1 + TU2 * TU2 ) ; CY = S * CX + FAZ ; Y = Math . atan2 ( SY , CY ) ; SA = S * SX / SY ; C2A = - SA * SA + _NUM ; CZ = FAZ + FAZ ; if ( C2A > _NUM ) { CZ = - CZ / C2A + CY ; } E = CZ * CZ * _NUM - _NUM ; C = ( ( - _NUM * C2A + _NUM ) * F + _NUM ) * C2A * F / _NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( _NUM - C ) * X * F + GLON2 - GLON1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( _NUM / R / R - _NUM ) * C2A + _NUM ) + _NUM ; X = ( X - _NUM ) / X ; C = _NUM - X ; C = ( X * X / _NUM + _NUM ) / C ; D = ( _NUM * X * X - _NUM ) * X ; X = E * CY ; S = _NUM - E - E ; S = ( ( ( ( SY * SY * _NUM - _NUM ) * S * CZ * D / _NUM - X ) * D / _NUM + CZ ) * SY * D + Y ) * C * equatorialRadius * R ; return S ; } | 625 |
java-test-402 | java | Where be vincenty not be the geographic pole ? | at any distance short of antipodal standpoint / forepoint | public static double ellipsoidal Distance ( Lat Lon p1 , Lat Lon p2 , double equatorial Radius , double polar Radius ) { final double F = ( equatorial Radius - polar Radius ) / equatorial Radius ; final double R = NUM - F ; final double EPS = NUM ; if ( p1 == null || p2 == null ) { throw new Illegal Argument Exception ( STRING ) ; } double GLAT 1 = p1 . get Latitude ( ) . radians ; double GLAT 2 = p2 . get Latitude ( ) . radians ; double TU 1 = R * Math . sin ( GLAT 1 ) / Math . cos ( GLAT 1 ) ; double TU 2 = R * Math . sin ( GLAT 2 ) / Math . cos ( GLAT 2 ) ; double CU 1 = NUM / Math . sqrt ( TU 1 * TU 1 + NUM ) ; double SU 1 = CU 1 * TU 1 ; double CU 2 = NUM / Math . sqrt ( TU 2 * TU 2 + NUM ) ; double S = CU 1 * CU 2 ; double BAZ = S * TU 2 ; double FAZ = BAZ * TU 1 ; double GLON 1 = p1 . get Longitude ( ) . radians ; double GLON 2 = p2 . get Longitude ( ) . radians ; double X = GLON 2 - GLON 1 ; double D , SX , CX , SY , CY , Y , SA , C2 A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU 1 = CU 2 * SX ; TU 2 = BAZ - SU 1 * CU 2 * CX ; SY = Math . sqrt ( TU 1 * TU 1 + TU 2 * TU 2 ) ; CY = S * CX + FAZ ; Y = Math . atan 2 ( SY , CY ) ; SA = S * SX / SY ; C2 A = - SA * SA + NUM ; CZ = FAZ + FAZ ; if ( C2 A > NUM ) { CZ = - CZ / C2 A + CY ; } E = CZ * CZ * NUM - NUM ; C = ( ( - NUM * C2 A + NUM ) * F + NUM ) * C2 A * F / NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( NUM - C ) * X * F + GLON 2 - GLON 1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( NUM / R / R - NUM ) * C2 A + NUM ) + NUM ; X = ( X - NUM ) / X ; C = NUM - X ; C = ( X * X / NUM + NUM ) / C ; D = ( NUM * X * X - NUM ) * X ; X = E * CY ; S = NUM - E - E ; S = ( ( ( ( SY * SY * NUM - NUM ) * S * CZ * D / NUM - X ) * D / NUM + CZ ) * SY * D + Y ) * C * equatorial Radius * R ; return S ; } | public static double ellipsoidalDistance ( LatLon p1 , LatLon p2 , double equatorialRadius , double polarRadius ) { final double F = ( equatorialRadius - polarRadius ) / equatorialRadius ; final double R = _NUM - F ; final double EPS = _NUM ; if ( p1 == null || p2 == null ) { throw new IllegalArgumentException ( STRING ) ; } double GLAT1 = p1 . getLatitude ( ) . radians ; double GLAT2 = p2 . getLatitude ( ) . radians ; double TU1 = R * Math . sin ( GLAT1 ) / Math . cos ( GLAT1 ) ; double TU2 = R * Math . sin ( GLAT2 ) / Math . cos ( GLAT2 ) ; double CU1 = _NUM / Math . sqrt ( TU1 * TU1 + _NUM ) ; double SU1 = CU1 * TU1 ; double CU2 = _NUM / Math . sqrt ( TU2 * TU2 + _NUM ) ; double S = CU1 * CU2 ; double BAZ = S * TU2 ; double FAZ = BAZ * TU1 ; double GLON1 = p1 . getLongitude ( ) . radians ; double GLON2 = p2 . getLongitude ( ) . radians ; double X = GLON2 - GLON1 ; double D , SX , CX , SY , CY , Y , SA , C2A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU1 = CU2 * SX ; TU2 = BAZ - SU1 * CU2 * CX ; SY = Math . sqrt ( TU1 * TU1 + TU2 * TU2 ) ; CY = S * CX + FAZ ; Y = Math . atan2 ( SY , CY ) ; SA = S * SX / SY ; C2A = - SA * SA + _NUM ; CZ = FAZ + FAZ ; if ( C2A > _NUM ) { CZ = - CZ / C2A + CY ; } E = CZ * CZ * _NUM - _NUM ; C = ( ( - _NUM * C2A + _NUM ) * F + _NUM ) * C2A * F / _NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( _NUM - C ) * X * F + GLON2 - GLON1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( _NUM / R / R - _NUM ) * C2A + _NUM ) + _NUM ; X = ( X - _NUM ) / X ; C = _NUM - X ; C = ( X * X / _NUM + _NUM ) / C ; D = ( _NUM * X * X - _NUM ) * X ; X = E * CY ; S = _NUM - E - E ; S = ( ( ( ( SY * SY * _NUM - _NUM ) * S * CZ * D / _NUM - X ) * D / _NUM + CZ ) * SY * D + Y ) * C * equatorialRadius * R ; return S ; } | 625 |
java-test-403 | java | Be vincenty be the geographic pole at any distance short of antipodal standpoint / forepoint ? | No | public static double ellipsoidal Distance ( Lat Lon p1 , Lat Lon p2 , double equatorial Radius , double polar Radius ) { final double F = ( equatorial Radius - polar Radius ) / equatorial Radius ; final double R = NUM - F ; final double EPS = NUM ; if ( p1 == null || p2 == null ) { throw new Illegal Argument Exception ( STRING ) ; } double GLAT 1 = p1 . get Latitude ( ) . radians ; double GLAT 2 = p2 . get Latitude ( ) . radians ; double TU 1 = R * Math . sin ( GLAT 1 ) / Math . cos ( GLAT 1 ) ; double TU 2 = R * Math . sin ( GLAT 2 ) / Math . cos ( GLAT 2 ) ; double CU 1 = NUM / Math . sqrt ( TU 1 * TU 1 + NUM ) ; double SU 1 = CU 1 * TU 1 ; double CU 2 = NUM / Math . sqrt ( TU 2 * TU 2 + NUM ) ; double S = CU 1 * CU 2 ; double BAZ = S * TU 2 ; double FAZ = BAZ * TU 1 ; double GLON 1 = p1 . get Longitude ( ) . radians ; double GLON 2 = p2 . get Longitude ( ) . radians ; double X = GLON 2 - GLON 1 ; double D , SX , CX , SY , CY , Y , SA , C2 A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU 1 = CU 2 * SX ; TU 2 = BAZ - SU 1 * CU 2 * CX ; SY = Math . sqrt ( TU 1 * TU 1 + TU 2 * TU 2 ) ; CY = S * CX + FAZ ; Y = Math . atan 2 ( SY , CY ) ; SA = S * SX / SY ; C2 A = - SA * SA + NUM ; CZ = FAZ + FAZ ; if ( C2 A > NUM ) { CZ = - CZ / C2 A + CY ; } E = CZ * CZ * NUM - NUM ; C = ( ( - NUM * C2 A + NUM ) * F + NUM ) * C2 A * F / NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( NUM - C ) * X * F + GLON 2 - GLON 1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( NUM / R / R - NUM ) * C2 A + NUM ) + NUM ; X = ( X - NUM ) / X ; C = NUM - X ; C = ( X * X / NUM + NUM ) / C ; D = ( NUM * X * X - NUM ) * X ; X = E * CY ; S = NUM - E - E ; S = ( ( ( ( SY * SY * NUM - NUM ) * S * CZ * D / NUM - X ) * D / NUM + CZ ) * SY * D + Y ) * C * equatorial Radius * R ; return S ; } | public static double ellipsoidalDistance ( LatLon p1 , LatLon p2 , double equatorialRadius , double polarRadius ) { final double F = ( equatorialRadius - polarRadius ) / equatorialRadius ; final double R = _NUM - F ; final double EPS = _NUM ; if ( p1 == null || p2 == null ) { throw new IllegalArgumentException ( STRING ) ; } double GLAT1 = p1 . getLatitude ( ) . radians ; double GLAT2 = p2 . getLatitude ( ) . radians ; double TU1 = R * Math . sin ( GLAT1 ) / Math . cos ( GLAT1 ) ; double TU2 = R * Math . sin ( GLAT2 ) / Math . cos ( GLAT2 ) ; double CU1 = _NUM / Math . sqrt ( TU1 * TU1 + _NUM ) ; double SU1 = CU1 * TU1 ; double CU2 = _NUM / Math . sqrt ( TU2 * TU2 + _NUM ) ; double S = CU1 * CU2 ; double BAZ = S * TU2 ; double FAZ = BAZ * TU1 ; double GLON1 = p1 . getLongitude ( ) . radians ; double GLON2 = p2 . getLongitude ( ) . radians ; double X = GLON2 - GLON1 ; double D , SX , CX , SY , CY , Y , SA , C2A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU1 = CU2 * SX ; TU2 = BAZ - SU1 * CU2 * CX ; SY = Math . sqrt ( TU1 * TU1 + TU2 * TU2 ) ; CY = S * CX + FAZ ; Y = Math . atan2 ( SY , CY ) ; SA = S * SX / SY ; C2A = - SA * SA + _NUM ; CZ = FAZ + FAZ ; if ( C2A > _NUM ) { CZ = - CZ / C2A + CY ; } E = CZ * CZ * _NUM - _NUM ; C = ( ( - _NUM * C2A + _NUM ) * F + _NUM ) * C2A * F / _NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( _NUM - C ) * X * F + GLON2 - GLON1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( _NUM / R / R - _NUM ) * C2A + _NUM ) + _NUM ; X = ( X - _NUM ) / X ; C = _NUM - X ; C = ( X * X / _NUM + _NUM ) / C ; D = ( _NUM * X * X - _NUM ) * X ; X = E * CY ; S = _NUM - E - E ; S = ( ( ( ( SY * SY * _NUM - _NUM ) * S * CZ * D / _NUM - X ) * D / _NUM + CZ ) * SY * D + Y ) * C * equatorialRadius * R ; return S ; } | 625 |
java-test-404 | java | Does the code compute the distance between two points on an ellipsoid iteratively ? | Yes | public static double ellipsoidal Distance ( Lat Lon p1 , Lat Lon p2 , double equatorial Radius , double polar Radius ) { final double F = ( equatorial Radius - polar Radius ) / equatorial Radius ; final double R = NUM - F ; final double EPS = NUM ; if ( p1 == null || p2 == null ) { throw new Illegal Argument Exception ( STRING ) ; } double GLAT 1 = p1 . get Latitude ( ) . radians ; double GLAT 2 = p2 . get Latitude ( ) . radians ; double TU 1 = R * Math . sin ( GLAT 1 ) / Math . cos ( GLAT 1 ) ; double TU 2 = R * Math . sin ( GLAT 2 ) / Math . cos ( GLAT 2 ) ; double CU 1 = NUM / Math . sqrt ( TU 1 * TU 1 + NUM ) ; double SU 1 = CU 1 * TU 1 ; double CU 2 = NUM / Math . sqrt ( TU 2 * TU 2 + NUM ) ; double S = CU 1 * CU 2 ; double BAZ = S * TU 2 ; double FAZ = BAZ * TU 1 ; double GLON 1 = p1 . get Longitude ( ) . radians ; double GLON 2 = p2 . get Longitude ( ) . radians ; double X = GLON 2 - GLON 1 ; double D , SX , CX , SY , CY , Y , SA , C2 A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU 1 = CU 2 * SX ; TU 2 = BAZ - SU 1 * CU 2 * CX ; SY = Math . sqrt ( TU 1 * TU 1 + TU 2 * TU 2 ) ; CY = S * CX + FAZ ; Y = Math . atan 2 ( SY , CY ) ; SA = S * SX / SY ; C2 A = - SA * SA + NUM ; CZ = FAZ + FAZ ; if ( C2 A > NUM ) { CZ = - CZ / C2 A + CY ; } E = CZ * CZ * NUM - NUM ; C = ( ( - NUM * C2 A + NUM ) * F + NUM ) * C2 A * F / NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( NUM - C ) * X * F + GLON 2 - GLON 1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( NUM / R / R - NUM ) * C2 A + NUM ) + NUM ; X = ( X - NUM ) / X ; C = NUM - X ; C = ( X * X / NUM + NUM ) / C ; D = ( NUM * X * X - NUM ) * X ; X = E * CY ; S = NUM - E - E ; S = ( ( ( ( SY * SY * NUM - NUM ) * S * CZ * D / NUM - X ) * D / NUM + CZ ) * SY * D + Y ) * C * equatorial Radius * R ; return S ; } | public static double ellipsoidalDistance ( LatLon p1 , LatLon p2 , double equatorialRadius , double polarRadius ) { final double F = ( equatorialRadius - polarRadius ) / equatorialRadius ; final double R = _NUM - F ; final double EPS = _NUM ; if ( p1 == null || p2 == null ) { throw new IllegalArgumentException ( STRING ) ; } double GLAT1 = p1 . getLatitude ( ) . radians ; double GLAT2 = p2 . getLatitude ( ) . radians ; double TU1 = R * Math . sin ( GLAT1 ) / Math . cos ( GLAT1 ) ; double TU2 = R * Math . sin ( GLAT2 ) / Math . cos ( GLAT2 ) ; double CU1 = _NUM / Math . sqrt ( TU1 * TU1 + _NUM ) ; double SU1 = CU1 * TU1 ; double CU2 = _NUM / Math . sqrt ( TU2 * TU2 + _NUM ) ; double S = CU1 * CU2 ; double BAZ = S * TU2 ; double FAZ = BAZ * TU1 ; double GLON1 = p1 . getLongitude ( ) . radians ; double GLON2 = p2 . getLongitude ( ) . radians ; double X = GLON2 - GLON1 ; double D , SX , CX , SY , CY , Y , SA , C2A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU1 = CU2 * SX ; TU2 = BAZ - SU1 * CU2 * CX ; SY = Math . sqrt ( TU1 * TU1 + TU2 * TU2 ) ; CY = S * CX + FAZ ; Y = Math . atan2 ( SY , CY ) ; SA = S * SX / SY ; C2A = - SA * SA + _NUM ; CZ = FAZ + FAZ ; if ( C2A > _NUM ) { CZ = - CZ / C2A + CY ; } E = CZ * CZ * _NUM - _NUM ; C = ( ( - _NUM * C2A + _NUM ) * F + _NUM ) * C2A * F / _NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( _NUM - C ) * X * F + GLON2 - GLON1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( _NUM / R / R - _NUM ) * C2A + _NUM ) + _NUM ; X = ( X - _NUM ) / X ; C = _NUM - X ; C = ( X * X / _NUM + _NUM ) / C ; D = ( _NUM * X * X - _NUM ) * X ; X = E * CY ; S = _NUM - E - E ; S = ( ( ( ( SY * SY * _NUM - _NUM ) * S * CZ * D / _NUM - X ) * D / _NUM + CZ ) * SY * D + Y ) * C * equatorialRadius * R ; return S ; } | 625 |
java-test-405 | java | How does the code compute the distance between two points on an ellipsoid ? | iteratively | public static double ellipsoidal Distance ( Lat Lon p1 , Lat Lon p2 , double equatorial Radius , double polar Radius ) { final double F = ( equatorial Radius - polar Radius ) / equatorial Radius ; final double R = NUM - F ; final double EPS = NUM ; if ( p1 == null || p2 == null ) { throw new Illegal Argument Exception ( STRING ) ; } double GLAT 1 = p1 . get Latitude ( ) . radians ; double GLAT 2 = p2 . get Latitude ( ) . radians ; double TU 1 = R * Math . sin ( GLAT 1 ) / Math . cos ( GLAT 1 ) ; double TU 2 = R * Math . sin ( GLAT 2 ) / Math . cos ( GLAT 2 ) ; double CU 1 = NUM / Math . sqrt ( TU 1 * TU 1 + NUM ) ; double SU 1 = CU 1 * TU 1 ; double CU 2 = NUM / Math . sqrt ( TU 2 * TU 2 + NUM ) ; double S = CU 1 * CU 2 ; double BAZ = S * TU 2 ; double FAZ = BAZ * TU 1 ; double GLON 1 = p1 . get Longitude ( ) . radians ; double GLON 2 = p2 . get Longitude ( ) . radians ; double X = GLON 2 - GLON 1 ; double D , SX , CX , SY , CY , Y , SA , C2 A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU 1 = CU 2 * SX ; TU 2 = BAZ - SU 1 * CU 2 * CX ; SY = Math . sqrt ( TU 1 * TU 1 + TU 2 * TU 2 ) ; CY = S * CX + FAZ ; Y = Math . atan 2 ( SY , CY ) ; SA = S * SX / SY ; C2 A = - SA * SA + NUM ; CZ = FAZ + FAZ ; if ( C2 A > NUM ) { CZ = - CZ / C2 A + CY ; } E = CZ * CZ * NUM - NUM ; C = ( ( - NUM * C2 A + NUM ) * F + NUM ) * C2 A * F / NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( NUM - C ) * X * F + GLON 2 - GLON 1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( NUM / R / R - NUM ) * C2 A + NUM ) + NUM ; X = ( X - NUM ) / X ; C = NUM - X ; C = ( X * X / NUM + NUM ) / C ; D = ( NUM * X * X - NUM ) * X ; X = E * CY ; S = NUM - E - E ; S = ( ( ( ( SY * SY * NUM - NUM ) * S * CZ * D / NUM - X ) * D / NUM + CZ ) * SY * D + Y ) * C * equatorial Radius * R ; return S ; } | public static double ellipsoidalDistance ( LatLon p1 , LatLon p2 , double equatorialRadius , double polarRadius ) { final double F = ( equatorialRadius - polarRadius ) / equatorialRadius ; final double R = _NUM - F ; final double EPS = _NUM ; if ( p1 == null || p2 == null ) { throw new IllegalArgumentException ( STRING ) ; } double GLAT1 = p1 . getLatitude ( ) . radians ; double GLAT2 = p2 . getLatitude ( ) . radians ; double TU1 = R * Math . sin ( GLAT1 ) / Math . cos ( GLAT1 ) ; double TU2 = R * Math . sin ( GLAT2 ) / Math . cos ( GLAT2 ) ; double CU1 = _NUM / Math . sqrt ( TU1 * TU1 + _NUM ) ; double SU1 = CU1 * TU1 ; double CU2 = _NUM / Math . sqrt ( TU2 * TU2 + _NUM ) ; double S = CU1 * CU2 ; double BAZ = S * TU2 ; double FAZ = BAZ * TU1 ; double GLON1 = p1 . getLongitude ( ) . radians ; double GLON2 = p2 . getLongitude ( ) . radians ; double X = GLON2 - GLON1 ; double D , SX , CX , SY , CY , Y , SA , C2A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU1 = CU2 * SX ; TU2 = BAZ - SU1 * CU2 * CX ; SY = Math . sqrt ( TU1 * TU1 + TU2 * TU2 ) ; CY = S * CX + FAZ ; Y = Math . atan2 ( SY , CY ) ; SA = S * SX / SY ; C2A = - SA * SA + _NUM ; CZ = FAZ + FAZ ; if ( C2A > _NUM ) { CZ = - CZ / C2A + CY ; } E = CZ * CZ * _NUM - _NUM ; C = ( ( - _NUM * C2A + _NUM ) * F + _NUM ) * C2A * F / _NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( _NUM - C ) * X * F + GLON2 - GLON1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( _NUM / R / R - _NUM ) * C2A + _NUM ) + _NUM ; X = ( X - _NUM ) / X ; C = _NUM - X ; C = ( X * X / _NUM + _NUM ) / C ; D = ( _NUM * X * X - _NUM ) * X ; X = E * CY ; S = _NUM - E - E ; S = ( ( ( ( SY * SY * _NUM - _NUM ) * S * CZ * D / _NUM - X ) * D / _NUM + CZ ) * SY * D + Y ) * C * equatorialRadius * R ; return S ; } | 625 |
java-test-406 | java | What be not the geographic pole at any distance short of antipodal standpoint / forepoint ? | vincenty | public static double ellipsoidal Distance ( Lat Lon p1 , Lat Lon p2 , double equatorial Radius , double polar Radius ) { final double F = ( equatorial Radius - polar Radius ) / equatorial Radius ; final double R = NUM - F ; final double EPS = NUM ; if ( p1 == null || p2 == null ) { throw new Illegal Argument Exception ( STRING ) ; } double GLAT 1 = p1 . get Latitude ( ) . radians ; double GLAT 2 = p2 . get Latitude ( ) . radians ; double TU 1 = R * Math . sin ( GLAT 1 ) / Math . cos ( GLAT 1 ) ; double TU 2 = R * Math . sin ( GLAT 2 ) / Math . cos ( GLAT 2 ) ; double CU 1 = NUM / Math . sqrt ( TU 1 * TU 1 + NUM ) ; double SU 1 = CU 1 * TU 1 ; double CU 2 = NUM / Math . sqrt ( TU 2 * TU 2 + NUM ) ; double S = CU 1 * CU 2 ; double BAZ = S * TU 2 ; double FAZ = BAZ * TU 1 ; double GLON 1 = p1 . get Longitude ( ) . radians ; double GLON 2 = p2 . get Longitude ( ) . radians ; double X = GLON 2 - GLON 1 ; double D , SX , CX , SY , CY , Y , SA , C2 A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU 1 = CU 2 * SX ; TU 2 = BAZ - SU 1 * CU 2 * CX ; SY = Math . sqrt ( TU 1 * TU 1 + TU 2 * TU 2 ) ; CY = S * CX + FAZ ; Y = Math . atan 2 ( SY , CY ) ; SA = S * SX / SY ; C2 A = - SA * SA + NUM ; CZ = FAZ + FAZ ; if ( C2 A > NUM ) { CZ = - CZ / C2 A + CY ; } E = CZ * CZ * NUM - NUM ; C = ( ( - NUM * C2 A + NUM ) * F + NUM ) * C2 A * F / NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( NUM - C ) * X * F + GLON 2 - GLON 1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( NUM / R / R - NUM ) * C2 A + NUM ) + NUM ; X = ( X - NUM ) / X ; C = NUM - X ; C = ( X * X / NUM + NUM ) / C ; D = ( NUM * X * X - NUM ) * X ; X = E * CY ; S = NUM - E - E ; S = ( ( ( ( SY * SY * NUM - NUM ) * S * CZ * D / NUM - X ) * D / NUM + CZ ) * SY * D + Y ) * C * equatorial Radius * R ; return S ; } | public static double ellipsoidalDistance ( LatLon p1 , LatLon p2 , double equatorialRadius , double polarRadius ) { final double F = ( equatorialRadius - polarRadius ) / equatorialRadius ; final double R = _NUM - F ; final double EPS = _NUM ; if ( p1 == null || p2 == null ) { throw new IllegalArgumentException ( STRING ) ; } double GLAT1 = p1 . getLatitude ( ) . radians ; double GLAT2 = p2 . getLatitude ( ) . radians ; double TU1 = R * Math . sin ( GLAT1 ) / Math . cos ( GLAT1 ) ; double TU2 = R * Math . sin ( GLAT2 ) / Math . cos ( GLAT2 ) ; double CU1 = _NUM / Math . sqrt ( TU1 * TU1 + _NUM ) ; double SU1 = CU1 * TU1 ; double CU2 = _NUM / Math . sqrt ( TU2 * TU2 + _NUM ) ; double S = CU1 * CU2 ; double BAZ = S * TU2 ; double FAZ = BAZ * TU1 ; double GLON1 = p1 . getLongitude ( ) . radians ; double GLON2 = p2 . getLongitude ( ) . radians ; double X = GLON2 - GLON1 ; double D , SX , CX , SY , CY , Y , SA , C2A , CZ , E , C ; do { SX = Math . sin ( X ) ; CX = Math . cos ( X ) ; TU1 = CU2 * SX ; TU2 = BAZ - SU1 * CU2 * CX ; SY = Math . sqrt ( TU1 * TU1 + TU2 * TU2 ) ; CY = S * CX + FAZ ; Y = Math . atan2 ( SY , CY ) ; SA = S * SX / SY ; C2A = - SA * SA + _NUM ; CZ = FAZ + FAZ ; if ( C2A > _NUM ) { CZ = - CZ / C2A + CY ; } E = CZ * CZ * _NUM - _NUM ; C = ( ( - _NUM * C2A + _NUM ) * F + _NUM ) * C2A * F / _NUM ; D = X ; X = ( ( E * CY * C + CZ ) * SY * C + Y ) * SA ; X = ( _NUM - C ) * X * F + GLON2 - GLON1 ; } while ( Math . abs ( D - X ) > EPS ) ; X = Math . sqrt ( ( _NUM / R / R - _NUM ) * C2A + _NUM ) + _NUM ; X = ( X - _NUM ) / X ; C = _NUM - X ; C = ( X * X / _NUM + _NUM ) / C ; D = ( _NUM * X * X - _NUM ) * X ; X = E * CY ; S = _NUM - E - E ; S = ( ( ( ( SY * SY * _NUM - _NUM ) * S * CZ * D / _NUM - X ) * D / _NUM + CZ ) * SY * D + Y ) * C * equatorialRadius * R ; return S ; } | 625 |
java-test-407 | java | What does the statement push to it when entering the scope ? | the topology ( if not null ) | @ Override public void enter Scope ( final I Scope scope ) { super . enter Scope ( scope ) ; final I Topology topo = Cast . as Topology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . set Topology ( topo ) ) ; } } | @ Override public void enterScope ( final IScope scope ) { super . enterScope ( scope ) ; final ITopology topo = Cast . asTopology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . setTopology ( topo ) ) ; } } | 63 |
java-test-408 | java | Does the statement push the topology ( if not null ) to it when entering the scope ? | Yes | @ Override public void enter Scope ( final I Scope scope ) { super . enter Scope ( scope ) ; final I Topology topo = Cast . as Topology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . set Topology ( topo ) ) ; } } | @ Override public void enterScope ( final IScope scope ) { super . enterScope ( scope ) ; final ITopology topo = Cast . asTopology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . setTopology ( topo ) ) ; } } | 63 |
java-test-409 | java | What does the statement remember when entering the scope ? | the one that was previously pushed | @ Override public void enter Scope ( final I Scope scope ) { super . enter Scope ( scope ) ; final I Topology topo = Cast . as Topology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . set Topology ( topo ) ) ; } } | @ Override public void enterScope ( final IScope scope ) { super . enterScope ( scope ) ; final ITopology topo = Cast . asTopology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . setTopology ( topo ) ) ; } } | 63 |
java-test-410 | java | Does the statement remember the one that was previously pushed when entering the scope ? | Yes | @ Override public void enter Scope ( final I Scope scope ) { super . enter Scope ( scope ) ; final I Topology topo = Cast . as Topology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . set Topology ( topo ) ) ; } } | @ Override public void enterScope ( final IScope scope ) { super . enterScope ( scope ) ; final ITopology topo = Cast . asTopology ( scope , topology . value ( scope ) ) ; if ( topo != null ) { previous . set ( scope . setTopology ( topo ) ) ; } } | 63 |
java-test-413 | java | Where do a train run for each message i d at ? | the end of the stream | @ Override public void end Of Stream ( ) throws Ade Exception , Ade Flow Exception { for ( Entry < String , Perodicity Bounder > last : m last Seen . entry Set ( ) ) { final Perodicity Bounder pb = last . get Value ( ) ; pb . train ( last . get Key ( ) ) ; } m trained = BOOL ; } | @ Override public void endOfStream ( ) throws AdeException , AdeFlowException { for ( Entry < String , PerodicityBounder > last : m_lastSeen . entrySet ( ) ) { final PerodicityBounder pb = last . getValue ( ) ; pb . train ( last . getKey ( ) ) ; } m_trained = _BOOL ; } | 69 |
java-test-414 | java | Do a train run the end of the stream for each message i d at ? | Yes | @ Override public void end Of Stream ( ) throws Ade Exception , Ade Flow Exception { for ( Entry < String , Perodicity Bounder > last : m last Seen . entry Set ( ) ) { final Perodicity Bounder pb = last . get Value ( ) ; pb . train ( last . get Key ( ) ) ; } m trained = BOOL ; } | @ Override public void endOfStream ( ) throws AdeException , AdeFlowException { for ( Entry < String , PerodicityBounder > last : m_lastSeen . entrySet ( ) ) { final PerodicityBounder pb = last . getValue ( ) ; pb . train ( last . getKey ( ) ) ; } m_trained = _BOOL ; } | 69 |
java-test-415 | java | What runs the end of the stream ? | a train | @ Override public void end Of Stream ( ) throws Ade Exception , Ade Flow Exception { for ( Entry < String , Perodicity Bounder > last : m last Seen . entry Set ( ) ) { final Perodicity Bounder pb = last . get Value ( ) ; pb . train ( last . get Key ( ) ) ; } m trained = BOOL ; } | @ Override public void endOfStream ( ) throws AdeException , AdeFlowException { for ( Entry < String , PerodicityBounder > last : m_lastSeen . entrySet ( ) ) { final PerodicityBounder pb = last . getValue ( ) ; pb . train ( last . getKey ( ) ) ; } m_trained = _BOOL ; } | 69 |
java-test-416 | java | For what purpose do a train run the end of the stream at ? | for each message i d | @ Override public void end Of Stream ( ) throws Ade Exception , Ade Flow Exception { for ( Entry < String , Perodicity Bounder > last : m last Seen . entry Set ( ) ) { final Perodicity Bounder pb = last . get Value ( ) ; pb . train ( last . get Key ( ) ) ; } m trained = BOOL ; } | @ Override public void endOfStream ( ) throws AdeException , AdeFlowException { for ( Entry < String , PerodicityBounder > last : m_lastSeen . entrySet ( ) ) { final PerodicityBounder pb = last . getValue ( ) ; pb . train ( last . getKey ( ) ) ; } m_trained = _BOOL ; } | 69 |
java-test-417 | java | In which direction does the metric apply ? | the dataobject ( | private Map < String , Metric Header Info > process CSV File Data Header ( Db Client db Client , Storage System storage System , String director Name , List < String > headers ) { Map < String , Metric Header Info > metric To Object Map = new Hash Map < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC NAME PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( NUM ) ; if ( ! METRICS NAMES TO GATHER . contains ( name ) ) { continue ; } String object Name = matcher . group ( NUM ) ; String units = matcher . group ( NUM ) ; if ( Strings . is Null Or Empty ( object Name ) ) { object Name = EMPTY ; } Storage HA Domain vplex Director = lookup V Plex Director By Name ( db Client , storage System , director Name ) ; if ( object Name . equals ( EMPTY ) ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . DIRECTOR ; header Info . director = vplex Director ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } else { Storage Port storage Port = lookup V Plex Front Storage Port By Name ( db Client , vplex Director , object Name ) ; if ( storage Port != null ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . PORT ; header Info . director = vplex Director ; header Info . port = storage Port ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } } } } return metric To Object Map ; } | private Map < String , MetricHeaderInfo > processCSVFileDataHeader ( DbClient dbClient , StorageSystem storageSystem , String directorName , List < String > headers ) { Map < String , MetricHeaderInfo > metricToObjectMap = new HashMap < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC_NAME_PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( _NUM ) ; if ( ! METRICS_NAMES_TO_GATHER . contains ( name ) ) { continue ; } String objectName = matcher . group ( _NUM ) ; String units = matcher . group ( _NUM ) ; if ( Strings . isNullOrEmpty ( objectName ) ) { objectName = EMPTY ; } StorageHADomain vplexDirector = lookupVPlexDirectorByName ( dbClient , storageSystem , directorName ) ; if ( objectName . equals ( EMPTY ) ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . DIRECTOR ; headerInfo . director = vplexDirector ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } else { StoragePort storagePort = lookupVPlexFrontStoragePortByName ( dbClient , vplexDirector , objectName ) ; if ( storagePort != null ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . PORT ; headerInfo . director = vplexDirector ; headerInfo . port = storagePort ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } } } } return metricToObjectMap ; } | 350 |
java-test-418 | java | What will headers contain ? | each of the strings delimited by | private Map < String , Metric Header Info > process CSV File Data Header ( Db Client db Client , Storage System storage System , String director Name , List < String > headers ) { Map < String , Metric Header Info > metric To Object Map = new Hash Map < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC NAME PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( NUM ) ; if ( ! METRICS NAMES TO GATHER . contains ( name ) ) { continue ; } String object Name = matcher . group ( NUM ) ; String units = matcher . group ( NUM ) ; if ( Strings . is Null Or Empty ( object Name ) ) { object Name = EMPTY ; } Storage HA Domain vplex Director = lookup V Plex Director By Name ( db Client , storage System , director Name ) ; if ( object Name . equals ( EMPTY ) ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . DIRECTOR ; header Info . director = vplex Director ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } else { Storage Port storage Port = lookup V Plex Front Storage Port By Name ( db Client , vplex Director , object Name ) ; if ( storage Port != null ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . PORT ; header Info . director = vplex Director ; header Info . port = storage Port ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } } } } return metric To Object Map ; } | private Map < String , MetricHeaderInfo > processCSVFileDataHeader ( DbClient dbClient , StorageSystem storageSystem , String directorName , List < String > headers ) { Map < String , MetricHeaderInfo > metricToObjectMap = new HashMap < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC_NAME_PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( _NUM ) ; if ( ! METRICS_NAMES_TO_GATHER . contains ( name ) ) { continue ; } String objectName = matcher . group ( _NUM ) ; String units = matcher . group ( _NUM ) ; if ( Strings . isNullOrEmpty ( objectName ) ) { objectName = EMPTY ; } StorageHADomain vplexDirector = lookupVPlexDirectorByName ( dbClient , storageSystem , directorName ) ; if ( objectName . equals ( EMPTY ) ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . DIRECTOR ; headerInfo . director = vplexDirector ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } else { StoragePort storagePort = lookupVPlexFrontStoragePortByName ( dbClient , vplexDirector , objectName ) ; if ( storagePort != null ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . PORT ; headerInfo . director = vplexDirector ; headerInfo . port = storagePort ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } } } } return metricToObjectMap ; } | 350 |
java-test-419 | java | Will this function parse that to determine what dataobject it should be associated with and its units ? | Yes | private Map < String , Metric Header Info > process CSV File Data Header ( Db Client db Client , Storage System storage System , String director Name , List < String > headers ) { Map < String , Metric Header Info > metric To Object Map = new Hash Map < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC NAME PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( NUM ) ; if ( ! METRICS NAMES TO GATHER . contains ( name ) ) { continue ; } String object Name = matcher . group ( NUM ) ; String units = matcher . group ( NUM ) ; if ( Strings . is Null Or Empty ( object Name ) ) { object Name = EMPTY ; } Storage HA Domain vplex Director = lookup V Plex Director By Name ( db Client , storage System , director Name ) ; if ( object Name . equals ( EMPTY ) ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . DIRECTOR ; header Info . director = vplex Director ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } else { Storage Port storage Port = lookup V Plex Front Storage Port By Name ( db Client , vplex Director , object Name ) ; if ( storage Port != null ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . PORT ; header Info . director = vplex Director ; header Info . port = storage Port ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } } } } return metric To Object Map ; } | private Map < String , MetricHeaderInfo > processCSVFileDataHeader ( DbClient dbClient , StorageSystem storageSystem , String directorName , List < String > headers ) { Map < String , MetricHeaderInfo > metricToObjectMap = new HashMap < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC_NAME_PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( _NUM ) ; if ( ! METRICS_NAMES_TO_GATHER . contains ( name ) ) { continue ; } String objectName = matcher . group ( _NUM ) ; String units = matcher . group ( _NUM ) ; if ( Strings . isNullOrEmpty ( objectName ) ) { objectName = EMPTY ; } StorageHADomain vplexDirector = lookupVPlexDirectorByName ( dbClient , storageSystem , directorName ) ; if ( objectName . equals ( EMPTY ) ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . DIRECTOR ; headerInfo . director = vplexDirector ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } else { StoragePort storagePort = lookupVPlexFrontStoragePortByName ( dbClient , vplexDirector , objectName ) ; if ( storagePort != null ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . PORT ; headerInfo . director = vplexDirector ; headerInfo . port = storagePort ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } } } } return metricToObjectMap ; } | 350 |
java-test-420 | java | What do this function determine ? | what dataobject it should be associated with and its units | private Map < String , Metric Header Info > process CSV File Data Header ( Db Client db Client , Storage System storage System , String director Name , List < String > headers ) { Map < String , Metric Header Info > metric To Object Map = new Hash Map < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC NAME PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( NUM ) ; if ( ! METRICS NAMES TO GATHER . contains ( name ) ) { continue ; } String object Name = matcher . group ( NUM ) ; String units = matcher . group ( NUM ) ; if ( Strings . is Null Or Empty ( object Name ) ) { object Name = EMPTY ; } Storage HA Domain vplex Director = lookup V Plex Director By Name ( db Client , storage System , director Name ) ; if ( object Name . equals ( EMPTY ) ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . DIRECTOR ; header Info . director = vplex Director ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } else { Storage Port storage Port = lookup V Plex Front Storage Port By Name ( db Client , vplex Director , object Name ) ; if ( storage Port != null ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . PORT ; header Info . director = vplex Director ; header Info . port = storage Port ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } } } } return metric To Object Map ; } | private Map < String , MetricHeaderInfo > processCSVFileDataHeader ( DbClient dbClient , StorageSystem storageSystem , String directorName , List < String > headers ) { Map < String , MetricHeaderInfo > metricToObjectMap = new HashMap < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC_NAME_PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( _NUM ) ; if ( ! METRICS_NAMES_TO_GATHER . contains ( name ) ) { continue ; } String objectName = matcher . group ( _NUM ) ; String units = matcher . group ( _NUM ) ; if ( Strings . isNullOrEmpty ( objectName ) ) { objectName = EMPTY ; } StorageHADomain vplexDirector = lookupVPlexDirectorByName ( dbClient , storageSystem , directorName ) ; if ( objectName . equals ( EMPTY ) ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . DIRECTOR ; headerInfo . director = vplexDirector ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } else { StoragePort storagePort = lookupVPlexFrontStoragePortByName ( dbClient , vplexDirector , objectName ) ; if ( storagePort != null ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . PORT ; headerInfo . director = vplexDirector ; headerInfo . port = storagePort ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } } } } return metricToObjectMap ; } | 350 |
java-test-421 | java | For what purpose will this function parse that ? | to determine what dataobject it should be associated with and its units | private Map < String , Metric Header Info > process CSV File Data Header ( Db Client db Client , Storage System storage System , String director Name , List < String > headers ) { Map < String , Metric Header Info > metric To Object Map = new Hash Map < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC NAME PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( NUM ) ; if ( ! METRICS NAMES TO GATHER . contains ( name ) ) { continue ; } String object Name = matcher . group ( NUM ) ; String units = matcher . group ( NUM ) ; if ( Strings . is Null Or Empty ( object Name ) ) { object Name = EMPTY ; } Storage HA Domain vplex Director = lookup V Plex Director By Name ( db Client , storage System , director Name ) ; if ( object Name . equals ( EMPTY ) ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . DIRECTOR ; header Info . director = vplex Director ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } else { Storage Port storage Port = lookup V Plex Front Storage Port By Name ( db Client , vplex Director , object Name ) ; if ( storage Port != null ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . PORT ; header Info . director = vplex Director ; header Info . port = storage Port ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } } } } return metric To Object Map ; } | private Map < String , MetricHeaderInfo > processCSVFileDataHeader ( DbClient dbClient , StorageSystem storageSystem , String directorName , List < String > headers ) { Map < String , MetricHeaderInfo > metricToObjectMap = new HashMap < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC_NAME_PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( _NUM ) ; if ( ! METRICS_NAMES_TO_GATHER . contains ( name ) ) { continue ; } String objectName = matcher . group ( _NUM ) ; String units = matcher . group ( _NUM ) ; if ( Strings . isNullOrEmpty ( objectName ) ) { objectName = EMPTY ; } StorageHADomain vplexDirector = lookupVPlexDirectorByName ( dbClient , storageSystem , directorName ) ; if ( objectName . equals ( EMPTY ) ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . DIRECTOR ; headerInfo . director = vplexDirector ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } else { StoragePort storagePort = lookupVPlexFrontStoragePortByName ( dbClient , vplexDirector , objectName ) ; if ( storagePort != null ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . PORT ; headerInfo . director = vplexDirector ; headerInfo . port = storagePort ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } } } } return metricToObjectMap ; } | 350 |
java-test-422 | java | Do this function determine ? | Yes | private Map < String , Metric Header Info > process CSV File Data Header ( Db Client db Client , Storage System storage System , String director Name , List < String > headers ) { Map < String , Metric Header Info > metric To Object Map = new Hash Map < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC NAME PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( NUM ) ; if ( ! METRICS NAMES TO GATHER . contains ( name ) ) { continue ; } String object Name = matcher . group ( NUM ) ; String units = matcher . group ( NUM ) ; if ( Strings . is Null Or Empty ( object Name ) ) { object Name = EMPTY ; } Storage HA Domain vplex Director = lookup V Plex Director By Name ( db Client , storage System , director Name ) ; if ( object Name . equals ( EMPTY ) ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . DIRECTOR ; header Info . director = vplex Director ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } else { Storage Port storage Port = lookup V Plex Front Storage Port By Name ( db Client , vplex Director , object Name ) ; if ( storage Port != null ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . PORT ; header Info . director = vplex Director ; header Info . port = storage Port ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } } } } return metric To Object Map ; } | private Map < String , MetricHeaderInfo > processCSVFileDataHeader ( DbClient dbClient , StorageSystem storageSystem , String directorName , List < String > headers ) { Map < String , MetricHeaderInfo > metricToObjectMap = new HashMap < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC_NAME_PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( _NUM ) ; if ( ! METRICS_NAMES_TO_GATHER . contains ( name ) ) { continue ; } String objectName = matcher . group ( _NUM ) ; String units = matcher . group ( _NUM ) ; if ( Strings . isNullOrEmpty ( objectName ) ) { objectName = EMPTY ; } StorageHADomain vplexDirector = lookupVPlexDirectorByName ( dbClient , storageSystem , directorName ) ; if ( objectName . equals ( EMPTY ) ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . DIRECTOR ; headerInfo . director = vplexDirector ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } else { StoragePort storagePort = lookupVPlexFrontStoragePortByName ( dbClient , vplexDirector , objectName ) ; if ( storagePort != null ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . PORT ; headerInfo . director = vplexDirector ; headerInfo . port = storagePort ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } } } } return metricToObjectMap ; } | 350 |
java-test-423 | java | Will headers contain each of the strings delimited by ? | Yes | private Map < String , Metric Header Info > process CSV File Data Header ( Db Client db Client , Storage System storage System , String director Name , List < String > headers ) { Map < String , Metric Header Info > metric To Object Map = new Hash Map < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC NAME PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( NUM ) ; if ( ! METRICS NAMES TO GATHER . contains ( name ) ) { continue ; } String object Name = matcher . group ( NUM ) ; String units = matcher . group ( NUM ) ; if ( Strings . is Null Or Empty ( object Name ) ) { object Name = EMPTY ; } Storage HA Domain vplex Director = lookup V Plex Director By Name ( db Client , storage System , director Name ) ; if ( object Name . equals ( EMPTY ) ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . DIRECTOR ; header Info . director = vplex Director ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } else { Storage Port storage Port = lookup V Plex Front Storage Port By Name ( db Client , vplex Director , object Name ) ; if ( storage Port != null ) { Metric Header Info header Info = new Metric Header Info ( ) ; header Info . type = Metric Header Info . Type . PORT ; header Info . director = vplex Director ; header Info . port = storage Port ; header Info . units = units ; metric To Object Map . put ( header , header Info ) ; } } } } return metric To Object Map ; } | private Map < String , MetricHeaderInfo > processCSVFileDataHeader ( DbClient dbClient , StorageSystem storageSystem , String directorName , List < String > headers ) { Map < String , MetricHeaderInfo > metricToObjectMap = new HashMap < > ( ) ; for ( String header : headers ) { Matcher matcher = METRIC_NAME_PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { String name = matcher . group ( _NUM ) ; if ( ! METRICS_NAMES_TO_GATHER . contains ( name ) ) { continue ; } String objectName = matcher . group ( _NUM ) ; String units = matcher . group ( _NUM ) ; if ( Strings . isNullOrEmpty ( objectName ) ) { objectName = EMPTY ; } StorageHADomain vplexDirector = lookupVPlexDirectorByName ( dbClient , storageSystem , directorName ) ; if ( objectName . equals ( EMPTY ) ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . DIRECTOR ; headerInfo . director = vplexDirector ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } else { StoragePort storagePort = lookupVPlexFrontStoragePortByName ( dbClient , vplexDirector , objectName ) ; if ( storagePort != null ) { MetricHeaderInfo headerInfo = new MetricHeaderInfo ( ) ; headerInfo . type = MetricHeaderInfo . Type . PORT ; headerInfo . director = vplexDirector ; headerInfo . port = storagePort ; headerInfo . units = units ; metricToObjectMap . put ( header , headerInfo ) ; } } } } return metricToObjectMap ; } | 350 |
java-test-426 | java | Have we pushed the bottom element off the bottom of the screen when we did not need to ? | Yes | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Scroll Child Top ( ) ; final int start = m List Padding . top ; final int end = ( get Bottom ( ) - get Top ( ) ) - m List Padding . bottom ; int top Offset = first Top - start ; final int last Bottom = get Scroll Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } try Offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { fill Down ( last Position + NUM , get Fill Child Top ( ) + m Divider Height ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getScrollChildTop ( ) ; final int start = mListPadding . top ; final int end = ( getBottom ( ) - getTop ( ) ) - mListPadding . bottom ; int topOffset = firstTop - start ; final int lastBottom = getScrollChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } tryOffsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { fillDown ( lastPosition + _NUM , getFillChildTop ( ) + mDividerHeight ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 236 |
java-test-427 | java | Have we dragged the bottom of the list too low ? | Yes | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Scroll Child Top ( ) ; final int start = m List Padding . top ; final int end = ( get Bottom ( ) - get Top ( ) ) - m List Padding . bottom ; int top Offset = first Top - start ; final int last Bottom = get Scroll Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } try Offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { fill Down ( last Position + NUM , get Fill Child Top ( ) + m Divider Height ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getScrollChildTop ( ) ; final int start = mListPadding . top ; final int end = ( getBottom ( ) - getTop ( ) ) - mListPadding . bottom ; int topOffset = firstTop - start ; final int lastBottom = getScrollChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } tryOffsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { fillDown ( lastPosition + _NUM , getFillChildTop ( ) + mDividerHeight ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 236 |
java-test-428 | java | What did we not need when ? | to | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Scroll Child Top ( ) ; final int start = m List Padding . top ; final int end = ( get Bottom ( ) - get Top ( ) ) - m List Padding . bottom ; int top Offset = first Top - start ; final int last Bottom = get Scroll Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } try Offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { fill Down ( last Position + NUM , get Fill Child Top ( ) + m Divider Height ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getScrollChildTop ( ) ; final int start = mListPadding . top ; final int end = ( getBottom ( ) - getTop ( ) ) - mListPadding . bottom ; int topOffset = firstTop - start ; final int lastBottom = getScrollChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } tryOffsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { fillDown ( lastPosition + _NUM , getFillChildTop ( ) + mDividerHeight ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 236 |
java-test-429 | java | What have we dragged too low ? | the bottom of the list | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Scroll Child Top ( ) ; final int start = m List Padding . top ; final int end = ( get Bottom ( ) - get Top ( ) ) - m List Padding . bottom ; int top Offset = first Top - start ; final int last Bottom = get Scroll Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } try Offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { fill Down ( last Position + NUM , get Fill Child Top ( ) + m Divider Height ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getScrollChildTop ( ) ; final int start = mListPadding . top ; final int end = ( getBottom ( ) - getTop ( ) ) - mListPadding . bottom ; int topOffset = firstTop - start ; final int lastBottom = getScrollChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } tryOffsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { fillDown ( lastPosition + _NUM , getFillChildTop ( ) + mDividerHeight ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 236 |
java-test-430 | java | When have we pushed the bottom element off the bottom of the screen ? | when we did not need to | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Scroll Child Top ( ) ; final int start = m List Padding . top ; final int end = ( get Bottom ( ) - get Top ( ) ) - m List Padding . bottom ; int top Offset = first Top - start ; final int last Bottom = get Scroll Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } try Offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { fill Down ( last Position + NUM , get Fill Child Top ( ) + m Divider Height ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getScrollChildTop ( ) ; final int start = mListPadding . top ; final int end = ( getBottom ( ) - getTop ( ) ) - mListPadding . bottom ; int topOffset = firstTop - start ; final int lastBottom = getScrollChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } tryOffsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { fillDown ( lastPosition + _NUM , getFillChildTop ( ) + mDividerHeight ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 236 |
java-test-431 | java | What have we pushed off the bottom of the screen when we did not need to ? | the bottom element | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Scroll Child Top ( ) ; final int start = m List Padding . top ; final int end = ( get Bottom ( ) - get Top ( ) ) - m List Padding . bottom ; int top Offset = first Top - start ; final int last Bottom = get Scroll Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } try Offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { fill Down ( last Position + NUM , get Fill Child Top ( ) + m Divider Height ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getScrollChildTop ( ) ; final int start = mListPadding . top ; final int end = ( getBottom ( ) - getTop ( ) ) - mListPadding . bottom ; int topOffset = firstTop - start ; final int lastBottom = getScrollChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } tryOffsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { fillDown ( lastPosition + _NUM , getFillChildTop ( ) + mDividerHeight ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 236 |
java-test-432 | java | Did we need to when ? | No | private void correct Too Low ( int child Count ) { if ( m First Position == NUM && child Count > NUM ) { final int first Top = get Scroll Child Top ( ) ; final int start = m List Padding . top ; final int end = ( get Bottom ( ) - get Top ( ) ) - m List Padding . bottom ; int top Offset = first Top - start ; final int last Bottom = get Scroll Child Bottom ( ) ; int last Position = m First Position + child Count - NUM ; if ( top Offset > NUM ) { if ( last Position < m Item Count - NUM || last Bottom > end ) { if ( last Position == m Item Count - NUM ) { top Offset = Math . min ( top Offset , last Bottom - end ) ; } try Offset Children Top And Bottom ( - top Offset ) ; if ( last Position < m Item Count - NUM ) { fill Down ( last Position + NUM , get Fill Child Top ( ) + m Divider Height ) ; adjust Views Up Or Down ( ) ; } } else if ( last Position == m Item Count - NUM ) { adjust Views Up Or Down ( ) ; } } } } | private void correctTooLow ( int childCount ) { if ( mFirstPosition == _NUM && childCount > _NUM ) { final int firstTop = getScrollChildTop ( ) ; final int start = mListPadding . top ; final int end = ( getBottom ( ) - getTop ( ) ) - mListPadding . bottom ; int topOffset = firstTop - start ; final int lastBottom = getScrollChildBottom ( ) ; int lastPosition = mFirstPosition + childCount - _NUM ; if ( topOffset > _NUM ) { if ( lastPosition < mItemCount - _NUM || lastBottom > end ) { if ( lastPosition == mItemCount - _NUM ) { topOffset = Math . min ( topOffset , lastBottom - end ) ; } tryOffsetChildrenTopAndBottom ( - topOffset ) ; if ( lastPosition < mItemCount - _NUM ) { fillDown ( lastPosition + _NUM , getFillChildTop ( ) + mDividerHeight ) ; adjustViewsUpOrDown ( ) ; } } else if ( lastPosition == mItemCount - _NUM ) { adjustViewsUpOrDown ( ) ; } } } } | 236 |
java-test-433 | java | Does the code create a polyline / polygon shape from a set of points ? | Yes | protected Shape create Shape ( int [ ] x Points , int [ ] y Points , int n Points , boolean close , boolean biased ) { float offset = biased ? ( float ) bias : NUM ; General Path path = new General Path ( General Path . WIND EVEN ODD ) ; if ( n Points > NUM ) { path . move To ( x Points [ NUM ] + offset , y Points [ NUM ] + offset ) ; int last X = x Points [ NUM ] ; int last Y = y Points [ NUM ] ; if ( close && ( Math . abs ( x Points [ n Points - NUM ] - last X ) < NUM ) && ( Math . abs ( y Points [ n Points - NUM ] - last Y ) < NUM ) ) { n Points -- ; } for ( int i = NUM ; i < n Points ; i ++ ) { if ( ( Math . abs ( x Points [ i ] - last X ) > NUM ) || ( Math . abs ( y Points [ i ] - last Y ) > NUM ) ) { path . line To ( x Points [ i ] + offset , y Points [ i ] + offset ) ; last X = x Points [ i ] ; last Y = y Points [ i ] ; } } if ( close ) path . close Path ( ) ; } return path ; } | protected Shape createShape ( int [ ] xPoints , int [ ] yPoints , int nPoints , boolean close , boolean biased ) { float offset = biased ? ( float ) bias : _NUM ; GeneralPath path = new GeneralPath ( GeneralPath . WIND_EVEN_ODD ) ; if ( nPoints > _NUM ) { path . moveTo ( xPoints [ _NUM ] + offset , yPoints [ _NUM ] + offset ) ; int lastX = xPoints [ _NUM ] ; int lastY = yPoints [ _NUM ] ; if ( close && ( Math . abs ( xPoints [ nPoints - _NUM ] - lastX ) < _NUM ) && ( Math . abs ( yPoints [ nPoints - _NUM ] - lastY ) < _NUM ) ) { nPoints -- ; } for ( int i = _NUM ; i < nPoints ; i ++ ) { if ( ( Math . abs ( xPoints [ i ] - lastX ) > _NUM ) || ( Math . abs ( yPoints [ i ] - lastY ) > _NUM ) ) { path . lineTo ( xPoints [ i ] + offset , yPoints [ i ] + offset ) ; lastX = xPoints [ i ] ; lastY = yPoints [ i ] ; } } if ( close ) path . closePath ( ) ; } return path ; } | 271 |
java-test-434 | java | What does the code create ? | a polyline / polygon shape from a set of points | protected Shape create Shape ( int [ ] x Points , int [ ] y Points , int n Points , boolean close , boolean biased ) { float offset = biased ? ( float ) bias : NUM ; General Path path = new General Path ( General Path . WIND EVEN ODD ) ; if ( n Points > NUM ) { path . move To ( x Points [ NUM ] + offset , y Points [ NUM ] + offset ) ; int last X = x Points [ NUM ] ; int last Y = y Points [ NUM ] ; if ( close && ( Math . abs ( x Points [ n Points - NUM ] - last X ) < NUM ) && ( Math . abs ( y Points [ n Points - NUM ] - last Y ) < NUM ) ) { n Points -- ; } for ( int i = NUM ; i < n Points ; i ++ ) { if ( ( Math . abs ( x Points [ i ] - last X ) > NUM ) || ( Math . abs ( y Points [ i ] - last Y ) > NUM ) ) { path . line To ( x Points [ i ] + offset , y Points [ i ] + offset ) ; last X = x Points [ i ] ; last Y = y Points [ i ] ; } } if ( close ) path . close Path ( ) ; } return path ; } | protected Shape createShape ( int [ ] xPoints , int [ ] yPoints , int nPoints , boolean close , boolean biased ) { float offset = biased ? ( float ) bias : _NUM ; GeneralPath path = new GeneralPath ( GeneralPath . WIND_EVEN_ODD ) ; if ( nPoints > _NUM ) { path . moveTo ( xPoints [ _NUM ] + offset , yPoints [ _NUM ] + offset ) ; int lastX = xPoints [ _NUM ] ; int lastY = yPoints [ _NUM ] ; if ( close && ( Math . abs ( xPoints [ nPoints - _NUM ] - lastX ) < _NUM ) && ( Math . abs ( yPoints [ nPoints - _NUM ] - lastY ) < _NUM ) ) { nPoints -- ; } for ( int i = _NUM ; i < nPoints ; i ++ ) { if ( ( Math . abs ( xPoints [ i ] - lastX ) > _NUM ) || ( Math . abs ( yPoints [ i ] - lastY ) > _NUM ) ) { path . lineTo ( xPoints [ i ] + offset , yPoints [ i ] + offset ) ; lastX = xPoints [ i ] ; lastY = yPoints [ i ] ; } } if ( close ) path . closePath ( ) ; } return path ; } | 271 |
java-test-435 | java | How does a new keyczar return ? | with public keys in privatekey | public static Keyczar Reader export Public Keys ( Generic Keyczar private Key ) throws Keyczar Exception { Key Metadata kmd = private Key . get Metadata ( ) ; Key Metadata public Kmd = null ; if ( kmd . get Type ( ) == Default Key Type . DSA PRIV ) { if ( kmd . get Purpose ( ) == Key Purpose . SIGN AND VERIFY ) { public Kmd = new Key Metadata ( kmd . get Name ( ) , Key Purpose . VERIFY , Default Key Type . DSA PUB ) ; } } else if ( kmd . get Type ( ) == Default Key Type . RSA PRIV ) { switch ( kmd . get Purpose ( ) ) { case DECRYPT AND ENCRYPT : public Kmd = new Key Metadata ( kmd . get Name ( ) , Key Purpose . ENCRYPT , Default Key Type . RSA PUB ) ; break ; case SIGN AND VERIFY : public Kmd = new Key Metadata ( kmd . get Name ( ) , Key Purpose . VERIFY , Default Key Type . RSA PUB ) ; break ; default : throw new Illegal Argument Exception ( STRING + kmd . get Purpose ( ) ) ; } } if ( public Kmd == null ) { throw new Keyczar Exception ( Messages . get String ( STRING , kmd . get Type ( ) , kmd . get Purpose ( ) ) ) ; } Hash Map < Integer , Keyczar Key > keys = new Hash Map < Integer , Keyczar Key > ( ) ; for ( Key Version version : private Key . get Versions ( ) ) { try { Keyczar Key key = private Key . get Key ( version ) ; Keyczar Key public Key = ( Keyczar Key ) get Public Method . invoke ( key ) ; public Kmd . add Version ( version ) ; keys . put ( version . get Version Number ( ) , public Key ) ; } catch ( Illegal Access Exception e ) { throw new Runtime Exception ( e ) ; } catch ( Invocation Target Exception e ) { throw new Runtime Exception ( e ) ; } } return new Memory Key Reader ( public Kmd , keys ) ; } | public static KeyczarReader exportPublicKeys ( GenericKeyczar privateKey ) throws KeyczarException { KeyMetadata kmd = privateKey . getMetadata ( ) ; KeyMetadata publicKmd = null ; if ( kmd . getType ( ) == DefaultKeyType . DSA_PRIV ) { if ( kmd . getPurpose ( ) == KeyPurpose . SIGN_AND_VERIFY ) { publicKmd = new KeyMetadata ( kmd . getName ( ) , KeyPurpose . VERIFY , DefaultKeyType . DSA_PUB ) ; } } else if ( kmd . getType ( ) == DefaultKeyType . RSA_PRIV ) { switch ( kmd . getPurpose ( ) ) { case DECRYPT_AND_ENCRYPT : publicKmd = new KeyMetadata ( kmd . getName ( ) , KeyPurpose . ENCRYPT , DefaultKeyType . RSA_PUB ) ; break ; case SIGN_AND_VERIFY : publicKmd = new KeyMetadata ( kmd . getName ( ) , KeyPurpose . VERIFY , DefaultKeyType . RSA_PUB ) ; break ; default : throw new IllegalArgumentException ( STRING + kmd . getPurpose ( ) ) ; } } if ( publicKmd == null ) { throw new KeyczarException ( Messages . getString ( STRING , kmd . getType ( ) , kmd . getPurpose ( ) ) ) ; } HashMap < Integer , KeyczarKey > keys = new HashMap < Integer , KeyczarKey > ( ) ; for ( KeyVersion version : privateKey . getVersions ( ) ) { try { KeyczarKey key = privateKey . getKey ( version ) ; KeyczarKey publicKey = ( KeyczarKey ) getPublicMethod . invoke ( key ) ; publicKmd . addVersion ( version ) ; keys . put ( version . getVersionNumber ( ) , publicKey ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e ) ; } } return new MemoryKeyReader ( publicKmd , keys ) ; } | 396 |
java-test-436 | java | How did the code call ? | via pathbar - button - longclick , tree - item - longclick , popup - button | private void on Show Pop Up ( View anchor , I Directory selection ) { Popup Menu popup = new Popup Menu ( get Activity ( ) , anchor ) ; popup . set On Menu Item Click Listener ( pop Up Listener ) ; Menu Inflater inflater = popup . get Menu Inflater ( ) ; inflater . inflate ( this . m Context Menue , popup . get Menu ( ) ) ; m Pop Up Selection = selection ; popup . show ( ) ; } | private void onShowPopUp ( View anchor , IDirectory selection ) { PopupMenu popup = new PopupMenu ( getActivity ( ) , anchor ) ; popup . setOnMenuItemClickListener ( popUpListener ) ; MenuInflater inflater = popup . getMenuInflater ( ) ; inflater . inflate ( this . mContextMenue , popup . getMenu ( ) ) ; mPopUpSelection = selection ; popup . show ( ) ; } | 89 |
java-test-437 | java | How do file system quota update ? | in sync mode | public VN Xe Command Result update File System Quota Sync ( String quota Id , File System Quota Modify Param param ) throws VN Xe Exception { logger . info ( STRING + quota Id ) ; Multivalued Map < String , String > query Params = new Multivalued Map Impl ( ) ; query Params . add ( VN Xe Constants . TIMEOUT , STRING ) ; set Query Parameters ( query Params ) ; VNX Unity Tree Quota quota = get File System Quota ( quota Id ) ; url = URL INSTANCE + quota . get Id ( ) + URL MODIFY ; return post Request Sync ( param ) ; } | public VNXeCommandResult updateFileSystemQuotaSync ( String quotaId , FileSystemQuotaModifyParam param ) throws VNXeException { _logger . info ( STRING + quotaId ) ; MultivaluedMap < String , String > queryParams = new MultivaluedMapImpl ( ) ; queryParams . add ( VNXeConstants . TIMEOUT , STRING ) ; setQueryParameters ( queryParams ) ; VNXUnityTreeQuota quota = getFileSystemQuota ( quotaId ) ; _url = URL_INSTANCE + quota . getId ( ) + URL_MODIFY ; return postRequestSync ( param ) ; } | 115 |
java-test-438 | java | What given in the given stream ? | extra code info | private static void write Extra Codes ( int char Offset , byte [ ] bytes , byte extra Code Modifier , Extra Codes Stream extra Codes ) throws IO Exception { int num Chars = extra Codes . get Num Chars ( ) ; if ( num Chars < char Offset ) { int fill Chars = char Offset - num Chars ; extra Codes . write Fill ( fill Chars , INTERNATIONAL EXTRA PLACEHOLDER ) ; extra Codes . increment Num Chars ( fill Chars ) ; } if ( bytes != null ) { extra Codes . write ( bytes ) ; extra Codes . increment Num Chars ( NUM ) ; } else { int last Idx = extra Codes . get Length ( ) - NUM ; if ( last Idx >= NUM ) { byte last Byte = extra Codes . get ( last Idx ) ; last Byte += extra Code Modifier ; extra Codes . set ( last Idx , last Byte ) ; } else { extra Codes . write ( extra Code Modifier ) ; extra Codes . set Unprintable Prefix Len ( NUM ) ; } } } | private static void writeExtraCodes ( int charOffset , byte [ ] bytes , byte extraCodeModifier , ExtraCodesStream extraCodes ) throws IOException { int numChars = extraCodes . getNumChars ( ) ; if ( numChars < charOffset ) { int fillChars = charOffset - numChars ; extraCodes . writeFill ( fillChars , INTERNATIONAL_EXTRA_PLACEHOLDER ) ; extraCodes . incrementNumChars ( fillChars ) ; } if ( bytes != null ) { extraCodes . write ( bytes ) ; extraCodes . incrementNumChars ( _NUM ) ; } else { int lastIdx = extraCodes . getLength ( ) - _NUM ; if ( lastIdx >= _NUM ) { byte lastByte = extraCodes . get ( lastIdx ) ; lastByte += extraCodeModifier ; extraCodes . set ( lastIdx , lastByte ) ; } else { extraCodes . write ( extraCodeModifier ) ; extraCodes . setUnprintablePrefixLen ( _NUM ) ; } } } | 198 |
java-test-439 | java | Did extra code info give in the given stream ? | Yes | private static void write Extra Codes ( int char Offset , byte [ ] bytes , byte extra Code Modifier , Extra Codes Stream extra Codes ) throws IO Exception { int num Chars = extra Codes . get Num Chars ( ) ; if ( num Chars < char Offset ) { int fill Chars = char Offset - num Chars ; extra Codes . write Fill ( fill Chars , INTERNATIONAL EXTRA PLACEHOLDER ) ; extra Codes . increment Num Chars ( fill Chars ) ; } if ( bytes != null ) { extra Codes . write ( bytes ) ; extra Codes . increment Num Chars ( NUM ) ; } else { int last Idx = extra Codes . get Length ( ) - NUM ; if ( last Idx >= NUM ) { byte last Byte = extra Codes . get ( last Idx ) ; last Byte += extra Code Modifier ; extra Codes . set ( last Idx , last Byte ) ; } else { extra Codes . write ( extra Code Modifier ) ; extra Codes . set Unprintable Prefix Len ( NUM ) ; } } } | private static void writeExtraCodes ( int charOffset , byte [ ] bytes , byte extraCodeModifier , ExtraCodesStream extraCodes ) throws IOException { int numChars = extraCodes . getNumChars ( ) ; if ( numChars < charOffset ) { int fillChars = charOffset - numChars ; extraCodes . writeFill ( fillChars , INTERNATIONAL_EXTRA_PLACEHOLDER ) ; extraCodes . incrementNumChars ( fillChars ) ; } if ( bytes != null ) { extraCodes . write ( bytes ) ; extraCodes . incrementNumChars ( _NUM ) ; } else { int lastIdx = extraCodes . getLength ( ) - _NUM ; if ( lastIdx >= _NUM ) { byte lastByte = extraCodes . get ( lastIdx ) ; lastByte += extraCodeModifier ; extraCodes . set ( lastIdx , lastByte ) ; } else { extraCodes . write ( extraCodeModifier ) ; extraCodes . setUnprintablePrefixLen ( _NUM ) ; } } } | 198 |
java-test-440 | java | Does the code translate a disassembled program to reil code ? | Yes | public Reil Program < Instruction Type > translate ( final I Translation Environment environment , final List < ? extends I Block Container < Instruction Type > > functions ) throws Internal Translation Exception { Preconditions . check Not Null ( environment , STRING ) ; final Reil Program < Instruction Type > program = new Reil Program < Instruction Type > ( ) ; for ( final I Block Container < Instruction Type > function : functions ) { program . add Function ( function , translate ( environment , function ) ) ; } return program ; } | public ReilProgram < InstructionType > translate ( final ITranslationEnvironment environment , final List < ? extends IBlockContainer < InstructionType > > functions ) throws InternalTranslationException { Preconditions . checkNotNull ( environment , STRING ) ; final ReilProgram < InstructionType > program = new ReilProgram < InstructionType > ( ) ; for ( final IBlockContainer < InstructionType > function : functions ) { program . addFunction ( function , translate ( environment , function ) ) ; } return program ; } | 100 |
java-test-441 | java | Does the code translate to reil code a disassembled program ? | Yes | public Reil Program < Instruction Type > translate ( final I Translation Environment environment , final List < ? extends I Block Container < Instruction Type > > functions ) throws Internal Translation Exception { Preconditions . check Not Null ( environment , STRING ) ; final Reil Program < Instruction Type > program = new Reil Program < Instruction Type > ( ) ; for ( final I Block Container < Instruction Type > function : functions ) { program . add Function ( function , translate ( environment , function ) ) ; } return program ; } | public ReilProgram < InstructionType > translate ( final ITranslationEnvironment environment , final List < ? extends IBlockContainer < InstructionType > > functions ) throws InternalTranslationException { Preconditions . checkNotNull ( environment , STRING ) ; final ReilProgram < InstructionType > program = new ReilProgram < InstructionType > ( ) ; for ( final IBlockContainer < InstructionType > function : functions ) { program . addFunction ( function , translate ( environment , function ) ) ; } return program ; } | 100 |
java-test-442 | java | What does the code translate to reil code ? | a disassembled program | public Reil Program < Instruction Type > translate ( final I Translation Environment environment , final List < ? extends I Block Container < Instruction Type > > functions ) throws Internal Translation Exception { Preconditions . check Not Null ( environment , STRING ) ; final Reil Program < Instruction Type > program = new Reil Program < Instruction Type > ( ) ; for ( final I Block Container < Instruction Type > function : functions ) { program . add Function ( function , translate ( environment , function ) ) ; } return program ; } | public ReilProgram < InstructionType > translate ( final ITranslationEnvironment environment , final List < ? extends IBlockContainer < InstructionType > > functions ) throws InternalTranslationException { Preconditions . checkNotNull ( environment , STRING ) ; final ReilProgram < InstructionType > program = new ReilProgram < InstructionType > ( ) ; for ( final IBlockContainer < InstructionType > function : functions ) { program . addFunction ( function , translate ( environment , function ) ) ; } return program ; } | 100 |
java-test-443 | java | How do of properties join ? | using dot ) | public void test Split And Join Multiple Properties On Dot ( ) { Properties inner = Property Utils . split Properties On Delimiter ( ONE DOT TWO , STRING ) ; assert Equals ( STRING , inner . get Property ( STRING ) ) ; assert Equals ( STRING , inner . get Property ( STRING ) ) ; assert Equals ( NUM , inner . size ( ) ) ; try { assert Equals ( ONE DOT TWO , Property Utils . join On Delimiter ( Property Utils . to Map ( inner ) , STRING ) ) ; } catch ( Comparison Failure e ) { assert Equals ( TWO DOT ONE , Property Utils . join On Delimiter ( Property Utils . to Map ( inner ) , STRING ) ) ; } } | public void testSplitAndJoinMultiplePropertiesOnDot ( ) { Properties inner = PropertyUtils . splitPropertiesOnDelimiter ( ONE_DOT_TWO , STRING ) ; assertEquals ( STRING , inner . getProperty ( STRING ) ) ; assertEquals ( STRING , inner . getProperty ( STRING ) ) ; assertEquals ( _NUM , inner . size ( ) ) ; try { assertEquals ( ONE_DOT_TWO , PropertyUtils . joinOnDelimiter ( PropertyUtils . toMap ( inner ) , STRING ) ) ; } catch ( ComparisonFailure e ) { assertEquals ( TWO_DOT_ONE , PropertyUtils . joinOnDelimiter ( PropertyUtils . toMap ( inner ) , STRING ) ) ; } } | 137 |
java-test-446 | java | In which direction do 4 roads run ? | east west | public Array List < Building Template > generate City ( boolean generic Road ) { int width = map Settings . get Board Width ( ) ; int height = map Settings . get Board Height ( ) ; int roads = map Settings . get City Blocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / NUM ; String city Type = map Settings . get City Type ( ) ; city Plan = new Hash Set < Coords > ( ) ; if ( generic Road ) { add Generic Road ( ) ; } if ( city Type . equals Ignore Case ( STRING ) ) build Hub City ( width , height , roads ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Metro City ( width , height ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Grid City ( width , height , ( roads + NUM ) / NUM ) ; else if ( city Type . equals Ignore Case ( STRING ) ) return build Town ( width , height , roads , map Settings . get Town Size ( ) ) ; else return new Array List < Building Template > ( ) ; return place Buildings ( NUM ) ; } | public ArrayList < BuildingTemplate > generateCity ( boolean genericRoad ) { int width = mapSettings . getBoardWidth ( ) ; int height = mapSettings . getBoardHeight ( ) ; int roads = mapSettings . getCityBlocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / _NUM ; String cityType = mapSettings . getCityType ( ) ; cityPlan = new HashSet < Coords > ( ) ; if ( genericRoad ) { addGenericRoad ( ) ; } if ( cityType . equalsIgnoreCase ( STRING ) ) buildHubCity ( width , height , roads ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildMetroCity ( width , height ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildGridCity ( width , height , ( roads + _NUM ) / _NUM ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) return buildTown ( width , height , roads , mapSettings . getTownSize ( ) ) ; else return new ArrayList < BuildingTemplate > ( ) ; return placeBuildings ( _NUM ) ; } | 234 |
java-test-447 | java | In which direction do 4 rounds run ? | north and south | public Array List < Building Template > generate City ( boolean generic Road ) { int width = map Settings . get Board Width ( ) ; int height = map Settings . get Board Height ( ) ; int roads = map Settings . get City Blocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / NUM ; String city Type = map Settings . get City Type ( ) ; city Plan = new Hash Set < Coords > ( ) ; if ( generic Road ) { add Generic Road ( ) ; } if ( city Type . equals Ignore Case ( STRING ) ) build Hub City ( width , height , roads ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Metro City ( width , height ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Grid City ( width , height , ( roads + NUM ) / NUM ) ; else if ( city Type . equals Ignore Case ( STRING ) ) return build Town ( width , height , roads , map Settings . get Town Size ( ) ) ; else return new Array List < Building Template > ( ) ; return place Buildings ( NUM ) ; } | public ArrayList < BuildingTemplate > generateCity ( boolean genericRoad ) { int width = mapSettings . getBoardWidth ( ) ; int height = mapSettings . getBoardHeight ( ) ; int roads = mapSettings . getCityBlocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / _NUM ; String cityType = mapSettings . getCityType ( ) ; cityPlan = new HashSet < Coords > ( ) ; if ( genericRoad ) { addGenericRoad ( ) ; } if ( cityType . equalsIgnoreCase ( STRING ) ) buildHubCity ( width , height , roads ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildMetroCity ( width , height ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildGridCity ( width , height , ( roads + _NUM ) / _NUM ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) return buildTown ( width , height , roads , mapSettings . getTownSize ( ) ) ; else return new ArrayList < BuildingTemplate > ( ) ; return placeBuildings ( _NUM ) ; } | 234 |
java-test-448 | java | What will this function generate ? | a city with a grid lay out . 4 rounds running north and south and 4 roads running east west | public Array List < Building Template > generate City ( boolean generic Road ) { int width = map Settings . get Board Width ( ) ; int height = map Settings . get Board Height ( ) ; int roads = map Settings . get City Blocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / NUM ; String city Type = map Settings . get City Type ( ) ; city Plan = new Hash Set < Coords > ( ) ; if ( generic Road ) { add Generic Road ( ) ; } if ( city Type . equals Ignore Case ( STRING ) ) build Hub City ( width , height , roads ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Metro City ( width , height ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Grid City ( width , height , ( roads + NUM ) / NUM ) ; else if ( city Type . equals Ignore Case ( STRING ) ) return build Town ( width , height , roads , map Settings . get Town Size ( ) ) ; else return new Array List < Building Template > ( ) ; return place Buildings ( NUM ) ; } | public ArrayList < BuildingTemplate > generateCity ( boolean genericRoad ) { int width = mapSettings . getBoardWidth ( ) ; int height = mapSettings . getBoardHeight ( ) ; int roads = mapSettings . getCityBlocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / _NUM ; String cityType = mapSettings . getCityType ( ) ; cityPlan = new HashSet < Coords > ( ) ; if ( genericRoad ) { addGenericRoad ( ) ; } if ( cityType . equalsIgnoreCase ( STRING ) ) buildHubCity ( width , height , roads ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildMetroCity ( width , height ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildGridCity ( width , height , ( roads + _NUM ) / _NUM ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) return buildTown ( width , height , roads , mapSettings . getTownSize ( ) ) ; else return new ArrayList < BuildingTemplate > ( ) ; return placeBuildings ( _NUM ) ; } | 234 |
java-test-449 | java | Will this function generate a city with a grid lay out . 4 rounds running north and south and 4 roads running east west ? | Yes | public Array List < Building Template > generate City ( boolean generic Road ) { int width = map Settings . get Board Width ( ) ; int height = map Settings . get Board Height ( ) ; int roads = map Settings . get City Blocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / NUM ; String city Type = map Settings . get City Type ( ) ; city Plan = new Hash Set < Coords > ( ) ; if ( generic Road ) { add Generic Road ( ) ; } if ( city Type . equals Ignore Case ( STRING ) ) build Hub City ( width , height , roads ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Metro City ( width , height ) ; else if ( city Type . equals Ignore Case ( STRING ) ) build Grid City ( width , height , ( roads + NUM ) / NUM ) ; else if ( city Type . equals Ignore Case ( STRING ) ) return build Town ( width , height , roads , map Settings . get Town Size ( ) ) ; else return new Array List < Building Template > ( ) ; return place Buildings ( NUM ) ; } | public ArrayList < BuildingTemplate > generateCity ( boolean genericRoad ) { int width = mapSettings . getBoardWidth ( ) ; int height = mapSettings . getBoardHeight ( ) ; int roads = mapSettings . getCityBlocks ( ) ; roads = ( roads * Math . min ( width , height ) ) / _NUM ; String cityType = mapSettings . getCityType ( ) ; cityPlan = new HashSet < Coords > ( ) ; if ( genericRoad ) { addGenericRoad ( ) ; } if ( cityType . equalsIgnoreCase ( STRING ) ) buildHubCity ( width , height , roads ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildMetroCity ( width , height ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) buildGridCity ( width , height , ( roads + _NUM ) / _NUM ) ; else if ( cityType . equalsIgnoreCase ( STRING ) ) return buildTown ( width , height , roads , mapSettings . getTownSize ( ) ) ; else return new ArrayList < BuildingTemplate > ( ) ; return placeBuildings ( _NUM ) ; } | 234 |
java-test-455 | java | What does the code obtain ? | the decimalstyle for the specified locale | 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-456 | java | Does this method provide access to locale sensitive decimal style symbols ? | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.