_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q28900
TypeUtil.getReferenceSignature
train
public String getReferenceSignature(ExecutableElement element) { StringBuilder sb = new StringBuilder("("); // If the method is an inner class constructor, prepend the outer class type. if (ElementUtil.isConstructor(element)) { TypeElement declaringClass = ElementUtil.getDeclaringClass(element); ...
java
{ "resource": "" }
q28901
RandomAccessFile.getFilePointer
train
public long getFilePointer() throws IOException { try { return Libcore.os.lseek(fd, 0L, SEEK_CUR); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
java
{ "resource": "" }
q28902
RandomAccessFile.length
train
public long length() throws IOException { try { return Libcore.os.fstat(fd).st_size; } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
java
{ "resource": "" }
q28903
RandomAccessFile.readInt
train
public final int readInt() throws IOException { readFully(scratch, 0, SizeOf.INT); return Memory.peekInt(scratch, 0, ByteOrder.BIG_ENDIAN); }
java
{ "resource": "" }
q28904
Timestamp.readObject
train
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { ois.defaultReadObject(); myhash = -1; timestamp = new Date(timestamp.getTime()); }
java
{ "resource": "" }
q28905
ReflectUtil.checkPackageAccess
train
public static void checkPackageAccess(Class<?> clazz) { checkPackageAccess(clazz.getName()); if (isNonPublicProxyClass(clazz)) { checkProxyPackageAccess(clazz); } }
java
{ "resource": "" }
q28906
ReflectUtil.isAncestor
train
private static boolean isAncestor(ClassLoader p, ClassLoader cl) { ClassLoader acl = cl; do { acl = acl.getParent(); if (p == acl) { return true; } } while (acl != null); return false; }
java
{ "resource": "" }
q28907
ReflectUtil.needsPackageAccessCheck
train
public static boolean needsPackageAccessCheck(ClassLoader from, ClassLoader to) { if (from == null || from == to) return false; if (to == null) return true; return !isAncestor(from, to); }
java
{ "resource": "" }
q28908
ReflectUtil.checkProxyPackageAccess
train
public static void checkProxyPackageAccess(Class<?> clazz) { SecurityManager s = System.getSecurityManager(); if (s != null) { // check proxy interfaces if the given class is a proxy class if (Proxy.isProxyClass(clazz)) { for (Class<?> intf : clazz.getInterfaces()...
java
{ "resource": "" }
q28909
ReflectUtil.isNonPublicProxyClass
train
public static boolean isNonPublicProxyClass(Class<?> cls) { String name = cls.getName(); int i = name.lastIndexOf('.'); String pkg = (i != -1) ? name.substring(0, i) : ""; // NOTE: Android creates proxies in the "default" package (and not com.sun.proxy), which // makes this chec...
java
{ "resource": "" }
q28910
TranslationUtil.retainResult
train
public static Expression retainResult(Expression node) { switch (node.getKind()) { case ARRAY_CREATION: ((ArrayCreation) node).setHasRetainedResult(true); return TreeUtil.remove(node); case CLASS_INSTANCE_CREATION: ((ClassInstanceCreation) node).setHasRetainedResult(true); ...
java
{ "resource": "" }
q28911
TranslationUtil.hasSideEffect
train
public static boolean hasSideEffect(Expression expr) { VariableElement var = TreeUtil.getVariableElement(expr); if (var != null && ElementUtil.isVolatile(var)) { return true; } switch (expr.getKind()) { case BOOLEAN_LITERAL: case CHARACTER_LITERAL: case NULL_LITERAL: case N...
java
{ "resource": "" }
q28912
TranslationUtil.getOperatorFunctionModifier
train
public String getOperatorFunctionModifier(Expression expr) { VariableElement var = TreeUtil.getVariableElement(expr); if (var == null) { assert TreeUtil.trimParentheses(expr) instanceof ArrayAccess : "Expression cannot be resolved to a variable or array access."; return "Array"; } ...
java
{ "resource": "" }
q28913
Period.at
train
public static Period at(float count, TimeUnit unit) { checkCount(count); return new Period(ETimeLimit.NOLIMIT, false, count, unit); }
java
{ "resource": "" }
q28914
Period.moreThan
train
public static Period moreThan(float count, TimeUnit unit) { checkCount(count); return new Period(ETimeLimit.MT, false, count, unit); }
java
{ "resource": "" }
q28915
Period.lessThan
train
public static Period lessThan(float count, TimeUnit unit) { checkCount(count); return new Period(ETimeLimit.LT, false, count, unit); }
java
{ "resource": "" }
q28916
Period.isSet
train
public boolean isSet() { for (int i = 0; i < counts.length; ++i) { if (counts[i] != 0) { return true; } } return false; }
java
{ "resource": "" }
q28917
Period.getCount
train
public float getCount(TimeUnit unit) { int ord = unit.ordinal; if (counts[ord] == 0) { return 0; } return (counts[ord] - 1)/1000f; }
java
{ "resource": "" }
q28918
Period.setTimeUnitValue
train
private Period setTimeUnitValue(TimeUnit unit, float value) { if (value < 0) { throw new IllegalArgumentException("value: " + value); } return setTimeUnitInternalValue(unit, (int)(value * 1000) + 1); }
java
{ "resource": "" }
q28919
AlgorithmParameterGenerator.init
train
public final void init(AlgorithmParameterSpec genParamSpec, SecureRandom random) throws InvalidAlgorithmParameterException { paramGenSpi.engineInit(genParamSpec, random); }
java
{ "resource": "" }
q28920
ArrayMap.containsKey
train
@Override public boolean containsKey(Object key) { return key == null ? (indexOfNull() >= 0) : (indexOf(key, key.hashCode()) >= 0); }
java
{ "resource": "" }
q28921
ArrayMap.setValueAt
train
public V setValueAt(int index, V value) { index = (index << 1) + 1; V old = (V)mArray[index]; mArray[index] = value; return old; }
java
{ "resource": "" }
q28922
ArrayMap.append
train
public void append(K key, V value) { int index = mSize; final int hash = key == null ? 0 : key.hashCode(); if (index >= mHashes.length) { throw new IllegalStateException("Array is full"); } if (index > 0 && mHashes[index-1] > hash) { RuntimeException e = n...
java
{ "resource": "" }
q28923
X509CertSelector.setPathToNamesInternal
train
void setPathToNamesInternal(Set<GeneralNameInterface> names) { // set names to non-null dummy value // this breaks getPathToNames() pathToNames = Collections.<List<?>>emptySet(); pathToGeneralNames = names; }
java
{ "resource": "" }
q28924
HandshakeCompletedEvent.getPeerPrincipal
train
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { Principal principal; try { principal = session.getPeerPrincipal(); } catch (AbstractMethodError e) { // if the provider does not support it, fallback to peer certs. // retu...
java
{ "resource": "" }
q28925
HandshakeCompletedEvent.getLocalPrincipal
train
public Principal getLocalPrincipal() { Principal principal; try { principal = session.getLocalPrincipal(); } catch (AbstractMethodError e) { principal = null; // if the provider does not support it, fallback to local certs. // return the X500Pr...
java
{ "resource": "" }
q28926
PKIXRevocationChecker.setOcspExtensions
train
public void setOcspExtensions(List<Extension> extensions) { this.ocspExtensions = (extensions == null) ? Collections.<Extension>emptyList() : new ArrayList<Extension>(extensions); }
java
{ "resource": "" }
q28927
PKIXRevocationChecker.setOcspResponses
train
public void setOcspResponses(Map<X509Certificate, byte[]> responses) { if (responses == null) { this.ocspResponses = Collections.<X509Certificate, byte[]>emptyMap(); } else { Map<X509Certificate, byte[]> copy = new HashMap<>(responses.size()); for (Map.Entry<X509C...
java
{ "resource": "" }
q28928
PKIXRevocationChecker.getOcspResponses
train
public Map<X509Certificate, byte[]> getOcspResponses() { Map<X509Certificate, byte[]> copy = new HashMap<>(ocspResponses.size()); for (Map.Entry<X509Certificate, byte[]> e : ocspResponses.entrySet()) { copy.put(e.getKey(), e.getValue().clone()); } return copy; }
java
{ "resource": "" }
q28929
PKIXRevocationChecker.setOptions
train
public void setOptions(Set<Option> options) { this.options = (options == null) ? Collections.<Option>emptySet() : new HashSet<Option>(options); }
java
{ "resource": "" }
q28930
NodeSet.runTo
train
public void runTo(int index) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); if ((index >= 0) && (m_next < m_firstFree)) m_next = index; ...
java
{ "resource": "" }
q28931
NodeSet.addNode
train
public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
java
{ "resource": "" }
q28932
NodeSet.addNodesInDocOrder
train
private boolean addNodesInDocOrder(int start, int end, int testIndex, NodeList nodelist, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!...
java
{ "resource": "" }
q28933
NodeSet.setCurrentPos
train
public void setCurrentPos(int i) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); m_next = i; }
java
{ "resource": "" }
q28934
Utility.objectEquals
train
public final static boolean objectEquals(Object a, Object b) { return a == null ? b == null ? true : false : b == null ? false : a.equals(b); }
java
{ "resource": "" }
q28935
Utility.checkCompare
train
public static <T extends Comparable<T>> int checkCompare(T a, T b) { return a == null ? b == null ? 0 : -1 : b == null ? 1 : a.compareTo(b); }
java
{ "resource": "" }
q28936
Utility.appendEncodedByte
train
private static final <T extends Appendable> void appendEncodedByte(T buffer, byte value, byte[] state) { try { if (state[0] != 0) { char c = (char) ((state[1] << 8) | ((value) & 0xFF)); buffer.append(c); state[0] = 0; } ...
java
{ "resource": "" }
q28937
Utility.RLEStringToIntArray
train
static public final int[] RLEStringToIntArray(String s) { int length = getInt(s, 0); int[] array = new int[length]; int ai = 0, i = 1; int maxI = s.length() / 2; while (ai < length && i < maxI) { int c = getInt(s, i++); if (c == ESCAPE) { ...
java
{ "resource": "" }
q28938
Utility.RLEStringToShortArray
train
static public final short[] RLEStringToShortArray(String s) { int length = ((s.charAt(0)) << 16) | (s.charAt(1)); short[] array = new short[length]; int ai = 0; for (int i=2; i<s.length(); ++i) { char c = s.charAt(i); if (c == ESCAPE) { c = s.charA...
java
{ "resource": "" }
q28939
Utility.RLEStringToByteArray
train
static public final byte[] RLEStringToByteArray(String s) { int length = ((s.charAt(0)) << 16) | (s.charAt(1)); byte[] array = new byte[length]; boolean nextChar = true; char c = 0; int node = 0; int runLength = 0; int i = 2; for (int ai=0; ai<length; ) { ...
java
{ "resource": "" }
q28940
Utility.format1ForSource
train
static public final String format1ForSource(String s) { StringBuilder buffer = new StringBuilder(); buffer.append("\""); for (int i=0; i<s.length();) { char c = s.charAt(i++); if (c < '\u0020' || c == '"' || c == '\\') { if (c == '\n') { ...
java
{ "resource": "" }
q28941
Utility.escape
train
public static final String escape(String s) { StringBuilder buf = new StringBuilder(); for (int i=0; i<s.length(); ) { int c = Character.codePointAt(s, i); i += UTF16.getCharCount(c); if (c >= ' ' && c <= 0x007F) { if (c == '\\') { ...
java
{ "resource": "" }
q28942
Utility.lookup
train
public static int lookup(String source, String[] target) { for (int i = 0; i < target.length; ++i) { if (source.equals(target[i])) return i; } return -1; }
java
{ "resource": "" }
q28943
Utility.parseChar
train
public static boolean parseChar(String id, int[] pos, char ch) { int start = pos[0]; pos[0] = PatternProps.skipWhiteSpace(id, pos[0]); if (pos[0] == id.length() || id.charAt(pos[0]) != ch) { pos[0] = start; return false; } ++pos[0]; ...
java
{ "resource": "" }
q28944
Utility.parsePattern
train
@SuppressWarnings("fallthrough") public static int parsePattern(String rule, int pos, int limit, String pattern, int[] parsedInts) { // TODO Update this to handle surrogates int[] p = new int[1]; int intCount = 0; // number of integers parsed for (int i=0; i<pattern.lengt...
java
{ "resource": "" }
q28945
Utility.parseUnicodeIdentifier
train
public static String parseUnicodeIdentifier(String str, int[] pos) { // assert(pos[0] < str.length()); StringBuilder buf = new StringBuilder(); int p = pos[0]; while (p < str.length()) { int ch = Character.codePointAt(str, p); if (buf.length() == 0) { ...
java
{ "resource": "" }
q28946
Utility.appendNumber
train
public static <T extends Appendable> T appendNumber(T result, int n, int radix, int minDigits) { try { if (radix < 2 || radix > 36) { throw new IllegalArgumentException("Illegal radix " + radix); } int abs = n; if (n < 0) { ...
java
{ "resource": "" }
q28947
Utility.appendToRule
train
public static void appendToRule(StringBuffer rule, String text, boolean isLiteral, boolean escapeUnprintable, StringBuffer quoteBuf) { for (int i=0; i<text.length(); ++i) { // Okay to process in 16-bit code units here appendToRule(rule, tex...
java
{ "resource": "" }
q28948
Utility.compareUnsigned
train
public static final int compareUnsigned(int source, int target) { source += MAGIC_UNSIGNED; target += MAGIC_UNSIGNED; if (source < target) { return -1; } else if (source > target) { return 1; } return 0; }
java
{ "resource": "" }
q28949
Utility.highBit
train
public static final byte highBit(int n) { if (n <= 0) { return -1; } byte bit = 0; if (n >= 1 << 16) { n >>= 16; bit += 16; } if (n >= 1 << 8) { n >>= 8; bit += 8; } if (n >= 1 << 4) { ...
java
{ "resource": "" }
q28950
XPath.setExpression
train
public void setExpression(Expression exp) { if(null != m_mainExp) exp.exprSetParent(m_mainExp.exprGetParent()); // a bit bogus m_mainExp = exp; }
java
{ "resource": "" }
q28951
ElemContext.push
train
final ElemContext push() { ElemContext frame = this.m_next; if (frame == null) { /* We have never been at this depth yet, and there is no * stack frame to re-use, so we now make a new one. */ frame = new ElemContext(this); this.m_...
java
{ "resource": "" }
q28952
ElemContext.push
train
final ElemContext push( final String uri, final String localName, final String qName) { ElemContext frame = this.m_next; if (frame == null) { /* We have never been at this depth yet, and there is no * stack frame to re-use, so we now make a ne...
java
{ "resource": "" }
q28953
PBEKeySpec.clearPassword
train
public final void clearPassword() { if (password != null) { for (int i = 0; i < password.length; i++) { password[i] = ' '; } password = null; } }
java
{ "resource": "" }
q28954
InflaterOutputStream.flush
train
public void flush() throws IOException { ensureOpen(); // Finish decompressing and writing pending output data if (!inf.finished()) { try { while (!inf.finished() && !inf.needsInput()) { int n; // Decompress pending output d...
java
{ "resource": "" }
q28955
InflaterOutputStream.write
train
public void write(byte[] b, int off, int len) throws IOException { // Sanity checks ensureOpen(); if (b == null) { throw new NullPointerException("Null buffer for read"); } else if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(...
java
{ "resource": "" }
q28956
InMemoryCookieStore.add
train
public void add(URI uri, HttpCookie cookie) { // pre-condition : argument can't be null if (cookie == null) { throw new NullPointerException("cookie is null"); } lock.lock(); try { if (cookie.getMaxAge() != 0) { addIndex(uriIndex, getEffec...
java
{ "resource": "" }
q28957
InMemoryCookieStore.getCookies
train
public List<HttpCookie> getCookies() { List<HttpCookie> rt = new ArrayList<HttpCookie>(); lock.lock(); try { for (List<HttpCookie> list : uriIndex.values()) { Iterator<HttpCookie> it = list.iterator(); while (it.hasNext()) { HttpCo...
java
{ "resource": "" }
q28958
InMemoryCookieStore.getURIs
train
public List<URI> getURIs() { List<URI> uris = new ArrayList<URI>(); lock.lock(); try { List<URI> result = new ArrayList<URI>(uriIndex.keySet()); result.remove(null); return Collections.unmodifiableList(result); } finally { uris.addAll(uriI...
java
{ "resource": "" }
q28959
InMemoryCookieStore.remove
train
public boolean remove(URI uri, HttpCookie ck) { // argument can't be null if (ck == null) { throw new NullPointerException("cookie is null"); } lock.lock(); try { uri = getEffectiveURI(uri); if (uriIndex.get(uri) == null) { ret...
java
{ "resource": "" }
q28960
InMemoryCookieStore.removeAll
train
public boolean removeAll() { lock.lock(); boolean result = false; try { result = !uriIndex.isEmpty(); uriIndex.clear(); } finally { lock.unlock(); } return result; }
java
{ "resource": "" }
q28961
InMemoryCookieStore.getInternal2
train
private <T extends Comparable<T>> void getInternal2(List<HttpCookie> cookies, Map<T, List<HttpCookie>> cookieIndex, T comparator) { // Removed cookieJar for (T index : cookieIndex.keySet()) { if ((index == comparator) || (index != null && comparator.comp...
java
{ "resource": "" }
q28962
InMemoryCookieStore.addIndex
train
private <T> void addIndex(Map<T, List<HttpCookie>> indexStore, T index, HttpCookie cookie) { // Android-changed : "index" can be null. We only use the URI based // index on Android and we want to support null URIs. The underlying //...
java
{ "resource": "" }
q28963
CurrencyPluralInfo.getCurrencyPluralPattern
train
public String getCurrencyPluralPattern(String pluralCount) { String currencyPluralPattern = pluralCountToCurrencyUnitPattern.get(pluralCount); if (currencyPluralPattern == null) { // fall back to "other" if (!pluralCount.equals("other")) { currencyPluralPattern = ...
java
{ "resource": "" }
q28964
LocaleIDParser.set
train
private void set(int pos, String s) { buffer.delete(pos, buffer.length()); buffer.insert(pos, s); }
java
{ "resource": "" }
q28965
LocaleIDParser.haveKeywordAssign
train
private boolean haveKeywordAssign() { // assume it is safe to start from index for (int i = index; i < id.length; ++i) { if (id[i] == KEYWORD_ASSIGN) { return true; } } return false; }
java
{ "resource": "" }
q28966
LocaleIDParser.parseLanguage
train
private int parseLanguage() { int startLength = buffer.length(); if (haveExperimentalLanguagePrefix()) { append(AsciiUtil.toLower(id[0])); append(HYPHEN); index = 2; } char c; while(!isTerminatorOrIDSeparator(c = next())) { append...
java
{ "resource": "" }
q28967
LocaleIDParser.parseVariant
train
private int parseVariant() { int oldBlen = buffer.length(); boolean start = true; boolean needSeparator = true; boolean skipping = false; char c; boolean firstPass = true; while ((c = next()) != DONE) { if (c == DOT) { start = false; ...
java
{ "resource": "" }
q28968
LocaleIDParser.getLanguageScriptCountryVariant
train
public String[] getLanguageScriptCountryVariant() { reset(); return new String[] { getString(parseLanguage()), getString(parseScript()), getString(parseCountry()), getString(parseVariant()) }; }
java
{ "resource": "" }
q28969
LocaleIDParser.setToKeywordStart
train
private boolean setToKeywordStart() { for (int i = index; i < id.length; ++i) { if (id[i] == KEYWORD_SEPARATOR) { if (canonicalize) { for (int j = ++i; j < id.length; ++j) { // increment i past separator for return if (id[j] == KEYWORD_ASSI...
java
{ "resource": "" }
q28970
LocaleIDParser.getKeywordMap
train
public Map<String, String> getKeywordMap() { if (keywords == null) { TreeMap<String, String> m = null; if (setToKeywordStart()) { // trim spaces and convert to lower case, both keywords and values. do { String key = getKeyword(); ...
java
{ "resource": "" }
q28971
LocaleIDParser.parseKeywords
train
private int parseKeywords() { int oldBlen = buffer.length(); Map<String, String> m = getKeywordMap(); if (!m.isEmpty()) { boolean first = true; for (Map.Entry<String, String> e : m.entrySet()) { append(first ? KEYWORD_SEPARATOR : ITEM_SEPARATOR); ...
java
{ "resource": "" }
q28972
LocaleIDParser.getKeywords
train
public Iterator<String> getKeywords() { Map<String, String> m = getKeywordMap(); return m.isEmpty() ? null : m.keySet().iterator(); }
java
{ "resource": "" }
q28973
LocaleIDParser.getKeywordValue
train
public String getKeywordValue(String keywordName) { Map<String, String> m = getKeywordMap(); return m.isEmpty() ? null : m.get(AsciiUtil.toLowerString(keywordName.trim())); }
java
{ "resource": "" }
q28974
PluralFormat.applyPattern
train
public void applyPattern(String pattern) { this.pattern = pattern; if (msgPattern == null) { msgPattern = new MessagePattern(); } try { msgPattern.parsePluralStyle(pattern); offset = msgPattern.getPluralOffset(0); } catch(RuntimeException e) { ...
java
{ "resource": "" }
q28975
PKCS9Attributes.decode
train
private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding)...
java
{ "resource": "" }
q28976
PKCS9Attributes.encode
train
public void encode(byte tag, OutputStream out) throws IOException { out.write(tag); out.write(derEncoding, 1, derEncoding.length -1); }
java
{ "resource": "" }
q28977
PKCS9Attributes.getAttributes
train
public PKCS9Attribute[] getAttributes() { PKCS9Attribute[] attribs = new PKCS9Attribute[attributes.size()]; ObjectIdentifier oid; int j = 0; for (int i=1; i < PKCS9Attribute.PKCS9_OIDS.length && j < attribs.length; i++) { attribs[j] = getAttribute(PKCS9...
java
{ "resource": "" }
q28978
PKCS9Attributes.getAttributeValue
train
public Object getAttributeValue(ObjectIdentifier oid) throws IOException { try { Object value = getAttribute(oid).getValue(); return value; } catch (NullPointerException ex) { throw new IOException("No value found for attribute " + oid); } }
java
{ "resource": "" }
q28979
PKCS9Attributes.getAttributeValue
train
public Object getAttributeValue(String name) throws IOException { ObjectIdentifier oid = PKCS9Attribute.getOID(name); if (oid == null) throw new IOException("Attribute name " + name + " not recognized or not supported."); return getAttributeValue(o...
java
{ "resource": "" }
q28980
GregorianCalendar.roll
train
public void roll(int field, int amount) { switch (field) { case WEEK_OF_YEAR: { // Unlike WEEK_OF_MONTH, WEEK_OF_YEAR never shifts the day of the // week. Also, rolling the week of the year can have seemingly // strange effects simply because...
java
{ "resource": "" }
q28981
GregorianCalendar.getActualMaximum
train
public int getActualMaximum(int field) { /* It is a known limitation that the code here (and in getActualMinimum) * won't behave properly at the extreme limits of GregorianCalendar's * representable range (except for the code that handles the YEAR * field). That's because the ends of...
java
{ "resource": "" }
q28982
KeyChecker.check
train
@Override public void check(Certificate cert, Collection<String> unresCritExts) throws CertPathValidatorException { X509Certificate currCert = (X509Certificate)cert; remainingCerts--; // if final certificate, check that target constraints are satisfied if (remainingCert...
java
{ "resource": "" }
q28983
Autoboxer.unbox
train
private void unbox(Expression expr, PrimitiveType primitiveType) { TypeElement boxedClass = findBoxedSuperclass(expr.getTypeMirror()); if (primitiveType == null && boxedClass != null) { primitiveType = typeUtil.unboxedType(boxedClass.asType()); } if (primitiveType == null) { return; } ...
java
{ "resource": "" }
q28984
Integer.getInteger
train
public static Integer getInteger(String nm, int val) { Integer result = getInteger(nm, null); return (result == null) ? Integer.valueOf(val) : result; }
java
{ "resource": "" }
q28985
DateFormat.format
train
@Override public final StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition fieldPosition) { if (obj instanceof Calendar) return format( (Calendar)obj, toAppendTo, fieldPosition ); else if (obj instanceof Date) return...
java
{ "resource": "" }
q28986
DateFormat.getDateInstance
train
public final static DateFormat getDateInstance(int style, Locale aLocale) { return get(style, -1, ULocale.forLocale(aLocale), null); }
java
{ "resource": "" }
q28987
DateFormat.setBooleanAttribute
train
public DateFormat setBooleanAttribute(BooleanAttribute key, boolean value) { if(key.equals(DateFormat.BooleanAttribute.PARSE_PARTIAL_MATCH)) { key = DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH; } if(value) { booleanAttributes.add(key); } ...
java
{ "resource": "" }
q28988
DateFormat.getBooleanAttribute
train
public boolean getBooleanAttribute(BooleanAttribute key) { if(key == DateFormat.BooleanAttribute.PARSE_PARTIAL_MATCH) { key = DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH; } return booleanAttributes.contains(key); }
java
{ "resource": "" }
q28989
HasPositionalPredChecker.check
train
public static boolean check(LocPathIterator path) { HasPositionalPredChecker hppc = new HasPositionalPredChecker(); path.callVisitors(null, hppc); return hppc.m_hasPositionalPred; }
java
{ "resource": "" }
q28990
Nodes.emptyNode
train
@SuppressWarnings("unchecked") static <T> Node<T> emptyNode(StreamShape shape) { switch (shape) { case REFERENCE: return (Node<T>) EMPTY_NODE; case INT_VALUE: return (Node<T>) EMPTY_INT_NODE; case LONG_VALUE: return (Node<T>) EMPTY_LONG_NODE; case DOUB...
java
{ "resource": "" }
q28991
USerializedSet.getSet
train
public final boolean getSet(char src[], int srcStart) { // leave most argument checking up to Java exceptions array=null; arrayOffset=bmpLength=length=0; length=src[srcStart++]; if ((length&0x8000) != 0) { /* there are supplementary values */ len...
java
{ "resource": "" }
q28992
USerializedSet.getRange
train
public final boolean getRange(int rangeIndex, int[] range) { if( rangeIndex<0) { return false; } if(array==null){ array = new char[8]; } if(range==null || range.length <2){ throw new IllegalArgumentException(); } rangeIndex*=2; ...
java
{ "resource": "" }
q28993
USerializedSet.contains
train
public final boolean contains(int c) { if(c>0x10ffff) { return false; } if(c<=0xffff) { int i; /* find c in the BMP part */ for(i=0; i<bmpLength && (char)c>=array[i]; ++i) {} return ((i&1) != 0); } else { ...
java
{ "resource": "" }
q28994
AtomicStampedReference.set
train
public void set(V newReference, int newStamp) { Pair<V> current = pair; if (newReference != current.reference || newStamp != current.stamp) this.pair = Pair.of(newReference, newStamp); }
java
{ "resource": "" }
q28995
EllipticCurve.checkValidity
train
private static void checkValidity(ECField field, BigInteger c, String cName) { // can only perform check if field is ECFieldFp or ECFieldF2m. if (field instanceof ECFieldFp) { BigInteger p = ((ECFieldFp)field).getP(); if (p.compareTo(c) != 1) { throw new I...
java
{ "resource": "" }
q28996
ZoneRegion.checkName
train
private static void checkName(String zoneId) { int n = zoneId.length(); if (n < 2) { throw new DateTimeException("Invalid ID for region-based ZoneId, invalid format: " + zoneId); } for (int i = 0; i < n; i++) { char c = zoneId.charAt(i); if (c >= 'a' &&...
java
{ "resource": "" }
q28997
TreeMap.compare
train
@SuppressWarnings("unchecked") final int compare(Object k1, Object k2) { return comparator==null ? ((Comparable<? super K>)k1).compareTo((K)k2) : comparator.compare((K)k1, (K)k2); }
java
{ "resource": "" }
q28998
TreeMap.readTreeSet
train
void readTreeSet(int size, java.io.ObjectInputStream s, V defaultVal) throws java.io.IOException, ClassNotFoundException { buildFromSorted(size, null, s, defaultVal); }
java
{ "resource": "" }
q28999
TreeMap.keySpliteratorFor
train
static <K> Spliterator<K> keySpliteratorFor(NavigableMap<K,?> m) { if (m instanceof TreeMap) { @SuppressWarnings("unchecked") TreeMap<K,Object> t = (TreeMap<K,Object>) m; return t.keySpliterator(); } if (m instanceof DescendingSubMap) { @Suppre...
java
{ "resource": "" }