id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
35,500
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Currency.java
Currency.getNumericCode
public int getNumericCode() { try { String name = "com.google.j2objc.util.CurrencyNumericCodesImpl"; CurrencyNumericCodes cnc = (CurrencyNumericCodes) Class.forName(name).newInstance(); return cnc.getNumericCode(currencyCode); } catch (Exception e) { throw new LibraryNotLinkedError("java.util support", "jre_util", "ComGoogleJ2objcUtilCurrencyNumericCodesImpl"); } }
java
public int getNumericCode() { try { String name = "com.google.j2objc.util.CurrencyNumericCodesImpl"; CurrencyNumericCodes cnc = (CurrencyNumericCodes) Class.forName(name).newInstance(); return cnc.getNumericCode(currencyCode); } catch (Exception e) { throw new LibraryNotLinkedError("java.util support", "jre_util", "ComGoogleJ2objcUtilCurrencyNumericCodesImpl"); } }
[ "public", "int", "getNumericCode", "(", ")", "{", "try", "{", "String", "name", "=", "\"com.google.j2objc.util.CurrencyNumericCodesImpl\"", ";", "CurrencyNumericCodes", "cnc", "=", "(", "CurrencyNumericCodes", ")", "Class", ".", "forName", "(", "name", ")", ".", "...
Returns the ISO 4217 numeric code of this currency. @return the ISO 4217 numeric code of this currency @since 1.7
[ "Returns", "the", "ISO", "4217", "numeric", "code", "of", "this", "currency", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Currency.java#L125-L134
35,501
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/CheckedInputStream.java
CheckedInputStream.read
public int read() throws IOException { int b = in.read(); if (b != -1) { cksum.update(b); } return b; }
java
public int read() throws IOException { int b = in.read(); if (b != -1) { cksum.update(b); } return b; }
[ "public", "int", "read", "(", ")", "throws", "IOException", "{", "int", "b", "=", "in", ".", "read", "(", ")", ";", "if", "(", "b", "!=", "-", "1", ")", "{", "cksum", ".", "update", "(", "b", ")", ";", "}", "return", "b", ";", "}" ]
Reads a byte. Will block if no input is available. @return the byte read, or -1 if the end of the stream is reached. @exception IOException if an I/O error has occurred
[ "Reads", "a", "byte", ".", "Will", "block", "if", "no", "input", "is", "available", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/CheckedInputStream.java#L58-L64
35,502
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/CheckedInputStream.java
CheckedInputStream.skip
public long skip(long n) throws IOException { byte[] buf = new byte[512]; long total = 0; while (total < n) { long len = n - total; len = read(buf, 0, len < buf.length ? (int)len : buf.length); if (len == -1) { return total; } total += len; } return total; }
java
public long skip(long n) throws IOException { byte[] buf = new byte[512]; long total = 0; while (total < n) { long len = n - total; len = read(buf, 0, len < buf.length ? (int)len : buf.length); if (len == -1) { return total; } total += len; } return total; }
[ "public", "long", "skip", "(", "long", "n", ")", "throws", "IOException", "{", "byte", "[", "]", "buf", "=", "new", "byte", "[", "512", "]", ";", "long", "total", "=", "0", ";", "while", "(", "total", "<", "n", ")", "{", "long", "len", "=", "n"...
Skips specified number of bytes of input. @param n the number of bytes to skip @return the actual number of bytes skipped @exception IOException if an I/O error has occurred
[ "Skips", "specified", "number", "of", "bytes", "of", "input", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/CheckedInputStream.java#L95-L107
35,503
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DisabledAlgorithmConstraints.java
DisabledAlgorithmConstraints.checkConstraints
private boolean checkConstraints(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters) { // check the key parameter, it cannot be null. if (key == null) { throw new IllegalArgumentException("The key cannot be null"); } // check the target algorithm if (algorithm != null && algorithm.length() != 0) { if (!permits(primitives, algorithm, parameters)) { return false; } } // check the key algorithm if (!permits(primitives, key.getAlgorithm(), null)) { return false; } // check the key constraints if (keySizeConstraints.disables(key)) { return false; } return true; }
java
private boolean checkConstraints(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters) { // check the key parameter, it cannot be null. if (key == null) { throw new IllegalArgumentException("The key cannot be null"); } // check the target algorithm if (algorithm != null && algorithm.length() != 0) { if (!permits(primitives, algorithm, parameters)) { return false; } } // check the key algorithm if (!permits(primitives, key.getAlgorithm(), null)) { return false; } // check the key constraints if (keySizeConstraints.disables(key)) { return false; } return true; }
[ "private", "boolean", "checkConstraints", "(", "Set", "<", "CryptoPrimitive", ">", "primitives", ",", "String", "algorithm", ",", "Key", "key", ",", "AlgorithmParameters", "parameters", ")", "{", "// check the key parameter, it cannot be null.", "if", "(", "key", "=="...
Check algorithm constraints
[ "Check", "algorithm", "constraints" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DisabledAlgorithmConstraints.java#L236-L262
35,504
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DisabledAlgorithmConstraints.java
DisabledAlgorithmConstraints.loadDisabledAlgorithmsMap
private static void loadDisabledAlgorithmsMap( final String propertyName) { String property = AccessController.doPrivileged( new PrivilegedAction<String>() { public String run() { return Security.getProperty(propertyName); } }); String[] algorithmsInProperty = null; if (property != null && !property.isEmpty()) { // remove double quote marks from beginning/end of the property if (property.charAt(0) == '"' && property.charAt(property.length() - 1) == '"') { property = property.substring(1, property.length() - 1); } algorithmsInProperty = property.split(","); for (int i = 0; i < algorithmsInProperty.length; i++) { algorithmsInProperty[i] = algorithmsInProperty[i].trim(); } } // map the disabled algorithms if (algorithmsInProperty == null) { algorithmsInProperty = new String[0]; } disabledAlgorithmsMap.put(propertyName, algorithmsInProperty); // map the key constraints KeySizeConstraints keySizeConstraints = new KeySizeConstraints(algorithmsInProperty); keySizeConstraintsMap.put(propertyName, keySizeConstraints); }
java
private static void loadDisabledAlgorithmsMap( final String propertyName) { String property = AccessController.doPrivileged( new PrivilegedAction<String>() { public String run() { return Security.getProperty(propertyName); } }); String[] algorithmsInProperty = null; if (property != null && !property.isEmpty()) { // remove double quote marks from beginning/end of the property if (property.charAt(0) == '"' && property.charAt(property.length() - 1) == '"') { property = property.substring(1, property.length() - 1); } algorithmsInProperty = property.split(","); for (int i = 0; i < algorithmsInProperty.length; i++) { algorithmsInProperty[i] = algorithmsInProperty[i].trim(); } } // map the disabled algorithms if (algorithmsInProperty == null) { algorithmsInProperty = new String[0]; } disabledAlgorithmsMap.put(propertyName, algorithmsInProperty); // map the key constraints KeySizeConstraints keySizeConstraints = new KeySizeConstraints(algorithmsInProperty); keySizeConstraintsMap.put(propertyName, keySizeConstraints); }
[ "private", "static", "void", "loadDisabledAlgorithmsMap", "(", "final", "String", "propertyName", ")", "{", "String", "property", "=", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "String", ">", "(", ")", "{", "public", "String", ...
Get disabled algorithm constraints from the specified security property.
[ "Get", "disabled", "algorithm", "constraints", "from", "the", "specified", "security", "property", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DisabledAlgorithmConstraints.java#L265-L301
35,505
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ClassLoaderUtil.java
ClassLoaderUtil.getBootstrapClassLoader
private static ClassLoader getBootstrapClassLoader() { if (BOOTSTRAP_CLASSLOADER == null) { synchronized(ClassLoaderUtil.class) { if (BOOTSTRAP_CLASSLOADER == null) { ClassLoader cl = null; if (System.getSecurityManager() != null) { cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { @Override public BootstrapClassLoader run() { return new BootstrapClassLoader(); } }); } else { cl = new BootstrapClassLoader(); } BOOTSTRAP_CLASSLOADER = cl; } } } return BOOTSTRAP_CLASSLOADER; }
java
private static ClassLoader getBootstrapClassLoader() { if (BOOTSTRAP_CLASSLOADER == null) { synchronized(ClassLoaderUtil.class) { if (BOOTSTRAP_CLASSLOADER == null) { ClassLoader cl = null; if (System.getSecurityManager() != null) { cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { @Override public BootstrapClassLoader run() { return new BootstrapClassLoader(); } }); } else { cl = new BootstrapClassLoader(); } BOOTSTRAP_CLASSLOADER = cl; } } } return BOOTSTRAP_CLASSLOADER; }
[ "private", "static", "ClassLoader", "getBootstrapClassLoader", "(", ")", "{", "if", "(", "BOOTSTRAP_CLASSLOADER", "==", "null", ")", "{", "synchronized", "(", "ClassLoaderUtil", ".", "class", ")", "{", "if", "(", "BOOTSTRAP_CLASSLOADER", "==", "null", ")", "{", ...
Lazily create a singleton BootstrapClassLoader. This class loader might be necessary when ICU4J classes are initialized by bootstrap class loader. @return The BootStrapClassLoader singleton instance
[ "Lazily", "create", "a", "singleton", "BootstrapClassLoader", ".", "This", "class", "loader", "might", "be", "necessary", "when", "ICU4J", "classes", "are", "initialized", "by", "bootstrap", "class", "loader", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ClassLoaderUtil.java#L52-L72
35,506
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ClassLoaderUtil.java
ClassLoaderUtil.getClassLoader
public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = cls.getClassLoader(); if (cl == null) { cl = getClassLoader(); } return cl; }
java
public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = cls.getClassLoader(); if (cl == null) { cl = getClassLoader(); } return cl; }
[ "public", "static", "ClassLoader", "getClassLoader", "(", "Class", "<", "?", ">", "cls", ")", "{", "ClassLoader", "cl", "=", "cls", ".", "getClassLoader", "(", ")", ";", "if", "(", "cl", "==", "null", ")", "{", "cl", "=", "getClassLoader", "(", ")", ...
Returns the class loader used for loading the specified class. @param cls The class @return the class loader
[ "Returns", "the", "class", "loader", "used", "for", "loading", "the", "specified", "class", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ClassLoaderUtil.java#L80-L86
35,507
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ClassLoaderUtil.java
ClassLoaderUtil.getClassLoader
public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); if (cl == null) { // When this method is called for initializing a ICU4J class // during bootstrap, cl might be still null (other than Android?). // In this case, we want to use the bootstrap class loader. cl = getBootstrapClassLoader(); } } return cl; }
java
public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); if (cl == null) { // When this method is called for initializing a ICU4J class // during bootstrap, cl might be still null (other than Android?). // In this case, we want to use the bootstrap class loader. cl = getBootstrapClassLoader(); } } return cl; }
[ "public", "static", "ClassLoader", "getClassLoader", "(", ")", "{", "ClassLoader", "cl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "if", "(", "cl", "==", "null", ")", "{", "cl", "=", "ClassLoader", ".", "...
Returns a fallback class loader. @return A class loader
[ "Returns", "a", "fallback", "class", "loader", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ClassLoaderUtil.java#L92-L104
35,508
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/transform/sax/SAXSource.java
SAXSource.setSystemId
public void setSystemId(String systemId) { if (null == inputSource) { inputSource = new InputSource(systemId); } else { inputSource.setSystemId(systemId); } }
java
public void setSystemId(String systemId) { if (null == inputSource) { inputSource = new InputSource(systemId); } else { inputSource.setSystemId(systemId); } }
[ "public", "void", "setSystemId", "(", "String", "systemId", ")", "{", "if", "(", "null", "==", "inputSource", ")", "{", "inputSource", "=", "new", "InputSource", "(", "systemId", ")", ";", "}", "else", "{", "inputSource", ".", "setSystemId", "(", "systemId...
Set the system identifier for this Source. If an input source has already been set, it will set the system ID or that input source, otherwise it will create a new input source. <p>The system identifier is optional if there is a byte stream or a character stream, but it is still useful to provide one, since the application can use it to resolve relative URIs and can include it in error messages and warnings (the parser will attempt to open a connection to the URI only if no byte stream or character stream is specified).</p> @param systemId The system identifier as a URI string.
[ "Set", "the", "system", "identifier", "for", "this", "Source", ".", "If", "an", "input", "source", "has", "already", "been", "set", "it", "will", "set", "the", "system", "ID", "or", "that", "input", "source", "otherwise", "it", "will", "create", "a", "ne...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/transform/sax/SAXSource.java#L143-L150
35,509
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/transform/sax/SAXSource.java
SAXSource.sourceToInputSource
public static InputSource sourceToInputSource(Source source) { if (source instanceof SAXSource) { return ((SAXSource) source).getInputSource(); } else if (source instanceof StreamSource) { StreamSource ss = (StreamSource) source; InputSource isource = new InputSource(ss.getSystemId()); isource.setByteStream(ss.getInputStream()); isource.setCharacterStream(ss.getReader()); isource.setPublicId(ss.getPublicId()); return isource; } else { return null; } }
java
public static InputSource sourceToInputSource(Source source) { if (source instanceof SAXSource) { return ((SAXSource) source).getInputSource(); } else if (source instanceof StreamSource) { StreamSource ss = (StreamSource) source; InputSource isource = new InputSource(ss.getSystemId()); isource.setByteStream(ss.getInputStream()); isource.setCharacterStream(ss.getReader()); isource.setPublicId(ss.getPublicId()); return isource; } else { return null; } }
[ "public", "static", "InputSource", "sourceToInputSource", "(", "Source", "source", ")", "{", "if", "(", "source", "instanceof", "SAXSource", ")", "{", "return", "(", "(", "SAXSource", ")", "source", ")", ".", "getInputSource", "(", ")", ";", "}", "else", "...
Attempt to obtain a SAX InputSource object from a Source object. @param source Must be a non-null Source reference. @return An InputSource, or null if Source can not be converted.
[ "Attempt", "to", "obtain", "a", "SAX", "InputSource", "object", "from", "a", "Source", "object", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/transform/sax/SAXSource.java#L186-L202
35,510
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java
ProviderConfig.checkSunPKCS11Solaris
private void checkSunPKCS11Solaris() { Boolean o = AccessController.doPrivileged( new PrivilegedAction<Boolean>() { public Boolean run() { File file = new File("/usr/lib/libpkcs11.so"); if (file.exists() == false) { return Boolean.FALSE; } if ("false".equalsIgnoreCase(System.getProperty ("sun.security.pkcs11.enable-solaris"))) { return Boolean.FALSE; } return Boolean.TRUE; } }); if (o == Boolean.FALSE) { tries = MAX_LOAD_TRIES; } }
java
private void checkSunPKCS11Solaris() { Boolean o = AccessController.doPrivileged( new PrivilegedAction<Boolean>() { public Boolean run() { File file = new File("/usr/lib/libpkcs11.so"); if (file.exists() == false) { return Boolean.FALSE; } if ("false".equalsIgnoreCase(System.getProperty ("sun.security.pkcs11.enable-solaris"))) { return Boolean.FALSE; } return Boolean.TRUE; } }); if (o == Boolean.FALSE) { tries = MAX_LOAD_TRIES; } }
[ "private", "void", "checkSunPKCS11Solaris", "(", ")", "{", "Boolean", "o", "=", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "Boolean", ">", "(", ")", "{", "public", "Boolean", "run", "(", ")", "{", "File", "file", "=", "ne...
or if disabled via system property
[ "or", "if", "disabled", "via", "system", "property" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java#L101-L119
35,511
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java
ProviderConfig.getProvider
synchronized Provider getProvider() { // volatile variable load Provider p = provider; if (p != null) { return p; } if (shouldLoad() == false) { return null; } if (isLoading) { // because this method is synchronized, this can only // happen if there is recursion. // if (debug != null) { // debug.println("Recursion loading provider: " + this); // new Exception("Call trace").printStackTrace(); // } return null; } try { isLoading = true; tries++; p = doLoadProvider(); } finally { isLoading = false; } provider = p; return p; }
java
synchronized Provider getProvider() { // volatile variable load Provider p = provider; if (p != null) { return p; } if (shouldLoad() == false) { return null; } if (isLoading) { // because this method is synchronized, this can only // happen if there is recursion. // if (debug != null) { // debug.println("Recursion loading provider: " + this); // new Exception("Call trace").printStackTrace(); // } return null; } try { isLoading = true; tries++; p = doLoadProvider(); } finally { isLoading = false; } provider = p; return p; }
[ "synchronized", "Provider", "getProvider", "(", ")", "{", "// volatile variable load", "Provider", "p", "=", "provider", ";", "if", "(", "p", "!=", "null", ")", "{", "return", "p", ";", "}", "if", "(", "shouldLoad", "(", ")", "==", "false", ")", "{", "...
Get the provider object. Loads the provider if it is not already loaded.
[ "Get", "the", "provider", "object", ".", "Loads", "the", "provider", "if", "it", "is", "not", "already", "loaded", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java#L166-L193
35,512
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java
ProviderConfig.doLoadProvider
private Provider doLoadProvider() { return AccessController.doPrivileged(new PrivilegedAction<Provider>() { public Provider run() { // if (debug != null) { // debug.println("Loading provider: " + ProviderConfig.this); // } try { // First try with the boot classloader. return initProvider(className, Object.class.getClassLoader()); } catch (Exception e1) { // If that fails, try with the system classloader. try { return initProvider(className, ClassLoader.getSystemClassLoader()); } catch (Exception e) { Throwable t; if (e instanceof InvocationTargetException) { t = ((InvocationTargetException)e).getCause(); } else { t = e; } // if (debug != null) { // debug.println("Error loading provider " + ProviderConfig.this); // t.printStackTrace(); // } // provider indicates fatal error, pass through exception if (t instanceof ProviderException) { throw (ProviderException)t; } // provider indicates that loading should not be retried if (t instanceof UnsupportedOperationException) { disableLoad(); } return null; } } } }); }
java
private Provider doLoadProvider() { return AccessController.doPrivileged(new PrivilegedAction<Provider>() { public Provider run() { // if (debug != null) { // debug.println("Loading provider: " + ProviderConfig.this); // } try { // First try with the boot classloader. return initProvider(className, Object.class.getClassLoader()); } catch (Exception e1) { // If that fails, try with the system classloader. try { return initProvider(className, ClassLoader.getSystemClassLoader()); } catch (Exception e) { Throwable t; if (e instanceof InvocationTargetException) { t = ((InvocationTargetException)e).getCause(); } else { t = e; } // if (debug != null) { // debug.println("Error loading provider " + ProviderConfig.this); // t.printStackTrace(); // } // provider indicates fatal error, pass through exception if (t instanceof ProviderException) { throw (ProviderException)t; } // provider indicates that loading should not be retried if (t instanceof UnsupportedOperationException) { disableLoad(); } return null; } } } }); }
[ "private", "Provider", "doLoadProvider", "(", ")", "{", "return", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "Provider", ">", "(", ")", "{", "public", "Provider", "run", "(", ")", "{", "// if (debug != null) {", "/...
Load and instantiate the Provider described by this class. NOTE use of doPrivileged(). @return null if the Provider could not be loaded @throws ProviderException if executing the Provider's constructor throws a ProviderException. All other Exceptions are ignored.
[ "Load", "and", "instantiate", "the", "Provider", "described", "by", "this", "class", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java#L205-L243
35,513
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java
ProviderConfig.expand
private static String expand(final String value) { // shortcut if value does not contain any properties if (value.contains("${") == false) { return value; } // return AccessController.doPrivileged(new PrivilegedAction<String>() { // public String run() { try { return PropertyExpander.expand(value); } catch (GeneralSecurityException e) { throw new ProviderException(e); } // } // }); }
java
private static String expand(final String value) { // shortcut if value does not contain any properties if (value.contains("${") == false) { return value; } // return AccessController.doPrivileged(new PrivilegedAction<String>() { // public String run() { try { return PropertyExpander.expand(value); } catch (GeneralSecurityException e) { throw new ProviderException(e); } // } // }); }
[ "private", "static", "String", "expand", "(", "final", "String", "value", ")", "{", "// shortcut if value does not contain any properties", "if", "(", "value", ".", "contains", "(", "\"${\"", ")", "==", "false", ")", "{", "return", "value", ";", "}", "// ...
Perform property expansion of the provider value. NOTE use of doPrivileged().
[ "Perform", "property", "expansion", "of", "the", "provider", "value", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderConfig.java#L278-L292
35,514
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.init
void init(TransformerFactoryImpl processor) { m_stylesheetProcessor = processor; // Set the initial content handler. m_processors.push(m_schema.getElementProcessor()); this.pushNewNamespaceSupport(); // m_includeStack.push(SystemIDResolver.getAbsoluteURI(this.getBaseIdentifier(), null)); // initXPath(processor, null); }
java
void init(TransformerFactoryImpl processor) { m_stylesheetProcessor = processor; // Set the initial content handler. m_processors.push(m_schema.getElementProcessor()); this.pushNewNamespaceSupport(); // m_includeStack.push(SystemIDResolver.getAbsoluteURI(this.getBaseIdentifier(), null)); // initXPath(processor, null); }
[ "void", "init", "(", "TransformerFactoryImpl", "processor", ")", "{", "m_stylesheetProcessor", "=", "processor", ";", "// Set the initial content handler.", "m_processors", ".", "push", "(", "m_schema", ".", "getElementProcessor", "(", ")", ")", ";", "this", ".", "p...
Do common initialization. @param processor non-null reference to the transformer factory that owns this handler.
[ "Do", "common", "initialization", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L128-L138
35,515
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.createXPath
public XPath createXPath(String str, ElemTemplateElement owningTemplate) throws javax.xml.transform.TransformerException { ErrorListener handler = m_stylesheetProcessor.getErrorListener(); XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler, m_funcTable); // Visit the expression, registering namespaces for any extension functions it includes. xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot())); return xpath; }
java
public XPath createXPath(String str, ElemTemplateElement owningTemplate) throws javax.xml.transform.TransformerException { ErrorListener handler = m_stylesheetProcessor.getErrorListener(); XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler, m_funcTable); // Visit the expression, registering namespaces for any extension functions it includes. xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot())); return xpath; }
[ "public", "XPath", "createXPath", "(", "String", "str", ",", "ElemTemplateElement", "owningTemplate", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "ErrorListener", "handler", "=", "m_stylesheetProcessor", ".", "getErrorListen...
Process an expression string into an XPath. Must be public for access by the AVT class. @param str A non-null reference to a valid or invalid XPath expression string. @return A non-null reference to an XPath object that represents the string argument. @throws javax.xml.transform.TransformerException if the expression can not be processed. @see <a href="http://www.w3.org/TR/xslt#section-Expressions">Section 4 Expressions in XSLT Specification</a>
[ "Process", "an", "expression", "string", "into", "an", "XPath", ".", "Must", "be", "public", "for", "access", "by", "the", "AVT", "class", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L151-L160
35,516
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.stackContains
private boolean stackContains(Stack stack, String url) { int n = stack.size(); boolean contains = false; for (int i = 0; i < n; i++) { String url2 = (String) stack.elementAt(i); if (url2.equals(url)) { contains = true; break; } } return contains; }
java
private boolean stackContains(Stack stack, String url) { int n = stack.size(); boolean contains = false; for (int i = 0; i < n; i++) { String url2 = (String) stack.elementAt(i); if (url2.equals(url)) { contains = true; break; } } return contains; }
[ "private", "boolean", "stackContains", "(", "Stack", "stack", ",", "String", "url", ")", "{", "int", "n", "=", "stack", ".", "size", "(", ")", ";", "boolean", "contains", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";...
Utility function to see if the stack contains the given URL. @param stack non-null reference to a Stack. @param url URL string on which an equality test will be performed. @return true if the stack contains the url argument.
[ "Utility", "function", "to", "see", "if", "the", "stack", "contains", "the", "given", "URL", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L226-L245
35,517
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.getProcessorFor
XSLTElementProcessor getProcessorFor( String uri, String localName, String rawName) throws org.xml.sax.SAXException { XSLTElementProcessor currentProcessor = getCurrentProcessor(); XSLTElementDef def = currentProcessor.getElemDef(); XSLTElementProcessor elemProcessor = def.getProcessorFor(uri, localName); if (null == elemProcessor && !(currentProcessor instanceof ProcessorStylesheetDoc) && ((null == getStylesheet() || Double.valueOf(getStylesheet().getVersion()).doubleValue() > Constants.XSLTVERSUPPORTED) ||(!uri.equals(Constants.S_XSLNAMESPACEURL) && currentProcessor instanceof ProcessorStylesheetElement) || getElemVersion() > Constants.XSLTVERSUPPORTED )) { elemProcessor = def.getProcessorForUnknown(uri, localName); } if (null == elemProcessor) error(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_ALLOWED_IN_POSITION, new Object[]{rawName}),null);//rawName + " is not allowed in this position in the stylesheet!", return elemProcessor; }
java
XSLTElementProcessor getProcessorFor( String uri, String localName, String rawName) throws org.xml.sax.SAXException { XSLTElementProcessor currentProcessor = getCurrentProcessor(); XSLTElementDef def = currentProcessor.getElemDef(); XSLTElementProcessor elemProcessor = def.getProcessorFor(uri, localName); if (null == elemProcessor && !(currentProcessor instanceof ProcessorStylesheetDoc) && ((null == getStylesheet() || Double.valueOf(getStylesheet().getVersion()).doubleValue() > Constants.XSLTVERSUPPORTED) ||(!uri.equals(Constants.S_XSLNAMESPACEURL) && currentProcessor instanceof ProcessorStylesheetElement) || getElemVersion() > Constants.XSLTVERSUPPORTED )) { elemProcessor = def.getProcessorForUnknown(uri, localName); } if (null == elemProcessor) error(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_ALLOWED_IN_POSITION, new Object[]{rawName}),null);//rawName + " is not allowed in this position in the stylesheet!", return elemProcessor; }
[ "XSLTElementProcessor", "getProcessorFor", "(", "String", "uri", ",", "String", "localName", ",", "String", "rawName", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "XSLTElementProcessor", "currentProcessor", "=", "getCurrentProcessor", "("...
Given a namespace URI, and a local name or a node type, get the processor for the element, or return null if not allowed. @param uri The Namespace URI, or an empty string. @param localName The local name (without prefix), or empty string if not namespace processing. @param rawName The qualified name (with prefix). @return A non-null reference to a element processor. @throws org.xml.sax.SAXException if the element is not allowed in the found position in the stylesheet.
[ "Given", "a", "namespace", "URI", "and", "a", "local", "name", "or", "a", "node", "type", "get", "the", "processor", "for", "the", "element", "or", "return", "null", "if", "not", "allowed", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L365-L392
35,518
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.flushCharacters
private void flushCharacters() throws org.xml.sax.SAXException { XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); }
java
private void flushCharacters() throws org.xml.sax.SAXException { XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); }
[ "private", "void", "flushCharacters", "(", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "XSLTElementProcessor", "elemProcessor", "=", "getCurrentProcessor", "(", ")", ";", "if", "(", "null", "!=", "elemProcessor", ")", "elemProcessor",...
Flush the characters buffer. @throws org.xml.sax.SAXException
[ "Flush", "the", "characters", "buffer", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L552-L559
35,519
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.skippedEntity
public void skippedEntity(String name) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; getCurrentProcessor().skippedEntity(this, name); }
java
public void skippedEntity(String name) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; getCurrentProcessor().skippedEntity(this, name); }
[ "public", "void", "skippedEntity", "(", "String", "name", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "!", "m_shouldProcess", ")", "return", ";", "getCurrentProcessor", "(", ")", ".", "skippedEntity", "(", "this", ","...
Receive notification of a skipped entity. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.</p> @param name The name of the skipped entity. @see org.xml.sax.ContentHandler#processingInstruction @throws org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception.
[ "Receive", "notification", "of", "a", "skipped", "entity", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L829-L836
35,520
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.warning
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
java
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
[ "public", "void", "warning", "(", "org", ".", "xml", ".", "sax", ".", "SAXParseException", "e", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "String", "formattedMsg", "=", "e", ".", "getMessage", "(", ")", ";", "SAXSourceLocato...
Receive notification of a XSLT processing warning. @param e The warning information encoded as an exception. @throws org.xml.sax.SAXException that wraps a {@link javax.xml.transform.TransformerException} if the current {@link javax.xml.transform.ErrorListener#warning} method chooses to flag this condition as an error.
[ "Receive", "notification", "of", "a", "XSLT", "processing", "warning", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L963-L979
35,521
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.getStylesheetRoot
public StylesheetRoot getStylesheetRoot() { if (m_stylesheetRoot != null){ m_stylesheetRoot.setOptimizer(m_optimize); m_stylesheetRoot.setIncremental(m_incremental); m_stylesheetRoot.setSource_location(m_source_location); } return m_stylesheetRoot; }
java
public StylesheetRoot getStylesheetRoot() { if (m_stylesheetRoot != null){ m_stylesheetRoot.setOptimizer(m_optimize); m_stylesheetRoot.setIncremental(m_incremental); m_stylesheetRoot.setSource_location(m_source_location); } return m_stylesheetRoot; }
[ "public", "StylesheetRoot", "getStylesheetRoot", "(", ")", "{", "if", "(", "m_stylesheetRoot", "!=", "null", ")", "{", "m_stylesheetRoot", ".", "setOptimizer", "(", "m_optimize", ")", ";", "m_stylesheetRoot", ".", "setIncremental", "(", "m_incremental", ")", ";", ...
Return the stylesheet root that this handler is constructing. @return The root stylesheet of the stylesheets tree.
[ "Return", "the", "stylesheet", "root", "that", "this", "handler", "is", "constructing", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1195-L1203
35,522
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.pushStylesheet
public void pushStylesheet(Stylesheet s) { if (m_stylesheets.size() == 0) m_stylesheetRoot = (StylesheetRoot) s; m_stylesheets.push(s); }
java
public void pushStylesheet(Stylesheet s) { if (m_stylesheets.size() == 0) m_stylesheetRoot = (StylesheetRoot) s; m_stylesheets.push(s); }
[ "public", "void", "pushStylesheet", "(", "Stylesheet", "s", ")", "{", "if", "(", "m_stylesheets", ".", "size", "(", ")", "==", "0", ")", "m_stylesheetRoot", "=", "(", "StylesheetRoot", ")", "s", ";", "m_stylesheets", ".", "push", "(", "s", ")", ";", "}...
Push the current stylesheet being constructed. If no other stylesheets have been pushed onto the stack, assume the argument is a stylesheet root, and also set the stylesheet root member. @param s non-null reference to a stylesheet.
[ "Push", "the", "current", "stylesheet", "being", "constructed", ".", "If", "no", "other", "stylesheets", "have", "been", "pushed", "onto", "the", "stack", "assume", "the", "argument", "is", "a", "stylesheet", "root", "and", "also", "set", "the", "stylesheet", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1218-L1225
35,523
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.popStylesheet
Stylesheet popStylesheet() { // The stylesheetLocatorStack needs to be popped because // a locator was pushed in for this stylesheet by the SAXparser by calling // setDocumentLocator(). if (!m_stylesheetLocatorStack.isEmpty()) m_stylesheetLocatorStack.pop(); if (!m_stylesheets.isEmpty()) m_lastPoppedStylesheet = (Stylesheet) m_stylesheets.pop(); // Shouldn't this be null if stylesheets is empty? -sb return m_lastPoppedStylesheet; }
java
Stylesheet popStylesheet() { // The stylesheetLocatorStack needs to be popped because // a locator was pushed in for this stylesheet by the SAXparser by calling // setDocumentLocator(). if (!m_stylesheetLocatorStack.isEmpty()) m_stylesheetLocatorStack.pop(); if (!m_stylesheets.isEmpty()) m_lastPoppedStylesheet = (Stylesheet) m_stylesheets.pop(); // Shouldn't this be null if stylesheets is empty? -sb return m_lastPoppedStylesheet; }
[ "Stylesheet", "popStylesheet", "(", ")", "{", "// The stylesheetLocatorStack needs to be popped because", "// a locator was pushed in for this stylesheet by the SAXparser by calling", "// setDocumentLocator().", "if", "(", "!", "m_stylesheetLocatorStack", ".", "isEmpty", "(", ")", ")...
Pop the last stylesheet pushed, and return the stylesheet that this handler is constructing, and set the last popped stylesheet member. Also pop the stylesheet locator stack. @return The stylesheet popped off the stack, or the last popped stylesheet.
[ "Pop", "the", "last", "stylesheet", "pushed", "and", "return", "the", "stylesheet", "that", "this", "handler", "is", "constructing", "and", "set", "the", "last", "popped", "stylesheet", "member", ".", "Also", "pop", "the", "stylesheet", "locator", "stack", "."...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1234-L1248
35,524
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.getElemTemplateElement
ElemTemplateElement getElemTemplateElement() { try { return (ElemTemplateElement) m_elems.peek(); } catch (java.util.EmptyStackException ese) { return null; } }
java
ElemTemplateElement getElemTemplateElement() { try { return (ElemTemplateElement) m_elems.peek(); } catch (java.util.EmptyStackException ese) { return null; } }
[ "ElemTemplateElement", "getElemTemplateElement", "(", ")", "{", "try", "{", "return", "(", "ElemTemplateElement", ")", "m_elems", ".", "peek", "(", ")", ";", "}", "catch", "(", "java", ".", "util", ".", "EmptyStackException", "ese", ")", "{", "return", "null...
Get the current ElemTemplateElement at the top of the stack. @return Valid ElemTemplateElement, which may be null.
[ "Get", "the", "current", "ElemTemplateElement", "at", "the", "top", "of", "the", "stack", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1313-L1324
35,525
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.pushBaseIndentifier
void pushBaseIndentifier(String baseID) { if (null != baseID) { int posOfHash = baseID.indexOf('#'); if (posOfHash > -1) { m_fragmentIDString = baseID.substring(posOfHash + 1); m_shouldProcess = false; } else m_shouldProcess = true; } else m_shouldProcess = true; m_baseIdentifiers.push(baseID); }
java
void pushBaseIndentifier(String baseID) { if (null != baseID) { int posOfHash = baseID.indexOf('#'); if (posOfHash > -1) { m_fragmentIDString = baseID.substring(posOfHash + 1); m_shouldProcess = false; } else m_shouldProcess = true; } else m_shouldProcess = true; m_baseIdentifiers.push(baseID); }
[ "void", "pushBaseIndentifier", "(", "String", "baseID", ")", "{", "if", "(", "null", "!=", "baseID", ")", "{", "int", "posOfHash", "=", "baseID", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "posOfHash", ">", "-", "1", ")", "{", "m_fragmentIDS...
Push a base identifier onto the base URI stack. @param baseID The current base identifier for this position in the stylesheet, which may be a fragment identifier, or which may be null. @see <a href="http://www.w3.org/TR/xslt#base-uri"> Section 3.2 Base URI of XSLT specification.</a>
[ "Push", "a", "base", "identifier", "onto", "the", "base", "URI", "stack", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1379-L1398
35,526
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.getBaseIdentifier
public String getBaseIdentifier() { // Try to get the baseIdentifier from the baseIdentifier's stack, // which may not be the same thing as the value found in the // SourceLocators stack. String base = (String) (m_baseIdentifiers.isEmpty() ? null : m_baseIdentifiers.peek()); // Otherwise try the stylesheet. if (null == base) { SourceLocator locator = getLocator(); base = (null == locator) ? "" : locator.getSystemId(); } return base; }
java
public String getBaseIdentifier() { // Try to get the baseIdentifier from the baseIdentifier's stack, // which may not be the same thing as the value found in the // SourceLocators stack. String base = (String) (m_baseIdentifiers.isEmpty() ? null : m_baseIdentifiers.peek()); // Otherwise try the stylesheet. if (null == base) { SourceLocator locator = getLocator(); base = (null == locator) ? "" : locator.getSystemId(); } return base; }
[ "public", "String", "getBaseIdentifier", "(", ")", "{", "// Try to get the baseIdentifier from the baseIdentifier's stack,", "// which may not be the same thing as the value found in the", "// SourceLocators stack.", "String", "base", "=", "(", "String", ")", "(", "m_baseIdentifiers"...
Return the base identifier. @return The base identifier of the current stylesheet.
[ "Return", "the", "base", "identifier", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1414-L1432
35,527
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java
StylesheetHandler.getLocator
public SAXSourceLocator getLocator() { if (m_stylesheetLocatorStack.isEmpty()) { SAXSourceLocator locator = new SAXSourceLocator(); locator.setSystemId(this.getStylesheetProcessor().getDOMsystemID()); return locator; // m_stylesheetLocatorStack.push(locator); } return ((SAXSourceLocator) m_stylesheetLocatorStack.peek()); }
java
public SAXSourceLocator getLocator() { if (m_stylesheetLocatorStack.isEmpty()) { SAXSourceLocator locator = new SAXSourceLocator(); locator.setSystemId(this.getStylesheetProcessor().getDOMsystemID()); return locator; // m_stylesheetLocatorStack.push(locator); } return ((SAXSourceLocator) m_stylesheetLocatorStack.peek()); }
[ "public", "SAXSourceLocator", "getLocator", "(", ")", "{", "if", "(", "m_stylesheetLocatorStack", ".", "isEmpty", "(", ")", ")", "{", "SAXSourceLocator", "locator", "=", "new", "SAXSourceLocator", "(", ")", ";", "locator", ".", "setSystemId", "(", "this", ".",...
Get the current stylesheet Locator object. @return non-null reference to the current locator object.
[ "Get", "the", "current", "stylesheet", "Locator", "object", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1445-L1460
35,528
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/ProgressMonitor.java
ProgressMonitor.getProgressSources
public ArrayList<ProgressSource> getProgressSources() { ArrayList<ProgressSource> snapshot = new ArrayList<ProgressSource>(); try { synchronized(progressSourceList) { for (Iterator<ProgressSource> iter = progressSourceList.iterator(); iter.hasNext();) { ProgressSource pi = iter.next(); // Clone ProgressSource and add to snapshot snapshot.add((ProgressSource)pi.clone()); } } } catch(CloneNotSupportedException e) { e.printStackTrace(); } return snapshot; }
java
public ArrayList<ProgressSource> getProgressSources() { ArrayList<ProgressSource> snapshot = new ArrayList<ProgressSource>(); try { synchronized(progressSourceList) { for (Iterator<ProgressSource> iter = progressSourceList.iterator(); iter.hasNext();) { ProgressSource pi = iter.next(); // Clone ProgressSource and add to snapshot snapshot.add((ProgressSource)pi.clone()); } } } catch(CloneNotSupportedException e) { e.printStackTrace(); } return snapshot; }
[ "public", "ArrayList", "<", "ProgressSource", ">", "getProgressSources", "(", ")", "{", "ArrayList", "<", "ProgressSource", ">", "snapshot", "=", "new", "ArrayList", "<", "ProgressSource", ">", "(", ")", ";", "try", "{", "synchronized", "(", "progressSourceList"...
Return a snapshot of the ProgressSource list
[ "Return", "a", "snapshot", "of", "the", "ProgressSource", "list" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/ProgressMonitor.java#L66-L84
35,529
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/ProgressMonitor.java
ProgressMonitor.registerSource
public void registerSource(ProgressSource pi) { synchronized(progressSourceList) { if (progressSourceList.contains(pi)) return; progressSourceList.add(pi); } // Notify only if there is at least one listener if (progressListenerList.size() > 0) { // Notify progress listener if there is progress change ArrayList<ProgressListener> listeners = new ArrayList<ProgressListener>(); // Copy progress listeners to another list to avoid holding locks synchronized(progressListenerList) { for (Iterator<ProgressListener> iter = progressListenerList.iterator(); iter.hasNext();) { listeners.add(iter.next()); } } // Fire event on each progress listener for (Iterator<ProgressListener> iter = listeners.iterator(); iter.hasNext();) { ProgressListener pl = iter.next(); ProgressEvent pe = new ProgressEvent(pi, pi.getURL(), pi.getMethod(), pi.getContentType(), pi.getState(), pi.getProgress(), pi.getExpected()); pl.progressStart(pe); } } }
java
public void registerSource(ProgressSource pi) { synchronized(progressSourceList) { if (progressSourceList.contains(pi)) return; progressSourceList.add(pi); } // Notify only if there is at least one listener if (progressListenerList.size() > 0) { // Notify progress listener if there is progress change ArrayList<ProgressListener> listeners = new ArrayList<ProgressListener>(); // Copy progress listeners to another list to avoid holding locks synchronized(progressListenerList) { for (Iterator<ProgressListener> iter = progressListenerList.iterator(); iter.hasNext();) { listeners.add(iter.next()); } } // Fire event on each progress listener for (Iterator<ProgressListener> iter = listeners.iterator(); iter.hasNext();) { ProgressListener pl = iter.next(); ProgressEvent pe = new ProgressEvent(pi, pi.getURL(), pi.getMethod(), pi.getContentType(), pi.getState(), pi.getProgress(), pi.getExpected()); pl.progressStart(pe); } } }
[ "public", "void", "registerSource", "(", "ProgressSource", "pi", ")", "{", "synchronized", "(", "progressSourceList", ")", "{", "if", "(", "progressSourceList", ".", "contains", "(", "pi", ")", ")", "return", ";", "progressSourceList", ".", "add", "(", "pi", ...
Register progress source when progress is began.
[ "Register", "progress", "source", "when", "progress", "is", "began", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/ProgressMonitor.java#L104-L133
35,530
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/java/net/AddressCache.java
AddressCache.put
public void put(String hostname, int netId, InetAddress[] addresses) { cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(addresses)); }
java
public void put(String hostname, int netId, InetAddress[] addresses) { cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(addresses)); }
[ "public", "void", "put", "(", "String", "hostname", ",", "int", "netId", ",", "InetAddress", "[", "]", "addresses", ")", "{", "cache", ".", "put", "(", "new", "AddressCacheKey", "(", "hostname", ",", "netId", ")", ",", "new", "AddressCacheEntry", "(", "a...
Associates the given 'addresses' with 'hostname'. The association will expire after a certain length of time.
[ "Associates", "the", "given", "addresses", "with", "hostname", ".", "The", "association", "will", "expire", "after", "a", "certain", "length", "of", "time", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/java/net/AddressCache.java#L117-L119
35,531
google/j2objc
jre_emul/Classes/com/google/j2objc/security/cert/IosCertificateFactory.java
IosCertificateFactory.maybeDecodeBase64
private byte[] maybeDecodeBase64(byte[] byteArray) { try { String pem = new String(byteArray); // Remove required begin/end lines. pem = pem.substring(BEGIN_CERT_LINE_LENGTH, pem.length() - END_CERT_LINE_LENGTH); return Base64.getDecoder().decode(pem); } catch (Exception e) { // Not a valid PEM encoded certificate, return original array. return byteArray; } }
java
private byte[] maybeDecodeBase64(byte[] byteArray) { try { String pem = new String(byteArray); // Remove required begin/end lines. pem = pem.substring(BEGIN_CERT_LINE_LENGTH, pem.length() - END_CERT_LINE_LENGTH); return Base64.getDecoder().decode(pem); } catch (Exception e) { // Not a valid PEM encoded certificate, return original array. return byteArray; } }
[ "private", "byte", "[", "]", "maybeDecodeBase64", "(", "byte", "[", "]", "byteArray", ")", "{", "try", "{", "String", "pem", "=", "new", "String", "(", "byteArray", ")", ";", "// Remove required begin/end lines.", "pem", "=", "pem", ".", "substring", "(", ...
Test whether array is a Base64-encoded certificate. If so, return the decoded content instead of the specified array. @see CertificateFactorySpi#engineGenerateCertificate(InputStream)
[ "Test", "whether", "array", "is", "a", "Base64", "-", "encoded", "certificate", ".", "If", "so", "return", "the", "decoded", "content", "instead", "of", "the", "specified", "array", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/Classes/com/google/j2objc/security/cert/IosCertificateFactory.java#L79-L89
35,532
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java
Streams.readFully
public static void readFully(InputStream in, byte[] dst) throws IOException { readFully(in, dst, 0, dst.length); }
java
public static void readFully(InputStream in, byte[] dst) throws IOException { readFully(in, dst, 0, dst.length); }
[ "public", "static", "void", "readFully", "(", "InputStream", "in", ",", "byte", "[", "]", "dst", ")", "throws", "IOException", "{", "readFully", "(", "in", ",", "dst", ",", "0", ",", "dst", ".", "length", ")", ";", "}" ]
Fills 'dst' with bytes from 'in', throwing EOFException if insufficient bytes are available.
[ "Fills", "dst", "with", "bytes", "from", "in", "throwing", "EOFException", "if", "insufficient", "bytes", "are", "available", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java#L59-L61
35,533
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java
Streams.readFully
public static String readFully(Reader reader) throws IOException { try { StringWriter writer = new StringWriter(); char[] buffer = new char[1024]; int count; while ((count = reader.read(buffer)) != -1) { writer.write(buffer, 0, count); } return writer.toString(); } finally { reader.close(); } }
java
public static String readFully(Reader reader) throws IOException { try { StringWriter writer = new StringWriter(); char[] buffer = new char[1024]; int count; while ((count = reader.read(buffer)) != -1) { writer.write(buffer, 0, count); } return writer.toString(); } finally { reader.close(); } }
[ "public", "static", "String", "readFully", "(", "Reader", "reader", ")", "throws", "IOException", "{", "try", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "char", "[", "]", "buffer", "=", "new", "char", "[", "1024", "]", ";",...
Returns the remainder of 'reader' as a string, closing it when done.
[ "Returns", "the", "remainder", "of", "reader", "as", "a", "string", "closing", "it", "when", "done", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java#L117-L129
35,534
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationFastLatin.java
CollationFastLatin.getOptions
public static int getOptions(CollationData data, CollationSettings settings, char[] primaries) { char[] header = data.fastLatinTableHeader; if(header == null) { return -1; } assert((header[0] >> 8) == VERSION); if(primaries.length != LATIN_LIMIT) { assert false; return -1; } int miniVarTop; if((settings.options & CollationSettings.ALTERNATE_MASK) == 0) { // No mini primaries are variable, set a variableTop just below the // lowest long mini primary. miniVarTop = MIN_LONG - 1; } else { int headerLength = header[0] & 0xff; int i = 1 + settings.getMaxVariable(); if(i >= headerLength) { return -1; // variableTop >= digits, should not occur } miniVarTop = header[i]; } boolean digitsAreReordered = false; if(settings.hasReordering()) { long prevStart = 0; long beforeDigitStart = 0; long digitStart = 0; long afterDigitStart = 0; for(int group = Collator.ReorderCodes.FIRST; group < Collator.ReorderCodes.FIRST + CollationData.MAX_NUM_SPECIAL_REORDER_CODES; ++group) { long start = data.getFirstPrimaryForGroup(group); start = settings.reorder(start); if(group == Collator.ReorderCodes.DIGIT) { beforeDigitStart = prevStart; digitStart = start; } else if(start != 0) { if(start < prevStart) { // The permutation affects the groups up to Latin. return -1; } // In the future, there might be a special group between digits & Latin. if(digitStart != 0 && afterDigitStart == 0 && prevStart == beforeDigitStart) { afterDigitStart = start; } prevStart = start; } } long latinStart = data.getFirstPrimaryForGroup(UScript.LATIN); latinStart = settings.reorder(latinStart); if(latinStart < prevStart) { return -1; } if(afterDigitStart == 0) { afterDigitStart = latinStart; } if(!(beforeDigitStart < digitStart && digitStart < afterDigitStart)) { digitsAreReordered = true; } } char[] table = data.fastLatinTable; // skip the header for(int c = 0; c < LATIN_LIMIT; ++c) { int p = table[c]; if(p >= MIN_SHORT) { p &= SHORT_PRIMARY_MASK; } else if(p > miniVarTop) { p &= LONG_PRIMARY_MASK; } else { p = 0; } primaries[c] = (char)p; } if(digitsAreReordered || (settings.options & CollationSettings.NUMERIC) != 0) { // Bail out for digits. for(int c = 0x30; c <= 0x39; ++c) { primaries[c] = 0; } } // Shift the miniVarTop above other options. return (miniVarTop << 16) | settings.options; }
java
public static int getOptions(CollationData data, CollationSettings settings, char[] primaries) { char[] header = data.fastLatinTableHeader; if(header == null) { return -1; } assert((header[0] >> 8) == VERSION); if(primaries.length != LATIN_LIMIT) { assert false; return -1; } int miniVarTop; if((settings.options & CollationSettings.ALTERNATE_MASK) == 0) { // No mini primaries are variable, set a variableTop just below the // lowest long mini primary. miniVarTop = MIN_LONG - 1; } else { int headerLength = header[0] & 0xff; int i = 1 + settings.getMaxVariable(); if(i >= headerLength) { return -1; // variableTop >= digits, should not occur } miniVarTop = header[i]; } boolean digitsAreReordered = false; if(settings.hasReordering()) { long prevStart = 0; long beforeDigitStart = 0; long digitStart = 0; long afterDigitStart = 0; for(int group = Collator.ReorderCodes.FIRST; group < Collator.ReorderCodes.FIRST + CollationData.MAX_NUM_SPECIAL_REORDER_CODES; ++group) { long start = data.getFirstPrimaryForGroup(group); start = settings.reorder(start); if(group == Collator.ReorderCodes.DIGIT) { beforeDigitStart = prevStart; digitStart = start; } else if(start != 0) { if(start < prevStart) { // The permutation affects the groups up to Latin. return -1; } // In the future, there might be a special group between digits & Latin. if(digitStart != 0 && afterDigitStart == 0 && prevStart == beforeDigitStart) { afterDigitStart = start; } prevStart = start; } } long latinStart = data.getFirstPrimaryForGroup(UScript.LATIN); latinStart = settings.reorder(latinStart); if(latinStart < prevStart) { return -1; } if(afterDigitStart == 0) { afterDigitStart = latinStart; } if(!(beforeDigitStart < digitStart && digitStart < afterDigitStart)) { digitsAreReordered = true; } } char[] table = data.fastLatinTable; // skip the header for(int c = 0; c < LATIN_LIMIT; ++c) { int p = table[c]; if(p >= MIN_SHORT) { p &= SHORT_PRIMARY_MASK; } else if(p > miniVarTop) { p &= LONG_PRIMARY_MASK; } else { p = 0; } primaries[c] = (char)p; } if(digitsAreReordered || (settings.options & CollationSettings.NUMERIC) != 0) { // Bail out for digits. for(int c = 0x30; c <= 0x39; ++c) { primaries[c] = 0; } } // Shift the miniVarTop above other options. return (miniVarTop << 16) | settings.options; }
[ "public", "static", "int", "getOptions", "(", "CollationData", "data", ",", "CollationSettings", "settings", ",", "char", "[", "]", "primaries", ")", "{", "char", "[", "]", "header", "=", "data", ".", "fastLatinTableHeader", ";", "if", "(", "header", "==", ...
Computes the options value for the compare functions and writes the precomputed primary weights. Returns -1 if the Latin fastpath is not supported for the data and settings. The capacity must be LATIN_LIMIT.
[ "Computes", "the", "options", "value", "for", "the", "compare", "functions", "and", "writes", "the", "precomputed", "primary", "weights", ".", "Returns", "-", "1", "if", "the", "Latin", "fastpath", "is", "not", "supported", "for", "the", "data", "and", "sett...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationFastLatin.java#L206-L288
35,535
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ClassLoader.java
ClassLoader.loadClass
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { // First, check if the class has already been loaded Class<?> c = findLoadedClass(name); if (c == null) { try { if (parent != null) { c = parent.loadClass(name, false); } else { c = findBootstrapClassOrNull(name); } } catch (ClassNotFoundException e) { // ClassNotFoundException thrown if class not found // from the non-null parent class loader } if (c == null) { // If still not found, then invoke findClass in order // to find the class. c = findClass(name); } } return c; }
java
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { // First, check if the class has already been loaded Class<?> c = findLoadedClass(name); if (c == null) { try { if (parent != null) { c = parent.loadClass(name, false); } else { c = findBootstrapClassOrNull(name); } } catch (ClassNotFoundException e) { // ClassNotFoundException thrown if class not found // from the non-null parent class loader } if (c == null) { // If still not found, then invoke findClass in order // to find the class. c = findClass(name); } } return c; }
[ "protected", "Class", "<", "?", ">", "loadClass", "(", "String", "name", ",", "boolean", "resolve", ")", "throws", "ClassNotFoundException", "{", "// First, check if the class has already been loaded", "Class", "<", "?", ">", "c", "=", "findLoadedClass", "(", "name"...
during the entire class loading process.
[ "during", "the", "entire", "class", "loading", "process", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ClassLoader.java#L307-L331
35,536
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/temporal/ValueRange.java
ValueRange.readObject
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException, InvalidObjectException { s.defaultReadObject(); if (minSmallest > minLargest) { throw new InvalidObjectException("Smallest minimum value must be less than largest minimum value"); } if (maxSmallest > maxLargest) { throw new InvalidObjectException("Smallest maximum value must be less than largest maximum value"); } if (minLargest > maxLargest) { throw new InvalidObjectException("Minimum value must be less than maximum value"); } }
java
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException, InvalidObjectException { s.defaultReadObject(); if (minSmallest > minLargest) { throw new InvalidObjectException("Smallest minimum value must be less than largest minimum value"); } if (maxSmallest > maxLargest) { throw new InvalidObjectException("Smallest maximum value must be less than largest maximum value"); } if (minLargest > maxLargest) { throw new InvalidObjectException("Minimum value must be less than maximum value"); } }
[ "private", "void", "readObject", "(", "ObjectInputStream", "s", ")", "throws", "IOException", ",", "ClassNotFoundException", ",", "InvalidObjectException", "{", "s", ".", "defaultReadObject", "(", ")", ";", "if", "(", "minSmallest", ">", "minLargest", ")", "{", ...
Restore the state of an ValueRange from the stream. Check that the values are valid. @param s the stream to read @throws InvalidObjectException if the smallest minimum is greater than the smallest maximum, or the smallest maximum is greater than the largest maximum or the largest minimum is greater than the largest maximum @throws ClassNotFoundException if a class cannot be resolved
[ "Restore", "the", "state", "of", "an", "ValueRange", "from", "the", "stream", ".", "Check", "that", "the", "values", "are", "valid", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/temporal/ValueRange.java#L355-L368
35,537
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java
UPropertyAliases.getPropertyName
public String getPropertyName(int property, int nameChoice) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } return getName(valueMaps[valueMapIndex], nameChoice); }
java
public String getPropertyName(int property, int nameChoice) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } return getName(valueMaps[valueMapIndex], nameChoice); }
[ "public", "String", "getPropertyName", "(", "int", "property", ",", "int", "nameChoice", ")", "{", "int", "valueMapIndex", "=", "findProperty", "(", "property", ")", ";", "if", "(", "valueMapIndex", "==", "0", ")", "{", "throw", "new", "IllegalArgumentExceptio...
Returns a property name given a property enum. Multiple names may be available for each property; the nameChoice selects among them.
[ "Returns", "a", "property", "name", "given", "a", "property", "enum", ".", "Multiple", "names", "may", "be", "available", "for", "each", "property", ";", "the", "nameChoice", "selects", "among", "them", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java#L243-L250
35,538
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java
UPropertyAliases.getPropertyValueName
public String getPropertyValueName(int property, int value, int nameChoice) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } int nameGroupOffset=findPropertyValueNameGroup(valueMaps[valueMapIndex+1], value); if(nameGroupOffset==0) { throw new IllegalArgumentException( "Property "+property+" (0x"+Integer.toHexString(property)+ ") does not have named values"); } return getName(nameGroupOffset, nameChoice); }
java
public String getPropertyValueName(int property, int value, int nameChoice) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } int nameGroupOffset=findPropertyValueNameGroup(valueMaps[valueMapIndex+1], value); if(nameGroupOffset==0) { throw new IllegalArgumentException( "Property "+property+" (0x"+Integer.toHexString(property)+ ") does not have named values"); } return getName(nameGroupOffset, nameChoice); }
[ "public", "String", "getPropertyValueName", "(", "int", "property", ",", "int", "value", ",", "int", "nameChoice", ")", "{", "int", "valueMapIndex", "=", "findProperty", "(", "property", ")", ";", "if", "(", "valueMapIndex", "==", "0", ")", "{", "throw", "...
Returns a value name given a property enum and a value enum. Multiple names may be available for each value; the nameChoice selects among them.
[ "Returns", "a", "value", "name", "given", "a", "property", "enum", "and", "a", "value", "enum", ".", "Multiple", "names", "may", "be", "available", "for", "each", "value", ";", "the", "nameChoice", "selects", "among", "them", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java#L257-L270
35,539
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java
UPropertyAliases.getPropertyValueEnum
public int getPropertyValueEnum(int property, CharSequence alias) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } valueMapIndex=valueMaps[valueMapIndex+1]; if(valueMapIndex==0) { throw new IllegalArgumentException( "Property "+property+" (0x"+Integer.toHexString(property)+ ") does not have named values"); } // valueMapIndex is the start of the property's valueMap, // where the first word is the BytesTrie offset. return getPropertyOrValueEnum(valueMaps[valueMapIndex], alias); }
java
public int getPropertyValueEnum(int property, CharSequence alias) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } valueMapIndex=valueMaps[valueMapIndex+1]; if(valueMapIndex==0) { throw new IllegalArgumentException( "Property "+property+" (0x"+Integer.toHexString(property)+ ") does not have named values"); } // valueMapIndex is the start of the property's valueMap, // where the first word is the BytesTrie offset. return getPropertyOrValueEnum(valueMaps[valueMapIndex], alias); }
[ "public", "int", "getPropertyValueEnum", "(", "int", "property", ",", "CharSequence", "alias", ")", "{", "int", "valueMapIndex", "=", "findProperty", "(", "property", ")", ";", "if", "(", "valueMapIndex", "==", "0", ")", "{", "throw", "new", "IllegalArgumentEx...
Returns a value enum given a property enum and one of its value names.
[ "Returns", "a", "value", "enum", "given", "a", "property", "enum", "and", "one", "of", "its", "value", "names", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java#L293-L308
35,540
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java
UPropertyAliases.getPropertyValueEnumNoThrow
public int getPropertyValueEnumNoThrow(int property, CharSequence alias) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { return UProperty.UNDEFINED; } valueMapIndex=valueMaps[valueMapIndex+1]; if(valueMapIndex==0) { return UProperty.UNDEFINED; } // valueMapIndex is the start of the property's valueMap, // where the first word is the BytesTrie offset. return getPropertyOrValueEnum(valueMaps[valueMapIndex], alias); }
java
public int getPropertyValueEnumNoThrow(int property, CharSequence alias) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { return UProperty.UNDEFINED; } valueMapIndex=valueMaps[valueMapIndex+1]; if(valueMapIndex==0) { return UProperty.UNDEFINED; } // valueMapIndex is the start of the property's valueMap, // where the first word is the BytesTrie offset. return getPropertyOrValueEnum(valueMaps[valueMapIndex], alias); }
[ "public", "int", "getPropertyValueEnumNoThrow", "(", "int", "property", ",", "CharSequence", "alias", ")", "{", "int", "valueMapIndex", "=", "findProperty", "(", "property", ")", ";", "if", "(", "valueMapIndex", "==", "0", ")", "{", "return", "UProperty", ".",...
Returns a value enum given a property enum and one of its value names. Does not throw. @return value enum, or UProperty.UNDEFINED if not defined for that property
[ "Returns", "a", "value", "enum", "given", "a", "property", "enum", "and", "one", "of", "its", "value", "names", ".", "Does", "not", "throw", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java#L314-L326
35,541
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/data/TokenIterator.java
TokenIterator.next
public String next() throws IOException { if (done) { return null; } for (;;) { if (line == null) { line = reader.readLineSkippingComments(); if (line == null) { done = true; return null; } pos = 0; } buf.setLength(0); lastpos = pos; pos = nextToken(pos); if (pos < 0) { line = null; continue; } return buf.toString(); } }
java
public String next() throws IOException { if (done) { return null; } for (;;) { if (line == null) { line = reader.readLineSkippingComments(); if (line == null) { done = true; return null; } pos = 0; } buf.setLength(0); lastpos = pos; pos = nextToken(pos); if (pos < 0) { line = null; continue; } return buf.toString(); } }
[ "public", "String", "next", "(", ")", "throws", "IOException", "{", "if", "(", "done", ")", "{", "return", "null", ";", "}", "for", "(", ";", ";", ")", "{", "if", "(", "line", "==", "null", ")", "{", "line", "=", "reader", ".", "readLineSkippingCom...
Return the next token from this iterator, or null if the last token has been returned.
[ "Return", "the", "next", "token", "from", "this", "iterator", "or", "null", "if", "the", "last", "token", "has", "been", "returned", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/data/TokenIterator.java#L59-L81
35,542
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationIterator.java
CollationIterator.nextCE
public final long nextCE() { if(cesIndex < ceBuffer.length) { // Return the next buffered CE. return ceBuffer.get(cesIndex++); } assert cesIndex == ceBuffer.length; ceBuffer.incLength(); long cAndCE32 = handleNextCE32(); int c = (int)(cAndCE32 >> 32); int ce32 = (int)cAndCE32; int t = ce32 & 0xff; if(t < Collation.SPECIAL_CE32_LOW_BYTE) { // Forced-inline of isSpecialCE32(ce32). // Normal CE from the main data. // Forced-inline of ceFromSimpleCE32(ce32). return ceBuffer.set(cesIndex++, ((long)(ce32 & 0xffff0000) << 32) | ((long)(ce32 & 0xff00) << 16) | (t << 8)); } CollationData d; // The compiler should be able to optimize the previous and the following // comparisons of t with the same constant. if(t == Collation.SPECIAL_CE32_LOW_BYTE) { if(c < 0) { return ceBuffer.set(cesIndex++, Collation.NO_CE); } d = data.base; ce32 = d.getCE32(c); t = ce32 & 0xff; if(t < Collation.SPECIAL_CE32_LOW_BYTE) { // Normal CE from the base data. return ceBuffer.set(cesIndex++, ((long)(ce32 & 0xffff0000) << 32) | ((long)(ce32 & 0xff00) << 16) | (t << 8)); } } else { d = data; } if(t == Collation.LONG_PRIMARY_CE32_LOW_BYTE) { // Forced-inline of ceFromLongPrimaryCE32(ce32). return ceBuffer.set(cesIndex++, ((long)(ce32 - t) << 32) | Collation.COMMON_SEC_AND_TER_CE); } return nextCEFromCE32(d, c, ce32); }
java
public final long nextCE() { if(cesIndex < ceBuffer.length) { // Return the next buffered CE. return ceBuffer.get(cesIndex++); } assert cesIndex == ceBuffer.length; ceBuffer.incLength(); long cAndCE32 = handleNextCE32(); int c = (int)(cAndCE32 >> 32); int ce32 = (int)cAndCE32; int t = ce32 & 0xff; if(t < Collation.SPECIAL_CE32_LOW_BYTE) { // Forced-inline of isSpecialCE32(ce32). // Normal CE from the main data. // Forced-inline of ceFromSimpleCE32(ce32). return ceBuffer.set(cesIndex++, ((long)(ce32 & 0xffff0000) << 32) | ((long)(ce32 & 0xff00) << 16) | (t << 8)); } CollationData d; // The compiler should be able to optimize the previous and the following // comparisons of t with the same constant. if(t == Collation.SPECIAL_CE32_LOW_BYTE) { if(c < 0) { return ceBuffer.set(cesIndex++, Collation.NO_CE); } d = data.base; ce32 = d.getCE32(c); t = ce32 & 0xff; if(t < Collation.SPECIAL_CE32_LOW_BYTE) { // Normal CE from the base data. return ceBuffer.set(cesIndex++, ((long)(ce32 & 0xffff0000) << 32) | ((long)(ce32 & 0xff00) << 16) | (t << 8)); } } else { d = data; } if(t == Collation.LONG_PRIMARY_CE32_LOW_BYTE) { // Forced-inline of ceFromLongPrimaryCE32(ce32). return ceBuffer.set(cesIndex++, ((long)(ce32 - t) << 32) | Collation.COMMON_SEC_AND_TER_CE); } return nextCEFromCE32(d, c, ce32); }
[ "public", "final", "long", "nextCE", "(", ")", "{", "if", "(", "cesIndex", "<", "ceBuffer", ".", "length", ")", "{", "// Return the next buffered CE.", "return", "ceBuffer", ".", "get", "(", "cesIndex", "++", ")", ";", "}", "assert", "cesIndex", "==", "ceB...
Returns the next collation element.
[ "Returns", "the", "next", "collation", "element", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationIterator.java#L242-L283
35,543
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationIterator.java
CollationIterator.previousCE
public final long previousCE(UVector32 offsets) { if(ceBuffer.length > 0) { // Return the previous buffered CE. return ceBuffer.get(--ceBuffer.length); } offsets.removeAllElements(); int limitOffset = getOffset(); int c = previousCodePoint(); if(c < 0) { return Collation.NO_CE; } if(data.isUnsafeBackward(c, isNumeric)) { return previousCEUnsafe(c, offsets); } // Simple, safe-backwards iteration: // Get a CE going backwards, handle prefixes but no contractions. int ce32 = data.getCE32(c); CollationData d; if(ce32 == Collation.FALLBACK_CE32) { d = data.base; ce32 = d.getCE32(c); } else { d = data; } if(Collation.isSimpleOrLongCE32(ce32)) { return Collation.ceFromCE32(ce32); } appendCEsFromCE32(d, c, ce32, false); if(ceBuffer.length > 1) { offsets.addElement(getOffset()); // For an expansion, the offset of each non-initial CE is the limit offset, // consistent with forward iteration. while(offsets.size() <= ceBuffer.length) { offsets.addElement(limitOffset); }; } return ceBuffer.get(--ceBuffer.length); }
java
public final long previousCE(UVector32 offsets) { if(ceBuffer.length > 0) { // Return the previous buffered CE. return ceBuffer.get(--ceBuffer.length); } offsets.removeAllElements(); int limitOffset = getOffset(); int c = previousCodePoint(); if(c < 0) { return Collation.NO_CE; } if(data.isUnsafeBackward(c, isNumeric)) { return previousCEUnsafe(c, offsets); } // Simple, safe-backwards iteration: // Get a CE going backwards, handle prefixes but no contractions. int ce32 = data.getCE32(c); CollationData d; if(ce32 == Collation.FALLBACK_CE32) { d = data.base; ce32 = d.getCE32(c); } else { d = data; } if(Collation.isSimpleOrLongCE32(ce32)) { return Collation.ceFromCE32(ce32); } appendCEsFromCE32(d, c, ce32, false); if(ceBuffer.length > 1) { offsets.addElement(getOffset()); // For an expansion, the offset of each non-initial CE is the limit offset, // consistent with forward iteration. while(offsets.size() <= ceBuffer.length) { offsets.addElement(limitOffset); }; } return ceBuffer.get(--ceBuffer.length); }
[ "public", "final", "long", "previousCE", "(", "UVector32", "offsets", ")", "{", "if", "(", "ceBuffer", ".", "length", ">", "0", ")", "{", "// Return the previous buffered CE.", "return", "ceBuffer", ".", "get", "(", "--", "ceBuffer", ".", "length", ")", ";",...
Returns the previous collation element.
[ "Returns", "the", "previous", "collation", "element", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationIterator.java#L308-L343
35,544
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_I.java
XResources_ja_JP_I.getContents
public Object[][] getContents() { return new Object[][] { { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" }, { "alphabet", new CharArrayWrapper( new char[]{ 0x30a4, 0x30ed, 0x30cf, 0x30cb, 0x30db, 0x30d8, 0x30c8, 0x30c1, 0x30ea, 0x30cc, 0x30eb, 0x30f2, 0x30ef, 0x30ab, 0x30e8, 0x30bf, 0x30ec, 0x30bd, 0x30c4, 0x30cd, 0x30ca, 0x30e9, 0x30e0, 0x30a6, 0x30f0, 0x30ce, 0x30aa, 0x30af, 0x30e4, 0x30de, 0x30b1, 0x30d5, 0x30b3, 0x30a8, 0x30c6, 0x30a2, 0x30b5, 0x30ad, 0x30e6, 0x30e1, 0x30df, 0x30b7, 0x30f1, 0x30d2, 0x30e2, 0x30bb, 0x30b9 }) }, { "tradAlphabet", new CharArrayWrapper( new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }) }, //language orientation { "orientation", "LeftToRight" }, //language numbering { "numbering", "multiplicative-additive" }, { "multiplierOrder", "follows" }, // largest numerical value //{"MaxNumericalValue", new Integer(10000000000)}, //These would not be used for EN. Only used for traditional numbering { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) }, //These only used for mutiplicative-additive numbering // Note that we are using longs and that the last two // multipliers are not supported. This is a known limitation. { "multiplier", new LongArrayWrapper( new long[]{ Long.MAX_VALUE, Long.MAX_VALUE, 100000000, 10000, 1000, 100, 10 }) }, { "multiplierChar", new CharArrayWrapper( new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 }) }, // chinese only?? { "zero", new CharArrayWrapper(new char[0]) }, { "digits", new CharArrayWrapper( new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D }) }, { "tables", new StringArrayWrapper( new String[]{ "digits" }) } }; }
java
public Object[][] getContents() { return new Object[][] { { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" }, { "alphabet", new CharArrayWrapper( new char[]{ 0x30a4, 0x30ed, 0x30cf, 0x30cb, 0x30db, 0x30d8, 0x30c8, 0x30c1, 0x30ea, 0x30cc, 0x30eb, 0x30f2, 0x30ef, 0x30ab, 0x30e8, 0x30bf, 0x30ec, 0x30bd, 0x30c4, 0x30cd, 0x30ca, 0x30e9, 0x30e0, 0x30a6, 0x30f0, 0x30ce, 0x30aa, 0x30af, 0x30e4, 0x30de, 0x30b1, 0x30d5, 0x30b3, 0x30a8, 0x30c6, 0x30a2, 0x30b5, 0x30ad, 0x30e6, 0x30e1, 0x30df, 0x30b7, 0x30f1, 0x30d2, 0x30e2, 0x30bb, 0x30b9 }) }, { "tradAlphabet", new CharArrayWrapper( new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }) }, //language orientation { "orientation", "LeftToRight" }, //language numbering { "numbering", "multiplicative-additive" }, { "multiplierOrder", "follows" }, // largest numerical value //{"MaxNumericalValue", new Integer(10000000000)}, //These would not be used for EN. Only used for traditional numbering { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) }, //These only used for mutiplicative-additive numbering // Note that we are using longs and that the last two // multipliers are not supported. This is a known limitation. { "multiplier", new LongArrayWrapper( new long[]{ Long.MAX_VALUE, Long.MAX_VALUE, 100000000, 10000, 1000, 100, 10 }) }, { "multiplierChar", new CharArrayWrapper( new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 }) }, // chinese only?? { "zero", new CharArrayWrapper(new char[0]) }, { "digits", new CharArrayWrapper( new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D }) }, { "tables", new StringArrayWrapper( new String[]{ "digits" }) } }; }
[ "public", "Object", "[", "]", "[", "]", "getContents", "(", ")", "{", "return", "new", "Object", "[", "]", "[", "]", "{", "{", "\"ui_language\"", ",", "\"ja\"", "}", ",", "{", "\"help_language\"", ",", "\"ja\"", "}", ",", "{", "\"language\"", ",", "\...
Get the association table for this resource. @return the association table for this resource.
[ "Get", "the", "association", "table", "for", "this", "resource", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_I.java#L40-L85
35,545
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java
AVA.getValueString
public String getValueString() { try { String s = value.getAsString(); if (s == null) { throw new RuntimeException("AVA string is null"); } return s; } catch (IOException e) { // should not occur throw new RuntimeException("AVA error: " + e, e); } }
java
public String getValueString() { try { String s = value.getAsString(); if (s == null) { throw new RuntimeException("AVA string is null"); } return s; } catch (IOException e) { // should not occur throw new RuntimeException("AVA error: " + e, e); } }
[ "public", "String", "getValueString", "(", ")", "{", "try", "{", "String", "s", "=", "value", ".", "getAsString", "(", ")", ";", "if", "(", "s", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"AVA string is null\"", ")", ";", "}", "...
Get the value of this AVA as a String. @exception RuntimeException if we could not obtain the string form (should not occur)
[ "Get", "the", "value", "of", "this", "AVA", "as", "a", "String", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java#L249-L260
35,546
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java
AVAKeyword.getKeyword
static String getKeyword(ObjectIdentifier oid, int standard) { return getKeyword (oid, standard, Collections.<String, String>emptyMap()); }
java
static String getKeyword(ObjectIdentifier oid, int standard) { return getKeyword (oid, standard, Collections.<String, String>emptyMap()); }
[ "static", "String", "getKeyword", "(", "ObjectIdentifier", "oid", ",", "int", "standard", ")", "{", "return", "getKeyword", "(", "oid", ",", "standard", ",", "Collections", ".", "<", "String", ",", "String", ">", "emptyMap", "(", ")", ")", ";", "}" ]
Get a keyword for the given ObjectIdentifier according to standard. If no keyword is available, the ObjectIdentifier is encoded as a String.
[ "Get", "a", "keyword", "for", "the", "given", "ObjectIdentifier", "according", "to", "standard", ".", "If", "no", "keyword", "is", "available", "the", "ObjectIdentifier", "is", "encoded", "as", "a", "String", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java#L1305-L1308
35,547
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java
AVAKeyword.hasKeyword
static boolean hasKeyword(ObjectIdentifier oid, int standard) { AVAKeyword ak = oidMap.get(oid); if (ak == null) { return false; } return ak.isCompliant(standard); }
java
static boolean hasKeyword(ObjectIdentifier oid, int standard) { AVAKeyword ak = oidMap.get(oid); if (ak == null) { return false; } return ak.isCompliant(standard); }
[ "static", "boolean", "hasKeyword", "(", "ObjectIdentifier", "oid", ",", "int", "standard", ")", "{", "AVAKeyword", "ak", "=", "oidMap", ".", "get", "(", "oid", ")", ";", "if", "(", "ak", "==", "null", ")", "{", "return", "false", ";", "}", "return", ...
Test if oid has an associated keyword in standard.
[ "Test", "if", "oid", "has", "an", "associated", "keyword", "in", "standard", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java#L1358-L1364
35,548
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
ChunkedIntArray.specialFind
int specialFind(int startPos, int position) { // We have to look all the way up the ancestor chain // to make sure we don't have an ancestor. int ancestor = startPos; while(ancestor > 0) { // Get the node whose index == ancestor ancestor*=slotsize; int chunkpos = ancestor >> lowbits; int slotpos = ancestor & lowmask; int[] chunk = chunks.elementAt(chunkpos); // Get that node's parent (Note that this assumes w[1] // is the parent node index. That's really a DTM feature // rather than a ChunkedIntArray feature.) ancestor = chunk[slotpos + 1]; if(ancestor == position) break; } if (ancestor <= 0) { return position; } return -1; }
java
int specialFind(int startPos, int position) { // We have to look all the way up the ancestor chain // to make sure we don't have an ancestor. int ancestor = startPos; while(ancestor > 0) { // Get the node whose index == ancestor ancestor*=slotsize; int chunkpos = ancestor >> lowbits; int slotpos = ancestor & lowmask; int[] chunk = chunks.elementAt(chunkpos); // Get that node's parent (Note that this assumes w[1] // is the parent node index. That's really a DTM feature // rather than a ChunkedIntArray feature.) ancestor = chunk[slotpos + 1]; if(ancestor == position) break; } if (ancestor <= 0) { return position; } return -1; }
[ "int", "specialFind", "(", "int", "startPos", ",", "int", "position", ")", "{", "// We have to look all the way up the ancestor chain", "// to make sure we don't have an ancestor.", "int", "ancestor", "=", "startPos", ";", "while", "(", "ancestor", ">", "0", ")", "{", ...
This test supports DTM.getNextPreceding.
[ "This", "test", "supports", "DTM", ".", "getNextPreceding", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java#L137-L164
35,549
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
ChunkedIntArray.readSlot
void readSlot(int position, int[] buffer) { /* try { System.arraycopy(fastArray, position*slotsize, buffer, 0, slotsize); } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (2): "+position); position *= slotsize; int chunkpos = position >> lowbits; int slotpos = (position & lowmask); // Grow if needed if (chunkpos > chunks.size() - 1) chunks.addElement(new int[chunkalloc]); int[] chunk = chunks.elementAt(chunkpos); System.arraycopy(chunk,slotpos,buffer,0,slotsize); } }
java
void readSlot(int position, int[] buffer) { /* try { System.arraycopy(fastArray, position*slotsize, buffer, 0, slotsize); } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (2): "+position); position *= slotsize; int chunkpos = position >> lowbits; int slotpos = (position & lowmask); // Grow if needed if (chunkpos > chunks.size() - 1) chunks.addElement(new int[chunkalloc]); int[] chunk = chunks.elementAt(chunkpos); System.arraycopy(chunk,slotpos,buffer,0,slotsize); } }
[ "void", "readSlot", "(", "int", "position", ",", "int", "[", "]", "buffer", ")", "{", "/*\n try\n {\n System.arraycopy(fastArray, position*slotsize, buffer, 0, slotsize);\n }\n catch(ArrayIndexOutOfBoundsException aioobe)\n */", "{", "// System.out.println(\"Using slo...
Retrieve the contents of a record into a user-supplied buffer array. Used to reduce addressing overhead when code will access several columns of the record. @param position int Record number @param buffer int[] Integer array provided by user, must be large enough to hold a complete record.
[ "Retrieve", "the", "contents", "of", "a", "record", "into", "a", "user", "-", "supplied", "buffer", "array", ".", "Used", "to", "reduce", "addressing", "overhead", "when", "code", "will", "access", "several", "columns", "of", "the", "record", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java#L245-L266
35,550
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedInputStream.java
BufferedInputStream.fill
private void fill() throws IOException { byte[] buffer = getBufIfOpen(); if (markpos < 0) pos = 0; /* no mark: throw away the buffer */ else if (pos >= buffer.length) /* no room left in buffer */ if (markpos > 0) { /* can throw away early part of the buffer */ int sz = pos - markpos; System.arraycopy(buffer, markpos, buffer, 0, sz); pos = sz; markpos = 0; } else if (buffer.length >= marklimit) { markpos = -1; /* buffer got too big, invalidate mark */ pos = 0; /* drop buffer contents */ } else if (buffer.length >= MAX_BUFFER_SIZE) { throw new OutOfMemoryError("Required array size too large"); } else { /* grow buffer */ int nsz = (pos <= MAX_BUFFER_SIZE - pos) ? pos * 2 : MAX_BUFFER_SIZE; if (nsz > marklimit) nsz = marklimit; byte nbuf[] = new byte[nsz]; System.arraycopy(buffer, 0, nbuf, 0, pos); if (!compareAndSetBuf(buffer, nbuf)) { // Can't replace buf if there was an async close. // Note: This would need to be changed if fill() // is ever made accessible to multiple threads. // But for now, the only way CAS can fail is via close. // assert buf == null; throw new IOException("Stream closed"); } buffer = nbuf; } count = pos; int n = getInIfOpen().read(buffer, pos, buffer.length - pos); if (n > 0) count = n + pos; }
java
private void fill() throws IOException { byte[] buffer = getBufIfOpen(); if (markpos < 0) pos = 0; /* no mark: throw away the buffer */ else if (pos >= buffer.length) /* no room left in buffer */ if (markpos > 0) { /* can throw away early part of the buffer */ int sz = pos - markpos; System.arraycopy(buffer, markpos, buffer, 0, sz); pos = sz; markpos = 0; } else if (buffer.length >= marklimit) { markpos = -1; /* buffer got too big, invalidate mark */ pos = 0; /* drop buffer contents */ } else if (buffer.length >= MAX_BUFFER_SIZE) { throw new OutOfMemoryError("Required array size too large"); } else { /* grow buffer */ int nsz = (pos <= MAX_BUFFER_SIZE - pos) ? pos * 2 : MAX_BUFFER_SIZE; if (nsz > marklimit) nsz = marklimit; byte nbuf[] = new byte[nsz]; System.arraycopy(buffer, 0, nbuf, 0, pos); if (!compareAndSetBuf(buffer, nbuf)) { // Can't replace buf if there was an async close. // Note: This would need to be changed if fill() // is ever made accessible to multiple threads. // But for now, the only way CAS can fail is via close. // assert buf == null; throw new IOException("Stream closed"); } buffer = nbuf; } count = pos; int n = getInIfOpen().read(buffer, pos, buffer.length - pos); if (n > 0) count = n + pos; }
[ "private", "void", "fill", "(", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "getBufIfOpen", "(", ")", ";", "if", "(", "markpos", "<", "0", ")", "pos", "=", "0", ";", "/* no mark: throw away the buffer */", "else", "if", "(", "pos"...
Fills the buffer with more data, taking into account shuffling and other tricks for dealing with marks. Assumes that it is being called by a synchronized method. This method also assumes that all data has already been read in, hence pos > count.
[ "Fills", "the", "buffer", "with", "more", "data", "taking", "into", "account", "shuffling", "and", "other", "tricks", "for", "dealing", "with", "marks", ".", "Assumes", "that", "it", "is", "being", "called", "by", "a", "synchronized", "method", ".", "This", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedInputStream.java#L220-L256
35,551
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedInputStream.java
BufferedInputStream.read
public synchronized int read(byte b[], int off, int len) throws IOException { getBufIfOpen(); // Check for closed stream if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } int n = 0; for (;;) { int nread = read1(b, off + n, len - n); if (nread <= 0) return (n == 0) ? nread : n; n += nread; if (n >= len) return n; // if not closed but no bytes available, return InputStream input = in; if (input != null && input.available() <= 0) return n; } }
java
public synchronized int read(byte b[], int off, int len) throws IOException { getBufIfOpen(); // Check for closed stream if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } int n = 0; for (;;) { int nread = read1(b, off + n, len - n); if (nread <= 0) return (n == 0) ? nread : n; n += nread; if (n >= len) return n; // if not closed but no bytes available, return InputStream input = in; if (input != null && input.available() <= 0) return n; } }
[ "public", "synchronized", "int", "read", "(", "byte", "b", "[", "]", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "getBufIfOpen", "(", ")", ";", "// Check for closed stream", "if", "(", "(", "off", "|", "len", "|", "(", "off...
Reads bytes from this byte-input stream into the specified byte array, starting at the given offset. <p> This method implements the general contract of the corresponding <code>{@link InputStream#read(byte[], int, int) read}</code> method of the <code>{@link InputStream}</code> class. As an additional convenience, it attempts to read as many bytes as possible by repeatedly invoking the <code>read</code> method of the underlying stream. This iterated <code>read</code> continues until one of the following conditions becomes true: <ul> <li> The specified number of bytes have been read, <li> The <code>read</code> method of the underlying stream returns <code>-1</code>, indicating end-of-file, or <li> The <code>available</code> method of the underlying stream returns zero, indicating that further input requests would block. </ul> If the first <code>read</code> on the underlying stream returns <code>-1</code> to indicate end-of-file then this method returns <code>-1</code>. Otherwise this method returns the number of bytes actually read. <p> Subclasses of this class are encouraged, but not required, to attempt to read as many bytes as possible in the same fashion. @param b destination buffer. @param off offset at which to start storing bytes. @param len maximum number of bytes to read. @return the number of bytes read, or <code>-1</code> if the end of the stream has been reached. @exception IOException if this input stream has been closed by invoking its {@link #close()} method, or an I/O error occurs.
[ "Reads", "bytes", "from", "this", "byte", "-", "input", "stream", "into", "the", "specified", "byte", "array", "starting", "at", "the", "given", "offset", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedInputStream.java#L340-L363
35,552
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Streams.java
Streams.composeWithExceptions
static Runnable composeWithExceptions(Runnable a, Runnable b) { return new Runnable() { @Override public void run() { try { a.run(); } catch (Throwable e1) { try { b.run(); } catch (Throwable e2) { try { e1.addSuppressed(e2); } catch (Throwable ignore) {} } throw e1; } b.run(); } }; }
java
static Runnable composeWithExceptions(Runnable a, Runnable b) { return new Runnable() { @Override public void run() { try { a.run(); } catch (Throwable e1) { try { b.run(); } catch (Throwable e2) { try { e1.addSuppressed(e2); } catch (Throwable ignore) {} } throw e1; } b.run(); } }; }
[ "static", "Runnable", "composeWithExceptions", "(", "Runnable", "a", ",", "Runnable", "b", ")", "{", "return", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "try", "{", "a", ".", "run", "(", ")", ";", "}",...
Given two Runnables, return a Runnable that executes both in sequence, even if the first throws an exception, and if both throw exceptions, add any exceptions thrown by the second as suppressed exceptions of the first.
[ "Given", "two", "Runnables", "return", "a", "Runnable", "that", "executes", "both", "in", "sequence", "even", "if", "the", "first", "throws", "an", "exception", "and", "if", "both", "throw", "exceptions", "add", "any", "exceptions", "thrown", "by", "the", "s...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Streams.java#L845-L866
35,553
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ListResourceBundle.java
ListResourceBundle.handleGetObject
public final Object handleGetObject(String key) { // lazily load the lookup hashtable. if (lookup == null) { loadLookup(); } if (key == null) { throw new NullPointerException(); } return lookup.get(key); // this class ignores locales }
java
public final Object handleGetObject(String key) { // lazily load the lookup hashtable. if (lookup == null) { loadLookup(); } if (key == null) { throw new NullPointerException(); } return lookup.get(key); // this class ignores locales }
[ "public", "final", "Object", "handleGetObject", "(", "String", "key", ")", "{", "// lazily load the lookup hashtable.", "if", "(", "lookup", "==", "null", ")", "{", "loadLookup", "(", ")", ";", "}", "if", "(", "key", "==", "null", ")", "{", "throw", "new",...
Implements java.util.ResourceBundle.handleGetObject; inherits javadoc specification.
[ "Implements", "java", ".", "util", ".", "ResourceBundle", ".", "handleGetObject", ";", "inherits", "javadoc", "specification", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ListResourceBundle.java#L127-L136
35,554
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ListResourceBundle.java
ListResourceBundle.loadLookup
private synchronized void loadLookup() { if (lookup != null) return; Object[][] contents = getContents(); HashMap<String,Object> temp = new HashMap<>(contents.length); for (int i = 0; i < contents.length; ++i) { // key must be non-null String, value must be non-null String key = (String) contents[i][0]; Object value = contents[i][1]; if (key == null || value == null) { throw new NullPointerException(); } temp.put(key, value); } lookup = temp; }
java
private synchronized void loadLookup() { if (lookup != null) return; Object[][] contents = getContents(); HashMap<String,Object> temp = new HashMap<>(contents.length); for (int i = 0; i < contents.length; ++i) { // key must be non-null String, value must be non-null String key = (String) contents[i][0]; Object value = contents[i][1]; if (key == null || value == null) { throw new NullPointerException(); } temp.put(key, value); } lookup = temp; }
[ "private", "synchronized", "void", "loadLookup", "(", ")", "{", "if", "(", "lookup", "!=", "null", ")", "return", ";", "Object", "[", "]", "[", "]", "contents", "=", "getContents", "(", ")", ";", "HashMap", "<", "String", ",", "Object", ">", "temp", ...
We lazily load the lookup hashtable. This function does the loading.
[ "We", "lazily", "load", "the", "lookup", "hashtable", ".", "This", "function", "does", "the", "loading", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ListResourceBundle.java#L191-L207
35,555
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/Adler32.java
Adler32.update
public void update(byte[] b, int off, int len) { if (b == null) { throw new NullPointerException(); } if (off < 0 || len < 0 || off > b.length - len) { throw new ArrayIndexOutOfBoundsException(); } adler = updateBytes(adler, b, off, len); }
java
public void update(byte[] b, int off, int len) { if (b == null) { throw new NullPointerException(); } if (off < 0 || len < 0 || off > b.length - len) { throw new ArrayIndexOutOfBoundsException(); } adler = updateBytes(adler, b, off, len); }
[ "public", "void", "update", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "{", "if", "(", "b", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "if", "(", "off", "<", "0", "||", "len",...
Updates the checksum with the specified array of bytes.
[ "Updates", "the", "checksum", "with", "the", "specified", "array", "of", "bytes", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/Adler32.java#L66-L74
35,556
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/Adler32.java
Adler32.update
private void update(ByteBuffer buffer) { int pos = buffer.position(); int limit = buffer.limit(); assert (pos <= limit); int rem = limit - pos; if (rem <= 0) return; if (buffer instanceof DirectBuffer) { adler = updateByteBuffer(adler, ((DirectBuffer)buffer).address(), pos, rem); } else if (buffer.hasArray()) { adler = updateBytes(adler, buffer.array(), pos + buffer.arrayOffset(), rem); } else { byte[] b = new byte[rem]; buffer.get(b); adler = updateBytes(adler, b, 0, b.length); } buffer.position(limit); }
java
private void update(ByteBuffer buffer) { int pos = buffer.position(); int limit = buffer.limit(); assert (pos <= limit); int rem = limit - pos; if (rem <= 0) return; if (buffer instanceof DirectBuffer) { adler = updateByteBuffer(adler, ((DirectBuffer)buffer).address(), pos, rem); } else if (buffer.hasArray()) { adler = updateBytes(adler, buffer.array(), pos + buffer.arrayOffset(), rem); } else { byte[] b = new byte[rem]; buffer.get(b); adler = updateBytes(adler, b, 0, b.length); } buffer.position(limit); }
[ "private", "void", "update", "(", "ByteBuffer", "buffer", ")", "{", "int", "pos", "=", "buffer", ".", "position", "(", ")", ";", "int", "limit", "=", "buffer", ".", "limit", "(", ")", ";", "assert", "(", "pos", "<=", "limit", ")", ";", "int", "rem"...
Updates the checksum with the bytes from the specified buffer. The checksum is updated using buffer.{@link java.nio.Buffer#remaining() remaining()} bytes starting at buffer.{@link java.nio.Buffer#position() position()} Upon return, the buffer's position will be updated to its limit; its limit will not have been changed. @param buffer the ByteBuffer to update the checksum with
[ "Updates", "the", "checksum", "with", "the", "bytes", "from", "the", "specified", "buffer", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/Adler32.java#L97-L114
35,557
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationDataBuilder.java
CollationDataBuilder.encodeCEs
int encodeCEs(long ces[], int cesLength) { if(cesLength < 0 || cesLength > Collation.MAX_EXPANSION_LENGTH) { throw new IllegalArgumentException("mapping to too many CEs"); } if(!isMutable()) { throw new IllegalStateException("attempt to add mappings after build()"); } if(cesLength == 0) { // Convenience: We cannot map to nothing, but we can map to a completely ignorable CE. // Do this here so that callers need not do it. return encodeOneCEAsCE32(0); } else if(cesLength == 1) { return encodeOneCE(ces[0]); } else if(cesLength == 2) { // Try to encode two CEs as one CE32. long ce0 = ces[0]; long ce1 = ces[1]; long p0 = ce0 >>> 32; if((ce0 & 0xffffffffff00ffL) == Collation.COMMON_SECONDARY_CE && (ce1 & 0xffffffff00ffffffL) == Collation.COMMON_TERTIARY_CE && p0 != 0) { // Latin mini expansion return (int)p0 | (((int)ce0 & 0xff00) << 8) | (((int)ce1 >> 16) & 0xff00) | Collation.SPECIAL_CE32_LOW_BYTE | Collation.LATIN_EXPANSION_TAG; } } // Try to encode two or more CEs as CE32s. int[] newCE32s = new int[Collation.MAX_EXPANSION_LENGTH]; // TODO: instance field? for(int i = 0;; ++i) { if(i == cesLength) { return encodeExpansion32(newCE32s, 0, cesLength); } int ce32 = encodeOneCEAsCE32(ces[i]); if(ce32 == Collation.NO_CE32) { break; } newCE32s[i] = ce32; } return encodeExpansion(ces, 0, cesLength); }
java
int encodeCEs(long ces[], int cesLength) { if(cesLength < 0 || cesLength > Collation.MAX_EXPANSION_LENGTH) { throw new IllegalArgumentException("mapping to too many CEs"); } if(!isMutable()) { throw new IllegalStateException("attempt to add mappings after build()"); } if(cesLength == 0) { // Convenience: We cannot map to nothing, but we can map to a completely ignorable CE. // Do this here so that callers need not do it. return encodeOneCEAsCE32(0); } else if(cesLength == 1) { return encodeOneCE(ces[0]); } else if(cesLength == 2) { // Try to encode two CEs as one CE32. long ce0 = ces[0]; long ce1 = ces[1]; long p0 = ce0 >>> 32; if((ce0 & 0xffffffffff00ffL) == Collation.COMMON_SECONDARY_CE && (ce1 & 0xffffffff00ffffffL) == Collation.COMMON_TERTIARY_CE && p0 != 0) { // Latin mini expansion return (int)p0 | (((int)ce0 & 0xff00) << 8) | (((int)ce1 >> 16) & 0xff00) | Collation.SPECIAL_CE32_LOW_BYTE | Collation.LATIN_EXPANSION_TAG; } } // Try to encode two or more CEs as CE32s. int[] newCE32s = new int[Collation.MAX_EXPANSION_LENGTH]; // TODO: instance field? for(int i = 0;; ++i) { if(i == cesLength) { return encodeExpansion32(newCE32s, 0, cesLength); } int ce32 = encodeOneCEAsCE32(ces[i]); if(ce32 == Collation.NO_CE32) { break; } newCE32s[i] = ce32; } return encodeExpansion(ces, 0, cesLength); }
[ "int", "encodeCEs", "(", "long", "ces", "[", "]", ",", "int", "cesLength", ")", "{", "if", "(", "cesLength", "<", "0", "||", "cesLength", ">", "Collation", ".", "MAX_EXPANSION_LENGTH", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"mapping to ...
Encodes the ces as either the returned ce32 by itself, or by storing an expansion, with the returned ce32 referring to that. <p>add(p, s, ces, cesLength) = addCE32(p, s, encodeCEs(ces, cesLength))
[ "Encodes", "the", "ces", "as", "either", "the", "returned", "ce32", "by", "itself", "or", "by", "storing", "an", "expansion", "with", "the", "returned", "ce32", "referring", "to", "that", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationDataBuilder.java#L131-L172
35,558
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationDataBuilder.java
CollationDataBuilder.copyFrom
void copyFrom(CollationDataBuilder src, CEModifier modifier) { if(!isMutable()) { throw new IllegalStateException("attempt to copyFrom() after build()"); } CopyHelper helper = new CopyHelper(src, this, modifier); Iterator<Trie2.Range> trieIterator = src.trie.iterator(); Trie2.Range range; while(trieIterator.hasNext() && !(range = trieIterator.next()).leadSurrogate) { enumRangeForCopy(range.startCodePoint, range.endCodePoint, range.value, helper); } // Update the contextChars and the unsafeBackwardSet while copying, // in case a character had conditional mappings in the source builder // and they were removed later. modified |= src.modified; }
java
void copyFrom(CollationDataBuilder src, CEModifier modifier) { if(!isMutable()) { throw new IllegalStateException("attempt to copyFrom() after build()"); } CopyHelper helper = new CopyHelper(src, this, modifier); Iterator<Trie2.Range> trieIterator = src.trie.iterator(); Trie2.Range range; while(trieIterator.hasNext() && !(range = trieIterator.next()).leadSurrogate) { enumRangeForCopy(range.startCodePoint, range.endCodePoint, range.value, helper); } // Update the contextChars and the unsafeBackwardSet while copying, // in case a character had conditional mappings in the source builder // and they were removed later. modified |= src.modified; }
[ "void", "copyFrom", "(", "CollationDataBuilder", "src", ",", "CEModifier", "modifier", ")", "{", "if", "(", "!", "isMutable", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"attempt to copyFrom() after build()\"", ")", ";", "}", "CopyHelper", ...
Copies all mappings from the src builder, with modifications. This builder here must not be built yet, and should be empty.
[ "Copies", "all", "mappings", "from", "the", "src", "builder", "with", "modifications", ".", "This", "builder", "here", "must", "not", "be", "built", "yet", "and", "should", "be", "empty", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationDataBuilder.java#L255-L269
35,559
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationDataBuilder.java
CollationDataBuilder.copyContractionsFromBaseCE32
protected int copyContractionsFromBaseCE32(StringBuilder context, int c, int ce32, ConditionalCE32 cond) { int trieIndex = Collation.indexFromCE32(ce32); int index; if((ce32 & Collation.CONTRACT_SINGLE_CP_NO_MATCH) != 0) { // No match on the single code point. // We are underneath a prefix, and the default mapping is just // a fallback to the mappings for a shorter prefix. assert(context.length() > 1); index = -1; } else { ce32 = base.getCE32FromContexts(trieIndex); // Default if no suffix match. assert(!Collation.isContractionCE32(ce32)); ce32 = copyFromBaseCE32(c, ce32, true); cond.next = index = addConditionalCE32(context.toString(), ce32); cond = getConditionalCE32(index); } int suffixStart = context.length(); CharsTrie.Iterator suffixes = CharsTrie.iterator(base.contexts, trieIndex + 2, 0); while(suffixes.hasNext()) { CharsTrie.Entry entry = suffixes.next(); context.append(entry.chars); ce32 = copyFromBaseCE32(c, entry.value, true); cond.next = index = addConditionalCE32(context.toString(), ce32); // No need to update the unsafeBackwardSet because the tailoring set // is already a copy of the base set. cond = getConditionalCE32(index); context.setLength(suffixStart); } assert(index >= 0); return index; }
java
protected int copyContractionsFromBaseCE32(StringBuilder context, int c, int ce32, ConditionalCE32 cond) { int trieIndex = Collation.indexFromCE32(ce32); int index; if((ce32 & Collation.CONTRACT_SINGLE_CP_NO_MATCH) != 0) { // No match on the single code point. // We are underneath a prefix, and the default mapping is just // a fallback to the mappings for a shorter prefix. assert(context.length() > 1); index = -1; } else { ce32 = base.getCE32FromContexts(trieIndex); // Default if no suffix match. assert(!Collation.isContractionCE32(ce32)); ce32 = copyFromBaseCE32(c, ce32, true); cond.next = index = addConditionalCE32(context.toString(), ce32); cond = getConditionalCE32(index); } int suffixStart = context.length(); CharsTrie.Iterator suffixes = CharsTrie.iterator(base.contexts, trieIndex + 2, 0); while(suffixes.hasNext()) { CharsTrie.Entry entry = suffixes.next(); context.append(entry.chars); ce32 = copyFromBaseCE32(c, entry.value, true); cond.next = index = addConditionalCE32(context.toString(), ce32); // No need to update the unsafeBackwardSet because the tailoring set // is already a copy of the base set. cond = getConditionalCE32(index); context.setLength(suffixStart); } assert(index >= 0); return index; }
[ "protected", "int", "copyContractionsFromBaseCE32", "(", "StringBuilder", "context", ",", "int", "c", ",", "int", "ce32", ",", "ConditionalCE32", "cond", ")", "{", "int", "trieIndex", "=", "Collation", ".", "indexFromCE32", "(", "ce32", ")", ";", "int", "index...
Copies base contractions to a list of ConditionalCE32. Sets cond.next to the index of the first new item and returns the index of the last new item.
[ "Copies", "base", "contractions", "to", "a", "list", "of", "ConditionalCE32", ".", "Sets", "cond", ".", "next", "to", "the", "index", "of", "the", "first", "new", "item", "and", "returns", "the", "index", "of", "the", "last", "new", "item", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationDataBuilder.java#L636-L668
35,560
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/SocketOutputStream.java
SocketOutputStream.socketWrite
private void socketWrite(byte b[], int off, int len) throws IOException { if (len <= 0 || off < 0 || off + len > b.length) { if (len == 0) { return; } throw new ArrayIndexOutOfBoundsException(); } Object traceContext = IoTrace.socketWriteBegin(); int bytesWritten = 0; FileDescriptor fd = impl.acquireFD(); try { BlockGuard.getThreadPolicy().onNetwork(); socketWrite0(fd, b, off, len); bytesWritten = len; } catch (SocketException se) { if (se instanceof sun.net.ConnectionResetException) { impl.setConnectionResetPending(); se = new SocketException("Connection reset"); } if (impl.isClosedOrPending()) { throw new SocketException("Socket closed"); } else { throw se; } } finally { IoTrace.socketWriteEnd(traceContext, impl.address, impl.port, bytesWritten); } }
java
private void socketWrite(byte b[], int off, int len) throws IOException { if (len <= 0 || off < 0 || off + len > b.length) { if (len == 0) { return; } throw new ArrayIndexOutOfBoundsException(); } Object traceContext = IoTrace.socketWriteBegin(); int bytesWritten = 0; FileDescriptor fd = impl.acquireFD(); try { BlockGuard.getThreadPolicy().onNetwork(); socketWrite0(fd, b, off, len); bytesWritten = len; } catch (SocketException se) { if (se instanceof sun.net.ConnectionResetException) { impl.setConnectionResetPending(); se = new SocketException("Connection reset"); } if (impl.isClosedOrPending()) { throw new SocketException("Socket closed"); } else { throw se; } } finally { IoTrace.socketWriteEnd(traceContext, impl.address, impl.port, bytesWritten); } }
[ "private", "void", "socketWrite", "(", "byte", "b", "[", "]", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "len", "<=", "0", "||", "off", "<", "0", "||", "off", "+", "len", ">", "b", ".", "length", ")", "{...
Writes to the socket with appropriate locking of the FileDescriptor. @param b the data to be written @param off the start offset in the data @param len the number of bytes that are written @exception IOException If an I/O error has occurred.
[ "Writes", "to", "the", "socket", "with", "appropriate", "locking", "of", "the", "FileDescriptor", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/SocketOutputStream.java#L98-L127
35,561
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java
URICertStore.initializeTimeout
private static int initializeTimeout() { // Integer tmp = java.security.AccessController.doPrivileged( // new GetIntegerAction("com.sun.security.crl.timeout")); Integer tmp = Integer.getInteger("com.sun.security.crl.timeout"); if (tmp == null || tmp < 0) { return DEFAULT_CRL_CONNECT_TIMEOUT; } // Convert to milliseconds, as the system property will be // specified in seconds return tmp * 1000; }
java
private static int initializeTimeout() { // Integer tmp = java.security.AccessController.doPrivileged( // new GetIntegerAction("com.sun.security.crl.timeout")); Integer tmp = Integer.getInteger("com.sun.security.crl.timeout"); if (tmp == null || tmp < 0) { return DEFAULT_CRL_CONNECT_TIMEOUT; } // Convert to milliseconds, as the system property will be // specified in seconds return tmp * 1000; }
[ "private", "static", "int", "initializeTimeout", "(", ")", "{", "// Integer tmp = java.security.AccessController.doPrivileged(", "// new GetIntegerAction(\"com.sun.security.crl.timeout\"));", "Integer", "tmp", "=", "Integer", ".", "getInteger", "(", "\"com.sun.securit...
Initialize the timeout length by getting the CRL timeout system property. If the property has not been set, or if its value is negative, set the timeout length to the default.
[ "Initialize", "the", "timeout", "length", "by", "getting", "the", "CRL", "timeout", "system", "property", ".", "If", "the", "property", "has", "not", "been", "set", "or", "if", "its", "value", "is", "negative", "set", "the", "timeout", "length", "to", "the...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java#L140-L150
35,562
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java
URICertStore.getInstance
static CertStore getInstance(AccessDescription ad) { if (!ad.getAccessMethod().equals((Object) AccessDescription.Ad_CAISSUERS_Id)) { return null; } GeneralNameInterface gn = ad.getAccessLocation().getName(); if (!(gn instanceof URIName)) { return null; } URI uri = ((URIName) gn).getURI(); try { return URICertStore.getInstance (new URICertStore.URICertStoreParameters(uri)); } catch (Exception ex) { if (debug != null) { debug.println("exception creating CertStore: " + ex); ex.printStackTrace(); } return null; } }
java
static CertStore getInstance(AccessDescription ad) { if (!ad.getAccessMethod().equals((Object) AccessDescription.Ad_CAISSUERS_Id)) { return null; } GeneralNameInterface gn = ad.getAccessLocation().getName(); if (!(gn instanceof URIName)) { return null; } URI uri = ((URIName) gn).getURI(); try { return URICertStore.getInstance (new URICertStore.URICertStoreParameters(uri)); } catch (Exception ex) { if (debug != null) { debug.println("exception creating CertStore: " + ex); ex.printStackTrace(); } return null; } }
[ "static", "CertStore", "getInstance", "(", "AccessDescription", "ad", ")", "{", "if", "(", "!", "ad", ".", "getAccessMethod", "(", ")", ".", "equals", "(", "(", "Object", ")", "AccessDescription", ".", "Ad_CAISSUERS_Id", ")", ")", "{", "return", "null", ";...
Creates a CertStore from information included in the AccessDescription object of a certificate's Authority Information Access Extension.
[ "Creates", "a", "CertStore", "from", "information", "included", "in", "the", "AccessDescription", "object", "of", "a", "certificate", "s", "Authority", "Information", "Access", "Extension", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java#L210-L230
35,563
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java
URICertStore.getMatchingCerts
private static Collection<X509Certificate> getMatchingCerts (Collection<X509Certificate> certs, CertSelector selector) { // if selector not specified, all certs match if (selector == null) { return certs; } List<X509Certificate> matchedCerts = new ArrayList<>(certs.size()); for (X509Certificate cert : certs) { if (selector.match(cert)) { matchedCerts.add(cert); } } return matchedCerts; }
java
private static Collection<X509Certificate> getMatchingCerts (Collection<X509Certificate> certs, CertSelector selector) { // if selector not specified, all certs match if (selector == null) { return certs; } List<X509Certificate> matchedCerts = new ArrayList<>(certs.size()); for (X509Certificate cert : certs) { if (selector.match(cert)) { matchedCerts.add(cert); } } return matchedCerts; }
[ "private", "static", "Collection", "<", "X509Certificate", ">", "getMatchingCerts", "(", "Collection", "<", "X509Certificate", ">", "certs", ",", "CertSelector", "selector", ")", "{", "// if selector not specified, all certs match", "if", "(", "selector", "==", "null", ...
Iterates over the specified Collection of X509Certificates and returns only those that match the criteria specified in the CertSelector.
[ "Iterates", "over", "the", "specified", "Collection", "of", "X509Certificates", "and", "returns", "only", "those", "that", "match", "the", "criteria", "specified", "in", "the", "CertSelector", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java#L327-L340
35,564
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java
URICertStore.getMatchingCRLs
private static Collection<X509CRL> getMatchingCRLs (X509CRL crl, CRLSelector selector) { if (selector == null || (crl != null && selector.match(crl))) { return Collections.singletonList(crl); } else { return Collections.emptyList(); } }
java
private static Collection<X509CRL> getMatchingCRLs (X509CRL crl, CRLSelector selector) { if (selector == null || (crl != null && selector.match(crl))) { return Collections.singletonList(crl); } else { return Collections.emptyList(); } }
[ "private", "static", "Collection", "<", "X509CRL", ">", "getMatchingCRLs", "(", "X509CRL", "crl", ",", "CRLSelector", "selector", ")", "{", "if", "(", "selector", "==", "null", "||", "(", "crl", "!=", "null", "&&", "selector", ".", "match", "(", "crl", "...
Checks if the specified X509CRL matches the criteria specified in the CRLSelector.
[ "Checks", "if", "the", "specified", "X509CRL", "matches", "the", "criteria", "specified", "in", "the", "CRLSelector", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/URICertStore.java#L439-L446
35,565
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java
CharSequences.getSingleCodePoint
@Deprecated public static int getSingleCodePoint(CharSequence s) { int length = s.length(); if (length < 1 || length > 2) { return Integer.MAX_VALUE; } int result = Character.codePointAt(s, 0); return (result < 0x10000) == (length == 1) ? result : Integer.MAX_VALUE; }
java
@Deprecated public static int getSingleCodePoint(CharSequence s) { int length = s.length(); if (length < 1 || length > 2) { return Integer.MAX_VALUE; } int result = Character.codePointAt(s, 0); return (result < 0x10000) == (length == 1) ? result : Integer.MAX_VALUE; }
[ "@", "Deprecated", "public", "static", "int", "getSingleCodePoint", "(", "CharSequence", "s", ")", "{", "int", "length", "=", "s", ".", "length", "(", ")", ";", "if", "(", "length", "<", "1", "||", "length", ">", "2", ")", "{", "return", "Integer", "...
Return the value of the first code point, if the string is exactly one code point. Otherwise return Integer.MAX_VALUE. @deprecated This API is ICU internal only. @hide draft / provisional / internal are hidden on Android
[ "Return", "the", "value", "of", "the", "first", "code", "point", "if", "the", "string", "is", "exactly", "one", "code", "point", ".", "Otherwise", "return", "Integer", ".", "MAX_VALUE", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java#L189-L197
35,566
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java
CharSequences.onCharacterBoundary
@Deprecated public static boolean onCharacterBoundary(CharSequence s, int i) { return i <= 0 || i >= s.length() || !Character.isHighSurrogate(s.charAt(i-1)) || !Character.isLowSurrogate(s.charAt(i)); }
java
@Deprecated public static boolean onCharacterBoundary(CharSequence s, int i) { return i <= 0 || i >= s.length() || !Character.isHighSurrogate(s.charAt(i-1)) || !Character.isLowSurrogate(s.charAt(i)); }
[ "@", "Deprecated", "public", "static", "boolean", "onCharacterBoundary", "(", "CharSequence", "s", ",", "int", "i", ")", "{", "return", "i", "<=", "0", "||", "i", ">=", "s", ".", "length", "(", ")", "||", "!", "Character", ".", "isHighSurrogate", "(", ...
Are we on a character boundary? @deprecated This API is ICU internal only. @hide draft / provisional / internal are hidden on Android
[ "Are", "we", "on", "a", "character", "boundary?" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java#L251-L257
35,567
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java
CharSequences.indexOf
@Deprecated public static int indexOf(CharSequence s, int codePoint) { int cp; for (int i = 0; i < s.length(); i += Character.charCount(cp)) { cp = Character.codePointAt(s, i); if (cp == codePoint) { return i; } } return -1; }
java
@Deprecated public static int indexOf(CharSequence s, int codePoint) { int cp; for (int i = 0; i < s.length(); i += Character.charCount(cp)) { cp = Character.codePointAt(s, i); if (cp == codePoint) { return i; } } return -1; }
[ "@", "Deprecated", "public", "static", "int", "indexOf", "(", "CharSequence", "s", ",", "int", "codePoint", ")", "{", "int", "cp", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "+=", "Character", "....
Find code point in string. @deprecated This API is ICU internal only. @hide draft / provisional / internal are hidden on Android
[ "Find", "code", "point", "in", "string", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java#L265-L275
35,568
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/NativeObject.java
NativeObject.getObject
NativeObject getObject(int offset) { long newAddress = 0L; switch (addressSize()) { case 8: newAddress = unsafe.getLong(offset + address); break; case 4: newAddress = unsafe.getInt(offset + address) & 0x00000000FFFFFFFF; break; default: throw new InternalError("Address size not supported"); } return new NativeObject(newAddress); }
java
NativeObject getObject(int offset) { long newAddress = 0L; switch (addressSize()) { case 8: newAddress = unsafe.getLong(offset + address); break; case 4: newAddress = unsafe.getInt(offset + address) & 0x00000000FFFFFFFF; break; default: throw new InternalError("Address size not supported"); } return new NativeObject(newAddress); }
[ "NativeObject", "getObject", "(", "int", "offset", ")", "{", "long", "newAddress", "=", "0L", ";", "switch", "(", "addressSize", "(", ")", ")", "{", "case", "8", ":", "newAddress", "=", "unsafe", ".", "getLong", "(", "offset", "+", "address", ")", ";",...
Reads an address from this native object at the given offset and constructs a native object using that address. @param offset The offset of the address to be read. Note that the size of an address is implementation-dependent. @return The native object created using the address read from the given offset
[ "Reads", "an", "address", "from", "this", "native", "object", "at", "the", "given", "offset", "and", "constructs", "a", "native", "object", "using", "that", "address", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/NativeObject.java#L123-L137
35,569
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/NativeObject.java
NativeObject.putObject
void putObject(int offset, NativeObject ob) { switch (addressSize()) { case 8: putLong(offset, ob.address); break; case 4: putInt(offset, (int)(ob.address & 0x00000000FFFFFFFF)); break; default: throw new InternalError("Address size not supported"); } }
java
void putObject(int offset, NativeObject ob) { switch (addressSize()) { case 8: putLong(offset, ob.address); break; case 4: putInt(offset, (int)(ob.address & 0x00000000FFFFFFFF)); break; default: throw new InternalError("Address size not supported"); } }
[ "void", "putObject", "(", "int", "offset", ",", "NativeObject", "ob", ")", "{", "switch", "(", "addressSize", "(", ")", ")", "{", "case", "8", ":", "putLong", "(", "offset", ",", "ob", ".", "address", ")", ";", "break", ";", "case", "4", ":", "putI...
Writes the base address of the given native object at the given offset of this native object. @param offset The offset at which the address is to be written. Note that the size of an address is implementation-dependent. @param ob The native object whose address is to be written
[ "Writes", "the", "base", "address", "of", "the", "given", "native", "object", "at", "the", "given", "offset", "of", "this", "native", "object", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/NativeObject.java#L150-L161
35,570
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/NativeObject.java
NativeObject.byteOrder
static ByteOrder byteOrder() { if (byteOrder != null) return byteOrder; long a = unsafe.allocateMemory(8); try { unsafe.putLong(a, 0x0102030405060708L); byte b = unsafe.getByte(a); switch (b) { case 0x01: byteOrder = ByteOrder.BIG_ENDIAN; break; case 0x08: byteOrder = ByteOrder.LITTLE_ENDIAN; break; default: assert false; } } finally { unsafe.freeMemory(a); } return byteOrder; }
java
static ByteOrder byteOrder() { if (byteOrder != null) return byteOrder; long a = unsafe.allocateMemory(8); try { unsafe.putLong(a, 0x0102030405060708L); byte b = unsafe.getByte(a); switch (b) { case 0x01: byteOrder = ByteOrder.BIG_ENDIAN; break; case 0x08: byteOrder = ByteOrder.LITTLE_ENDIAN; break; default: assert false; } } finally { unsafe.freeMemory(a); } return byteOrder; }
[ "static", "ByteOrder", "byteOrder", "(", ")", "{", "if", "(", "byteOrder", "!=", "null", ")", "return", "byteOrder", ";", "long", "a", "=", "unsafe", ".", "allocateMemory", "(", "8", ")", ";", "try", "{", "unsafe", ".", "putLong", "(", "a", ",", "0x0...
Returns the byte order of the underlying hardware. @return An instance of {@link java.nio.ByteOrder}
[ "Returns", "the", "byte", "order", "of", "the", "underlying", "hardware", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/NativeObject.java#L372-L389
35,571
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java
File.join
private static String join(String prefix, String suffix) { int prefixLength = prefix.length(); boolean haveSlash = (prefixLength > 0 && prefix.charAt(prefixLength - 1) == separatorChar); if (!haveSlash) { haveSlash = (suffix.length() > 0 && suffix.charAt(0) == separatorChar); } return haveSlash ? (prefix + suffix) : (prefix + separatorChar + suffix); }
java
private static String join(String prefix, String suffix) { int prefixLength = prefix.length(); boolean haveSlash = (prefixLength > 0 && prefix.charAt(prefixLength - 1) == separatorChar); if (!haveSlash) { haveSlash = (suffix.length() > 0 && suffix.charAt(0) == separatorChar); } return haveSlash ? (prefix + suffix) : (prefix + separatorChar + suffix); }
[ "private", "static", "String", "join", "(", "String", "prefix", ",", "String", "suffix", ")", "{", "int", "prefixLength", "=", "prefix", ".", "length", "(", ")", ";", "boolean", "haveSlash", "=", "(", "prefixLength", ">", "0", "&&", "prefix", ".", "charA...
Joins two path components, adding a separator only if necessary.
[ "Joins", "two", "path", "components", "adding", "a", "separator", "only", "if", "necessary", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L241-L248
35,572
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java
File.setExecutable
public boolean setExecutable(boolean executable, boolean ownerOnly) { return doChmod(ownerOnly ? S_IXUSR : (S_IXUSR | S_IXGRP | S_IXOTH), executable); }
java
public boolean setExecutable(boolean executable, boolean ownerOnly) { return doChmod(ownerOnly ? S_IXUSR : (S_IXUSR | S_IXGRP | S_IXOTH), executable); }
[ "public", "boolean", "setExecutable", "(", "boolean", "executable", ",", "boolean", "ownerOnly", ")", "{", "return", "doChmod", "(", "ownerOnly", "?", "S_IXUSR", ":", "(", "S_IXUSR", "|", "S_IXGRP", "|", "S_IXOTH", ")", ",", "executable", ")", ";", "}" ]
Manipulates the execute permissions for the abstract path designated by this file. <p>Note that this method does <i>not</i> throw {@code IOException} on failure. Callers must check the return value. @param executable To allow execute permission if true, otherwise disallow @param ownerOnly To manipulate execute permission only for owner if true, otherwise for everyone. The manipulation will apply to everyone regardless of this value if the underlying system does not distinguish owner and other users. @return true if and only if the operation succeeded. If the user does not have permission to change the access permissions of this abstract pathname the operation will fail. If the underlying file system does not support execute permission and the value of executable is false, this operation will fail. @since 1.6
[ "Manipulates", "the", "execute", "permissions", "for", "the", "abstract", "path", "designated", "by", "this", "file", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L695-L697
35,573
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java
File.setReadable
public boolean setReadable(boolean readable, boolean ownerOnly) { return doChmod(ownerOnly ? S_IRUSR : (S_IRUSR | S_IRGRP | S_IROTH), readable); }
java
public boolean setReadable(boolean readable, boolean ownerOnly) { return doChmod(ownerOnly ? S_IRUSR : (S_IRUSR | S_IRGRP | S_IROTH), readable); }
[ "public", "boolean", "setReadable", "(", "boolean", "readable", ",", "boolean", "ownerOnly", ")", "{", "return", "doChmod", "(", "ownerOnly", "?", "S_IRUSR", ":", "(", "S_IRUSR", "|", "S_IRGRP", "|", "S_IROTH", ")", ",", "readable", ")", ";", "}" ]
Manipulates the read permissions for the abstract path designated by this file. @param readable To allow read permission if true, otherwise disallow @param ownerOnly To manipulate read permission only for owner if true, otherwise for everyone. The manipulation will apply to everyone regardless of this value if the underlying system does not distinguish owner and other users. @return true if and only if the operation succeeded. If the user does not have permission to change the access permissions of this abstract pathname the operation will fail. If the underlying file system does not support read permission and the value of readable is false, this operation will fail. @since 1.6
[ "Manipulates", "the", "read", "permissions", "for", "the", "abstract", "path", "designated", "by", "this", "file", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L726-L728
35,574
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java
File.setWritable
public boolean setWritable(boolean writable, boolean ownerOnly) { return doChmod(ownerOnly ? S_IWUSR : (S_IWUSR | S_IWGRP | S_IWOTH), writable); }
java
public boolean setWritable(boolean writable, boolean ownerOnly) { return doChmod(ownerOnly ? S_IWUSR : (S_IWUSR | S_IWGRP | S_IWOTH), writable); }
[ "public", "boolean", "setWritable", "(", "boolean", "writable", ",", "boolean", "ownerOnly", ")", "{", "return", "doChmod", "(", "ownerOnly", "?", "S_IWUSR", ":", "(", "S_IWUSR", "|", "S_IWGRP", "|", "S_IWOTH", ")", ",", "writable", ")", ";", "}" ]
Manipulates the write permissions for the abstract path designated by this file. @param writable To allow write permission if true, otherwise disallow @param ownerOnly To manipulate write permission only for owner if true, otherwise for everyone. The manipulation will apply to everyone regardless of this value if the underlying system does not distinguish owner and other users. @return true if and only if the operation succeeded. If the user does not have permission to change the access permissions of this abstract pathname the operation will fail. @since 1.6
[ "Manipulates", "the", "write", "permissions", "for", "the", "abstract", "path", "designated", "by", "this", "file", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L755-L757
35,575
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java
File.getTotalSpace
public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
java
public long getTotalSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
[ "public", "long", "getTotalSpace", "(", ")", "{", "try", "{", "StructStatVfs", "sb", "=", "Libcore", ".", "os", ".", "statvfs", "(", "path", ")", ";", "return", "sb", ".", "f_blocks", "*", "sb", ".", "f_bsize", ";", "// total block count * block size in byte...
Returns the total size in bytes of the partition containing this path. Returns 0 if this path does not exist. @since 1.6
[ "Returns", "the", "total", "size", "in", "bytes", "of", "the", "partition", "containing", "this", "path", ".", "Returns", "0", "if", "this", "path", "does", "not", "exist", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L1225-L1232
35,576
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java
File.getUsableSpace
public long getUsableSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bavail * sb.f_bsize; // non-root free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
java
public long getUsableSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bavail * sb.f_bsize; // non-root free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
[ "public", "long", "getUsableSpace", "(", ")", "{", "try", "{", "StructStatVfs", "sb", "=", "Libcore", ".", "os", ".", "statvfs", "(", "path", ")", ";", "return", "sb", ".", "f_bavail", "*", "sb", ".", "f_bsize", ";", "// non-root free block count * block siz...
Returns the number of usable free bytes on the partition containing this path. Returns 0 if this path does not exist. <p>Note that this is likely to be an optimistic over-estimate and should not be taken as a guarantee your application can actually write this many bytes. On Android (and other Unix-based systems), this method returns the number of free bytes available to non-root users, regardless of whether you're actually running as root, and regardless of any quota or other restrictions that might apply to the user. (The {@code getFreeSpace} method returns the number of bytes potentially available to root.) @since 1.6
[ "Returns", "the", "number", "of", "usable", "free", "bytes", "on", "the", "partition", "containing", "this", "path", ".", "Returns", "0", "if", "this", "path", "does", "not", "exist", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L1247-L1254
35,577
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java
File.getFreeSpace
public long getFreeSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
java
public long getFreeSpace() { try { StructStatVfs sb = Libcore.os.statvfs(path); return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes. } catch (ErrnoException errnoException) { return 0; } }
[ "public", "long", "getFreeSpace", "(", ")", "{", "try", "{", "StructStatVfs", "sb", "=", "Libcore", ".", "os", ".", "statvfs", "(", "path", ")", ";", "return", "sb", ".", "f_bfree", "*", "sb", ".", "f_bsize", ";", "// free block count * block size in bytes."...
Returns the number of free bytes on the partition containing this path. Returns 0 if this path does not exist. <p>Note that this is likely to be an optimistic over-estimate and should not be taken as a guarantee your application can actually write this many bytes. @since 1.6
[ "Returns", "the", "number", "of", "free", "bytes", "on", "the", "partition", "containing", "this", "path", ".", "Returns", "0", "if", "this", "path", "does", "not", "exist", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L1265-L1272
35,578
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java
ArrayDeque.allocateElements
private void allocateElements(int numElements) { int initialCapacity = MIN_INITIAL_CAPACITY; // Find the best power of two to hold elements. // Tests "<=" because arrays aren't kept full. if (numElements >= initialCapacity) { initialCapacity = numElements; initialCapacity |= (initialCapacity >>> 1); initialCapacity |= (initialCapacity >>> 2); initialCapacity |= (initialCapacity >>> 4); initialCapacity |= (initialCapacity >>> 8); initialCapacity |= (initialCapacity >>> 16); initialCapacity++; if (initialCapacity < 0) // Too many elements, must back off initialCapacity >>>= 1; // Good luck allocating 2^30 elements } elements = new Object[initialCapacity]; }
java
private void allocateElements(int numElements) { int initialCapacity = MIN_INITIAL_CAPACITY; // Find the best power of two to hold elements. // Tests "<=" because arrays aren't kept full. if (numElements >= initialCapacity) { initialCapacity = numElements; initialCapacity |= (initialCapacity >>> 1); initialCapacity |= (initialCapacity >>> 2); initialCapacity |= (initialCapacity >>> 4); initialCapacity |= (initialCapacity >>> 8); initialCapacity |= (initialCapacity >>> 16); initialCapacity++; if (initialCapacity < 0) // Too many elements, must back off initialCapacity >>>= 1; // Good luck allocating 2^30 elements } elements = new Object[initialCapacity]; }
[ "private", "void", "allocateElements", "(", "int", "numElements", ")", "{", "int", "initialCapacity", "=", "MIN_INITIAL_CAPACITY", ";", "// Find the best power of two to hold elements.", "// Tests \"<=\" because arrays aren't kept full.", "if", "(", "numElements", ">=", "initia...
Allocates empty array to hold the given number of elements. @param numElements the number of elements to hold
[ "Allocates", "empty", "array", "to", "hold", "the", "given", "number", "of", "elements", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java#L128-L145
35,579
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java
ArrayDeque.doubleCapacity
private void doubleCapacity() { assert head == tail; int p = head; int n = elements.length; int r = n - p; // number of elements to the right of p int newCapacity = n << 1; if (newCapacity < 0) throw new IllegalStateException("Sorry, deque too big"); Object[] a = new Object[newCapacity]; System.arraycopy(elements, p, a, 0, r); System.arraycopy(elements, 0, a, r, p); elements = a; head = 0; tail = n; }
java
private void doubleCapacity() { assert head == tail; int p = head; int n = elements.length; int r = n - p; // number of elements to the right of p int newCapacity = n << 1; if (newCapacity < 0) throw new IllegalStateException("Sorry, deque too big"); Object[] a = new Object[newCapacity]; System.arraycopy(elements, p, a, 0, r); System.arraycopy(elements, 0, a, r, p); elements = a; head = 0; tail = n; }
[ "private", "void", "doubleCapacity", "(", ")", "{", "assert", "head", "==", "tail", ";", "int", "p", "=", "head", ";", "int", "n", "=", "elements", ".", "length", ";", "int", "r", "=", "n", "-", "p", ";", "// number of elements to the right of p", "int",...
Doubles the capacity of this deque. Call only when full, i.e., when head and tail have wrapped around to become equal.
[ "Doubles", "the", "capacity", "of", "this", "deque", ".", "Call", "only", "when", "full", "i", ".", "e", ".", "when", "head", "and", "tail", "have", "wrapped", "around", "to", "become", "equal", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java#L151-L165
35,580
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java
ArrayDeque.addFirst
public void addFirst(E e) { if (e == null) throw new NullPointerException(); elements[head = (head - 1) & (elements.length - 1)] = e; if (head == tail) doubleCapacity(); }
java
public void addFirst(E e) { if (e == null) throw new NullPointerException(); elements[head = (head - 1) & (elements.length - 1)] = e; if (head == tail) doubleCapacity(); }
[ "public", "void", "addFirst", "(", "E", "e", ")", "{", "if", "(", "e", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "elements", "[", "head", "=", "(", "head", "-", "1", ")", "&", "(", "elements", ".", "length", "-", "...
Inserts the specified element at the front of this deque. @param e the element to add @throws NullPointerException if the specified element is null
[ "Inserts", "the", "specified", "element", "at", "the", "front", "of", "this", "deque", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java#L210-L216
35,581
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java
ArrayDeque.addLast
public void addLast(E e) { if (e == null) throw new NullPointerException(); elements[tail] = e; if ( (tail = (tail + 1) & (elements.length - 1)) == head) doubleCapacity(); }
java
public void addLast(E e) { if (e == null) throw new NullPointerException(); elements[tail] = e; if ( (tail = (tail + 1) & (elements.length - 1)) == head) doubleCapacity(); }
[ "public", "void", "addLast", "(", "E", "e", ")", "{", "if", "(", "e", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "elements", "[", "tail", "]", "=", "e", ";", "if", "(", "(", "tail", "=", "(", "tail", "+", "1", ")"...
Inserts the specified element at the end of this deque. <p>This method is equivalent to {@link #add}. @param e the element to add @throws NullPointerException if the specified element is null
[ "Inserts", "the", "specified", "element", "at", "the", "end", "of", "this", "deque", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java#L226-L232
35,582
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java
ArrayDeque.clear
public void clear() { int h = head; int t = tail; if (h != t) { // clear all cells head = tail = 0; int i = h; int mask = elements.length - 1; do { elements[i] = null; i = (i + 1) & mask; } while (i != t); } }
java
public void clear() { int h = head; int t = tail; if (h != t) { // clear all cells head = tail = 0; int i = h; int mask = elements.length - 1; do { elements[i] = null; i = (i + 1) & mask; } while (i != t); } }
[ "public", "void", "clear", "(", ")", "{", "int", "h", "=", "head", ";", "int", "t", "=", "tail", ";", "if", "(", "h", "!=", "t", ")", "{", "// clear all cells", "head", "=", "tail", "=", "0", ";", "int", "i", "=", "h", ";", "int", "mask", "="...
Removes all of the elements from this deque. The deque will be empty after this call returns.
[ "Removes", "all", "of", "the", "elements", "from", "this", "deque", ".", "The", "deque", "will", "be", "empty", "after", "this", "call", "returns", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java#L738-L750
35,583
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TrieBuilder.java
TrieBuilder.isInZeroBlock
public boolean isInZeroBlock(int ch) { // valid, uncompacted trie and valid c? if (m_isCompacted_ || ch > UCharacter.MAX_VALUE || ch < UCharacter.MIN_VALUE) { return true; } return m_index_[ch >> SHIFT_] == 0; }
java
public boolean isInZeroBlock(int ch) { // valid, uncompacted trie and valid c? if (m_isCompacted_ || ch > UCharacter.MAX_VALUE || ch < UCharacter.MIN_VALUE) { return true; } return m_index_[ch >> SHIFT_] == 0; }
[ "public", "boolean", "isInZeroBlock", "(", "int", "ch", ")", "{", "// valid, uncompacted trie and valid c?", "if", "(", "m_isCompacted_", "||", "ch", ">", "UCharacter", ".", "MAX_VALUE", "||", "ch", "<", "UCharacter", ".", "MIN_VALUE", ")", "{", "return", "true"...
Checks if the character belongs to a zero block in the trie @param ch codepoint which data is to be retrieved @return true if ch is in the zero block
[ "Checks", "if", "the", "character", "belongs", "to", "a", "zero", "block", "in", "the", "trie" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TrieBuilder.java#L85-L94
35,584
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TrieBuilder.java
TrieBuilder.equal_int
protected static final boolean equal_int(int[] array, int start1, int start2, int length) { while(length>0 && array[start1]==array[start2]) { ++start1; ++start2; --length; } return length==0; }
java
protected static final boolean equal_int(int[] array, int start1, int start2, int length) { while(length>0 && array[start1]==array[start2]) { ++start1; ++start2; --length; } return length==0; }
[ "protected", "static", "final", "boolean", "equal_int", "(", "int", "[", "]", "array", ",", "int", "start1", ",", "int", "start2", ",", "int", "length", ")", "{", "while", "(", "length", ">", "0", "&&", "array", "[", "start1", "]", "==", "array", "["...
Compare two sections of an array for equality.
[ "Compare", "two", "sections", "of", "an", "array", "for", "equality", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TrieBuilder.java#L205-L212
35,585
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TrieBuilder.java
TrieBuilder.findSameIndexBlock
protected static final int findSameIndexBlock(int index[], int indexLength, int otherBlock) { for (int block = BMP_INDEX_LENGTH_; block < indexLength; block += SURROGATE_BLOCK_COUNT_) { if(equal_int(index, block, otherBlock, SURROGATE_BLOCK_COUNT_)) { return block; } } return indexLength; }
java
protected static final int findSameIndexBlock(int index[], int indexLength, int otherBlock) { for (int block = BMP_INDEX_LENGTH_; block < indexLength; block += SURROGATE_BLOCK_COUNT_) { if(equal_int(index, block, otherBlock, SURROGATE_BLOCK_COUNT_)) { return block; } } return indexLength; }
[ "protected", "static", "final", "int", "findSameIndexBlock", "(", "int", "index", "[", "]", ",", "int", "indexLength", ",", "int", "otherBlock", ")", "{", "for", "(", "int", "block", "=", "BMP_INDEX_LENGTH_", ";", "block", "<", "indexLength", ";", "block", ...
Finds the same index block as the otherBlock @param index array @param indexLength size of index @param otherBlock @return same index block
[ "Finds", "the", "same", "index", "block", "as", "the", "otherBlock" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/TrieBuilder.java#L243-L253
35,586
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.fireEndElem
protected void fireEndElem(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null); } }
java
protected void fireEndElem(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null); } }
[ "protected", "void", "fireEndElem", "(", "String", "name", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "m_tracer", "!=", "null", ")", "{", "flushMyWriter", "(", ")", ";", "m_tracer", ".", "fireGenerateEvent", "(", "...
To fire off the end element trace event @param name Name of element
[ "To", "fire", "off", "the", "end", "element", "trace", "event" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L95-L103
35,587
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.fireCharEvent
protected void fireCharEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CHARACTERS, chars, start,length); } }
java
protected void fireCharEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CHARACTERS, chars, start,length); } }
[ "protected", "void", "fireCharEvent", "(", "char", "[", "]", "chars", ",", "int", "start", ",", "int", "length", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "m_tracer", "!=", "null", ")", "{", "flushMyWriter", "("...
Report the characters trace event @param chars content of characters @param start starting index of characters to output @param length number of characters to output
[ "Report", "the", "characters", "trace", "event" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L111-L119
35,588
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.addAttribute
public void addAttribute(String name, final String value) { if (m_elemContext.m_startTagOpen) { final String patchedName = patchName(name); final String localName = getLocalName(patchedName); final String uri = getNamespaceURI(patchedName, false); addAttributeAlways(uri,localName, patchedName, "CDATA", value, false); } }
java
public void addAttribute(String name, final String value) { if (m_elemContext.m_startTagOpen) { final String patchedName = patchName(name); final String localName = getLocalName(patchedName); final String uri = getNamespaceURI(patchedName, false); addAttributeAlways(uri,localName, patchedName, "CDATA", value, false); } }
[ "public", "void", "addAttribute", "(", "String", "name", ",", "final", "String", "value", ")", "{", "if", "(", "m_elemContext", ".", "m_startTagOpen", ")", "{", "final", "String", "patchedName", "=", "patchName", "(", "name", ")", ";", "final", "String", "...
Adds the given attribute to the set of collected attributes, but only if there is a currently open element. @param name the attribute's qualified name @param value the value of the attribute
[ "Adds", "the", "given", "attribute", "to", "the", "set", "of", "collected", "attributes", "but", "only", "if", "there", "is", "a", "currently", "open", "element", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L444-L454
35,589
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.addAttributes
public void addAttributes(Attributes atts) throws SAXException { int nAtts = atts.getLength(); for (int i = 0; i < nAtts; i++) { String uri = atts.getURI(i); if (null == uri) uri = ""; addAttributeAlways( uri, atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i), false); } }
java
public void addAttributes(Attributes atts) throws SAXException { int nAtts = atts.getLength(); for (int i = 0; i < nAtts; i++) { String uri = atts.getURI(i); if (null == uri) uri = ""; addAttributeAlways( uri, atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i), false); } }
[ "public", "void", "addAttributes", "(", "Attributes", "atts", ")", "throws", "SAXException", "{", "int", "nAtts", "=", "atts", ".", "getLength", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nAtts", ";", "i", "++", ")", "{", "Str...
Add the given attributes to the currently collected ones. These attributes are always added, regardless of whether on not an element is currently open. @param atts List of attributes to add to this list
[ "Add", "the", "given", "attributes", "to", "the", "currently", "collected", "ones", ".", "These", "attributes", "are", "always", "added", "regardless", "of", "whether", "on", "not", "an", "element", "is", "currently", "open", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L481-L502
35,590
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.endEntity
public void endEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = false; m_inEntityRef = false; if (m_tracer != null) this.fireEndEntity(name); }
java
public void endEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = false; m_inEntityRef = false; if (m_tracer != null) this.fireEndEntity(name); }
[ "public", "void", "endEntity", "(", "String", "name", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "name", ".", "equals", "(", "\"[dtd]\"", ")", ")", "m_inExternalDTD", "=", "false", ";", "m_inEntityRef", "=", "false...
Report the end of an entity. @param name The name of the entity that is ending. @throws org.xml.sax.SAXException The application may raise an exception. @see #startEntity
[ "Report", "the", "end", "of", "an", "entity", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L525-L533
35,591
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.subPartMatch
private static final boolean subPartMatch(String p, String t) { return (p == t) || ((null != p) && (p.equals(t))); }
java
private static final boolean subPartMatch(String p, String t) { return (p == t) || ((null != p) && (p.equals(t))); }
[ "private", "static", "final", "boolean", "subPartMatch", "(", "String", "p", ",", "String", "t", ")", "{", "return", "(", "p", "==", "t", ")", "||", "(", "(", "null", "!=", "p", ")", "&&", "(", "p", ".", "equals", "(", "t", ")", ")", ")", ";", ...
Tell if two strings are equal, without worry if the first string is null. @param p String reference, which may be null. @param t String reference, which may be null. @return true if strings are equal.
[ "Tell", "if", "two", "strings", "are", "equal", "without", "worry", "if", "the", "first", "string", "is", "null", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L805-L808
35,592
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.getNamespaceURI
public String getNamespaceURI(String qname, boolean isElement) { String uri = EMPTYSTRING; int col = qname.lastIndexOf(':'); final String prefix = (col > 0) ? qname.substring(0, col) : EMPTYSTRING; if (!EMPTYSTRING.equals(prefix) || isElement) { if (m_prefixMap != null) { uri = m_prefixMap.lookupNamespace(prefix); if (uri == null && !prefix.equals(XMLNS_PREFIX)) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_NAMESPACE_PREFIX, new Object[] { qname.substring(0, col) } )); } } } return uri; }
java
public String getNamespaceURI(String qname, boolean isElement) { String uri = EMPTYSTRING; int col = qname.lastIndexOf(':'); final String prefix = (col > 0) ? qname.substring(0, col) : EMPTYSTRING; if (!EMPTYSTRING.equals(prefix) || isElement) { if (m_prefixMap != null) { uri = m_prefixMap.lookupNamespace(prefix); if (uri == null && !prefix.equals(XMLNS_PREFIX)) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_NAMESPACE_PREFIX, new Object[] { qname.substring(0, col) } )); } } } return uri; }
[ "public", "String", "getNamespaceURI", "(", "String", "qname", ",", "boolean", "isElement", ")", "{", "String", "uri", "=", "EMPTYSTRING", ";", "int", "col", "=", "qname", ".", "lastIndexOf", "(", "'", "'", ")", ";", "final", "String", "prefix", "=", "("...
Returns the URI of an element or attribute. Note that default namespaces do not apply directly to attributes. @param qname a qualified name @param isElement true if the qualified name is the name of an element. @return returns the namespace URI associated with the qualified name.
[ "Returns", "the", "URI", "of", "an", "element", "or", "attribute", ".", "Note", "that", "default", "namespaces", "do", "not", "apply", "directly", "to", "attributes", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L856-L877
35,593
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.entityReference
public void entityReference(String name) throws org.xml.sax.SAXException { flushPending(); startEntity(name); endEntity(name); if (m_tracer != null) fireEntityReference(name); }
java
public void entityReference(String name) throws org.xml.sax.SAXException { flushPending(); startEntity(name); endEntity(name); if (m_tracer != null) fireEntityReference(name); }
[ "public", "void", "entityReference", "(", "String", "name", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "flushPending", "(", ")", ";", "startEntity", "(", "name", ")", ";", "endEntity", "(", "name", ")", ";", "if", "(", "m_t...
Entity reference event. @param name Name of entity @throws org.xml.sax.SAXException
[ "Entity", "reference", "event", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L901-L911
35,594
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.setTransformer
public void setTransformer(Transformer t) { m_transformer = t; // If this transformer object implements the SerializerTrace interface // then assign m_tracer to the transformer object so it can be used // to fire trace events. if ((m_transformer instanceof SerializerTrace) && (((SerializerTrace) m_transformer).hasTraceListeners())) { m_tracer = (SerializerTrace) m_transformer; } else { m_tracer = null; } }
java
public void setTransformer(Transformer t) { m_transformer = t; // If this transformer object implements the SerializerTrace interface // then assign m_tracer to the transformer object so it can be used // to fire trace events. if ((m_transformer instanceof SerializerTrace) && (((SerializerTrace) m_transformer).hasTraceListeners())) { m_tracer = (SerializerTrace) m_transformer; } else { m_tracer = null; } }
[ "public", "void", "setTransformer", "(", "Transformer", "t", ")", "{", "m_transformer", "=", "t", ";", "// If this transformer object implements the SerializerTrace interface", "// then assign m_tracer to the transformer object so it can be used", "// to fire trace events.", "if", "(...
Sets the transformer associated with this serializer @param t the transformer associated with this serializer. @see SerializationHandler#setTransformer(Transformer)
[ "Sets", "the", "transformer", "associated", "with", "this", "serializer" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L918-L931
35,595
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.characters
public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { flushPending(); String data = node.getNodeValue(); if (data != null) { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); } }
java
public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { flushPending(); String data = node.getNodeValue(); if (data != null) { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); } }
[ "public", "void", "characters", "(", "org", ".", "w3c", ".", "dom", ".", "Node", "node", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "flushPending", "(", ")", ";", "String", "data", "=", "node", ".", "getNodeValue", "(", "...
This method gets the nodes value as a String and uses that String as if it were an input character notification. @param node the Node to serialize @throws org.xml.sax.SAXException
[ "This", "method", "gets", "the", "nodes", "value", "as", "a", "String", "and", "uses", "that", "String", "as", "if", "it", "were", "an", "input", "character", "notification", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L948-L963
35,596
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.fireStartEntity
protected void fireStartEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF, name); } }
java
protected void fireStartEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF, name); } }
[ "protected", "void", "fireStartEntity", "(", "String", "name", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "m_tracer", "!=", "null", ")", "{", "flushMyWriter", "(", ")", ";", "m_tracer", ".", "fireGenerateEvent", "(",...
To fire off start entity trace event @param name Name of entity
[ "To", "fire", "off", "start", "entity", "trace", "event" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L992-L1000
35,597
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.fireCDATAEvent
protected void fireCDATAEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CDATA, chars, start,length); } }
java
protected void fireCDATAEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CDATA, chars, start,length); } }
[ "protected", "void", "fireCDATAEvent", "(", "char", "[", "]", "chars", ",", "int", "start", ",", "int", "length", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "m_tracer", "!=", "null", ")", "{", "flushMyWriter", "(...
Report the CDATA trace event @param chars content of CDATA @param start starting index of characters to output @param length number of characters to output
[ "Report", "the", "CDATA", "trace", "event" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L1045-L1053
35,598
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.fireCommentEvent
protected void fireCommentEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_COMMENT, new String(chars, start, length)); } }
java
protected void fireCommentEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_COMMENT, new String(chars, start, length)); } }
[ "protected", "void", "fireCommentEvent", "(", "char", "[", "]", "chars", ",", "int", "start", ",", "int", "length", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "m_tracer", "!=", "null", ")", "{", "flushMyWriter", ...
Report the comment trace event @param chars content of comment @param start starting index of comment to output @param length number of characters to output
[ "Report", "the", "comment", "trace", "event" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L1061-L1069
35,599
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.fireEndEntity
public void fireEndEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) flushMyWriter(); // we do not need to handle this. }
java
public void fireEndEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) flushMyWriter(); // we do not need to handle this. }
[ "public", "void", "fireEndEntity", "(", "String", "name", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "m_tracer", "!=", "null", ")", "flushMyWriter", "(", ")", ";", "// we do not need to handle this.", "}" ]
To fire off end entity trace event @param name Name of entity
[ "To", "fire", "off", "end", "entity", "trace", "event" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L1076-L1082