idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
26,800
public boolean visit ( FieldDeclaration node ) { if ( isSerializationField ( node . getFragment ( 0 ) . getVariableElement ( ) ) ) { node . remove ( ) ; } return false ; }
Removes serialVersionUID field .
26,801
public boolean visit ( MethodDeclaration node ) { if ( isSerializationMethod ( node . getExecutableElement ( ) ) ) { node . remove ( ) ; } return false ; }
Removes serialization related methods .
26,802
static int adjustConfidence ( int codeUnit , int confidence ) { if ( codeUnit == 0 ) { confidence -= 10 ; } else if ( ( codeUnit >= 0x20 && codeUnit <= 0xff ) || codeUnit == 0x0a ) { confidence += 10 ; } if ( confidence < 0 ) { confidence = 0 ; } else if ( confidence > 100 ) { confidence = 100 ; } return confidence ; }
NULs should be rare in actual text .
26,803
public static ScientificNumberFormatter getMarkupInstance ( ULocale locale , String beginMarkup , String endMarkup ) { return getInstanceForLocale ( locale , new MarkupStyle ( beginMarkup , endMarkup ) ) ; }
Gets a ScientificNumberFormatter instance that uses markup for exponents for this locale .
26,804
public static ScientificNumberFormatter getMarkupInstance ( DecimalFormat df , String beginMarkup , String endMarkup ) { return getInstance ( df , new MarkupStyle ( beginMarkup , endMarkup ) ) ; }
Gets a ScientificNumberFormatter instance that uses markup for exponents .
26,805
public String format ( Object number ) { synchronized ( fmt ) { return style . format ( fmt . formatToCharacterIterator ( number ) , preExponent ) ; } }
Formats a number
26,806
public String getHeaderFieldKey ( int n ) { try { getInputStream ( ) ; } catch ( Exception e ) { return null ; } MessageHeader props = properties ; return props == null ? null : props . getKey ( n ) ; }
Return the key for the nth header field . Returns null if there are fewer than n fields . This can be used to iterate through all the headers in the message .
26,807
public String getHeaderField ( int n ) { try { getInputStream ( ) ; } catch ( Exception e ) { return null ; } MessageHeader props = properties ; return props == null ? null : props . getValue ( n ) ; }
Return the value for the nth header field . Returns null if there are fewer than n fields . This can be used in conjunction with getHeaderFieldKey to iterate through all the headers in the message .
26,808
public String getContentType ( ) { if ( contentType == null ) contentType = getHeaderField ( "content-type" ) ; if ( contentType == null ) { String ct = null ; try { ct = guessContentTypeFromStream ( getInputStream ( ) ) ; } catch ( java . io . IOException e ) { } String ce = properties . findValue ( "content-encoding"...
Call this routine to get the content - type associated with this object .
26,809
public int getContentLength ( ) { try { getInputStream ( ) ; } catch ( Exception e ) { return - 1 ; } int l = contentLength ; if ( l < 0 ) { try { l = Integer . parseInt ( properties . findValue ( "content-length" ) ) ; setContentLength ( l ) ; } catch ( Exception e ) { } } return l ; }
Call this routine to get the content - length associated with this object .
26,810
public String getHeaderField ( String key ) { try { getResponse ( ) ; return getHeaderFieldDoNotForceResponse ( key ) ; } catch ( IOException e ) { return null ; } }
Returns the value of the named header field .
26,811
private void loadRequestCookies ( ) throws IOException { CookieHandler cookieHandler = CookieHandler . getDefault ( ) ; if ( cookieHandler != null ) { try { URI uri = getURL ( ) . toURI ( ) ; Map < String , List < String > > cookieHeaders = cookieHandler . get ( uri , getHeaderFieldsDoNotForceResponse ( ) ) ; for ( Map...
Add any cookies for this URI to the request headers .
26,812
private void saveResponseCookies ( ) throws IOException { CookieHandler cookieHandler = CookieHandler . getDefault ( ) ; if ( cookieHandler != null ) { try { URI uri = getURL ( ) . toURI ( ) ; cookieHandler . put ( uri , getHeaderFieldsDoNotForceResponse ( ) ) ; } catch ( URISyntaxException e ) { throw new IOException ...
Store any returned cookies .
26,813
static IOException secureConnectionException ( String description ) { try { Class < ? > sslExceptionClass = Class . forName ( "javax.net.ssl.SSLException" ) ; Constructor < ? > constructor = sslExceptionClass . getConstructor ( String . class ) ; return ( IOException ) constructor . newInstance ( description ) ; } catc...
Returns an SSLException if that class is linked into the application otherwise IOException .
26,814
public String getSystemId ( ) { Stylesheet sheet = getStylesheet ( ) ; return ( sheet == null ) ? null : sheet . getHref ( ) ; }
Return the system identifier for the current document event .
26,815
public void setPrefixes ( NamespaceSupport nsSupport , boolean excludeXSLDecl ) throws TransformerException { Enumeration decls = nsSupport . getDeclaredPrefixes ( ) ; while ( decls . hasMoreElements ( ) ) { String prefix = ( String ) decls . nextElement ( ) ; if ( null == m_declaredPrefixes ) m_declaredPrefixes = new ...
Copy the namespace declarations from the NamespaceSupport object . Take care to call resolveInheritedNamespaceDecls . after all namespace declarations have been added .
26,816
public String getNamespaceForPrefix ( String prefix , org . w3c . dom . Node context ) { this . error ( XSLTErrorResources . ER_CANT_RESOLVE_NSPREFIX , null ) ; return null ; }
Fullfill the PrefixResolver interface . Calling this for this class will throw an error .
26,817
void addOrReplaceDecls ( XMLNSDecl newDecl ) { int n = m_prefixTable . size ( ) ; for ( int i = n - 1 ; i >= 0 ; i -- ) { XMLNSDecl decl = ( XMLNSDecl ) m_prefixTable . get ( i ) ; if ( decl . getPrefix ( ) . equals ( newDecl . getPrefix ( ) ) ) { return ; } } m_prefixTable . add ( newDecl ) ; }
Add or replace this namespace declaration in list of namespaces in scope for this element .
26,818
void unexecuteNSDecls ( TransformerImpl transformer , String ignorePrefix ) throws TransformerException { try { if ( null != m_prefixTable ) { SerializationHandler rhandler = transformer . getResultTreeHandler ( ) ; int n = m_prefixTable . size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { XMLNSDecl decl = ( XMLNSDecl ) m_p...
Send endPrefixMapping events to the result tree handler for all declared prefix mappings in the stylesheet .
26,819
public final String pop ( ) { if ( m_firstFree <= 0 ) return null ; m_firstFree -- ; String s = m_map [ m_firstFree ] ; m_map [ m_firstFree ] = null ; return s ; }
Pop the tail of this vector .
26,820
public static JavaTimeZone createTimeZone ( String id ) { java . util . TimeZone jtz = null ; if ( AVAILABLESET . contains ( id ) ) { jtz = java . util . TimeZone . getTimeZone ( id ) ; } if ( jtz == null ) { boolean [ ] isSystemID = new boolean [ 1 ] ; String canonicalID = TimeZone . getCanonicalID ( id , isSystemID )...
Creates an instance of JavaTimeZone with the given timezone ID .
26,821
public String reindent ( String code ) { try { StringBuilder sb = new StringBuilder ( ) ; LineReader lr = new LineReader ( new StringReader ( code ) ) ; String line = lr . readLine ( ) ; while ( line != null ) { sb . append ( line . trim ( ) ) ; line = lr . readLine ( ) ; if ( line != null ) { sb . append ( '\n' ) ; } ...
Fix line indention based on brace count .
26,822
public byte [ ] getContentBytes ( ) throws IOException { if ( content == null ) return null ; DerInputStream dis = new DerInputStream ( content . toByteArray ( ) ) ; return dis . getOctetString ( ) ; }
Returns a byte array representation of the data held in the content field .
26,823
Logger demandLogger ( String name , String resourceBundleName , Class < ? > caller ) { Logger result = getLogger ( name ) ; if ( result == null ) { Logger newLogger = new Logger ( name , resourceBundleName , caller ) ; do { if ( addLogger ( newLogger ) ) { return newLogger ; } result = getLogger ( name ) ; } while ( re...
readConfiguration and other methods .
26,824
private void loadLoggerHandlers ( final Logger logger , final String name , final String handlersPropertyName ) { String names [ ] = parseClassNames ( handlersPropertyName ) ; for ( int i = 0 ; i < names . length ; i ++ ) { String word = names [ i ] ; try { Class clz = getClassInstance ( word ) ; Handler hdl = ( Handle...
only be modified by trusted code .
26,825
private void resetLogger ( Logger logger ) { Handler [ ] targets = logger . getHandlers ( ) ; for ( int i = 0 ; i < targets . length ; i ++ ) { Handler h = targets [ i ] ; logger . removeHandler ( h ) ; try { h . close ( ) ; } catch ( Exception ex ) { } } String name = logger . getName ( ) ; if ( name != null && name ....
Private method to reset an individual target logger .
26,826
private String [ ] parseClassNames ( String propertyName ) { String hands = getProperty ( propertyName ) ; if ( hands == null ) { return new String [ 0 ] ; } hands = hands . trim ( ) ; int ix = 0 ; Vector < String > result = new Vector < > ( ) ; while ( ix < hands . length ( ) ) { int end = ix ; while ( end < hands . l...
get a list of whitespace separated classnames from a property .
26,827
public String getProperty ( String name ) { Object oval = props . get ( name ) ; String sval = ( oval instanceof String ) ? ( String ) oval : null ; return sval ; }
Get the value of a logging property . The method returns null if the property is not found .
26,828
String getStringProperty ( String name , String defaultValue ) { String val = getProperty ( name ) ; if ( val == null ) { return defaultValue ; } return val . trim ( ) ; }
default value .
26,829
synchronized private void setLevelsOnExistingLoggers ( ) { Enumeration < ? > enm = props . keys ( ) ; while ( enm . hasMoreElements ( ) ) { String key = ( String ) enm . nextElement ( ) ; if ( ! key . endsWith ( ".level" ) ) { continue ; } int ix = key . length ( ) - 6 ; String name = key . substring ( 0 , ix ) ; Level...
changed to apply any level settings to any pre - existing loggers .
26,830
private void reflectionStrippedProcessing ( ) { HashMap < Object , Object > newEntries = new HashMap < > ( ) ; for ( Map . Entry < Object , Object > entry : props . entrySet ( ) ) { String key = ( String ) entry . getKey ( ) ; int index = key . lastIndexOf ( '.' ) ; if ( index == - 1 || index == 0 || index == key . len...
JavaIoFileOutputStream . level instead of java . io . FileOutputStream . level ) .
26,831
private static BigInteger toUnsignedBigInteger ( long i ) { if ( i >= 0L ) return BigInteger . valueOf ( i ) ; else { int upper = ( int ) ( i >>> 32 ) ; int lower = ( int ) i ; return ( BigInteger . valueOf ( Integer . toUnsignedLong ( upper ) ) ) . shiftLeft ( 32 ) . add ( BigInteger . valueOf ( Integer . toUnsignedLo...
Return a BigInteger equal to the unsigned value of the argument .
26,832
public static long divideUnsigned ( long dividend , long divisor ) { if ( divisor < 0L ) { return ( compareUnsigned ( dividend , divisor ) ) < 0 ? 0L : 1L ; } if ( dividend > 0 ) return dividend / divisor ; else { return toUnsignedBigInteger ( dividend ) . divide ( toUnsignedBigInteger ( divisor ) ) . longValue ( ) ; }...
Returns the unsigned quotient of dividing the first argument by the second where each argument and the result is interpreted as an unsigned value .
26,833
public static long remainderUnsigned ( long dividend , long divisor ) { if ( dividend > 0 && divisor > 0 ) { return dividend % divisor ; } else { if ( compareUnsigned ( dividend , divisor ) < 0 ) return dividend ; else return toUnsignedBigInteger ( dividend ) . remainder ( toUnsignedBigInteger ( divisor ) ) . longValue...
Returns the unsigned remainder from dividing the first argument by the second where each argument and the result is interpreted as an unsigned value .
26,834
public DTMIterator sortNodes ( XPathContext xctxt , Vector keys , DTMIterator sourceNodes ) throws TransformerException { NodeSorter sorter = new NodeSorter ( xctxt ) ; sourceNodes . setShouldCacheNodes ( true ) ; sourceNodes . runTo ( - 1 ) ; xctxt . pushContextNodeList ( sourceNodes ) ; try { sorter . sort ( sourceNo...
Sort given nodes
26,835
public Factory registerObject ( Object obj , ULocale locale , int kind , boolean visible ) { Factory factory = new SimpleLocaleKeyFactory ( obj , locale , kind , visible ) ; return registerFactory ( factory ) ; }
Convenience function for callers using locales . This instantiates a SimpleLocaleKeyFactory and registers the factory .
26,836
public Locale [ ] getAvailableLocales ( ) { Set < String > visIDs = getVisibleIDs ( ) ; Locale [ ] locales = new Locale [ visIDs . size ( ) ] ; int n = 0 ; for ( String id : visIDs ) { Locale loc = LocaleUtility . getLocaleFromName ( id ) ; locales [ n ++ ] = loc ; } return locales ; }
Convenience method for callers using locales . This returns the standard Locale list built from the Set of visible ids .
26,837
public ULocale [ ] getAvailableULocales ( ) { Set < String > visIDs = getVisibleIDs ( ) ; ULocale [ ] locales = new ULocale [ visIDs . size ( ) ] ; int n = 0 ; for ( String id : visIDs ) { locales [ n ++ ] = new ULocale ( id ) ; } return locales ; }
Convenience method for callers using locales . This returns the standard ULocale list built from the Set of visible ids .
26,838
public String validateFallbackLocale ( ) { ULocale loc = ULocale . getDefault ( ) ; if ( loc != fallbackLocale ) { synchronized ( this ) { if ( loc != fallbackLocale ) { fallbackLocale = loc ; fallbackLocaleName = loc . getBaseName ( ) ; clearServiceCache ( ) ; } } } return fallbackLocaleName ; }
Return the name of the current fallback locale . If it has changed since this was last accessed the service cache is cleared .
26,839
public void setIP ( byte [ ] ip ) { buffer [ INDEX_IP ] = ip [ 0 ] ; buffer [ INDEX_IP + 1 ] = ip [ 1 ] ; buffer [ INDEX_IP + 2 ] = ip [ 2 ] ; buffer [ INDEX_IP + 3 ] = ip [ 3 ] ; }
Set the IP address . This expects an array of four bytes in host order .
26,840
private String getString ( int offset , int maxLength ) { int index = offset ; int lastIndex = index + maxLength ; while ( index < lastIndex && ( buffer [ index ] != 0 ) ) { index ++ ; } return new String ( buffer , offset , index - offset , StandardCharsets . ISO_8859_1 ) ; }
Get a String from the buffer at the offset given . The method reads until it encounters a null value or reaches the maxLength given .
26,841
private void setString ( int offset , int maxLength , String theString ) { byte [ ] stringBytes = theString . getBytes ( StandardCharsets . ISO_8859_1 ) ; int length = Math . min ( stringBytes . length , maxLength ) ; System . arraycopy ( stringBytes , 0 , buffer , offset , length ) ; buffer [ offset + length ] = 0 ; }
Put a string into the buffer at the offset given .
26,842
public void flush ( ) throws IOException { if ( obuffer != null ) { output . write ( obuffer ) ; obuffer = null ; } output . flush ( ) ; }
Flushes this output stream by forcing any buffered output bytes that have already been processed by the encapsulated cipher object to be written out .
26,843
public final SelectableChannel configureBlocking ( boolean block ) throws IOException { synchronized ( regLock ) { if ( ! isOpen ( ) ) throw new ClosedChannelException ( ) ; if ( blocking == block ) return this ; if ( block && haveValidKeys ( ) ) throw new IllegalBlockingModeException ( ) ; implConfigureBlocking ( bloc...
Adjusts this channel s blocking mode .
26,844
public TextTrieMap < V > put ( CharSequence text , V val ) { CharIterator chitr = new CharIterator ( text , 0 , _ignoreCase ) ; _root . add ( chitr , val ) ; return this ; }
Adds the text key and its associated object in this object .
26,845
public Iterator < V > get ( CharSequence text , int start ) { return get ( text , start , null ) ; }
Gets an iterator of the objects associated with the longest prefix matching string key starting at the specified position .
26,846
public UnicodeSet getExemplarSet ( int options , int extype ) { String [ ] exemplarSetTypes = { "ExemplarCharacters" , "AuxExemplarCharacters" , "ExemplarCharactersIndex" , "ExemplarCharactersCurrency" , "ExemplarCharactersPunctuation" } ; if ( extype == ES_CURRENCY ) { return noSubstitute ? null : UnicodeSet . EMPTY ;...
Returns the set of exemplar characters for a locale .
26,847
public static final LocaleData getInstance ( ULocale locale ) { LocaleData ld = new LocaleData ( ) ; ld . bundle = ( ICUResourceBundle ) UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , locale ) ; ld . langBundle = ( ICUResourceBundle ) UResourceBundle . getBundleInstance ( ICUData . ICU_LANG_BASE_NAME ,...
Gets the LocaleData object associated with the ULocale specified in locale
26,848
public String getDelimiter ( int type ) { ICUResourceBundle delimitersBundle = ( ICUResourceBundle ) bundle . get ( "delimiters" ) ; ICUResourceBundle stringBundle = delimitersBundle . getWithFallback ( DELIMITER_TYPES [ type ] ) ; if ( noSubstitute && ! bundle . isRoot ( ) && stringBundle . isRoot ( ) ) { return null ...
Retrieves a delimiter string from the locale data .
26,849
private static UResourceBundle measurementTypeBundleForLocale ( ULocale locale , String measurementType ) { UResourceBundle measTypeBundle = null ; String region = ULocale . getRegionForSupplementalData ( locale , true ) ; try { UResourceBundle rb = UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , "suppl...
Utility for getMeasurementSystem and getPaperSize
26,850
public static final MeasurementSystem getMeasurementSystem ( ULocale locale ) { UResourceBundle sysBundle = measurementTypeBundleForLocale ( locale , MEASUREMENT_SYSTEM ) ; switch ( sysBundle . getInt ( ) ) { case 0 : return MeasurementSystem . SI ; case 1 : return MeasurementSystem . US ; case 2 : return MeasurementSy...
Returns the measurement system used in the locale specified by the locale .
26,851
public String getLocaleSeparator ( ) { String sub0 = "{0}" ; String sub1 = "{1}" ; ICUResourceBundle locDispBundle = ( ICUResourceBundle ) langBundle . get ( LOCALE_DISPLAY_PATTERN ) ; String localeSeparator = locDispBundle . getStringWithFallback ( SEPARATOR ) ; int index0 = localeSeparator . indexOf ( sub0 ) ; int in...
Returns LocaleDisplaySeparator for this locale .
26,852
public static VersionInfo getCLDRVersion ( ) { if ( gCLDRVersion == null ) { UResourceBundle supplementalDataBundle = UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , "supplementalData" , ICUResourceBundle . ICU_DATA_CLASS_LOADER ) ; UResourceBundle cldrVersionBundle = supplementalDataBundle . get ( "cld...
Returns the current CLDR version
26,853
private StringVector getNodesByID ( XPathContext xctxt , int docContext , String refval , StringVector usedrefs , NodeSetDTM nodeSet , boolean mayBeMore ) { if ( null != refval ) { String ref = null ; StringTokenizer tokenizer = new StringTokenizer ( refval ) ; boolean hasMore = tokenizer . hasMoreTokens ( ) ; DTM dtm ...
Fill in a list with nodes that match a space delimited list if ID ID references .
26,854
private void switchToForward ( ) { assert ( state == State . ITER_CHECK_BWD || ( state == State . ITER_IN_FCD_SEGMENT && pos == limit ) || ( state . compareTo ( State . IN_NORM_ITER_AT_LIMIT ) >= 0 && pos == normalized . length ( ) ) ) ; if ( state == State . ITER_CHECK_BWD ) { start = pos = iter . getIndex ( ) ; if ( ...
Switches to forward checking if possible .
26,855
private boolean nextSegment ( ) { assert ( state == State . ITER_CHECK_FWD ) ; pos = iter . getIndex ( ) ; if ( s == null ) { s = new StringBuilder ( ) ; } else { s . setLength ( 0 ) ; } int prevCC = 0 ; for ( ; ; ) { int c = iter . nextCodePoint ( ) ; if ( c < 0 ) { break ; } int fcd16 = nfcImpl . getFCD16 ( c ) ; int...
Extends the FCD text segment forward or normalizes around pos .
26,856
private void switchToBackward ( ) { assert ( state == State . ITER_CHECK_FWD || ( state == State . ITER_IN_FCD_SEGMENT && pos == start ) || ( state . compareTo ( State . IN_NORM_ITER_AT_LIMIT ) >= 0 && pos == 0 ) ) ; if ( state == State . ITER_CHECK_FWD ) { limit = pos = iter . getIndex ( ) ; if ( pos == start ) { stat...
Switches to backward checking .
26,857
private boolean previousSegment ( ) { assert ( state == State . ITER_CHECK_BWD ) ; pos = iter . getIndex ( ) ; if ( s == null ) { s = new StringBuilder ( ) ; } else { s . setLength ( 0 ) ; } int nextCC = 0 ; for ( ; ; ) { int c = iter . previousCodePoint ( ) ; if ( c < 0 ) { break ; } int fcd16 = nfcImpl . getFCD16 ( c...
Extends the FCD text segment backward or normalizes around pos .
26,858
public GeneralNames get ( String name ) throws IOException { if ( name . equalsIgnoreCase ( ISSUER ) ) { return names ; } else { throw new IOException ( "Attribute name not recognized by " + "CertAttrSet:CertificateIssuer" ) ; } }
Gets the attribute value .
26,859
public void delete ( String name ) throws IOException { if ( name . equalsIgnoreCase ( ISSUER ) ) { names = null ; } else { throw new IOException ( "Attribute name not recognized by " + "CertAttrSet:CertificateIssuer" ) ; } encodeThis ( ) ; }
Deletes the attribute value .
26,860
public final StringBuffer format ( Object obj , StringBuffer toAppendTo , FieldPosition fieldPosition ) { if ( obj instanceof Date ) return format ( ( Date ) obj , toAppendTo , fieldPosition ) ; else if ( obj instanceof Number ) return format ( new Date ( ( ( Number ) obj ) . longValue ( ) ) , toAppendTo , fieldPositio...
Overrides Format . Formats a time object into a time string . Examples of time objects are a time value expressed in milliseconds and a Date object .
26,861
public final static DateFormat getTimeInstance ( int style ) { return get ( style , 0 , 1 , Locale . getDefault ( Locale . Category . FORMAT ) ) ; }
Gets the time formatter with the given formatting style for the default locale .
26,862
public final static DateFormat getDateInstance ( int style ) { return get ( 0 , style , 2 , Locale . getDefault ( Locale . Category . FORMAT ) ) ; }
Gets the date formatter with the given formatting style for the default locale .
26,863
protected synchronized void create ( ) throws SocketException { ResourceManager . beforeUdpCreate ( ) ; fd = new FileDescriptor ( ) ; try { datagramSocketCreate ( ) ; } catch ( SocketException ioe ) { ResourceManager . afterUdpClose ( ) ; fd = null ; throw ioe ; } if ( fd != null && fd . valid ( ) ) { guard . open ( "c...
Creates a datagram socket
26,864
protected void connect ( InetAddress address , int port ) throws SocketException { BlockGuard . getThreadPolicy ( ) . onNetwork ( ) ; connect0 ( address , port ) ; connectedAddress = address ; connectedPort = port ; connected = true ; }
Connects a datagram socket to a remote destination . This associates the remote address with the local socket so that datagrams may only be sent to this destination and received from this destination .
26,865
protected void disconnect ( ) { disconnect0 ( connectedAddress . holder ( ) . getFamily ( ) ) ; connected = false ; connectedAddress = null ; connectedPort = - 1 ; }
Disconnects a previously connected socket . Does nothing if the socket was not connected already .
26,866
protected void joinGroup ( SocketAddress mcastaddr , NetworkInterface netIf ) throws IOException { if ( mcastaddr == null || ! ( mcastaddr instanceof InetSocketAddress ) ) throw new IllegalArgumentException ( "Unsupported address type" ) ; join ( ( ( InetSocketAddress ) mcastaddr ) . getAddress ( ) , netIf ) ; }
Join the multicast group .
26,867
protected void leaveGroup ( SocketAddress mcastaddr , NetworkInterface netIf ) throws IOException { if ( mcastaddr == null || ! ( mcastaddr instanceof InetSocketAddress ) ) throw new IllegalArgumentException ( "Unsupported address type" ) ; leave ( ( ( InetSocketAddress ) mcastaddr ) . getAddress ( ) , netIf ) ; }
Leave the multicast group .
26,868
static InetAddress getNIFirstAddress ( int niIndex ) throws SocketException { if ( niIndex > 0 ) { NetworkInterface networkInterface = NetworkInterface . getByIndex ( niIndex ) ; Enumeration < InetAddress > addressesEnum = networkInterface . getInetAddresses ( ) ; if ( addressesEnum . hasMoreElements ( ) ) { return add...
Return the first address bound to NetworkInterface with given ID . In case of niIndex == 0 or no address return anyLocalAddress
26,869
public SSLParameters getSSLParameters ( ) { SSLParameters params = new SSLParameters ( ) ; params . setCipherSuites ( getEnabledCipherSuites ( ) ) ; params . setProtocols ( getEnabledProtocols ( ) ) ; if ( getNeedClientAuth ( ) ) { params . setNeedClientAuth ( true ) ; } else if ( getWantClientAuth ( ) ) { params . set...
Returns the SSLParameters in effect for this SSLSocket . The ciphersuites and protocols of the returned SSLParameters are always non - null .
26,870
private void readObject ( ObjectInputStream s ) throws IOException , ClassNotFoundException { s . defaultReadObject ( ) ; Throwable cause = super . getCause ( ) ; if ( ! ( cause instanceof IOException ) ) throw new InvalidObjectException ( "Cause must be an IOException" ) ; }
Called to read the object from a stream .
26,871
private void enqueue ( E x ) { final Object [ ] items = this . items ; items [ putIndex ] = x ; if ( ++ putIndex == items . length ) putIndex = 0 ; count ++ ; notEmpty . signal ( ) ; }
Inserts element at current put position advances and signals . Call only when holding lock .
26,872
private E dequeue ( ) { final Object [ ] items = this . items ; @ SuppressWarnings ( "unchecked" ) E x = ( E ) items [ takeIndex ] ; items [ takeIndex ] = null ; if ( ++ takeIndex == items . length ) takeIndex = 0 ; count -- ; if ( itrs != null ) itrs . elementDequeued ( ) ; notFull . signal ( ) ; return x ; }
Extracts element at current take position advances and signals . Call only when holding lock .
26,873
public void put ( E e ) throws InterruptedException { Objects . requireNonNull ( e ) ; final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { while ( count == items . length ) notFull . await ( ) ; enqueue ( e ) ; } finally { lock . unlock ( ) ; } }
Inserts the specified element at the tail of this queue waiting for space to become available if the queue is full .
26,874
public boolean offer ( E e , long timeout , TimeUnit unit ) throws InterruptedException { Objects . requireNonNull ( e ) ; long nanos = unit . toNanos ( timeout ) ; final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { while ( count == items . length ) { if ( nanos <= 0L ) return false ; nanos =...
Inserts the specified element at the tail of this queue waiting up to the specified wait time for space to become available if the queue is full .
26,875
public static String getTableString ( ICUResourceBundle bundle , String tableName , String subtableName , String item , String defaultValue ) { String result = null ; try { for ( ; ; ) { ICUResourceBundle table = bundle . findWithFallback ( tableName ) ; if ( table == null ) { return defaultValue ; } ICUResourceBundle ...
Utility to fetch locale display data from resource bundle tables . Uses fallback through the Fallback resource if available .
26,876
public char charAt ( int where ) { int len = length ( ) ; if ( where < 0 ) { throw new IndexOutOfBoundsException ( "charAt: " + where + " < 0" ) ; } else if ( where >= len ) { throw new IndexOutOfBoundsException ( "charAt: " + where + " >= length " + len ) ; } if ( where >= mGapStart ) return mText [ where + mGapLength...
Return the char at the specified offset within the buffer .
26,877
public void setSpan ( Object what , int start , int end , int flags ) { setSpan ( true , what , start , end , flags ) ; }
Mark the specified range of text with the specified object . The flags determine how the span will behave when text is inserted at the start or end of the span s range .
26,878
public void removeSpan ( Object what ) { for ( int i = mSpanCount - 1 ; i >= 0 ; i -- ) { if ( mSpans [ i ] == what ) { removeSpan ( i ) ; return ; } } }
Remove the specified markup object from the buffer .
26,879
public int getSpanStart ( Object what ) { int count = mSpanCount ; Object [ ] spans = mSpans ; for ( int i = count - 1 ; i >= 0 ; i -- ) { if ( spans [ i ] == what ) { int where = mSpanStarts [ i ] ; if ( where > mGapStart ) where -= mGapLength ; return where ; } } return - 1 ; }
Return the buffer offset of the beginning of the specified markup object or - 1 if it is not attached to this buffer .
26,880
public int getSpanEnd ( Object what ) { int count = mSpanCount ; Object [ ] spans = mSpans ; for ( int i = count - 1 ; i >= 0 ; i -- ) { if ( spans [ i ] == what ) { int where = mSpanEnds [ i ] ; if ( where > mGapStart ) where -= mGapLength ; return where ; } } return - 1 ; }
Return the buffer offset of the end of the specified markup object or - 1 if it is not attached to this buffer .
26,881
public int getSpanFlags ( Object what ) { int count = mSpanCount ; Object [ ] spans = mSpans ; for ( int i = count - 1 ; i >= 0 ; i -- ) { if ( spans [ i ] == what ) { return mSpanFlags [ i ] ; } } return 0 ; }
Return the flags of the end of the specified markup object or 0 if it is not attached to this buffer .
26,882
@ SuppressWarnings ( "unchecked" ) public < T > T [ ] getSpans ( int queryStart , int queryEnd , Class < T > kind ) { if ( kind == null ) return ArrayUtils . emptyArray ( kind ) ; int spanCount = mSpanCount ; Object [ ] spans = mSpans ; int [ ] starts = mSpanStarts ; int [ ] ends = mSpanEnds ; int [ ] flags = mSpanFlag...
Return an array of the spans of the specified type that overlap the specified range of the buffer . The kind may be Object . class to get a list of all the spans regardless of type .
26,883
public void getChars ( int start , int end , char [ ] dest , int destoff ) { checkRange ( "getChars" , start , end ) ; if ( end <= mGapStart ) { System . arraycopy ( mText , start , dest , destoff , end - start ) ; } else if ( start >= mGapStart ) { System . arraycopy ( mText , start + mGapLength , dest , destoff , end...
Copy the specified range of chars from this buffer into the specified array beginning at the specified offset .
26,884
public String substring ( int start , int end ) { char [ ] buf = new char [ end - start ] ; getChars ( start , end , buf , 0 ) ; return new String ( buf ) ; }
Return a String containing a copy of the chars in this buffer limited to the [ start end [ range .
26,885
public static StreamEncoder forOutputStreamWriter ( OutputStream out , Object lock , String charsetName ) throws UnsupportedEncodingException { String csn = charsetName ; if ( csn == null ) csn = Charset . defaultCharset ( ) . name ( ) ; try { if ( Charset . isSupported ( csn ) ) return new StreamEncoder ( out , lock ,...
Factories for java . io . OutputStreamWriter
26,886
public static StreamEncoder forEncoder ( WritableByteChannel ch , CharsetEncoder enc , int minBufferCap ) { return new StreamEncoder ( ch , enc , minBufferCap ) ; }
Factory for java . nio . channels . Channels . newWriter
26,887
public static SocketChannel open ( SocketAddress remote ) throws IOException { SocketChannel sc = open ( ) ; try { sc . connect ( remote ) ; } catch ( Throwable x ) { try { sc . close ( ) ; } catch ( Throwable suppressed ) { x . addSuppressed ( suppressed ) ; } throw x ; } assert sc . isConnected ( ) ; return sc ; }
Opens a socket channel and connects it to a remote address .
26,888
private void removeUnsharedReference ( Object obj , int previousHandle ) { if ( previousHandle != - 1 ) { objectsWritten . put ( obj , previousHandle ) ; } else { objectsWritten . remove ( obj ) ; } }
Remove the unshared object from the table and restore any previous handle .
26,889
public void useProtocolVersion ( int version ) throws IOException { if ( ! objectsWritten . isEmpty ( ) ) { throw new IllegalStateException ( "Cannot set protocol version when stream in use" ) ; } if ( version != ObjectStreamConstants . PROTOCOL_VERSION_1 && version != ObjectStreamConstants . PROTOCOL_VERSION_2 ) { thr...
Sets the specified protocol version to be used by this stream .
26,890
private ObjectStreamClass writeEnumDesc ( ObjectStreamClass classDesc , boolean unshared ) throws IOException { classDesc . setFlags ( ( byte ) ( SC_SERIALIZABLE | SC_ENUM ) ) ; int previousHandle = - 1 ; if ( unshared ) { previousHandle = objectsWritten . get ( classDesc ) ; } int handle = - 1 ; if ( ! unshared ) { ha...
write for Enum Class Desc only which is different from other classes
26,891
private boolean iterateExtended ( ValueIterator . Element result , int limit ) { while ( m_current_ < limit ) { String name = m_name_ . getExtendedOr10Name ( m_current_ ) ; if ( name != null && name . length ( ) > 0 ) { result . integer = m_current_ ; result . value = name ; return false ; } ++ m_current_ ; } return tr...
Iterate extended names .
26,892
public static String [ ] getBeanInfoSearchPath ( ) { String [ ] path = new String [ searchPath . length ] ; System . arraycopy ( searchPath , 0 , path , 0 , searchPath . length ) ; return path ; }
Gets an array of search packages .
26,893
public static void setBeanInfoSearchPath ( String [ ] path ) { if ( System . getSecurityManager ( ) != null ) { System . getSecurityManager ( ) . checkPropertiesAccess ( ) ; } searchPath = path ; }
Sets the search packages .
26,894
public long getAndSet ( T obj , long newValue ) { long prev ; do { prev = get ( obj ) ; } while ( ! compareAndSet ( obj , prev , newValue ) ) ; return prev ; }
Atomically sets the field of the given object managed by this updater to the given value and returns the old value .
26,895
private static boolean anchorIsTarget ( TrustAnchor anchor , CertSelector sel ) { X509Certificate anchorCert = anchor . getTrustedCert ( ) ; if ( anchorCert != null ) { return sel . match ( anchorCert ) ; } return false ; }
Returns true if trust anchor certificate matches specified certificate constraints .
26,896
public void endVisit ( VariableDeclarationFragment fragment ) { Element element = fragment . getVariableElement ( ) . getEnclosingElement ( ) ; if ( element instanceof TypeElement ) { TypeElement type = ( TypeElement ) element ; if ( ElementUtil . isPublic ( fragment . getVariableElement ( ) ) ) { ClassReferenceNode no...
and resolve the type by its name using a resolve method in the parser environment .
26,897
private void handleChildMethod ( ExecutableElement methodElement ) { String methodIdentifier = stitchMethodIdentifier ( methodElement ) ; MethodReferenceNode node = ( MethodReferenceNode ) elementReferenceMap . get ( methodIdentifier ) ; if ( node == null ) { node = new MethodReferenceNode ( methodElement ) ; } node . ...
Adds a node for the child in the elementReferenceMap if it doesn t exist marks it as declared and adds this method to the override map .
26,898
private void handleParentMethod ( ExecutableElement parentMethodElement , ExecutableElement childMethodElement ) { MethodReferenceNode parentMethodNode = ( MethodReferenceNode ) elementReferenceMap . get ( stitchMethodIdentifier ( parentMethodElement ) ) ; if ( parentMethodNode == null ) { parentMethodNode = new Method...
Adds a node for the parent in the elementReferenceMap if it doesn t exist adds the method to the override map and links the child method in the invokedMethods set .
26,899
private void addValueInRefsTable ( XPathContext xctxt , XMLString ref , int node ) { XNodeSet nodes = ( XNodeSet ) m_refsTable . get ( ref ) ; if ( nodes == null ) { nodes = new XNodeSet ( node , xctxt . getDTMManager ( ) ) ; nodes . nextNode ( ) ; m_refsTable . put ( ref , nodes ) ; } else { if ( nodes . getCurrentNod...
Add an association between a ref and a node in the m_refsTable . Requires that m_refsTable ! = null