_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q27000
TemplateList.addObjectIfNotFound
train
private void addObjectIfNotFound(Object obj, Vector v) { int n = v.size(); boolean addIt = true; for (int i = 0; i < n; i++) { if (v.elementAt(i) == obj) { addIt = false; break; } } if (addIt) { v.addElement(obj); } }
java
{ "resource": "" }
q27001
TemplateList.putHead
train
private void putHead(String key, TemplateSubPatternAssociation assoc) { if (key.equals(PsuedoNames.PSEUDONAME_TEXT)) m_textPatterns = assoc; else if (key.equals(PsuedoNames.PSEUDONAME_ROOT)) m_docPatterns = assoc; else if (key.equals(PsuedoNames.PSEUDONAME_COMMENT)) m_commentPatterns = ...
java
{ "resource": "" }
q27002
Holiday.firstBetween
train
@Override public Date firstBetween(Date start, Date end) { return rule.firstBetween(start, end); }
java
{ "resource": "" }
q27003
Holiday.isBetween
train
@Override public boolean isBetween(Date start, Date end) { return rule.isBetween(start, end); }
java
{ "resource": "" }
q27004
XMLReaderAdapter.setup
train
private void setup (XMLReader xmlReader) { if (xmlReader == null) { throw new NullPointerException("XMLReader must not be null"); } this.xmlReader = xmlReader; qAtts = new AttributesAdapter(); }
java
{ "resource": "" }
q27005
XMLReaderAdapter.setupXMLReader
train
private void setupXMLReader () throws SAXException { xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); try { xmlReader.setFeature("http://xml.org/sax/features/namespaces", false); } catch (SAXException e) { // NO OP: it's just ...
java
{ "resource": "" }
q27006
XMLReaderAdapter.startElement
train
public void startElement (String uri, String localName, String qName, Attributes atts) throws SAXException { if (documentHandler != null) { qAtts.setAttributes(atts); documentHandler.startElement(qName, qAtts); } }
java
{ "resource": "" }
q27007
XMLReaderAdapter.endElement
train
public void endElement (String uri, String localName, String qName) throws SAXException { if (documentHandler != null) documentHandler.endElement(qName); }
java
{ "resource": "" }
q27008
XMLReaderAdapter.processingInstruction
train
public void processingInstruction (String target, String data) throws SAXException { if (documentHandler != null) documentHandler.processingInstruction(target, data); }
java
{ "resource": "" }
q27009
Pair.of
train
public static <F, S> Pair<F, S> of(F first, S second) { if (first == null || second == null) { throw new IllegalArgumentException("Pair.of requires non null values."); } return new Pair<F, S>(first, second); }
java
{ "resource": "" }
q27010
URLStreamHandler.sameFile
train
protected boolean sameFile(URL u1, URL u2) { // Compare the protocols. if (!((u1.getProtocol() == u2.getProtocol()) || (u1.getProtocol() != null && u1.getProtocol().equalsIgnoreCase(u2.getProtocol())))) return false; // Compare the files. if (!(u...
java
{ "resource": "" }
q27011
URLStreamHandler.getHostAddress
train
protected synchronized InetAddress getHostAddress(URL u) { if (u.hostAddress != null) return (InetAddress) u.hostAddress; String host = u.getHost(); if (host == null || host.equals("")) { return null; } else { try { u.hostAddress = Ine...
java
{ "resource": "" }
q27012
CompoundTransliterator._smartAppend
train
private static void _smartAppend(StringBuilder buf, char c) { if (buf.length() != 0 && buf.charAt(buf.length() - 1) != c) { buf.append(c); } }
java
{ "resource": "" }
q27013
CachedXPathAPI.selectSingleNode
train
public Node selectSingleNode( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Have the XObject return its result as a NodeSetDTM. NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode); // Return the first node, or null return ...
java
{ "resource": "" }
q27014
SSLServerSocket.getSSLParameters
train
public SSLParameters getSSLParameters() { SSLParameters parameters = new SSLParameters(); parameters.setCipherSuites(getEnabledCipherSuites()); parameters.setProtocols(getEnabledProtocols()); if (getNeedClientAuth()) { parameters.setNeedClientAuth(true); } else if (g...
java
{ "resource": "" }
q27015
SSLServerSocket.setSSLParameters
train
public void setSSLParameters(SSLParameters params) { String[] s; s = params.getCipherSuites(); if (s != null) { setEnabledCipherSuites(s); } s = params.getProtocols(); if (s != null) { setEnabledProtocols(s); } if (params.getNeedC...
java
{ "resource": "" }
q27016
CertId.encode
train
public void encode(DerOutputStream out) throws IOException { DerOutputStream tmp = new DerOutputStream(); hashAlgId.encode(tmp); tmp.putOctetString(issuerNameHash); tmp.putOctetString(issuerKeyHash); certSerialNumber.encode(tmp); out.write(DerValue.tag_Sequence, tmp); ...
java
{ "resource": "" }
q27017
KeyAgreement.init
train
public final void init(Key key, SecureRandom random) throws InvalidKeyException { if (spi != null && (key == null || lock == null)) { spi.engineInit(key, random); } else { try { chooseProvider(I_NO_PARAMS, key, null, random); } catch (Inval...
java
{ "resource": "" }
q27018
KeyAgreement.init
train
public final void init(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException { init(key, params, JceSecurity.RANDOM); }
java
{ "resource": "" }
q27019
KeyAgreement.init
train
public final void init(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { if (spi != null) { spi.engineInit(key, params, random); } else { chooseProvider(I_PARAMS, ke...
java
{ "resource": "" }
q27020
KeyAgreement.doPhase
train
public final Key doPhase(Key key, boolean lastPhase) throws InvalidKeyException, IllegalStateException { chooseFirstProvider(); return spi.engineDoPhase(key, lastPhase); }
java
{ "resource": "" }
q27021
WalkerFactory.newDTMIterator
train
public static DTMIterator newDTMIterator( Compiler compiler, int opPos, boolean isTopLevel) throws javax.xml.transform.TransformerException { int firstStepPos = OpMap.getFirstChildPos(opPos); int analysis = analyze(compiler, firstStepPos, 0); boolean isOneStep = isOneStep(...
java
{ "resource": "" }
q27022
WalkerFactory.getAnalysisBitFromAxes
train
static public int getAnalysisBitFromAxes(int axis) { switch (axis) // Generate new traverser { case Axis.ANCESTOR : return BIT_ANCESTOR; case Axis.ANCESTORORSELF : return BIT_ANCESTOR_OR_SELF; case Axis.ATTRIBUTE : return BIT_ATTRIBUTE; cas...
java
{ "resource": "" }
q27023
WalkerFactory.mightBeProximate
train
public static boolean mightBeProximate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { boolean mightBeProximate = false; int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTI...
java
{ "resource": "" }
q27024
WalkerFactory.analyze
train
private static int analyze( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; int analysisResult = 0x00000000; // 32 bits of analysis while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOp...
java
{ "resource": "" }
q27025
WalkerFactory.isDownwardAxisOfMany
train
public static boolean isDownwardAxisOfMany(int axis) { return ((Axis.DESCENDANTORSELF == axis) || (Axis.DESCENDANT == axis) || (Axis.FOLLOWING == axis) // || (Axis.FOLLOWINGSIBLING == axis) || (Axis.PRECEDING == axis) // || (Axis.PRECEDINGSIBLING == axis) ...
java
{ "resource": "" }
q27026
WalkerFactory.analyzePredicate
train
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : argLen...
java
{ "resource": "" }
q27027
DecimalFormatSymbols.setCurrency
train
public void setCurrency(Currency currency) { if (currency == null) { throw new NullPointerException(); } this.currency = currency; intlCurrencySymbol = currency.getCurrencyCode(); currencySymbol = currency.getSymbol(locale); //cachedIcuDFS = null; }
java
{ "resource": "" }
q27028
DateFormatSymbols.initializeData
train
protected void initializeData(ULocale desiredLocale, String type) { String key = desiredLocale.getBaseName() + '+' + type; String ns = desiredLocale.getKeywordValue("numbers"); if (ns != null && ns.length() > 0) { key += '+' + ns; } DateFormatSymbols dfs = DFSCACH...
java
{ "resource": "" }
q27029
DateFormatSymbols.initializeData
train
void initializeData(DateFormatSymbols dfs) { this.eras = dfs.eras; this.eraNames = dfs.eraNames; this.narrowEras = dfs.narrowEras; this.months = dfs.months; this.shortMonths = dfs.shortMonths; this.narrowMonths = dfs.narrowMonths; this.standaloneMonths = dfs.stand...
java
{ "resource": "" }
q27030
DateFormatSymbols.loadDayPeriodStrings
train
private String[] loadDayPeriodStrings(Map<String, String> resourceMap) { String strings[] = new String[DAY_PERIOD_KEYS.length]; if (resourceMap != null) { for (int i = 0; i < DAY_PERIOD_KEYS.length; ++i) { strings[i] = resourceMap.get(DAY_PERIOD_KEYS[i]); // Null if string d...
java
{ "resource": "" }
q27031
DateFormatSymbols.setLocale
train
final void setLocale(ULocale valid, ULocale actual) { // Change the following to an assertion later if ((valid == null) != (actual == null)) { ///CLOVER:OFF throw new IllegalArgumentException(); ///CLOVER:ON } // Another check we could do is that the a...
java
{ "resource": "" }
q27032
TransliteratorParser.checkVariableRange
train
private void checkVariableRange(int ch, String rule, int start) { if (ch >= curData.variablesBase && ch < variableLimit) { syntaxError("Variable range character in rule", rule, start); } }
java
{ "resource": "" }
q27033
TransliteratorParser.resemblesPragma
train
static boolean resemblesPragma(String rule, int pos, int limit) { // Must start with /use\s/i return Utility.parsePattern(rule, pos, limit, "use ", null) >= 0; }
java
{ "resource": "" }
q27034
TransliteratorParser.syntaxError
train
static final void syntaxError(String msg, String rule, int start) { int end = ruleEnd(rule, start, rule.length()); throw new IllegalIcuArgumentException(msg + " in \"" + Utility.escape(rule.substring(start, end)) + '"'); }
java
{ "resource": "" }
q27035
TransliteratorParser.parseSet
train
private final char parseSet(String rule, ParsePosition pos) { UnicodeSet set = new UnicodeSet(rule, pos, parseData); if (variableNext >= variableLimit) { throw new RuntimeException("Private use variables exhausted"); } set.compact(); return generateStandInFor(set); ...
java
{ "resource": "" }
q27036
TransliteratorParser.generateStandInFor
train
char generateStandInFor(Object obj) { // assert(obj != null); // Look up previous stand-in, if any. This is a short list // (typical n is 0, 1, or 2); linear search is optimal. for (int i=0; i<variablesVector.size(); ++i) { if (variablesVector.get(i) == obj) { // [sic] poin...
java
{ "resource": "" }
q27037
TransliteratorParser.appendVariableDef
train
private void appendVariableDef(String name, StringBuffer buf) { char[] ch = variableNames.get(name); if (ch == null) { // We allow one undefined variable so that variable definition // statements work. For the first undefined variable we return // the special placeho...
java
{ "resource": "" }
q27038
PasswordCallback.clearPassword
train
public void clearPassword() { if (inputPassword != null) { for (int i = 0; i < inputPassword.length; i++) inputPassword[i] = ' '; } }
java
{ "resource": "" }
q27039
ServerSocketChannelImpl.translateReadyOps
train
public boolean translateReadyOps(int ops, int initialOps, SelectionKeyImpl sk) { int intOps = sk.nioInterestOps(); // Do this just once, it synchronizes int oldOps = sk.nioReadyOps(); int newOps = initialOps; if ((ops & PollArrayWrapper.POLLNVAL) != ...
java
{ "resource": "" }
q27040
ICUResourceBundle.getKeywordValues
train
public static final String[] getKeywordValues(String baseName, String keyword) { Set<String> keywords = new HashSet<String>(); ULocale locales[] = getAvailEntry(baseName, ICU_DATA_CLASS_LOADER).getULocaleList(); int i; for (i = 0; i < locales.length; i++) { try { ...
java
{ "resource": "" }
q27041
ICUResourceBundle.getStringWithFallback
train
public String getStringWithFallback(String path) throws MissingResourceException { // Optimized form of getWithFallback(path).getString(); ICUResourceBundle actualBundle = this; String result = findStringWithFallback(path, actualBundle, null); if (result == null) { throw new...
java
{ "resource": "" }
q27042
ICUResourceBundle.getAvailableLocaleNameSet
train
public static Set<String> getAvailableLocaleNameSet(String bundlePrefix, ClassLoader loader) { return getAvailEntry(bundlePrefix, loader).getLocaleNameSet(); }
java
{ "resource": "" }
q27043
ICUResourceBundle.getFullLocaleNameSet
train
public static Set<String> getFullLocaleNameSet(String bundlePrefix, ClassLoader loader) { return getAvailEntry(bundlePrefix, loader).getFullLocaleNameSet(); }
java
{ "resource": "" }
q27044
ICUResourceBundle.addLocaleIDsFromIndexBundle
train
private static final void addLocaleIDsFromIndexBundle(String baseName, ClassLoader root, Set<String> locales) { ICUResourceBundle bundle; try { bundle = (ICUResourceBundle) UResourceBundle.instantiateBundle(baseName, ICU_RESOURCE_INDEX, root, true); bundle = (ICUResou...
java
{ "resource": "" }
q27045
ICUResourceBundle.getResPathKeys
train
private void getResPathKeys(String[] keys, int depth) { ICUResourceBundle b = this; while (depth > 0) { keys[--depth] = b.key; b = b.container; assert (depth == 0) == (b.container == null); } }
java
{ "resource": "" }
q27046
ICUResourceBundle.createBundle
train
public static ICUResourceBundle createBundle(String baseName, String localeID, ClassLoader root) { ICUResourceBundleReader reader = ICUResourceBundleReader.getReader(baseName, localeID, root); if (reader == null) { // could not open the .res file return null; } re...
java
{ "resource": "" }
q27047
CanonicalIterator.reset
train
public void reset() { done = false; for (int i = 0; i < current.length; ++i) { current[i] = 0; } }
java
{ "resource": "" }
q27048
CanonicalIterator.setSource
train
public void setSource(String newSource) { source = nfd.normalize(newSource); done = false; // catch degenerate case if (newSource.length() == 0) { pieces = new String[1][]; current = new int[1]; pieces[0] = new String[]{""}; return; ...
java
{ "resource": "" }
q27049
CanonicalIterator.getEquivalents
train
private String[] getEquivalents(String segment) { Set<String> result = new HashSet<String>(); Set<String> basic = getEquivalents2(segment); Set<String> permutations = new HashSet<String>(); // now get all the permutations // add only the ones that are canonically equivalent ...
java
{ "resource": "" }
q27050
JapaneseCalendar.handleGetLimit
train
@SuppressWarnings("fallthrough") protected int handleGetLimit(int field, int limitType) { switch (field) { case ERA: if (limitType == MINIMUM || limitType == GREATEST_MINIMUM) { return 0; } return CURRENT_ERA; case YEAR: { ...
java
{ "resource": "" }
q27051
Providers.getSunProvider
train
public static Provider getSunProvider() { try { Class<?> clazz = Class.forName(jarVerificationProviders[0]); return (Provider)clazz.newInstance(); } catch (Exception e) { try { Class<?> clazz = Class.forName(BACKUP_PROVIDER_CLASSNAME); ...
java
{ "resource": "" }
q27052
Providers.getProviderList
train
public static ProviderList getProviderList() { ProviderList list = getThreadProviderList(); if (list == null) { list = getSystemProviderList(); } return list; }
java
{ "resource": "" }
q27053
WriterToUTF8Buffered.write
train
public void write(final int c) throws IOException { /* If we are close to the end of the buffer then flush it. * Remember the buffer can hold a few more bytes than BYTES_MAX */ if (count >= BYTES_MAX) flushBuffer(); if (c < 0x80) { m_outputBytes[count++] = (byte) (c); ...
java
{ "resource": "" }
q27054
LocPathIterator.readObject
train
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.T...
java
{ "resource": "" }
q27055
LocPathIterator.execute
train
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(xctxt.getCurrentNode(), xctxt); return iter; }
java
{ "resource": "" }
q27056
LocPathIterator.asNode
train
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator iter = (DTMIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); iter.setRoot(current, xctxt); int next = iter.nextNode(); // m_clones.freeInstance(iter); iter.de...
java
{ "resource": "" }
q27057
LocPathIterator.runTo
train
public void runTo(int index) { if (m_foundLast || ((index >= 0) && (index <= getCurrentPos()))) return; int n; if (-1 == index) { while (DTM.NULL != (n = nextNode())); } else { while (DTM.NULL != (n = nextNode())) { if (getCurrentPos() >= index) ...
java
{ "resource": "" }
q27058
DefaultMethodShimGenerator.getOverrideSignature
train
private String getOverrideSignature(ExecutablePair method) { StringBuilder sb = new StringBuilder(ElementUtil.getName(method.element())); sb.append('('); for (TypeMirror pType : method.type().getParameterTypes()) { sb.append(typeUtil.getSignatureName(pType)); } sb.append(')'); return sb.to...
java
{ "resource": "" }
q27059
Enum.compareTo
train
public final int compareTo(E o) { Enum<?> other = (Enum<?>)o; Enum<E> self = this; if (self.getClass() != other.getClass() && // optimization self.getDeclaringClass() != other.getDeclaringClass()) throw new ClassCastException(); return self.ordinal - other.ordinal...
java
{ "resource": "" }
q27060
Enum.getSharedConstants
train
@SuppressWarnings("unchecked") // the cache always returns the type matching enumType public static <T extends Enum<T>> T[] getSharedConstants(Class<T> enumType) { return (T[]) sharedConstantsCache.get(enumType); }
java
{ "resource": "" }
q27061
DerInputStream.subStream
train
public DerInputStream subStream(int len, boolean do_skip) throws IOException { DerInputBuffer newbuf = buffer.dup(); newbuf.truncate(len); if (do_skip) { buffer.skip(len); } return new DerInputStream(newbuf); }
java
{ "resource": "" }
q27062
DerInputStream.getInteger
train
public int getInteger() throws IOException { if (buffer.read() != DerValue.tag_Integer) { throw new IOException("DER input, Integer tag error"); } return buffer.getInteger(getLength(buffer)); }
java
{ "resource": "" }
q27063
DerInputStream.getBigInteger
train
public BigInteger getBigInteger() throws IOException { if (buffer.read() != DerValue.tag_Integer) { throw new IOException("DER input, Integer tag error"); } return buffer.getBigInteger(getLength(buffer), false); }
java
{ "resource": "" }
q27064
DerInputStream.getEnumerated
train
public int getEnumerated() throws IOException { if (buffer.read() != DerValue.tag_Enumerated) { throw new IOException("DER input, Enumerated tag error"); } return buffer.getInteger(getLength(buffer)); }
java
{ "resource": "" }
q27065
DerInputStream.getUnalignedBitString
train
public BitArray getUnalignedBitString() throws IOException { if (buffer.read() != DerValue.tag_BitString) throw new IOException("DER input not a bit string"); int length = getLength(buffer) - 1; /* * First byte = number of excess bits in the last octet of the * re...
java
{ "resource": "" }
q27066
DerInputStream.getOctetString
train
public byte[] getOctetString() throws IOException { if (buffer.read() != DerValue.tag_OctetString) throw new IOException("DER input not an octet string"); int length = getLength(buffer); byte[] retval = new byte[length]; if ((length != 0) && (buffer.read(retval) != length)) ...
java
{ "resource": "" }
q27067
DerInputStream.getBytes
train
public void getBytes(byte[] val) throws IOException { if ((val.length != 0) && (buffer.read(val) != val.length)) { throw new IOException("short read of DER octet string"); } }
java
{ "resource": "" }
q27068
DerInputStream.getSequence
train
public DerValue[] getSequence(int startLen, boolean originalEncodedFormRetained) throws IOException { tag = (byte)buffer.read(); if (tag != DerValue.tag_Sequence) throw new IOException("Sequence tag error"); return readVector(startLen, originalEncodedFormRetained); }
java
{ "resource": "" }
q27069
DerInputStream.readString
train
private String readString(byte stringTag, String stringName, String enc) throws IOException { if (buffer.read() != stringTag) throw new IOException("DER input not a " + stringName + " string"); int length = getLength(buffer); ...
java
{ "resource": "" }
q27070
DerInputStream.getUTCTime
train
public Date getUTCTime() throws IOException { if (buffer.read() != DerValue.tag_UtcTime) throw new IOException("DER input, UTCtime tag invalid "); return buffer.getUTCTime(getLength(buffer)); }
java
{ "resource": "" }
q27071
DerInputStream.getGeneralizedTime
train
public Date getGeneralizedTime() throws IOException { if (buffer.read() != DerValue.tag_GeneralizedTime) throw new IOException("DER input, GeneralizedTime tag invalid "); return buffer.getGeneralizedTime(getLength(buffer)); }
java
{ "resource": "" }
q27072
CollationRuleParser.getReorderCode
train
public static int getReorderCode(String word) { for(int i = 0; i < gSpecialReorderCodes.length; ++i) { if(word.equalsIgnoreCase(gSpecialReorderCodes[i])) { return Collator.ReorderCodes.FIRST + i; } } try { int script = UCharacter.getPropertyVal...
java
{ "resource": "" }
q27073
JavadocConverter.convertJavadoc
train
static Javadoc convertJavadoc( TreePath path, String source, JavacEnvironment env, boolean reportWarnings) { DocTrees docTrees = DocTrees.instance(env.task()); DocCommentTree docComment = docTrees.getDocCommentTree(path); if (docComment == null) { return null; // Declaration does not have a java...
java
{ "resource": "" }
q27074
JavadocConverter.setTagValues
train
private TagElement setTagValues(TagElement tag, TagKind tagKind, DocTree javadocNode, DocTree body) { tag.setTagKind(tagKind); setPos(javadocNode, tag); scan(body, tag); return tag; }
java
{ "resource": "" }
q27075
JavadocConverter.setPos
train
private TreeNode setPos(DocTree node, TreeNode newNode) { int pos = pos(node); return newNode.setPosition(new SourcePosition(pos, length(node), lineNumber(pos))); }
java
{ "resource": "" }
q27076
JavadocConverter.setPos
train
private TreeNode setPos(TreeNode newNode, int pos, int endPos) { return newNode.setPosition(new SourcePosition(pos, endPos - pos, lineNumber(pos))); }
java
{ "resource": "" }
q27077
Transliterator.transliterate
train
public final int transliterate(Replaceable text, int start, int limit) { if (start < 0 || limit < start || text.length() < limit) { return -1; } Position pos = new Position(start, limit, start); filteredTransliterate(text, pos, false, true); r...
java
{ "resource": "" }
q27078
Transliterator.transliterate
train
public final String transliterate(String text) { ReplaceableString result = new ReplaceableString(text); transliterate(result); return result.toString(); }
java
{ "resource": "" }
q27079
Transliterator.filteredTransliterate
train
public void filteredTransliterate(Replaceable text, Position index, boolean incremental) { filteredTransliterate(text, index, incremental, false); }
java
{ "resource": "" }
q27080
Transliterator.getBasicInstance
train
static Transliterator getBasicInstance(String id, String canonID) { StringBuffer s = new StringBuffer(); Transliterator t = registry.get(id, s); if (s.length() != 0) { // assert(t==0); // Instantiate an alias t = getInstance(s.toString(), FORWARD); } ...
java
{ "resource": "" }
q27081
Transliterator.registerFactory
train
public static void registerFactory(String ID, Factory factory) { registry.put(ID, factory, true); }
java
{ "resource": "" }
q27082
Transliterator.registerInstance
train
static void registerInstance(Transliterator trans, boolean visible) { registry.put(trans.getID(), trans, visible); }
java
{ "resource": "" }
q27083
Transliterator.registerAlias
train
public static void registerAlias(String aliasID, String realID) { registry.put(aliasID, realID, true); }
java
{ "resource": "" }
q27084
Transliterator.unregister
train
public static void unregister(String ID) { displayNameCache.remove(new CaseInsensitiveString(ID)); registry.remove(ID); }
java
{ "resource": "" }
q27085
Transliterator.getAvailableVariants
train
public static final Enumeration<String> getAvailableVariants(String source, String target) { return registry.getAvailableVariants(source, target); }
java
{ "resource": "" }
q27086
DateTimePatternGenerator.getFrozenInstance
train
@Deprecated public static DateTimePatternGenerator getFrozenInstance(ULocale uLocale) { String localeKey = uLocale.toString(); DateTimePatternGenerator result = DTPNG_CACHE.get(localeKey); if (result != null) { return result; } result = new DateTimePatternGenerat...
java
{ "resource": "" }
q27087
DateTimePatternGenerator.getSkeletonAllowingDuplicates
train
@Deprecated public String getSkeletonAllowingDuplicates(String pattern) { synchronized (this) { // synchronized since a getter must be thread-safe current.set(pattern, fp, true); return current.toString(); } }
java
{ "resource": "" }
q27088
DateTimePatternGenerator.getCanonicalSkeletonAllowingDuplicates
train
@Deprecated public String getCanonicalSkeletonAllowingDuplicates(String pattern) { synchronized (this) { // synchronized since a getter must be thread-safe current.set(pattern, fp, true); return current.toCanonicalString(); } }
java
{ "resource": "" }
q27089
DateTimePatternGenerator.getRedundants
train
@Deprecated public Collection<String> getRedundants(Collection<String> output) { synchronized (this) { // synchronized since a getter must be thread-safe if (output == null) { output = new LinkedHashSet<String>(); } for (DateTimeMatcher cur : skeleton2patt...
java
{ "resource": "" }
q27090
DateTimePatternGenerator.isSingleField
train
@Deprecated public static boolean isSingleField(String skeleton) { char first = skeleton.charAt(0); for (int i = 1; i < skeleton.length(); ++i) { if (skeleton.charAt(i) != first) return false; } return true; }
java
{ "resource": "" }
q27091
DateTimePatternGenerator.getBestAppending
train
private String getBestAppending(DateTimeMatcher source, int missingFields, DistanceInfo distInfo, DateTimeMatcher skipMatcher, EnumSet<DTPGflags> flags, int options) { String resultPattern = null; if (missingFields != 0) { PatternWithMatcher resultPatternWithMatcher = getBestRaw(source, miss...
java
{ "resource": "" }
q27092
DateTimePatternGenerator.getCanonicalIndex
train
private static int getCanonicalIndex(String s, boolean strict) { int len = s.length(); if (len == 0) { return -1; } int ch = s.charAt(0); // verify that all are the same character for (int i = 1; i < len; ++i) { if (s.charAt(i) != ch) { ...
java
{ "resource": "" }
q27093
JavacParser.filterJavaFileObject
train
private static JavaFileObject filterJavaFileObject(JavaFileObject fobj) { String path = fobj.getName(); if (path.endsWith("module-info.java")) { String pkgName = null; try { pkgName = moduleName(fobj.getCharContent(true).toString()); String source = "package " + pkgName + ";"; ...
java
{ "resource": "" }
q27094
JavacParser.createEnvironment
train
private JavacEnvironment createEnvironment(String path, String source) throws IOException { List<JavaFileObject> inputFiles = new ArrayList<>(); inputFiles.add(filterJavaFileObject(MemoryFileObject.createJavaFile(path, source))); return createEnvironment(Collections.emptyList(), inputFiles, false); }
java
{ "resource": "" }
q27095
JavacParser.packageName
train
@VisibleForTesting static String packageName(String source) { try (StringReader r = new StringReader(source)) { StreamTokenizer tokenizer = new StreamTokenizer(r); tokenizer.slashSlashComments(true); tokenizer.slashStarComments(true); StringBuilder sb = new StringBuilder(); boolean i...
java
{ "resource": "" }
q27096
DistributionPoint.encode
train
public void encode(DerOutputStream out) throws IOException { DerOutputStream tagged = new DerOutputStream(); // NOTE: only one of pointNames and pointRDN can be set if ((fullName != null) || (relativeName != null)) { DerOutputStream distributionPoint = new DerOutputStream(); ...
java
{ "resource": "" }
q27097
DistributionPoint.reasonToString
train
private static String reasonToString(int reason) { if ((reason > 0) && (reason < REASON_STRINGS.length)) { return REASON_STRINGS[reason]; } return "Unknown reason " + reason; }
java
{ "resource": "" }
q27098
ElemExsltFunction.compose
train
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); // Register the function namespace (if not already registered). String namespace = getName().getNamespace(); String handlerClass = sroot.getExtensionHandlerClass(); Object[] args ={namespace, sroot};...
java
{ "resource": "" }
q27099
NumericShaper.getContextKey
train
private static int getContextKey(char c) { if (c < contexts[ctCache]) { while (ctCache > 0 && c < contexts[ctCache]) --ctCache; } else if (c >= contexts[ctCache + 1]) { while (ctCache < ctCacheLimit && c >= contexts[ctCache + 1]) ++ctCache; } // if we're not in a...
java
{ "resource": "" }