idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
26,900
public String getString ( int maxLength ) throws java . io . IOException { String result = null ; if ( fInputStream != null ) { StringBuilder sb = new StringBuilder ( ) ; char [ ] buffer = new char [ 1024 ] ; Reader reader = getReader ( ) ; int max = maxLength < 0 ? Integer . MAX_VALUE : maxLength ; int bytesRead = 0 ;...
Create a Java String from Unicode character data corresponding to the original byte data supplied to the Charset detect operation . The length of the returned string is limited to the specified size ; the string will be trunctated to this length if necessary . A limit value of zero or less is ignored and treated as no ...
26,901
public InputFile getNextFile ( ) { for ( Iterator < String > iter = queuedNames . iterator ( ) ; iter . hasNext ( ) ; ) { String name = iter . next ( ) ; iter . remove ( ) ; processedNames . add ( name ) ; InputFile file = getFileForName ( name ) ; if ( file != null ) { return file ; } } return null ; }
Returns the next Java source file to be processed . Returns null if the queue is empty .
26,902
static void Print ( AddressBook addressBook ) { for ( Person person : addressBook . getPeopleList ( ) ) { System . out . println ( "Person ID: " + person . getId ( ) ) ; System . out . println ( " Name: " + person . getName ( ) ) ; if ( ! person . getEmail ( ) . isEmpty ( ) ) { System . out . println ( " E-mail addre...
Iterates though all people in the AddressBook and prints info about them .
26,903
public static void main ( String [ ] args ) throws Exception { if ( args . length != 1 ) { System . err . println ( "Usage: ListPeople ADDRESS_BOOK_FILE" ) ; System . exit ( - 1 ) ; } AddressBook addressBook = AddressBook . parseFrom ( new FileInputStream ( args [ 0 ] ) ) ; Print ( addressBook ) ; }
the information inside .
26,904
public int push ( int i ) { if ( ( m_firstFree + 1 ) >= m_mapSize ) { m_mapSize += m_blocksize ; int newMap [ ] = new int [ m_mapSize ] ; System . arraycopy ( m_map , 0 , newMap , 0 , m_firstFree + 1 ) ; m_map = newMap ; } m_map [ m_firstFree ] = i ; m_firstFree ++ ; return i ; }
Pushes an item onto the top of this stack .
26,905
public void encode ( DerOutputStream out ) throws IOException { DerValue derValue = new DerValue ( nameValue ) ; out . putDerValue ( derValue ) ; }
Encode the X400 name into the DerOutputStream .
26,906
public final void addElement ( Object value ) { if ( ( m_firstFree + 1 ) >= m_mapSize ) { m_mapSize += m_blocksize ; Object newMap [ ] = new Object [ m_mapSize ] ; System . arraycopy ( m_map , 0 , newMap , 0 , m_firstFree + 1 ) ; m_map = newMap ; } m_map [ m_firstFree ] = value ; m_firstFree ++ ; }
Append an object onto the vector .
26,907
public final boolean contains ( Object s ) { for ( int i = 0 ; i < m_firstFree ; i ++ ) { if ( m_map [ i ] == s ) return true ; } return false ; }
Tell if the table contains the given Object .
26,908
public static void dumpUnit ( CompilationUnit unit ) { String relativeOutputPath = unit . getMainTypeName ( ) . replace ( '.' , '/' ) + ".ast" ; File outputFile = new File ( unit . getEnv ( ) . options ( ) . fileUtil ( ) . getOutputDirectory ( ) , relativeOutputPath ) ; outputFile . getParentFile ( ) . mkdirs ( ) ; try...
Dumps a compilation unit to a file . The output file s path is the same as where translated files get written but with an ast suffix .
26,909
public static String dump ( TreeNode node ) { DebugASTDump dumper = new DebugASTDump ( ) ; node . accept ( dumper ) ; dumper . sb . newline ( ) ; return dumper . toString ( ) ; }
Dumps an AST node as a string .
26,910
private int compareMagnitude ( BigDecimal val ) { long ys = val . intCompact ; long xs = this . intCompact ; if ( xs == 0 ) return ( ys == 0 ) ? 0 : - 1 ; if ( ys == 0 ) return 1 ; long sdiff = ( long ) this . scale - val . scale ; if ( sdiff != 0 ) { long xae = ( long ) this . precision ( ) - this . scale ; long yae =...
Version of compareTo that ignores sign .
26,911
private static int bigDigitLength ( BigInteger b ) { if ( b . signum == 0 ) return 1 ; int r = ( int ) ( ( ( ( long ) b . bitLength ( ) + 1 ) * 646456993 ) >>> 31 ) ; return b . compareMagnitude ( bigTenToThe ( r ) ) < 0 ? r : r + 1 ; }
Returns the length of the absolute value of a BigInteger in decimal digits .
26,912
private int checkScale ( long val ) { int asInt = ( int ) val ; if ( asInt != val ) { asInt = val > Integer . MAX_VALUE ? Integer . MAX_VALUE : Integer . MIN_VALUE ; BigInteger b ; if ( intCompact != 0 && ( ( b = intVal ) == null || b . signum ( ) != 0 ) ) throw new ArithmeticException ( asInt > 0 ? "Underflow" : "Over...
Check a scale for Underflow or Overflow . If this BigDecimal is nonzero throw an exception if the scale is outof range . If this is zero saturate the scale to the extreme value of the right sign if the scale is out of range .
26,913
private static boolean commonNeedIncrement ( int roundingMode , int qsign , int cmpFracHalf , boolean oddQuot ) { switch ( roundingMode ) { case ROUND_UNNECESSARY : throw new ArithmeticException ( "Rounding necessary" ) ; case ROUND_UP : return true ; case ROUND_DOWN : return false ; case ROUND_CEILING : return qsign >...
Shared logic of need increment computation .
26,914
private final int yearType ( int year ) { int yearLength = handleGetYearLength ( year ) ; if ( yearLength > 380 ) { yearLength -= 30 ; } int type = 0 ; switch ( yearLength ) { case 353 : type = 0 ; break ; case 354 : type = 1 ; break ; case 355 : type = 2 ; break ; default : throw new IllegalArgumentException ( "Illega...
Returns the the type of a given year . 0 Deficient year with 353 or 383 days 1 Normal year with 354 or 384 days 2 Complete year with 355 or 385 days
26,915
protected int handleGetMonthLength ( int extendedYear , int month ) { while ( month < 0 ) { month += monthsInYear ( -- extendedYear ) ; } while ( month > 12 ) { month -= monthsInYear ( extendedYear ++ ) ; } switch ( month ) { case HESHVAN : case KISLEV : return MONTH_LENGTH [ month ] [ yearType ( extendedYear ) ] ; def...
Returns the length of the given month in the given year
26,916
public Hashtable getEnvironmentHash ( ) { Hashtable hash = new Hashtable ( ) ; checkJAXPVersion ( hash ) ; checkProcessorVersion ( hash ) ; checkParserVersion ( hash ) ; checkAntVersion ( hash ) ; checkDOMVersion ( hash ) ; checkSAXVersion ( hash ) ; checkSystemProperties ( hash ) ; return hash ; }
Fill a hash with basic environment settings that affect Xalan .
26,917
protected boolean writeEnvironmentReport ( Hashtable h ) { if ( null == h ) { logMsg ( "# ERROR: writeEnvironmentReport called with null Hashtable" ) ; return false ; } boolean errors = false ; logMsg ( "#---- BEGIN writeEnvironmentReport($Revision: 468646 $): Useful stuff found: ----" ) ; for ( Enumeration keys = h . ...
Dump a basic Xalan environment report to outWriter .
26,918
protected void checkSystemProperties ( Hashtable h ) { if ( null == h ) h = new Hashtable ( ) ; try { String javaVersion = System . getProperty ( "java.version" ) ; h . put ( "java.version" , javaVersion ) ; } catch ( SecurityException se ) { h . put ( "java.version" , "WARNING: SecurityException thrown accessing syste...
Fillin hash with info about SystemProperties .
26,919
protected Vector checkPathForJars ( String cp , String [ ] jars ) { if ( ( null == cp ) || ( null == jars ) || ( 0 == cp . length ( ) ) || ( 0 == jars . length ) ) return null ; Vector v = new Vector ( ) ; StringTokenizer st = new StringTokenizer ( cp , File . pathSeparator ) ; while ( st . hasMoreTokens ( ) ) { String...
Cheap - o listing of specified . jars found in the classpath .
26,920
protected String getApparentVersion ( String jarName , long jarSize ) { String foundSize = ( String ) jarVersions . get ( new Long ( jarSize ) ) ; if ( ( null != foundSize ) && ( foundSize . startsWith ( jarName ) ) ) { return foundSize ; } else { if ( "xerces.jar" . equalsIgnoreCase ( jarName ) || "xercesImpl.jar" . e...
Cheap - o method to determine the product version of a . jar .
26,921
protected void checkJAXPVersion ( Hashtable h ) { if ( null == h ) h = new Hashtable ( ) ; final Class noArgs [ ] = new Class [ 0 ] ; Class clazz = null ; try { final String JAXP1_CLASS = "javax.xml.parsers.DocumentBuilder" ; final String JAXP11_METHOD = "getDOMImplementation" ; clazz = ObjectFactory . findProviderClas...
Report version information about JAXP interfaces .
26,922
protected void checkProcessorVersion ( Hashtable h ) { if ( null == h ) h = new Hashtable ( ) ; try { final String XALAN1_VERSION_CLASS = "org.apache.xalan.xslt.XSLProcessorVersion" ; Class clazz = ObjectFactory . findProviderClass ( XALAN1_VERSION_CLASS , ObjectFactory . findClassLoader ( ) , true ) ; StringBuffer buf...
Report product version information from Xalan - J .
26,923
protected void checkParserVersion ( Hashtable h ) { if ( null == h ) h = new Hashtable ( ) ; try { final String XERCES1_VERSION_CLASS = "org.apache.xerces.framework.Version" ; Class clazz = ObjectFactory . findProviderClass ( XERCES1_VERSION_CLASS , ObjectFactory . findClassLoader ( ) , true ) ; Field f = clazz . getFi...
Report product version information from common parsers .
26,924
protected void checkAntVersion ( Hashtable h ) { if ( null == h ) h = new Hashtable ( ) ; try { final String ANT_VERSION_CLASS = "org.apache.tools.ant.Main" ; final String ANT_VERSION_METHOD = "getAntVersion" ; final Class noArgs [ ] = new Class [ 0 ] ; Class clazz = ObjectFactory . findProviderClass ( ANT_VERSION_CLAS...
Report product version information from Ant .
26,925
protected void checkDOMVersion ( Hashtable h ) { if ( null == h ) h = new Hashtable ( ) ; final String DOM_LEVEL2_CLASS = "org.w3c.dom.Document" ; final String DOM_LEVEL2_METHOD = "createElementNS" ; final String DOM_LEVEL2WD_CLASS = "org.w3c.dom.Node" ; final String DOM_LEVEL2WD_METHOD = "supported" ; final String DOM...
Report version info from DOM interfaces .
26,926
protected void checkSAXVersion ( Hashtable h ) { if ( null == h ) h = new Hashtable ( ) ; final String SAX_VERSION1_CLASS = "org.xml.sax.Parser" ; final String SAX_VERSION1_METHOD = "parse" ; final String SAX_VERSION2_CLASS = "org.xml.sax.XMLReader" ; final String SAX_VERSION2_METHOD = "parse" ; final String SAX_VERSIO...
Report version info from SAX interfaces .
26,927
private boolean authenticate ( byte method , InputStream in , BufferedOutputStream out ) throws IOException { return authenticate ( method , in , out , 0L ) ; }
Provides the authentication machanism required by the proxy .
26,928
public static VersionInfo getDataVersion ( ) { UResourceBundle icudatares = null ; try { icudatares = UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , ICUDataVersion . U_ICU_VERSION_BUNDLE , ICUResourceBundle . ICU_DATA_CLASS_LOADER ) ; icudatares = icudatares . get ( ICUDataVersion . U_ICU_DATA_KEY ) ; ...
This function retrieves the data version from icuver and returns a VersionInfo object with that version information .
26,929
public static String getDisplayName ( String [ ] [ ] zoneStrings , String id , boolean daylight , int style ) { String [ ] needle = new String [ ] { id } ; int index = Arrays . binarySearch ( zoneStrings , needle , ZONE_STRINGS_COMPARATOR ) ; if ( index >= 0 ) { String [ ] row = zoneStrings [ index ] ; if ( daylight ) ...
Returns the appropriate string from zoneStrings . Used with getZoneStrings .
26,930
public static String [ ] [ ] getZoneStrings ( Locale locale ) { if ( locale == null ) { locale = Locale . getDefault ( ) ; } return cachedZoneStrings . get ( locale ) ; }
Returns an array of time zone strings as used by DateFormatSymbols . getZoneStrings .
26,931
public void updateProgress ( long latestProgress , long expectedProgress ) { lastProgress = progress ; progress = latestProgress ; expected = expectedProgress ; if ( connected ( ) == false ) state = State . CONNECTED ; else state = State . UPDATE ; if ( lastProgress / threshold != progress / threshold ) { progressMonit...
Update progress .
26,932
public void startNonText ( StylesheetHandler handler ) throws org . xml . sax . SAXException { if ( this == handler . getCurrentProcessor ( ) ) { handler . popProcessor ( ) ; } int nChars = m_accumulator . length ( ) ; if ( ( nChars > 0 ) && ( ( null != m_xslTextElement ) || ! XMLCharacterRecognizer . isWhiteSpace ( m_...
Receive notification of the start of the non - text event . This is sent to the current processor when any non - text event occurs .
26,933
public double match ( ULocale desired , ULocale desiredMax , ULocale supported , ULocale supportedMax ) { return matcherData . match ( desired , desiredMax , supported , supportedMax ) ; }
Returns a fraction between 0 and 1 where 1 means that the languages are a perfect match and 0 means that they are completely different . Note that the precise values may change over time ; no code should be made dependent on the values remaining constant .
26,934
public ULocale getBestMatch ( LocalePriorityList languageList ) { double bestWeight = 0 ; ULocale bestTableMatch = null ; double penalty = 0 ; OutputDouble matchWeight = new OutputDouble ( ) ; for ( final ULocale language : languageList ) { final ULocale matchLocale = getBestMatchInternal ( language , matchWeight ) ; f...
Get the best match for a LanguagePriorityList
26,935
private ULocale getBestMatchInternal ( ULocale languageCode , OutputDouble outputWeight ) { languageCode = canonicalize ( languageCode ) ; final ULocale maximized = addLikelySubtags ( languageCode ) ; if ( DEBUG ) { System . out . println ( "\ngetBestMatchInternal: " + languageCode + ";\t" + maximized ) ; } double best...
Get the best match for an individual language code .
26,936
private void processMapping ( ) { for ( Entry < String , Set < String > > desiredToMatchingLanguages : matcherData . matchingLanguages ( ) . keyValuesSet ( ) ) { String desired = desiredToMatchingLanguages . getKey ( ) ; Set < String > supported = desiredToMatchingLanguages . getValue ( ) ; for ( R3 < ULocale , ULocale...
We preprocess the data to get just the possible matches for each desired base language .
26,937
private ULocale addLikelySubtags ( ULocale languageCode ) { if ( languageCode . equals ( UNKNOWN_LOCALE ) ) { return UNKNOWN_LOCALE ; } final ULocale result = ULocale . addLikelySubtags ( languageCode ) ; if ( result == null || result . equals ( languageCode ) ) { final String language = languageCode . getLanguage ( ) ...
We need to add another method to addLikelySubtags that doesn t return null but instead substitutes Zzzz and ZZ if unknown . There are also a few cases where addLikelySubtags needs to have expanded data to handle all deprecated codes .
26,938
private static long calcSize ( long size , long skip , long limit ) { return size >= 0 ? Math . max ( - 1 , Math . min ( size - skip , limit ) ) : - 1 ; }
Calculates the sliced size given the current size number of elements skip and the number of elements to limit .
26,939
private static long calcSliceFence ( long skip , long limit ) { long sliceFence = limit >= 0 ? skip + limit : Long . MAX_VALUE ; return ( sliceFence >= 0 ) ? sliceFence : Long . MAX_VALUE ; }
Calculates the slice fence which is one past the index of the slice range
26,940
@ SuppressWarnings ( "unchecked" ) private static < P_IN > Spliterator < P_IN > sliceSpliterator ( StreamShape shape , Spliterator < P_IN > s , long skip , long limit ) { assert s . hasCharacteristics ( Spliterator . SUBSIZED ) ; long sliceFence = calcSliceFence ( skip , limit ) ; switch ( shape ) { case REFERENCE : re...
Creates a slice spliterator given a stream shape governing the spliterator type . Requires that the underlying Spliterator be SUBSIZED .
26,941
public String nextString ( ) throws NoSuchElementException , UResourceTypeMismatchException { if ( index < size ) { return bundle . getString ( index ++ ) ; } throw new NoSuchElementException ( ) ; }
Returns the next String of this iterator if this iterator object has at least one more element to provide
26,942
public MessagePattern parse ( String pattern ) { preParse ( pattern ) ; parseMessage ( 0 , 0 , 0 , ArgType . NONE ) ; postParse ( ) ; return this ; }
Parses a MessageFormat pattern string .
26,943
public MessagePattern parsePluralStyle ( String pattern ) { preParse ( pattern ) ; parsePluralOrSelectStyle ( ArgType . PLURAL , 0 , 0 ) ; postParse ( ) ; return this ; }
Parses a PluralFormat pattern string .
26,944
public MessagePattern parseSelectStyle ( String pattern ) { preParse ( pattern ) ; parsePluralOrSelectStyle ( ArgType . SELECT , 0 , 0 ) ; postParse ( ) ; return this ; }
Parses a SelectFormat pattern string .
26,945
public static int validateArgumentName ( String name ) { if ( ! PatternProps . isIdentifier ( name ) ) { return ARG_NAME_NOT_VALID ; } return parseArgNumber ( name , 0 , name . length ( ) ) ; }
Validates and parses an argument name or argument number string . An argument name must be a pattern identifier that is it must contain no Unicode Pattern_Syntax or Pattern_White_Space characters . If it only contains ASCII digits then it must be a small integer with no leading zero .
26,946
public boolean partSubstringMatches ( Part part , String s ) { return part . length == s . length ( ) && msg . regionMatches ( part . index , s , 0 , part . length ) ; }
Compares the part s substring with the input string s .
26,947
public double getNumericValue ( Part part ) { Part . Type type = part . type ; if ( type == Part . Type . ARG_INT ) { return part . value ; } else if ( type == Part . Type . ARG_DOUBLE ) { return numericValues . get ( part . value ) ; } else { return NO_NUMERIC_VALUE ; } }
Returns the numeric value associated with an ARG_INT or ARG_DOUBLE .
26,948
public int getLimitPartIndex ( int start ) { int limit = parts . get ( start ) . limitPartIndex ; if ( limit < start ) { return start ; } return limit ; }
Returns the index of the ARG|MSG_LIMIT part corresponding to the ARG|MSG_START at start .
26,949
@ SuppressWarnings ( "unchecked" ) public MessagePattern cloneAsThawed ( ) { MessagePattern newMsg ; try { newMsg = ( MessagePattern ) super . clone ( ) ; } catch ( CloneNotSupportedException e ) { throw new ICUCloneNotSupportedException ( e ) ; } newMsg . parts = ( ArrayList < Part > ) parts . clone ( ) ; if ( numeric...
Creates and returns an unfrozen copy of this object .
26,950
private static int parseArgNumber ( CharSequence s , int start , int limit ) { if ( start >= limit ) { return ARG_NAME_NOT_VALID ; } int number ; boolean badNumber ; char c = s . charAt ( start ++ ) ; if ( c == '0' ) { if ( start == limit ) { return 0 ; } else { number = 0 ; badNumber = true ; } } else if ( '1' <= c &&...
Validates and parses an argument name or argument number string . This internal method assumes that the input substring is a pattern identifier .
26,951
private void parseDouble ( int start , int limit , boolean allowInfinity ) { assert start < limit ; for ( ; ; ) { int value = 0 ; int isNegative = 0 ; int index = start ; char c = msg . charAt ( index ++ ) ; if ( c == '-' ) { isNegative = 1 ; if ( index == limit ) { break ; } c = msg . charAt ( index ++ ) ; } else if (...
Parses a number from the specified message substring .
26,952
private int skipDouble ( int index ) { while ( index < msg . length ( ) ) { char c = msg . charAt ( index ) ; if ( ( c < '0' && "+-." . indexOf ( c ) < 0 ) || ( c > '9' && c != 'e' && c != 'E' && c != 0x221e ) ) { break ; } ++ index ; } return index ; }
Skips a sequence of characters that could occur in a double value . Does not fully parse or validate the value .
26,953
public static Normalizer2WithImpl getN2WithImpl ( int index ) { switch ( index ) { case 0 : return getNFCInstance ( ) . decomp ; case 1 : return getNFKCInstance ( ) . decomp ; case 2 : return getNFCInstance ( ) . comp ; case 3 : return getNFKCInstance ( ) . comp ; default : return null ; } }
For use in properties APIs .
26,954
Parsed copy ( ) { Parsed cloned = new Parsed ( ) ; cloned . fieldValues . putAll ( this . fieldValues ) ; cloned . zone = this . zone ; cloned . chrono = this . chrono ; cloned . leapSecond = this . leapSecond ; return cloned ; }
Creates a copy .
26,955
TemporalAccessor resolve ( ResolverStyle resolverStyle , Set < TemporalField > resolverFields ) { if ( resolverFields != null ) { fieldValues . keySet ( ) . retainAll ( resolverFields ) ; } this . resolverStyle = resolverStyle ; resolveFields ( ) ; resolveTimeLenient ( ) ; crossCheck ( ) ; resolvePeriod ( ) ; resolveFr...
Resolves the fields in this context .
26,956
public int getValue ( int ch ) { if ( m_isCompacted_ || ch > UCharacter . MAX_VALUE || ch < 0 ) { return 0 ; } int block = m_index_ [ ch >> SHIFT_ ] ; return m_data_ [ Math . abs ( block ) + ( ch & MASK_ ) ] ; }
Gets a 32 bit data from the table data
26,957
public int getValue ( int ch , boolean [ ] inBlockZero ) { if ( m_isCompacted_ || ch > UCharacter . MAX_VALUE || ch < 0 ) { if ( inBlockZero != null ) { inBlockZero [ 0 ] = true ; } return 0 ; } int block = m_index_ [ ch >> SHIFT_ ] ; if ( inBlockZero != null ) { inBlockZero [ 0 ] = ( block == 0 ) ; } return m_data_ [ ...
Get a 32 bit data from the table data
26,958
public boolean setValue ( int ch , int value ) { if ( m_isCompacted_ || ch > UCharacter . MAX_VALUE || ch < 0 ) { return false ; } int block = getDataBlock ( ch ) ; if ( block < 0 ) { return false ; } m_data_ [ block + ( ch & MASK_ ) ] = value ; return true ; }
Sets a 32 bit data in the table data
26,959
public IntTrie serialize ( TrieBuilder . DataManipulate datamanipulate , Trie . DataManipulate triedatamanipulate ) { if ( datamanipulate == null ) { throw new IllegalArgumentException ( "Parameters can not be null" ) ; } if ( ! m_isCompacted_ ) { compact ( false ) ; fold ( datamanipulate ) ; compact ( true ) ; m_isCom...
Serializes the build table with 32 bit data
26,960
public int serialize ( OutputStream os , boolean reduceTo16Bits , TrieBuilder . DataManipulate datamanipulate ) throws IOException { if ( datamanipulate == null ) { throw new IllegalArgumentException ( "Parameters can not be null" ) ; } if ( ! m_isCompacted_ ) { compact ( false ) ; fold ( datamanipulate ) ; compact ( t...
Serializes the build table to an output stream .
26,961
private static final int findSameDataBlock ( int data [ ] , int dataLength , int otherBlock , int step ) { dataLength -= DATA_BLOCK_LENGTH ; for ( int block = 0 ; block <= dataLength ; block += step ) { if ( equal_int ( data , block , otherBlock , DATA_BLOCK_LENGTH ) ) { return block ; } } return - 1 ; }
Find the same data block
26,962
private final void fold ( DataManipulate manipulate ) { int leadIndexes [ ] = new int [ SURROGATE_BLOCK_COUNT_ ] ; int index [ ] = m_index_ ; System . arraycopy ( index , 0xd800 >> SHIFT_ , leadIndexes , 0 , SURROGATE_BLOCK_COUNT_ ) ; int block = 0 ; if ( m_leadUnitValue_ == m_initialValue_ ) { } else { block = allocDa...
Fold the normalization data for supplementary code points into a compact area on top of the BMP - part of the trie index with the lead surrogates indexing this compact area .
26,963
private void readObject ( ObjectInputStream s ) throws IOException , ClassNotFoundException { scope_ifname = null ; scope_ifname_set = false ; if ( getClass ( ) . getClassLoader ( ) != Class . class . getClassLoader ( ) ) { throw new SecurityException ( "invalid address type" ) ; } s . defaultReadObject ( ) ; if ( ifna...
restore the state of this object from stream including the scope information only if the scoped interface name is valid on this system
26,964
public boolean isAnyLocalAddress ( ) { byte test = 0x00 ; for ( int i = 0 ; i < INADDRSZ ; i ++ ) { test |= ipaddress [ i ] ; } return ( test == 0x00 ) ; }
Utility routine to check if the InetAddress in a wildcard address .
26,965
public boolean isLoopbackAddress ( ) { byte test = 0x00 ; for ( int i = 0 ; i < 15 ; i ++ ) { test |= ipaddress [ i ] ; } return ( test == 0x00 ) && ( ipaddress [ 15 ] == 0x01 ) ; }
Utility routine to check if the InetAddress is a loopback address .
26,966
public boolean isIPv4CompatibleAddress ( ) { if ( ( ipaddress [ 0 ] == 0x00 ) && ( ipaddress [ 1 ] == 0x00 ) && ( ipaddress [ 2 ] == 0x00 ) && ( ipaddress [ 3 ] == 0x00 ) && ( ipaddress [ 4 ] == 0x00 ) && ( ipaddress [ 5 ] == 0x00 ) && ( ipaddress [ 6 ] == 0x00 ) && ( ipaddress [ 7 ] == 0x00 ) && ( ipaddress [ 8 ] == 0...
Utility routine to check if the InetAddress is an IPv4 compatible IPv6 address .
26,967
private synchronized void writeObject ( java . io . ObjectOutputStream s ) throws IOException { if ( scope_ifname_set ) { ifname = scope_ifname . getName ( ) ; } s . defaultWriteObject ( ) ; }
default behavior is overridden in order to write the scope_ifname field as a String rather than a NetworkInterface which is not serializable
26,968
public void pushContext ( ) { Context2 parentContext = currentContext ; currentContext = parentContext . getChild ( ) ; if ( currentContext == null ) { currentContext = new Context2 ( parentContext ) ; } else { currentContext . setParent ( parentContext ) ; } }
Start a new Namespace context .
26,969
public String [ ] processName ( String qName , String [ ] parts , boolean isAttribute ) { String [ ] name = currentContext . processName ( qName , isAttribute ) ; if ( name == null ) return null ; System . arraycopy ( name , 0 , parts , 0 , 3 ) ; return parts ; }
Process a raw XML 1 . 0 name .
26,970
void declarePrefix ( String prefix , String uri ) { if ( ! tablesDirty ) { copyTables ( ) ; } if ( declarations == null ) { declarations = new Vector ( ) ; } prefix = prefix . intern ( ) ; uri = uri . intern ( ) ; if ( "" . equals ( prefix ) ) { if ( "" . equals ( uri ) ) { defaultNS = null ; } else { defaultNS = uri ;...
Declare a Namespace prefix for this context .
26,971
String [ ] processName ( String qName , boolean isAttribute ) { String name [ ] ; Hashtable table ; if ( isAttribute ) { if ( elementNameTable == null ) elementNameTable = new Hashtable ( ) ; table = elementNameTable ; } else { if ( attributeNameTable == null ) attributeNameTable = new Hashtable ( ) ; table = attribute...
Process a raw XML 1 . 0 name in this context .
26,972
String getURI ( String prefix ) { if ( "" . equals ( prefix ) ) { return defaultNS ; } else if ( prefixTable == null ) { return null ; } else { return ( String ) prefixTable . get ( prefix ) ; } }
Look up the URI associated with a prefix in this context .
26,973
String getPrefix ( String uri ) { if ( uriTable == null ) { return null ; } else { return ( String ) uriTable . get ( uri ) ; } }
Look up one of the prefixes associated with a URI in this context .
26,974
private void copyTables ( ) { prefixTable = ( Hashtable ) prefixTable . clone ( ) ; uriTable = ( Hashtable ) uriTable . clone ( ) ; if ( elementNameTable != null ) elementNameTable = new Hashtable ( ) ; if ( attributeNameTable != null ) attributeNameTable = new Hashtable ( ) ; tablesDirty = true ; }
Copy on write for the internal tables in this context .
26,975
public String getMessage ( ) { String errnoName = OsConstants . errnoName ( errno ) ; if ( errnoName == null ) { errnoName = "errno " + errno ; } String description = Libcore . os . strerror ( errno ) ; return functionName + " failed: " + errnoName + " (" + description + ")" ; }
Converts the stashed function name and errno value to a human - readable string . We do this here rather than in the constructor so that callers only pay for this if they need it .
26,976
private static Collection < X509CRL > getCRLs ( X509CRLSelector selector , X509CertImpl certImpl , DistributionPoint point , boolean [ ] reasonsMask , boolean signFlag , PublicKey prevKey , X509Certificate prevCert , String provider , List < CertStore > certStores , Set < TrustAnchor > trustAnchors , Date validity ) th...
Download CRLs from the given distribution point verify and return them . See the top of the class for current limitations .
26,977
private static X509CRL getCRL ( URIName name ) throws CertStoreException { URI uri = name . getURI ( ) ; if ( debug != null ) { debug . println ( "Trying to fetch CRL from DP " + uri ) ; } CertStore ucs = null ; try { ucs = URICertStore . getInstance ( new URICertStore . URICertStoreParameters ( uri ) ) ; } catch ( Inv...
Download CRL from given URI .
26,978
private static Collection < X509CRL > getCRLs ( X500Name name , X500Principal certIssuer , List < CertStore > certStores ) throws CertStoreException { if ( debug != null ) { debug . println ( "Trying to fetch CRL from DP " + name ) ; } X509CRLSelector xcs = new X509CRLSelector ( ) ; xcs . addIssuer ( name . asX500Princ...
Fetch CRLs from certStores .
26,979
private static GeneralNames getFullNames ( X500Name issuer , RDN rdn ) throws IOException { List < RDN > rdns = new ArrayList < > ( issuer . rdns ( ) ) ; rdns . add ( rdn ) ; X500Name fullName = new X500Name ( rdns . toArray ( new RDN [ 0 ] ) ) ; GeneralNames fullNames = new GeneralNames ( ) ; fullNames . add ( new Gen...
Append relative name to the issuer name and return a new GeneralNames object .
26,980
private static boolean issues ( X509CertImpl cert , X509CRLImpl crl , String provider ) throws IOException { boolean matched = false ; AdaptableX509CertSelector issuerSelector = new AdaptableX509CertSelector ( ) ; boolean [ ] usages = cert . getKeyUsage ( ) ; if ( usages != null ) { usages [ 6 ] = true ; issuerSelector...
Verifies whether a CRL is issued by a certain certificate
26,981
public void addUnchanged ( int unchangedLength ) { if ( unchangedLength < 0 ) { throw new IllegalArgumentException ( "addUnchanged(" + unchangedLength + "): length must not be negative" ) ; } int last = lastUnit ( ) ; if ( last < MAX_UNCHANGED ) { int remaining = MAX_UNCHANGED - last ; if ( remaining >= unchangedLength...
Adds a record for an unchanged segment of text . Normally called from inside ICU string transformation functions not user code .
26,982
public static int skipWhiteSpace ( CharSequence s , int i ) { while ( i < s . length ( ) && isWhiteSpace ( s . charAt ( i ) ) ) { ++ i ; } return i ; }
Skips over Pattern_White_Space starting at index i of the CharSequence .
26,983
public static boolean isIdentifier ( CharSequence s ) { int limit = s . length ( ) ; if ( limit == 0 ) { return false ; } int start = 0 ; do { if ( isSyntaxOrWhiteSpace ( s . charAt ( start ++ ) ) ) { return false ; } } while ( start < limit ) ; return true ; }
Tests whether the CharSequence contains a pattern identifier that is whether it contains only non - Pattern_White_Space non - Pattern_Syntax characters .
26,984
public static int skipIdentifier ( CharSequence s , int i ) { while ( i < s . length ( ) && ! isSyntaxOrWhiteSpace ( s . charAt ( i ) ) ) { ++ i ; } return i ; }
Skips over a pattern identifier starting at index i of the CharSequence .
26,985
public DurationFormatterFactory setPeriodFormatter ( PeriodFormatter formatter ) { if ( formatter != this . formatter ) { this . formatter = formatter ; reset ( ) ; } return this ; }
Set the period formatter used by the factory . New formatters created with this factory will use the given period formatter .
26,986
public DurationFormatterFactory setPeriodBuilder ( PeriodBuilder builder ) { if ( builder != this . builder ) { this . builder = builder ; reset ( ) ; } return this ; }
Set the builder used by the factory . New formatters created with this factory will use the given locale .
26,987
public DurationFormatterFactory setFallback ( DateFormatter fallback ) { boolean doReset = fallback == null ? this . fallback != null : ! fallback . equals ( this . fallback ) ; if ( doReset ) { this . fallback = fallback ; reset ( ) ; } return this ; }
Set a fallback formatter for durations over a given limit .
26,988
public DurationFormatterFactory setFallbackLimit ( long fallbackLimit ) { if ( fallbackLimit < 0 ) { fallbackLimit = 0 ; } if ( fallbackLimit != this . fallbackLimit ) { this . fallbackLimit = fallbackLimit ; reset ( ) ; } return this ; }
Set a fallback limit for durations over a given limit .
26,989
public DurationFormatter getFormatter ( ) { if ( f == null ) { if ( fallback != null ) { fallback = fallback . withLocale ( localeName ) . withTimeZone ( timeZone ) ; } formatter = getPeriodFormatter ( ) ; builder = getPeriodBuilder ( ) ; f = createFormatter ( ) ; } return f ; }
Return a formatter based on this factory s current settings .
26,990
public PeriodFormatter getPeriodFormatter ( ) { if ( formatter == null ) { formatter = ps . newPeriodFormatterFactory ( ) . setLocale ( localeName ) . getFormatter ( ) ; } return formatter ; }
Return the current period formatter .
26,991
public PeriodBuilder getPeriodBuilder ( ) { if ( builder == null ) { builder = ps . newPeriodBuilderFactory ( ) . setLocale ( localeName ) . setTimeZone ( timeZone ) . getSingleUnitBuilder ( ) ; } return builder ; }
Return the current builder .
26,992
public boolean [ ] getKeyUsageMappedBits ( ) { KeyUsageExtension keyUsage = new KeyUsageExtension ( ) ; Boolean val = Boolean . TRUE ; try { if ( isSet ( getPosition ( SSL_CLIENT ) ) || isSet ( getPosition ( S_MIME ) ) || isSet ( getPosition ( OBJECT_SIGNING ) ) ) keyUsage . set ( KeyUsageExtension . DIGITAL_SIGNATURE ...
Get a boolean array representing the bits of this extension as it maps to the KeyUsage extension .
26,993
public int next ( int options ) { int c = DONE ; isEscaped = false ; for ( ; ; ) { c = _current ( ) ; _advance ( UTF16 . getCharCount ( c ) ) ; if ( c == SymbolTable . SYMBOL_REF && buf == null && ( options & PARSE_VARIABLES ) != 0 && sym != null ) { String name = sym . parseReference ( text , pos , text . length ( ) )...
Returns the next character using the given options or DONE if there are no more characters and advance the position to the next character .
26,994
private int _current ( ) { if ( buf != null ) { return UTF16 . charAt ( buf , 0 , buf . length , bufPos ) ; } else { int i = pos . getIndex ( ) ; return ( i < text . length ( ) ) ? UTF16 . charAt ( text , i ) : DONE ; } }
Returns the current 32 - bit code point without parsing escapes parsing variables or skipping whitespace .
26,995
private void _advance ( int count ) { if ( buf != null ) { bufPos += count ; if ( bufPos == buf . length ) { buf = null ; } } else { pos . setIndex ( pos . getIndex ( ) + count ) ; if ( pos . getIndex ( ) > text . length ( ) ) { pos . setIndex ( text . length ( ) ) ; } } }
Advances the position by the given amount .
26,996
public static String getISO3Country ( String country ) { int offset = findIndex ( _countries , country ) ; if ( offset >= 0 ) { return _countries3 [ offset ] ; } else { offset = findIndex ( _obsoleteCountries , country ) ; if ( offset >= 0 ) { return _obsoleteCountries3 [ offset ] ; } } return "" ; }
Returns a three - letter abbreviation for the provided country . If the provided country is empty returns the empty string . Otherwise returns an uppercase ISO 3166 3 - letter country code .
26,997
private static int findIndex ( String [ ] array , String target ) { for ( int i = 0 ; i < array . length ; i ++ ) { if ( target . equals ( array [ i ] ) ) { return i ; } } return - 1 ; }
linear search of the string array . the arrays are unfortunately ordered by the two - letter target code not the three - letter search code which seems backwards .
26,998
public void setFeature ( String name , boolean value ) throws SAXNotRecognizedException , SAXNotSupportedException { if ( parent != null ) { parent . setFeature ( name , value ) ; } else { throw new SAXNotRecognizedException ( "Feature: " + name ) ; } }
Set the value of a feature .
26,999
public void init ( Compiler compiler , int opPos , int stepType ) throws javax . xml . transform . TransformerException { super . init ( compiler , opPos , stepType ) ; switch ( stepType ) { case OpCodes . OP_FUNCTION : case OpCodes . OP_EXTFUNCTION : m_mustHardReset = true ; case OpCodes . OP_GROUP : case OpCodes . OP...
Init a FilterExprWalker .