_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q27700 | OIDMap.getClass | train | public static Class<?> getClass(String name) throws CertificateException {
OIDInfo info = nameMap.get(name);
return (info == null) ? null : info.getClazz();
} | java | {
"resource": ""
} |
q27701 | OIDMap.getClass | train | public static Class<?> getClass(ObjectIdentifier oid)
throws CertificateException {
OIDInfo info = oidMap.get(oid);
return (info == null) ? null : info.getClazz();
} | java | {
"resource": ""
} |
q27702 | OffsetTime.toEpochNano | train | private long toEpochNano() {
long nod = time.toNanoOfDay();
long offsetNanos = offset.getTotalSeconds() * NANOS_PER_SECOND;
return nod - offsetNanos;
} | java | {
"resource": ""
} |
q27703 | ArrayRewriter.visit | train | @Override
public boolean visit(Assignment node) {
Expression lhs = node.getLeftHandSide();
TypeMirror lhsType = lhs.getTypeMirror();
if (lhs instanceof ArrayAccess && !lhsType.getKind().isPrimitive()) {
FunctionInvocation newAssignment = newArrayAssignment(node, (ArrayAccess) lhs, lhsType);
no... | java | {
"resource": ""
} |
q27704 | UScript.findCodeFromLocale | train | private static int[] findCodeFromLocale(ULocale locale) {
int[] result = getCodesFromLocale(locale);
if(result != null) {
return result;
}
ULocale likely = ULocale.addLikelySubtags(locale);
return getCodesFromLocale(likely);
} | java | {
"resource": ""
} |
q27705 | UScript.getCode | train | public static final int[] getCode(String nameOrAbbrOrLocale) {
boolean triedCode = false;
if (nameOrAbbrOrLocale.indexOf('_') < 0 && nameOrAbbrOrLocale.indexOf('-') < 0) {
int propNum = UCharacter.getPropertyValueEnumNoThrow(UProperty.SCRIPT, nameOrAbbrOrLocale);
if (propNum != U... | java | {
"resource": ""
} |
q27706 | UScript.getScript | train | public static final int getScript(int codepoint){
if (codepoint >= UCharacter.MIN_VALUE & codepoint <= UCharacter.MAX_VALUE) {
int scriptX=UCharacterProperty.INSTANCE.getAdditional(codepoint, 0)&UCharacterProperty.SCRIPT_X_MASK;
if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
... | java | {
"resource": ""
} |
q27707 | UScript.hasScript | train | public static final boolean hasScript(int c, int sc) {
int scriptX=UCharacterProperty.INSTANCE.getAdditional(c, 0)&UCharacterProperty.SCRIPT_X_MASK;
if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
return sc==scriptX;
}
char[] scriptExtensions=UCharacterProperty.INSTANC... | java | {
"resource": ""
} |
q27708 | UScript.getName | train | public static final String getName(int scriptCode){
return UCharacter.getPropertyValueName(UProperty.SCRIPT,
scriptCode,
UProperty.NameChoice.LONG);
} | java | {
"resource": ""
} |
q27709 | UScript.getShortName | train | public static final String getShortName(int scriptCode){
return UCharacter.getPropertyValueName(UProperty.SCRIPT,
scriptCode,
UProperty.NameChoice.SHORT);
} | java | {
"resource": ""
} |
q27710 | UScript.getSampleString | train | public static final String getSampleString(int script) {
int sampleChar = ScriptMetadata.getScriptProps(script) & 0x1fffff;
if(sampleChar != 0) {
return new StringBuilder().appendCodePoint(sampleChar).toString();
}
return "";
} | java | {
"resource": ""
} |
q27711 | TextAttribute.readResolve | train | protected Object readResolve() throws InvalidObjectException {
if (this.getClass() != TextAttribute.class) {
throw new InvalidObjectException(
"subclass didn't correctly implement readResolve");
}
TextAttribute instance = (TextAttribute) instanceMap.get(getName());
... | java | {
"resource": ""
} |
q27712 | JarVerifier.beginEntry | train | public void beginEntry(JarEntry je, ManifestEntryVerifier mev)
throws IOException
{
if (je == null)
return;
if (debug != null) {
debug.println("beginEntry "+je.getName());
}
String name = je.getName();
/*
* Assumptions:
* 1... | java | {
"resource": ""
} |
q27713 | JarVerifier.update | train | public void update(int b, ManifestEntryVerifier mev)
throws IOException
{
if (b != -1) {
if (parsingBlockOrSF) {
baos.write(b);
} else {
mev.update((byte)b);
}
} else {
processEntry(mev);
}
} | java | {
"resource": ""
} |
q27714 | JarVerifier.update | train | public void update(int n, byte[] b, int off, int len,
ManifestEntryVerifier mev)
throws IOException
{
if (n != -1) {
if (parsingBlockOrSF) {
baos.write(b, off, n);
} else {
mev.update(b, off, n);
}
} e... | java | {
"resource": ""
} |
q27715 | JarVerifier.getCerts | train | @Deprecated // Android-changed added "Deprecated."
public java.security.cert.Certificate[] getCerts(String name)
{
return mapSignersToCertArray(getCodeSigners(name));
} | java | {
"resource": ""
} |
q27716 | JarVerifier.doneWithMeta | train | void doneWithMeta()
{
parsingMeta = false;
anyToVerify = !sigFileSigners.isEmpty();
baos = null;
sigFileData = null;
pendingBlocks = null;
signerCache = null;
manDig = null;
// MANIFEST.MF is always treated as signed and verified,
// move its s... | java | {
"resource": ""
} |
q27717 | JarVerifier.isSigningRelated | train | static boolean isSigningRelated(String name) {
name = name.toUpperCase(Locale.ENGLISH);
if (!name.startsWith("META-INF/")) {
return false;
}
name = name.substring(9);
if (name.indexOf('/') != -1) {
return false;
}
if (name.endsWith(".DSA")
... | java | {
"resource": ""
} |
q27718 | FastStringBuffer.charAt | train | public char charAt(int pos)
{
int startChunk = pos >>> m_chunkBits;
if (startChunk == 0 && m_innerFSB != null)
return m_innerFSB.charAt(pos & m_chunkMask);
else
return m_array[startChunk][pos & m_chunkMask];
} | java | {
"resource": ""
} |
q27719 | FastStringBuffer.sendNormalizedSAXcharacters | train | static int sendNormalizedSAXcharacters(char ch[],
int start, int length,
org.xml.sax.ContentHandler handler,
int edgeTreatmentFlags)
throws org.xml.sax.SAXException
{
boolean processingLeadingWhitespace =
((edgeTreatmentFlags & SUPPRESS_LEADING_... | java | {
"resource": ""
} |
q27720 | FastStringBuffer.sendNormalizedSAXcharacters | train | public static void sendNormalizedSAXcharacters(char ch[],
int start, int length,
org.xml.sax.ContentHandler handler)
throws org.xml.sax.SAXException
{
sendNormalizedSAXcharacters(ch, start, length,
handler, SUPPRESS_BOTH);
} | java | {
"resource": ""
} |
q27721 | AbstractPipeline.evaluate | train | final <R> R evaluate(TerminalOp<E_OUT, R> terminalOp) {
assert getOutputShape() == terminalOp.inputShape();
if (linkedOrConsumed)
throw new IllegalStateException(MSG_STREAM_LINKED);
linkedOrConsumed = true;
return isParallel()
? terminalOp.evaluateParallel(thi... | java | {
"resource": ""
} |
q27722 | AbstractPipeline.evaluateToArrayNode | train | @SuppressWarnings("unchecked")
public final Node<E_OUT> evaluateToArrayNode(IntFunction<E_OUT[]> generator) {
if (linkedOrConsumed)
throw new IllegalStateException(MSG_STREAM_LINKED);
linkedOrConsumed = true;
// If the last intermediate operation is stateful then
// eval... | java | {
"resource": ""
} |
q27723 | AbstractPipeline.sourceStageSpliterator | train | @SuppressWarnings("unchecked")
final Spliterator<E_OUT> sourceStageSpliterator() {
if (this != sourceStage)
throw new IllegalStateException();
if (linkedOrConsumed)
throw new IllegalStateException(MSG_STREAM_LINKED);
linkedOrConsumed = true;
if (sourceStage.... | java | {
"resource": ""
} |
q27724 | AbstractPipeline.spliterator | train | @Override
@SuppressWarnings("unchecked")
public Spliterator<E_OUT> spliterator() {
if (linkedOrConsumed)
throw new IllegalStateException(MSG_STREAM_LINKED);
linkedOrConsumed = true;
if (this == sourceStage) {
if (sourceStage.sourceSpliterator != null) {
... | java | {
"resource": ""
} |
q27725 | AbstractPipeline.sourceSpliterator | train | @SuppressWarnings("unchecked")
private Spliterator<?> sourceSpliterator(int terminalFlags) {
// Get the source spliterator of the pipeline
Spliterator<?> spliterator = null;
if (sourceStage.sourceSpliterator != null) {
spliterator = sourceStage.sourceSpliterator;
sour... | java | {
"resource": ""
} |
q27726 | Variable.isPsuedoVarRef | train | public boolean isPsuedoVarRef()
{
java.lang.String ns = m_qname.getNamespaceURI();
if((null != ns) && ns.equals(PSUEDOVARNAMESPACE))
{
if(m_qname.getLocalName().startsWith("#"))
return true;
}
return false;
} | java | {
"resource": ""
} |
q27727 | FormattedFloatingDecimal.checkExponent | train | private int checkExponent(int length) {
if (length >= nDigits || length < 0)
return decExponent;
for (int i = 0; i < length; i++)
if (digits[i] != '9')
// a '9' anywhere in digits will absorb the round
return decExponent;
return decExponen... | java | {
"resource": ""
} |
q27728 | FormattedFloatingDecimal.applyPrecision | train | private char [] applyPrecision(int length) {
char [] result = new char[nDigits];
for (int i = 0; i < result.length; i++) result[i] = '0';
if (length >= nDigits || length < 0) {
// no rounding necessary
System.arraycopy(digits, 0, result, 0, nDigits);
return r... | java | {
"resource": ""
} |
q27729 | FunctionDef1Arg.getArg0AsNode | train | protected int getArg0AsNode(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
return (null == m_arg0)
? xctxt.getCurrentNode() : m_arg0.asNode(xctxt);
} | java | {
"resource": ""
} |
q27730 | FunctionDef1Arg.getArg0AsString | train | protected XMLString getArg0AsString(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
if(null == m_arg0)
{
int currentNode = xctxt.getCurrentNode();
if(DTM.NULL == currentNode)
return XString.EMPTYSTRING;
else
{
DTM dtm = xctxt.getDTM(curre... | java | {
"resource": ""
} |
q27731 | FunctionDef1Arg.getArg0AsNumber | train | protected double getArg0AsNumber(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
if(null == m_arg0)
{
int currentNode = xctxt.getCurrentNode();
if(DTM.NULL == currentNode)
return 0;
else
{
DTM dtm = xctxt.getDTM(currentNode);
XML... | java | {
"resource": ""
} |
q27732 | X509Key.setKey | train | protected void setKey(BitArray key) {
this.bitStringKey = (BitArray)key.clone();
/*
* Do this to keep the byte array form consistent with
* this. Can delete when byte[] key is deleted.
*/
this.key = key.toByteArray();
int remaining = key.length() % 8;
... | java | {
"resource": ""
} |
q27733 | X509Key.getKey | train | protected BitArray getKey() {
/*
* Do this for consistency in case a subclass
* modifies byte[] key directly. Remove when
* byte[] key is deleted.
* Note: the consistency checks fail when the subclass
* modifies a non byte-aligned key (into a byte-aligned key)
... | java | {
"resource": ""
} |
q27734 | X509Key.parse | train | public static PublicKey parse(DerValue in) throws IOException
{
AlgorithmId algorithm;
PublicKey subjectKey;
if (in.tag != DerValue.tag_Sequence)
throw new IOException("corrupt subject key");
algorithm = AlgorithmId.parse(in.data.getDerValue());
try {
... | java | {
"resource": ""
} |
q27735 | X509Key.readObject | train | private void readObject(ObjectInputStream stream) throws IOException {
try {
decode(stream);
} catch (InvalidKeyException e) {
e.printStackTrace();
throw new IOException("deserialized key is invalid: " +
e.getMessage());
}
... | java | {
"resource": ""
} |
q27736 | PrivateKeyUsageExtension.valid | train | public void valid(Date now)
throws CertificateNotYetValidException, CertificateExpiredException {
/*
* we use the internal Dates rather than the passed in Date
* because someone could override the Date methods after()
* and before() to do something entirely different.
*/
... | java | {
"resource": ""
} |
q27737 | SchemaFactory.getFeature | train | public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException("name == null");
}
throw new SAXNotRecognizedException(name);
} | java | {
"resource": ""
} |
q27738 | SchemaFactory.setFeature | train | public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException("name == null");
}
throw new SAXNotRecognizedException(name);
} | java | {
"resource": ""
} |
q27739 | RuleBasedCollator.internalBuildTailoring | train | private final void internalBuildTailoring(String rules) throws Exception {
CollationTailoring base = CollationRoot.getRoot();
// Most code using Collator does not need to build a Collator from rules.
// By using reflection, most code will not have a static dependency on the builder code.
... | java | {
"resource": ""
} |
q27740 | RuleBasedCollator.getCollationElementIterator | train | public CollationElementIterator getCollationElementIterator(CharacterIterator source) {
initMaxExpansions();
CharacterIterator newsource = (CharacterIterator) source.clone();
return new CollationElementIterator(newsource, this);
} | java | {
"resource": ""
} |
q27741 | RuleBasedCollator.freeze | train | @Override
public Collator freeze() {
if (!isFrozen()) {
frozenLock = new ReentrantLock();
if (collationBuffer == null) {
collationBuffer = new CollationBuffer(data);
}
}
return this;
} | java | {
"resource": ""
} |
q27742 | RuleBasedCollator.cloneAsThawed | train | @Override
public RuleBasedCollator cloneAsThawed() {
try {
RuleBasedCollator result = (RuleBasedCollator) super.clone();
// since all collation data in the RuleBasedCollator do not change
// we can safely assign the result.fields to this collator
// except in... | java | {
"resource": ""
} |
q27743 | RuleBasedCollator.setUpperCaseFirst | train | public void setUpperCaseFirst(boolean upperfirst) {
checkNotFrozen();
if (upperfirst == isUpperCaseFirst()) { return; }
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setCaseFirst(upperfirst ? CollationSettings.CASE_FIRST_AND_UPPER_MASK : 0);
setFastLatinOpti... | java | {
"resource": ""
} |
q27744 | RuleBasedCollator.setLowerCaseFirst | train | public void setLowerCaseFirst(boolean lowerfirst) {
checkNotFrozen();
if (lowerfirst == isLowerCaseFirst()) { return; }
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setCaseFirst(lowerfirst ? CollationSettings.CASE_FIRST : 0);
setFastLatinOptions(ownedSettin... | java | {
"resource": ""
} |
q27745 | RuleBasedCollator.setNumericCollationDefault | train | public void setNumericCollationDefault() {
checkNotFrozen();
CollationSettings defaultSettings = getDefaultSettings();
if(settings.readOnly() == defaultSettings) { return; }
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setFlagDefault(CollationSettings.NUMER... | java | {
"resource": ""
} |
q27746 | RuleBasedCollator.setDecomposition | train | @Override
public void setDecomposition(int decomposition)
{
checkNotFrozen();
boolean flag;
switch(decomposition) {
case NO_DECOMPOSITION:
flag = false;
break;
case CANONICAL_DECOMPOSITION:
flag = true;
break;
defaul... | java | {
"resource": ""
} |
q27747 | RuleBasedCollator.setStrength | train | @Override
public void setStrength(int newStrength) {
checkNotFrozen();
if(newStrength == getStrength()) { return; }
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setStrength(newStrength);
setFastLatinOptions(ownedSettings);
} | java | {
"resource": ""
} |
q27748 | RuleBasedCollator.getTailoredSet | train | @Override
public UnicodeSet getTailoredSet() {
UnicodeSet tailored = new UnicodeSet();
if(data.base != null) {
new TailoredSet(tailored).forData(data);
}
return tailored;
} | java | {
"resource": ""
} |
q27749 | RuleBasedCollator.internalAddContractions | train | void internalAddContractions(int c, UnicodeSet set) {
new ContractionsAndExpansions(set, null, null, false).forCodePoint(data, c);
} | java | {
"resource": ""
} |
q27750 | RuleBasedCollator.getRawCollationKey | train | @Override
public RawCollationKey getRawCollationKey(String source, RawCollationKey key) {
if (source == null) {
return null;
}
CollationBuffer buffer = null;
try {
buffer = getCollationBuffer();
return getRawCollationKey(source, key, buffer);
... | java | {
"resource": ""
} |
q27751 | RuleBasedCollator.internalGetCEs | train | @Deprecated
public long[] internalGetCEs(CharSequence str) {
CollationBuffer buffer = null;
try {
buffer = getCollationBuffer();
boolean numeric = settings.readOnly().isNumeric();
CollationIterator iter;
if(settings.readOnly().dontCheckFCD()) {
... | java | {
"resource": ""
} |
q27752 | RuleBasedCollator.getVersion | train | @Override
public VersionInfo getVersion() {
int version = tailoring.version;
int rtVersion = VersionInfo.UCOL_RUNTIME_VERSION.getMajor();
return VersionInfo.getInstance(
(version >>> 24) + (rtVersion << 4) + (rtVersion >> 4),
((version >> 16) & 0xff), ((versio... | java | {
"resource": ""
} |
q27753 | RuleBasedCollator.getUCAVersion | train | @Override
public VersionInfo getUCAVersion() {
VersionInfo v = getVersion();
// Note: This is tied to how the current implementation encodes the UCA version
// in the overall getVersion().
// Alternatively, we could load the root collator and get at lower-level data from there.
... | java | {
"resource": ""
} |
q27754 | CharacterDecoder.decodeBuffer | train | public void decodeBuffer(InputStream aStream, OutputStream bStream) throws IOException {
int i;
int totalBytes = 0;
PushbackInputStream ps = new PushbackInputStream (aStream);
decodeBufferPrefix(ps, bStream);
while (true) {
int length;
try {
... | java | {
"resource": ""
} |
q27755 | CharacterDecoder.decodeBuffer | train | public byte decodeBuffer(String inputString)[] throws IOException {
byte inputBuffer[] = new byte[inputString.length()];
ByteArrayInputStream inStream;
ByteArrayOutputStream outStream;
inputString.getBytes(0, inputString.length(), inputBuffer, 0);
inStream = new ByteArrayInpu... | java | {
"resource": ""
} |
q27756 | CharacterDecoder.decodeBuffer | train | public byte decodeBuffer(InputStream in)[] throws IOException {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
decodeBuffer(in, outStream);
return (outStream.toByteArray());
} | java | {
"resource": ""
} |
q27757 | ToStream.closeCDATA | train | protected void closeCDATA() throws org.xml.sax.SAXException
{
try
{
m_writer.write(CDATA_DELIMITER_CLOSE);
// write out a CDATA section closing "]]>"
m_cdataTagOpen = false; // Remember that we have done so.
}
catch (IOException e)
{
... | java | {
"resource": ""
} |
q27758 | ToStream.flushWriter | train | protected final void flushWriter() throws org.xml.sax.SAXException
{
final java.io.Writer writer = m_writer;
if (null != writer)
{
try
{
if (writer instanceof WriterToUTF8Buffered)
{
if (m_shouldFlush)
... | java | {
"resource": ""
} |
q27759 | ToStream.getOutputFormat | train | public Properties getOutputFormat() {
Properties def = new Properties();
{
Set s = getOutputPropDefaultKeys();
Iterator i = s.iterator();
while (i.hasNext()) {
String key = (String) i.next();
String val = getOutputPropertyDefault(key);
... | java | {
"resource": ""
} |
q27760 | ToStream.escapingNotNeeded | train | protected boolean escapingNotNeeded(char ch)
{
final boolean ret;
if (ch < 127)
{
// This is the old/fast code here, but is this
// correct for all encodings?
if (ch >= CharInfo.S_SPACE || (CharInfo.S_LINEFEED == ch ||
CharInfo.S_CARR... | java | {
"resource": ""
} |
q27761 | ToStream.accumDefaultEntity | train | int accumDefaultEntity(
java.io.Writer writer,
char ch,
int i,
char[] chars,
int len,
boolean fromTextNode,
boolean escLF)
throws IOException
{
if (!escLF && CharInfo.S_LINEFEED == ch)
{
writer.write(m_lineSep, 0, m_lineSep... | java | {
"resource": ""
} |
q27762 | ToStream.writeNormalizedChars | train | void writeNormalizedChars(
char ch[],
int start,
int length,
boolean isCData,
boolean useSystemLineSeparator)
throws IOException, org.xml.sax.SAXException
{
final java.io.Writer writer = m_writer;
int end = start + length;
for (int i = start; ... | java | {
"resource": ""
} |
q27763 | ToStream.processDirty | train | private int processDirty(
char[] chars,
int end,
int i,
char ch,
int lastDirty,
boolean fromTextNode) throws IOException
{
int startClean = lastDirty + 1;
// if we have some clean characters accumulated
// process them before the dirty one. ... | java | {
"resource": ""
} |
q27764 | ToStream.accumDefaultEscape | train | private int accumDefaultEscape(
Writer writer,
char ch,
int i,
char[] chars,
int len,
boolean fromTextNode,
boolean escLF)
throws IOException
{
int pos = accumDefaultEntity(writer, ch, i, chars, len, fromTextNode, escLF);
if (i == pos... | java | {
"resource": ""
} |
q27765 | ToStream.startElement | train | public void startElement(
String elementNamespaceURI,
String elementLocalName,
String elementName)
throws SAXException
{
startElement(elementNamespaceURI, elementLocalName, elementName, null);
} | java | {
"resource": ""
} |
q27766 | ToStream.startPrefixMapping | train | public void startPrefixMapping(String prefix, String uri)
throws org.xml.sax.SAXException
{
// the "true" causes the flush of any open tags
startPrefixMapping(prefix, uri, true);
} | java | {
"resource": ""
} |
q27767 | ToStream.startEntity | train | public void startEntity(String name) throws org.xml.sax.SAXException
{
if (name.equals("[dtd]"))
m_inExternalDTD = true;
if (!m_expandDTDEntities && !m_inExternalDTD) {
/* Only leave the entity as-is if
* we've been told not to expand them
* and thi... | java | {
"resource": ""
} |
q27768 | ToStream.setCdataSectionElements | train | public void setCdataSectionElements(Vector URI_and_localNames)
{
// convert to the new way.
if (URI_and_localNames != null)
{
final int len = URI_and_localNames.size() - 1;
if (len > 0)
{
final StringBuffer sb = new StringBuffer();
... | java | {
"resource": ""
} |
q27769 | ToStream.ensureAttributesNamespaceIsDeclared | train | protected String ensureAttributesNamespaceIsDeclared(
String ns,
String localName,
String rawName)
throws org.xml.sax.SAXException
{
if (ns != null && ns.length() > 0)
{
// extract the prefix in front of the raw name
int index = 0;
... | java | {
"resource": ""
} |
q27770 | ToStream.firePseudoAttributes | train | protected void firePseudoAttributes()
{
if (m_tracer != null)
{
try
{
// flush out the "<elemName" if not already flushed
m_writer.flush();
// make a StringBuffer to write the name="value" pairs to.
... | java | {
"resource": ""
} |
q27771 | ToStream.resetToStream | train | private void resetToStream()
{
this.m_cdataStartCalled = false;
/* The stream is being reset. It is one of
* ToXMLStream, ToHTMLStream ... and this type can't be changed
* so neither should m_charInfo which is associated with the
* type of Stream. Just leave m_charInf... | java | {
"resource": ""
} |
q27772 | ToStream.notationDecl | train | public void notationDecl(String name, String pubID, String sysID) throws SAXException {
// TODO Auto-generated method stub
try {
DTDprolog();
m_writer.write("<!NOTATION ");
m_writer.write(name);
if (pubID != null) {
... | java | {
"resource": ""
} |
q27773 | ToStream.DTDprolog | train | private void DTDprolog() throws SAXException, IOException {
final java.io.Writer writer = m_writer;
if (m_needToOutputDocTypeDecl)
{
outputDocTypeDecl(m_elemContext.m_elementName, false);
m_needToOutputDocTypeDecl = false;
}
if (m_inDoctype)
{
... | java | {
"resource": ""
} |
q27774 | ToStream.addCdataSectionElements | train | public void addCdataSectionElements(String URI_and_localNames)
{
if (URI_and_localNames != null)
initCdataElems(URI_and_localNames);
if (m_StringOfCDATASections == null)
m_StringOfCDATASections = URI_and_localNames;
else
m_StringOfCDATASections += (" " + U... | java | {
"resource": ""
} |
q27775 | TrieIterator.reset | train | @Override
public final void reset()
{
m_currentCodepoint_ = 0;
m_nextCodepoint_ = 0;
m_nextIndex_ = 0;
m_nextBlock_ = m_trie_.m_index_[0] << Trie.INDEX_STAGE_2_SHIFT_;
if (m_nextBlock_ == m_trie_.m_dataOffset_) {
m_nextValue_ = m_initialValue_;
... | java | {
"resource": ""
} |
q27776 | TrieIterator.setResult | train | private final void setResult(Element element, int start, int limit,
int value)
{
element.start = start;
element.limit = limit;
element.value = value;
} | java | {
"resource": ""
} |
q27777 | TrieIterator.checkNullNextTrailIndex | train | private final boolean checkNullNextTrailIndex()
{
if (m_nextIndex_ <= 0) {
m_nextCodepoint_ += TRAIL_SURROGATE_COUNT_ - 1;
int nextLead = UTF16.getLeadSurrogate(m_nextCodepoint_);
int leadBlock =
m_trie_.m_index_[nextLead >> Trie.INDEX_STAGE_1_SHIFT_] ... | java | {
"resource": ""
} |
q27778 | ObjectIdentifier.toIntArray | train | public int[] toIntArray() {
int length = encoding.length;
int[] result = new int[20];
int which = 0;
int fromPos = 0;
for (int i = 0; i < length; i++) {
if ((encoding[i] & 0x80) == 0) {
// one section [fromPos..i]
if (i - fromPos + 1 > ... | java | {
"resource": ""
} |
q27779 | ObjectIdentifier.pack7Oid | train | private static int pack7Oid(int input, byte[] out, int ooffset) {
byte[] b = new byte[4];
b[0] = (byte)(input >> 24);
b[1] = (byte)(input >> 16);
b[2] = (byte)(input >> 8);
b[3] = (byte)(input);
return pack7Oid(b, 0, 4, out, ooffset);
} | java | {
"resource": ""
} |
q27780 | ObjectIdentifier.pack7Oid | train | private static int pack7Oid(BigInteger input, byte[] out, int ooffset) {
byte[] b = input.toByteArray();
return pack7Oid(b, 0, b.length, out, ooffset);
} | java | {
"resource": ""
} |
q27781 | ObjectIdentifier.check | train | private static void check(byte[] encoding) throws IOException {
int length = encoding.length;
if (length < 1 || // too short
(encoding[length - 1] & 0x80) != 0) { // not ended
throw new IOException("ObjectIdentifier() -- " +
"Invalid DER encoding, no... | java | {
"resource": ""
} |
q27782 | GenericSignatureParser.parseForClass | train | public void parseForClass(GenericDeclaration genericDecl, String signature) {
setInput(genericDecl, signature);
if (!eof) {
parseClassSignature();
} else {
if(genericDecl instanceof Class) {
Class c = (Class) genericDecl;
this.formalTypePar... | java | {
"resource": ""
} |
q27783 | GenericSignatureParser.parseForMethod | train | public void parseForMethod(GenericDeclaration genericDecl,
String signature, Class<?>[] rawExceptionTypes) {
setInput(genericDecl, signature);
if (!eof) {
parseMethodTypeSignature(rawExceptionTypes);
} else {
Method m = (Method) genericDecl;
this.f... | java | {
"resource": ""
} |
q27784 | GenericSignatureParser.parseForConstructor | train | public void parseForConstructor(GenericDeclaration genericDecl,
String signature, Class<?>[] rawExceptionTypes) {
setInput(genericDecl, signature);
if (!eof) {
parseMethodTypeSignature(rawExceptionTypes);
} else {
Constructor c = (Constructor) genericDecl;
... | java | {
"resource": ""
} |
q27785 | GenericSignatureParser.parseForField | train | public void parseForField(GenericDeclaration genericDecl,
String signature) {
setInput(genericDecl, signature);
if (!eof) {
this.fieldType = parseFieldTypeSignature();
}
} | java | {
"resource": ""
} |
q27786 | AbstractExecutorService.doInvokeAny | train | private <T> T doInvokeAny(Collection<? extends Callable<T>> tasks,
boolean timed, long nanos)
throws InterruptedException, ExecutionException, TimeoutException {
if (tasks == null)
throw new NullPointerException();
int ntasks = tasks.size();
if (... | java | {
"resource": ""
} |
q27787 | AbstractExecutorService.cancelAll | train | private static <T> void cancelAll(ArrayList<Future<T>> futures, int j) {
for (int size = futures.size(); j < size; j++)
futures.get(j).cancel(true);
} | java | {
"resource": ""
} |
q27788 | FileUtil.extractZipEntry | train | public File extractZipEntry(File dir, ZipFile zipFile, ZipEntry entry) throws IOException {
File outputFile = new File(dir, entry.getName());
File parentFile = outputFile.getParentFile();
if (!outputFile.getCanonicalPath().startsWith(dir.getCanonicalPath() + File.separator)
|| (!parentFile.isDirecto... | java | {
"resource": ""
} |
q27789 | EnumRewriter.isSimpleEnum | train | private boolean isSimpleEnum(EnumDeclaration node) {
TypeElement type = node.getTypeElement();
for (EnumConstantDeclaration constant : node.getEnumConstants()) {
ExecutableElement method = constant.getExecutableElement();
if (method.getParameters().size() > 0 || method.isVarArgs()) {
return ... | java | {
"resource": ""
} |
q27790 | EnumRewriter.addArcInitialization | train | private void addArcInitialization(EnumDeclaration node) {
String enumClassName = nameTable.getFullName(node.getTypeElement());
List<Statement> stmts = node.getClassInitStatements().subList(0, 0);
int i = 0;
for (EnumConstantDeclaration constant : node.getEnumConstants()) {
VariableElement varEleme... | java | {
"resource": ""
} |
q27791 | ChronoPeriodImpl.monthRange | train | private long monthRange() {
ValueRange startRange = chrono.range(MONTH_OF_YEAR);
if (startRange.isFixed() && startRange.isIntValue()) {
return startRange.getMaximum() - startRange.getMinimum() + 1;
}
return -1;
} | java | {
"resource": ""
} |
q27792 | OperatorRewriter.getRetainedWithTarget | train | private Expression getRetainedWithTarget(Assignment node, VariableElement var) {
Expression lhs = node.getLeftHandSide();
if (!(lhs instanceof FieldAccess)) {
return new ThisExpression(ElementUtil.getDeclaringClass(var).asType());
}
// To avoid duplicating the target expression we must save the re... | java | {
"resource": ""
} |
q27793 | OperatorRewriter.getPromotionSuffix | train | private static String getPromotionSuffix(Assignment node) {
if (!needsPromotionSuffix(node.getOperator())) {
return "";
}
TypeKind lhsKind = node.getLeftHandSide().getTypeMirror().getKind();
TypeKind rhsKind = node.getRightHandSide().getTypeMirror().getKind();
if (lhsKind == TypeKind.DOUBLE ||... | java | {
"resource": ""
} |
q27794 | TextUtils.join | train | public static String join(CharSequence delimiter, Iterable tokens) {
StringBuilder sb = new StringBuilder();
boolean firstTime = true;
for (Object token: tokens) {
if (firstTime) {
firstTime = false;
} else {
sb.append(delimiter);
... | java | {
"resource": ""
} |
q27795 | TextUtils.dumpSpans | train | public static void dumpSpans(CharSequence cs, Printer printer, String prefix) {
if (cs instanceof Spanned) {
Spanned sp = (Spanned) cs;
Object[] os = sp.getSpans(0, cs.length(), Object.class);
for (int i = 0; i < os.length; i++) {
Object o = os[i];
... | java | {
"resource": ""
} |
q27796 | TextUtils.expandTemplate | train | public static CharSequence expandTemplate(CharSequence template,
CharSequence... values) {
if (values.length > 9) {
throw new IllegalArgumentException("max of 9 values are supported");
}
SpannableStringBuilder ssb = new SpannableStringBu... | java | {
"resource": ""
} |
q27797 | TextUtils.htmlEncode | train | public static String htmlEncode(String s) {
StringBuilder sb = new StringBuilder();
char c;
for (int i = 0; i < s.length(); i++) {
c = s.charAt(i);
switch (c) {
case '<':
sb.append("<"); //$NON-NLS-1$
break;
case ... | java | {
"resource": ""
} |
q27798 | TextUtils.concat | train | public static CharSequence concat(CharSequence... text) {
if (text.length == 0) {
return "";
}
if (text.length == 1) {
return text[0];
}
boolean spanned = false;
for (int i = 0; i < text.length; i++) {
if (text[i] instanceof Spanned) ... | java | {
"resource": ""
} |
q27799 | TextUtils.isGraphic | train | public static boolean isGraphic(CharSequence str) {
final int len = str.length();
for (int i=0; i<len; i++) {
int gc = Character.getType(str.charAt(i));
if (gc != Character.CONTROL
&& gc != Character.FORMAT
&& gc != Character.SURROGATE
... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.