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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
33,700 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/OlsonTimeZone.java | OlsonTimeZone.constructEmpty | private void constructEmpty(){
transitionCount = 0;
transitionTimes64 = null;
typeMapData = null;
typeCount = 1;
typeOffsets = new int[]{0,0};
finalZone = null;
finalStartYear = Integer.MAX_VALUE;
finalStartMillis = Double.MAX_VALUE;
transitionRulesInitialized = false;
} | java | private void constructEmpty(){
transitionCount = 0;
transitionTimes64 = null;
typeMapData = null;
typeCount = 1;
typeOffsets = new int[]{0,0};
finalZone = null;
finalStartYear = Integer.MAX_VALUE;
finalStartMillis = Double.MAX_VALUE;
transitionRulesInitialized = false;
} | [
"private",
"void",
"constructEmpty",
"(",
")",
"{",
"transitionCount",
"=",
"0",
";",
"transitionTimes64",
"=",
"null",
";",
"typeMapData",
"=",
"null",
";",
"typeCount",
"=",
"1",
";",
"typeOffsets",
"=",
"new",
"int",
"[",
"]",
"{",
"0",
",",
"0",
"}... | Construct a GMT+0 zone with no transitions. This is done when a
constructor fails so the resultant object is well-behaved. | [
"Construct",
"a",
"GMT",
"+",
"0",
"zone",
"with",
"no",
"transitions",
".",
"This",
"is",
"done",
"when",
"a",
"constructor",
"fails",
"so",
"the",
"resultant",
"object",
"is",
"well",
"-",
"behaved",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/OlsonTimeZone.java#L463-L475 |
33,701 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Grego.java | Grego.fieldsToDay | public static long fieldsToDay(int year, int month, int dom) {
int y = year - 1;
long julian =
365 * y + floorDivide(y, 4) + (JULIAN_1_CE - 3) + // Julian cal
floorDivide(y, 400) - floorDivide(y, 100) + 2 + // => Gregorian cal
DAYS_BEFORE[month + (isLeapYear(year) ? 12 : 0)] + dom; // => month/dom
return julian - JULIAN_1970_CE; // JD => epoch day
} | java | public static long fieldsToDay(int year, int month, int dom) {
int y = year - 1;
long julian =
365 * y + floorDivide(y, 4) + (JULIAN_1_CE - 3) + // Julian cal
floorDivide(y, 400) - floorDivide(y, 100) + 2 + // => Gregorian cal
DAYS_BEFORE[month + (isLeapYear(year) ? 12 : 0)] + dom; // => month/dom
return julian - JULIAN_1970_CE; // JD => epoch day
} | [
"public",
"static",
"long",
"fieldsToDay",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"dom",
")",
"{",
"int",
"y",
"=",
"year",
"-",
"1",
";",
"long",
"julian",
"=",
"365",
"*",
"y",
"+",
"floorDivide",
"(",
"y",
",",
"4",
")",
"+",
"... | Convert a year, month, and day-of-month, given in the proleptic
Gregorian calendar, to 1970 epoch days.
@param year Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.
@param month 0-based month, with 0==Jan
@param dom 1-based day of month
@return the day number, with day 0 == Jan 1 1970 | [
"Convert",
"a",
"year",
"month",
"and",
"day",
"-",
"of",
"-",
"month",
"given",
"in",
"the",
"proleptic",
"Gregorian",
"calendar",
"to",
"1970",
"epoch",
"days",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Grego.java#L97-L104 |
33,702 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Grego.java | Grego.timeToString | public static String timeToString(long time) {
int[] fields = timeToFields(time, null);
int millis = fields[5];
int hour = millis / MILLIS_PER_HOUR;
millis = millis % MILLIS_PER_HOUR;
int min = millis / MILLIS_PER_MINUTE;
millis = millis % MILLIS_PER_MINUTE;
int sec = millis / MILLIS_PER_SECOND;
millis = millis % MILLIS_PER_SECOND;
return String.format((Locale)null, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
fields[0], fields[1] + 1, fields[2], hour, min, sec, millis);
} | java | public static String timeToString(long time) {
int[] fields = timeToFields(time, null);
int millis = fields[5];
int hour = millis / MILLIS_PER_HOUR;
millis = millis % MILLIS_PER_HOUR;
int min = millis / MILLIS_PER_MINUTE;
millis = millis % MILLIS_PER_MINUTE;
int sec = millis / MILLIS_PER_SECOND;
millis = millis % MILLIS_PER_SECOND;
return String.format((Locale)null, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
fields[0], fields[1] + 1, fields[2], hour, min, sec, millis);
} | [
"public",
"static",
"String",
"timeToString",
"(",
"long",
"time",
")",
"{",
"int",
"[",
"]",
"fields",
"=",
"timeToFields",
"(",
"time",
",",
"null",
")",
";",
"int",
"millis",
"=",
"fields",
"[",
"5",
"]",
";",
"int",
"hour",
"=",
"millis",
"/",
... | Convenient method for formatting time to ISO 8601 style
date string.
@param time long time
@return ISO-8601 date string | [
"Convenient",
"method",
"for",
"formatting",
"time",
"to",
"ISO",
"8601",
"style",
"date",
"string",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Grego.java#L225-L237 |
33,703 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/IntTrie.java | IntTrie.getCodePointValue | public final int getCodePointValue(int ch)
{
int offset;
// fastpath for U+0000..U+D7FF
if(0 <= ch && ch < UTF16.LEAD_SURROGATE_MIN_VALUE) {
// copy of getRawOffset()
offset = (m_index_[ch >> INDEX_STAGE_1_SHIFT_] << INDEX_STAGE_2_SHIFT_)
+ (ch & INDEX_STAGE_3_MASK_);
return m_data_[offset];
}
// handle U+D800..U+10FFFF
offset = getCodePointOffset(ch);
return (offset >= 0) ? m_data_[offset] : m_initialValue_;
} | java | public final int getCodePointValue(int ch)
{
int offset;
// fastpath for U+0000..U+D7FF
if(0 <= ch && ch < UTF16.LEAD_SURROGATE_MIN_VALUE) {
// copy of getRawOffset()
offset = (m_index_[ch >> INDEX_STAGE_1_SHIFT_] << INDEX_STAGE_2_SHIFT_)
+ (ch & INDEX_STAGE_3_MASK_);
return m_data_[offset];
}
// handle U+D800..U+10FFFF
offset = getCodePointOffset(ch);
return (offset >= 0) ? m_data_[offset] : m_initialValue_;
} | [
"public",
"final",
"int",
"getCodePointValue",
"(",
"int",
"ch",
")",
"{",
"int",
"offset",
";",
"// fastpath for U+0000..U+D7FF",
"if",
"(",
"0",
"<=",
"ch",
"&&",
"ch",
"<",
"UTF16",
".",
"LEAD_SURROGATE_MIN_VALUE",
")",
"{",
"// copy of getRawOffset()",
"offs... | Gets the value associated with the codepoint.
If no value is associated with the codepoint, a default value will be
returned.
@param ch codepoint
@return offset to data | [
"Gets",
"the",
"value",
"associated",
"with",
"the",
"codepoint",
".",
"If",
"no",
"value",
"is",
"associated",
"with",
"the",
"codepoint",
"a",
"default",
"value",
"will",
"be",
"returned",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/IntTrie.java#L119-L134 |
33,704 | google/j2objc | jre_emul/Classes/com/google/j2objc/io/AsyncPipedNSInputStreamAdapter.java | AsyncPipedNSInputStreamAdapter.create | public static Object create(Delegate delegate, int bufferSize) {
if (bufferSize < 1) {
throw new IllegalArgumentException("Invalid buffer size: " + bufferSize);
}
if (delegate == null) {
throw new IllegalArgumentException("Delegate must not be null");
}
return nativeCreate(delegate, bufferSize);
} | java | public static Object create(Delegate delegate, int bufferSize) {
if (bufferSize < 1) {
throw new IllegalArgumentException("Invalid buffer size: " + bufferSize);
}
if (delegate == null) {
throw new IllegalArgumentException("Delegate must not be null");
}
return nativeCreate(delegate, bufferSize);
} | [
"public",
"static",
"Object",
"create",
"(",
"Delegate",
"delegate",
",",
"int",
"bufferSize",
")",
"{",
"if",
"(",
"bufferSize",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid buffer size: \"",
"+",
"bufferSize",
")",
";",
"}"... | Creates a native NSInputStream that is piped to a NSOutpuStream, which in turn requests data
from the supplied delegate asynchronously.
<p>Please note that the returned NSInputStream is not yet open. This is to allow the stream to
be used by other Foundation API (such as NSMutableURLRequest) and is consistent with other
NSInputStream initializers.
@param delegate the delegate.
@param bufferSize the size of the internal buffer used to pipe the NSOutputStream to the
NSInputStream.
@return a native NSInputStream. | [
"Creates",
"a",
"native",
"NSInputStream",
"that",
"is",
"piped",
"to",
"a",
"NSOutpuStream",
"which",
"in",
"turn",
"requests",
"data",
"from",
"the",
"supplied",
"delegate",
"asynchronously",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/Classes/com/google/j2objc/io/AsyncPipedNSInputStreamAdapter.java#L308-L318 |
33,705 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java | ProcessorInclude.getSourceFromUriResolver | private Source getSourceFromUriResolver(StylesheetHandler handler)
throws TransformerException {
Source s = null;
TransformerFactoryImpl processor = handler.getStylesheetProcessor();
URIResolver uriresolver = processor.getURIResolver();
if (uriresolver != null) {
String href = getHref();
String base = handler.getBaseIdentifier();
s = uriresolver.resolve(href,base);
}
return s;
} | java | private Source getSourceFromUriResolver(StylesheetHandler handler)
throws TransformerException {
Source s = null;
TransformerFactoryImpl processor = handler.getStylesheetProcessor();
URIResolver uriresolver = processor.getURIResolver();
if (uriresolver != null) {
String href = getHref();
String base = handler.getBaseIdentifier();
s = uriresolver.resolve(href,base);
}
return s;
} | [
"private",
"Source",
"getSourceFromUriResolver",
"(",
"StylesheetHandler",
"handler",
")",
"throws",
"TransformerException",
"{",
"Source",
"s",
"=",
"null",
";",
"TransformerFactoryImpl",
"processor",
"=",
"handler",
".",
"getStylesheetProcessor",
"(",
")",
";",
"URI... | Get the Source object for the included or imported stylesheet module
obtained from the user's URIResolver, if there is no user provided
URIResolver null is returned. | [
"Get",
"the",
"Source",
"object",
"for",
"the",
"included",
"or",
"imported",
"stylesheet",
"module",
"obtained",
"from",
"the",
"user",
"s",
"URIResolver",
"if",
"there",
"is",
"no",
"user",
"provided",
"URIResolver",
"null",
"is",
"returned",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java#L348-L360 |
33,706 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java | ProcessorInclude.getBaseURIOfIncludedStylesheet | private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s)
throws TransformerException {
String baseURI;
String idFromUriResolverSource;
if (s != null && (idFromUriResolverSource = s.getSystemId()) != null) {
// We have a Source obtained from a users's URIResolver,
// and the system ID is set on it, so return that as the base URI
baseURI = idFromUriResolverSource;
} else {
// The user did not provide a URIResolver, or it did not
// return a Source for the included stylesheet module, or
// the Source has no system ID set, so we fall back to using
// the system ID Resolver to take the href and base
// to generate the baseURI of the included stylesheet.
baseURI = SystemIDResolver.getAbsoluteURI(getHref(), handler
.getBaseIdentifier());
}
return baseURI;
} | java | private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s)
throws TransformerException {
String baseURI;
String idFromUriResolverSource;
if (s != null && (idFromUriResolverSource = s.getSystemId()) != null) {
// We have a Source obtained from a users's URIResolver,
// and the system ID is set on it, so return that as the base URI
baseURI = idFromUriResolverSource;
} else {
// The user did not provide a URIResolver, or it did not
// return a Source for the included stylesheet module, or
// the Source has no system ID set, so we fall back to using
// the system ID Resolver to take the href and base
// to generate the baseURI of the included stylesheet.
baseURI = SystemIDResolver.getAbsoluteURI(getHref(), handler
.getBaseIdentifier());
}
return baseURI;
} | [
"private",
"String",
"getBaseURIOfIncludedStylesheet",
"(",
"StylesheetHandler",
"handler",
",",
"Source",
"s",
")",
"throws",
"TransformerException",
"{",
"String",
"baseURI",
";",
"String",
"idFromUriResolverSource",
";",
"if",
"(",
"s",
"!=",
"null",
"&&",
"(",
... | Get the base URI of the included or imported stylesheet,
if the user provided a URIResolver, then get the Source
object for the stylsheet from it, and get the systemId
from that Source object, otherwise try to recover by
using the SysteIDResolver to figure out the base URI.
@param handler The handler that processes the stylesheet as SAX events,
and maintains state
@param s The Source object from a URIResolver, for the included stylesheet module,
so this will be null if there is no URIResolver set. | [
"Get",
"the",
"base",
"URI",
"of",
"the",
"included",
"or",
"imported",
"stylesheet",
"if",
"the",
"user",
"provided",
"a",
"URIResolver",
"then",
"get",
"the",
"Source",
"object",
"for",
"the",
"stylsheet",
"from",
"it",
"and",
"get",
"the",
"systemId",
"... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java#L373-L395 |
33,707 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUConfig.java | ICUConfig.get | public static String get(String name, String def) {
String val = null;
final String fname = name;
if (System.getSecurityManager() != null) {
try {
val = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty(fname);
}
});
} catch (AccessControlException e) {
// ignore
// TODO log this message
}
} else {
val = System.getProperty(name);
}
if (val == null) {
val = CONFIG_PROPS.getProperty(name, def);
}
return val;
} | java | public static String get(String name, String def) {
String val = null;
final String fname = name;
if (System.getSecurityManager() != null) {
try {
val = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty(fname);
}
});
} catch (AccessControlException e) {
// ignore
// TODO log this message
}
} else {
val = System.getProperty(name);
}
if (val == null) {
val = CONFIG_PROPS.getProperty(name, def);
}
return val;
} | [
"public",
"static",
"String",
"get",
"(",
"String",
"name",
",",
"String",
"def",
")",
"{",
"String",
"val",
"=",
"null",
";",
"final",
"String",
"fname",
"=",
"name",
";",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"!=",
"null",
")",
... | Get ICU configuration property value for the given name.
@param name The configuration property name
@param def The default value
@return The configuration property value. If the property does not
exist, <code>def</code> is returned. | [
"Get",
"ICU",
"configuration",
"property",
"value",
"for",
"the",
"given",
"name",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUConfig.java#L62-L85 |
33,708 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/Writer.java | Writer.write | public void write(int c) throws IOException {
synchronized (lock) {
if (writeBuffer == null){
writeBuffer = new char[WRITE_BUFFER_SIZE];
}
writeBuffer[0] = (char) c;
write(writeBuffer, 0, 1);
}
} | java | public void write(int c) throws IOException {
synchronized (lock) {
if (writeBuffer == null){
writeBuffer = new char[WRITE_BUFFER_SIZE];
}
writeBuffer[0] = (char) c;
write(writeBuffer, 0, 1);
}
} | [
"public",
"void",
"write",
"(",
"int",
"c",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"writeBuffer",
"==",
"null",
")",
"{",
"writeBuffer",
"=",
"new",
"char",
"[",
"WRITE_BUFFER_SIZE",
"]",
";",
"}",
"writeBuff... | Writes a single character. The character to be written is contained in
the 16 low-order bits of the given integer value; the 16 high-order bits
are ignored.
<p> Subclasses that intend to support efficient single-character output
should override this method.
@param c
int specifying a character to be written
@throws IOException
If an I/O error occurs | [
"Writes",
"a",
"single",
"character",
".",
"The",
"character",
"to",
"be",
"written",
"is",
"contained",
"in",
"the",
"16",
"low",
"-",
"order",
"bits",
"of",
"the",
"given",
"integer",
"value",
";",
"the",
"16",
"high",
"-",
"order",
"bits",
"are",
"i... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/Writer.java#L108-L116 |
33,709 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/Writer.java | Writer.write | public void write(String str, int off, int len) throws IOException {
synchronized (lock) {
char cbuf[];
if (len <= WRITE_BUFFER_SIZE) {
if (writeBuffer == null) {
writeBuffer = new char[WRITE_BUFFER_SIZE];
}
cbuf = writeBuffer;
} else { // Don't permanently allocate very large buffers.
cbuf = new char[len];
}
str.getChars(off, (off + len), cbuf, 0);
write(cbuf, 0, len);
}
} | java | public void write(String str, int off, int len) throws IOException {
synchronized (lock) {
char cbuf[];
if (len <= WRITE_BUFFER_SIZE) {
if (writeBuffer == null) {
writeBuffer = new char[WRITE_BUFFER_SIZE];
}
cbuf = writeBuffer;
} else { // Don't permanently allocate very large buffers.
cbuf = new char[len];
}
str.getChars(off, (off + len), cbuf, 0);
write(cbuf, 0, len);
}
} | [
"public",
"void",
"write",
"(",
"String",
"str",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"char",
"cbuf",
"[",
"]",
";",
"if",
"(",
"len",
"<=",
"WRITE_BUFFER_SIZE",
")",
"{",
"if... | Writes a portion of a string.
@param str
A String
@param off
Offset from which to start writing characters
@param len
Number of characters to write
@throws IndexOutOfBoundsException
If <tt>off</tt> is negative, or <tt>len</tt> is negative,
or <tt>off+len</tt> is negative or greater than the length
of the given string
@throws IOException
If an I/O error occurs | [
"Writes",
"a",
"portion",
"of",
"a",
"string",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/Writer.java#L181-L195 |
33,710 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java | LocaleDisplayNames.getInstance | public static LocaleDisplayNames getInstance(ULocale locale, DialectHandling dialectHandling) {
LocaleDisplayNames result = null;
if (FACTORY_DIALECTHANDLING != null) {
try {
result = (LocaleDisplayNames) FACTORY_DIALECTHANDLING.invoke(null,
locale, dialectHandling);
} catch (InvocationTargetException e) {
// fall through
} catch (IllegalAccessException e) {
// fall through
}
}
if (result == null) {
result = new LastResortLocaleDisplayNames(locale, dialectHandling);
}
return result;
} | java | public static LocaleDisplayNames getInstance(ULocale locale, DialectHandling dialectHandling) {
LocaleDisplayNames result = null;
if (FACTORY_DIALECTHANDLING != null) {
try {
result = (LocaleDisplayNames) FACTORY_DIALECTHANDLING.invoke(null,
locale, dialectHandling);
} catch (InvocationTargetException e) {
// fall through
} catch (IllegalAccessException e) {
// fall through
}
}
if (result == null) {
result = new LastResortLocaleDisplayNames(locale, dialectHandling);
}
return result;
} | [
"public",
"static",
"LocaleDisplayNames",
"getInstance",
"(",
"ULocale",
"locale",
",",
"DialectHandling",
"dialectHandling",
")",
"{",
"LocaleDisplayNames",
"result",
"=",
"null",
";",
"if",
"(",
"FACTORY_DIALECTHANDLING",
"!=",
"null",
")",
"{",
"try",
"{",
"res... | Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale,
using the provided dialectHandling.
@param locale the display locale
@param dialectHandling how to select names for locales
@return a LocaleDisplayNames instance | [
"Returns",
"an",
"instance",
"of",
"LocaleDisplayNames",
"that",
"returns",
"names",
"formatted",
"for",
"the",
"provided",
"locale",
"using",
"the",
"provided",
"dialectHandling",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java#L76-L92 |
33,711 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java | LocaleDisplayNames.getInstance | public static LocaleDisplayNames getInstance(ULocale locale, DisplayContext... contexts) {
LocaleDisplayNames result = null;
if (FACTORY_DISPLAYCONTEXT != null) {
try {
result = (LocaleDisplayNames) FACTORY_DISPLAYCONTEXT.invoke(null,
locale, contexts);
} catch (InvocationTargetException e) {
// fall through
} catch (IllegalAccessException e) {
// fall through
}
}
if (result == null) {
result = new LastResortLocaleDisplayNames(locale, contexts);
}
return result;
} | java | public static LocaleDisplayNames getInstance(ULocale locale, DisplayContext... contexts) {
LocaleDisplayNames result = null;
if (FACTORY_DISPLAYCONTEXT != null) {
try {
result = (LocaleDisplayNames) FACTORY_DISPLAYCONTEXT.invoke(null,
locale, contexts);
} catch (InvocationTargetException e) {
// fall through
} catch (IllegalAccessException e) {
// fall through
}
}
if (result == null) {
result = new LastResortLocaleDisplayNames(locale, contexts);
}
return result;
} | [
"public",
"static",
"LocaleDisplayNames",
"getInstance",
"(",
"ULocale",
"locale",
",",
"DisplayContext",
"...",
"contexts",
")",
"{",
"LocaleDisplayNames",
"result",
"=",
"null",
";",
"if",
"(",
"FACTORY_DISPLAYCONTEXT",
"!=",
"null",
")",
"{",
"try",
"{",
"res... | Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale,
using the provided DisplayContext settings
@param locale the display locale
@param contexts one or more context settings (e.g. for dialect
handling, capitalization, etc.
@return a LocaleDisplayNames instance | [
"Returns",
"an",
"instance",
"of",
"LocaleDisplayNames",
"that",
"returns",
"names",
"formatted",
"for",
"the",
"provided",
"locale",
"using",
"the",
"provided",
"DisplayContext",
"settings"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java#L102-L118 |
33,712 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java | LocaleDisplayNames.getUiList | public List<UiListItem> getUiList(Set<ULocale> localeSet, boolean inSelf, Comparator<Object> collator) {
return getUiListCompareWholeItems(localeSet, UiListItem.getComparator(collator, inSelf));
} | java | public List<UiListItem> getUiList(Set<ULocale> localeSet, boolean inSelf, Comparator<Object> collator) {
return getUiListCompareWholeItems(localeSet, UiListItem.getComparator(collator, inSelf));
} | [
"public",
"List",
"<",
"UiListItem",
">",
"getUiList",
"(",
"Set",
"<",
"ULocale",
">",
"localeSet",
",",
"boolean",
"inSelf",
",",
"Comparator",
"<",
"Object",
">",
"collator",
")",
"{",
"return",
"getUiListCompareWholeItems",
"(",
"localeSet",
",",
"UiListIt... | Return a list of information used to construct a UI list of locale names.
@param collator how to collate—should normally be Collator.getInstance(getDisplayLocale())
@param inSelf if true, compares the nameInSelf, otherwise the nameInDisplayLocale.
Set depending on which field (displayLocale vs self) is to show up in the UI.
If both are to show up in the UI, then it should be the one used for the primary sort order.
@param localeSet a list of locales to present in a UI list. The casing uses the settings in the LocaleDisplayNames instance.
@return an ordered list of UiListItems.
@throws IllformedLocaleException if any of the locales in localeSet are malformed. | [
"Return",
"a",
"list",
"of",
"information",
"used",
"to",
"construct",
"a",
"UI",
"list",
"of",
"locale",
"names",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java#L264-L266 |
33,713 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/XMLChar.java | XMLChar.isValidIANAEncoding | public static boolean isValidIANAEncoding(String ianaEncoding) {
if (ianaEncoding != null) {
int length = ianaEncoding.length();
if (length > 0) {
char c = ianaEncoding.charAt(0);
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
for (int i = 1; i < length; i++) {
c = ianaEncoding.charAt(i);
if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
(c < '0' || c > '9') && c != '.' && c != '_' &&
c != '-') {
return false;
}
}
return true;
}
}
}
return false;
} | java | public static boolean isValidIANAEncoding(String ianaEncoding) {
if (ianaEncoding != null) {
int length = ianaEncoding.length();
if (length > 0) {
char c = ianaEncoding.charAt(0);
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
for (int i = 1; i < length; i++) {
c = ianaEncoding.charAt(i);
if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
(c < '0' || c > '9') && c != '.' && c != '_' &&
c != '-') {
return false;
}
}
return true;
}
}
}
return false;
} | [
"public",
"static",
"boolean",
"isValidIANAEncoding",
"(",
"String",
"ianaEncoding",
")",
"{",
"if",
"(",
"ianaEncoding",
"!=",
"null",
")",
"{",
"int",
"length",
"=",
"ianaEncoding",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
">",
"0",
")",
"{",... | Returns true if the encoding name is a valid IANA encoding.
This method does not verify that there is a decoder available
for this encoding, only that the characters are valid for an
IANA encoding name.
@param ianaEncoding The IANA encoding name. | [
"Returns",
"true",
"if",
"the",
"encoding",
"name",
"is",
"a",
"valid",
"IANA",
"encoding",
".",
"This",
"method",
"does",
"not",
"verify",
"that",
"there",
"is",
"a",
"decoder",
"available",
"for",
"this",
"encoding",
"only",
"that",
"the",
"characters",
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/XMLChar.java#L598-L617 |
33,714 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/XMLChar.java | XMLChar.isValidJavaEncoding | public static boolean isValidJavaEncoding(String javaEncoding) {
if (javaEncoding != null) {
int length = javaEncoding.length();
if (length > 0) {
for (int i = 1; i < length; i++) {
char c = javaEncoding.charAt(i);
if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
(c < '0' || c > '9') && c != '.' && c != '_' &&
c != '-') {
return false;
}
}
return true;
}
}
return false;
} | java | public static boolean isValidJavaEncoding(String javaEncoding) {
if (javaEncoding != null) {
int length = javaEncoding.length();
if (length > 0) {
for (int i = 1; i < length; i++) {
char c = javaEncoding.charAt(i);
if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
(c < '0' || c > '9') && c != '.' && c != '_' &&
c != '-') {
return false;
}
}
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isValidJavaEncoding",
"(",
"String",
"javaEncoding",
")",
"{",
"if",
"(",
"javaEncoding",
"!=",
"null",
")",
"{",
"int",
"length",
"=",
"javaEncoding",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
">",
"0",
")",
"{",... | Returns true if the encoding name is a valid Java encoding.
This method does not verify that there is a decoder available
for this encoding, only that the characters are valid for an
Java encoding name.
@param javaEncoding The Java encoding name. | [
"Returns",
"true",
"if",
"the",
"encoding",
"name",
"is",
"a",
"valid",
"Java",
"encoding",
".",
"This",
"method",
"does",
"not",
"verify",
"that",
"there",
"is",
"a",
"decoder",
"available",
"for",
"this",
"encoding",
"only",
"that",
"the",
"characters",
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/XMLChar.java#L627-L643 |
33,715 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.encodeInfo | public void encodeInfo(OutputStream out) throws CRLException {
try {
DerOutputStream tmp = new DerOutputStream();
DerOutputStream rCerts = new DerOutputStream();
DerOutputStream seq = new DerOutputStream();
if (version != 0) // v2 crl encode version
tmp.putInteger(version);
infoSigAlgId.encode(tmp);
if ((version == 0) && (issuer.toString() == null))
throw new CRLException("Null Issuer DN not allowed in v1 CRL");
issuer.encode(tmp);
if (thisUpdate.getTime() < YR_2050)
tmp.putUTCTime(thisUpdate);
else
tmp.putGeneralizedTime(thisUpdate);
if (nextUpdate != null) {
if (nextUpdate.getTime() < YR_2050)
tmp.putUTCTime(nextUpdate);
else
tmp.putGeneralizedTime(nextUpdate);
}
if (!revokedList.isEmpty()) {
for (X509CRLEntry entry : revokedList) {
((X509CRLEntryImpl)entry).encode(rCerts);
}
tmp.write(DerValue.tag_Sequence, rCerts);
}
if (extensions != null)
extensions.encode(tmp, isExplicit);
seq.write(DerValue.tag_Sequence, tmp);
tbsCertList = seq.toByteArray();
out.write(tbsCertList);
} catch (IOException e) {
throw new CRLException("Encoding error: " + e.getMessage());
}
} | java | public void encodeInfo(OutputStream out) throws CRLException {
try {
DerOutputStream tmp = new DerOutputStream();
DerOutputStream rCerts = new DerOutputStream();
DerOutputStream seq = new DerOutputStream();
if (version != 0) // v2 crl encode version
tmp.putInteger(version);
infoSigAlgId.encode(tmp);
if ((version == 0) && (issuer.toString() == null))
throw new CRLException("Null Issuer DN not allowed in v1 CRL");
issuer.encode(tmp);
if (thisUpdate.getTime() < YR_2050)
tmp.putUTCTime(thisUpdate);
else
tmp.putGeneralizedTime(thisUpdate);
if (nextUpdate != null) {
if (nextUpdate.getTime() < YR_2050)
tmp.putUTCTime(nextUpdate);
else
tmp.putGeneralizedTime(nextUpdate);
}
if (!revokedList.isEmpty()) {
for (X509CRLEntry entry : revokedList) {
((X509CRLEntryImpl)entry).encode(rCerts);
}
tmp.write(DerValue.tag_Sequence, rCerts);
}
if (extensions != null)
extensions.encode(tmp, isExplicit);
seq.write(DerValue.tag_Sequence, tmp);
tbsCertList = seq.toByteArray();
out.write(tbsCertList);
} catch (IOException e) {
throw new CRLException("Encoding error: " + e.getMessage());
}
} | [
"public",
"void",
"encodeInfo",
"(",
"OutputStream",
"out",
")",
"throws",
"CRLException",
"{",
"try",
"{",
"DerOutputStream",
"tmp",
"=",
"new",
"DerOutputStream",
"(",
")",
";",
"DerOutputStream",
"rCerts",
"=",
"new",
"DerOutputStream",
"(",
")",
";",
"DerO... | Encodes the "to-be-signed" CRL to the OutputStream.
@param out the OutputStream to write to.
@exception CRLException on encoding errors. | [
"Encodes",
"the",
"to",
"-",
"be",
"-",
"signed",
"CRL",
"to",
"the",
"OutputStream",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L285-L327 |
33,716 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.verify | public void verify(PublicKey key)
throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException {
verify(key, "");
} | java | public void verify(PublicKey key)
throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException {
verify(key, "");
} | [
"public",
"void",
"verify",
"(",
"PublicKey",
"key",
")",
"throws",
"CRLException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"NoSuchProviderException",
",",
"SignatureException",
"{",
"verify",
"(",
"key",
",",
"\"\"",
")",
";",
"}"
] | Verifies that this CRL was signed using the
private key that corresponds to the given public key.
@param key the PublicKey used to carry out the verification.
@exception NoSuchAlgorithmException on unsupported signature
algorithms.
@exception InvalidKeyException on incorrect key.
@exception NoSuchProviderException if there's no default provider.
@exception SignatureException on signature errors.
@exception CRLException on encoding errors. | [
"Verifies",
"that",
"this",
"CRL",
"was",
"signed",
"using",
"the",
"private",
"key",
"that",
"corresponds",
"to",
"the",
"given",
"public",
"key",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L342-L346 |
33,717 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.verify | public synchronized void verify(PublicKey key, String sigProvider)
throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException {
if (sigProvider == null) {
sigProvider = "";
}
if ((verifiedPublicKey != null) && verifiedPublicKey.equals(key)) {
// this CRL has already been successfully verified using
// this public key. Make sure providers match, too.
if (sigProvider.equals(verifiedProvider)) {
return;
}
}
if (signedCRL == null) {
throw new CRLException("Uninitialized CRL");
}
Signature sigVerf = null;
if (sigProvider.length() == 0) {
sigVerf = Signature.getInstance(sigAlgId.getName());
} else {
sigVerf = Signature.getInstance(sigAlgId.getName(), sigProvider);
}
sigVerf.initVerify(key);
if (tbsCertList == null) {
throw new CRLException("Uninitialized CRL");
}
sigVerf.update(tbsCertList, 0, tbsCertList.length);
if (!sigVerf.verify(signature)) {
throw new SignatureException("Signature does not match.");
}
verifiedPublicKey = key;
verifiedProvider = sigProvider;
} | java | public synchronized void verify(PublicKey key, String sigProvider)
throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException {
if (sigProvider == null) {
sigProvider = "";
}
if ((verifiedPublicKey != null) && verifiedPublicKey.equals(key)) {
// this CRL has already been successfully verified using
// this public key. Make sure providers match, too.
if (sigProvider.equals(verifiedProvider)) {
return;
}
}
if (signedCRL == null) {
throw new CRLException("Uninitialized CRL");
}
Signature sigVerf = null;
if (sigProvider.length() == 0) {
sigVerf = Signature.getInstance(sigAlgId.getName());
} else {
sigVerf = Signature.getInstance(sigAlgId.getName(), sigProvider);
}
sigVerf.initVerify(key);
if (tbsCertList == null) {
throw new CRLException("Uninitialized CRL");
}
sigVerf.update(tbsCertList, 0, tbsCertList.length);
if (!sigVerf.verify(signature)) {
throw new SignatureException("Signature does not match.");
}
verifiedPublicKey = key;
verifiedProvider = sigProvider;
} | [
"public",
"synchronized",
"void",
"verify",
"(",
"PublicKey",
"key",
",",
"String",
"sigProvider",
")",
"throws",
"CRLException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"NoSuchProviderException",
",",
"SignatureException",
"{",
"if",
"(",
"s... | Verifies that this CRL was signed using the
private key that corresponds to the given public key,
and that the signature verification was computed by
the given provider.
@param key the PublicKey used to carry out the verification.
@param sigProvider the name of the signature provider.
@exception NoSuchAlgorithmException on unsupported signature
algorithms.
@exception InvalidKeyException on incorrect key.
@exception NoSuchProviderException on incorrect provider.
@exception SignatureException on signature errors.
@exception CRLException on encoding errors. | [
"Verifies",
"that",
"this",
"CRL",
"was",
"signed",
"using",
"the",
"private",
"key",
"that",
"corresponds",
"to",
"the",
"given",
"public",
"key",
"and",
"that",
"the",
"signature",
"verification",
"was",
"computed",
"by",
"the",
"given",
"provider",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L364-L400 |
33,718 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.isRevoked | public boolean isRevoked(Certificate cert) {
if (revokedMap.isEmpty() || (!(cert instanceof X509Certificate))) {
return false;
}
X509Certificate xcert = (X509Certificate) cert;
X509IssuerSerial issuerSerial = new X509IssuerSerial(xcert);
return revokedMap.containsKey(issuerSerial);
} | java | public boolean isRevoked(Certificate cert) {
if (revokedMap.isEmpty() || (!(cert instanceof X509Certificate))) {
return false;
}
X509Certificate xcert = (X509Certificate) cert;
X509IssuerSerial issuerSerial = new X509IssuerSerial(xcert);
return revokedMap.containsKey(issuerSerial);
} | [
"public",
"boolean",
"isRevoked",
"(",
"Certificate",
"cert",
")",
"{",
"if",
"(",
"revokedMap",
".",
"isEmpty",
"(",
")",
"||",
"(",
"!",
"(",
"cert",
"instanceof",
"X509Certificate",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"X509Certificate",
"... | Checks whether the given certificate is on this CRL.
@param cert the certificate to check for.
@return true if the given certificate is on this CRL,
false otherwise. | [
"Checks",
"whether",
"the",
"given",
"certificate",
"is",
"on",
"this",
"CRL",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L547-L554 |
33,719 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getRevokedCertificate | public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
if (revokedMap.isEmpty()) {
return null;
}
// assume this is a direct CRL entry (cert and CRL issuer are the same)
X509IssuerSerial issuerSerial = new X509IssuerSerial
(getIssuerX500Principal(), serialNumber);
return revokedMap.get(issuerSerial);
} | java | public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
if (revokedMap.isEmpty()) {
return null;
}
// assume this is a direct CRL entry (cert and CRL issuer are the same)
X509IssuerSerial issuerSerial = new X509IssuerSerial
(getIssuerX500Principal(), serialNumber);
return revokedMap.get(issuerSerial);
} | [
"public",
"X509CRLEntry",
"getRevokedCertificate",
"(",
"BigInteger",
"serialNumber",
")",
"{",
"if",
"(",
"revokedMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"// assume this is a direct CRL entry (cert and CRL issuer are the same)",
"X509IssuerS... | Gets the CRL entry with the given serial number from this CRL.
@return the entry with the given serial number, or <code>null</code> if
no such entry exists in the CRL.
@see X509CRLEntry | [
"Gets",
"the",
"CRL",
"entry",
"with",
"the",
"given",
"serial",
"number",
"from",
"this",
"CRL",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L642-L650 |
33,720 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getRevokedCertificate | public X509CRLEntry getRevokedCertificate(X509Certificate cert) {
if (revokedMap.isEmpty()) {
return null;
}
X509IssuerSerial issuerSerial = new X509IssuerSerial(cert);
return revokedMap.get(issuerSerial);
} | java | public X509CRLEntry getRevokedCertificate(X509Certificate cert) {
if (revokedMap.isEmpty()) {
return null;
}
X509IssuerSerial issuerSerial = new X509IssuerSerial(cert);
return revokedMap.get(issuerSerial);
} | [
"public",
"X509CRLEntry",
"getRevokedCertificate",
"(",
"X509Certificate",
"cert",
")",
"{",
"if",
"(",
"revokedMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"X509IssuerSerial",
"issuerSerial",
"=",
"new",
"X509IssuerSerial",
"(",
"cert",... | Gets the CRL entry for the given certificate. | [
"Gets",
"the",
"CRL",
"entry",
"for",
"the",
"given",
"certificate",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L655-L661 |
33,721 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getSignature | public byte[] getSignature() {
if (signature == null)
return null;
byte[] dup = new byte[signature.length];
System.arraycopy(signature, 0, dup, 0, dup.length);
return dup;
} | java | public byte[] getSignature() {
if (signature == null)
return null;
byte[] dup = new byte[signature.length];
System.arraycopy(signature, 0, dup, 0, dup.length);
return dup;
} | [
"public",
"byte",
"[",
"]",
"getSignature",
"(",
")",
"{",
"if",
"(",
"signature",
"==",
"null",
")",
"return",
"null",
";",
"byte",
"[",
"]",
"dup",
"=",
"new",
"byte",
"[",
"signature",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"s... | Gets the raw Signature bits from the CRL.
@return the signature. | [
"Gets",
"the",
"raw",
"Signature",
"bits",
"from",
"the",
"CRL",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L700-L706 |
33,722 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getAuthKeyId | public KeyIdentifier getAuthKeyId() throws IOException {
AuthorityKeyIdentifierExtension aki = getAuthKeyIdExtension();
if (aki != null) {
KeyIdentifier keyId = (KeyIdentifier)aki.get(
AuthorityKeyIdentifierExtension.KEY_ID);
return keyId;
} else {
return null;
}
} | java | public KeyIdentifier getAuthKeyId() throws IOException {
AuthorityKeyIdentifierExtension aki = getAuthKeyIdExtension();
if (aki != null) {
KeyIdentifier keyId = (KeyIdentifier)aki.get(
AuthorityKeyIdentifierExtension.KEY_ID);
return keyId;
} else {
return null;
}
} | [
"public",
"KeyIdentifier",
"getAuthKeyId",
"(",
")",
"throws",
"IOException",
"{",
"AuthorityKeyIdentifierExtension",
"aki",
"=",
"getAuthKeyIdExtension",
"(",
")",
";",
"if",
"(",
"aki",
"!=",
"null",
")",
"{",
"KeyIdentifier",
"keyId",
"=",
"(",
"KeyIdentifier",... | return the AuthorityKeyIdentifier, if any.
@returns AuthorityKeyIdentifier or null
(if no AuthorityKeyIdentifierExtension)
@throws IOException on error | [
"return",
"the",
"AuthorityKeyIdentifier",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L784-L793 |
33,723 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getAuthKeyIdExtension | public AuthorityKeyIdentifierExtension getAuthKeyIdExtension()
throws IOException {
Object obj = getExtension(PKIXExtensions.AuthorityKey_Id);
return (AuthorityKeyIdentifierExtension)obj;
} | java | public AuthorityKeyIdentifierExtension getAuthKeyIdExtension()
throws IOException {
Object obj = getExtension(PKIXExtensions.AuthorityKey_Id);
return (AuthorityKeyIdentifierExtension)obj;
} | [
"public",
"AuthorityKeyIdentifierExtension",
"getAuthKeyIdExtension",
"(",
")",
"throws",
"IOException",
"{",
"Object",
"obj",
"=",
"getExtension",
"(",
"PKIXExtensions",
".",
"AuthorityKey_Id",
")",
";",
"return",
"(",
"AuthorityKeyIdentifierExtension",
")",
"obj",
";"... | return the AuthorityKeyIdentifierExtension, if any.
@returns AuthorityKeyIdentifierExtension or null (if no such extension)
@throws IOException on error | [
"return",
"the",
"AuthorityKeyIdentifierExtension",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L801-L805 |
33,724 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getCRLNumberExtension | public CRLNumberExtension getCRLNumberExtension() throws IOException {
Object obj = getExtension(PKIXExtensions.CRLNumber_Id);
return (CRLNumberExtension)obj;
} | java | public CRLNumberExtension getCRLNumberExtension() throws IOException {
Object obj = getExtension(PKIXExtensions.CRLNumber_Id);
return (CRLNumberExtension)obj;
} | [
"public",
"CRLNumberExtension",
"getCRLNumberExtension",
"(",
")",
"throws",
"IOException",
"{",
"Object",
"obj",
"=",
"getExtension",
"(",
"PKIXExtensions",
".",
"CRLNumber_Id",
")",
";",
"return",
"(",
"CRLNumberExtension",
")",
"obj",
";",
"}"
] | return the CRLNumberExtension, if any.
@returns CRLNumberExtension or null (if no such extension)
@throws IOException on error | [
"return",
"the",
"CRLNumberExtension",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L813-L816 |
33,725 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getCRLNumber | public BigInteger getCRLNumber() throws IOException {
CRLNumberExtension numExt = getCRLNumberExtension();
if (numExt != null) {
BigInteger num = numExt.get(CRLNumberExtension.NUMBER);
return num;
} else {
return null;
}
} | java | public BigInteger getCRLNumber() throws IOException {
CRLNumberExtension numExt = getCRLNumberExtension();
if (numExt != null) {
BigInteger num = numExt.get(CRLNumberExtension.NUMBER);
return num;
} else {
return null;
}
} | [
"public",
"BigInteger",
"getCRLNumber",
"(",
")",
"throws",
"IOException",
"{",
"CRLNumberExtension",
"numExt",
"=",
"getCRLNumberExtension",
"(",
")",
";",
"if",
"(",
"numExt",
"!=",
"null",
")",
"{",
"BigInteger",
"num",
"=",
"numExt",
".",
"get",
"(",
"CR... | return the CRL number from the CRLNumberExtension, if any.
@returns number or null (if no such extension)
@throws IOException on error | [
"return",
"the",
"CRL",
"number",
"from",
"the",
"CRLNumberExtension",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L824-L832 |
33,726 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getDeltaCRLIndicatorExtension | public DeltaCRLIndicatorExtension getDeltaCRLIndicatorExtension()
throws IOException {
Object obj = getExtension(PKIXExtensions.DeltaCRLIndicator_Id);
return (DeltaCRLIndicatorExtension)obj;
} | java | public DeltaCRLIndicatorExtension getDeltaCRLIndicatorExtension()
throws IOException {
Object obj = getExtension(PKIXExtensions.DeltaCRLIndicator_Id);
return (DeltaCRLIndicatorExtension)obj;
} | [
"public",
"DeltaCRLIndicatorExtension",
"getDeltaCRLIndicatorExtension",
"(",
")",
"throws",
"IOException",
"{",
"Object",
"obj",
"=",
"getExtension",
"(",
"PKIXExtensions",
".",
"DeltaCRLIndicator_Id",
")",
";",
"return",
"(",
"DeltaCRLIndicatorExtension",
")",
"obj",
... | return the DeltaCRLIndicatorExtension, if any.
@returns DeltaCRLIndicatorExtension or null (if no such extension)
@throws IOException on error | [
"return",
"the",
"DeltaCRLIndicatorExtension",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L840-L845 |
33,727 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getBaseCRLNumber | public BigInteger getBaseCRLNumber() throws IOException {
DeltaCRLIndicatorExtension dciExt = getDeltaCRLIndicatorExtension();
if (dciExt != null) {
BigInteger num = dciExt.get(DeltaCRLIndicatorExtension.NUMBER);
return num;
} else {
return null;
}
} | java | public BigInteger getBaseCRLNumber() throws IOException {
DeltaCRLIndicatorExtension dciExt = getDeltaCRLIndicatorExtension();
if (dciExt != null) {
BigInteger num = dciExt.get(DeltaCRLIndicatorExtension.NUMBER);
return num;
} else {
return null;
}
} | [
"public",
"BigInteger",
"getBaseCRLNumber",
"(",
")",
"throws",
"IOException",
"{",
"DeltaCRLIndicatorExtension",
"dciExt",
"=",
"getDeltaCRLIndicatorExtension",
"(",
")",
";",
"if",
"(",
"dciExt",
"!=",
"null",
")",
"{",
"BigInteger",
"num",
"=",
"dciExt",
".",
... | return the base CRL number from the DeltaCRLIndicatorExtension, if any.
@returns number or null (if no such extension)
@throws IOException on error | [
"return",
"the",
"base",
"CRL",
"number",
"from",
"the",
"DeltaCRLIndicatorExtension",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L853-L861 |
33,728 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getIssuerAltNameExtension | public IssuerAlternativeNameExtension getIssuerAltNameExtension()
throws IOException {
Object obj = getExtension(PKIXExtensions.IssuerAlternativeName_Id);
return (IssuerAlternativeNameExtension)obj;
} | java | public IssuerAlternativeNameExtension getIssuerAltNameExtension()
throws IOException {
Object obj = getExtension(PKIXExtensions.IssuerAlternativeName_Id);
return (IssuerAlternativeNameExtension)obj;
} | [
"public",
"IssuerAlternativeNameExtension",
"getIssuerAltNameExtension",
"(",
")",
"throws",
"IOException",
"{",
"Object",
"obj",
"=",
"getExtension",
"(",
"PKIXExtensions",
".",
"IssuerAlternativeName_Id",
")",
";",
"return",
"(",
"IssuerAlternativeNameExtension",
")",
"... | return the IssuerAlternativeNameExtension, if any.
@returns IssuerAlternativeNameExtension or null (if no such extension)
@throws IOException on error | [
"return",
"the",
"IssuerAlternativeNameExtension",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L869-L873 |
33,729 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getIssuingDistributionPointExtension | public IssuingDistributionPointExtension
getIssuingDistributionPointExtension() throws IOException {
Object obj = getExtension(PKIXExtensions.IssuingDistributionPoint_Id);
return (IssuingDistributionPointExtension) obj;
} | java | public IssuingDistributionPointExtension
getIssuingDistributionPointExtension() throws IOException {
Object obj = getExtension(PKIXExtensions.IssuingDistributionPoint_Id);
return (IssuingDistributionPointExtension) obj;
} | [
"public",
"IssuingDistributionPointExtension",
"getIssuingDistributionPointExtension",
"(",
")",
"throws",
"IOException",
"{",
"Object",
"obj",
"=",
"getExtension",
"(",
"PKIXExtensions",
".",
"IssuingDistributionPoint_Id",
")",
";",
"return",
"(",
"IssuingDistributionPointEx... | return the IssuingDistributionPointExtension, if any.
@returns IssuingDistributionPointExtension or null
(if no such extension)
@throws IOException on error | [
"return",
"the",
"IssuingDistributionPointExtension",
"if",
"any",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L882-L887 |
33,730 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getIssuerX500Principal | public static X500Principal getIssuerX500Principal(X509CRL crl) {
try {
byte[] encoded = crl.getEncoded();
DerInputStream derIn = new DerInputStream(encoded);
DerValue tbsCert = derIn.getSequence(3)[0];
DerInputStream tbsIn = tbsCert.data;
DerValue tmp;
// skip version number if present
byte nextByte = (byte)tbsIn.peekByte();
if (nextByte == DerValue.tag_Integer) {
tmp = tbsIn.getDerValue();
}
tmp = tbsIn.getDerValue(); // skip signature
tmp = tbsIn.getDerValue(); // issuer
byte[] principalBytes = tmp.toByteArray();
return new X500Principal(principalBytes);
} catch (Exception e) {
throw new RuntimeException("Could not parse issuer", e);
}
} | java | public static X500Principal getIssuerX500Principal(X509CRL crl) {
try {
byte[] encoded = crl.getEncoded();
DerInputStream derIn = new DerInputStream(encoded);
DerValue tbsCert = derIn.getSequence(3)[0];
DerInputStream tbsIn = tbsCert.data;
DerValue tmp;
// skip version number if present
byte nextByte = (byte)tbsIn.peekByte();
if (nextByte == DerValue.tag_Integer) {
tmp = tbsIn.getDerValue();
}
tmp = tbsIn.getDerValue(); // skip signature
tmp = tbsIn.getDerValue(); // issuer
byte[] principalBytes = tmp.toByteArray();
return new X500Principal(principalBytes);
} catch (Exception e) {
throw new RuntimeException("Could not parse issuer", e);
}
} | [
"public",
"static",
"X500Principal",
"getIssuerX500Principal",
"(",
"X509CRL",
"crl",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"encoded",
"=",
"crl",
".",
"getEncoded",
"(",
")",
";",
"DerInputStream",
"derIn",
"=",
"new",
"DerInputStream",
"(",
"encoded",
")... | Extract the issuer X500Principal from an X509CRL. Parses the encoded
form of the CRL to preserve the principal's ASN.1 encoding.
Called by java.security.cert.X509CRL.getIssuerX500Principal(). | [
"Extract",
"the",
"issuer",
"X500Principal",
"from",
"an",
"X509CRL",
".",
"Parses",
"the",
"encoded",
"form",
"of",
"the",
"CRL",
"to",
"preserve",
"the",
"principal",
"s",
"ASN",
".",
"1",
"encoding",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L1131-L1152 |
33,731 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.toImpl | public static X509CRLImpl toImpl(X509CRL crl)
throws CRLException {
if (crl instanceof X509CRLImpl) {
return (X509CRLImpl)crl;
} else {
return X509Factory.intern(crl);
}
} | java | public static X509CRLImpl toImpl(X509CRL crl)
throws CRLException {
if (crl instanceof X509CRLImpl) {
return (X509CRLImpl)crl;
} else {
return X509Factory.intern(crl);
}
} | [
"public",
"static",
"X509CRLImpl",
"toImpl",
"(",
"X509CRL",
"crl",
")",
"throws",
"CRLException",
"{",
"if",
"(",
"crl",
"instanceof",
"X509CRLImpl",
")",
"{",
"return",
"(",
"X509CRLImpl",
")",
"crl",
";",
"}",
"else",
"{",
"return",
"X509Factory",
".",
... | Utility method to convert an arbitrary instance of X509CRL
to a X509CRLImpl. Does a cast if possible, otherwise reparses
the encoding. | [
"Utility",
"method",
"to",
"convert",
"an",
"arbitrary",
"instance",
"of",
"X509CRL",
"to",
"a",
"X509CRLImpl",
".",
"Does",
"a",
"cast",
"if",
"possible",
"otherwise",
"reparses",
"the",
"encoding",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L1173-L1180 |
33,732 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java | X509CRLImpl.getCertIssuer | private X500Principal getCertIssuer(X509CRLEntryImpl entry,
X500Principal prevCertIssuer) throws IOException {
CertificateIssuerExtension ciExt =
entry.getCertificateIssuerExtension();
if (ciExt != null) {
GeneralNames names = ciExt.get(CertificateIssuerExtension.ISSUER);
X500Name issuerDN = (X500Name) names.get(0).getName();
return issuerDN.asX500Principal();
} else {
return prevCertIssuer;
}
} | java | private X500Principal getCertIssuer(X509CRLEntryImpl entry,
X500Principal prevCertIssuer) throws IOException {
CertificateIssuerExtension ciExt =
entry.getCertificateIssuerExtension();
if (ciExt != null) {
GeneralNames names = ciExt.get(CertificateIssuerExtension.ISSUER);
X500Name issuerDN = (X500Name) names.get(0).getName();
return issuerDN.asX500Principal();
} else {
return prevCertIssuer;
}
} | [
"private",
"X500Principal",
"getCertIssuer",
"(",
"X509CRLEntryImpl",
"entry",
",",
"X500Principal",
"prevCertIssuer",
")",
"throws",
"IOException",
"{",
"CertificateIssuerExtension",
"ciExt",
"=",
"entry",
".",
"getCertificateIssuerExtension",
"(",
")",
";",
"if",
"(",... | Returns the X500 certificate issuer DN of a CRL entry.
@param entry the entry to check
@param prevCertIssuer the previous entry's certificate issuer
@return the X500Principal in a CertificateIssuerExtension, or
prevCertIssuer if it does not exist | [
"Returns",
"the",
"X500",
"certificate",
"issuer",
"DN",
"of",
"a",
"CRL",
"entry",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java#L1190-L1202 |
33,733 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_32.java | Trie2_32.get | @Override
public final int get(int codePoint) {
int value;
int ix;
if (codePoint >= 0) {
if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {
// Ordinary BMP code point, excluding leading surrogates.
// BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
// 32 bit data is stored in the index array itself.
ix = index[codePoint >> UTRIE2_SHIFT_2];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
}
if (codePoint <= 0xffff) {
// Lead Surrogate Code Point. A Separate index section is stored for
// lead surrogate code units and code points.
// The main index has the code unit data.
// For this function, we need the code point data.
// Note: this expression could be refactored for slightly improved efficiency, but
// surrogate code points will be so rare in practice that it's not worth it.
ix = index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
}
if (codePoint < highStart) {
// Supplemental code point, use two-level lookup.
ix = (UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> UTRIE2_SHIFT_1);
ix = index[ix];
ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;
ix = index[ix];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
}
if (codePoint <= 0x10ffff) {
value = data32[highValueIndex];
return value;
}
}
// Fall through. The code point is outside of the legal range of 0..0x10ffff.
return errorValue;
} | java | @Override
public final int get(int codePoint) {
int value;
int ix;
if (codePoint >= 0) {
if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {
// Ordinary BMP code point, excluding leading surrogates.
// BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
// 32 bit data is stored in the index array itself.
ix = index[codePoint >> UTRIE2_SHIFT_2];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
}
if (codePoint <= 0xffff) {
// Lead Surrogate Code Point. A Separate index section is stored for
// lead surrogate code units and code points.
// The main index has the code unit data.
// For this function, we need the code point data.
// Note: this expression could be refactored for slightly improved efficiency, but
// surrogate code points will be so rare in practice that it's not worth it.
ix = index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
}
if (codePoint < highStart) {
// Supplemental code point, use two-level lookup.
ix = (UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> UTRIE2_SHIFT_1);
ix = index[ix];
ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;
ix = index[ix];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
}
if (codePoint <= 0x10ffff) {
value = data32[highValueIndex];
return value;
}
}
// Fall through. The code point is outside of the legal range of 0..0x10ffff.
return errorValue;
} | [
"@",
"Override",
"public",
"final",
"int",
"get",
"(",
"int",
"codePoint",
")",
"{",
"int",
"value",
";",
"int",
"ix",
";",
"if",
"(",
"codePoint",
">=",
"0",
")",
"{",
"if",
"(",
"codePoint",
"<",
"0x0d800",
"||",
"(",
"codePoint",
">",
"0x0dbff",
... | Get the value for a code point as stored in the Trie2.
@param codePoint the code point
@return the value | [
"Get",
"the",
"value",
"for",
"a",
"code",
"point",
"as",
"stored",
"in",
"the",
"Trie2",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_32.java#L68-L113 |
33,734 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_32.java | Trie2_32.getFromU16SingleLead | @Override
public int getFromU16SingleLead(char codeUnit){
int value;
int ix;
ix = index[codeUnit >> UTRIE2_SHIFT_2];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codeUnit & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
} | java | @Override
public int getFromU16SingleLead(char codeUnit){
int value;
int ix;
ix = index[codeUnit >> UTRIE2_SHIFT_2];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codeUnit & UTRIE2_DATA_MASK);
value = data32[ix];
return value;
} | [
"@",
"Override",
"public",
"int",
"getFromU16SingleLead",
"(",
"char",
"codeUnit",
")",
"{",
"int",
"value",
";",
"int",
"ix",
";",
"ix",
"=",
"index",
"[",
"codeUnit",
">>",
"UTRIE2_SHIFT_2",
"]",
";",
"ix",
"=",
"(",
"ix",
"<<",
"UTRIE2_INDEX_SHIFT",
"... | Get a Trie2 value for a UTF-16 code unit.
This function returns the same value as get() if the input
character is outside of the lead surrogate range
There are two values stored in a Trie2 for inputs in the lead
surrogate range. This function returns the alternate value,
while Trie2.get() returns the main value.
@param codeUnit a 16 bit code unit or lead surrogate value.
@return the value | [
"Get",
"a",
"Trie2",
"value",
"for",
"a",
"UTF",
"-",
"16",
"code",
"unit",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_32.java#L129-L139 |
33,735 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_32.java | Trie2_32.serialize | public int serialize(OutputStream os) throws IOException {
DataOutputStream dos = new DataOutputStream(os);
int bytesWritten = 0;
bytesWritten += serializeHeader(dos);
for (int i=0; i<dataLength; i++) {
dos.writeInt(data32[i]);
}
bytesWritten += dataLength*4;
return bytesWritten;
} | java | public int serialize(OutputStream os) throws IOException {
DataOutputStream dos = new DataOutputStream(os);
int bytesWritten = 0;
bytesWritten += serializeHeader(dos);
for (int i=0; i<dataLength; i++) {
dos.writeInt(data32[i]);
}
bytesWritten += dataLength*4;
return bytesWritten;
} | [
"public",
"int",
"serialize",
"(",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"DataOutputStream",
"dos",
"=",
"new",
"DataOutputStream",
"(",
"os",
")",
";",
"int",
"bytesWritten",
"=",
"0",
";",
"bytesWritten",
"+=",
"serializeHeader",
"(",
"dos... | Serialize a Trie2_32 onto an OutputStream.
A Trie2 can be serialized multiple times.
The serialized data is compatible with ICU4C UTrie2 serialization.
Trie2 serialization is unrelated to Java object serialization.
@param os the stream to which the serialized Trie2 data will be written.
@return the number of bytes written.
@throw IOException on an error writing to the OutputStream. | [
"Serialize",
"a",
"Trie2_32",
"onto",
"an",
"OutputStream",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_32.java#L152-L162 |
33,736 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java | UnionPathIterator.addIterator | public void addIterator(DTMIterator expr)
{
// Increase array size by only 1 at a time. Fix this
// if it looks to be a problem.
if (null == m_iterators)
{
m_iterators = new DTMIterator[1];
m_iterators[0] = expr;
}
else
{
DTMIterator[] exprs = m_iterators;
int len = m_iterators.length;
m_iterators = new DTMIterator[len + 1];
System.arraycopy(exprs, 0, m_iterators, 0, len);
m_iterators[len] = expr;
}
expr.nextNode();
if(expr instanceof Expression)
((Expression)expr).exprSetParent(this);
} | java | public void addIterator(DTMIterator expr)
{
// Increase array size by only 1 at a time. Fix this
// if it looks to be a problem.
if (null == m_iterators)
{
m_iterators = new DTMIterator[1];
m_iterators[0] = expr;
}
else
{
DTMIterator[] exprs = m_iterators;
int len = m_iterators.length;
m_iterators = new DTMIterator[len + 1];
System.arraycopy(exprs, 0, m_iterators, 0, len);
m_iterators[len] = expr;
}
expr.nextNode();
if(expr instanceof Expression)
((Expression)expr).exprSetParent(this);
} | [
"public",
"void",
"addIterator",
"(",
"DTMIterator",
"expr",
")",
"{",
"// Increase array size by only 1 at a time. Fix this",
"// if it looks to be a problem.",
"if",
"(",
"null",
"==",
"m_iterators",
")",
"{",
"m_iterators",
"=",
"new",
"DTMIterator",
"[",
"1",
"]",
... | Add an iterator to the union list.
@param expr non-null reference to a location path iterator. | [
"Add",
"an",
"iterator",
"to",
"the",
"union",
"list",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java#L98-L122 |
33,737 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java | UnionPathIterator.createUnionIterator | public static LocPathIterator createUnionIterator(Compiler compiler, int opPos)
throws javax.xml.transform.TransformerException
{
// For the moment, I'm going to first create a full UnionPathIterator, and
// then see if I can reduce it to a UnionChildIterator. It would obviously
// be more effecient to just test for the conditions for a UnionChildIterator,
// and then create that directly.
UnionPathIterator upi = new UnionPathIterator(compiler, opPos);
int nPaths = upi.m_exprs.length;
boolean isAllChildIterators = true;
for(int i = 0; i < nPaths; i++)
{
LocPathIterator lpi = upi.m_exprs[i];
if(lpi.getAxis() != Axis.CHILD)
{
isAllChildIterators = false;
break;
}
else
{
// check for positional predicates or position function, which won't work.
if(HasPositionalPredChecker.check(lpi))
{
isAllChildIterators = false;
break;
}
}
}
if(isAllChildIterators)
{
UnionChildIterator uci = new UnionChildIterator();
for(int i = 0; i < nPaths; i++)
{
PredicatedNodeTest lpi = upi.m_exprs[i];
// I could strip the lpi down to a pure PredicatedNodeTest, but
// I don't think it's worth it. Note that the test can be used
// as a static object... so it doesn't have to be cloned.
uci.addNodeTest(lpi);
}
return uci;
}
else
return upi;
} | java | public static LocPathIterator createUnionIterator(Compiler compiler, int opPos)
throws javax.xml.transform.TransformerException
{
// For the moment, I'm going to first create a full UnionPathIterator, and
// then see if I can reduce it to a UnionChildIterator. It would obviously
// be more effecient to just test for the conditions for a UnionChildIterator,
// and then create that directly.
UnionPathIterator upi = new UnionPathIterator(compiler, opPos);
int nPaths = upi.m_exprs.length;
boolean isAllChildIterators = true;
for(int i = 0; i < nPaths; i++)
{
LocPathIterator lpi = upi.m_exprs[i];
if(lpi.getAxis() != Axis.CHILD)
{
isAllChildIterators = false;
break;
}
else
{
// check for positional predicates or position function, which won't work.
if(HasPositionalPredChecker.check(lpi))
{
isAllChildIterators = false;
break;
}
}
}
if(isAllChildIterators)
{
UnionChildIterator uci = new UnionChildIterator();
for(int i = 0; i < nPaths; i++)
{
PredicatedNodeTest lpi = upi.m_exprs[i];
// I could strip the lpi down to a pure PredicatedNodeTest, but
// I don't think it's worth it. Note that the test can be used
// as a static object... so it doesn't have to be cloned.
uci.addNodeTest(lpi);
}
return uci;
}
else
return upi;
} | [
"public",
"static",
"LocPathIterator",
"createUnionIterator",
"(",
"Compiler",
"compiler",
",",
"int",
"opPos",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"// For the moment, I'm going to first create a full UnionPathIterator, and ... | This will return an iterator capable of handling the union of paths given.
@param compiler The Compiler which is creating
this expression.
@param opPos The position of this iterator in the
opcode list from the compiler.
@return Object that is derived from LocPathIterator.
@throws javax.xml.transform.TransformerException | [
"This",
"will",
"return",
"an",
"iterator",
"capable",
"of",
"handling",
"the",
"union",
"of",
"paths",
"given",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java#L179-L225 |
33,738 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java | UnionPathIterator.createDTMIterator | protected LocPathIterator createDTMIterator(
Compiler compiler, int opPos) throws javax.xml.transform.TransformerException
{
LocPathIterator lpi = (LocPathIterator)WalkerFactory.newDTMIterator(compiler, opPos,
(compiler.getLocationPathDepth() <= 0));
return lpi;
} | java | protected LocPathIterator createDTMIterator(
Compiler compiler, int opPos) throws javax.xml.transform.TransformerException
{
LocPathIterator lpi = (LocPathIterator)WalkerFactory.newDTMIterator(compiler, opPos,
(compiler.getLocationPathDepth() <= 0));
return lpi;
} | [
"protected",
"LocPathIterator",
"createDTMIterator",
"(",
"Compiler",
"compiler",
",",
"int",
"opPos",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"LocPathIterator",
"lpi",
"=",
"(",
"LocPathIterator",
")",
"WalkerFactory"... | Create a new location path iterator.
@param compiler The Compiler which is creating
this expression.
@param opPos The position of this iterator in the
@return New location path iterator.
@throws javax.xml.transform.TransformerException | [
"Create",
"a",
"new",
"location",
"path",
"iterator",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java#L310-L316 |
33,739 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java | UnionPathIterator.loadLocationPaths | protected void loadLocationPaths(Compiler compiler, int opPos, int count)
throws javax.xml.transform.TransformerException
{
// TODO: Handle unwrapped FilterExpr
int steptype = compiler.getOp(opPos);
if (steptype == OpCodes.OP_LOCATIONPATH)
{
loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
m_exprs[count] = createDTMIterator(compiler, opPos);
m_exprs[count].exprSetParent(this);
}
else
{
// Have to check for unwrapped functions, which the LocPathIterator
// doesn't handle.
switch (steptype)
{
case OpCodes.OP_VARIABLE :
case OpCodes.OP_EXTFUNCTION :
case OpCodes.OP_FUNCTION :
case OpCodes.OP_GROUP :
loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
WalkingIterator iter =
new WalkingIterator(compiler.getNamespaceContext());
iter.exprSetParent(this);
if(compiler.getLocationPathDepth() <= 0)
iter.setIsTopLevel(true);
iter.m_firstWalker = new org.apache.xpath.axes.FilterExprWalker(iter);
iter.m_firstWalker.init(compiler, opPos, steptype);
m_exprs[count] = iter;
break;
default :
m_exprs = new LocPathIterator[count];
}
}
} | java | protected void loadLocationPaths(Compiler compiler, int opPos, int count)
throws javax.xml.transform.TransformerException
{
// TODO: Handle unwrapped FilterExpr
int steptype = compiler.getOp(opPos);
if (steptype == OpCodes.OP_LOCATIONPATH)
{
loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
m_exprs[count] = createDTMIterator(compiler, opPos);
m_exprs[count].exprSetParent(this);
}
else
{
// Have to check for unwrapped functions, which the LocPathIterator
// doesn't handle.
switch (steptype)
{
case OpCodes.OP_VARIABLE :
case OpCodes.OP_EXTFUNCTION :
case OpCodes.OP_FUNCTION :
case OpCodes.OP_GROUP :
loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
WalkingIterator iter =
new WalkingIterator(compiler.getNamespaceContext());
iter.exprSetParent(this);
if(compiler.getLocationPathDepth() <= 0)
iter.setIsTopLevel(true);
iter.m_firstWalker = new org.apache.xpath.axes.FilterExprWalker(iter);
iter.m_firstWalker.init(compiler, opPos, steptype);
m_exprs[count] = iter;
break;
default :
m_exprs = new LocPathIterator[count];
}
}
} | [
"protected",
"void",
"loadLocationPaths",
"(",
"Compiler",
"compiler",
",",
"int",
"opPos",
",",
"int",
"count",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"// TODO: Handle unwrapped FilterExpr",
"int",
"steptype",
"=",
... | Initialize the location path iterators. Recursive.
@param compiler The Compiler which is creating
this expression.
@param opPos The position of this iterator in the
opcode list from the compiler.
@param count The insert position of the iterator.
@throws javax.xml.transform.TransformerException | [
"Initialize",
"the",
"location",
"path",
"iterators",
".",
"Recursive",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java#L329-L373 |
33,740 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/reflect/Reflection.java | Reflection.isSameClassPackage | private static boolean isSameClassPackage(ClassLoader loader1, String name1,
ClassLoader loader2, String name2)
{
if (loader1 != loader2) {
return false;
} else {
int lastDot1 = name1.lastIndexOf('.');
int lastDot2 = name2.lastIndexOf('.');
if ((lastDot1 == -1) || (lastDot2 == -1)) {
// One of the two doesn't have a package. Only return true
// if the other one also doesn't have a package.
return (lastDot1 == lastDot2);
} else {
int idx1 = 0;
int idx2 = 0;
// Skip over '['s
if (name1.charAt(idx1) == '[') {
do {
idx1++;
} while (name1.charAt(idx1) == '[');
if (name1.charAt(idx1) != 'L') {
// Something is terribly wrong. Shouldn't be here.
throw new InternalError("Illegal class name " + name1);
}
}
if (name2.charAt(idx2) == '[') {
do {
idx2++;
} while (name2.charAt(idx2) == '[');
if (name2.charAt(idx2) != 'L') {
// Something is terribly wrong. Shouldn't be here.
throw new InternalError("Illegal class name " + name2);
}
}
// Check that package part is identical
int length1 = lastDot1 - idx1;
int length2 = lastDot2 - idx2;
if (length1 != length2) {
return false;
}
return name1.regionMatches(false, idx1, name2, idx2, length1);
}
}
} | java | private static boolean isSameClassPackage(ClassLoader loader1, String name1,
ClassLoader loader2, String name2)
{
if (loader1 != loader2) {
return false;
} else {
int lastDot1 = name1.lastIndexOf('.');
int lastDot2 = name2.lastIndexOf('.');
if ((lastDot1 == -1) || (lastDot2 == -1)) {
// One of the two doesn't have a package. Only return true
// if the other one also doesn't have a package.
return (lastDot1 == lastDot2);
} else {
int idx1 = 0;
int idx2 = 0;
// Skip over '['s
if (name1.charAt(idx1) == '[') {
do {
idx1++;
} while (name1.charAt(idx1) == '[');
if (name1.charAt(idx1) != 'L') {
// Something is terribly wrong. Shouldn't be here.
throw new InternalError("Illegal class name " + name1);
}
}
if (name2.charAt(idx2) == '[') {
do {
idx2++;
} while (name2.charAt(idx2) == '[');
if (name2.charAt(idx2) != 'L') {
// Something is terribly wrong. Shouldn't be here.
throw new InternalError("Illegal class name " + name2);
}
}
// Check that package part is identical
int length1 = lastDot1 - idx1;
int length2 = lastDot2 - idx2;
if (length1 != length2) {
return false;
}
return name1.regionMatches(false, idx1, name2, idx2, length1);
}
}
} | [
"private",
"static",
"boolean",
"isSameClassPackage",
"(",
"ClassLoader",
"loader1",
",",
"String",
"name1",
",",
"ClassLoader",
"loader2",
",",
"String",
"name2",
")",
"{",
"if",
"(",
"loader1",
"!=",
"loader2",
")",
"{",
"return",
"false",
";",
"}",
"else"... | Returns true if two classes are in the same package; classloader
and classname information is enough to determine a class's package | [
"Returns",
"true",
"if",
"two",
"classes",
"are",
"in",
"the",
"same",
"package",
";",
"classloader",
"and",
"classname",
"information",
"is",
"enough",
"to",
"determine",
"a",
"class",
"s",
"package"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/reflect/Reflection.java#L146-L192 |
33,741 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TaiwanCalendar.java | TaiwanCalendar.handleGetLimit | protected int handleGetLimit(int field, int limitType) {
if (field == ERA) {
if (limitType == MINIMUM || limitType == GREATEST_MINIMUM) {
return BEFORE_MINGUO;
} else {
return MINGUO;
}
}
return super.handleGetLimit(field, limitType);
} | java | protected int handleGetLimit(int field, int limitType) {
if (field == ERA) {
if (limitType == MINIMUM || limitType == GREATEST_MINIMUM) {
return BEFORE_MINGUO;
} else {
return MINGUO;
}
}
return super.handleGetLimit(field, limitType);
} | [
"protected",
"int",
"handleGetLimit",
"(",
"int",
"field",
",",
"int",
"limitType",
")",
"{",
"if",
"(",
"field",
"==",
"ERA",
")",
"{",
"if",
"(",
"limitType",
"==",
"MINIMUM",
"||",
"limitType",
"==",
"GREATEST_MINIMUM",
")",
"{",
"return",
"BEFORE_MINGU... | Override GregorianCalendar. There is only one Taiwan ERA. We
should really handle YEAR, YEAR_WOY, and EXTENDED_YEAR here too to
implement the 1..5000000 range, but it's not critical. | [
"Override",
"GregorianCalendar",
".",
"There",
"is",
"only",
"one",
"Taiwan",
"ERA",
".",
"We",
"should",
"really",
"handle",
"YEAR",
"YEAR_WOY",
"and",
"EXTENDED_YEAR",
"here",
"too",
"to",
"implement",
"the",
"1",
"..",
"5000000",
"range",
"but",
"it",
"s"... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TaiwanCalendar.java#L221-L230 |
33,742 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TrAXFilter.java | TrAXFilter.setParent | public void setParent (XMLReader parent)
{
super.setParent(parent);
if(null != parent.getContentHandler())
this.setContentHandler(parent.getContentHandler());
// Not really sure if we should do this here, but
// it seems safer in case someone calls parse() on
// the parent.
setupParse ();
} | java | public void setParent (XMLReader parent)
{
super.setParent(parent);
if(null != parent.getContentHandler())
this.setContentHandler(parent.getContentHandler());
// Not really sure if we should do this here, but
// it seems safer in case someone calls parse() on
// the parent.
setupParse ();
} | [
"public",
"void",
"setParent",
"(",
"XMLReader",
"parent",
")",
"{",
"super",
".",
"setParent",
"(",
"parent",
")",
";",
"if",
"(",
"null",
"!=",
"parent",
".",
"getContentHandler",
"(",
")",
")",
"this",
".",
"setContentHandler",
"(",
"parent",
".",
"ge... | Set the parent reader.
<p>This is the {@link org.xml.sax.XMLReader XMLReader} from which
this filter will obtain its events and to which it will pass its
configuration requests. The parent may itself be another filter.</p>
<p>If there is no parent reader set, any attempt to parse
or to set or get a feature or property will fail.</p>
@param parent The parent XML reader.
@throws java.lang.NullPointerException If the parent is null. | [
"Set",
"the",
"parent",
"reader",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TrAXFilter.java#L84-L95 |
33,743 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/AbstractPollSelectorImpl.java | AbstractPollSelectorImpl.updateSelectedKeys | protected int updateSelectedKeys() {
int numKeysUpdated = 0;
// Skip zeroth entry; it is for interrupts only
for (int i=channelOffset; i<totalChannels; i++) {
int rOps = pollWrapper.getReventOps(i);
if (rOps != 0) {
SelectionKeyImpl sk = channelArray[i];
pollWrapper.putReventOps(i, 0);
if (selectedKeys.contains(sk)) {
if (sk.channel.translateAndSetReadyOps(rOps, sk)) {
numKeysUpdated++;
}
} else {
sk.channel.translateAndSetReadyOps(rOps, sk);
if ((sk.nioReadyOps() & sk.nioInterestOps()) != 0) {
selectedKeys.add(sk);
numKeysUpdated++;
}
}
}
}
return numKeysUpdated;
} | java | protected int updateSelectedKeys() {
int numKeysUpdated = 0;
// Skip zeroth entry; it is for interrupts only
for (int i=channelOffset; i<totalChannels; i++) {
int rOps = pollWrapper.getReventOps(i);
if (rOps != 0) {
SelectionKeyImpl sk = channelArray[i];
pollWrapper.putReventOps(i, 0);
if (selectedKeys.contains(sk)) {
if (sk.channel.translateAndSetReadyOps(rOps, sk)) {
numKeysUpdated++;
}
} else {
sk.channel.translateAndSetReadyOps(rOps, sk);
if ((sk.nioReadyOps() & sk.nioInterestOps()) != 0) {
selectedKeys.add(sk);
numKeysUpdated++;
}
}
}
}
return numKeysUpdated;
} | [
"protected",
"int",
"updateSelectedKeys",
"(",
")",
"{",
"int",
"numKeysUpdated",
"=",
"0",
";",
"// Skip zeroth entry; it is for interrupts only",
"for",
"(",
"int",
"i",
"=",
"channelOffset",
";",
"i",
"<",
"totalChannels",
";",
"i",
"++",
")",
"{",
"int",
"... | Copy the information in the pollfd structs into the opss
of the corresponding Channels. Add the ready keys to the
ready queue. | [
"Copy",
"the",
"information",
"in",
"the",
"pollfd",
"structs",
"into",
"the",
"opss",
"of",
"the",
"corresponding",
"Channels",
".",
"Add",
"the",
"ready",
"keys",
"to",
"the",
"ready",
"queue",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/AbstractPollSelectorImpl.java#L114-L136 |
33,744 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.enq | private Node enq(Node node) {
for (;;) {
Node oldTail = tail;
if (oldTail != null) {
U.putObject(node, Node.PREV, oldTail);
if (compareAndSetTail(oldTail, node)) {
oldTail.next = node;
return oldTail;
}
} else {
initializeSyncQueue();
}
}
} | java | private Node enq(Node node) {
for (;;) {
Node oldTail = tail;
if (oldTail != null) {
U.putObject(node, Node.PREV, oldTail);
if (compareAndSetTail(oldTail, node)) {
oldTail.next = node;
return oldTail;
}
} else {
initializeSyncQueue();
}
}
} | [
"private",
"Node",
"enq",
"(",
"Node",
"node",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"Node",
"oldTail",
"=",
"tail",
";",
"if",
"(",
"oldTail",
"!=",
"null",
")",
"{",
"U",
".",
"putObject",
"(",
"node",
",",
"Node",
".",
"PREV",
",",
"oldT... | Inserts node into queue, initializing if necessary. See picture above.
@param node the node to insert
@return node's predecessor | [
"Inserts",
"node",
"into",
"queue",
"initializing",
"if",
"necessary",
".",
"See",
"picture",
"above",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L618-L631 |
33,745 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.addWaiter | private Node addWaiter(Node mode) {
Node node = new Node(mode);
for (;;) {
Node oldTail = tail;
if (oldTail != null) {
U.putObject(node, Node.PREV, oldTail);
if (compareAndSetTail(oldTail, node)) {
oldTail.next = node;
return node;
}
} else {
initializeSyncQueue();
}
}
} | java | private Node addWaiter(Node mode) {
Node node = new Node(mode);
for (;;) {
Node oldTail = tail;
if (oldTail != null) {
U.putObject(node, Node.PREV, oldTail);
if (compareAndSetTail(oldTail, node)) {
oldTail.next = node;
return node;
}
} else {
initializeSyncQueue();
}
}
} | [
"private",
"Node",
"addWaiter",
"(",
"Node",
"mode",
")",
"{",
"Node",
"node",
"=",
"new",
"Node",
"(",
"mode",
")",
";",
"for",
"(",
";",
";",
")",
"{",
"Node",
"oldTail",
"=",
"tail",
";",
"if",
"(",
"oldTail",
"!=",
"null",
")",
"{",
"U",
".... | Creates and enqueues node for current thread and given mode.
@param mode Node.EXCLUSIVE for exclusive, Node.SHARED for shared
@return the new node | [
"Creates",
"and",
"enqueues",
"node",
"for",
"current",
"thread",
"and",
"given",
"mode",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L639-L654 |
33,746 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.setHead | private void setHead(Node node) {
head = node;
node.thread = null;
node.prev = null;
} | java | private void setHead(Node node) {
head = node;
node.thread = null;
node.prev = null;
} | [
"private",
"void",
"setHead",
"(",
"Node",
"node",
")",
"{",
"head",
"=",
"node",
";",
"node",
".",
"thread",
"=",
"null",
";",
"node",
".",
"prev",
"=",
"null",
";",
"}"
] | Sets head of queue to be node, thus dequeuing. Called only by
acquire methods. Also nulls out unused fields for sake of GC
and to suppress unnecessary signals and traversals.
@param node the node | [
"Sets",
"head",
"of",
"queue",
"to",
"be",
"node",
"thus",
"dequeuing",
".",
"Called",
"only",
"by",
"acquire",
"methods",
".",
"Also",
"nulls",
"out",
"unused",
"fields",
"for",
"sake",
"of",
"GC",
"and",
"to",
"suppress",
"unnecessary",
"signals",
"and",... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L663-L667 |
33,747 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.unparkSuccessor | private void unparkSuccessor(Node node) {
/*
* If status is negative (i.e., possibly needing signal) try
* to clear in anticipation of signalling. It is OK if this
* fails or if status is changed by waiting thread.
*/
int ws = node.waitStatus;
if (ws < 0)
node.compareAndSetWaitStatus(ws, 0);
/*
* Thread to unpark is held in successor, which is normally
* just the next node. But if cancelled or apparently null,
* traverse backwards from tail to find the actual
* non-cancelled successor.
*/
Node s = node.next;
if (s == null || s.waitStatus > 0) {
s = null;
for (Node p = tail; p != node && p != null; p = p.prev)
if (p.waitStatus <= 0)
s = p;
}
if (s != null)
LockSupport.unpark(s.thread);
} | java | private void unparkSuccessor(Node node) {
/*
* If status is negative (i.e., possibly needing signal) try
* to clear in anticipation of signalling. It is OK if this
* fails or if status is changed by waiting thread.
*/
int ws = node.waitStatus;
if (ws < 0)
node.compareAndSetWaitStatus(ws, 0);
/*
* Thread to unpark is held in successor, which is normally
* just the next node. But if cancelled or apparently null,
* traverse backwards from tail to find the actual
* non-cancelled successor.
*/
Node s = node.next;
if (s == null || s.waitStatus > 0) {
s = null;
for (Node p = tail; p != node && p != null; p = p.prev)
if (p.waitStatus <= 0)
s = p;
}
if (s != null)
LockSupport.unpark(s.thread);
} | [
"private",
"void",
"unparkSuccessor",
"(",
"Node",
"node",
")",
"{",
"/*\n * If status is negative (i.e., possibly needing signal) try\n * to clear in anticipation of signalling. It is OK if this\n * fails or if status is changed by waiting thread.\n */",
"int",
... | Wakes up node's successor, if one exists.
@param node the node | [
"Wakes",
"up",
"node",
"s",
"successor",
"if",
"one",
"exists",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L674-L699 |
33,748 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.cancelAcquire | private void cancelAcquire(Node node) {
// Ignore if node doesn't exist
if (node == null)
return;
node.thread = null;
// Skip cancelled predecessors
Node pred = node.prev;
while (pred.waitStatus > 0)
node.prev = pred = pred.prev;
// predNext is the apparent node to unsplice. CASes below will
// fail if not, in which case, we lost race vs another cancel
// or signal, so no further action is necessary.
Node predNext = pred.next;
// Can use unconditional write instead of CAS here.
// After this atomic step, other Nodes can skip past us.
// Before, we are free of interference from other threads.
node.waitStatus = Node.CANCELLED;
// If we are the tail, remove ourselves.
if (node == tail && compareAndSetTail(node, pred)) {
pred.compareAndSetNext(predNext, null);
} else {
// If successor needs signal, try to set pred's next-link
// so it will get one. Otherwise wake it up to propagate.
int ws;
if (pred != head &&
((ws = pred.waitStatus) == Node.SIGNAL ||
(ws <= 0 && pred.compareAndSetWaitStatus(ws, Node.SIGNAL))) &&
pred.thread != null) {
Node next = node.next;
if (next != null && next.waitStatus <= 0)
pred.compareAndSetNext(predNext, next);
} else {
unparkSuccessor(node);
}
node.next = node; // help GC
}
} | java | private void cancelAcquire(Node node) {
// Ignore if node doesn't exist
if (node == null)
return;
node.thread = null;
// Skip cancelled predecessors
Node pred = node.prev;
while (pred.waitStatus > 0)
node.prev = pred = pred.prev;
// predNext is the apparent node to unsplice. CASes below will
// fail if not, in which case, we lost race vs another cancel
// or signal, so no further action is necessary.
Node predNext = pred.next;
// Can use unconditional write instead of CAS here.
// After this atomic step, other Nodes can skip past us.
// Before, we are free of interference from other threads.
node.waitStatus = Node.CANCELLED;
// If we are the tail, remove ourselves.
if (node == tail && compareAndSetTail(node, pred)) {
pred.compareAndSetNext(predNext, null);
} else {
// If successor needs signal, try to set pred's next-link
// so it will get one. Otherwise wake it up to propagate.
int ws;
if (pred != head &&
((ws = pred.waitStatus) == Node.SIGNAL ||
(ws <= 0 && pred.compareAndSetWaitStatus(ws, Node.SIGNAL))) &&
pred.thread != null) {
Node next = node.next;
if (next != null && next.waitStatus <= 0)
pred.compareAndSetNext(predNext, next);
} else {
unparkSuccessor(node);
}
node.next = node; // help GC
}
} | [
"private",
"void",
"cancelAcquire",
"(",
"Node",
"node",
")",
"{",
"// Ignore if node doesn't exist",
"if",
"(",
"node",
"==",
"null",
")",
"return",
";",
"node",
".",
"thread",
"=",
"null",
";",
"// Skip cancelled predecessors",
"Node",
"pred",
"=",
"node",
"... | Cancels an ongoing attempt to acquire.
@param node the node | [
"Cancels",
"an",
"ongoing",
"attempt",
"to",
"acquire",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L778-L820 |
33,749 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.shouldParkAfterFailedAcquire | private static boolean shouldParkAfterFailedAcquire(Node pred, Node node) {
int ws = pred.waitStatus;
if (ws == Node.SIGNAL)
/*
* This node has already set status asking a release
* to signal it, so it can safely park.
*/
return true;
if (ws > 0) {
/*
* Predecessor was cancelled. Skip over predecessors and
* indicate retry.
*/
do {
node.prev = pred = pred.prev;
} while (pred.waitStatus > 0);
pred.next = node;
} else {
/*
* waitStatus must be 0 or PROPAGATE. Indicate that we
* need a signal, but don't park yet. Caller will need to
* retry to make sure it cannot acquire before parking.
*/
pred.compareAndSetWaitStatus(ws, Node.SIGNAL);
}
return false;
} | java | private static boolean shouldParkAfterFailedAcquire(Node pred, Node node) {
int ws = pred.waitStatus;
if (ws == Node.SIGNAL)
/*
* This node has already set status asking a release
* to signal it, so it can safely park.
*/
return true;
if (ws > 0) {
/*
* Predecessor was cancelled. Skip over predecessors and
* indicate retry.
*/
do {
node.prev = pred = pred.prev;
} while (pred.waitStatus > 0);
pred.next = node;
} else {
/*
* waitStatus must be 0 or PROPAGATE. Indicate that we
* need a signal, but don't park yet. Caller will need to
* retry to make sure it cannot acquire before parking.
*/
pred.compareAndSetWaitStatus(ws, Node.SIGNAL);
}
return false;
} | [
"private",
"static",
"boolean",
"shouldParkAfterFailedAcquire",
"(",
"Node",
"pred",
",",
"Node",
"node",
")",
"{",
"int",
"ws",
"=",
"pred",
".",
"waitStatus",
";",
"if",
"(",
"ws",
"==",
"Node",
".",
"SIGNAL",
")",
"/*\n * This node has already set... | Checks and updates status for a node that failed to acquire.
Returns true if thread should block. This is the main signal
control in all acquire loops. Requires that pred == node.prev.
@param pred node's predecessor holding status
@param node the node
@return {@code true} if thread should block | [
"Checks",
"and",
"updates",
"status",
"for",
"a",
"node",
"that",
"failed",
"to",
"acquire",
".",
"Returns",
"true",
"if",
"thread",
"should",
"block",
".",
"This",
"is",
"the",
"main",
"signal",
"control",
"in",
"all",
"acquire",
"loops",
".",
"Requires",... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L831-L857 |
33,750 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.acquireQueued | final boolean acquireQueued(final Node node, int arg) {
try {
boolean interrupted = false;
for (;;) {
final Node p = node.predecessor();
if (p == head && tryAcquire(arg)) {
setHead(node);
p.next = null; // help GC
return interrupted;
}
if (shouldParkAfterFailedAcquire(p, node) &&
parkAndCheckInterrupt())
interrupted = true;
}
} catch (Throwable t) {
cancelAcquire(node);
throw t;
}
} | java | final boolean acquireQueued(final Node node, int arg) {
try {
boolean interrupted = false;
for (;;) {
final Node p = node.predecessor();
if (p == head && tryAcquire(arg)) {
setHead(node);
p.next = null; // help GC
return interrupted;
}
if (shouldParkAfterFailedAcquire(p, node) &&
parkAndCheckInterrupt())
interrupted = true;
}
} catch (Throwable t) {
cancelAcquire(node);
throw t;
}
} | [
"final",
"boolean",
"acquireQueued",
"(",
"final",
"Node",
"node",
",",
"int",
"arg",
")",
"{",
"try",
"{",
"boolean",
"interrupted",
"=",
"false",
";",
"for",
"(",
";",
";",
")",
"{",
"final",
"Node",
"p",
"=",
"node",
".",
"predecessor",
"(",
")",
... | Acquires in exclusive uninterruptible mode for thread already in
queue. Used by condition wait methods as well as acquire.
@param node the node
@param arg the acquire argument
@return {@code true} if interrupted while waiting | [
"Acquires",
"in",
"exclusive",
"uninterruptible",
"mode",
"for",
"thread",
"already",
"in",
"queue",
".",
"Used",
"by",
"condition",
"wait",
"methods",
"as",
"well",
"as",
"acquire",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L893-L911 |
33,751 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.doAcquireSharedInterruptibly | private void doAcquireSharedInterruptibly(int arg)
throws InterruptedException {
final Node node = addWaiter(Node.SHARED);
try {
for (;;) {
final Node p = node.predecessor();
if (p == head) {
int r = tryAcquireShared(arg);
if (r >= 0) {
setHeadAndPropagate(node, r);
p.next = null; // help GC
return;
}
}
if (shouldParkAfterFailedAcquire(p, node) &&
parkAndCheckInterrupt())
throw new InterruptedException();
}
} catch (Throwable t) {
cancelAcquire(node);
throw t;
}
} | java | private void doAcquireSharedInterruptibly(int arg)
throws InterruptedException {
final Node node = addWaiter(Node.SHARED);
try {
for (;;) {
final Node p = node.predecessor();
if (p == head) {
int r = tryAcquireShared(arg);
if (r >= 0) {
setHeadAndPropagate(node, r);
p.next = null; // help GC
return;
}
}
if (shouldParkAfterFailedAcquire(p, node) &&
parkAndCheckInterrupt())
throw new InterruptedException();
}
} catch (Throwable t) {
cancelAcquire(node);
throw t;
}
} | [
"private",
"void",
"doAcquireSharedInterruptibly",
"(",
"int",
"arg",
")",
"throws",
"InterruptedException",
"{",
"final",
"Node",
"node",
"=",
"addWaiter",
"(",
"Node",
".",
"SHARED",
")",
";",
"try",
"{",
"for",
"(",
";",
";",
")",
"{",
"final",
"Node",
... | Acquires in shared interruptible mode.
@param arg the acquire argument | [
"Acquires",
"in",
"shared",
"interruptible",
"mode",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1010-L1032 |
33,752 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.doAcquireSharedNanos | private boolean doAcquireSharedNanos(int arg, long nanosTimeout)
throws InterruptedException {
if (nanosTimeout <= 0L)
return false;
final long deadline = System.nanoTime() + nanosTimeout;
final Node node = addWaiter(Node.SHARED);
try {
for (;;) {
final Node p = node.predecessor();
if (p == head) {
int r = tryAcquireShared(arg);
if (r >= 0) {
setHeadAndPropagate(node, r);
p.next = null; // help GC
return true;
}
}
nanosTimeout = deadline - System.nanoTime();
if (nanosTimeout <= 0L) {
cancelAcquire(node);
return false;
}
if (shouldParkAfterFailedAcquire(p, node) &&
nanosTimeout > SPIN_FOR_TIMEOUT_THRESHOLD)
LockSupport.parkNanos(this, nanosTimeout);
if (Thread.interrupted())
throw new InterruptedException();
}
} catch (Throwable t) {
cancelAcquire(node);
throw t;
}
} | java | private boolean doAcquireSharedNanos(int arg, long nanosTimeout)
throws InterruptedException {
if (nanosTimeout <= 0L)
return false;
final long deadline = System.nanoTime() + nanosTimeout;
final Node node = addWaiter(Node.SHARED);
try {
for (;;) {
final Node p = node.predecessor();
if (p == head) {
int r = tryAcquireShared(arg);
if (r >= 0) {
setHeadAndPropagate(node, r);
p.next = null; // help GC
return true;
}
}
nanosTimeout = deadline - System.nanoTime();
if (nanosTimeout <= 0L) {
cancelAcquire(node);
return false;
}
if (shouldParkAfterFailedAcquire(p, node) &&
nanosTimeout > SPIN_FOR_TIMEOUT_THRESHOLD)
LockSupport.parkNanos(this, nanosTimeout);
if (Thread.interrupted())
throw new InterruptedException();
}
} catch (Throwable t) {
cancelAcquire(node);
throw t;
}
} | [
"private",
"boolean",
"doAcquireSharedNanos",
"(",
"int",
"arg",
",",
"long",
"nanosTimeout",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"nanosTimeout",
"<=",
"0L",
")",
"return",
"false",
";",
"final",
"long",
"deadline",
"=",
"System",
".",
"nano... | Acquires in shared timed mode.
@param arg the acquire argument
@param nanosTimeout max wait time
@return {@code true} if acquired | [
"Acquires",
"in",
"shared",
"timed",
"mode",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1041-L1073 |
33,753 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.fullGetFirstQueuedThread | private Thread fullGetFirstQueuedThread() {
/*
* The first node is normally head.next. Try to get its
* thread field, ensuring consistent reads: If thread
* field is nulled out or s.prev is no longer head, then
* some other thread(s) concurrently performed setHead in
* between some of our reads. We try this twice before
* resorting to traversal.
*/
Node h, s;
Thread st;
if (((h = head) != null && (s = h.next) != null &&
s.prev == head && (st = s.thread) != null) ||
((h = head) != null && (s = h.next) != null &&
s.prev == head && (st = s.thread) != null))
return st;
/*
* Head's next field might not have been set yet, or may have
* been unset after setHead. So we must check to see if tail
* is actually first node. If not, we continue on, safely
* traversing from tail back to head to find first,
* guaranteeing termination.
*/
Thread firstThread = null;
for (Node p = tail; p != null && p != head; p = p.prev) {
Thread t = p.thread;
if (t != null)
firstThread = t;
}
return firstThread;
} | java | private Thread fullGetFirstQueuedThread() {
/*
* The first node is normally head.next. Try to get its
* thread field, ensuring consistent reads: If thread
* field is nulled out or s.prev is no longer head, then
* some other thread(s) concurrently performed setHead in
* between some of our reads. We try this twice before
* resorting to traversal.
*/
Node h, s;
Thread st;
if (((h = head) != null && (s = h.next) != null &&
s.prev == head && (st = s.thread) != null) ||
((h = head) != null && (s = h.next) != null &&
s.prev == head && (st = s.thread) != null))
return st;
/*
* Head's next field might not have been set yet, or may have
* been unset after setHead. So we must check to see if tail
* is actually first node. If not, we continue on, safely
* traversing from tail back to head to find first,
* guaranteeing termination.
*/
Thread firstThread = null;
for (Node p = tail; p != null && p != head; p = p.prev) {
Thread t = p.thread;
if (t != null)
firstThread = t;
}
return firstThread;
} | [
"private",
"Thread",
"fullGetFirstQueuedThread",
"(",
")",
"{",
"/*\n * The first node is normally head.next. Try to get its\n * thread field, ensuring consistent reads: If thread\n * field is nulled out or s.prev is no longer head, then\n * some other thread(s) concurren... | Version of getFirstQueuedThread called when fastpath fails. | [
"Version",
"of",
"getFirstQueuedThread",
"called",
"when",
"fastpath",
"fails",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1425-L1457 |
33,754 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.isQueued | public final boolean isQueued(Thread thread) {
if (thread == null)
throw new NullPointerException();
for (Node p = tail; p != null; p = p.prev)
if (p.thread == thread)
return true;
return false;
} | java | public final boolean isQueued(Thread thread) {
if (thread == null)
throw new NullPointerException();
for (Node p = tail; p != null; p = p.prev)
if (p.thread == thread)
return true;
return false;
} | [
"public",
"final",
"boolean",
"isQueued",
"(",
"Thread",
"thread",
")",
"{",
"if",
"(",
"thread",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"for",
"(",
"Node",
"p",
"=",
"tail",
";",
"p",
"!=",
"null",
";",
"p",
"=",
... | Returns true if the given thread is currently queued.
<p>This implementation traverses the queue to determine
presence of the given thread.
@param thread the thread
@return {@code true} if the given thread is on the queue
@throws NullPointerException if the thread is null | [
"Returns",
"true",
"if",
"the",
"given",
"thread",
"is",
"currently",
"queued",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1469-L1476 |
33,755 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.hasQueuedPredecessors | public final boolean hasQueuedPredecessors() {
// The correctness of this depends on head being initialized
// before tail and on head.next being accurate if the current
// thread is first in queue.
Node t = tail; // Read fields in reverse initialization order
Node h = head;
Node s;
return h != t &&
((s = h.next) == null || s.thread != Thread.currentThread());
} | java | public final boolean hasQueuedPredecessors() {
// The correctness of this depends on head being initialized
// before tail and on head.next being accurate if the current
// thread is first in queue.
Node t = tail; // Read fields in reverse initialization order
Node h = head;
Node s;
return h != t &&
((s = h.next) == null || s.thread != Thread.currentThread());
} | [
"public",
"final",
"boolean",
"hasQueuedPredecessors",
"(",
")",
"{",
"// The correctness of this depends on head being initialized",
"// before tail and on head.next being accurate if the current",
"// thread is first in queue.",
"Node",
"t",
"=",
"tail",
";",
"// Read fields in rever... | Queries whether any threads have been waiting to acquire longer
than the current thread.
<p>An invocation of this method is equivalent to (but may be
more efficient than):
<pre> {@code
getFirstQueuedThread() != Thread.currentThread()
&& hasQueuedThreads()}</pre>
<p>Note that because cancellations due to interrupts and
timeouts may occur at any time, a {@code true} return does not
guarantee that some other thread will acquire before the current
thread. Likewise, it is possible for another thread to win a
race to enqueue after this method has returned {@code false},
due to the queue being empty.
<p>This method is designed to be used by a fair synchronizer to
avoid <a href="AbstractQueuedSynchronizer.html#barging">barging</a>.
Such a synchronizer's {@link #tryAcquire} method should return
{@code false}, and its {@link #tryAcquireShared} method should
return a negative value, if this method returns {@code true}
(unless this is a reentrant acquire). For example, the {@code
tryAcquire} method for a fair, reentrant, exclusive mode
synchronizer might look like this:
<pre> {@code
protected boolean tryAcquire(int arg) {
if (isHeldExclusively()) {
// A reentrant acquire; increment hold count
return true;
} else if (hasQueuedPredecessors()) {
return false;
} else {
// try to acquire normally
}
}}</pre>
@return {@code true} if there is a queued thread preceding the
current thread, and {@code false} if the current thread
is at the head of the queue or the queue is empty
@since 1.7 | [
"Queries",
"whether",
"any",
"threads",
"have",
"been",
"waiting",
"to",
"acquire",
"longer",
"than",
"the",
"current",
"thread",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1538-L1547 |
33,756 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.getQueueLength | public final int getQueueLength() {
int n = 0;
for (Node p = tail; p != null; p = p.prev) {
if (p.thread != null)
++n;
}
return n;
} | java | public final int getQueueLength() {
int n = 0;
for (Node p = tail; p != null; p = p.prev) {
if (p.thread != null)
++n;
}
return n;
} | [
"public",
"final",
"int",
"getQueueLength",
"(",
")",
"{",
"int",
"n",
"=",
"0",
";",
"for",
"(",
"Node",
"p",
"=",
"tail",
";",
"p",
"!=",
"null",
";",
"p",
"=",
"p",
".",
"prev",
")",
"{",
"if",
"(",
"p",
".",
"thread",
"!=",
"null",
")",
... | Returns an estimate of the number of threads waiting to
acquire. The value is only an estimate because the number of
threads may change dynamically while this method traverses
internal data structures. This method is designed for use in
monitoring system state, not for synchronization control.
@return the estimated number of threads waiting to acquire | [
"Returns",
"an",
"estimate",
"of",
"the",
"number",
"of",
"threads",
"waiting",
"to",
"acquire",
".",
"The",
"value",
"is",
"only",
"an",
"estimate",
"because",
"the",
"number",
"of",
"threads",
"may",
"change",
"dynamically",
"while",
"this",
"method",
"tra... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1561-L1568 |
33,757 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.isOnSyncQueue | final boolean isOnSyncQueue(Node node) {
if (node.waitStatus == Node.CONDITION || node.prev == null)
return false;
if (node.next != null) // If has successor, it must be on queue
return true;
/*
* node.prev can be non-null, but not yet on queue because
* the CAS to place it on queue can fail. So we have to
* traverse from tail to make sure it actually made it. It
* will always be near the tail in calls to this method, and
* unless the CAS failed (which is unlikely), it will be
* there, so we hardly ever traverse much.
*/
return findNodeFromTail(node);
} | java | final boolean isOnSyncQueue(Node node) {
if (node.waitStatus == Node.CONDITION || node.prev == null)
return false;
if (node.next != null) // If has successor, it must be on queue
return true;
/*
* node.prev can be non-null, but not yet on queue because
* the CAS to place it on queue can fail. So we have to
* traverse from tail to make sure it actually made it. It
* will always be near the tail in calls to this method, and
* unless the CAS failed (which is unlikely), it will be
* there, so we hardly ever traverse much.
*/
return findNodeFromTail(node);
} | [
"final",
"boolean",
"isOnSyncQueue",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"node",
".",
"waitStatus",
"==",
"Node",
".",
"CONDITION",
"||",
"node",
".",
"prev",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"node",
".",
"next",
"!=",
"nul... | Returns true if a node, always one that was initially placed on
a condition queue, is now waiting to reacquire on sync queue.
@param node the node
@return true if is reacquiring | [
"Returns",
"true",
"if",
"a",
"node",
"always",
"one",
"that",
"was",
"initially",
"placed",
"on",
"a",
"condition",
"queue",
"is",
"now",
"waiting",
"to",
"reacquire",
"on",
"sync",
"queue",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1655-L1669 |
33,758 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.findNodeFromTail | private boolean findNodeFromTail(Node node) {
// We check for node first, since it's likely to be at or near tail.
// tail is known to be non-null, so we could re-order to "save"
// one null check, but we leave it this way to help the VM.
for (Node p = tail;;) {
if (p == node)
return true;
if (p == null)
return false;
p = p.prev;
}
} | java | private boolean findNodeFromTail(Node node) {
// We check for node first, since it's likely to be at or near tail.
// tail is known to be non-null, so we could re-order to "save"
// one null check, but we leave it this way to help the VM.
for (Node p = tail;;) {
if (p == node)
return true;
if (p == null)
return false;
p = p.prev;
}
} | [
"private",
"boolean",
"findNodeFromTail",
"(",
"Node",
"node",
")",
"{",
"// We check for node first, since it's likely to be at or near tail.",
"// tail is known to be non-null, so we could re-order to \"save\"",
"// one null check, but we leave it this way to help the VM.",
"for",
"(",
"... | Returns true if node is on sync queue by searching backwards from tail.
Called only when needed by isOnSyncQueue.
@return true if present | [
"Returns",
"true",
"if",
"node",
"is",
"on",
"sync",
"queue",
"by",
"searching",
"backwards",
"from",
"tail",
".",
"Called",
"only",
"when",
"needed",
"by",
"isOnSyncQueue",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1676-L1687 |
33,759 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.transferForSignal | final boolean transferForSignal(Node node) {
/*
* If cannot change waitStatus, the node has been cancelled.
*/
if (!node.compareAndSetWaitStatus(Node.CONDITION, 0))
return false;
/*
* Splice onto queue and try to set waitStatus of predecessor to
* indicate that thread is (probably) waiting. If cancelled or
* attempt to set waitStatus fails, wake up to resync (in which
* case the waitStatus can be transiently and harmlessly wrong).
*/
Node p = enq(node);
int ws = p.waitStatus;
if (ws > 0 || !p.compareAndSetWaitStatus(ws, Node.SIGNAL))
LockSupport.unpark(node.thread);
return true;
} | java | final boolean transferForSignal(Node node) {
/*
* If cannot change waitStatus, the node has been cancelled.
*/
if (!node.compareAndSetWaitStatus(Node.CONDITION, 0))
return false;
/*
* Splice onto queue and try to set waitStatus of predecessor to
* indicate that thread is (probably) waiting. If cancelled or
* attempt to set waitStatus fails, wake up to resync (in which
* case the waitStatus can be transiently and harmlessly wrong).
*/
Node p = enq(node);
int ws = p.waitStatus;
if (ws > 0 || !p.compareAndSetWaitStatus(ws, Node.SIGNAL))
LockSupport.unpark(node.thread);
return true;
} | [
"final",
"boolean",
"transferForSignal",
"(",
"Node",
"node",
")",
"{",
"/*\n * If cannot change waitStatus, the node has been cancelled.\n */",
"if",
"(",
"!",
"node",
".",
"compareAndSetWaitStatus",
"(",
"Node",
".",
"CONDITION",
",",
"0",
")",
")",
"r... | Transfers a node from a condition queue onto sync queue.
Returns true if successful.
@param node the node
@return true if successfully transferred (else the node was
cancelled before signal) | [
"Transfers",
"a",
"node",
"from",
"a",
"condition",
"queue",
"onto",
"sync",
"queue",
".",
"Returns",
"true",
"if",
"successful",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1696-L1714 |
33,760 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.transferAfterCancelledWait | final boolean transferAfterCancelledWait(Node node) {
if (node.compareAndSetWaitStatus(Node.CONDITION, 0)) {
enq(node);
return true;
}
/*
* If we lost out to a signal(), then we can't proceed
* until it finishes its enq(). Cancelling during an
* incomplete transfer is both rare and transient, so just
* spin.
*/
while (!isOnSyncQueue(node))
Thread.yield();
return false;
} | java | final boolean transferAfterCancelledWait(Node node) {
if (node.compareAndSetWaitStatus(Node.CONDITION, 0)) {
enq(node);
return true;
}
/*
* If we lost out to a signal(), then we can't proceed
* until it finishes its enq(). Cancelling during an
* incomplete transfer is both rare and transient, so just
* spin.
*/
while (!isOnSyncQueue(node))
Thread.yield();
return false;
} | [
"final",
"boolean",
"transferAfterCancelledWait",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"node",
".",
"compareAndSetWaitStatus",
"(",
"Node",
".",
"CONDITION",
",",
"0",
")",
")",
"{",
"enq",
"(",
"node",
")",
";",
"return",
"true",
";",
"}",
"/*\n ... | Transfers node, if necessary, to sync queue after a cancelled wait.
Returns true if thread was cancelled before being signalled.
@param node the node
@return true if cancelled before the node was signalled | [
"Transfers",
"node",
"if",
"necessary",
"to",
"sync",
"queue",
"after",
"a",
"cancelled",
"wait",
".",
"Returns",
"true",
"if",
"thread",
"was",
"cancelled",
"before",
"being",
"signalled",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1723-L1737 |
33,761 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.getWaitingThreads | public final Collection<Thread> getWaitingThreads(ConditionObject condition) {
if (!owns(condition))
throw new IllegalArgumentException("Not owner");
return condition.getWaitingThreads();
} | java | public final Collection<Thread> getWaitingThreads(ConditionObject condition) {
if (!owns(condition))
throw new IllegalArgumentException("Not owner");
return condition.getWaitingThreads();
} | [
"public",
"final",
"Collection",
"<",
"Thread",
">",
"getWaitingThreads",
"(",
"ConditionObject",
"condition",
")",
"{",
"if",
"(",
"!",
"owns",
"(",
"condition",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Not owner\"",
")",
";",
"return",
"... | Returns a collection containing those threads that may be
waiting on the given condition associated with this
synchronizer. Because the actual set of threads may change
dynamically while constructing this result, the returned
collection is only a best-effort estimate. The elements of the
returned collection are in no particular order.
@param condition the condition
@return the collection of threads
@throws IllegalMonitorStateException if exclusive synchronization
is not held
@throws IllegalArgumentException if the given condition is
not associated with this synchronizer
@throws NullPointerException if the condition is null | [
"Returns",
"a",
"collection",
"containing",
"those",
"threads",
"that",
"may",
"be",
"waiting",
"on",
"the",
"given",
"condition",
"associated",
"with",
"this",
"synchronizer",
".",
"Because",
"the",
"actual",
"set",
"of",
"threads",
"may",
"change",
"dynamicall... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L1831-L1835 |
33,762 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.initializeSyncQueue | private final void initializeSyncQueue() {
Node h;
if (U.compareAndSwapObject(this, HEAD, null, (h = new Node())))
tail = h;
} | java | private final void initializeSyncQueue() {
Node h;
if (U.compareAndSwapObject(this, HEAD, null, (h = new Node())))
tail = h;
} | [
"private",
"final",
"void",
"initializeSyncQueue",
"(",
")",
"{",
"Node",
"h",
";",
"if",
"(",
"U",
".",
"compareAndSwapObject",
"(",
"this",
",",
"HEAD",
",",
"null",
",",
"(",
"h",
"=",
"new",
"Node",
"(",
")",
")",
")",
")",
"tail",
"=",
"h",
... | Initializes head and tail fields on first contention. | [
"Initializes",
"head",
"and",
"tail",
"fields",
"on",
"first",
"contention",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L2315-L2319 |
33,763 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.compareAndSetTail | private final boolean compareAndSetTail(Node expect, Node update) {
return U.compareAndSwapObject(this, TAIL, expect, update);
} | java | private final boolean compareAndSetTail(Node expect, Node update) {
return U.compareAndSwapObject(this, TAIL, expect, update);
} | [
"private",
"final",
"boolean",
"compareAndSetTail",
"(",
"Node",
"expect",
",",
"Node",
"update",
")",
"{",
"return",
"U",
".",
"compareAndSwapObject",
"(",
"this",
",",
"TAIL",
",",
"expect",
",",
"update",
")",
";",
"}"
] | CASes tail field. | [
"CASes",
"tail",
"field",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L2324-L2326 |
33,764 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java | PrintWriter.close | public void close() {
try {
synchronized (lock) {
if (out == null)
return;
out.close();
out = null;
}
}
catch (IOException x) {
trouble = true;
}
} | java | public void close() {
try {
synchronized (lock) {
if (out == null)
return;
out.close();
out = null;
}
}
catch (IOException x) {
trouble = true;
}
} | [
"public",
"void",
"close",
"(",
")",
"{",
"try",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"return",
";",
"out",
".",
"close",
"(",
")",
";",
"out",
"=",
"null",
";",
"}",
"}",
"catch",
"(",
"IOException",
... | Closes the stream and releases any system resources associated
with it. Closing a previously closed stream has no effect.
@see #checkError() | [
"Closes",
"the",
"stream",
"and",
"releases",
"any",
"system",
"resources",
"associated",
"with",
"it",
".",
"Closing",
"a",
"previously",
"closed",
"stream",
"has",
"no",
"effect",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java#L334-L346 |
33,765 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java | PrintWriter.checkError | public boolean checkError() {
if (out != null) {
flush();
}
if (out instanceof java.io.PrintWriter) {
PrintWriter pw = (PrintWriter) out;
return pw.checkError();
} else if (psOut != null) {
return psOut.checkError();
}
return trouble;
} | java | public boolean checkError() {
if (out != null) {
flush();
}
if (out instanceof java.io.PrintWriter) {
PrintWriter pw = (PrintWriter) out;
return pw.checkError();
} else if (psOut != null) {
return psOut.checkError();
}
return trouble;
} | [
"public",
"boolean",
"checkError",
"(",
")",
"{",
"if",
"(",
"out",
"!=",
"null",
")",
"{",
"flush",
"(",
")",
";",
"}",
"if",
"(",
"out",
"instanceof",
"java",
".",
"io",
".",
"PrintWriter",
")",
"{",
"PrintWriter",
"pw",
"=",
"(",
"PrintWriter",
... | Flushes the stream if it's not closed and checks its error state.
@return <code>true</code> if the print stream has encountered an error,
either on the underlying output stream or during a format
conversion. | [
"Flushes",
"the",
"stream",
"if",
"it",
"s",
"not",
"closed",
"and",
"checks",
"its",
"error",
"state",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java#L355-L366 |
33,766 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java | PrintWriter.write | public void write(char buf[], int off, int len) {
try {
synchronized (lock) {
ensureOpen();
out.write(buf, off, len);
}
}
catch (InterruptedIOException x) {
Thread.currentThread().interrupt();
}
catch (IOException x) {
trouble = true;
}
} | java | public void write(char buf[], int off, int len) {
try {
synchronized (lock) {
ensureOpen();
out.write(buf, off, len);
}
}
catch (InterruptedIOException x) {
Thread.currentThread().interrupt();
}
catch (IOException x) {
trouble = true;
}
} | [
"public",
"void",
"write",
"(",
"char",
"buf",
"[",
"]",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"try",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"ensureOpen",
"(",
")",
";",
"out",
".",
"write",
"(",
"buf",
",",
"off",
",",
"len",
")... | Writes A Portion of an array of characters.
@param buf Array of characters
@param off Offset from which to start writing characters
@param len Number of characters to write | [
"Writes",
"A",
"Portion",
"of",
"an",
"array",
"of",
"characters",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java#L422-L435 |
33,767 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java | PrintWriter.format | public PrintWriter format(Locale l, String format, Object ... args) {
try {
synchronized (lock) {
ensureOpen();
if ((formatter == null) || (formatter.locale() != l))
formatter = new Formatter(WeakProxy.forObject(this), l);
formatter.format(l, format, args);
if (autoFlush)
out.flush();
}
} catch (InterruptedIOException x) {
Thread.currentThread().interrupt();
} catch (IOException x) {
trouble = true;
}
return this;
} | java | public PrintWriter format(Locale l, String format, Object ... args) {
try {
synchronized (lock) {
ensureOpen();
if ((formatter == null) || (formatter.locale() != l))
formatter = new Formatter(WeakProxy.forObject(this), l);
formatter.format(l, format, args);
if (autoFlush)
out.flush();
}
} catch (InterruptedIOException x) {
Thread.currentThread().interrupt();
} catch (IOException x) {
trouble = true;
}
return this;
} | [
"public",
"PrintWriter",
"format",
"(",
"Locale",
"l",
",",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"(",
"formatter",
"==",
"null",
")",
"|... | Writes a formatted string to this writer using the specified format
string and arguments. If automatic flushing is enabled, calls to this
method will flush the output buffer.
@param l
The {@linkplain java.util.Locale locale} to apply during
formatting. If <tt>l</tt> is <tt>null</tt> then no localization
is applied.
@param format
A format string as described in <a
href="../util/Formatter.html#syntax">Format string syntax</a>.
@param args
Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
extra arguments are ignored. The number of arguments is
variable and may be zero. The maximum number of arguments is
limited by the maximum dimension of a Java array as defined by
<cite>The Java™ Virtual Machine Specification</cite>.
The behaviour on a
<tt>null</tt> argument depends on the <a
href="../util/Formatter.html#syntax">conversion</a>.
@throws java.util.IllegalFormatException
If a format string contains an illegal syntax, a format
specifier that is incompatible with the given arguments,
insufficient arguments given the format string, or other
illegal conditions. For specification of all possible
formatting errors, see the <a
href="../util/Formatter.html#detail">Details</a> section of the
formatter class specification.
@throws NullPointerException
If the <tt>format</tt> is <tt>null</tt>
@return This writer
@since 1.5 | [
"Writes",
"a",
"formatted",
"string",
"to",
"this",
"writer",
"using",
"the",
"specified",
"format",
"string",
"and",
"arguments",
".",
"If",
"automatic",
"flushing",
"is",
"enabled",
"calls",
"to",
"this",
"method",
"will",
"flush",
"the",
"output",
"buffer",... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PrintWriter.java#L958-L974 |
33,768 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java | MulticastSocket.joinGroup | public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
throws IOException {
if (isClosed())
throw new SocketException("Socket is closed");
if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress))
throw new IllegalArgumentException("Unsupported address type");
if (oldImpl)
throw new UnsupportedOperationException();
checkAddress(((InetSocketAddress)mcastaddr).getAddress(), "joinGroup");
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkMulticast(((InetSocketAddress)mcastaddr).getAddress());
}
if (!((InetSocketAddress)mcastaddr).getAddress().isMulticastAddress()) {
throw new SocketException("Not a multicast address");
}
getImpl().joinGroup(mcastaddr, netIf);
} | java | public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
throws IOException {
if (isClosed())
throw new SocketException("Socket is closed");
if (mcastaddr == null || !(mcastaddr instanceof InetSocketAddress))
throw new IllegalArgumentException("Unsupported address type");
if (oldImpl)
throw new UnsupportedOperationException();
checkAddress(((InetSocketAddress)mcastaddr).getAddress(), "joinGroup");
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkMulticast(((InetSocketAddress)mcastaddr).getAddress());
}
if (!((InetSocketAddress)mcastaddr).getAddress().isMulticastAddress()) {
throw new SocketException("Not a multicast address");
}
getImpl().joinGroup(mcastaddr, netIf);
} | [
"public",
"void",
"joinGroup",
"(",
"SocketAddress",
"mcastaddr",
",",
"NetworkInterface",
"netIf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isClosed",
"(",
")",
")",
"throw",
"new",
"SocketException",
"(",
"\"Socket is closed\"",
")",
";",
"if",
"(",
"m... | Joins the specified multicast group at the specified interface.
<p>If there is a security manager, this method first
calls its {@code checkMulticast} method
with the {@code mcastaddr} argument
as its argument.
@param mcastaddr is the multicast address to join
@param netIf specifies the local interface to receive multicast
datagram packets, or <i>null</i> to defer to the interface set by
{@link MulticastSocket#setInterface(InetAddress)} or
{@link MulticastSocket#setNetworkInterface(NetworkInterface)}
@exception IOException if there is an error joining
or when the address is not a multicast address.
@exception SecurityException if a security manager exists and its
{@code checkMulticast} method doesn't allow the join.
@throws IllegalArgumentException if mcastaddr is null or is a
SocketAddress subclass not supported by this socket
@see SecurityManager#checkMulticast(InetAddress)
@since 1.4 | [
"Joins",
"the",
"specified",
"multicast",
"group",
"at",
"the",
"specified",
"interface",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java#L385-L407 |
33,769 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java | MulticastSocket.setInterface | public void setInterface(InetAddress inf) throws SocketException {
if (isClosed()) {
throw new SocketException("Socket is closed");
}
checkAddress(inf, "setInterface");
synchronized (infLock) {
getImpl().setOption(SocketOptions.IP_MULTICAST_IF, inf);
infAddress = inf;
interfaceSet = true;
}
} | java | public void setInterface(InetAddress inf) throws SocketException {
if (isClosed()) {
throw new SocketException("Socket is closed");
}
checkAddress(inf, "setInterface");
synchronized (infLock) {
getImpl().setOption(SocketOptions.IP_MULTICAST_IF, inf);
infAddress = inf;
interfaceSet = true;
}
} | [
"public",
"void",
"setInterface",
"(",
"InetAddress",
"inf",
")",
"throws",
"SocketException",
"{",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"throw",
"new",
"SocketException",
"(",
"\"Socket is closed\"",
")",
";",
"}",
"checkAddress",
"(",
"inf",
",",
"\"... | Set the multicast network interface used by methods
whose behavior would be affected by the value of the
network interface. Useful for multihomed hosts.
@param inf the InetAddress
@exception SocketException if there is an error in
the underlying protocol, such as a TCP error.
@see #getInterface() | [
"Set",
"the",
"multicast",
"network",
"interface",
"used",
"by",
"methods",
"whose",
"behavior",
"would",
"be",
"affected",
"by",
"the",
"value",
"of",
"the",
"network",
"interface",
".",
"Useful",
"for",
"multihomed",
"hosts",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java#L465-L475 |
33,770 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java | MulticastSocket.getInterface | public InetAddress getInterface() throws SocketException {
if (isClosed()) {
throw new SocketException("Socket is closed");
}
synchronized (infLock) {
InetAddress ia =
(InetAddress)getImpl().getOption(SocketOptions.IP_MULTICAST_IF);
/**
* No previous setInterface or interface can be
* set using setNetworkInterface
*/
if (infAddress == null) {
return ia;
}
/**
* Same interface set with setInterface?
*/
if (ia.equals(infAddress)) {
return ia;
}
/**
* Different InetAddress from what we set with setInterface
* so enumerate the current interface to see if the
* address set by setInterface is bound to this interface.
*/
try {
NetworkInterface ni = NetworkInterface.getByInetAddress(ia);
Enumeration<InetAddress> addrs = ni.getInetAddresses();
while (addrs.hasMoreElements()) {
InetAddress addr = addrs.nextElement();
if (addr.equals(infAddress)) {
return infAddress;
}
}
/**
* No match so reset infAddress to indicate that the
* interface has changed via means
*/
infAddress = null;
return ia;
} catch (Exception e) {
return ia;
}
}
} | java | public InetAddress getInterface() throws SocketException {
if (isClosed()) {
throw new SocketException("Socket is closed");
}
synchronized (infLock) {
InetAddress ia =
(InetAddress)getImpl().getOption(SocketOptions.IP_MULTICAST_IF);
/**
* No previous setInterface or interface can be
* set using setNetworkInterface
*/
if (infAddress == null) {
return ia;
}
/**
* Same interface set with setInterface?
*/
if (ia.equals(infAddress)) {
return ia;
}
/**
* Different InetAddress from what we set with setInterface
* so enumerate the current interface to see if the
* address set by setInterface is bound to this interface.
*/
try {
NetworkInterface ni = NetworkInterface.getByInetAddress(ia);
Enumeration<InetAddress> addrs = ni.getInetAddresses();
while (addrs.hasMoreElements()) {
InetAddress addr = addrs.nextElement();
if (addr.equals(infAddress)) {
return infAddress;
}
}
/**
* No match so reset infAddress to indicate that the
* interface has changed via means
*/
infAddress = null;
return ia;
} catch (Exception e) {
return ia;
}
}
} | [
"public",
"InetAddress",
"getInterface",
"(",
")",
"throws",
"SocketException",
"{",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"throw",
"new",
"SocketException",
"(",
"\"Socket is closed\"",
")",
";",
"}",
"synchronized",
"(",
"infLock",
")",
"{",
"InetAddres... | Retrieve the address of the network interface used for
multicast packets.
@return An {@code InetAddress} representing
the address of the network interface used for
multicast packets.
@exception SocketException if there is an error in
the underlying protocol, such as a TCP error.
@see #setInterface(java.net.InetAddress) | [
"Retrieve",
"the",
"address",
"of",
"the",
"network",
"interface",
"used",
"for",
"multicast",
"packets",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java#L490-L538 |
33,771 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java | MulticastSocket.setNetworkInterface | public void setNetworkInterface(NetworkInterface netIf)
throws SocketException {
synchronized (infLock) {
getImpl().setOption(SocketOptions.IP_MULTICAST_IF2, netIf);
infAddress = null;
interfaceSet = true;
}
} | java | public void setNetworkInterface(NetworkInterface netIf)
throws SocketException {
synchronized (infLock) {
getImpl().setOption(SocketOptions.IP_MULTICAST_IF2, netIf);
infAddress = null;
interfaceSet = true;
}
} | [
"public",
"void",
"setNetworkInterface",
"(",
"NetworkInterface",
"netIf",
")",
"throws",
"SocketException",
"{",
"synchronized",
"(",
"infLock",
")",
"{",
"getImpl",
"(",
")",
".",
"setOption",
"(",
"SocketOptions",
".",
"IP_MULTICAST_IF2",
",",
"netIf",
")",
"... | Specify the network interface for outgoing multicast datagrams
sent on this socket.
@param netIf the interface
@exception SocketException if there is an error in
the underlying protocol, such as a TCP error.
@see #getNetworkInterface()
@since 1.4 | [
"Specify",
"the",
"network",
"interface",
"for",
"outgoing",
"multicast",
"datagrams",
"sent",
"on",
"this",
"socket",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java#L550-L558 |
33,772 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java | MulticastSocket.getNetworkInterface | public NetworkInterface getNetworkInterface() throws SocketException {
Integer niIndex
= (Integer)getImpl().getOption(SocketOptions.IP_MULTICAST_IF2);
if (niIndex == 0) {
InetAddress[] addrs = new InetAddress[1];
addrs[0] = InetAddress.anyLocalAddress();
return new NetworkInterface(addrs[0].getHostName(), 0, addrs);
} else {
return NetworkInterface.getByIndex(niIndex);
}
} | java | public NetworkInterface getNetworkInterface() throws SocketException {
Integer niIndex
= (Integer)getImpl().getOption(SocketOptions.IP_MULTICAST_IF2);
if (niIndex == 0) {
InetAddress[] addrs = new InetAddress[1];
addrs[0] = InetAddress.anyLocalAddress();
return new NetworkInterface(addrs[0].getHostName(), 0, addrs);
} else {
return NetworkInterface.getByIndex(niIndex);
}
} | [
"public",
"NetworkInterface",
"getNetworkInterface",
"(",
")",
"throws",
"SocketException",
"{",
"Integer",
"niIndex",
"=",
"(",
"Integer",
")",
"getImpl",
"(",
")",
".",
"getOption",
"(",
"SocketOptions",
".",
"IP_MULTICAST_IF2",
")",
";",
"if",
"(",
"niIndex",... | Get the multicast network interface set.
@exception SocketException if there is an error in
the underlying protocol, such as a TCP error.
@return the multicast {@code NetworkInterface} currently set
@see #setNetworkInterface(NetworkInterface)
@since 1.4 | [
"Get",
"the",
"multicast",
"network",
"interface",
"set",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/MulticastSocket.java#L569-L579 |
33,773 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/spi/SelectorProvider.java | SelectorProvider.provider | public static SelectorProvider provider() {
synchronized (lock) {
if (provider != null)
return provider;
/*
return AccessController.doPrivileged(
new PrivilegedAction<SelectorProvider>() {
public SelectorProvider run() {
if (loadProviderFromProperty())
return provider;
if (loadProviderAsService())
return provider;
provider = sun.nio.ch.DefaultSelectorProvider.create();
return provider;
}
});
*/
if (loadProviderFromProperty()) {
return provider;
}
if (loadProviderAsService()) {
return provider;
}
provider = sun.nio.ch.DefaultSelectorProvider.create();
return provider;
}
} | java | public static SelectorProvider provider() {
synchronized (lock) {
if (provider != null)
return provider;
/*
return AccessController.doPrivileged(
new PrivilegedAction<SelectorProvider>() {
public SelectorProvider run() {
if (loadProviderFromProperty())
return provider;
if (loadProviderAsService())
return provider;
provider = sun.nio.ch.DefaultSelectorProvider.create();
return provider;
}
});
*/
if (loadProviderFromProperty()) {
return provider;
}
if (loadProviderAsService()) {
return provider;
}
provider = sun.nio.ch.DefaultSelectorProvider.create();
return provider;
}
} | [
"public",
"static",
"SelectorProvider",
"provider",
"(",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"provider",
"!=",
"null",
")",
"return",
"provider",
";",
"/*\n return AccessController.doPrivileged(\n new PrivilegedAction<Select... | Returns the system-wide default selector provider for this invocation of
the Java virtual machine.
<p> The first invocation of this method locates the default provider
object as follows: </p>
<ol>
<li><p> If the system property
<tt>java.nio.channels.spi.SelectorProvider</tt> is defined then it is
taken to be the fully-qualified name of a concrete provider class.
The class is loaded and instantiated; if this process fails then an
unspecified error is thrown. </p></li>
<li><p> If a provider class has been installed in a jar file that is
visible to the system class loader, and that jar file contains a
provider-configuration file named
<tt>java.nio.channels.spi.SelectorProvider</tt> in the resource
directory <tt>META-INF/services</tt>, then the first class name
specified in that file is taken. The class is loaded and
instantiated; if this process fails then an unspecified error is
thrown. </p></li>
<li><p> Finally, if no provider has been specified by any of the above
means then the system-default provider class is instantiated and the
result is returned. </p></li>
</ol>
<p> Subsequent invocations of this method return the provider that was
returned by the first invocation. </p>
@return The system-wide default selector provider | [
"Returns",
"the",
"system",
"-",
"wide",
"default",
"selector",
"provider",
"for",
"this",
"invocation",
"of",
"the",
"Java",
"virtual",
"machine",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/spi/SelectorProvider.java#L161-L187 |
33,774 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedWriter.java | BufferedWriter.flushBuffer | void flushBuffer() throws IOException {
synchronized (lock) {
ensureOpen();
if (nextChar == 0)
return;
out.write(cb, 0, nextChar);
nextChar = 0;
}
} | java | void flushBuffer() throws IOException {
synchronized (lock) {
ensureOpen();
if (nextChar == 0)
return;
out.write(cb, 0, nextChar);
nextChar = 0;
}
} | [
"void",
"flushBuffer",
"(",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"nextChar",
"==",
"0",
")",
"return",
";",
"out",
".",
"write",
"(",
"cb",
",",
"0",
",",
"nextChar",
")",
... | Flushes the output buffer to the underlying character stream, without
flushing the stream itself. This method is non-private only so that it
may be invoked by PrintStream. | [
"Flushes",
"the",
"output",
"buffer",
"to",
"the",
"underlying",
"character",
"stream",
"without",
"flushing",
"the",
"stream",
"itself",
".",
"This",
"method",
"is",
"non",
"-",
"private",
"only",
"so",
"that",
"it",
"may",
"be",
"invoked",
"by",
"PrintStre... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedWriter.java#L123-L131 |
33,775 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedWriter.java | BufferedWriter.write | public void write(char cbuf[], int off, int len) throws IOException {
synchronized (lock) {
ensureOpen();
if ((off < 0) || (off > cbuf.length) || (len < 0) ||
((off + len) > cbuf.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
if (len >= nChars) {
/* If the request length exceeds the size of the output buffer,
flush the buffer and then write the data directly. In this
way buffered streams will cascade harmlessly. */
flushBuffer();
out.write(cbuf, off, len);
return;
}
int b = off, t = off + len;
while (b < t) {
int d = min(nChars - nextChar, t - b);
System.arraycopy(cbuf, b, cb, nextChar, d);
b += d;
nextChar += d;
if (nextChar >= nChars)
flushBuffer();
}
}
} | java | public void write(char cbuf[], int off, int len) throws IOException {
synchronized (lock) {
ensureOpen();
if ((off < 0) || (off > cbuf.length) || (len < 0) ||
((off + len) > cbuf.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
if (len >= nChars) {
/* If the request length exceeds the size of the output buffer,
flush the buffer and then write the data directly. In this
way buffered streams will cascade harmlessly. */
flushBuffer();
out.write(cbuf, off, len);
return;
}
int b = off, t = off + len;
while (b < t) {
int d = min(nChars - nextChar, t - b);
System.arraycopy(cbuf, b, cb, nextChar, d);
b += d;
nextChar += d;
if (nextChar >= nChars)
flushBuffer();
}
}
} | [
"public",
"void",
"write",
"(",
"char",
"cbuf",
"[",
"]",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"(",
"off",
"<",
"0",
")",
"||",
"("... | Writes a portion of an array of characters.
<p> Ordinarily this method stores characters from the given array into
this stream's buffer, flushing the buffer to the underlying stream as
needed. If the requested length is at least as large as the buffer,
however, then this method will flush the buffer and write the characters
directly to the underlying stream. Thus redundant
<code>BufferedWriter</code>s will not copy data unnecessarily.
@param cbuf A character array
@param off Offset from which to start reading characters
@param len Number of characters to write
@exception IOException If an I/O error occurs | [
"Writes",
"a",
"portion",
"of",
"an",
"array",
"of",
"characters",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedWriter.java#L172-L201 |
33,776 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedWriter.java | BufferedWriter.write | public void write(String s, int off, int len) throws IOException {
synchronized (lock) {
ensureOpen();
int b = off, t = off + len;
while (b < t) {
int d = min(nChars - nextChar, t - b);
s.getChars(b, b + d, cb, nextChar);
b += d;
nextChar += d;
if (nextChar >= nChars)
flushBuffer();
}
}
} | java | public void write(String s, int off, int len) throws IOException {
synchronized (lock) {
ensureOpen();
int b = off, t = off + len;
while (b < t) {
int d = min(nChars - nextChar, t - b);
s.getChars(b, b + d, cb, nextChar);
b += d;
nextChar += d;
if (nextChar >= nChars)
flushBuffer();
}
}
} | [
"public",
"void",
"write",
"(",
"String",
"s",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"ensureOpen",
"(",
")",
";",
"int",
"b",
"=",
"off",
",",
"t",
"=",
"off",
"+",
"len",
... | Writes a portion of a String.
<p> If the value of the <tt>len</tt> parameter is negative then no
characters are written. This is contrary to the specification of this
method in the {@linkplain java.io.Writer#write(java.lang.String,int,int)
superclass}, which requires that an {@link IndexOutOfBoundsException} be
thrown.
@param s String to be written
@param off Offset from which to start reading characters
@param len Number of characters to be written
@exception IOException If an I/O error occurs | [
"Writes",
"a",
"portion",
"of",
"a",
"String",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedWriter.java#L218-L232 |
33,777 | google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/MetadataWriter.java | MetadataWriter.getTypeModifiers | private static int getTypeModifiers(TypeElement type) {
int modifiers = ElementUtil.fromModifierSet(type.getModifiers());
if (type.getKind().isInterface()) {
modifiers |= java.lang.reflect.Modifier.INTERFACE | java.lang.reflect.Modifier.ABSTRACT
| java.lang.reflect.Modifier.STATIC;
}
if (ElementUtil.isSynthetic(type)) {
modifiers |= ElementUtil.ACC_SYNTHETIC;
}
if (ElementUtil.isAnnotationType(type)) {
modifiers |= ElementUtil.ACC_ANNOTATION;
}
if (ElementUtil.isEnum(type)) {
modifiers |= ElementUtil.ACC_ENUM;
}
if (ElementUtil.isAnonymous(type)) {
modifiers |= ElementUtil.ACC_ANONYMOUS;
}
return modifiers;
} | java | private static int getTypeModifiers(TypeElement type) {
int modifiers = ElementUtil.fromModifierSet(type.getModifiers());
if (type.getKind().isInterface()) {
modifiers |= java.lang.reflect.Modifier.INTERFACE | java.lang.reflect.Modifier.ABSTRACT
| java.lang.reflect.Modifier.STATIC;
}
if (ElementUtil.isSynthetic(type)) {
modifiers |= ElementUtil.ACC_SYNTHETIC;
}
if (ElementUtil.isAnnotationType(type)) {
modifiers |= ElementUtil.ACC_ANNOTATION;
}
if (ElementUtil.isEnum(type)) {
modifiers |= ElementUtil.ACC_ENUM;
}
if (ElementUtil.isAnonymous(type)) {
modifiers |= ElementUtil.ACC_ANONYMOUS;
}
return modifiers;
} | [
"private",
"static",
"int",
"getTypeModifiers",
"(",
"TypeElement",
"type",
")",
"{",
"int",
"modifiers",
"=",
"ElementUtil",
".",
"fromModifierSet",
"(",
"type",
".",
"getModifiers",
"(",
")",
")",
";",
"if",
"(",
"type",
".",
"getKind",
"(",
")",
".",
... | Returns the modifiers for a specified type, including internal ones.
All class modifiers are defined in the JVM specification, table 4.1. | [
"Returns",
"the",
"modifiers",
"for",
"a",
"specified",
"type",
"including",
"internal",
"ones",
".",
"All",
"class",
"modifiers",
"are",
"defined",
"in",
"the",
"JVM",
"specification",
"table",
"4",
".",
"1",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/MetadataWriter.java#L461-L480 |
33,778 | google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/MetadataWriter.java | MetadataWriter.getMethodModifiers | private static int getMethodModifiers(ExecutableElement method) {
int modifiers = ElementUtil.fromModifierSet(method.getModifiers());
if (method.isVarArgs()) {
modifiers |= ElementUtil.ACC_VARARGS;
}
if (ElementUtil.isSynthetic(method)) {
modifiers |= ElementUtil.ACC_SYNTHETIC;
}
return modifiers;
} | java | private static int getMethodModifiers(ExecutableElement method) {
int modifiers = ElementUtil.fromModifierSet(method.getModifiers());
if (method.isVarArgs()) {
modifiers |= ElementUtil.ACC_VARARGS;
}
if (ElementUtil.isSynthetic(method)) {
modifiers |= ElementUtil.ACC_SYNTHETIC;
}
return modifiers;
} | [
"private",
"static",
"int",
"getMethodModifiers",
"(",
"ExecutableElement",
"method",
")",
"{",
"int",
"modifiers",
"=",
"ElementUtil",
".",
"fromModifierSet",
"(",
"method",
".",
"getModifiers",
"(",
")",
")",
";",
"if",
"(",
"method",
".",
"isVarArgs",
"(",
... | Returns the modifiers for a specified method, including internal ones.
All method modifiers are defined in the JVM specification, table 4.5. | [
"Returns",
"the",
"modifiers",
"for",
"a",
"specified",
"method",
"including",
"internal",
"ones",
".",
"All",
"method",
"modifiers",
"are",
"defined",
"in",
"the",
"JVM",
"specification",
"table",
"4",
".",
"5",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/MetadataWriter.java#L486-L495 |
33,779 | google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/MetadataWriter.java | MetadataWriter.getFieldModifiers | private static int getFieldModifiers(VariableElement var) {
int modifiers = ElementUtil.fromModifierSet(var.getModifiers());
if (ElementUtil.isSynthetic(var)) {
modifiers |= ElementUtil.ACC_SYNTHETIC;
}
if (ElementUtil.isEnumConstant(var)) {
modifiers |= ElementUtil.ACC_ENUM;
}
return modifiers;
} | java | private static int getFieldModifiers(VariableElement var) {
int modifiers = ElementUtil.fromModifierSet(var.getModifiers());
if (ElementUtil.isSynthetic(var)) {
modifiers |= ElementUtil.ACC_SYNTHETIC;
}
if (ElementUtil.isEnumConstant(var)) {
modifiers |= ElementUtil.ACC_ENUM;
}
return modifiers;
} | [
"private",
"static",
"int",
"getFieldModifiers",
"(",
"VariableElement",
"var",
")",
"{",
"int",
"modifiers",
"=",
"ElementUtil",
".",
"fromModifierSet",
"(",
"var",
".",
"getModifiers",
"(",
")",
")",
";",
"if",
"(",
"ElementUtil",
".",
"isSynthetic",
"(",
... | Returns the modifiers for a specified field, including internal ones.
All method modifiers are defined in the JVM specification, table 4.4. | [
"Returns",
"the",
"modifiers",
"for",
"a",
"specified",
"field",
"including",
"internal",
"ones",
".",
"All",
"method",
"modifiers",
"are",
"defined",
"in",
"the",
"JVM",
"specification",
"table",
"4",
".",
"4",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/MetadataWriter.java#L501-L510 |
33,780 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java | OutputProperties.setMethodDefaults | public void setMethodDefaults(String method)
{
String defaultMethod = m_properties.getProperty(OutputKeys.METHOD);
if((null == defaultMethod) || !defaultMethod.equals(method)
// bjm - add the next condition as a hack
// but it is because both output_xml.properties and
// output_unknown.properties have the same method=xml
// for their default. Otherwise we end up with
// a ToUnknownStream wraping a ToXMLStream even
// when the users says method="xml"
//
|| defaultMethod.equals("xml")
)
{
Properties savedProps = m_properties;
Properties newDefaults =
OutputPropertiesFactory.getDefaultMethodProperties(method);
m_properties = new Properties(newDefaults);
copyFrom(savedProps, false);
}
} | java | public void setMethodDefaults(String method)
{
String defaultMethod = m_properties.getProperty(OutputKeys.METHOD);
if((null == defaultMethod) || !defaultMethod.equals(method)
// bjm - add the next condition as a hack
// but it is because both output_xml.properties and
// output_unknown.properties have the same method=xml
// for their default. Otherwise we end up with
// a ToUnknownStream wraping a ToXMLStream even
// when the users says method="xml"
//
|| defaultMethod.equals("xml")
)
{
Properties savedProps = m_properties;
Properties newDefaults =
OutputPropertiesFactory.getDefaultMethodProperties(method);
m_properties = new Properties(newDefaults);
copyFrom(savedProps, false);
}
} | [
"public",
"void",
"setMethodDefaults",
"(",
"String",
"method",
")",
"{",
"String",
"defaultMethod",
"=",
"m_properties",
".",
"getProperty",
"(",
"OutputKeys",
".",
"METHOD",
")",
";",
"if",
"(",
"(",
"null",
"==",
"defaultMethod",
")",
"||",
"!",
"defaultM... | Reset the default properties based on the method.
@param method the method value.
@see javax.xml.transform.OutputKeys | [
"Reset",
"the",
"default",
"properties",
"based",
"on",
"the",
"method",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java#L307-L328 |
33,781 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java | OutputProperties.setQNameProperties | public void setQNameProperties(String key, Vector v)
{
int s = v.size();
// Just an initial guess at reasonable tuning parameters
FastStringBuffer fsb = new FastStringBuffer(9,9);
for (int i = 0; i < s; i++)
{
QName qname = (QName) v.elementAt(i);
fsb.append(qname.toNamespacedString());
// Don't append space after last value
if (i < s-1)
fsb.append(' ');
}
m_properties.put(key, fsb.toString());
} | java | public void setQNameProperties(String key, Vector v)
{
int s = v.size();
// Just an initial guess at reasonable tuning parameters
FastStringBuffer fsb = new FastStringBuffer(9,9);
for (int i = 0; i < s; i++)
{
QName qname = (QName) v.elementAt(i);
fsb.append(qname.toNamespacedString());
// Don't append space after last value
if (i < s-1)
fsb.append(' ');
}
m_properties.put(key, fsb.toString());
} | [
"public",
"void",
"setQNameProperties",
"(",
"String",
"key",
",",
"Vector",
"v",
")",
"{",
"int",
"s",
"=",
"v",
".",
"size",
"(",
")",
";",
"// Just an initial guess at reasonable tuning parameters",
"FastStringBuffer",
"fsb",
"=",
"new",
"FastStringBuffer",
"("... | Set an output property with a QName list value. The QNames will be turned
into strings with the namespace in curly brackets.
@param key the key to be placed into the property list.
@param v non-null list of QNames corresponding to <tt>key</tt>.
@see javax.xml.transform.OutputKeys | [
"Set",
"an",
"output",
"property",
"with",
"a",
"QName",
"list",
"value",
".",
"The",
"QNames",
"will",
"be",
"turned",
"into",
"strings",
"with",
"the",
"namespace",
"in",
"curly",
"brackets",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java#L417-L436 |
33,782 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java | OutputProperties.copyFrom | public void copyFrom(Properties src, boolean shouldResetDefaults)
{
Enumeration keys = src.keys();
while (keys.hasMoreElements())
{
String key = (String) keys.nextElement();
if (!isLegalPropertyKey(key))
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{key})); //"output property not recognized: "
Object oldValue = m_properties.get(key);
if (null == oldValue)
{
String val = (String) src.get(key);
if(shouldResetDefaults && key.equals(OutputKeys.METHOD))
{
setMethodDefaults(val);
}
m_properties.put(key, val);
}
else if (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS))
{
m_properties.put(key, (String) oldValue + " " + (String) src.get(key));
}
}
} | java | public void copyFrom(Properties src, boolean shouldResetDefaults)
{
Enumeration keys = src.keys();
while (keys.hasMoreElements())
{
String key = (String) keys.nextElement();
if (!isLegalPropertyKey(key))
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{key})); //"output property not recognized: "
Object oldValue = m_properties.get(key);
if (null == oldValue)
{
String val = (String) src.get(key);
if(shouldResetDefaults && key.equals(OutputKeys.METHOD))
{
setMethodDefaults(val);
}
m_properties.put(key, val);
}
else if (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS))
{
m_properties.put(key, (String) oldValue + " " + (String) src.get(key));
}
}
} | [
"public",
"void",
"copyFrom",
"(",
"Properties",
"src",
",",
"boolean",
"shouldResetDefaults",
")",
"{",
"Enumeration",
"keys",
"=",
"src",
".",
"keys",
"(",
")",
";",
"while",
"(",
"keys",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"String",
"key",
"="... | Copy the keys and values from the source to this object. This will
not copy the default values. This is meant to be used by going from
a higher precedence object to a lower precedence object, so that if a
key already exists, this method will not reset it.
@param src non-null reference to the source properties.
@param shouldResetDefaults true if the defaults should be reset based on
the method property. | [
"Copy",
"the",
"keys",
"and",
"values",
"from",
"the",
"source",
"to",
"this",
"object",
".",
"This",
"will",
"not",
"copy",
"the",
"default",
"values",
".",
"This",
"is",
"meant",
"to",
"be",
"used",
"by",
"going",
"from",
"a",
"higher",
"precedence",
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java#L592-L621 |
33,783 | google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java | NodeImpl.validatePrefix | static String validatePrefix(String prefix, boolean namespaceAware, String namespaceURI) {
if (!namespaceAware) {
throw new DOMException(DOMException.NAMESPACE_ERR, prefix);
}
if (prefix != null) {
if (namespaceURI == null
|| !DocumentImpl.isXMLIdentifier(prefix)
|| "xml".equals(prefix) && !"http://www.w3.org/XML/1998/namespace".equals(namespaceURI)
|| "xmlns".equals(prefix) && !"http://www.w3.org/2000/xmlns/".equals(namespaceURI)) {
throw new DOMException(DOMException.NAMESPACE_ERR, prefix);
}
}
return prefix;
} | java | static String validatePrefix(String prefix, boolean namespaceAware, String namespaceURI) {
if (!namespaceAware) {
throw new DOMException(DOMException.NAMESPACE_ERR, prefix);
}
if (prefix != null) {
if (namespaceURI == null
|| !DocumentImpl.isXMLIdentifier(prefix)
|| "xml".equals(prefix) && !"http://www.w3.org/XML/1998/namespace".equals(namespaceURI)
|| "xmlns".equals(prefix) && !"http://www.w3.org/2000/xmlns/".equals(namespaceURI)) {
throw new DOMException(DOMException.NAMESPACE_ERR, prefix);
}
}
return prefix;
} | [
"static",
"String",
"validatePrefix",
"(",
"String",
"prefix",
",",
"boolean",
"namespaceAware",
",",
"String",
"namespaceURI",
")",
"{",
"if",
"(",
"!",
"namespaceAware",
")",
"{",
"throw",
"new",
"DOMException",
"(",
"DOMException",
".",
"NAMESPACE_ERR",
",",
... | Validates the element or attribute namespace prefix on this node.
@param namespaceAware whether this node is namespace aware
@param namespaceURI this node's namespace URI | [
"Validates",
"the",
"element",
"or",
"attribute",
"namespace",
"prefix",
"on",
"this",
"node",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java#L205-L220 |
33,784 | google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java | NodeImpl.getNamespacingElement | private NodeImpl getNamespacingElement() {
switch (this.getNodeType()) {
case ELEMENT_NODE:
return this;
case DOCUMENT_NODE:
return (NodeImpl) ((Document) this).getDocumentElement();
case ENTITY_NODE:
case NOTATION_NODE:
case DOCUMENT_FRAGMENT_NODE:
case DOCUMENT_TYPE_NODE:
return null;
case ATTRIBUTE_NODE:
return (NodeImpl) ((Attr) this).getOwnerElement();
case TEXT_NODE:
case CDATA_SECTION_NODE:
case ENTITY_REFERENCE_NODE:
case PROCESSING_INSTRUCTION_NODE:
case COMMENT_NODE:
return getContainingElement();
default:
throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
"Unsupported node type " + getNodeType());
}
} | java | private NodeImpl getNamespacingElement() {
switch (this.getNodeType()) {
case ELEMENT_NODE:
return this;
case DOCUMENT_NODE:
return (NodeImpl) ((Document) this).getDocumentElement();
case ENTITY_NODE:
case NOTATION_NODE:
case DOCUMENT_FRAGMENT_NODE:
case DOCUMENT_TYPE_NODE:
return null;
case ATTRIBUTE_NODE:
return (NodeImpl) ((Attr) this).getOwnerElement();
case TEXT_NODE:
case CDATA_SECTION_NODE:
case ENTITY_REFERENCE_NODE:
case PROCESSING_INSTRUCTION_NODE:
case COMMENT_NODE:
return getContainingElement();
default:
throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
"Unsupported node type " + getNodeType());
}
} | [
"private",
"NodeImpl",
"getNamespacingElement",
"(",
")",
"{",
"switch",
"(",
"this",
".",
"getNodeType",
"(",
")",
")",
"{",
"case",
"ELEMENT_NODE",
":",
"return",
"this",
";",
"case",
"DOCUMENT_NODE",
":",
"return",
"(",
"NodeImpl",
")",
"(",
"(",
"Docum... | Returns the element whose namespace definitions apply to this node. Use
this element when mapping prefixes to URIs and vice versa. | [
"Returns",
"the",
"element",
"whose",
"namespace",
"definitions",
"apply",
"to",
"this",
"node",
".",
"Use",
"this",
"element",
"when",
"mapping",
"prefixes",
"to",
"URIs",
"and",
"vice",
"versa",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java#L450-L478 |
33,785 | google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java | NodeImpl.getContainingElement | private NodeImpl getContainingElement() {
for (Node p = getParentNode(); p != null; p = p.getParentNode()) {
if (p.getNodeType() == ELEMENT_NODE) {
return (NodeImpl) p;
}
}
return null;
} | java | private NodeImpl getContainingElement() {
for (Node p = getParentNode(); p != null; p = p.getParentNode()) {
if (p.getNodeType() == ELEMENT_NODE) {
return (NodeImpl) p;
}
}
return null;
} | [
"private",
"NodeImpl",
"getContainingElement",
"(",
")",
"{",
"for",
"(",
"Node",
"p",
"=",
"getParentNode",
"(",
")",
";",
"p",
"!=",
"null",
";",
"p",
"=",
"p",
".",
"getParentNode",
"(",
")",
")",
"{",
"if",
"(",
"p",
".",
"getNodeType",
"(",
")... | Returns the nearest ancestor element that contains this node. | [
"Returns",
"the",
"nearest",
"ancestor",
"element",
"that",
"contains",
"this",
"node",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java#L483-L490 |
33,786 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java | ExtensionNamespacesManager.registerExtension | public void registerExtension(String namespace)
{
if (namespaceIndex(namespace, m_extensions) == -1)
{
int predef = namespaceIndex(namespace, m_predefExtensions);
if (predef !=-1)
m_extensions.add(m_predefExtensions.get(predef));
else if (!(m_unregisteredExtensions.contains(namespace)))
m_unregisteredExtensions.add(namespace);
}
} | java | public void registerExtension(String namespace)
{
if (namespaceIndex(namespace, m_extensions) == -1)
{
int predef = namespaceIndex(namespace, m_predefExtensions);
if (predef !=-1)
m_extensions.add(m_predefExtensions.get(predef));
else if (!(m_unregisteredExtensions.contains(namespace)))
m_unregisteredExtensions.add(namespace);
}
} | [
"public",
"void",
"registerExtension",
"(",
"String",
"namespace",
")",
"{",
"if",
"(",
"namespaceIndex",
"(",
"namespace",
",",
"m_extensions",
")",
"==",
"-",
"1",
")",
"{",
"int",
"predef",
"=",
"namespaceIndex",
"(",
"namespace",
",",
"m_predefExtensions",... | If necessary, register the extension namespace found compiling a function or
creating an extension element.
If it is a predefined namespace, create a
support object to simplify the instantiate of an appropriate ExtensionHandler
during transformation runtime. Otherwise, add the namespace, if necessary,
to a vector of undefined extension namespaces, to be defined later. | [
"If",
"necessary",
"register",
"the",
"extension",
"namespace",
"found",
"compiling",
"a",
"function",
"or",
"creating",
"an",
"extension",
"element",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java#L70-L80 |
33,787 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java | ExtensionNamespacesManager.registerExtension | public void registerExtension(ExtensionNamespaceSupport extNsSpt)
{
String namespace = extNsSpt.getNamespace();
if (namespaceIndex(namespace, m_extensions) == -1)
{
m_extensions.add(extNsSpt);
if (m_unregisteredExtensions.contains(namespace))
m_unregisteredExtensions.remove(namespace);
}
} | java | public void registerExtension(ExtensionNamespaceSupport extNsSpt)
{
String namespace = extNsSpt.getNamespace();
if (namespaceIndex(namespace, m_extensions) == -1)
{
m_extensions.add(extNsSpt);
if (m_unregisteredExtensions.contains(namespace))
m_unregisteredExtensions.remove(namespace);
}
} | [
"public",
"void",
"registerExtension",
"(",
"ExtensionNamespaceSupport",
"extNsSpt",
")",
"{",
"String",
"namespace",
"=",
"extNsSpt",
".",
"getNamespace",
"(",
")",
";",
"if",
"(",
"namespaceIndex",
"(",
"namespace",
",",
"m_extensions",
")",
"==",
"-",
"1",
... | Register the extension namespace for an ElemExtensionDecl or ElemFunction,
and prepare a support object to launch the appropriate ExtensionHandler at
transformation runtime. | [
"Register",
"the",
"extension",
"namespace",
"for",
"an",
"ElemExtensionDecl",
"or",
"ElemFunction",
"and",
"prepare",
"a",
"support",
"object",
"to",
"launch",
"the",
"appropriate",
"ExtensionHandler",
"at",
"transformation",
"runtime",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java#L87-L97 |
33,788 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java | ExtensionNamespacesManager.namespaceIndex | public int namespaceIndex(String namespace, Vector extensions)
{
for (int i = 0; i < extensions.size(); i++)
{
if (((ExtensionNamespaceSupport)extensions.get(i)).getNamespace().equals(namespace))
return i;
}
return -1;
} | java | public int namespaceIndex(String namespace, Vector extensions)
{
for (int i = 0; i < extensions.size(); i++)
{
if (((ExtensionNamespaceSupport)extensions.get(i)).getNamespace().equals(namespace))
return i;
}
return -1;
} | [
"public",
"int",
"namespaceIndex",
"(",
"String",
"namespace",
",",
"Vector",
"extensions",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"extensions",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"(",
"(",
"ExtensionNam... | Get the index for a namespace entry in the extension namespace Vector, -1 if
no such entry yet exists. | [
"Get",
"the",
"index",
"for",
"a",
"namespace",
"entry",
"in",
"the",
"extension",
"namespace",
"Vector",
"-",
"1",
"if",
"no",
"such",
"entry",
"yet",
"exists",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java#L103-L111 |
33,789 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java | ExtensionNamespacesManager.registerUnregisteredNamespaces | public void registerUnregisteredNamespaces()
{
for (int i = 0; i < m_unregisteredExtensions.size(); i++)
{
String ns = (String)m_unregisteredExtensions.get(i);
ExtensionNamespaceSupport extNsSpt = defineJavaNamespace(ns);
if (extNsSpt != null)
m_extensions.add(extNsSpt);
}
} | java | public void registerUnregisteredNamespaces()
{
for (int i = 0; i < m_unregisteredExtensions.size(); i++)
{
String ns = (String)m_unregisteredExtensions.get(i);
ExtensionNamespaceSupport extNsSpt = defineJavaNamespace(ns);
if (extNsSpt != null)
m_extensions.add(extNsSpt);
}
} | [
"public",
"void",
"registerUnregisteredNamespaces",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m_unregisteredExtensions",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"String",
"ns",
"=",
"(",
"String",
")",
"m_unregisteredExten... | Attempt to register any unregistered extension namespaces. | [
"Attempt",
"to",
"register",
"any",
"unregistered",
"extension",
"namespaces",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java#L127-L136 |
33,790 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java | ExtensionNamespacesManager.setPredefinedNamespaces | private void setPredefinedNamespaces()
{
String uri = Constants.S_EXTENSIONS_JAVA_URL;
String handlerClassName = "org.apache.xalan.extensions.ExtensionHandlerJavaPackage";
String lang = "javapackage";
String lib = "";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_OLD_JAVA_URL;
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_LOTUSXSL_JAVA_URL;
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_BUILTIN_EXTENSIONS_URL;
handlerClassName = "org.apache.xalan.extensions.ExtensionHandlerJavaClass";
lang = "javaclass"; // for remaining predefined extension namespaces.
lib = "org.apache.xalan.lib.Extensions";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_BUILTIN_OLD_EXTENSIONS_URL;
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
// Xalan extension namespaces (redirect, pipe and SQL).
uri = Constants.S_EXTENSIONS_REDIRECT_URL;
lib = "org.apache.xalan.lib.Redirect";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_PIPE_URL;
lib = "org.apache.xalan.lib.PipeDocument";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_SQL_URL;
lib = "org.apache.xalan.lib.sql.XConnection";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
//EXSLT namespaces (not including EXSLT function namespaces which are
// registered by the associated ElemFunction.
uri = Constants.S_EXSLT_COMMON_URL;
lib = "org.apache.xalan.lib.ExsltCommon";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_MATH_URL;
lib = "org.apache.xalan.lib.ExsltMath";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_SETS_URL;
lib = "org.apache.xalan.lib.ExsltSets";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_DATETIME_URL;
lib = "org.apache.xalan.lib.ExsltDatetime";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_DYNAMIC_URL;
lib = "org.apache.xalan.lib.ExsltDynamic";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_STRINGS_URL;
lib = "org.apache.xalan.lib.ExsltStrings";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
} | java | private void setPredefinedNamespaces()
{
String uri = Constants.S_EXTENSIONS_JAVA_URL;
String handlerClassName = "org.apache.xalan.extensions.ExtensionHandlerJavaPackage";
String lang = "javapackage";
String lib = "";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_OLD_JAVA_URL;
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_LOTUSXSL_JAVA_URL;
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_BUILTIN_EXTENSIONS_URL;
handlerClassName = "org.apache.xalan.extensions.ExtensionHandlerJavaClass";
lang = "javaclass"; // for remaining predefined extension namespaces.
lib = "org.apache.xalan.lib.Extensions";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_BUILTIN_OLD_EXTENSIONS_URL;
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
// Xalan extension namespaces (redirect, pipe and SQL).
uri = Constants.S_EXTENSIONS_REDIRECT_URL;
lib = "org.apache.xalan.lib.Redirect";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_PIPE_URL;
lib = "org.apache.xalan.lib.PipeDocument";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXTENSIONS_SQL_URL;
lib = "org.apache.xalan.lib.sql.XConnection";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
//EXSLT namespaces (not including EXSLT function namespaces which are
// registered by the associated ElemFunction.
uri = Constants.S_EXSLT_COMMON_URL;
lib = "org.apache.xalan.lib.ExsltCommon";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_MATH_URL;
lib = "org.apache.xalan.lib.ExsltMath";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_SETS_URL;
lib = "org.apache.xalan.lib.ExsltSets";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_DATETIME_URL;
lib = "org.apache.xalan.lib.ExsltDatetime";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_DYNAMIC_URL;
lib = "org.apache.xalan.lib.ExsltDynamic";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
uri = Constants.S_EXSLT_STRINGS_URL;
lib = "org.apache.xalan.lib.ExsltStrings";
m_predefExtensions.add(new ExtensionNamespaceSupport(uri, handlerClassName,
new Object[]{uri, lang, lib}));
} | [
"private",
"void",
"setPredefinedNamespaces",
"(",
")",
"{",
"String",
"uri",
"=",
"Constants",
".",
"S_EXTENSIONS_JAVA_URL",
";",
"String",
"handlerClassName",
"=",
"\"org.apache.xalan.extensions.ExtensionHandlerJavaPackage\"",
";",
"String",
"lang",
"=",
"\"javapackage\""... | Set up a Vector for predefined extension namespaces. | [
"Set",
"up",
"a",
"Vector",
"for",
"predefined",
"extension",
"namespaces",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java#L208-L284 |
33,791 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/XPathException.java | XPathException.getExpressionOwner | protected ExpressionNode getExpressionOwner(ExpressionNode ex)
{
ExpressionNode parent = ex.exprGetParent();
while((null != parent) && (parent instanceof Expression))
parent = parent.exprGetParent();
return parent;
} | java | protected ExpressionNode getExpressionOwner(ExpressionNode ex)
{
ExpressionNode parent = ex.exprGetParent();
while((null != parent) && (parent instanceof Expression))
parent = parent.exprGetParent();
return parent;
} | [
"protected",
"ExpressionNode",
"getExpressionOwner",
"(",
"ExpressionNode",
"ex",
")",
"{",
"ExpressionNode",
"parent",
"=",
"ex",
".",
"exprGetParent",
"(",
")",
";",
"while",
"(",
"(",
"null",
"!=",
"parent",
")",
"&&",
"(",
"parent",
"instanceof",
"Expressi... | Get the first non-Expression parent of this node.
@return null or first ancestor that is not an Expression. | [
"Get",
"the",
"first",
"non",
"-",
"Expression",
"parent",
"of",
"this",
"node",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/XPathException.java#L112-L118 |
33,792 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/XPathException.java | XPathException.getMessage | public String getMessage()
{
String lastMessage = super.getMessage();
Throwable exception = m_exception;
while (null != exception)
{
String nextMessage = exception.getMessage();
if (null != nextMessage)
lastMessage = nextMessage;
if (exception instanceof TransformerException)
{
TransformerException se = (TransformerException) exception;
Throwable prev = exception;
exception = se.getException();
if (prev == exception)
break;
}
else
{
exception = null;
}
}
return (null != lastMessage) ? lastMessage : "";
} | java | public String getMessage()
{
String lastMessage = super.getMessage();
Throwable exception = m_exception;
while (null != exception)
{
String nextMessage = exception.getMessage();
if (null != nextMessage)
lastMessage = nextMessage;
if (exception instanceof TransformerException)
{
TransformerException se = (TransformerException) exception;
Throwable prev = exception;
exception = se.getException();
if (prev == exception)
break;
}
else
{
exception = null;
}
}
return (null != lastMessage) ? lastMessage : "";
} | [
"public",
"String",
"getMessage",
"(",
")",
"{",
"String",
"lastMessage",
"=",
"super",
".",
"getMessage",
"(",
")",
";",
"Throwable",
"exception",
"=",
"m_exception",
";",
"while",
"(",
"null",
"!=",
"exception",
")",
"{",
"String",
"nextMessage",
"=",
"e... | Find the most contained message.
@return The error message of the originating exception. | [
"Find",
"the",
"most",
"contained",
"message",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/XPathException.java#L217-L247 |
33,793 | google/j2objc | jre_emul/apache_harmony/classlib/modules/beans/src/main/java/java/beans/EventSetDescriptor.java | EventSetDescriptor.checkEventType | private static void checkEventType(String eventSetName,
Method listenerMethod) throws IntrospectionException {
Class<?>[] params = listenerMethod.getParameterTypes();
String firstParamTypeName = null;
String eventTypeName = prepareEventTypeName(eventSetName);
if (params.length > 0) {
firstParamTypeName = extractShortClassName(params[0]
.getName());
}
if (firstParamTypeName == null
|| !firstParamTypeName.equals(eventTypeName)) {
throw new IntrospectionException("Listener method " +
listenerMethod.getName() + " should have parameter of type " + eventTypeName);
}
} | java | private static void checkEventType(String eventSetName,
Method listenerMethod) throws IntrospectionException {
Class<?>[] params = listenerMethod.getParameterTypes();
String firstParamTypeName = null;
String eventTypeName = prepareEventTypeName(eventSetName);
if (params.length > 0) {
firstParamTypeName = extractShortClassName(params[0]
.getName());
}
if (firstParamTypeName == null
|| !firstParamTypeName.equals(eventTypeName)) {
throw new IntrospectionException("Listener method " +
listenerMethod.getName() + " should have parameter of type " + eventTypeName);
}
} | [
"private",
"static",
"void",
"checkEventType",
"(",
"String",
"eventSetName",
",",
"Method",
"listenerMethod",
")",
"throws",
"IntrospectionException",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"params",
"=",
"listenerMethod",
".",
"getParameterTypes",
"(",
")",
";... | Checks that given listener method has an argument of the valid type.
@param eventSetName
event set name
@param listenerMethod
listener method
@throws IntrospectionException
if check fails | [
"Checks",
"that",
"given",
"listener",
"method",
"has",
"an",
"argument",
"of",
"the",
"valid",
"type",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/apache_harmony/classlib/modules/beans/src/main/java/java/beans/EventSetDescriptor.java#L210-L226 |
33,794 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java | ProcessorOutputElem.setCdataSectionElements | public void setCdataSectionElements(java.util.Vector newValue)
{
m_outputProperties.setQNameProperties(OutputKeys.CDATA_SECTION_ELEMENTS, newValue);
} | java | public void setCdataSectionElements(java.util.Vector newValue)
{
m_outputProperties.setQNameProperties(OutputKeys.CDATA_SECTION_ELEMENTS, newValue);
} | [
"public",
"void",
"setCdataSectionElements",
"(",
"java",
".",
"util",
".",
"Vector",
"newValue",
")",
"{",
"m_outputProperties",
".",
"setQNameProperties",
"(",
"OutputKeys",
".",
"CDATA_SECTION_ELEMENTS",
",",
"newValue",
")",
";",
"}"
] | Set the cdata-section-elements property from the attribute value.
@see javax.xml.transform.OutputKeys#CDATA_SECTION_ELEMENTS
@param newValue non-null reference to processed attribute value. | [
"Set",
"the",
"cdata",
"-",
"section",
"-",
"elements",
"property",
"from",
"the",
"attribute",
"value",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java#L52-L55 |
33,795 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java | ProcessorOutputElem.setMethod | public void setMethod(org.apache.xml.utils.QName newValue)
{
m_outputProperties.setQNameProperty(OutputKeys.METHOD, newValue);
} | java | public void setMethod(org.apache.xml.utils.QName newValue)
{
m_outputProperties.setQNameProperty(OutputKeys.METHOD, newValue);
} | [
"public",
"void",
"setMethod",
"(",
"org",
".",
"apache",
".",
"xml",
".",
"utils",
".",
"QName",
"newValue",
")",
"{",
"m_outputProperties",
".",
"setQNameProperty",
"(",
"OutputKeys",
".",
"METHOD",
",",
"newValue",
")",
";",
"}"
] | Set the method property from the attribute value.
@see javax.xml.transform.OutputKeys#METHOD
@param newValue non-null reference to processed attribute value. | [
"Set",
"the",
"method",
"property",
"from",
"the",
"attribute",
"value",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java#L112-L115 |
33,796 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java | ProcessorOutputElem.setForeignAttr | public void setForeignAttr(String attrUri, String attrLocalName, String attrRawName, String attrValue)
{
QName key = new QName(attrUri, attrLocalName);
m_outputProperties.setProperty(key, attrValue);
} | java | public void setForeignAttr(String attrUri, String attrLocalName, String attrRawName, String attrValue)
{
QName key = new QName(attrUri, attrLocalName);
m_outputProperties.setProperty(key, attrValue);
} | [
"public",
"void",
"setForeignAttr",
"(",
"String",
"attrUri",
",",
"String",
"attrLocalName",
",",
"String",
"attrRawName",
",",
"String",
"attrValue",
")",
"{",
"QName",
"key",
"=",
"new",
"QName",
"(",
"attrUri",
",",
"attrLocalName",
")",
";",
"m_outputProp... | Set a foreign property from the attribute value.
@param newValue non-null reference to attribute value. | [
"Set",
"a",
"foreign",
"property",
"from",
"the",
"attribute",
"value",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java#L151-L155 |
33,797 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java | CharsTrie.saveState | public CharsTrie saveState(State state) /*const*/ {
state.chars=chars_;
state.root=root_;
state.pos=pos_;
state.remainingMatchLength=remainingMatchLength_;
return this;
} | java | public CharsTrie saveState(State state) /*const*/ {
state.chars=chars_;
state.root=root_;
state.pos=pos_;
state.remainingMatchLength=remainingMatchLength_;
return this;
} | [
"public",
"CharsTrie",
"saveState",
"(",
"State",
"state",
")",
"/*const*/",
"{",
"state",
".",
"chars",
"=",
"chars_",
";",
"state",
".",
"root",
"=",
"root_",
";",
"state",
".",
"pos",
"=",
"pos_",
";",
"state",
".",
"remainingMatchLength",
"=",
"remai... | Saves the state of this trie.
@param state The State object to hold the trie's state.
@return this
@see #resetToState | [
"Saves",
"the",
"state",
"of",
"this",
"trie",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java#L95-L101 |
33,798 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java | CharsTrie.resetToState | public CharsTrie resetToState(State state) {
if(chars_==state.chars && chars_!=null && root_==state.root) {
pos_=state.pos;
remainingMatchLength_=state.remainingMatchLength;
} else {
throw new IllegalArgumentException("incompatible trie state");
}
return this;
} | java | public CharsTrie resetToState(State state) {
if(chars_==state.chars && chars_!=null && root_==state.root) {
pos_=state.pos;
remainingMatchLength_=state.remainingMatchLength;
} else {
throw new IllegalArgumentException("incompatible trie state");
}
return this;
} | [
"public",
"CharsTrie",
"resetToState",
"(",
"State",
"state",
")",
"{",
"if",
"(",
"chars_",
"==",
"state",
".",
"chars",
"&&",
"chars_",
"!=",
"null",
"&&",
"root_",
"==",
"state",
".",
"root",
")",
"{",
"pos_",
"=",
"state",
".",
"pos",
";",
"remai... | Resets this trie to the saved state.
@param state The State object which holds a saved trie state.
@return this
@throws IllegalArgumentException if the state object contains no state,
or the state of a different trie
@see #saveState
@see #reset | [
"Resets",
"this",
"trie",
"to",
"the",
"saved",
"state",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java#L112-L120 |
33,799 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java | CharsTrie.current | public Result current() /*const*/ {
int pos=pos_;
if(pos<0) {
return Result.NO_MATCH;
} else {
int node;
return (remainingMatchLength_<0 && (node=chars_.charAt(pos))>=kMinValueLead) ?
valueResults_[node>>15] : Result.NO_VALUE;
}
} | java | public Result current() /*const*/ {
int pos=pos_;
if(pos<0) {
return Result.NO_MATCH;
} else {
int node;
return (remainingMatchLength_<0 && (node=chars_.charAt(pos))>=kMinValueLead) ?
valueResults_[node>>15] : Result.NO_VALUE;
}
} | [
"public",
"Result",
"current",
"(",
")",
"/*const*/",
"{",
"int",
"pos",
"=",
"pos_",
";",
"if",
"(",
"pos",
"<",
"0",
")",
"{",
"return",
"Result",
".",
"NO_MATCH",
";",
"}",
"else",
"{",
"int",
"node",
";",
"return",
"(",
"remainingMatchLength_",
"... | Determines whether the string so far matches, whether it has a value,
and whether another input char can continue a matching string.
@return The match/value Result. | [
"Determines",
"whether",
"the",
"string",
"so",
"far",
"matches",
"whether",
"it",
"has",
"a",
"value",
"and",
"whether",
"another",
"input",
"char",
"can",
"continue",
"a",
"matching",
"string",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java#L127-L136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.