_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q29600
SocketFactory.createSocket
train
public Socket createSocket() throws IOException { // // bug 6771432: // The Exception is used by HttpsClient to signal that // unconnected sockets have not been implemented. // UnsupportedOperationException uop = new UnsupportedOperationException(); ...
java
{ "resource": "" }
q29601
StylesheetComposed.recompose
train
public void recompose(Vector recomposableElements) throws TransformerException { //recomposeImports(); // Calculate the number of this import. //recomposeIncludes(this); // Build the global include list for this stylesheet. // Now add in all of the recomposable elements at this precedence lev...
java
{ "resource": "" }
q29602
StylesheetComposed.recomposeImports
train
void recomposeImports() { m_importNumber = getStylesheetRoot().getImportNumber(this); StylesheetRoot root = getStylesheetRoot(); int globalImportCount = root.getGlobalImportCount(); m_importCountComposed = (globalImportCount - m_importNumber) - 1; // Now get the count of composed imports f...
java
{ "resource": "" }
q29603
StylesheetComposed.recomposeIncludes
train
void recomposeIncludes(Stylesheet including) { int n = including.getIncludeCount(); if (n > 0) { if (null == m_includesComposed) m_includesComposed = new Vector(); for (int i = 0; i < n; i++) { Stylesheet included = including.getInclude(i); m_includesComposed.a...
java
{ "resource": "" }
q29604
StringRange.compact
train
public static void compact(Set<String> source, Adder adder, boolean shorterPairs, boolean moreCompact) { if (!moreCompact) { String start = null; String end = null; int lastCp = 0; int prefixLen = 0; for (String s : source) { if (start ...
java
{ "resource": "" }
q29605
StringRange.compact
train
public static void compact(Set<String> source, Adder adder, boolean shorterPairs) { compact(source,adder,shorterPairs,false); }
java
{ "resource": "" }
q29606
Hashing.singleWordWangJenkinsHash
train
public static int singleWordWangJenkinsHash(Object k) { int h = k.hashCode(); h += (h << 15) ^ 0xffffcd7d; h ^= (h >>> 10); h += (h << 3); h ^= (h >>> 6); h += (h << 2) + (h << 14); return h ^ (h >>> 16); }
java
{ "resource": "" }
q29607
XPathParser.initXPath
train
public void initXPath( Compiler compiler, String expression, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { m_ops = compiler; m_namespaceContext = namespaceContext; m_functionTable = compiler.getFunctionTable(); Lexer lexer = new Lexer(compil...
java
{ "resource": "" }
q29608
XPathParser.tokenIs
train
final boolean tokenIs(String s) { return (m_token != null) ? (m_token.equals(s)) : (s == null); }
java
{ "resource": "" }
q29609
XPathParser.lookbehind
train
private final boolean lookbehind(char c, int n) { boolean isToken; int lookBehindPos = m_queueMark - (n + 1); if (lookBehindPos >= 0) { String lookbehind = (String) m_ops.m_tokenQueue.elementAt(lookBehindPos); if (lookbehind.length() == 1) { char c0 = (lookbehind == null) ...
java
{ "resource": "" }
q29610
XPathParser.lookbehindHasToken
train
private final boolean lookbehindHasToken(int n) { boolean hasToken; if ((m_queueMark - n) > 0) { String lookbehind = (String) m_ops.m_tokenQueue.elementAt(m_queueMark - (n - 1)); char c0 = (lookbehind == null) ? '|' : lookbehind.charAt(0); hasToken = (c0 == '|') ? false : true; } ...
java
{ "resource": "" }
q29611
XPathParser.nextToken
train
private final void nextToken() { if (m_queueMark < m_ops.getTokenQueueSize()) { m_token = (String) m_ops.m_tokenQueue.elementAt(m_queueMark++); m_tokenChar = m_token.charAt(0); } else { m_token = null; m_tokenChar = 0; } }
java
{ "resource": "" }
q29612
XPathParser.getTokenRelative
train
private final String getTokenRelative(int i) { String tok; int relative = m_queueMark + i; if ((relative > 0) && (relative < m_ops.getTokenQueueSize())) { tok = (String) m_ops.m_tokenQueue.elementAt(relative); } else { tok = null; } return tok; }
java
{ "resource": "" }
q29613
XPathParser.prevToken
train
private final void prevToken() { if (m_queueMark > 0) { m_queueMark--; m_token = (String) m_ops.m_tokenQueue.elementAt(m_queueMark); m_tokenChar = m_token.charAt(0); } else { m_token = null; m_tokenChar = 0; } }
java
{ "resource": "" }
q29614
XPathParser.consumeExpected
train
private final void consumeExpected(String expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected, ...
java
{ "resource": "" }
q29615
XPathParser.dumpRemainingTokenQueue
train
protected String dumpRemainingTokenQueue() { int q = m_queueMark; String returnMsg; if (q < m_ops.getTokenQueueSize()) { String msg = "\n Remaining tokens: ("; while (q < m_ops.getTokenQueueSize()) { String t = (String) m_ops.m_tokenQueue.elementAt(q++); msg += ("...
java
{ "resource": "" }
q29616
XPathParser.getFunctionToken
train
final int getFunctionToken(String key) { int tok; Object id; try { // These are nodetests, xpathparser treats them as functions when parsing // a FilterExpr. id = Keywords.lookupNodeTest(key); if (null == id) id = m_functionTable.getFunctionID(key); tok = ((Intege...
java
{ "resource": "" }
q29617
XPathParser.insertOp
train
void insertOp(int pos, int length, int op) { int totalLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH); for (int i = totalLen - 1; i >= pos; i--) { m_ops.setOp(i + length, m_ops.getOp(i)); } m_ops.setOp(pos,op); m_ops.setOp(OpMap.MAPINDEX_LENGTH,totalLen + length); }
java
{ "resource": "" }
q29618
XPathParser.appendOp
train
void appendOp(int length, int op) { int totalLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH); m_ops.setOp(totalLen, op); m_ops.setOp(totalLen + OpMap.MAPINDEX_LENGTH, length); m_ops.setOp(OpMap.MAPINDEX_LENGTH, totalLen + length); }
java
{ "resource": "" }
q29619
XPathParser.UnionExpr
train
protected void UnionExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); boolean continueOrLoop = true; boolean foundUnion = false; do { PathExpr(); if (tokenIs('|')) { if (false == foundUnion) { fou...
java
{ "resource": "" }
q29620
XPathParser.Literal
train
protected void Literal() throws javax.xml.transform.TransformerException { int last = m_token.length() - 1; char c0 = m_tokenChar; char cX = m_token.charAt(last); if (((c0 == '\"') && (cX == '\"')) || ((c0 == '\'') && (cX == '\''))) { // Mutate the token to remove the quotes and have the ...
java
{ "resource": "" }
q29621
XMLStringFactoryImpl.newstr
train
public XMLString newstr(FastStringBuffer fsb, int start, int length) { return new XStringForFSB(fsb, start, length); }
java
{ "resource": "" }
q29622
InitializationNormalizer.getInitLocation
train
private List<Statement> getInitLocation(MethodDeclaration node) { List<Statement> stmts = node.getBody().getStatements(); if (!stmts.isEmpty() && stmts.get(0) instanceof SuperConstructorInvocation) { return stmts.subList(0, 1); } // java.lang.Object supertype is null. All other types should have a...
java
{ "resource": "" }
q29623
URIName.nameConstraint
train
public static URIName nameConstraint(DerValue value) throws IOException { URI uri; String name = value.getIA5String(); try { uri = new URI(name); } catch (URISyntaxException use) { throw new IOException("invalid URI name constraint:" + name, use); } ...
java
{ "resource": "" }
q29624
PropertyAnnotation.getAttributeKeyValue
train
private String getAttributeKeyValue(String key) { String prefix = key + '='; String attribute = getAttribute(prefix); return attribute != null ? attribute.substring(prefix.length()) : null; }
java
{ "resource": "" }
q29625
PropertyAnnotation.toAttributeString
train
public static String toAttributeString(Set<String> attributes) { List<String> list = new ArrayList<String>(attributes); Collections.sort(list, ATTRIBUTES_COMPARATOR); return Joiner.on(", ").join(list); }
java
{ "resource": "" }
q29626
Extension.newExtension
train
public static Extension newExtension(ObjectIdentifier extensionId, boolean critical, byte[] rawExtensionValue) throws IOException { Extension ext = new Extension(); ext.extensionId = extensionId; ext.critical = critical; ext.extensionValue = rawExtensionValue; return ext;...
java
{ "resource": "" }
q29627
Currency.getAvailableCurrencies
train
public static Set<Currency> getAvailableCurrencies() { Set<Currency> result = new LinkedHashSet<Currency>(); for (String currencyCode : availableCurrencyCodes) { result.add(Currency.getInstance(currencyCode)); } return result; }
java
{ "resource": "" }
q29628
Currency.getNumericCode
train
public int getNumericCode() { try { String name = "com.google.j2objc.util.CurrencyNumericCodesImpl"; CurrencyNumericCodes cnc = (CurrencyNumericCodes) Class.forName(name).newInstance(); return cnc.getNumericCode(currencyCode); } catch (Exception e) { throw...
java
{ "resource": "" }
q29629
CheckedInputStream.read
train
public int read() throws IOException { int b = in.read(); if (b != -1) { cksum.update(b); } return b; }
java
{ "resource": "" }
q29630
CheckedInputStream.skip
train
public long skip(long n) throws IOException { byte[] buf = new byte[512]; long total = 0; while (total < n) { long len = n - total; len = read(buf, 0, len < buf.length ? (int)len : buf.length); if (len == -1) { return total; } ...
java
{ "resource": "" }
q29631
DisabledAlgorithmConstraints.checkConstraints
train
private boolean checkConstraints(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters) { // check the key parameter, it cannot be null. if (key == null) { throw new IllegalArgumentException("The key cannot be null"); } // ch...
java
{ "resource": "" }
q29632
DisabledAlgorithmConstraints.loadDisabledAlgorithmsMap
train
private static void loadDisabledAlgorithmsMap( final String propertyName) { String property = AccessController.doPrivileged( new PrivilegedAction<String>() { public String run() { return Security.getProperty(propertyName); } ...
java
{ "resource": "" }
q29633
ClassLoaderUtil.getBootstrapClassLoader
train
private static ClassLoader getBootstrapClassLoader() { if (BOOTSTRAP_CLASSLOADER == null) { synchronized(ClassLoaderUtil.class) { if (BOOTSTRAP_CLASSLOADER == null) { ClassLoader cl = null; if (System.getSecurityManager() != null) { ...
java
{ "resource": "" }
q29634
ClassLoaderUtil.getClassLoader
train
public static ClassLoader getClassLoader(Class<?> cls) { ClassLoader cl = cls.getClassLoader(); if (cl == null) { cl = getClassLoader(); } return cl; }
java
{ "resource": "" }
q29635
ClassLoaderUtil.getClassLoader
train
public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); if (cl == null) { // When this method is called for initializing a ICU4J class ...
java
{ "resource": "" }
q29636
SAXSource.setSystemId
train
public void setSystemId(String systemId) { if (null == inputSource) { inputSource = new InputSource(systemId); } else { inputSource.setSystemId(systemId); } }
java
{ "resource": "" }
q29637
SAXSource.sourceToInputSource
train
public static InputSource sourceToInputSource(Source source) { if (source instanceof SAXSource) { return ((SAXSource) source).getInputSource(); } else if (source instanceof StreamSource) { StreamSource ss = (StreamSource) source; InputSource isource = new Input...
java
{ "resource": "" }
q29638
ProviderConfig.checkSunPKCS11Solaris
train
private void checkSunPKCS11Solaris() { Boolean o = AccessController.doPrivileged( new PrivilegedAction<Boolean>() { public Boolean run() { File file = new File("/usr/lib/libpkcs11.so"); if (file.exists() == false) { ...
java
{ "resource": "" }
q29639
ProviderConfig.getProvider
train
synchronized Provider getProvider() { // volatile variable load Provider p = provider; if (p != null) { return p; } if (shouldLoad() == false) { return null; } if (isLoading) { // because this method is synchronized, this can on...
java
{ "resource": "" }
q29640
ProviderConfig.doLoadProvider
train
private Provider doLoadProvider() { return AccessController.doPrivileged(new PrivilegedAction<Provider>() { public Provider run() { // if (debug != null) { // debug.println("Loading provider: " + ProviderConfig.this); // } try { ...
java
{ "resource": "" }
q29641
ProviderConfig.expand
train
private static String expand(final String value) { // shortcut if value does not contain any properties if (value.contains("${") == false) { return value; } // return AccessController.doPrivileged(new PrivilegedAction<String>() { // public String run() { ...
java
{ "resource": "" }
q29642
StylesheetHandler.init
train
void init(TransformerFactoryImpl processor) { m_stylesheetProcessor = processor; // Set the initial content handler. m_processors.push(m_schema.getElementProcessor()); this.pushNewNamespaceSupport(); // m_includeStack.push(SystemIDResolver.getAbsoluteURI(this.getBaseIdentifier(), null)); // ...
java
{ "resource": "" }
q29643
StylesheetHandler.createXPath
train
public XPath createXPath(String str, ElemTemplateElement owningTemplate) throws javax.xml.transform.TransformerException { ErrorListener handler = m_stylesheetProcessor.getErrorListener(); XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler, m_funcTable); // Vis...
java
{ "resource": "" }
q29644
StylesheetHandler.stackContains
train
private boolean stackContains(Stack stack, String url) { int n = stack.size(); boolean contains = false; for (int i = 0; i < n; i++) { String url2 = (String) stack.elementAt(i); if (url2.equals(url)) { contains = true; break; } } return contains; ...
java
{ "resource": "" }
q29645
StylesheetHandler.getProcessorFor
train
XSLTElementProcessor getProcessorFor( String uri, String localName, String rawName) throws org.xml.sax.SAXException { XSLTElementProcessor currentProcessor = getCurrentProcessor(); XSLTElementDef def = currentProcessor.getElemDef(); XSLTElementProcessor elemProcessor = def.getProces...
java
{ "resource": "" }
q29646
StylesheetHandler.flushCharacters
train
private void flushCharacters() throws org.xml.sax.SAXException { XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); }
java
{ "resource": "" }
q29647
StylesheetHandler.skippedEntity
train
public void skippedEntity(String name) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; getCurrentProcessor().skippedEntity(this, name); }
java
{ "resource": "" }
q29648
StylesheetHandler.warning
train
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(f...
java
{ "resource": "" }
q29649
StylesheetHandler.getStylesheetRoot
train
public StylesheetRoot getStylesheetRoot() { if (m_stylesheetRoot != null){ m_stylesheetRoot.setOptimizer(m_optimize); m_stylesheetRoot.setIncremental(m_incremental); m_stylesheetRoot.setSource_location(m_source_location); } return m_stylesheetRoot; }
java
{ "resource": "" }
q29650
StylesheetHandler.pushStylesheet
train
public void pushStylesheet(Stylesheet s) { if (m_stylesheets.size() == 0) m_stylesheetRoot = (StylesheetRoot) s; m_stylesheets.push(s); }
java
{ "resource": "" }
q29651
StylesheetHandler.popStylesheet
train
Stylesheet popStylesheet() { // The stylesheetLocatorStack needs to be popped because // a locator was pushed in for this stylesheet by the SAXparser by calling // setDocumentLocator(). if (!m_stylesheetLocatorStack.isEmpty()) m_stylesheetLocatorStack.pop(); if (!m_stylesheets.isEmpty()) ...
java
{ "resource": "" }
q29652
StylesheetHandler.getElemTemplateElement
train
ElemTemplateElement getElemTemplateElement() { try { return (ElemTemplateElement) m_elems.peek(); } catch (java.util.EmptyStackException ese) { return null; } }
java
{ "resource": "" }
q29653
StylesheetHandler.pushBaseIndentifier
train
void pushBaseIndentifier(String baseID) { if (null != baseID) { int posOfHash = baseID.indexOf('#'); if (posOfHash > -1) { m_fragmentIDString = baseID.substring(posOfHash + 1); m_shouldProcess = false; } else m_shouldProcess = true; } else ...
java
{ "resource": "" }
q29654
StylesheetHandler.getBaseIdentifier
train
public String getBaseIdentifier() { // Try to get the baseIdentifier from the baseIdentifier's stack, // which may not be the same thing as the value found in the // SourceLocators stack. String base = (String) (m_baseIdentifiers.isEmpty() ? null : m_baseIdentifiers.peek()...
java
{ "resource": "" }
q29655
StylesheetHandler.getLocator
train
public SAXSourceLocator getLocator() { if (m_stylesheetLocatorStack.isEmpty()) { SAXSourceLocator locator = new SAXSourceLocator(); locator.setSystemId(this.getStylesheetProcessor().getDOMsystemID()); return locator; // m_stylesheetLocatorStack.push(locator); } return ((SA...
java
{ "resource": "" }
q29656
ProgressMonitor.getProgressSources
train
public ArrayList<ProgressSource> getProgressSources() { ArrayList<ProgressSource> snapshot = new ArrayList<ProgressSource>(); try { synchronized(progressSourceList) { for (Iterator<ProgressSource> iter = progressSourceList.iterator(); iter.hasNext();) { ...
java
{ "resource": "" }
q29657
ProgressMonitor.registerSource
train
public void registerSource(ProgressSource pi) { synchronized(progressSourceList) { if (progressSourceList.contains(pi)) return; progressSourceList.add(pi); } // Notify only if there is at least one listener if (progressListenerList.size() > 0...
java
{ "resource": "" }
q29658
AddressCache.put
train
public void put(String hostname, int netId, InetAddress[] addresses) { cache.put(new AddressCacheKey(hostname, netId), new AddressCacheEntry(addresses)); }
java
{ "resource": "" }
q29659
IosCertificateFactory.maybeDecodeBase64
train
private byte[] maybeDecodeBase64(byte[] byteArray) { try { String pem = new String(byteArray); // Remove required begin/end lines. pem = pem.substring(BEGIN_CERT_LINE_LENGTH, pem.length() - END_CERT_LINE_LENGTH); return Base64.getDecoder().decode(pem); } catch (Exception e) { // No...
java
{ "resource": "" }
q29660
Streams.readFully
train
public static void readFully(InputStream in, byte[] dst) throws IOException { readFully(in, dst, 0, dst.length); }
java
{ "resource": "" }
q29661
Streams.readFully
train
public static String readFully(Reader reader) throws IOException { try { StringWriter writer = new StringWriter(); char[] buffer = new char[1024]; int count; while ((count = reader.read(buffer)) != -1) { writer.write(buffer, 0, count); ...
java
{ "resource": "" }
q29662
CollationFastLatin.getOptions
train
public static int getOptions(CollationData data, CollationSettings settings, char[] primaries) { char[] header = data.fastLatinTableHeader; if(header == null) { return -1; } assert((header[0] >> 8) == VERSION); if(primaries.length != LATIN_LIMIT) { assert false; ...
java
{ "resource": "" }
q29663
ClassLoader.loadClass
train
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { // First, check if the class has already been loaded Class<?> c = findLoadedClass(name); if (c == null) { try { if (parent != null) { ...
java
{ "resource": "" }
q29664
ValueRange.readObject
train
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException, InvalidObjectException { s.defaultReadObject(); if (minSmallest > minLargest) { throw new InvalidObjectException("Smallest minimum value must be less than largest minimum value"); } ...
java
{ "resource": "" }
q29665
UPropertyAliases.getPropertyName
train
public String getPropertyName(int property, int nameChoice) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } return getName...
java
{ "resource": "" }
q29666
UPropertyAliases.getPropertyValueName
train
public String getPropertyValueName(int property, int value, int nameChoice) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } ...
java
{ "resource": "" }
q29667
UPropertyAliases.getPropertyValueEnum
train
public int getPropertyValueEnum(int property, CharSequence alias) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { throw new IllegalArgumentException( "Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")"); } valueMap...
java
{ "resource": "" }
q29668
UPropertyAliases.getPropertyValueEnumNoThrow
train
public int getPropertyValueEnumNoThrow(int property, CharSequence alias) { int valueMapIndex=findProperty(property); if(valueMapIndex==0) { return UProperty.UNDEFINED; } valueMapIndex=valueMaps[valueMapIndex+1]; if(valueMapIndex==0) { return UProperty.UNDE...
java
{ "resource": "" }
q29669
TokenIterator.next
train
public String next() throws IOException { if (done) { return null; } for (;;) { if (line == null) { line = reader.readLineSkippingComments(); if (line == null) { done = true; return null; ...
java
{ "resource": "" }
q29670
CollationIterator.nextCE
train
public final long nextCE() { if(cesIndex < ceBuffer.length) { // Return the next buffered CE. return ceBuffer.get(cesIndex++); } assert cesIndex == ceBuffer.length; ceBuffer.incLength(); long cAndCE32 = handleNextCE32(); int c = (int)(cAndCE32 >> 3...
java
{ "resource": "" }
q29671
CollationIterator.previousCE
train
public final long previousCE(UVector32 offsets) { if(ceBuffer.length > 0) { // Return the previous buffered CE. return ceBuffer.get(--ceBuffer.length); } offsets.removeAllElements(); int limitOffset = getOffset(); int c = previousCodePoint(); if(c ...
java
{ "resource": "" }
q29672
XResources_ja_JP_I.getContents
train
public Object[][] getContents() { return new Object[][] { { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" }, { "alphabet", new CharArrayWrapper( new char[]{ 0x30a4, 0x30ed, 0x30cf, 0x30cb, 0x30db, 0x30d8, 0x30c8, 0x30c1, 0x30ea, 0x30cc, 0x30eb, 0x30f2, 0x30...
java
{ "resource": "" }
q29673
AVA.getValueString
train
public String getValueString() { try { String s = value.getAsString(); if (s == null) { throw new RuntimeException("AVA string is null"); } return s; } catch (IOException e) { // should not occur throw new RuntimeExc...
java
{ "resource": "" }
q29674
AVAKeyword.getKeyword
train
static String getKeyword(ObjectIdentifier oid, int standard) { return getKeyword (oid, standard, Collections.<String, String>emptyMap()); }
java
{ "resource": "" }
q29675
AVAKeyword.hasKeyword
train
static boolean hasKeyword(ObjectIdentifier oid, int standard) { AVAKeyword ak = oidMap.get(oid); if (ak == null) { return false; } return ak.isCompliant(standard); }
java
{ "resource": "" }
q29676
ChunkedIntArray.specialFind
train
int specialFind(int startPos, int position) { // We have to look all the way up the ancestor chain // to make sure we don't have an ancestor. int ancestor = startPos; while(ancestor > 0) { // Get the node whose index == ancestor ancesto...
java
{ "resource": "" }
q29677
ChunkedIntArray.readSlot
train
void readSlot(int position, int[] buffer) { /* try { System.arraycopy(fastArray, position*slotsize, buffer, 0, slotsize); } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (2): "+position); position *= slotsize; int chunkpos ...
java
{ "resource": "" }
q29678
BufferedInputStream.fill
train
private void fill() throws IOException { byte[] buffer = getBufIfOpen(); if (markpos < 0) pos = 0; /* no mark: throw away the buffer */ else if (pos >= buffer.length) /* no room left in buffer */ if (markpos > 0) { /* can throw away early part of the buffer *...
java
{ "resource": "" }
q29679
BufferedInputStream.read
train
public synchronized int read(byte b[], int off, int len) throws IOException { getBufIfOpen(); // Check for closed stream if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; ...
java
{ "resource": "" }
q29680
Streams.composeWithExceptions
train
static Runnable composeWithExceptions(Runnable a, Runnable b) { return new Runnable() { @Override public void run() { try { a.run(); } catch (Throwable e1) { try { b.run(); ...
java
{ "resource": "" }
q29681
ListResourceBundle.handleGetObject
train
public final Object handleGetObject(String key) { // lazily load the lookup hashtable. if (lookup == null) { loadLookup(); } if (key == null) { throw new NullPointerException(); } return lookup.get(key); // this class ignores locales }
java
{ "resource": "" }
q29682
ListResourceBundle.loadLookup
train
private synchronized void loadLookup() { if (lookup != null) return; Object[][] contents = getContents(); HashMap<String,Object> temp = new HashMap<>(contents.length); for (int i = 0; i < contents.length; ++i) { // key must be non-null String, value must be non-n...
java
{ "resource": "" }
q29683
Adler32.update
train
public void update(byte[] b, int off, int len) { if (b == null) { throw new NullPointerException(); } if (off < 0 || len < 0 || off > b.length - len) { throw new ArrayIndexOutOfBoundsException(); } adler = updateBytes(adler, b, off, len); }
java
{ "resource": "" }
q29684
Adler32.update
train
private void update(ByteBuffer buffer) { int pos = buffer.position(); int limit = buffer.limit(); assert (pos <= limit); int rem = limit - pos; if (rem <= 0) return; if (buffer instanceof DirectBuffer) { adler = updateByteBuffer(adler, ((DirectBuff...
java
{ "resource": "" }
q29685
CollationDataBuilder.encodeCEs
train
int encodeCEs(long ces[], int cesLength) { if(cesLength < 0 || cesLength > Collation.MAX_EXPANSION_LENGTH) { throw new IllegalArgumentException("mapping to too many CEs"); } if(!isMutable()) { throw new IllegalStateException("attempt to add mappings after build()"); ...
java
{ "resource": "" }
q29686
CollationDataBuilder.copyFrom
train
void copyFrom(CollationDataBuilder src, CEModifier modifier) { if(!isMutable()) { throw new IllegalStateException("attempt to copyFrom() after build()"); } CopyHelper helper = new CopyHelper(src, this, modifier); Iterator<Trie2.Range> trieIterator = src.trie.iterator(); ...
java
{ "resource": "" }
q29687
CollationDataBuilder.copyContractionsFromBaseCE32
train
protected int copyContractionsFromBaseCE32(StringBuilder context, int c, int ce32, ConditionalCE32 cond) { int trieIndex = Collation.indexFromCE32(ce32); int index; if((ce32 & Collation.CONTRACT_SINGLE_CP_NO_MATCH) != 0) { // No match on the single code point. ...
java
{ "resource": "" }
q29688
SocketOutputStream.socketWrite
train
private void socketWrite(byte b[], int off, int len) throws IOException { if (len <= 0 || off < 0 || off + len > b.length) { if (len == 0) { return; } throw new ArrayIndexOutOfBoundsException(); } Object traceContext = IoTrace.socketWriteBegi...
java
{ "resource": "" }
q29689
URICertStore.initializeTimeout
train
private static int initializeTimeout() { // Integer tmp = java.security.AccessController.doPrivileged( // new GetIntegerAction("com.sun.security.crl.timeout")); Integer tmp = Integer.getInteger("com.sun.security.crl.timeout"); if (tmp == null || tmp < 0) { return DEFAULT_CRL_...
java
{ "resource": "" }
q29690
URICertStore.getInstance
train
static CertStore getInstance(AccessDescription ad) { if (!ad.getAccessMethod().equals((Object) AccessDescription.Ad_CAISSUERS_Id)) { return null; } GeneralNameInterface gn = ad.getAccessLocation().getName(); if (!(gn instanceof URIName)) { return n...
java
{ "resource": "" }
q29691
URICertStore.getMatchingCerts
train
private static Collection<X509Certificate> getMatchingCerts (Collection<X509Certificate> certs, CertSelector selector) { // if selector not specified, all certs match if (selector == null) { return certs; } List<X509Certificate> matchedCerts = new ArrayList<>(certs.si...
java
{ "resource": "" }
q29692
URICertStore.getMatchingCRLs
train
private static Collection<X509CRL> getMatchingCRLs (X509CRL crl, CRLSelector selector) { if (selector == null || (crl != null && selector.match(crl))) { return Collections.singletonList(crl); } else { return Collections.emptyList(); } }
java
{ "resource": "" }
q29693
CharSequences.getSingleCodePoint
train
@Deprecated public static int getSingleCodePoint(CharSequence s) { int length = s.length(); if (length < 1 || length > 2) { return Integer.MAX_VALUE; } int result = Character.codePointAt(s, 0); return (result < 0x10000) == (length == 1) ? result : Integer.MAX_VALU...
java
{ "resource": "" }
q29694
CharSequences.onCharacterBoundary
train
@Deprecated public static boolean onCharacterBoundary(CharSequence s, int i) { return i <= 0 || i >= s.length() || !Character.isHighSurrogate(s.charAt(i-1)) || !Character.isLowSurrogate(s.charAt(i)); }
java
{ "resource": "" }
q29695
CharSequences.indexOf
train
@Deprecated public static int indexOf(CharSequence s, int codePoint) { int cp; for (int i = 0; i < s.length(); i += Character.charCount(cp)) { cp = Character.codePointAt(s, i); if (cp == codePoint) { return i; } } return -1; }
java
{ "resource": "" }
q29696
NativeObject.getObject
train
NativeObject getObject(int offset) { long newAddress = 0L; switch (addressSize()) { case 8: newAddress = unsafe.getLong(offset + address); break; case 4: newAddress = unsafe.getInt(offset + address) & 0x00000000FFFFFFFF; ...
java
{ "resource": "" }
q29697
NativeObject.putObject
train
void putObject(int offset, NativeObject ob) { switch (addressSize()) { case 8: putLong(offset, ob.address); break; case 4: putInt(offset, (int)(ob.address & 0x00000000FFFFFFFF)); break; default: t...
java
{ "resource": "" }
q29698
NativeObject.byteOrder
train
static ByteOrder byteOrder() { if (byteOrder != null) return byteOrder; long a = unsafe.allocateMemory(8); try { unsafe.putLong(a, 0x0102030405060708L); byte b = unsafe.getByte(a); switch (b) { case 0x01: byteOrder = ByteOrder.BIG_ENDIA...
java
{ "resource": "" }
q29699
File.join
train
private static String join(String prefix, String suffix) { int prefixLength = prefix.length(); boolean haveSlash = (prefixLength > 0 && prefix.charAt(prefixLength - 1) == separatorChar); if (!haveSlash) { haveSlash = (suffix.length() > 0 && suffix.charAt(0) == separatorChar); ...
java
{ "resource": "" }