idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
27,300 | private void nextSegment ( ) { assert ( checkDir > 0 && seq == rawSeq && pos != limit ) ; int p = pos ; int prevCC = 0 ; for ( ; ; ) { int q = p ; int c = Character . codePointAt ( seq , p ) ; p += Character . charCount ( c ) ; int fcd16 = nfcImpl . getFCD16 ( c ) ; int leadCC = fcd16 >> 8 ; if ( leadCC == 0 && q != po... | Extend the FCD text segment forward or normalize around pos . To be called when checkDir > 0 && pos ! = limit . Returns with checkDir == 0 and pos ! = limit . |
27,301 | private void previousSegment ( ) { assert ( checkDir < 0 && seq == rawSeq && pos != start ) ; int p = pos ; int nextCC = 0 ; for ( ; ; ) { int q = p ; int c = Character . codePointBefore ( seq , p ) ; p -= Character . charCount ( c ) ; int fcd16 = nfcImpl . getFCD16 ( c ) ; int trailCC = fcd16 & 0xff ; if ( trailCC == ... | Extend the FCD text segment backward or normalize around pos . To be called when checkDir < 0 && pos ! = start . Returns with checkDir == 0 and pos ! = start . |
27,302 | private static void setBlocker ( Thread t , Object arg ) { U . putObject ( t , PARKBLOCKER , arg ) ; } | Cannot be instantiated . |
27,303 | public static void park ( Object blocker ) { Thread t = Thread . currentThread ( ) ; setBlocker ( t , blocker ) ; U . park ( false , 0L ) ; setBlocker ( t , null ) ; } | Disables the current thread for thread scheduling purposes unless the permit is available . |
27,304 | public static void parkUntil ( Object blocker , long deadline ) { Thread t = Thread . currentThread ( ) ; setBlocker ( t , blocker ) ; U . park ( true , deadline ) ; setBlocker ( t , null ) ; } | Disables the current thread for thread scheduling purposes until the specified deadline unless the permit is available . |
27,305 | private static void writeFullyImpl ( WritableByteChannel ch , ByteBuffer bb ) throws IOException { while ( bb . remaining ( ) > 0 ) { int n = ch . write ( bb ) ; if ( n <= 0 ) throw new RuntimeException ( "no bytes written" ) ; } } | Write all remaining bytes in buffer to the given channel . If the channel is selectable then it must be configured blocking . |
27,306 | private static void writeFully ( WritableByteChannel ch , ByteBuffer bb ) throws IOException { if ( ch instanceof SelectableChannel ) { SelectableChannel sc = ( SelectableChannel ) ch ; synchronized ( sc . blockingLock ( ) ) { if ( ! sc . isBlocking ( ) ) throw new IllegalBlockingModeException ( ) ; writeFullyImpl ( ch... | Write all remaining bytes in buffer to the given channel . |
27,307 | public static InputStream newInputStream ( ReadableByteChannel ch ) { checkNotNull ( ch , "ch" ) ; return new sun . nio . ch . ChannelInputStream ( ch ) ; } | Constructs a stream that reads bytes from the given channel . |
27,308 | public static OutputStream newOutputStream ( final WritableByteChannel ch ) { checkNotNull ( ch , "ch" ) ; return new OutputStream ( ) { private ByteBuffer bb = null ; private byte [ ] bs = null ; private byte [ ] b1 = null ; public synchronized void write ( int b ) throws IOException { if ( b1 == null ) b1 = new byte ... | Constructs a stream that writes bytes to the given channel . |
27,309 | public static ReadableByteChannel newChannel ( final InputStream in ) { checkNotNull ( in , "in" ) ; if ( in instanceof FileInputStream && FileInputStream . class . equals ( in . getClass ( ) ) ) { return ( ( FileInputStream ) in ) . getChannel ( ) ; } return new ReadableByteChannelImpl ( in ) ; } | Constructs a channel that reads bytes from the given stream . |
27,310 | public static Reader newReader ( ReadableByteChannel ch , CharsetDecoder dec , int minBufferCap ) { checkNotNull ( ch , "ch" ) ; return StreamDecoder . forDecoder ( ch , dec . reset ( ) , minBufferCap ) ; } | Constructs a reader that decodes bytes from the given channel using the given decoder . |
27,311 | public static Reader newReader ( ReadableByteChannel ch , String csName ) { checkNotNull ( csName , "csName" ) ; return newReader ( ch , Charset . forName ( csName ) . newDecoder ( ) , - 1 ) ; } | Constructs a reader that decodes bytes from the given channel according to the named charset . |
27,312 | public static Writer newWriter ( final WritableByteChannel ch , final CharsetEncoder enc , final int minBufferCap ) { checkNotNull ( ch , "ch" ) ; return StreamEncoder . forEncoder ( ch , enc . reset ( ) , minBufferCap ) ; } | Constructs a writer that encodes characters using the given encoder and writes the resulting bytes to the given channel . |
27,313 | public static Writer newWriter ( WritableByteChannel ch , String csName ) { checkNotNull ( csName , "csName" ) ; return newWriter ( ch , Charset . forName ( csName ) . newEncoder ( ) , - 1 ) ; } | Constructs a writer that encodes characters according to the named charset and writes the resulting bytes to the given channel . |
27,314 | public Enumeration < JarEntry > entries ( ) { final Enumeration enum_ = super . entries ( ) ; return new Enumeration < JarEntry > ( ) { public boolean hasMoreElements ( ) { return enum_ . hasMoreElements ( ) ; } public JarFileEntry nextElement ( ) { ZipEntry ze = ( ZipEntry ) enum_ . nextElement ( ) ; return new JarFil... | Returns an enumeration of the zip file entries . |
27,315 | private void checkMemoryManagementOption ( MemoryManagementOption option ) { if ( memoryManagementOption != null && memoryManagementOption != option ) { usage ( "Multiple memory management options cannot be set." ) ; } setMemoryManagementOption ( option ) ; } | Check that the memory management option wasn t previously set to a different value . If okay then set the option . |
27,316 | public Iterable < VariableElement > getImplicitPrefixParams ( TypeElement type ) { return Iterables . transform ( getCaptures ( type ) , Capture :: getParam ) ; } | Returns all the implicit params that come before explicit params in a constructor . |
27,317 | public Iterable < VariableElement > getImplicitPostfixParams ( TypeElement type ) { if ( ElementUtil . isEnum ( type ) ) { return implicitEnumParams ; } return Collections . emptyList ( ) ; } | returns all the implicit params that come after explicit params in a constructor . |
27,318 | static Object find ( String factoryId , String fallbackClassName ) throws ConfigurationError { ClassLoader classLoader = findClassLoader ( ) ; String systemProp = System . getProperty ( factoryId ) ; if ( systemProp != null && systemProp . length ( ) > 0 ) { if ( debug ) debugPrintln ( "found " + systemProp + " in the ... | Finds the implementation Class object in the specified order . Main entry point . Package private so this code can be shared . |
27,319 | private static String which ( Class clazz ) { try { String classnameAsResource = clazz . getName ( ) . replace ( '.' , '/' ) + ".class" ; ClassLoader loader = clazz . getClassLoader ( ) ; URL it ; if ( loader != null ) { it = loader . getResource ( classnameAsResource ) ; } else { it = ClassLoader . getSystemResource (... | Returns the location where the given Class is loaded from . |
27,320 | private int getNextDelimiter ( int offset ) { if ( offset >= 0 ) { int result = offset ; int c = 0 ; if ( delims == null ) { do { c = UTF16 . charAt ( m_source_ , result ) ; if ( m_delimiters_ . contains ( c ) ) { break ; } result ++ ; } while ( result < m_length_ ) ; } else { do { c = UTF16 . charAt ( m_source_ , resu... | Gets the index of the next delimiter after offset |
27,321 | public String getSetterMethodName ( ) { if ( null == m_setterString ) { if ( m_foreignAttr == this ) { return S_FOREIGNATTR_SETTER ; } else if ( m_name . equals ( "*" ) ) { m_setterString = "addLiteralResultAttribute" ; return m_setterString ; } StringBuffer outBuf = new StringBuffer ( ) ; outBuf . append ( "set" ) ; i... | Return a string that should represent the setter method . The setter method name will be created algorithmically the first time this method is accessed and then cached for return by subsequent invocations of this method . |
27,322 | AVT processAVT ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { try { AVT avt = new AVT ( handler , uri , name , rawName , value , owner ) ; return avt ; } catch ( TransformerException te ) { throw new org . xml ... | Process an attribute string of type T_AVT into a AVT value . |
27,323 | Object processCHAR ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { if ( getSupportsAVT ( ) ) { try { AVT avt = new AVT ( handler , uri , name , rawName , value , owner ) ; if ( ( avt . isSimple ( ) ) && ( value ... | Process an attribute string of type T_CHAR into a Character value . |
27,324 | Object processENUM ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { AVT avt = null ; if ( getSupportsAVT ( ) ) { try { avt = new AVT ( handler , uri , name , rawName , value , owner ) ; if ( ! avt . isSimple ( ) ... | Process an attribute string of type T_ENUM into a int value . |
27,325 | Object processENUM_OR_PQNAME ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { Object objToReturn = null ; if ( getSupportsAVT ( ) ) { try { AVT avt = new AVT ( handler , uri , name , rawName , value , owner ) ; i... | Process an attribute string of that is either an enumerated value or a qname - but - not - ncname . Returns an AVT if this attribute support AVT ; otherwise returns int or qname . |
27,326 | Object processEXPR ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { try { XPath expr = handler . createXPath ( value , owner ) ; return expr ; } catch ( TransformerException te ) { throw new org . xml . sax . SAX... | Process an attribute string of type T_EXPR into an XPath value . |
27,327 | Object processPATTERN ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { try { XPath pattern = handler . createMatchPatternXPath ( value , owner ) ; return pattern ; } catch ( TransformerException te ) { throw new ... | Process an attribute string of type T_PATTERN into an XPath match pattern value . |
27,328 | Object processNUMBER ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { if ( getSupportsAVT ( ) ) { Double val ; AVT avt = null ; try { avt = new AVT ( handler , uri , name , rawName , value , owner ) ; if ( avt . ... | Process an attribute string of type T_NUMBER into a double value . |
27,329 | Object processNCNAME ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { if ( getSupportsAVT ( ) ) { AVT avt = null ; try { avt = new AVT ( handler , uri , name , rawName , value , owner ) ; if ( ( avt . isSimple ( ... | Process an attribute string of type NCName into a String |
27,330 | Vector processSIMPLEPATTERNLIST ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { try { StringTokenizer tokenizer = new StringTokenizer ( value , " \t\n\r\f" ) ; int nPatterns = tokenizer . countTokens ( ) ; Vecto... | Process an attribute string of type T_SIMPLEPATTERNLIST into a vector of XPath match patterns . |
27,331 | StringVector processSTRINGLIST ( StylesheetHandler handler , String uri , String name , String rawName , String value ) { StringTokenizer tokenizer = new StringTokenizer ( value , " \t\n\r\f" ) ; int nStrings = tokenizer . countTokens ( ) ; StringVector strings = new StringVector ( nStrings ) ; for ( int i = 0 ; i < nS... | Process an attribute string of type T_STRINGLIST into a vector of XPath match patterns . |
27,332 | StringVector processPREFIX_URLLIST ( StylesheetHandler handler , String uri , String name , String rawName , String value ) throws org . xml . sax . SAXException { StringTokenizer tokenizer = new StringTokenizer ( value , " \t\n\r\f" ) ; int nStrings = tokenizer . countTokens ( ) ; StringVector strings = new StringVect... | Process an attribute string of type T_URLLIST into a vector of prefixes that may be resolved to URLs . |
27,333 | private Boolean processYESNO ( StylesheetHandler handler , String uri , String name , String rawName , String value ) throws org . xml . sax . SAXException { if ( ! ( value . equals ( "yes" ) || value . equals ( "no" ) ) ) { handleError ( handler , XSLTErrorResources . INVALID_BOOLEAN , new Object [ ] { name , value } ... | Process an attribute string of type T_YESNO into a Boolean value . |
27,334 | Object processValue ( StylesheetHandler handler , String uri , String name , String rawName , String value , ElemTemplateElement owner ) throws org . xml . sax . SAXException { int type = getType ( ) ; Object processedValue = null ; switch ( type ) { case T_AVT : processedValue = processAVT ( handler , uri , name , raw... | Process an attribute value . |
27,335 | void setDefAttrValue ( StylesheetHandler handler , ElemTemplateElement elem ) throws org . xml . sax . SAXException { setAttrValue ( handler , this . getNamespace ( ) , this . getName ( ) , this . getName ( ) , this . getDefault ( ) , elem ) ; } | Set the default value of an attribute . |
27,336 | private Class getPrimativeClass ( Object obj ) { if ( obj instanceof XPath ) return XPath . class ; Class cl = obj . getClass ( ) ; if ( cl == Double . class ) { cl = double . class ; } if ( cl == Float . class ) { cl = float . class ; } else if ( cl == Boolean . class ) { cl = boolean . class ; } else if ( cl == Byte ... | Get the primative type for the class if there is one . If the class is a Double for instance this will return double . class . If the class is not one of the 9 primative types it will return the same class that was passed in . |
27,337 | private StringBuffer getListOfEnums ( ) { StringBuffer enumNamesList = new StringBuffer ( ) ; String [ ] enumValues = this . getEnumNames ( ) ; for ( int i = 0 ; i < enumValues . length ; i ++ ) { if ( i > 0 ) { enumNamesList . append ( ' ' ) ; } enumNamesList . append ( enumValues [ i ] ) ; } return enumNamesList ; } | StringBuffer containing comma delimited list of valid values for ENUM type . Used to build error message . |
27,338 | boolean setAttrValue ( StylesheetHandler handler , String attrUri , String attrLocalName , String attrRawName , String attrValue , ElemTemplateElement elem ) throws org . xml . sax . SAXException { if ( attrRawName . equals ( "xmlns" ) || attrRawName . startsWith ( "xmlns:" ) ) return true ; String setterString = getSe... | Set a value on an attribute . |
27,339 | public Source getAssociatedStylesheet ( ) { int sz = m_stylesheets . size ( ) ; if ( sz > 0 ) { Source source = ( Source ) m_stylesheets . elementAt ( sz - 1 ) ; return source ; } else return null ; } | Return the last stylesheet found that match the constraints . |
27,340 | public void startElement ( String namespaceURI , String localName , String qName , Attributes atts ) throws org . xml . sax . SAXException { throw new StopParseException ( ) ; } | The spec notes that The xml - stylesheet processing instruction is allowed only in the prolog of an XML document . so at least for right now I m going to go ahead an throw a TransformerException in order to stop the parse . |
27,341 | public static boolean caseIgnoreMatch ( String s1 , String s2 ) { if ( s1 == s2 ) { return true ; } int len = s1 . length ( ) ; if ( len != s2 . length ( ) ) { return false ; } for ( int i = 0 ; i < len ; i ++ ) { char c1 = s1 . charAt ( i ) ; char c2 = s2 . charAt ( i ) ; if ( c1 != c2 && toLower ( c1 ) != toLower ( c... | Compares two ASCII Strings s1 and s2 ignoring case . |
27,342 | public static String toLowerString ( String s ) { int len = s . length ( ) ; int idx = 0 ; for ( ; idx < len ; idx ++ ) { if ( isUpper ( s . charAt ( idx ) ) ) { break ; } } if ( idx == len ) { return s ; } char [ ] buf = new char [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { char c = s . charAt ( i ) ; buf [ i ] = ( ... | Converts the given ASCII String to lower - case . |
27,343 | public void loadPropertyFile ( String file , Properties target ) { try { SecuritySupport ss = SecuritySupport . getInstance ( ) ; InputStream is = ss . getResourceAsStream ( ObjectFactory . findClassLoader ( ) , file ) ; BufferedInputStream bis = new BufferedInputStream ( is ) ; target . load ( bis ) ; bis . close ( ) ... | Retrieve a propery bundle from a specified file |
27,344 | public void setLeftRight ( Expression l , Expression r ) { m_left = l ; m_right = r ; l . exprSetParent ( this ) ; r . exprSetParent ( this ) ; } | Set the left and right operand expressions for this operation . |
27,345 | static int distance ( GeneralNameInterface base , GeneralNameInterface test , int incomparable ) { switch ( base . constrains ( test ) ) { case GeneralNameInterface . NAME_DIFF_TYPE : if ( debug != null ) { debug . println ( "Builder.distance(): Names are different types" ) ; } return incomparable ; case GeneralNameInt... | get distance of one GeneralName from another |
27,346 | static int targetDistance ( NameConstraintsExtension constraints , X509Certificate cert , GeneralNameInterface target ) throws IOException { if ( constraints != null && ! constraints . verify ( cert ) ) { throw new IOException ( "certificate does not satisfy existing name " + "constraints" ) ; } X509CertImpl certImpl ;... | Determine how close a given certificate gets you toward a given target . |
27,347 | boolean addMatchingCerts ( X509CertSelector selector , Collection < CertStore > certStores , Collection < X509Certificate > resultCerts , boolean checkAll ) { X509Certificate targetCert = selector . getCertificate ( ) ; if ( targetCert != null ) { if ( selector . match ( targetCert ) && ! X509CertImpl . isSelfSigned ( ... | Search the specified CertStores and add all certificates matching selector to resultCerts . Self - signed certs are not useful here and therefore ignored . |
27,348 | private void linkNodeLast ( LinkedHashMapEntry < K , V > p ) { LinkedHashMapEntry < K , V > last = tail ; tail = p ; if ( last == null ) head = p ; else { p . before = last ; last . after = p ; } } | link at the end of list |
27,349 | private void transferLinks ( LinkedHashMapEntry < K , V > src , LinkedHashMapEntry < K , V > dst ) { LinkedHashMapEntry < K , V > b = dst . before = src . before ; LinkedHashMapEntry < K , V > a = dst . after = src . after ; if ( b == null ) head = dst ; else b . after = dst ; if ( a == null ) tail = dst ; else a . bef... | apply src s links to dst |
27,350 | public static Locale [ ] getAvailableLocales ( ) { if ( shim == null ) { return ICUResourceBundle . getAvailableLocales ( ICUData . ICU_COLLATION_BASE_NAME , ICUResourceBundle . ICU_DATA_CLASS_LOADER ) ; } return shim . getAvailableLocales ( ) ; } | Returns the set of locales as Locale objects for which collators are installed . Note that Locale objects do not support RFC 3066 . |
27,351 | public int compare ( Object source , Object target ) { return doCompare ( ( CharSequence ) source , ( CharSequence ) target ) ; } | Compares the source Object to the target Object . |
27,352 | public String getName ( ) { String algName = nameTable . get ( algid ) ; if ( algName != null ) { return algName ; } if ( ( params != null ) && algid . equals ( specifiedWithECDSA_oid ) ) { try { AlgorithmId paramsId = AlgorithmId . parse ( new DerValue ( getEncodedParams ( ) ) ) ; String paramsName = paramsId . getNam... | Returns a name for the algorithm which may be more intelligible to humans than the algorithm s OID but which won t necessarily be comprehensible on other systems . For example this might return a name such as MD5withRSA for a signature algorithm on some systems . It also returns names like OID . 1 . 2 . 3 . 4 when no p... |
27,353 | public static AlgorithmId get ( String algname ) throws NoSuchAlgorithmException { ObjectIdentifier oid ; try { oid = algOID ( algname ) ; } catch ( IOException ioe ) { throw new NoSuchAlgorithmException ( "Invalid ObjectIdentifier " + algname ) ; } if ( oid == null ) { throw new NoSuchAlgorithmException ( "unrecognize... | Returns one of the algorithm IDs most commonly associated with this algorithm name . |
27,354 | public static AlgorithmId get ( AlgorithmParameters algparams ) throws NoSuchAlgorithmException { ObjectIdentifier oid ; String algname = algparams . getAlgorithm ( ) ; try { oid = algOID ( algname ) ; } catch ( IOException ioe ) { throw new NoSuchAlgorithmException ( "Invalid ObjectIdentifier " + algname ) ; } if ( oi... | Returns one of the algorithm IDs most commonly associated with this algorithm parameters . |
27,355 | public static String makeSigAlg ( String digAlg , String encAlg ) { digAlg = digAlg . replace ( "-" , "" ) . toUpperCase ( Locale . ENGLISH ) ; if ( digAlg . equalsIgnoreCase ( "SHA" ) ) digAlg = "SHA1" ; encAlg = encAlg . toUpperCase ( Locale . ENGLISH ) ; if ( encAlg . equals ( "EC" ) ) encAlg = "ECDSA" ; return digA... | Creates a signature algorithm name from a digest algorithm name and a encryption algorithm name . |
27,356 | public static String getEncAlgFromSigAlg ( String signatureAlgorithm ) { signatureAlgorithm = signatureAlgorithm . toUpperCase ( Locale . ENGLISH ) ; int with = signatureAlgorithm . indexOf ( "WITH" ) ; String keyAlgorithm = null ; if ( with > 0 ) { int and = signatureAlgorithm . indexOf ( "AND" , with + 4 ) ; if ( and... | Extracts the encryption algorithm name from a signature algorithm name . |
27,357 | public static String getDigAlgFromSigAlg ( String signatureAlgorithm ) { signatureAlgorithm = signatureAlgorithm . toUpperCase ( Locale . ENGLISH ) ; int with = signatureAlgorithm . indexOf ( "WITH" ) ; if ( with > 0 ) { return signatureAlgorithm . substring ( 0 , with ) ; } return null ; } | Extracts the digest algorithm name from a signature algorithm name . |
27,358 | protected int _documentRoot ( int nodeIdentifier ) { if ( nodeIdentifier == NULL ) return NULL ; for ( int parent = _parent ( nodeIdentifier ) ; parent != NULL ; nodeIdentifier = parent , parent = _parent ( nodeIdentifier ) ) ; return nodeIdentifier ; } | Given a node identifier find the owning document node . Unlike the DOM this considers the owningDocument of a Document to be itself . Note that in shared DTMs this may not be zero . |
27,359 | public void startDocument ( ) throws SAXException { m_endDocumentOccured = false ; m_prefixMappings = new java . util . Vector ( ) ; m_contextIndexes = new IntStack ( ) ; m_parents = new IntStack ( ) ; m_currentDocumentNode = m_size ; super . startDocument ( ) ; } | Receive notification of the beginning of a new RTF document . |
27,360 | public TypeMirror unaryNumericPromotion ( TypeMirror type ) { TypeKind t = type . getKind ( ) ; if ( t == TypeKind . DECLARED ) { type = javacTypes . unboxedType ( type ) ; t = type . getKind ( ) ; } if ( t == TypeKind . BYTE || t == TypeKind . SHORT || t == TypeKind . CHAR ) { return getInt ( ) ; } else { return type ... | If type is a byte TypeMirror short TypeMirror or char TypeMirror an int TypeMirror is returned . Otherwise type is returned . See jls - 5 . 6 . 1 . |
27,361 | public TypeMirror binaryNumericPromotion ( TypeMirror type1 , TypeMirror type2 ) { TypeKind t1 = type1 . getKind ( ) ; TypeKind t2 = type2 . getKind ( ) ; if ( t1 == TypeKind . DECLARED ) { t1 = javacTypes . unboxedType ( type1 ) . getKind ( ) ; } if ( t2 == TypeKind . DECLARED ) { t2 = javacTypes . unboxedType ( type2... | If either type is a double TypeMirror a double TypeMirror is returned . Otherwise if either type is a float TypeMirror a float TypeMirror is returned . Otherwise if either type is a long TypeMirror a long TypeMirror is returned . Otherwise an int TypeMirror is returned . See jls - 5 . 6 . 2 . |
27,362 | public TypeElement getObjcClass ( TypeMirror t ) { if ( isArray ( t ) ) { return getIosArray ( ( ( ArrayType ) t ) . getComponentType ( ) ) ; } else if ( isDeclaredType ( t ) ) { return getObjcClass ( ( TypeElement ) ( ( DeclaredType ) t ) . asElement ( ) ) ; } return null ; } | Maps the given type to it s Objective - C equivalent . Array types are mapped to their equivalent IOSArray type and common Java classes like String and Object are mapped to NSString and NSObject . |
27,363 | public DeclaredType findSupertype ( TypeMirror type , String qualifiedName ) { TypeElement element = asTypeElement ( type ) ; if ( element != null && element . getQualifiedName ( ) . toString ( ) . equals ( qualifiedName ) ) { return ( DeclaredType ) type ; } for ( TypeMirror t : directSupertypes ( type ) ) { DeclaredT... | Find a supertype matching the given qualified name . |
27,364 | public boolean visitTypeHierarchy ( TypeMirror type , TypeVisitor visitor ) { boolean result = true ; if ( type == null ) { return result ; } if ( type . getKind ( ) == TypeKind . DECLARED ) { result = visitor . accept ( ( DeclaredType ) type ) ; } for ( TypeMirror superType : directSupertypes ( type ) ) { if ( ! resul... | Visit all declared types in the hierarchy using a depth - first traversal visiting classes before interfaces . |
27,365 | public boolean visitTypeHierarchyObjcOrder ( TypeMirror type , TypeVisitor visitor ) { boolean result = true ; if ( type == null ) { return result ; } if ( type . getKind ( ) == TypeKind . DECLARED ) { result = visitor . accept ( ( DeclaredType ) type ) ; } TypeMirror classType = null ; for ( TypeMirror superType : dir... | Visit all declared types in the order that Objective - C compilation will visit when resolving the type signature of a method . Uses a depth - first traversal visiting interfaces before classes . |
27,366 | public static String getBinaryName ( TypeMirror t ) { switch ( t . getKind ( ) ) { case BOOLEAN : return "Z" ; case BYTE : return "B" ; case CHAR : return "C" ; case DOUBLE : return "D" ; case FLOAT : return "F" ; case INT : return "I" ; case LONG : return "J" ; case SHORT : return "S" ; case VOID : return "V" ; defaul... | Returns the binary name for a primitive or void type . |
27,367 | public String getReferenceSignature ( ExecutableElement element ) { StringBuilder sb = new StringBuilder ( "(" ) ; if ( ElementUtil . isConstructor ( element ) ) { TypeElement declaringClass = ElementUtil . getDeclaringClass ( element ) ; if ( ElementUtil . hasOuterContext ( declaringClass ) ) { TypeElement outerClass ... | Get the Reference signature of a method . |
27,368 | public long getFilePointer ( ) throws IOException { try { return Libcore . os . lseek ( fd , 0L , SEEK_CUR ) ; } catch ( ErrnoException errnoException ) { throw errnoException . rethrowAsIOException ( ) ; } } | Gets the current position within this file . All reads and writes take place at the current file pointer position . |
27,369 | public long length ( ) throws IOException { try { return Libcore . os . fstat ( fd ) . st_size ; } catch ( ErrnoException errnoException ) { throw errnoException . rethrowAsIOException ( ) ; } } | Returns the length of this file in bytes . |
27,370 | public final int readInt ( ) throws IOException { readFully ( scratch , 0 , SizeOf . INT ) ; return Memory . peekInt ( scratch , 0 , ByteOrder . BIG_ENDIAN ) ; } | Reads a big - endian 32 - bit integer from the current position in this file . Blocks until four bytes have been read the end of the file is reached or an exception is thrown . |
27,371 | private void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { ois . defaultReadObject ( ) ; myhash = - 1 ; timestamp = new Date ( timestamp . getTime ( ) ) ; } | Explicitly reset hash code value to - 1 |
27,372 | public static void checkPackageAccess ( Class < ? > clazz ) { checkPackageAccess ( clazz . getName ( ) ) ; if ( isNonPublicProxyClass ( clazz ) ) { checkProxyPackageAccess ( clazz ) ; } } | Checks package access on the given class . |
27,373 | private static boolean isAncestor ( ClassLoader p , ClassLoader cl ) { ClassLoader acl = cl ; do { acl = acl . getParent ( ) ; if ( p == acl ) { return true ; } } while ( acl != null ) ; return false ; } | be found in the cl s delegation chain |
27,374 | public static boolean needsPackageAccessCheck ( ClassLoader from , ClassLoader to ) { if ( from == null || from == to ) return false ; if ( to == null ) return true ; return ! isAncestor ( from , to ) ; } | Returns true if package access check is needed for reflective access from a class loader from to classes or members in a class defined by class loader to . This method returns true if from is not the same as or an ancestor of to . All code in a system domain are granted with all permission and so this method returns fa... |
27,375 | public static void checkProxyPackageAccess ( Class < ? > clazz ) { SecurityManager s = System . getSecurityManager ( ) ; if ( s != null ) { if ( Proxy . isProxyClass ( clazz ) ) { for ( Class < ? > intf : clazz . getInterfaces ( ) ) { checkPackageAccess ( intf ) ; } } } } | Check package access on the proxy interfaces that the given proxy class implements . |
27,376 | public static boolean isNonPublicProxyClass ( Class < ? > cls ) { String name = cls . getName ( ) ; int i = name . lastIndexOf ( '.' ) ; String pkg = ( i != - 1 ) ? name . substring ( 0 , i ) : "" ; return Proxy . isProxyClass ( cls ) && ! pkg . isEmpty ( ) ; } | Test if the given class is a proxy class that implements non - public interface . Such proxy class may be in a non - restricted package that bypasses checkPackageAccess . |
27,377 | public static Expression retainResult ( Expression node ) { switch ( node . getKind ( ) ) { case ARRAY_CREATION : ( ( ArrayCreation ) node ) . setHasRetainedResult ( true ) ; return TreeUtil . remove ( node ) ; case CLASS_INSTANCE_CREATION : ( ( ClassInstanceCreation ) node ) . setHasRetainedResult ( true ) ; return Tr... | If possible give this expression an unbalanced extra retain . If a non - null result is returned then the returned expression has an unbalanced extra retain and the passed in expression is removed from the tree and must be discarded . If null is returned then the passed in expression is left untouched . The caller must... |
27,378 | public static boolean hasSideEffect ( Expression expr ) { VariableElement var = TreeUtil . getVariableElement ( expr ) ; if ( var != null && ElementUtil . isVolatile ( var ) ) { return true ; } switch ( expr . getKind ( ) ) { case BOOLEAN_LITERAL : case CHARACTER_LITERAL : case NULL_LITERAL : case NUMBER_LITERAL : case... | Reterns whether the expression might have any side effects . If true it would be unsafe to prune the given node from the tree . |
27,379 | public String getOperatorFunctionModifier ( Expression expr ) { VariableElement var = TreeUtil . getVariableElement ( expr ) ; if ( var == null ) { assert TreeUtil . trimParentheses ( expr ) instanceof ArrayAccess : "Expression cannot be resolved to a variable or array access." ; return "Array" ; } String modifier = ""... | Returns the modifier for an assignment expression being converted to a function . The result will be Array if the lhs is an array access Strong if the lhs is a field with a strong reference and an empty string for local variables and weak fields . |
27,380 | public static Period at ( float count , TimeUnit unit ) { checkCount ( count ) ; return new Period ( ETimeLimit . NOLIMIT , false , count , unit ) ; } | Constructs a Period representing a duration of count units extending into the past . |
27,381 | public static Period moreThan ( float count , TimeUnit unit ) { checkCount ( count ) ; return new Period ( ETimeLimit . MT , false , count , unit ) ; } | Constructs a Period representing a duration more than count units extending into the past . |
27,382 | public static Period lessThan ( float count , TimeUnit unit ) { checkCount ( count ) ; return new Period ( ETimeLimit . LT , false , count , unit ) ; } | Constructs a Period representing a duration less than count units extending into the past . |
27,383 | public boolean isSet ( ) { for ( int i = 0 ; i < counts . length ; ++ i ) { if ( counts [ i ] != 0 ) { return true ; } } return false ; } | Returns true if any unit is set . |
27,384 | public float getCount ( TimeUnit unit ) { int ord = unit . ordinal ; if ( counts [ ord ] == 0 ) { return 0 ; } return ( counts [ ord ] - 1 ) / 1000f ; } | Returns the count for the specified unit . If the unit is not set returns 0 . |
27,385 | private Period setTimeUnitValue ( TimeUnit unit , float value ) { if ( value < 0 ) { throw new IllegalArgumentException ( "value: " + value ) ; } return setTimeUnitInternalValue ( unit , ( int ) ( value * 1000 ) + 1 ) ; } | Set the unit s internal value converting from float to int . |
27,386 | public final void init ( AlgorithmParameterSpec genParamSpec , SecureRandom random ) throws InvalidAlgorithmParameterException { paramGenSpi . engineInit ( genParamSpec , random ) ; } | Initializes this parameter generator with a set of algorithm - specific parameter generation values . |
27,387 | public boolean containsKey ( Object key ) { return key == null ? ( indexOfNull ( ) >= 0 ) : ( indexOf ( key , key . hashCode ( ) ) >= 0 ) ; } | Check whether a key exists in the array . |
27,388 | public V setValueAt ( int index , V value ) { index = ( index << 1 ) + 1 ; V old = ( V ) mArray [ index ] ; mArray [ index ] = value ; return old ; } | Set the value at a given index in the array . |
27,389 | public void append ( K key , V value ) { int index = mSize ; final int hash = key == null ? 0 : key . hashCode ( ) ; if ( index >= mHashes . length ) { throw new IllegalStateException ( "Array is full" ) ; } if ( index > 0 && mHashes [ index - 1 ] > hash ) { RuntimeException e = new RuntimeException ( "here" ) ; e . fi... | Special fast path for appending items to the end of the array without validation . The array must already be large enough to contain the item . |
27,390 | void setPathToNamesInternal ( Set < GeneralNameInterface > names ) { pathToNames = Collections . < List < ? > > emptySet ( ) ; pathToGeneralNames = names ; } | called from CertPathHelper |
27,391 | public Principal getPeerPrincipal ( ) throws SSLPeerUnverifiedException { Principal principal ; try { principal = session . getPeerPrincipal ( ) ; } catch ( AbstractMethodError e ) { Certificate [ ] certs = getPeerCertificates ( ) ; principal = ( ( X509Certificate ) certs [ 0 ] ) . getSubjectX500Principal ( ) ; } retur... | Returns the identity of the peer which was established as part of defining the session . |
27,392 | public Principal getLocalPrincipal ( ) { Principal principal ; try { principal = session . getLocalPrincipal ( ) ; } catch ( AbstractMethodError e ) { principal = null ; Certificate [ ] certs = getLocalCertificates ( ) ; if ( certs != null ) { principal = ( ( X509Certificate ) certs [ 0 ] ) . getSubjectX500Principal ( ... | Returns the principal that was sent to the peer during handshaking . |
27,393 | public void setOcspExtensions ( List < Extension > extensions ) { this . ocspExtensions = ( extensions == null ) ? Collections . < Extension > emptyList ( ) : new ArrayList < Extension > ( extensions ) ; } | Sets the optional OCSP request extensions . |
27,394 | public void setOcspResponses ( Map < X509Certificate , byte [ ] > responses ) { if ( responses == null ) { this . ocspResponses = Collections . < X509Certificate , byte [ ] > emptyMap ( ) ; } else { Map < X509Certificate , byte [ ] > copy = new HashMap < > ( responses . size ( ) ) ; for ( Map . Entry < X509Certificate ... | Sets the OCSP responses . These responses are used to determine the revocation status of the specified certificates when OCSP is used . |
27,395 | public Map < X509Certificate , byte [ ] > getOcspResponses ( ) { Map < X509Certificate , byte [ ] > copy = new HashMap < > ( ocspResponses . size ( ) ) ; for ( Map . Entry < X509Certificate , byte [ ] > e : ocspResponses . entrySet ( ) ) { copy . put ( e . getKey ( ) , e . getValue ( ) . clone ( ) ) ; } return copy ; } | Gets the OCSP responses . These responses are used to determine the revocation status of the specified certificates when OCSP is used . |
27,396 | public void setOptions ( Set < Option > options ) { this . options = ( options == null ) ? Collections . < Option > emptySet ( ) : new HashSet < Option > ( options ) ; } | Sets the revocation options . |
27,397 | public void runTo ( int index ) { if ( ! m_cacheNodes ) throw new RuntimeException ( XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_NODESET_CANNOT_INDEX , null ) ) ; if ( ( index >= 0 ) && ( m_next < m_firstFree ) ) m_next = index ; else m_next = m_firstFree - 1 ; } | If an index is requested NodeSet will call this method to run the iterator to the index . By default this sets m_next to the index . If the index argument is - 1 this signals that the iterator should be run to the end . |
27,398 | public void addNode ( Node n ) { if ( ! m_mutable ) throw new RuntimeException ( XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_NODESET_NOT_MUTABLE , null ) ) ; this . addElement ( n ) ; } | Add a node to the NodeSet . Not all types of NodeSets support this operation |
27,399 | private boolean addNodesInDocOrder ( int start , int end , int testIndex , NodeList nodelist , XPathContext support ) { if ( ! m_mutable ) throw new RuntimeException ( XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_NODESET_NOT_MUTABLE , null ) ) ; boolean foundit = false ; int i ; Node node = nodelist . it... | Add the node list to this node set in document order . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.