idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
27,500
static void drop6 ( FileDescriptor fd , byte [ ] group , int index , byte [ ] source ) throws IOException { joinOrDrop6 ( false , fd , group , index , source ) ; }
Drop membership of IPv6 multicast group
27,501
static int block6 ( FileDescriptor fd , byte [ ] group , int index , byte [ ] source ) throws IOException { return blockOrUnblock6 ( true , fd , group , index , source ) ; }
Block IPv6 source
27,502
private void writeTag ( ) { if ( dataPos == dataSize ) return ; int tag = data [ dataPos ++ ] ; if ( isEOC ( tag ) && ( data [ dataPos ] == 0 ) ) { dataPos ++ ; writeTag ( ) ; } else newData [ newDataPos ++ ] = ( byte ) tag ; }
Write the tag and if it is an end - of - contents tag then skip the tag and its 1 byte length of zero .
27,503
private void writeLengthAndValue ( ) throws IOException { if ( dataPos == dataSize ) return ; int curLen = 0 ; int lenByte = data [ dataPos ++ ] & 0xff ; if ( isIndefinite ( lenByte ) ) { byte [ ] lenBytes = ( byte [ ] ) ndefsList . get ( index ++ ) ; System . arraycopy ( lenBytes , 0 , newData , newDataPos , lenBytes ...
Write the length and if it is an indefinite length then calculate the definite length from the positions of the indefinite length and its matching EOC terminator . Then write the value .
27,504
private int getNumOfLenBytes ( int len ) { int numOfLenBytes = 0 ; if ( len < 128 ) { numOfLenBytes = 1 ; } else if ( len < ( 1 << 8 ) ) { numOfLenBytes = 2 ; } else if ( len < ( 1 << 16 ) ) { numOfLenBytes = 3 ; } else if ( len < ( 1 << 24 ) ) { numOfLenBytes = 4 ; } else { numOfLenBytes = 5 ; } return numOfLenBytes ;...
in ASN . 1 notation
27,505
private void writeValue ( int curLen ) { for ( int i = 0 ; i < curLen ; i ++ ) newData [ newDataPos ++ ] = data [ dataPos ++ ] ; }
Write the value ;
27,506
byte [ ] convert ( byte [ ] indefData ) throws IOException { data = indefData ; dataPos = 0 ; index = 0 ; dataSize = data . length ; int len = 0 ; int unused = 0 ; while ( dataPos < dataSize ) { parseTag ( ) ; len = parseLength ( ) ; parseValue ( len ) ; if ( unresolved == 0 ) { unused = dataSize - dataPos ; dataSize =...
Converts a indefinite length DER encoded byte array to a definte length DER encoding .
27,507
@ SuppressWarnings ( "rawtypes" ) public Object getContent ( URLConnection urlc , Class [ ] classes ) throws IOException { Object obj = getContent ( urlc ) ; for ( int i = 0 ; i < classes . length ; i ++ ) { if ( classes [ i ] . isInstance ( obj ) ) { return obj ; } } return null ; }
Given a URL connect stream positioned at the beginning of the representation of an object this method reads that stream and creates an object that matches one of the types specified .
27,508
private static int parseNumber ( CharSequence offsetId , int pos , boolean precededByColon ) { if ( precededByColon && offsetId . charAt ( pos - 1 ) != ':' ) { throw new DateTimeException ( "Invalid ID for ZoneOffset, colon not found when expected: " + offsetId ) ; } char ch1 = offsetId . charAt ( pos ) ; char ch2 = of...
Parse a two digit zero - prefixed number .
27,509
private static void validate ( int hours , int minutes , int seconds ) { if ( hours < - 18 || hours > 18 ) { throw new DateTimeException ( "Zone offset hours not in valid range: value " + hours + " is not in the range -18 to 18" ) ; } if ( hours > 0 ) { if ( minutes < 0 || seconds < 0 ) { throw new DateTimeException ( ...
Validates the offset fields .
27,510
public void namespaceAfterStartElement ( final String prefix , final String uri ) throws SAXException { startPrefixMapping ( prefix , uri , false ) ; }
Send a namespace declaration in the output document . The namespace declaration will not be include if the namespace is already in scope with the same prefix .
27,511
protected boolean popNamespace ( String prefix ) { try { if ( m_prefixMap . popNamespace ( prefix ) ) { m_saxHandler . endPrefixMapping ( prefix ) ; return true ; } } catch ( SAXException e ) { } return false ; }
Undeclare the namespace that is currently pointed to by a given prefix . Inform SAX handler if prefix was previously mapped .
27,512
protected int getNextNode ( ) { if ( null != m_exprObj ) { m_lastFetched = m_exprObj . nextNode ( ) ; } else m_lastFetched = DTM . NULL ; return m_lastFetched ; }
Get the next node via getNextXXX . Bottlenecked for derived class override .
27,513
public boolean hasSpansIntersecting ( int start , int end ) { for ( int i = 0 ; i < numberOfSpans ; i ++ ) { if ( spanStarts [ i ] >= end || spanEnds [ i ] <= start ) continue ; return true ; } return false ; }
Returns true if there are spans intersecting the given interval .
27,514
private boolean shouldAcceptInternal ( URI uri , HttpCookie cookie ) { try { return policyCallback . shouldAccept ( uri , cookie ) ; } catch ( Exception ignored ) { return false ; } }
to determine whether or not accept this cookie
27,515
public synchronized void releaseXMLReader ( XMLReader reader ) { if ( m_readers . get ( ) == reader && reader != null ) { m_inUse . remove ( reader ) ; } }
Mark the cached XMLReader as available . If the reader was not actually in the cache do nothing .
27,516
public PatternTokenizer setExtraQuotingCharacters ( UnicodeSet syntaxCharacters ) { this . extraQuotingCharacters = ( UnicodeSet ) syntaxCharacters . clone ( ) ; needingQuoteCharacters = null ; return this ; }
Sets the extra characters to be quoted in literals
27,517
public String quoteLiteral ( String string ) { if ( needingQuoteCharacters == null ) { needingQuoteCharacters = new UnicodeSet ( ) . addAll ( syntaxCharacters ) . addAll ( ignorableCharacters ) . addAll ( extraQuotingCharacters ) ; if ( usingSlash ) needingQuoteCharacters . add ( BACK_SLASH ) ; if ( usingQuote ) needin...
Quote a literal string using the available settings . Thus syntax characters quote characters and ignorable characters will be put into quotes .
27,518
public static List < String > appendLines ( List < String > result , String file , String encoding ) throws IOException { InputStream is = new FileInputStream ( file ) ; try { return appendLines ( result , is , encoding ) ; } finally { is . close ( ) ; } }
Utility for loading lines from a file .
27,519
public static List < String > appendLines ( List < String > result , InputStream inputStream , String encoding ) throws UnsupportedEncodingException , IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( inputStream , encoding == null ? "UTF-8" : encoding ) ) ; while ( true ) { String line = i...
Utility for loading lines from a UTF8 file .
27,520
static ByteBuffer getTemporaryDirectBuffer ( int size ) { BufferCache cache = bufferCache . get ( ) ; ByteBuffer buf = cache . get ( size ) ; if ( buf != null ) { return buf ; } else { if ( ! cache . isEmpty ( ) ) { buf = cache . removeFirst ( ) ; free ( buf ) ; } return ByteBuffer . allocateDirect ( size ) ; } }
Returns a temporary buffer of at least the given size
27,521
static void offerFirstTemporaryDirectBuffer ( ByteBuffer buf ) { assert buf != null ; BufferCache cache = bufferCache . get ( ) ; if ( ! cache . offerFirst ( buf ) ) { free ( buf ) ; } }
Releases a temporary buffer by returning to the cache or freeing it . If returning to the cache then insert it at the start so that it is likely to be returned by a subsequent call to getTemporaryDirectBuffer .
27,522
private static void free ( ByteBuffer buf ) { Cleaner cleaner = ( ( DirectBuffer ) buf ) . cleaner ( ) ; if ( cleaner != null ) { cleaner . clean ( ) ; } }
Frees the memory for the given direct buffer
27,523
public boolean appendPrefix ( int tl , int td , StringBuffer sb ) { if ( dr . scopeData != null ) { int ix = tl * 3 + td ; ScopeData sd = dr . scopeData [ ix ] ; if ( sd != null ) { String prefix = sd . prefix ; if ( prefix != null ) { sb . append ( prefix ) ; return sd . requiresDigitPrefix ; } } } return false ; }
Append the appropriate prefix to the string builder depending on whether and how a limit and direction are to be displayed .
27,524
public void appendSuffix ( int tl , int td , StringBuffer sb ) { if ( dr . scopeData != null ) { int ix = tl * 3 + td ; ScopeData sd = dr . scopeData [ ix ] ; if ( sd != null ) { String suffix = sd . suffix ; if ( suffix != null ) { if ( trace ) { System . out . println ( "appendSuffix '" + suffix + "'" ) ; } sb . appe...
Append the appropriate suffix to the string builder depending on whether and how a limit and direction are to be displayed .
27,525
public void appendCountValue ( int count , int integralDigits , int decimalDigits , StringBuffer sb ) { int ival = count / 1000 ; if ( decimalDigits == 0 ) { appendInteger ( ival , integralDigits , 10 , sb ) ; return ; } if ( dr . requiresDigitSeparator && sb . length ( ) > 0 ) { sb . append ( ' ' ) ; } appendDigits ( ...
Append a count value to the builder .
27,526
public void appendDigits ( long num , int mindigits , int maxdigits , StringBuffer sb ) { char [ ] buf = new char [ maxdigits ] ; int ix = maxdigits ; while ( ix > 0 && num > 0 ) { buf [ -- ix ] = ( char ) ( dr . zero + ( num % 10 ) ) ; num /= 10 ; } for ( int e = maxdigits - mindigits ; ix > e ; ) { buf [ -- ix ] = dr...
Append digits to the string builder using this . zero for 0 etc .
27,527
public void appendSkippedUnit ( StringBuffer sb ) { if ( dr . skippedUnitMarker != null ) { sb . append ( dr . skippedUnitMarker ) ; } }
Append a marker for skipped units internal to a string .
27,528
public boolean appendUnitSeparator ( TimeUnit unit , boolean longSep , boolean afterFirst , boolean beforeLast , StringBuffer sb ) { if ( ( longSep && dr . unitSep != null ) || dr . shortUnitSep != null ) { if ( longSep && dr . unitSep != null ) { int ix = ( afterFirst ? 2 : 0 ) + ( beforeLast ? 1 : 0 ) ; sb . append (...
Append the appropriate separator between units
27,529
public void encode ( DerOutputStream out , byte tag ) throws IOException { byte [ ] bytes = id . toByteArray ( ) ; int excessBits = bytes . length * 8 - id . length ( ) ; out . write ( tag ) ; out . putLength ( bytes . length + 1 ) ; out . write ( excessBits ) ; out . write ( bytes ) ; }
Encode the UniqueIdentity in DER form to the stream .
27,530
protected void startNode ( int node ) throws org . xml . sax . SAXException { XPathContext xcntxt = m_transformer . getXPathContext ( ) ; try { if ( DTM . ELEMENT_NODE == m_dtm . getNodeType ( node ) ) { xcntxt . pushCurrentNode ( node ) ; if ( m_startNode != node ) { super . startNode ( node ) ; } else { String elemNa...
Start traversal of the tree at the given node
27,531
public void encode ( OutputStream out , boolean isExplicit ) throws CRLException { try { DerOutputStream extOut = new DerOutputStream ( ) ; Collection < Extension > allExts = map . values ( ) ; Object [ ] objs = allExts . toArray ( ) ; for ( int i = 0 ; i < objs . length ; i ++ ) { if ( objs [ i ] instanceof CertAttrSe...
Encode the extensions in DER form to the stream .
27,532
public Extension get ( String alias ) { X509AttributeName attr = new X509AttributeName ( alias ) ; String name ; String id = attr . getPrefix ( ) ; if ( id . equalsIgnoreCase ( X509CertImpl . NAME ) ) { int index = alias . lastIndexOf ( "." ) ; name = alias . substring ( index + 1 ) ; } else name = alias ; return map ....
Get the extension with this alias .
27,533
public void set ( String alias , Object obj ) { map . put ( alias , ( Extension ) obj ) ; }
Set the extension value with this alias .
27,534
public RbnfLenientScanner get ( ULocale locale , String extras ) { RbnfLenientScanner result = null ; String key = locale . toString ( ) + "/" + extras ; synchronized ( cache ) { result = cache . get ( key ) ; if ( result != null ) { return result ; } } result = createScanner ( locale , extras ) ; synchronized ( cache ...
Returns a collation - based scanner .
27,535
private Expression compileOperation ( Operation operation , int opPos ) throws TransformerException { int leftPos = getFirstChildPos ( opPos ) ; int rightPos = getNextOpPos ( leftPos ) ; operation . setLeftRight ( compile ( leftPos ) , compile ( rightPos ) ) ; return operation ; }
Bottle - neck compilation of an operation with left and right operands .
27,536
private Expression compileUnary ( UnaryOperation unary , int opPos ) throws TransformerException { int rightPos = getFirstChildPos ( opPos ) ; unary . setRight ( compile ( rightPos ) ) ; return unary ; }
Bottle - neck compilation of a unary operation .
27,537
protected Expression literal ( int opPos ) { opPos = getFirstChildPos ( opPos ) ; return ( XString ) getTokenQueue ( ) . elementAt ( getOp ( opPos ) ) ; }
Compile a literal string value .
27,538
protected Expression numberlit ( int opPos ) { opPos = getFirstChildPos ( opPos ) ; return ( XNumber ) getTokenQueue ( ) . elementAt ( getOp ( opPos ) ) ; }
Compile a literal number value .
27,539
protected Expression variable ( int opPos ) throws TransformerException { Variable var = new Variable ( ) ; opPos = getFirstChildPos ( opPos ) ; int nsPos = getOp ( opPos ) ; java . lang . String namespace = ( OpCodes . EMPTY == nsPos ) ? null : ( java . lang . String ) getTokenQueue ( ) . elementAt ( nsPos ) ; java . ...
Compile a variable reference .
27,540
protected Expression matchPattern ( int opPos ) throws TransformerException { locPathDepth ++ ; try { int nextOpPos = opPos ; int i ; for ( i = 0 ; getOp ( nextOpPos ) == OpCodes . OP_LOCATIONPATHPATTERN ; i ++ ) { nextOpPos = getNextOpPos ( nextOpPos ) ; } if ( i == 1 ) return compile ( opPos ) ; UnionPattern up = new...
Compile an entire match pattern expression .
27,541
public Expression locationPathPattern ( int opPos ) throws TransformerException { opPos = getFirstChildPos ( opPos ) ; return stepPattern ( opPos , 0 , null ) ; }
Compile a location match pattern unit expression .
27,542
protected StepPattern stepPattern ( int opPos , int stepCount , StepPattern ancestorPattern ) throws TransformerException { int startOpPos = opPos ; int stepType = getOp ( opPos ) ; if ( OpCodes . ENDOP == stepType ) { return null ; } boolean addMagicSelf = true ; int endStep = getNextOpPos ( opPos ) ; StepPattern patt...
Compile a step pattern unit expression used for both location paths and match patterns .
27,543
public Expression [ ] getCompiledPredicates ( int opPos ) throws TransformerException { int count = countPredicates ( opPos ) ; if ( count > 0 ) { Expression [ ] predicates = new Expression [ count ] ; compilePredicates ( opPos , predicates ) ; return predicates ; } return null ; }
Compile a zero or more predicates for a given match pattern .
27,544
public int countPredicates ( int opPos ) throws TransformerException { int count = 0 ; while ( OpCodes . OP_PREDICATE == getOp ( opPos ) ) { count ++ ; opPos = getNextOpPos ( opPos ) ; } return count ; }
Count the number of predicates in the step .
27,545
private void compilePredicates ( int opPos , Expression [ ] predicates ) throws TransformerException { for ( int i = 0 ; OpCodes . OP_PREDICATE == getOp ( opPos ) ; i ++ ) { predicates [ i ] = predicate ( opPos ) ; opPos = getNextOpPos ( opPos ) ; } }
Compiles predicates in the step .
27,546
Expression compileFunction ( int opPos ) throws TransformerException { int endFunc = opPos + getOp ( opPos + 1 ) - 1 ; opPos = getFirstChildPos ( opPos ) ; int funcID = getOp ( opPos ) ; opPos ++ ; if ( - 1 != funcID ) { Function func = m_functionTable . getFunction ( funcID ) ; if ( func instanceof FuncExtFunctionAvai...
Compile a built - in XPath function .
27,547
private Expression compileExtension ( int opPos ) throws TransformerException { int endExtFunc = opPos + getOp ( opPos + 1 ) - 1 ; opPos = getFirstChildPos ( opPos ) ; java . lang . String ns = ( java . lang . String ) getTokenQueue ( ) . elementAt ( getOp ( opPos ) ) ; opPos ++ ; java . lang . String funcName = ( java...
Compile an extension function .
27,548
public synchronized void addObserver ( Observer o ) { if ( o == null ) throw new NullPointerException ( ) ; if ( ! observers . contains ( o ) ) { observers . add ( o ) ; } }
Adds an observer to the set of observers for this object provided that it is not the same as some observer already in the set . The order in which notifications will be delivered to multiple observers is not specified . See the class comment .
27,549
public static long incTwoBytePrimaryByOffset ( long basePrimary , boolean isCompressible , int offset ) { long primary ; if ( isCompressible ) { offset += ( ( int ) ( basePrimary >> 16 ) & 0xff ) - 4 ; primary = ( ( offset % 251 ) + 4 ) << 16 ; offset /= 251 ; } else { offset += ( ( int ) ( basePrimary >> 16 ) & 0xff )...
Increments a 2 - byte primary by a code point offset .
27,550
public static long incThreeBytePrimaryByOffset ( long basePrimary , boolean isCompressible , int offset ) { offset += ( ( int ) ( basePrimary >> 8 ) & 0xff ) - 2 ; long primary = ( ( offset % 254 ) + 2 ) << 8 ; offset /= 254 ; if ( isCompressible ) { offset += ( ( int ) ( basePrimary >> 16 ) & 0xff ) - 4 ; primary |= (...
Increments a 3 - byte primary by a code point offset .
27,551
static long getThreeBytePrimaryForOffsetData ( int c , long dataCE ) { long p = dataCE >>> 32 ; int lower32 = ( int ) dataCE ; int offset = ( c - ( lower32 >> 8 ) ) * ( lower32 & 0x7f ) ; boolean isCompressible = ( lower32 & 0x80 ) != 0 ; return Collation . incThreeBytePrimaryByOffset ( p , isCompressible , offset ) ; ...
Computes a 3 - byte primary for c s OFFSET_TAG data CE .
27,552
static long unassignedPrimaryFromCodePoint ( int c ) { ++ c ; long primary = 2 + ( c % 18 ) * 14 ; c /= 18 ; primary |= ( 2 + ( c % 254 ) ) << 8 ; c /= 254 ; primary |= ( 4 + ( c % 251 ) ) << 16 ; return primary | ( ( long ) UNASSIGNED_IMPLICIT_BYTE << 24 ) ; }
Returns the unassigned - character implicit primary weight for any valid code point c .
27,553
static Person PromptForAddress ( BufferedReader stdin , PrintStream stdout ) throws IOException { Person . Builder person = Person . newBuilder ( ) ; stdout . print ( "Enter person ID: " ) ; person . setId ( Integer . valueOf ( stdin . readLine ( ) ) ) ; stdout . print ( "Enter name: " ) ; person . setName ( stdin . re...
This function fills in a Person message based on user input .
27,554
private void writeObject ( java . io . ObjectOutputStream s ) throws IOException { s . writeObject ( thisX500Name . getEncodedInternal ( ) ) ; }
Save the X500Principal object to a stream .
27,555
public final void addElements ( int value , int numberOfElements ) { if ( ( m_firstFree + numberOfElements ) >= m_mapSize ) { m_mapSize += ( m_blocksize + numberOfElements ) ; int newMap [ ] = new int [ m_mapSize ] ; System . arraycopy ( m_map , 0 , newMap , 0 , m_firstFree + 1 ) ; m_map = newMap ; } for ( int i = 0 ; ...
Append several int values onto the vector .
27,556
public double num ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { return m_right . num ( xctxt ) ; }
Evaluate this operation directly to a double .
27,557
private static boolean hasAnnotation ( String pkgInfo , String annotation ) { if ( ! annotation . contains ( "." ) ) { ErrorUtil . warning ( annotation + " is not a fully qualified name" ) ; } if ( pkgInfo . contains ( "@" + annotation ) ) { return true ; } int idx = annotation . lastIndexOf ( "." ) ; String annotation...
Return true if pkgInfo has the specified annotation .
27,558
public final Buffer limit ( int newLimit ) { if ( ( newLimit > capacity ) || ( newLimit < 0 ) ) throw new IllegalArgumentException ( ) ; limit = newLimit ; if ( position > limit ) position = limit ; if ( mark > limit ) mark = - 1 ; return this ; }
Sets this buffer s limit . If the position is larger than the new limit then it is set to the new limit . If the mark is defined and larger than the new limit then it is discarded .
27,559
public int getLength ( ) { if ( m_count == - 1 ) { short count = 0 ; for ( int n = dtm . getFirstAttribute ( element ) ; n != - 1 ; n = dtm . getNextAttribute ( n ) ) { ++ count ; } m_count = count ; } return ( int ) m_count ; }
Return the number of Attributes on this Element
27,560
public Node getNamedItem ( String name ) { for ( int n = dtm . getFirstAttribute ( element ) ; n != DTM . NULL ; n = dtm . getNextAttribute ( n ) ) { if ( dtm . getNodeName ( n ) . equals ( name ) ) return dtm . getNode ( n ) ; } return null ; }
Retrieves a node specified by name .
27,561
public void setTimeInMillis ( long millis ) { if ( time == millis && isTimeSet && areFieldsSet && areAllFieldsSet ) { return ; } time = millis ; isTimeSet = true ; areFieldsSet = false ; computeFields ( ) ; areAllFieldsSet = areFieldsSet = true ; }
Sets this Calendar s current time from the given long value .
27,562
public void set ( int field , int value ) { if ( areFieldsSet && ! areAllFieldsSet ) { computeFields ( ) ; } internalSet ( field , value ) ; isTimeSet = false ; areFieldsSet = false ; isSet [ field ] = true ; stamp [ field ] = nextStamp ++ ; if ( nextStamp == Integer . MAX_VALUE ) { adjustStamp ( ) ; } }
Sets the given calendar field to the given value . The value is not interpreted by this method regardless of the leniency mode .
27,563
private static int aggregateStamp ( int stamp_a , int stamp_b ) { if ( stamp_a == UNSET || stamp_b == UNSET ) { return UNSET ; } return ( stamp_a > stamp_b ) ? stamp_a : stamp_b ; }
Returns the pseudo - time - stamp for two fields given their individual pseudo - time - stamps . If either of the fields is unset then the aggregate is unset . Otherwise the aggregate is the later of the two stamps .
27,564
public void setTimeZone ( TimeZone value ) { zone = value ; sharedZone = false ; areAllFieldsSet = areFieldsSet = false ; }
Sets the time zone with the given time zone value .
27,565
public TimeZone getTimeZone ( ) { if ( sharedZone ) { zone = ( TimeZone ) zone . clone ( ) ; sharedZone = false ; } return zone ; }
Gets the time zone .
27,566
private void setWeekCountData ( Locale desiredLocale ) { int [ ] data = cachedLocaleData . get ( desiredLocale ) ; if ( data == null ) { data = new int [ 2 ] ; LocaleData localeData = LocaleData . get ( desiredLocale ) ; data [ 0 ] = localeData . firstDayOfWeek . intValue ( ) ; data [ 1 ] = localeData . minimalDaysInFi...
Both firstDayOfWeek and minimalDaysInFirstWeek are locale - dependent . They are used to figure out the week count for a specific date for a given locale . These must be set when a Calendar is constructed .
27,567
private void invalidateWeekFields ( ) { if ( stamp [ WEEK_OF_MONTH ] != COMPUTED && stamp [ WEEK_OF_YEAR ] != COMPUTED ) { return ; } Calendar cal = ( Calendar ) clone ( ) ; cal . setLenient ( true ) ; cal . clear ( WEEK_OF_MONTH ) ; cal . clear ( WEEK_OF_YEAR ) ; if ( stamp [ WEEK_OF_MONTH ] == COMPUTED ) { int weekOf...
Sets the WEEK_OF_MONTH and WEEK_OF_YEAR fields to new values with the new parameter value if they have been calculated internally .
27,568
public static boolean isNodeTheSame ( Node node1 , Node node2 ) { if ( node1 instanceof DTMNodeProxy && node2 instanceof DTMNodeProxy ) return ( ( DTMNodeProxy ) node1 ) . equals ( ( DTMNodeProxy ) node2 ) ; else return ( node1 == node2 ) ; }
Use DTMNodeProxy to determine whether two nodes are the same .
27,569
public String getNamespaceForPrefix ( String prefix , Element namespaceContext ) { int type ; Node parent = namespaceContext ; String namespace = null ; if ( prefix . equals ( "xml" ) ) { namespace = QName . S_XMLNAMESPACEURI ; } else if ( prefix . equals ( "xmlns" ) ) { namespace = "http://www.w3.org/2000/xmlns/" ; } ...
Given an XML Namespace prefix and a context in which the prefix is to be evaluated return the Namespace Name this prefix was bound to . Note that DOM Level 3 is expected to provide a version of this which deals with the DOM s early binding behavior .
27,570
public String getLocalNameOfNode ( Node n ) { String qname = n . getNodeName ( ) ; int index = qname . indexOf ( ':' ) ; return ( index < 0 ) ? qname : qname . substring ( index + 1 ) ; }
Returns the local name of the given node . If the node s name begins with a namespace prefix this is the part after the colon ; otherwise it s the full node name .
27,571
public boolean isNamespaceNode ( Node n ) { if ( Node . ATTRIBUTE_NODE == n . getNodeType ( ) ) { String attrName = n . getNodeName ( ) ; return ( attrName . startsWith ( "xmlns:" ) || attrName . equals ( "xmlns" ) ) ; } return false ; }
Test whether the given node is a namespace decl node . In DOM Level 2 this can be done in a namespace - aware manner but in Level 1 DOMs it has to be done by testing the node name .
27,572
public LocalDate dateYearDay ( Era era , int yearOfEra , int dayOfYear ) { return dateYearDay ( prolepticYear ( era , yearOfEra ) , dayOfYear ) ; }
Obtains an ISO local date from the era year - of - era and day - of - year fields .
27,573
public String getMessageAndLocation ( ) { StringBuilder sbuffer = new StringBuilder ( ) ; String message = super . getMessage ( ) ; if ( null != message ) { sbuffer . append ( message ) ; } if ( null != locator ) { String systemID = locator . getSystemId ( ) ; int line = locator . getLineNumber ( ) ; int column = locat...
Get the error message with location information appended .
27,574
public String getLocationAsString ( ) { if ( null != locator ) { StringBuilder sbuffer = new StringBuilder ( ) ; String systemID = locator . getSystemId ( ) ; int line = locator . getLineNumber ( ) ; int column = locator . getColumnNumber ( ) ; if ( null != systemID ) { sbuffer . append ( "; SystemID: " ) ; sbuffer . a...
Get the location information as a string .
27,575
public void setXMLReader ( XMLReader eventsource ) { fXMLReader = eventsource ; eventsource . setContentHandler ( this ) ; eventsource . setDTDHandler ( this ) ; eventsource . setErrorHandler ( this ) ; try { eventsource . setProperty ( "http://xml.org/sax/properties/lexical-handler" , this ) ; } catch ( SAXNotRecogniz...
Bind our input streams to an XMLReader .
27,576
public void notationDecl ( String a , String b , String c ) throws SAXException { if ( null != clientDTDHandler ) clientDTDHandler . notationDecl ( a , b , c ) ; }
DTDHandler support .
27,577
private void co_yield ( boolean moreRemains ) throws SAXException { if ( fNoMoreEvents ) return ; try { Object arg = Boolean . FALSE ; if ( moreRemains ) { arg = fCoroutineManager . co_resume ( Boolean . TRUE , fSourceCoroutineID , fControllerCoroutineID ) ; } if ( arg == Boolean . FALSE ) { fNoMoreEvents = true ; if (...
Co_Yield handles coroutine interactions while a parse is in progress .
27,578
public void initializeSerializerProps ( ) { fDOMConfigProperties . setProperty ( DOMConstants . S_DOM3_PROPERTIES_NS + DOMConstants . DOM_CANONICAL_FORM , DOMConstants . DOM3_DEFAULT_FALSE ) ; fDOMConfigProperties . setProperty ( DOMConstants . S_DOM3_PROPERTIES_NS + DOMConstants . DOM_CDATA_SECTIONS , DOMConstants . D...
Initializes the underlying serializer s configuration depending on the default DOMConfiguration parameters . This method must be called before a node is to be serialized .
27,579
public boolean canSetParameter ( String name , Object value ) { if ( value instanceof Boolean ) { if ( name . equalsIgnoreCase ( DOMConstants . DOM_CDATA_SECTIONS ) || name . equalsIgnoreCase ( DOMConstants . DOM_COMMENTS ) || name . equalsIgnoreCase ( DOMConstants . DOM_ENTITIES ) || name . equalsIgnoreCase ( DOMConst...
Checks if setting a parameter to a specific value is supported .
27,580
public String writeToString ( Node nodeArg ) throws DOMException , LSException { if ( nodeArg == null ) { return null ; } Serializer serializer = fXMLSerializer ; serializer . reset ( ) ; if ( nodeArg != fVisitedNode ) { String xmlVersion = getXMLVersion ( nodeArg ) ; serializer . getOutputFormat ( ) . setProperty ( "v...
Serializes the specified node and returns a String with the serialized data to the caller .
27,581
protected String getXMLEncoding ( Node nodeArg ) { Document doc = null ; if ( nodeArg != null ) { if ( nodeArg . getNodeType ( ) == Node . DOCUMENT_NODE ) { doc = ( Document ) nodeArg ; } else { doc = nodeArg . getOwnerDocument ( ) ; } if ( doc != null && doc . getImplementation ( ) . hasFeature ( "Core" , "3.0" ) ) { ...
Determines the XML Encoding of the Document Node to serialize . If the Document Node is not a DOM Level 3 Node then the default encoding UTF - 8 is returned .
27,582
protected String getInputEncoding ( Node nodeArg ) { Document doc = null ; if ( nodeArg != null ) { if ( nodeArg . getNodeType ( ) == Node . DOCUMENT_NODE ) { doc = ( Document ) nodeArg ; } else { doc = nodeArg . getOwnerDocument ( ) ; } if ( doc != null && doc . getImplementation ( ) . hasFeature ( "Core" , "3.0" ) ) ...
Determines the Input Encoding of the Document Node to serialize . If the Document Node is not a DOM Level 3 Node then null is returned .
27,583
private static String getPathWithoutEscapes ( String origPath ) { if ( origPath != null && origPath . length ( ) != 0 && origPath . indexOf ( '%' ) != - 1 ) { StringTokenizer tokenizer = new StringTokenizer ( origPath , "%" ) ; StringBuffer result = new StringBuffer ( origPath . length ( ) ) ; int size = tokenizer . co...
Replaces all escape sequences in the given path with their literal characters .
27,584
private static LSException createLSException ( short code , Throwable cause ) { LSException lse = new LSException ( code , cause != null ? cause . getMessage ( ) : null ) ; if ( cause != null && ThrowableMethods . fgThrowableMethodsAvailable ) { try { ThrowableMethods . fgThrowableInitCauseMethod . invoke ( lse , new O...
Creates an LSException . On J2SE 1 . 4 and above the cause for the exception will be set .
27,585
private void calcMinMax ( ) throws IOException { hasMin = false ; hasMax = false ; if ( excluded != null ) { for ( int i = 0 ; i < excluded . size ( ) ; i ++ ) { GeneralSubtree subtree = excluded . get ( i ) ; if ( subtree . getMinimum ( ) != 0 ) hasMin = true ; if ( subtree . getMaximum ( ) != - 1 ) hasMax = true ; } ...
Recalculate hasMin and hasMax flags .
27,586
public boolean verify ( GeneralNameInterface name ) throws IOException { if ( name == null ) { throw new IOException ( "name is null" ) ; } if ( excluded != null && excluded . size ( ) > 0 ) { for ( int i = 0 ; i < excluded . size ( ) ; i ++ ) { GeneralSubtree gs = excluded . get ( i ) ; if ( gs == null ) continue ; Ge...
check whether a name conforms to these NameConstraints . This involves verifying that the name is consistent with the permitted and excluded subtrees variables .
27,587
public boolean verifyRFC822SpecialCase ( X500Name subject ) throws IOException { for ( AVA ava : subject . allAvas ( ) ) { ObjectIdentifier attrOID = ava . getObjectIdentifier ( ) ; if ( attrOID . equals ( ( Object ) PKCS9Attribute . EMAIL_ADDRESS_OID ) ) { String attrValue = ava . getValueString ( ) ; if ( attrValue !...
Perform the RFC 822 special case check . We have a certificate that does not contain any subject alternative names . Check that any EMAILADDRESS attributes in its subject name conform to these NameConstraints .
27,588
protected Object readResolve ( ) throws ObjectStreamException { try { if ( type == Type . SECRET && RAW . equals ( format ) ) { return new SecretKeySpec ( encoded , algorithm ) ; } else if ( type == Type . PUBLIC && X509 . equals ( format ) ) { KeyFactory f = KeyFactory . getInstance ( algorithm ) ; return f . generate...
Resolve the Key object .
27,589
public long skip ( long n ) throws IOException { if ( n < 0 ) { throw new IllegalArgumentException ( "negative skip length" ) ; } ensureOpen ( ) ; int max = ( int ) Math . min ( n , Integer . MAX_VALUE ) ; int total = 0 ; while ( total < max ) { int len = max - total ; if ( len > b . length ) { len = b . length ; } len...
Skips specified number of bytes of uncompressed data .
27,590
protected void fill ( ) throws IOException { ensureOpen ( ) ; len = in . read ( buf , 0 , buf . length ) ; if ( len == - 1 ) { throw new EOFException ( "Unexpected end of ZLIB input stream" ) ; } inf . setInput ( buf , 0 , len ) ; }
Fills input buffer with more data to decompress .
27,591
public void parseNumbers ( ) { for ( int i = '0' ; i <= '9' ; i ++ ) { tokenTypes [ i ] |= TOKEN_DIGIT ; } tokenTypes [ '.' ] |= TOKEN_DIGIT ; tokenTypes [ '-' ] |= TOKEN_DIGIT ; }
Specifies that this tokenizer shall parse numbers .
27,592
public int getLastPos ( XPathContext xctxt ) { int count = 0 ; AxesWalker savedWalker = wi ( ) . getLastUsedWalker ( ) ; try { ReverseAxesWalker clone = ( ReverseAxesWalker ) this . clone ( ) ; clone . setRoot ( this . getRoot ( ) ) ; clone . setPredicateCount ( m_predicateIndex ) ; clone . setPrevWalker ( null ) ; clo...
Get the number of nodes in this node list . The function is probably ill named?
27,593
public void check ( Certificate cert , Collection < String > unresCritExts ) throws CertPathValidatorException { X509Certificate currCert = ( X509Certificate ) cert ; i ++ ; checkBasicConstraints ( currCert ) ; verifyNameConstraints ( currCert ) ; if ( unresCritExts != null && ! unresCritExts . isEmpty ( ) ) { unresCri...
Performs the basic constraints and name constraints checks on the certificate using its internal state .
27,594
private void verifyNameConstraints ( X509Certificate currCert ) throws CertPathValidatorException { String msg = "name constraints" ; if ( debug != null ) { debug . println ( "---checking " + msg + "..." ) ; } if ( prevNC != null && ( ( i == certPathLength ) || ! X509CertImpl . isSelfIssued ( currCert ) ) ) { if ( debu...
Internal method to check the name constraints against a cert
27,595
static NameConstraintsExtension mergeNameConstraints ( X509Certificate currCert , NameConstraintsExtension prevNC ) throws CertPathValidatorException { X509CertImpl currCertImpl ; try { currCertImpl = X509CertImpl . toImpl ( currCert ) ; } catch ( CertificateException ce ) { throw new CertPathValidatorException ( ce ) ...
Helper to fold sets of name constraints together
27,596
private void checkBasicConstraints ( X509Certificate currCert ) throws CertPathValidatorException { String msg = "basic constraints" ; if ( debug != null ) { debug . println ( "---checking " + msg + "..." ) ; debug . println ( "i = " + i + ", maxPathLength = " + maxPathLength ) ; } if ( i < certPathLength ) { int pathL...
Internal method to check that a given cert meets basic constraints .
27,597
static int mergeBasicConstraints ( X509Certificate cert , int maxPathLength ) { int pathLenConstraint = cert . getBasicConstraints ( ) ; if ( ! X509CertImpl . isSelfIssued ( cert ) ) { maxPathLength -- ; } if ( pathLenConstraint < maxPathLength ) { maxPathLength = pathLenConstraint ; } return maxPathLength ; }
Merges the specified maxPathLength with the pathLenConstraint obtained from the certificate .
27,598
public synchronized Object co_entry_pause ( int thisCoroutine ) throws java . lang . NoSuchMethodException { if ( ! m_activeIDs . get ( thisCoroutine ) ) throw new java . lang . NoSuchMethodException ( ) ; while ( m_nextCoroutine != thisCoroutine ) { try { wait ( ) ; } catch ( java . lang . InterruptedException e ) { }...
In the standard coroutine architecture coroutines are identified by their method names and are launched and run up to their first yield by simply resuming them ; its s presumed that this recognizes the not - already - running case and does the right thing . We seem to need a way to achieve that same threadsafe run - up...
27,599
public synchronized Object co_resume ( Object arg_object , int thisCoroutine , int toCoroutine ) throws java . lang . NoSuchMethodException { if ( ! m_activeIDs . get ( toCoroutine ) ) throw new java . lang . NoSuchMethodException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_COROUTINE_NOT_AVAIL , new Objec...
Transfer control to another coroutine which has already been started and is waiting on this CoroutineManager . We won t return from this call until that routine has relinquished control .