idx
int64
0
34.9k
question
stringlengths
12
26.4k
target
stringlengths
15
2.15k
400
protected ASN1Sequence ( ASN1EncodableVector v ) { for ( int i = 0 ; i != v . size ( ) ; i ++ ) { seq . addElement ( v . get ( i ) ) ; } }
Called from ControllerThread.run to initialize the logging subsystem
401
private final double readDatum ( final DataInput in , final ColumnType columnType ) throws IOException { switch ( columnType ) { case DOUBLE : return in . readDouble ( ) ; case INTEGER : int iValue = in . readInt ( ) ; if ( iValue == Integer . MIN_VALUE + 1 ) { boolean isMissing = in . readBoolean ( ) ; if ( isMissing ) { return Double . NaN ; } else { return iValue ; } } else { return iValue ; } case NOMINAL_BYTE : byte bValue = in . readByte ( ) ; if ( bValue == - 1 ) { return Double . NaN ; } else { return bValue ; } case NOMINAL_INTEGER : iValue = in . readInt ( ) ; if ( iValue == - 1 ) { return Double . NaN ; } else { return iValue ; } case NOMINAL_SHORT : short sValue = in . readShort ( ) ; if ( sValue == - 1 ) { return Double . NaN ; } else { return sValue ; } default : throw new RuntimeException ( "Illegal type: " + columnType ) ; } }
Prints the indentation at the beginning of a line.
402
protected void closeTransportLayer ( ) throws IOException { super . close ( ) ; if ( input != null ) { input . close ( ) ; output . close ( ) ; } }
Returns true if the name is a syntactically valid fully qualified class name (no whitespace permitted), and returns false otherwise.
403
public double op ( final double x ) { final double sn = Math . sin ( this . asr * ( - x + 1 ) * 0.5 ) ; return Math . exp ( ( sn * hk - hs ) / ( 1.0 - sn * sn ) ) ; }
Set bounds for the right textView including clip padding.
404
public void listen ( StanzaListener stanzaListener , StanzaFilter stanzaFilter ) { connection . addAsyncStanzaListener ( stanzaListener , stanzaFilter ) ; logger . info ( "Listening for incoming XMPP Stanzas..." ) ; }
This is called right before the fragment is detached from its current activity instance.
405
public static void addInputMode ( String name , Hashtable values , boolean firstUpcase ) { initInputModes ( ) ; inputModes . put ( name , values ) ; if ( firstUpcase ) { firstUppercaseInputMode . addElement ( name ) ; } }
Add a log Handler to receive logging messages. <p> By default, Loggers also send their output to their parent logger. Typically the root Logger is configured with a set of Handlers that essentially act as default handlers for all loggers.
406
private static String doGetPath ( String filename , int separatorAdd ) { if ( filename == null ) { return null ; } int prefix = getPrefixLength ( filename ) ; if ( prefix < 0 ) { return null ; } int index = indexOfLastSeparator ( filename ) ; int endIndex = index + separatorAdd ; if ( prefix >= filename . length ( ) || index < 0 || prefix >= endIndex ) { return "" ; } return filename . substring ( prefix , endIndex ) ; }
swap to values of the array
407
@ Override public void addEnvVarUpdatedListener ( EnvVarUpdateInterface listener ) { if ( ! listenerList . contains ( listener ) ) { listenerList . add ( listener ) ; } }
ExceptionDescribe: print the exception description and the stack trace back, then clear the exception
408
private void init ( Configuration exp ) throws IOException { isInitialized = true ; }
Destroys the tripleBuffer and tripleBufferGraphics objects.
409
public List < LocalVariable > visibleVariables ( ) throws AbsentInformationException { validateStackFrame ( ) ; createVisibleVariables ( ) ; List < LocalVariable > mapAsList = new ArrayList < LocalVariable > ( visibleVariables . values ( ) ) ; Collections . sort ( mapAsList ) ; return mapAsList ; }
This generates a list of SelectArgs which must be used when building queries, especially with Strings. Strings are otherwise not escaped, even when used with .in() or .eq(). This can result in an SQL injection vulnerability. See: http://ormlite.com/javadoc/ormlite-core/doc-files/ormlite_3.html#Select-Arguments
410
private static List < Object > createEqualityKey ( Node node ) { List < Object > values = new ArrayList < Object > ( ) ; values . add ( node . getNodeType ( ) ) ; values . add ( node . getNodeName ( ) ) ; values . add ( node . getLocalName ( ) ) ; values . add ( node . getNamespaceURI ( ) ) ; values . add ( node . getPrefix ( ) ) ; values . add ( node . getNodeValue ( ) ) ; for ( Node child = node . getFirstChild ( ) ; child != null ; child = child . getNextSibling ( ) ) { values . add ( child ) ; } switch ( node . getNodeType ( ) ) { case DOCUMENT_TYPE_NODE : DocumentTypeImpl doctype = ( DocumentTypeImpl ) node ; values . add ( doctype . getPublicId ( ) ) ; values . add ( doctype . getSystemId ( ) ) ; values . add ( doctype . getInternalSubset ( ) ) ; values . add ( doctype . getEntities ( ) ) ; values . add ( doctype . getNotations ( ) ) ; break ; case ELEMENT_NODE : Element element = ( Element ) node ; values . add ( element . getAttributes ( ) ) ; break ; } return values ; }
Removes and returns last element, or null if empty.
411
public static void startServices ( ServiceHost host , Class ... services ) throws InstantiationException , IllegalAccessException { checkArgument ( services != null , "services cannot be null" ) ; for ( Class service : services ) { startService ( host , service ) ; } }
lat and lon are in degrees, positive north and east.
412
private AppliedMigration createAppliedMigration ( int version , String description ) { return new AppliedMigration ( version , version , MigrationVersion . fromVersion ( Integer . toString ( version ) ) , description , MigrationType . CQL , "x" , null , new Date ( ) , "sa" , 123 , true ) ; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
413
TemplateEntry nextEntry ( ) { if ( ! hasNext ( ) ) { throw new NoSuchElementException ( ) ; } final TemplateEntry entry = nextEntry ; nextEntry = null ; return entry ; }
Send a message to a remote device. If the local device did't connected to the remote devices, it will call connectDevice(), then send the message. If you want to get a response from the remote device, call another overload method, this method default will not obtain a response.
414
private void createRecordHolderQueue ( File [ ] listFiles ) { this . recordHolderHeap = new PriorityQueue < SortTempFileChunkHolder > ( listFiles . length ) ; }
Format method for the x conversion character and int argument. <p/> For x format, the flag character '-', means that the output should be left justified within the field. The default is to pad with blanks on the left. The '#' flag character means to lead with '0x'. <p/> The field width is treated as the minimum number of characters to be printed. The default is to add no padding. Padding is with blanks by default. <p/> The precision, if set, is the minimum number of digits to appear. Padding is with leading 0s.
415
public static double correlation ( double [ ] x , double [ ] y ) { if ( x . length == y . length ) { double mx = MathUtils . mean ( x ) ; double my = MathUtils . mean ( y ) ; double sx = Math . sqrt ( MathUtils . variance ( x ) ) ; double sy = Math . sqrt ( MathUtils . variance ( y ) ) ; int n = x . length ; double nval = 0.0 ; for ( int i = 0 ; i < n ; i ++ ) { nval += ( x [ i ] - mx ) * ( y [ i ] - my ) ; } double r = nval / ( ( n - 1 ) * sx * sy ) ; return r ; } else throw new IllegalArgumentException ( "vectors of different size" ) ; }
Unit test verifies that the release time does NOT advance when the earliest running transaction terminates but a second transaction is still active which reads on the same commit time.
416
public static int writeMessageFully ( Message msg , OutputStream out , ByteBuffer buf , MessageWriter writer ) throws IOException { assert msg != null ; assert out != null ; assert buf != null ; assert buf . hasArray ( ) ; if ( writer != null ) writer . setCurrentWriteClass ( msg . getClass ( ) ) ; boolean finished = false ; int cnt = 0 ; while ( ! finished ) { finished = msg . writeTo ( buf , writer ) ; out . write ( buf . array ( ) , 0 , buf . position ( ) ) ; cnt += buf . position ( ) ; buf . clear ( ) ; } return cnt ; }
Validates the procedures resultset against expectedProcedures.
417
@ Override public boolean connectionAllowed ( EventSetDescriptor esd ) { return connectionAllowed ( esd . getName ( ) ) ; }
Check if we've crossed a reasonable touch slop for the given child view. If the child cannot be dragged along the horizontal or vertical axis, motion along that axis will not count toward the slop check.
418
protected final void dragExit ( final int x , final int y ) { DragSourceEvent event = new DragSourceEvent ( getDragSourceContext ( ) , x , y ) ; EventDispatcher dispatcher = new EventDispatcher ( DISPATCH_EXIT , event ) ; SunToolkit . invokeLaterOnAppContext ( SunToolkit . targetToAppContext ( getComponent ( ) ) , dispatcher ) ; startSecondaryEventLoop ( ) ; }
Method to return a Date instance which is exactly numDays days after the point in time designated by the input Date
419
public static String generateRandomString ( int count ) { Random random = new Random ( ) ; StringBuffer buffer = new StringBuffer ( ) ; while ( count -- != 0 ) { char ch = ( char ) ( random . nextInt ( 96 ) + 32 ) ; buffer . append ( ch ) ; } return buffer . toString ( ) ; }
Returns a new byte array, copied from the passed ByteBuffer.
420
public void decrement ( ) { int counterVal = counter . decrementAndGet ( ) ; if ( counterVal == 0 ) { if ( null != resourceCallback ) { resourceCallback . onTransitionToIdle ( ) ; } becameIdleAt = SystemClock . uptimeMillis ( ) ; } if ( debugCounting ) { if ( counterVal == 0 ) { Log . i ( TAG , "Resource: " + resourceName + " went idle! (Time spent not idle: " + ( becameIdleAt - becameBusyAt ) + ")" ) ; } else { Log . i ( TAG , "Resource: " + resourceName + " in-use-count decremented to: " + counterVal ) ; } } if ( counterVal < 0 ) { throw new IllegalArgumentException ( "Counter has been corrupted!" ) ; } }
Gets a JMS listener container factory that can return a JMS listener container.
421
public void removeTestingCallback ( OneSheeldTestingCallback testingCallback ) { if ( testingCallback != null && testingCallbacks . contains ( testingCallback ) ) testingCallbacks . remove ( testingCallback ) ; }
Returns all charts (there is no support for searching or filtering).
422
public boolean shouldDataBeRouted ( SimpleRouterContext context , DataMetaData dataMetaData , Node node , boolean initialLoad , boolean initialLoadSelectUsed , TriggerRouter triggerRouter ) { IDataRouter router = getDataRouter ( dataMetaData . getRouter ( ) ) ; Set < Node > oneNodeSet = new HashSet < Node > ( 1 ) ; oneNodeSet . add ( node ) ; Collection < String > nodeIds = router . routeToNodes ( context , dataMetaData , oneNodeSet , initialLoad , initialLoadSelectUsed , triggerRouter ) ; return nodeIds != null && nodeIds . contains ( node . getNodeId ( ) ) ; }
Adds another ImageContainer to the list of those interested in the results of the request.
423
private void verifyIsRoot ( ) { if ( hierarchyElements . size ( ) != 0 ) { throw new IllegalStateException ( "This is not the root. Can " + "only call addCounter() on the root node. Current node: " + hierarchy ) ; } }
Runs the test case.
424
@ Override public Object put ( Object key , Object value ) { Entry tab [ ] = table ; int hash = 0 ; int index = 0 ; if ( key != null ) { hash = System . identityHashCode ( key ) ; index = ( hash & 0x7FFFFFFF ) % tab . length ; for ( Entry e = tab [ index ] ; e != null ; e = e . next ) { if ( ( e . hash == hash ) && key == e . key ) { Object old = e . value ; e . value = value ; return old ; } } } else { for ( Entry e = tab [ 0 ] ; e != null ; e = e . next ) { if ( e . key == null ) { Object old = e . value ; e . value = value ; return old ; } } } modCount ++ ; if ( count >= threshold ) { rehash ( ) ; tab = table ; index = ( hash & 0x7FFFFFFF ) % tab . length ; } Entry e = new Entry ( hash , key , value , tab [ index ] ) ; tab [ index ] = e ; count ++ ; return null ; }
Each validator should call this method to add its ValidationState into the validation manager.
425
public static String backQuoteChars ( String string , char [ ] find , String [ ] replace ) { int index ; StringBuilder newStr ; int i ; if ( string == null ) return string ; for ( i = 0 ; i < find . length ; i ++ ) { if ( string . indexOf ( find [ i ] ) != - 1 ) { newStr = new StringBuilder ( ) ; while ( ( index = string . indexOf ( find [ i ] ) ) != - 1 ) { if ( index > 0 ) newStr . append ( string . substring ( 0 , index ) ) ; newStr . append ( replace [ i ] ) ; if ( ( index + 1 ) < string . length ( ) ) string = string . substring ( index + 1 ) ; else string = "" ; } newStr . append ( string ) ; string = newStr . toString ( ) ; } } return string ; }
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
426
public void testBitLengthNegative2 ( ) { byte aBytes [ ] = { - 128 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 3 , - 15 , 35 , 26 } ; int aSign = - 1 ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; assertEquals ( 96 , aNumber . bitLength ( ) ) ; }
Parses a MULTILINESTRING statement that has nested linestrings from the current reader
427
public void addLanguage ( ExecutionLanguage language ) { languages . add ( 1 , language ) ; }
Compute a gts Id from given classId/labelsId. We compute the palindromic SipHash of 'GTS:' + <classId> + ':' + <labelsId>
428
private static boolean memberEquals ( final Class < ? > type , final Object o1 , final Object o2 ) { if ( o1 == o2 ) { return true ; } if ( o1 == null || o2 == null ) { return false ; } if ( type . isArray ( ) ) { return arrayMemberEquals ( type . getComponentType ( ) , o1 , o2 ) ; } if ( type . isAnnotation ( ) ) { return equals ( ( Annotation ) o1 , ( Annotation ) o2 ) ; } return o1 . equals ( o2 ) ; }
Checks if an arrowpoint is allowed by background knowledge.
429
public Encoding ( String name ) { this . name = name ; }
Creates a ConfigurationResponse based on the configRequest, configuration response contains the requested shared configuration This method locks the SharedConfiguration
430
private String base64 ( String value ) { StringBuffer cb = new StringBuffer ( ) ; int i = 0 ; for ( i = 0 ; i + 2 < value . length ( ) ; i += 3 ) { long chunk = ( int ) value . charAt ( i ) ; chunk = ( chunk << 8 ) + ( int ) value . charAt ( i + 1 ) ; chunk = ( chunk << 8 ) + ( int ) value . charAt ( i + 2 ) ; cb . append ( encode ( chunk > > 18 ) ) ; cb . append ( encode ( chunk > > 12 ) ) ; cb . append ( encode ( chunk > > 6 ) ) ; cb . append ( encode ( chunk ) ) ; } if ( i + 1 < value . length ( ) ) { long chunk = ( int ) value . charAt ( i ) ; chunk = ( chunk << 8 ) + ( int ) value . charAt ( i + 1 ) ; chunk <<= 8 ; cb . append ( encode ( chunk > > 18 ) ) ; cb . append ( encode ( chunk > > 12 ) ) ; cb . append ( encode ( chunk > > 6 ) ) ; cb . append ( '=' ) ; } else if ( i < value . length ( ) ) { long chunk = ( int ) value . charAt ( i ) ; chunk <<= 16 ; cb . append ( encode ( chunk > > 18 ) ) ; cb . append ( encode ( chunk > > 12 ) ) ; cb . append ( '=' ) ; cb . append ( '=' ) ; } return cb . toString ( ) ; }
Returns true iff s starts with prefix, ignoring case.
431
public String writeLongToString ( ) { StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < ( bitSet . getBits ( ) . length ) ; ++ i ) { builder . append ( Long . toString ( bitSet . getBits ( ) [ i ] ) + "|" ) ; } return builder . toString ( ) ; }
Returns the number of unprocessed tokens remaining in the string.
432
@ Override public void committed ( long committedWindowId ) throws IOException { LOG . debug ( "data manager committed {}" , committedWindowId ) ; for ( Long currentWindow : savedWindows . keySet ( ) ) { if ( currentWindow <= largestWindowAddedToTransferQueue ) { continue ; } if ( currentWindow <= committedWindowId ) { LOG . debug ( "to transfer {}" , currentWindow ) ; largestWindowAddedToTransferQueue = currentWindow ; windowsToTransfer . add ( currentWindow ) ; } else { break ; } } }
Creates an object out of a property name. If anything fails, return null.
433
public void delete ( RandomAccessFile raf , RandomAccessFile tempRaf ) throws CannotReadException , CannotWriteException , IOException { raf . seek ( 0 ) ; tempRaf . seek ( 0 ) ; deleteTag ( raf , tempRaf ) ; }
Adds files array to the request with both custom provided file content-type and files name
434
void onDeferredEndDrag ( DragView dragView ) { dragView . remove ( ) ; if ( mDragObject . deferDragViewCleanupPostAnimation ) { for ( DragListener listener : new ArrayList < > ( mListeners ) ) { listener . onDragEnd ( ) ; } } }
Returns whether the specified classpath is equivalent to the default classpath for this configuration.
435
private byte [ ] pageToByteArray ( P page ) { try { if ( page == null ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( baos ) ; oos . writeInt ( EMPTY_PAGE ) ; oos . close ( ) ; baos . close ( ) ; byte [ ] array = baos . toByteArray ( ) ; byte [ ] result = new byte [ pageSize ] ; System . arraycopy ( array , 0 , result , 0 , array . length ) ; return result ; } else { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( baos ) ; oos . writeInt ( FILLED_PAGE ) ; page . writeExternal ( oos ) ; oos . close ( ) ; baos . close ( ) ; byte [ ] array = baos . toByteArray ( ) ; if ( array . length > this . pageSize ) { throw new IllegalArgumentException ( "Size of page " + page + " is greater than specified" + " pagesize: " + array . length + " > " + pageSize ) ; } else if ( array . length == this . pageSize ) { return array ; } else { byte [ ] result = new byte [ pageSize ] ; System . arraycopy ( array , 0 , result , 0 , array . length ) ; return result ; } } } catch ( IOException e ) { throw new RuntimeException ( "IOException occurred! " , e ) ; } }
Return a List of Element objects that are children of the given element
436
void presentDecorAnimations ( int position , float offset ) { int animMapSize = mDecorAnimations . size ( ) ; for ( int i = 0 ; i < animMapSize ; i ++ ) { Decor decor = mDecorAnimations . keyAt ( i ) ; ArrayList < Animation > animations = mDecorAnimations . get ( decor ) ; int animListSize = animations . size ( ) ; for ( int j = 0 ; j < animListSize ; j ++ ) { Animation animation = animations . get ( j ) ; if ( animation == null ) { continue ; } if ( ! animation . shouldAnimate ( position ) ) { if ( mPreviousPosition < position && animation . pageEnd < position ) { animation . animate ( decor . contentView , 1 , 0 , position ) ; } else if ( mPreviousPosition > position && animation . pageStart > position ) { animation . animate ( decor . contentView , 0 , 0 , position ) ; } continue ; } animation . animate ( decor . contentView , offset , 0 , position ) ; } } mPreviousPosition = position ; }
Add a HISTORY line.
437
public static boolean deltree ( File directory ) { if ( directory == null || ! directory . exists ( ) ) { return true ; } boolean result = true ; if ( directory . isFile ( ) ) { result = directory . delete ( ) ; } else { File [ ] list = directory . listFiles ( ) ; for ( int i = list . length ; i -- > 0 ; ) { if ( ! deltree ( list [ i ] ) ) { result = false ; } } if ( ! directory . delete ( ) ) { result = false ; } } return result ; }
Get Converted Qty from Server (no cache)
438
private void updateProgress ( String progressLabel , int progress ) { if ( myHost != null && ( ( progress != previousProgress ) || ( ! progressLabel . equals ( previousProgressLabel ) ) ) ) { myHost . updateProgress ( progressLabel , progress ) ; } previousProgress = progress ; previousProgressLabel = progressLabel ; }
Finds the specified option among the arguments, and removes it if needed.
439
public void invalidate ( long newFileSize ) { if ( newFileSize < fileSize ) { fileSize = newFileSize ; counters . clear ( ) ; blockSize = calcBlockSize ( fileSize ) ; } else if ( newFileSize > fileSize ) compact ( newFileSize ) ; }
Metodo que carga la coleccion con la configuracion segun la extension de los ficheros
440
public void addCase ( SwitchCase switchCase ) { assertNotNull ( switchCase ) ; if ( cases == null ) { cases = new ArrayList < SwitchCase > ( ) ; } cases . add ( switchCase ) ; switchCase . setParent ( this ) ; }
Unregister a CircularProgressViewListener with this View
441
private void updateProgress ( String progressLabel , int progress ) { if ( myHost != null && ( ( progress != previousProgress ) || ( ! progressLabel . equals ( previousProgressLabel ) ) ) ) { myHost . updateProgress ( progressLabel , progress ) ; } previousProgress = progress ; previousProgressLabel = progressLabel ; }
returns a date time instance by a number, the conversion from the double to date is o the base of the CFML rules.
442
public void test_atomicAppendFullBlock ( ) throws IOException { final String id = "test" ; final int version = 0 ; Random r = new Random ( ) ; final byte [ ] expected = new byte [ BLOCK_SIZE ] ; r . nextBytes ( expected ) ; final long block0 = repo . appendBlock ( id , version , expected , 0 , expected . length ) ; assertEquals ( "block#" , 0L , block0 ) ; assertEquals ( "blockCount" , 1 , repo . getBlockCount ( id , version ) ) ; assertEquals ( "readBlock" , expected , repo . readBlock ( id , version , block0 ) ) ; assertEquals ( "inputStream" , expected , read ( repo . inputStream ( id , version ) ) ) ; }
Parses a NewExpr except for the leading "new", and returns the constructed object.
443
public static int hash ( byte [ ] data , int offset , int length , int seed ) { return hash ( ByteBuffer . wrap ( data , offset , length ) , seed ) ; }
Returns the number of foos.
444
protected void layoutContainer ( ) { Rectangle inBounds = p . getBounds ( ) ; Insets insets = p . getInsets ( ) ; inBounds . x += insets . left ; inBounds . width -= insets . left ; inBounds . width -= insets . right ; inBounds . y += insets . top ; inBounds . height -= insets . top ; inBounds . height -= insets . bottom ; backgroundBounds = ( Rectangle ) inBounds . clone ( ) ; occludingBounds = ( Rectangle ) inBounds . clone ( ) ; layoutCardinals ( ) ; layoutEast ( p . getEast ( ) , occludingBounds . x + occludingBounds . width , occludingBounds . y , occludingBounds . width , occludingBounds . height ) ; layoutWest ( p . getWest ( ) , occludingBounds . x , occludingBounds . y , occludingBounds . width , occludingBounds . height ) ; int southLeft = inBounds . x + getWidthAtYCardinal ( p . getWest ( ) , inBounds . y + inBounds . height - getHeightAtLeftCardinal ( p . getSouth ( ) ) ) ; int southRight = inBounds . x + inBounds . width - getWidthAtYCardinal ( p . getEast ( ) , inBounds . y + inBounds . height - getHeightAtRightCardinal ( p . getSouth ( ) ) ) ; layoutSouth ( p . getSouth ( ) , southLeft , occludingBounds . y + occludingBounds . height , southRight - southLeft , occludingBounds . height ) ; int northLeft = inBounds . x + getWidthAtYCardinal ( p . getWest ( ) , inBounds . y + getHeightAtLeftCardinal ( p . getNorth ( ) ) ) ; int northRight = inBounds . x + inBounds . width - getWidthAtYCardinal ( p . getEast ( ) , inBounds . y + getHeightAtRightCardinal ( p . getNorth ( ) ) ) ; layoutNorth ( p . getNorth ( ) , northLeft , occludingBounds . y , northRight - northLeft , occludingBounds . height ) ; layoutBackground ( ) ; }
Returns an array containing x,y,w,h of one of items[][] elements.
445
public static boolean isFileExist ( String filePath , FileType fileType ) throws IOException { filePath = filePath . replace ( "\\" , "/" ) ; switch ( fileType ) { case HDFS : case VIEWFS : Path path = new Path ( filePath ) ; FileSystem fs = path . getFileSystem ( configuration ) ; return fs . exists ( path ) ; case LOCAL : default : File defaultFile = new File ( filePath ) ; return defaultFile . exists ( ) ; } }
Write text to the output
446
private void informUponSimilarName ( final StringBuffer messageBuffer , final String name , final String candidate ) { if ( name . equals ( candidate ) ) { return ; } if ( name . regionMatches ( true , 0 , candidate , 0 , PKG_LEN + 5 ) ) { messageBuffer . append ( " Did you mean '" ) ; messageBuffer . append ( candidate ) ; messageBuffer . append ( "'?" ) ; } }
For each qualifier hierarchy in tops, take the lub of the annos in subtypeAnnos that correspond to that hierarchy place the lub in lubOfPrimaries
447
private void checkQopSupport ( byte [ ] qopInChallenge , byte [ ] ciphersInChallenge ) throws IOException { String qopOptions ; if ( qopInChallenge == null ) { qopOptions = "auth" ; } else { qopOptions = new String ( qopInChallenge , encoding ) ; } String [ ] serverQopTokens = new String [ 3 ] ; byte [ ] serverQop = parseQop ( qopOptions , serverQopTokens , true ) ; byte serverAllQop = combineMasks ( serverQop ) ; switch ( findPreferredMask ( serverAllQop , qop ) ) { case 0 : throw new SaslException ( "DIGEST-MD5: No common protection " + "layer between client and server" ) ; case NO_PROTECTION : negotiatedQop = "auth" ; break ; case INTEGRITY_ONLY_PROTECTION : negotiatedQop = "auth-int" ; integrity = true ; rawSendSize = sendMaxBufSize - 16 ; break ; case PRIVACY_PROTECTION : negotiatedQop = "auth-conf" ; privacy = integrity = true ; rawSendSize = sendMaxBufSize - 26 ; checkStrengthSupport ( ciphersInChallenge ) ; break ; } if ( logger . isLoggable ( Level . FINE ) ) { logger . log ( Level . FINE , "DIGEST61:Raw send size: {0}" , new Integer ( rawSendSize ) ) ; } }
Compares two map nodes by their distance from the source node
448
public void close ( boolean pCloseUnderlying ) throws IOException { if ( closed ) { return ; } if ( pCloseUnderlying ) { closed = true ; input . close ( ) ; } else { for ( ; ; ) { int av = available ( ) ; if ( av == 0 ) { av = makeAvailable ( ) ; if ( av == 0 ) { break ; } } long skip = skip ( av ) ; if ( skip != av ) { if ( log . isDebugEnabled ( ) ) { log . debug ( skip + " bytes been skipped." ) ; } } } } closed = true ; }
Returns an enumeration describing the available options.
449
protected void addNewEvent ( Object eventKey , T event ) { if ( unwrittenEvents == null ) { unwrittenEvents = Maps . newHashMap ( ) ; } List < T > listEvents = unwrittenEvents . get ( eventKey ) ; if ( listEvents == null ) { unwrittenEvents . put ( eventKey , Lists . newArrayList ( event ) ) ; } else { listEvents . add ( event ) ; } }
Rewrite a method signature.
450
public static Locale localeFromString ( final String localeAsString ) { if ( StringUtils . isBlank ( localeAsString ) ) { final List < ApiParameterError > dataValidationErrors = new ArrayList < > ( ) ; final ApiParameterError error = ApiParameterError . parameterError ( "validation.msg.invalid.locale.format" , "The parameter locale is invalid. It cannot be blank." , "locale" ) ; dataValidationErrors . add ( error ) ; throw new PlatformApiDataValidationException ( "validation.msg.validation.errors.exist" , "Validation errors exist." , dataValidationErrors ) ; } String languageCode = "" ; String countryCode = "" ; String variantCode = "" ; final String [ ] localeParts = localeAsString . split ( "_" ) ; if ( localeParts != null && localeParts . length == 1 ) { languageCode = localeParts [ 0 ] ; } if ( localeParts != null && localeParts . length == 2 ) { languageCode = localeParts [ 0 ] ; countryCode = localeParts [ 1 ] ; } if ( localeParts != null && localeParts . length == 3 ) { languageCode = localeParts [ 0 ] ; countryCode = localeParts [ 1 ] ; variantCode = localeParts [ 2 ] ; } return localeFrom ( languageCode , countryCode , variantCode ) ; }
Creates a pattern element from the pattern string which is either a reg-ex expression or in our old 'StringMatcher' format.
451
protected Object decodeResponse ( InputStream inputStream , String contentType ) throws IOException { Object value ; if ( contentType . startsWith ( JSON_MIME_TYPE ) ) { JSONDecoder decoder = new JSONDecoder ( ) ; value = decoder . readValue ( inputStream ) ; } else if ( contentType . startsWith ( TEXT_MIME_TYPE_PREFIX ) ) { TextDecoder decoder = new TextDecoder ( ) ; value = decoder . readValue ( inputStream ) ; } else { value = null ; } return value ; }
Initialize rules through file input stream. This is a convenience for first calling setPasswordMap(parseRulesFile(is)).
452
protected static Pair < String , String > asrImmediate ( final long offset , final ITranslationEnvironment environment , final List < ReilInstruction > instructions , final String registerNodeValue , final String immediateNodeValue ) { long baseOffset = offset ; final String shifterOperand = environment . getNextVariableString ( ) ; final String shifterCarryOut = environment . getNextVariableString ( ) ; if ( immediateNodeValue . equals ( "0" ) ) { final String tmpVar1 = environment . getNextVariableString ( ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , dWordSize , registerNodeValue , wordSize , thirtyOneSet , byteSize , tmpVar1 ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , byteSize , tmpVar1 , byteSize , oneSet , byteSize , shifterCarryOut ) ) ; instructions . add ( ReilHelpers . createSub ( baseOffset ++ , byteSize , shifterCarryOut , byteSize , String . valueOf ( 1 ) , dWordSize , shifterOperand ) ) ; return new Pair < String , String > ( shifterOperand , shifterCarryOut ) ; } else { final String tmpVar1 = environment . getNextVariableString ( ) ; final String tmpVar2 = environment . getNextVariableString ( ) ; final String tmpVar3 = environment . getNextVariableString ( ) ; final String tmpVar4 = environment . getNextVariableString ( ) ; final String tmpVar5 = environment . getNextVariableString ( ) ; instructions . add ( ReilHelpers . createAdd ( baseOffset ++ , dWordSize , registerNodeValue , dWordSize , bitMaskHighestBitSet , qWordSize , tmpVar1 ) ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , qWordSize , tmpVar1 , wordSize , "-" + immediateNodeValue , dWordSize , tmpVar2 ) ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , dWordSize , bitMaskHighestBitSet , wordSize , "-" + immediateNodeValue , dWordSize , tmpVar3 ) ) ; instructions . add ( ReilHelpers . createSub ( baseOffset ++ , dWordSize , tmpVar2 , dWordSize , tmpVar3 , qWordSize , tmpVar4 ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , qWordSize , tmpVar4 , dWordSize , bitMaskAllBitsSet , dWordSize , shifterOperand ) ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , dWordSize , registerNodeValue , dWordSize , String . valueOf ( - ( Integer . decode ( immediateNodeValue ) - 1 ) ) , wordSize , tmpVar5 ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , wordSize , tmpVar5 , byteSize , oneSet , byteSize , shifterCarryOut ) ) ; return new Pair < String , String > ( shifterOperand , shifterCarryOut ) ; } }
Read a Text object whose length is already known. This allows creating Text from a stream which uses a different serialization format.
453
private boolean isIncluded ( final HttpServletRequest request ) { String uri = ( String ) request . getAttribute ( "javax.servlet.include.request_uri" ) ; boolean includeRequest = ! ( uri == null ) ; if ( includeRequest && log . isDebugEnabled ( ) ) { log . debug ( "{} resulted in an include request. This is unusable, because" + "the response will be assembled into the overrall response. Not gzipping." , request . getRequestURL ( ) ) ; } return includeRequest ; }
Builds a partial URL - including the servlet path and resource, but not the scheme or host.
454
public static void loadModule ( final JTree tree , final INaviModule module ) { Preconditions . checkNotNull ( tree , "IE01195: Tree argument can not be null" ) ; Preconditions . checkNotNull ( module , "IE01196: Module argument can not be null" ) ; loadModuleThreaded ( SwingUtilities . getWindowAncestor ( tree ) , module , tree ) ; }
Entry point for LoginState. This method is called during session upgrade in order to copy session attributes from one session to another.
455
public boolean evaluate ( FeatureClassInfo fci , int row ) { boolean ret = true ; StringBuffer reasoning = null ; if ( logger . isLoggable ( Level . FINE ) ) { reasoning = new StringBuffer ( ) ; } if ( exp != null ) { ret = exp . evaluate ( fci , row , reasoning ) ; } if ( reasoning != null ) { reasoning . append ( "\n--------" ) ; logger . fine ( reasoning . toString ( ) ) ; } return ret ; }
Stop the underlying cleanup of the registrations.
456
public void addFunctionalInstrumentation ( SpecialInstrumentationPoint functionalInstrumentation ) { if ( null == functionalInstrumentations ) { functionalInstrumentations = new HashSet < SpecialInstrumentationPoint > ( 1 ) ; } functionalInstrumentations . add ( functionalInstrumentation ) ; }
Update the unit to reflect damages taken in this phase.
457
public final List < Integer > executeIntListQuery ( String sql ) throws AdeException { return SpecialSqlQueries . executeIntListQuery ( sql , m_connection ) ; }
Add a camera listener.
458
@ ApiOperation ( value = "Uninstall SymmetricDS on the single engine" ) @ RequestMapping ( value = "engine/uninstall" , method = RequestMethod . POST ) @ ResponseStatus ( HttpStatus . NO_CONTENT ) @ ResponseBody public final void postUninstall ( ) { uninstallImpl ( getSymmetricEngine ( ) ) ; }
Transform canvas before draw content, for example, do canvas.translate
459
public boolean oneOutgoingTransitionLeavesCompositeWithExitActions ( State state ) { Set < State > sourceParentStates = new HashSet < State > ( getParentStates ( state ) ) ; for ( Transition transition : state . getOutgoingTransitions ( ) ) { Set < State > targetParentStates = getParentStates ( transition . getTarget ( ) ) ; Set < State > crossedStates = new HashSet < State > ( sourceParentStates ) ; crossedStates . removeAll ( targetParentStates ) ; for ( State crossedCompositeState : crossedStates ) { if ( hasExitAction ( crossedCompositeState ) ) return true ; } } return false ; }
SelectFunctionalityTest#test_SelectDistinct(). Selects records from a table using distinct
460
public static int determineConsecutiveDigitCount ( CharSequence msg , int startpos ) { int count = 0 ; int len = msg . length ( ) ; int idx = startpos ; if ( idx < len ) { char ch = msg . charAt ( idx ) ; while ( isDigit ( ch ) && idx < len ) { count ++ ; idx ++ ; if ( idx < len ) { ch = msg . charAt ( idx ) ; } } } return count ; }
Publish / send a message to an MQTT server
461
@ Override public int read ( ) throws IOException { int x = in . read ( ) ; if ( x != - 1 ) { check . update ( x ) ; } return x ; }
update IDP Authentication Contexts
462
public static boolean removeTable ( Table t ) { try { tableList . remove ( t ) ; } catch ( Exception e ) { return false ; } return true ; }
Constructs a new CustomEditor.
463
public void addScrollingListener ( OnWheelScrollListener listener ) { scrollingListeners . add ( listener ) ; }
Add a hyphen to the first element in a list of dates to indicate a date range. This method only modifiers the date list if exactly two dates are displayed in the graphic.
464
public Plot add ( String label , Population population , int x , int y ) { List < Number > xs = new ArrayList < Number > ( ) ; List < Number > ys = new ArrayList < Number > ( ) ; for ( Solution solution : population ) { if ( ! solution . violatesConstraints ( ) ) { xs . add ( solution . getObjective ( x ) ) ; ys . add ( solution . getObjective ( y ) ) ; } } scatter ( label , xs , ys ) ; setLabelsIfBlank ( "Objective " + ( x + 1 ) , "Objective " + ( y + 1 ) ) ; return this ; }
Plug in all the fields of your object here, and then they will be included in equals, hashcode and toString.
465
private void initializeNeighborhoods ( ) { List < Individual > sortedPopulation = new ArrayList < Individual > ( population ) ; for ( Individual individual : population ) { Collections . sort ( sortedPopulation , new WeightSorter ( individual ) ) ; for ( int i = 0 ; i < neighborhoodSize ; i ++ ) { individual . addNeighbor ( sortedPopulation . get ( i ) ) ; } } }
Converts screen space x-coordinates into normalized values.
466
public void print ( boolean x ) { out . print ( x ) ; out . flush ( ) ; }
Parse JSON text into java object from the input source.
467
public final boolean removeElement ( int s ) { for ( int i = 0 ; i < m_firstFree ; i ++ ) { if ( m_map [ i ] == s ) { if ( ( i + 1 ) < m_firstFree ) System . arraycopy ( m_map , i + 1 , m_map , i - 1 , m_firstFree - i ) ; else m_map [ i ] = java . lang . Integer . MIN_VALUE ; m_firstFree -- ; return true ; } } return false ; }
Generates a TestSuite for the given GenericPropertiesCreator property and returns it. Potentially missing test classes are output.
468
public VNXeCommandJob restoreLunGroupSnap ( String snapId , VNXeSnapRestoreParam restoreParam ) throws VNXeException { StringBuilder urlBuilder = new StringBuilder ( URL_INSTANCE ) ; urlBuilder . append ( snapId ) ; urlBuilder . append ( URL_RESTORE ) ; _url = urlBuilder . toString ( ) ; return postRequestAsync ( restoreParam ) ; }
Initializes the first node of a route.
469
public void sortFromTo ( int from , int to ) { final int widthThreshold = 10000 ; if ( size == 0 ) return ; checkRangeFromTo ( from , to , size ) ; short min = elements [ from ] ; short max = elements [ from ] ; short [ ] theElements = elements ; for ( int i = from + 1 ; i <= to ; ) { short elem = theElements [ i ++ ] ; if ( elem > max ) max = elem ; else if ( elem < min ) min = elem ; } double N = ( double ) to - ( double ) from + 1.0 ; double quickSortEstimate = N * Math . log ( N ) / 0.6931471805599453 ; double width = ( double ) max - ( double ) min + 1.0 ; double countSortEstimate = Math . max ( width , N ) ; if ( width < widthThreshold && countSortEstimate < quickSortEstimate ) { countSortFromTo ( from , to , min , max ) ; } else { quickSortFromTo ( from , to ) ; } }
Safe access to the digest stored in a Hash
470
public HaskellCatalog ( ) { this ( HaskellCatalog . XML_PATH ) ; }
TODO: Think of a better way to do CheckerProps, it's weird to have some params built in TODO: and some as MISC_OPTIONS
471
public ClassFactory ( File dir , ClassLoader parent ) { super ( parent ) ; this . output = dir ; dir . mkdirs ( ) ; }
Simulates a sample with the given sample size.
472
static boolean isSameColumn ( ConstraintWidget a , ConstraintWidget b ) { return Math . max ( a . getX ( ) , b . getX ( ) ) < Math . min ( a . getX ( ) + a . getWidth ( ) , b . getX ( ) + b . getWidth ( ) ) ; }
draws the grid background
473
Remover add ( T listener ) ;
Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
474
public boolean isExistingCommand ( ) { return ( ! name . equals ( CommandTagHandle . CMD_UNKNOWN ) ) ; }
Stop config fetching daemon.
475
@ SuppressWarnings ( "deprecation" ) protected void stopClassifier ( ) { if ( m_RunThread != null ) { m_RunThread . interrupt ( ) ; m_RunThread . stop ( ) ; } }
Creates an ImageIcon from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded state of the image. The icon's description is initialized to be a string representation of the URL.
476
private void sleep ( long sleeptime ) { try { Thread . sleep ( sleeptime ) ; } catch ( InterruptedException e ) { } }
Parses end of the tag. It expects that current position is at the "<" after which "/" and the tag's name follows.
477
protected void buildPanels ( ) { keyPanels . clear ( ) ; inScrollPane . removeAll ( ) ; for ( String key : order ) { String name = names . get ( key ) ; if ( name != null ) { String value = values . getProperty ( key ) ; KeyPanel keyPanel = new KeyPanel ( name , value ) ; keyPanel . setAlignmentX ( LEFT_ALIGNMENT ) ; keyPanel . setMaximumSize ( guiSize ) ; inScrollPane . add ( keyPanel ) ; keyPanels . put ( key , keyPanel ) ; } else { SpecialSetting special = specials . get ( key ) ; special . setAlignmentX ( LEFT_ALIGNMENT ) ; inScrollPane . add ( special ) ; } } }
Modified Bessel Functions of First Kind - Order 1.
478
public void loadDataStringFromFile ( String sFilename , boolean clearCurrentData , String sEncoding ) { try { ByteArrayOutputStream bsOut = new ByteArrayOutputStream ( ) ; FileInputStream fiIn = new FileInputStream ( sFilename ) ; int iData = 0 ; while ( ( iData = fiIn . read ( ) ) > - 1 ) bsOut . write ( iData ) ; String sDataString = bsOut . toString ( ) ; setDataString ( sDataString , SourceNGramSize , clearCurrentData ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; setDataString ( "" , 1 , false ) ; } }
Watches all contents in the specified theme for changes and reloads the theme if a change is detected.
479
public final char nextChar ( CharSequence csq ) { return csq . charAt ( index ++ ) ; }
Count substring occurrences in a source string, ignoring case.
480
private long dragStartedAgo ( ) { if ( dragStarted == 0 ) { return - 1 ; } return System . currentTimeMillis ( ) - dragStarted ; }
Reads next 16-bit value, LSB first
481
protected static double regularizedIncBetaCF ( double alpha , double beta , double x ) { final double FPMIN = Double . MIN_VALUE / NUM_PRECISION ; double qab = alpha + beta ; double qap = alpha + 1.0 ; double qam = alpha - 1.0 ; double c = 1.0 ; double d = 1.0 - qab * x / qap ; if ( Math . abs ( d ) < FPMIN ) { d = FPMIN ; } d = 1.0 / d ; double h = d ; for ( int m = 1 ; m < 10000 ; m ++ ) { int m2 = 2 * m ; double aa = m * ( beta - m ) * x / ( ( qam + m2 ) * ( alpha + m2 ) ) ; d = 1.0 + aa * d ; if ( Math . abs ( d ) < FPMIN ) { d = FPMIN ; } c = 1.0 + aa / c ; if ( Math . abs ( c ) < FPMIN ) { c = FPMIN ; } d = 1.0 / d ; h *= d * c ; aa = - ( alpha + m ) * ( qab + m ) * x / ( ( alpha + m2 ) * ( qap + m2 ) ) ; d = 1.0 + aa * d ; if ( Math . abs ( d ) < FPMIN ) { d = FPMIN ; } c = 1.0 + aa / c ; if ( Math . abs ( c ) < FPMIN ) { c = FPMIN ; } d = 1.0 / d ; double del = d * c ; h *= del ; if ( Math . abs ( del - 1.0 ) <= NUM_PRECISION ) { break ; } } return h ; }
Compare source line annotations.
482
public DateTimeZoneBuilder addCutover ( int year , char mode , int monthOfYear , int dayOfMonth , int dayOfWeek , boolean advanceDayOfWeek , int millisOfDay ) { if ( iRuleSets . size ( ) > 0 ) { OfYear ofYear = new OfYear ( mode , monthOfYear , dayOfMonth , dayOfWeek , advanceDayOfWeek , millisOfDay ) ; RuleSet lastRuleSet = iRuleSets . get ( iRuleSets . size ( ) - 1 ) ; lastRuleSet . setUpperLimit ( year , ofYear ) ; } iRuleSets . add ( new RuleSet ( ) ) ; return this ; }
Reads an input stream into a list of byte values.
483
private boolean isNullSetting ( boolean makeDest , MappingType mtd , MappingType mts , StringBuilder result ) { if ( makeDest && ( mtd == ALL_FIELDS || mtd == ONLY_VALUED_FIELDS ) && mts == ONLY_NULL_FIELDS ) { result . append ( " " + stringOfSetDestination + "(null);" + newLine ) ; return true ; } return false ; }
Initializes the runtime environment using the provied input
484
protected void findAndInit ( Iterator it ) { while ( it . hasNext ( ) ) { findAndInit ( it . next ( ) ) ; } }
Converts a point in pixel space to a point in physics space.
485
private boolean shouldEmitTypedefByName ( JSType realType ) { return realType . isRecordType ( ) || realType . isTemplatizedType ( ) || realType . isFunctionType ( ) ; }
Look up a word in the FST. This method is thread-safe.
486
private synchronized void manageMenu ( ) { if ( ( game != null ) || ( hasBoard && ( null == client ) ) ) { fileGameNew . setEnabled ( false ) ; fileGameOpen . setEnabled ( false ) ; fileGameScenario . setEnabled ( false ) ; fileGameConnectBot . setEnabled ( false ) ; fileGameConnect . setEnabled ( false ) ; replacePlayer . setEnabled ( false ) ; if ( ( phase != IGame . Phase . PHASE_UNKNOWN ) && ( phase != IGame . Phase . PHASE_LOUNGE ) && ( phase != IGame . Phase . PHASE_SELECTION ) && ( phase != IGame . Phase . PHASE_EXCHANGE ) && ( phase != IGame . Phase . PHASE_VICTORY ) && ( phase != IGame . Phase . PHASE_STARTING_SCENARIO ) ) { fileGameSave . setEnabled ( true ) ; fileGameSaveServer . setEnabled ( true ) ; replacePlayer . setEnabled ( true ) ; } else { fileGameSave . setEnabled ( false ) ; fileGameSaveServer . setEnabled ( false ) ; replacePlayer . setEnabled ( false ) ; } } else { fileGameNew . setEnabled ( true ) ; fileGameOpen . setEnabled ( true ) ; fileGameSave . setEnabled ( false ) ; fileGameSaveServer . setEnabled ( false ) ; fileGameScenario . setEnabled ( true ) ; fileGameConnectBot . setEnabled ( true ) ; fileGameConnect . setEnabled ( true ) ; replacePlayer . setEnabled ( true ) ; } if ( game != null ) { viewGameOptions . setEnabled ( true ) ; viewPlayerSettings . setEnabled ( true ) ; } else { viewGameOptions . setEnabled ( false ) ; viewPlayerSettings . setEnabled ( false ) ; } filePrint . setEnabled ( false ) ; if ( client != null ) { fileBoardNew . setEnabled ( false ) ; fileBoardOpen . setEnabled ( false ) ; fileBoardSave . setEnabled ( false ) ; fileBoardSaveAs . setEnabled ( false ) ; fileBoardSaveAsImage . setEnabled ( false ) ; } else { fileBoardNew . setEnabled ( true ) ; fileBoardOpen . setEnabled ( true ) ; fileBoardSave . setEnabled ( false ) ; fileBoardSaveAs . setEnabled ( false ) ; fileBoardSaveAsImage . setEnabled ( false ) ; } if ( hasBoard ) { fileBoardSave . setEnabled ( true ) ; fileBoardSaveAs . setEnabled ( true ) ; fileBoardSaveAsImage . setEnabled ( true ) ; viewMiniMap . setEnabled ( true ) ; viewZoomIn . setEnabled ( true ) ; viewZoomOut . setEnabled ( true ) ; } else { fileBoardSave . setEnabled ( false ) ; fileBoardSaveAs . setEnabled ( false ) ; fileBoardSaveAsImage . setEnabled ( false ) ; viewMiniMap . setEnabled ( false ) ; viewZoomIn . setEnabled ( false ) ; viewZoomOut . setEnabled ( false ) ; } if ( hasUnitList ) { fileUnitsOpen . setEnabled ( phase == IGame . Phase . PHASE_LOUNGE ) ; fileUnitsClear . setEnabled ( phase == IGame . Phase . PHASE_LOUNGE ) ; } else { fileUnitsOpen . setEnabled ( phase == IGame . Phase . PHASE_LOUNGE ) ; fileUnitsClear . setEnabled ( false ) ; } fileUnitsReinforce . setEnabled ( phase != IGame . Phase . PHASE_LOUNGE ) ; fileUnitsReinforceRAT . setEnabled ( phase != IGame . Phase . PHASE_LOUNGE ) ; if ( entity != null ) { viewMekDisplay . setEnabled ( true ) ; } else { viewMekDisplay . setEnabled ( false ) ; } if ( ( client == null ) && hasBoard ) { viewLOSSetting . setEnabled ( false ) ; viewUnitOverview . setEnabled ( false ) ; viewPlayerList . setEnabled ( false ) ; } else if ( ( phase == IGame . Phase . PHASE_SET_ARTYAUTOHITHEXES ) || ( phase == IGame . Phase . PHASE_DEPLOY_MINEFIELDS ) || ( phase == IGame . Phase . PHASE_MOVEMENT ) || ( phase == IGame . Phase . PHASE_FIRING ) || ( phase == IGame . Phase . PHASE_PHYSICAL ) || ( phase == IGame . Phase . PHASE_OFFBOARD ) || ( phase == IGame . Phase . PHASE_TARGETING ) || ( phase == IGame . Phase . PHASE_DEPLOYMENT ) ) { viewLOSSetting . setEnabled ( true ) ; viewMiniMap . setEnabled ( true ) ; viewZoomIn . setEnabled ( true ) ; viewZoomOut . setEnabled ( true ) ; viewUnitOverview . setEnabled ( true ) ; viewPlayerList . setEnabled ( true ) ; } else { viewLOSSetting . setEnabled ( false ) ; viewMiniMap . setEnabled ( false ) ; viewZoomIn . setEnabled ( false ) ; viewZoomOut . setEnabled ( false ) ; viewUnitOverview . setEnabled ( false ) ; viewPlayerList . setEnabled ( false ) ; } if ( ( phase == IGame . Phase . PHASE_INITIATIVE ) || ( phase == IGame . Phase . PHASE_MOVEMENT ) || ( phase == IGame . Phase . PHASE_FIRING ) || ( phase == IGame . Phase . PHASE_PHYSICAL ) || ( phase == IGame . Phase . PHASE_OFFBOARD ) || ( phase == IGame . Phase . PHASE_TARGETING ) || ( phase == IGame . Phase . PHASE_END ) || ( phase == IGame . Phase . PHASE_DEPLOYMENT ) ) { viewRoundReport . setEnabled ( true ) ; } else { viewRoundReport . setEnabled ( false ) ; } viewClientSettings . setEnabled ( true ) ; if ( ( phase != IGame . Phase . PHASE_FIRING ) || ( entity == null ) ) { fireCancel . setEnabled ( false ) ; } else { fireCancel . setEnabled ( true ) ; } updateSaveWeaponOrderMenuItem ( ) ; }
Tests whether header and footer should be included in output
487
public static Node selectSingleNode ( Node contextNode , String str , Node namespaceNode ) throws TransformerException { NodeIterator nl = selectNodeIterator ( contextNode , str , namespaceNode ) ; return nl . nextNode ( ) ; }
Convert the specified CharSequence to an input stream, encoded as bytes using the specified character encoding.
488
public static Array listToArrayTrim ( String list , String delimiter , int [ ] info ) { if ( delimiter . length ( ) == 1 ) return listToArrayTrim ( list , delimiter . charAt ( 0 ) , info ) ; if ( list . length ( ) == 0 ) return new ArrayImpl ( ) ; char [ ] del = delimiter . toCharArray ( ) ; char c ; outer : while ( list . length ( ) > 0 ) { c = list . charAt ( 0 ) ; for ( int i = 0 ; i < del . length ; i ++ ) { if ( c == del [ i ] ) { info [ 0 ] ++ ; list = list . substring ( 1 ) ; continue outer ; } } break ; } int len ; outer : while ( list . length ( ) > 0 ) { c = list . charAt ( list . length ( ) - 1 ) ; for ( int i = 0 ; i < del . length ; i ++ ) { if ( c == del [ i ] ) { info [ 1 ] ++ ; len = list . length ( ) ; list = list . substring ( 0 , len - 1 < 0 ? 0 : len - 1 ) ; continue outer ; } } break ; } return listToArray ( list , delimiter ) ; }
Create a new predicate returning true when the input String contains the given pattern.
489
public BigInteger calculateClientEvidenceMessage ( ) throws CryptoException { if ( ( this . A == null ) || ( this . B == null ) || ( this . S == null ) ) { throw new CryptoException ( "Impossible to compute M1: " + "some data are missing from the previous operations (A,B,S)" ) ; } this . M1 = SRP6Util . calculateM1 ( digest , N , A , B , S ) ; return M1 ; }
Received some bytes from the data socket, which is assumed to already be connected. The bytes are placed in the given array, and the number of bytes successfully read is returned.
490
public void testCase6 ( ) { byte aBytes [ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70 , 10 , 20 , 30 } ; byte bBytes [ ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2 , 3 , 1 , 2 , 3 , 4 , 5 } ; int aSign = 1 ; int bSign = - 1 ; byte rBytes [ ] = { - 11 , - 41 , - 101 , 54 , - 97 , - 52 , - 77 , - 41 , 44 , - 86 , - 116 , - 45 , 126 , - 116 , 20 , 61 , 14 , - 86 , - 65 , 86 , 1 , 35 , 35 , 106 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger bNumber = new BigInteger ( bSign , bBytes ) ; BigInteger result = aNumber . multiply ( bNumber ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = result . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , - 1 , result . signum ( ) ) ; }
Return the current size of the byte array.
491
private static Field findAccessibleField ( Class clas , String fieldName ) throws UtilEvalError , NoSuchFieldException { Field field ; try { field = clas . getField ( fieldName ) ; ReflectManager . RMSetAccessible ( field ) ; return field ; } catch ( NoSuchFieldException e ) { } while ( clas != null ) { try { field = clas . getDeclaredField ( fieldName ) ; ReflectManager . RMSetAccessible ( field ) ; return field ; } catch ( NoSuchFieldException e ) { } clas = clas . getSuperclass ( ) ; } throw new NoSuchFieldException ( fieldName ) ; }
Adds a special "marked occurrence" highlight.
492
public void removeArguments ( String label ) { List < PBArgument > remove = new ArrayList < > ( ) ; for ( PBArgument arg : l_arguments ) { if ( arg . isLabel ( label ) ) remove . add ( arg ) ; } l_arguments . removeAll ( remove ) ; }
Rules for the given permission, or the empty list.
493
public POSMikheevFeatureExtractor ( String viewName , String json ) { this . viewName = viewName ; this . counter = POSMikheevCounter . read ( json ) ; }
Creates and initializes a BatchInterrupted object.
494
public static boolean endsWithIgnoreCase ( String src , String subS ) { String sub = subS . toLowerCase ( ) ; int sublen = sub . length ( ) ; int j = 0 ; int i = src . length ( ) - sublen ; if ( i < 0 ) { return false ; } while ( j < sublen ) { char source = Character . toLowerCase ( src . charAt ( i ) ) ; if ( sub . charAt ( j ) != source ) { return false ; } j ++ ; i ++ ; } return true ; }
Convert Calendar to MM/dd/yyyy format.
495
private void prefixSearch ( String query ) { m_curNode = m_trie . find ( query ) ; if ( m_curNode != null ) { Iterator iter = trieIterator ( ) ; while ( iter . hasNext ( ) ) addInternal ( ( Tuple ) iter . next ( ) ) ; } }
Return the inner product of x and y (x.length == y.length assumed)
496
private void sendStageProgressPatch ( com . vmware . xenon . common . TaskState . TaskStage stage ) { ServiceUtils . logInfo ( this , "sendStageProgressPatch %s" , stage ) ; TaskUtils . sendSelfPatch ( this , buildPatch ( stage , null ) ) ; }
Toggles various rendering flags
497
@ Nullable protected abstract Object extractParameter ( @ Nullable String cacheName , String typeName , TypeKind typeKind , String fieldName , Object obj ) throws CacheException ;
Logger all information about the received OobResponse of an RPC call.
498
public static boolean isViewableValue ( Object value ) { if ( value instanceof CompositeData || value instanceof TabularData ) { return true ; } if ( value instanceof CompositeData [ ] || value instanceof TabularData [ ] ) { return Array . getLength ( value ) > 0 ; } if ( value instanceof Collection ) { Collection < ? > c = ( Collection < ? > ) value ; if ( c . isEmpty ( ) ) { return false ; } else { return Utils . isUniformCollection ( c , CompositeData . class ) || Utils . isUniformCollection ( c , TabularData . class ) ; } } return false ; }
tries to remove the child frame, it returns true if it could do such.
499
static OCSPResponse check ( List < CertId > certIds , URI responderURI , X509Certificate issuerCert , X509Certificate responderCert , Date date , List < Extension > extensions ) throws IOException , CertPathValidatorException { byte [ ] bytes = null ; OCSPRequest request = null ; try { request = new OCSPRequest ( certIds , extensions ) ; bytes = request . encodeBytes ( ) ; } catch ( IOException ioe ) { throw new CertPathValidatorException ( "Exception while encoding OCSPRequest" , ioe ) ; } InputStream in = null ; OutputStream out = null ; byte [ ] response = null ; try { URL url = responderURI . toURL ( ) ; if ( debug != null ) { debug . println ( "connecting to OCSP service at: " + url ) ; } HttpURLConnection con = ( HttpURLConnection ) url . openConnection ( ) ; con . setConnectTimeout ( CONNECT_TIMEOUT ) ; con . setReadTimeout ( CONNECT_TIMEOUT ) ; con . setDoOutput ( true ) ; con . setDoInput ( true ) ; con . setRequestMethod ( "POST" ) ; con . setRequestProperty ( "Content-type" , "application/ocsp-request" ) ; con . setRequestProperty ( "Content-length" , String . valueOf ( bytes . length ) ) ; out = con . getOutputStream ( ) ; out . write ( bytes ) ; out . flush ( ) ; if ( debug != null && con . getResponseCode ( ) != HttpURLConnection . HTTP_OK ) { debug . println ( "Received HTTP error: " + con . getResponseCode ( ) + " - " + con . getResponseMessage ( ) ) ; } in = con . getInputStream ( ) ; int contentLength = con . getContentLength ( ) ; if ( contentLength == - 1 ) { contentLength = Integer . MAX_VALUE ; } response = new byte [ contentLength > 2048 ? 2048 : contentLength ] ; int total = 0 ; while ( total < contentLength ) { int count = in . read ( response , total , response . length - total ) ; if ( count < 0 ) break ; total += count ; if ( total >= response . length && total < contentLength ) { response = Arrays . copyOf ( response , total * 2 ) ; } } response = Arrays . copyOf ( response , total ) ; } catch ( IOException ioe ) { throw new CertPathValidatorException ( "Unable to determine revocation status due to network error" , ioe , null , - 1 , BasicReason . UNDETERMINED_REVOCATION_STATUS ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IOException ioe ) { throw ioe ; } } if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioe ) { throw ioe ; } } } OCSPResponse ocspResponse = null ; try { ocspResponse = new OCSPResponse ( response ) ; } catch ( IOException ioe ) { throw new CertPathValidatorException ( ioe ) ; } ocspResponse . verify ( certIds , issuerCert , responderCert , date , request . getNonce ( ) ) ; return ocspResponse ; }
Computes the result for one date and two string input values.