_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q27300 | ChangeListenerMap.add | train | public final synchronized void add(String name, L listener) {
if (this.map == null) {
this.map = new HashMap<>();
}
L[] array = this.map.get(name);
int size = (array != null)
? array.length
: 0;
L[] clone = newArray(size + 1);
... | java | {
"resource": ""
} |
q27301 | ChangeListenerMap.remove | train | public final synchronized void remove(String name, L listener) {
if (this.map != null) {
L[] array = this.map.get(name);
if (array != null) {
for (int i = 0; i < array.length; i++) {
if (listener.equals(array[i])) {
int size = a... | java | {
"resource": ""
} |
q27302 | ChangeListenerMap.get | train | public final synchronized L[] get(String name) {
return (this.map != null)
? this.map.get(name)
: null;
} | java | {
"resource": ""
} |
q27303 | ChangeListenerMap.set | train | public final void set(String name, L[] listeners) {
if (listeners != null) {
if (this.map == null) {
this.map = new HashMap<>();
}
this.map.put(name, listeners);
}
else if (this.map != null) {
this.map.remove(name);
if (... | java | {
"resource": ""
} |
q27304 | ChangeListenerMap.getListeners | train | public final synchronized L[] getListeners() {
if (this.map == null) {
return newArray(0);
}
List<L> list = new ArrayList<>();
L[] listeners = this.map.get(null);
if (listeners != null) {
for (L listener : listeners) {
list.add(listener);
... | java | {
"resource": ""
} |
q27305 | ChangeListenerMap.getListeners | train | public final L[] getListeners(String name) {
if (name != null) {
L[] listeners = get(name);
if (listeners != null) {
return listeners.clone();
}
}
return newArray(0);
} | java | {
"resource": ""
} |
q27306 | ChangeListenerMap.hasListeners | train | public final synchronized boolean hasListeners(String name) {
if (this.map == null) {
return false;
}
L[] array = this.map.get(null);
return (array != null) || ((name != null) && (null != this.map.get(name)));
} | java | {
"resource": ""
} |
q27307 | ChangeListenerMap.getEntries | train | public final Set<Entry<String, L[]>> getEntries() {
return (this.map != null)
? this.map.entrySet()
: Collections.<Entry<String, L[]>>emptySet();
} | java | {
"resource": ""
} |
q27308 | ReentrantLock.getWaitQueueLength | train | public int getWaitQueueLength(Condition condition) {
if (condition == null)
throw new NullPointerException();
if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
throw new IllegalArgumentException("not owner");
return sync.getWaitQueueLength((AbstractQ... | java | {
"resource": ""
} |
q27309 | ReentrantLock.getWaitingThreads | train | protected Collection<Thread> getWaitingThreads(Condition condition) {
if (condition == null)
throw new NullPointerException();
if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
throw new IllegalArgumentException("not owner");
return sync.getWaitingTh... | java | {
"resource": ""
} |
q27310 | SimpleFormatter.compileMinMaxArguments | train | public static SimpleFormatter compileMinMaxArguments(CharSequence pattern, int min, int max) {
StringBuilder sb = new StringBuilder();
String compiledPattern = SimpleFormatterImpl.compileToStringMinMaxArguments(pattern, sb, min, max);
return new SimpleFormatter(compiledPattern);
} | java | {
"resource": ""
} |
q27311 | MessageHeader.findValue | train | public synchronized String findValue(String k) {
if (k == null) {
for (int i = nkeys; --i >= 0;)
if (keys[i] == null)
return values[i];
} else
for (int i = nkeys; --i >= 0;) {
if (k.equalsIgnoreCase(keys[i]))
... | java | {
"resource": ""
} |
q27312 | MessageHeader.getKey | train | public synchronized int getKey(String k) {
for (int i = nkeys; --i >= 0;)
if ((keys[i] == k) ||
(k != null && k.equalsIgnoreCase(keys[i])))
return i;
return -1;
} | java | {
"resource": ""
} |
q27313 | MessageHeader.filterNTLMResponses | train | public boolean filterNTLMResponses(String k) {
boolean found = false;
for (int i=0; i<nkeys; i++) {
if (k.equalsIgnoreCase(keys[i])
&& values[i] != null && values[i].length() > 5
&& values[i].regionMatches(true, 0, "NTLM ", 0, 5)) {
fou... | java | {
"resource": ""
} |
q27314 | MessageHeader.print | train | public synchronized void print(PrintStream p) {
for (int i = 0; i < nkeys; i++)
if (keys[i] != null) {
p.print(keys[i] +
(values[i] != null ? ": "+values[i]: "") + "\r\n");
}
p.print("\r\n");
p.flush();
} | java | {
"resource": ""
} |
q27315 | MessageHeader.add | train | public synchronized void add(String k, String v) {
grow();
keys[nkeys] = k;
values[nkeys] = v;
nkeys++;
} | java | {
"resource": ""
} |
q27316 | MessageHeader.prepend | train | public synchronized void prepend(String k, String v) {
grow();
for (int i = nkeys; i > 0; i--) {
keys[i] = keys[i-1];
values[i] = values[i-1];
}
keys[0] = k;
values[0] = v;
nkeys++;
} | java | {
"resource": ""
} |
q27317 | MessageHeader.remove | train | public synchronized void remove(String k) {
if(k == null) {
for (int i = 0; i < nkeys; i++) {
while (keys[i] == null && i < nkeys) {
for(int j=i; j<nkeys-1; j++) {
keys[j] = keys[j+1];
values[j] = values[j+1];
... | java | {
"resource": ""
} |
q27318 | MessageHeader.setIfNotSet | train | public synchronized void setIfNotSet(String k, String v) {
if (findValue(k) == null) {
add(k, v);
}
} | java | {
"resource": ""
} |
q27319 | MessageHeader.mergeHeader | train | public void mergeHeader(InputStream is) throws java.io.IOException {
if (is == null)
return;
char s[] = new char[10];
int firstc = is.read();
while (firstc != '\n' && firstc != '\r' && firstc >= 0) {
int len = 0;
int keyend = -1;
int c;
... | java | {
"resource": ""
} |
q27320 | DayPeriodRules.getInstance | train | public static DayPeriodRules getInstance(ULocale locale) {
String localeCode = locale.getName();
if (localeCode.isEmpty()) { localeCode = "root"; }
Integer ruleSetNum = null;
while (ruleSetNum == null) {
ruleSetNum = DATA.localesToRuleSetNumMap.get(localeCode);
i... | java | {
"resource": ""
} |
q27321 | DeflaterOutputStream.write | train | public void write(byte[] b, int off, int len) throws IOException {
if (def.finished()) {
throw new IOException("write beyond end of stream");
}
if ((off | len | (off + len) | (b.length - (off + len))) < 0) {
throw new IndexOutOfBoundsException();
} else if (len ==... | java | {
"resource": ""
} |
q27322 | DeflaterOutputStream.close | train | public void close() throws IOException {
if (!closed) {
finish();
if (usesDefaultDeflater)
def.end();
out.close();
closed = true;
}
} | java | {
"resource": ""
} |
q27323 | DeflaterOutputStream.deflate | train | protected void deflate() throws IOException {
// Android-changed: output all available compressed data (b/4005091)
int len = 0;
while ((len = def.deflate(buf, 0, buf.length)) > 0) {
out.write(buf, 0, len);
}
} | java | {
"resource": ""
} |
q27324 | DeflaterOutputStream.flush | train | public void flush() throws IOException {
if (syncFlush && !def.finished()) {
int len = 0;
while ((len = def.deflate(buf, 0, buf.length, Deflater.SYNC_FLUSH)) > 0)
{
out.write(buf, 0, len);
if (len < buf.length)
break;
... | java | {
"resource": ""
} |
q27325 | XRTreeFrag.object | train | public Object object()
{
if (m_DTMXRTreeFrag.getXPathContext() != null)
return new org.apache.xml.dtm.ref.DTMNodeIterator((DTMIterator)(new org.apache.xpath.NodeSetDTM(m_dtmRoot, m_DTMXRTreeFrag.getXPathContext().getDTMManager())));
else
return super.object();
} | java | {
"resource": ""
} |
q27326 | UCharacterUtility.isNonCharacter | train | public static boolean isNonCharacter(int ch)
{
if ((ch & NON_CHARACTER_SUFFIX_MIN_3_0_) ==
NON_CHARACTER_SUFFIX_MIN_3_0_) {
return true;
}
return ch >= NON_CHARACTER_MIN_3_1_ && ch <= NON_CHARACTER_MAX_3_1_;
} | java | {
"resource": ""
} |
q27327 | UCharacterUtility.getNullTermByteSubString | train | static int getNullTermByteSubString(StringBuffer str, byte[] array,
int index)
{
byte b = 1;
while (b != 0)
{
b = array[index];
if (b != 0) {
str.append((char)(b & 0x00FF));
}
... | java | {
"resource": ""
} |
q27328 | UCharacterUtility.compareNullTermByteSubString | train | static int compareNullTermByteSubString(String str, byte[] array,
int strindex, int aindex)
{
byte b = 1;
int length = str.length();
while (b != 0)
{
b = array[aindex];
aindex ++;
if... | java | {
"resource": ""
} |
q27329 | UCharacterUtility.skipNullTermByteSubString | train | static int skipNullTermByteSubString(byte[] array, int index,
int skipcount)
{
byte b;
for (int i = 0; i < skipcount; i ++)
{
b = 1;
while (b != 0)
{
b = array[index];
inde... | java | {
"resource": ""
} |
q27330 | UCharacterUtility.skipByteSubString | train | static int skipByteSubString(byte[] array, int index, int length,
byte skipend)
{
int result;
byte b;
for (result = 0; result < length; result ++)
{
b = array[index + result];
if (b == skipend)
{... | java | {
"resource": ""
} |
q27331 | SequenceInputStream.nextStream | train | final void nextStream() throws IOException {
if (in != null) {
in.close();
}
if (e.hasMoreElements()) {
in = (InputStream) e.nextElement();
if (in == null)
throw new NullPointerException();
}
else in = null;
} | java | {
"resource": ""
} |
q27332 | URLImpl.getURLStreamHandler | train | public Object getURLStreamHandler(String protocol) {
URLStreamHandler handler = (URLStreamHandler) handlers.get(protocol);
if (handler == null) {
boolean checkedWithFactory = false;
// Use the factory (if any)
if (factory != null) {
handler = factory.createURLStreamHandler(protocol)... | java | {
"resource": ""
} |
q27333 | CastResolver.returnValueNeedsIntCast | train | private boolean returnValueNeedsIntCast(Expression arg) {
ExecutableElement methodElement = TreeUtil.getExecutableElement(arg);
assert methodElement != null;
if (arg.getParent() instanceof ExpressionStatement) {
// Avoid "unused return value" warning.
return false;
}
String methodName ... | java | {
"resource": ""
} |
q27334 | CastResolver.endVisit | train | @Override
public void endVisit(MethodDeclaration node) {
ExecutableElement element = node.getExecutableElement();
if (!ElementUtil.getName(element).equals("compareTo") || node.getBody() == null) {
return;
}
DeclaredType comparableType = typeUtil.findSupertype(
ElementUtil.getDeclaringCla... | java | {
"resource": ""
} |
q27335 | DecimalFormat.format | train | private StringBuffer format(long number, StringBuffer result,
FieldDelegate delegate) {
boolean isNegative = (number < 0);
if (isNegative) {
number = -number;
}
// In general, long values always represent real finite numbers, so
// we d... | java | {
"resource": ""
} |
q27336 | DecimalFormat.checkAndSetFastPathStatus | train | private void checkAndSetFastPathStatus() {
boolean fastPathWasOn = isFastPath;
if ((roundingMode == RoundingMode.HALF_EVEN) &&
(isGroupingUsed()) &&
(groupingSize == 3) &&
(secondaryGroupingSize == 0) &&
(multiplier == 1) &&
(!decimalSeparato... | java | {
"resource": ""
} |
q27337 | DecimalFormat.fastDoubleFormat | train | private void fastDoubleFormat(double d,
boolean negative) {
char[] container = fastPathData.fastPathContainer;
/*
* The principle of the algorithm is to :
* - Break the passed double into its integral and fractional parts
* converted into... | java | {
"resource": ""
} |
q27338 | DecimalFormat.setDecimalFormatSymbols | train | public void setDecimalFormatSymbols(DecimalFormatSymbols newSymbols) {
try {
// don't allow multiple references
symbols = (DecimalFormatSymbols) newSymbols.clone();
expandAffixes();
fastPathCheckNeeded = true;
} catch (Exception foo) {
// shoul... | java | {
"resource": ""
} |
q27339 | DecimalFormat.expandAffixes | train | private void expandAffixes() {
// Reuse one StringBuffer for better performance
StringBuffer buffer = new StringBuffer();
if (posPrefixPattern != null) {
positivePrefix = expandAffix(posPrefixPattern, buffer);
positivePrefixFieldPositions = null;
}
if (pos... | java | {
"resource": ""
} |
q27340 | DecimalFormat.appendAffix | train | private void appendAffix(StringBuffer buffer, String affix, boolean localized) {
boolean needQuote;
if (localized) {
needQuote = affix.indexOf(symbols.getZeroDigit()) >= 0
|| affix.indexOf(symbols.getGroupingSeparator()) >= 0
|| affix.indexOf(symbols.getDecima... | java | {
"resource": ""
} |
q27341 | DecimalFormat.toPattern | train | private String toPattern(boolean localized) {
StringBuffer result = new StringBuffer();
for (int j = 1; j >= 0; --j) {
if (j == 1)
appendAffix(result, posPrefixPattern, positivePrefix, localized);
else appendAffix(result, negPrefixPattern, negativePrefix, localize... | java | {
"resource": ""
} |
q27342 | BOCSU.getNegDivMod | train | private static final long getNegDivMod(int number, int factor)
{
int modulo = number % factor;
long result = number / factor;
if (modulo < 0) {
-- result;
modulo += factor;
}
return (result << 32) | modulo;
} | java | {
"resource": ""
} |
q27343 | DriverManager.getDrivers | train | @CallerSensitive
public static java.util.Enumeration<Driver> getDrivers() {
java.util.Vector<Driver> result = new java.util.Vector<Driver>();
ClassLoader callerClassLoader = ClassLoader.getSystemClassLoader();
// Walk through the loaded registeredDrivers.
for(DriverInfo aDriver : r... | java | {
"resource": ""
} |
q27344 | DriverManager.println | train | public static void println(String message) {
synchronized (logSync) {
if (logWriter != null) {
logWriter.println(message);
// automatic flushing is never enabled, so we must do it ourselves
logWriter.flush();
}
}
} | java | {
"resource": ""
} |
q27345 | ArabicShaping.shape | train | public int shape(char[] source, int sourceStart, int sourceLength,
char[] dest, int destStart, int destSize) throws ArabicShapingException {
if (source == null) {
throw new IllegalArgumentException("source can not be null");
}
if (sourceStart < 0 || sourceLength ... | java | {
"resource": ""
} |
q27346 | ArabicShaping.shape | train | public void shape(char[] source, int start, int length) throws ArabicShapingException {
if ((options & LAMALEF_MASK) == LAMALEF_RESIZE) {
throw new ArabicShapingException("Cannot shape in place with length option resize.");
}
shape(source, start, length, source, start, length);
} | java | {
"resource": ""
} |
q27347 | ArabicShaping.shape | train | public String shape(String text) throws ArabicShapingException {
char[] src = text.toCharArray();
char[] dest = src;
if (((options & LAMALEF_MASK) == LAMALEF_RESIZE) &&
((options & LETTERS_MASK) == LETTERS_UNSHAPE)) {
dest = new char[src.length * 2]; // max
}
... | java | {
"resource": ""
} |
q27348 | AtomicInteger.accumulateAndGet | train | public final int accumulateAndGet(int x,
IntBinaryOperator accumulatorFunction) {
int prev, next;
do {
prev = get();
next = accumulatorFunction.applyAsInt(prev, x);
} while (!compareAndSet(prev, next));
return next;
} | java | {
"resource": ""
} |
q27349 | Phaser.internalAwaitAdvance | train | private int internalAwaitAdvance(int phase, QNode node) {
// assert root == this;
releaseWaiters(phase-1); // ensure old queue clean
boolean queued = false; // true when node is enqueued
int lastUnarrived = 0; // to increase spins upon change
int spi... | java | {
"resource": ""
} |
q27350 | SelectFormat.applyPattern | train | public void applyPattern(String pattern) {
this.pattern = pattern;
if (msgPattern == null) {
msgPattern = new MessagePattern();
}
try {
msgPattern.parseSelectStyle(pattern);
} catch(RuntimeException e) {
reset();
throw e;
}
... | java | {
"resource": ""
} |
q27351 | SelectFormat.format | train | public final String format(String keyword) {
//Check for the validity of the keyword
if (!PatternProps.isIdentifier(keyword)) {
throw new IllegalArgumentException("Invalid formatting argument.");
}
// If no pattern was applied, throw an exception
if (msgPattern == nul... | java | {
"resource": ""
} |
q27352 | NodeSorter.mergesort | train | void mergesort(Vector a, Vector b, int l, int r, XPathContext support)
throws TransformerException
{
if ((r - l) > 0)
{
int m = (r + l) / 2;
mergesort(a, b, l, m, support);
mergesort(a, b, m + 1, r, support);
int i, j, k;
for (i = m; i >= l; i--)
{
//... | java | {
"resource": ""
} |
q27353 | AbstractSpinedBuffer.chunkSize | train | protected int chunkSize(int n) {
int power = (n == 0 || n == 1)
? initialChunkPower
: Math.min(initialChunkPower + n - 1, AbstractSpinedBuffer.MAX_CHUNK_POWER);
return 1 << power;
} | java | {
"resource": ""
} |
q27354 | ElemLiteralResult.getLiteralResultAttributeNS | train | public AVT getLiteralResultAttributeNS(String namespaceURI, String localName)
{
if (null != m_avts)
{
int nAttrs = m_avts.size();
for (int i = (nAttrs - 1); i >= 0; i--)
{
AVT avt = (AVT) m_avts.get(i);
if (avt.getName().equals(localName) &&
avt.getURI().e... | java | {
"resource": ""
} |
q27355 | ElemLiteralResult.resolvePrefixTables | train | public void resolvePrefixTables() throws TransformerException
{
super.resolvePrefixTables();
StylesheetRoot stylesheet = getStylesheetRoot();
if ((null != m_namespace) && (m_namespace.length() > 0))
{
NamespaceAlias nsa = stylesheet.getNamespaceAliasComposed(m_namespace);
if (null != n... | java | {
"resource": ""
} |
q27356 | ElemLiteralResult.needToCheckExclude | train | boolean needToCheckExclude()
{
if (null == m_excludeResultPrefixes && null == getPrefixTable()
&& m_ExtensionElementURIs==null // JJK Bugzilla 1133
)
return false;
else
{
// Create a new prefix table if one has not already been created.
if (null == ge... | java | {
"resource": ""
} |
q27357 | ElemLiteralResult.getPrefix | train | public String getPrefix()
{
int len=m_rawName.length()-m_localName.length()-1;
return (len>0)
? m_rawName.substring(0,len)
: "";
} | java | {
"resource": ""
} |
q27358 | ElemLiteralResult.throwDOMException | train | public void throwDOMException(short code, String msg)
{
String themsg = XSLMessages.createMessage(msg, null);
throw new DOMException(code, themsg);
} | java | {
"resource": ""
} |
q27359 | NFSubstitution.makeSubstitution | train | public static NFSubstitution makeSubstitution(int pos,
NFRule rule,
NFRule rulePredecessor,
NFRuleSet ruleSet,
RuleBased... | java | {
"resource": ""
} |
q27360 | MultiplierSubstitution.setDivisor | train | public void setDivisor(int radix, short exponent) {
divisor = NFRule.power(radix, exponent);
if (divisor == 0) {
throw new IllegalStateException("Substitution with divisor 0");
}
} | java | {
"resource": ""
} |
q27361 | ModulusSubstitution.doSubstitution | train | public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) {
// if this isn't a >>> substitution, just use the inherited version
// of this function (which uses either a rule set or a DecimalFormat
// to format its substitution value)
if (ruleTo... | java | {
"resource": ""
} |
q27362 | ModulusSubstitution.doParse | train | public Number doParse(String text, ParsePosition parsePosition, double baseValue,
double upperBound, boolean lenientParse) {
// if this isn't a >>> substitution, we can just use the
// inherited parse() routine to do the parsing
if (ruleToUse == null) {
return... | java | {
"resource": ""
} |
q27363 | FractionalPartSubstitution.doSubstitution | train | public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) {
if (!byDigits) {
// if we're not in "byDigits" mode, just use the inherited
// doSubstitution() routine
super.doSubstitution(number, toInsertInto, position, recursionCoun... | java | {
"resource": ""
} |
q27364 | FractionalPartSubstitution.doParse | train | public Number doParse(String text, ParsePosition parsePosition, double baseValue,
double upperBound, boolean lenientParse) {
// if we're not in byDigits mode, we can just use the inherited
// doParse()
if (!byDigits) {
return super.doParse(text, parsePosition,... | java | {
"resource": ""
} |
q27365 | NumeratorSubstitution.doParse | train | public Number doParse(String text, ParsePosition parsePosition, double baseValue,
double upperBound, boolean lenientParse) {
// we don't have to do anything special to do the parsing here,
// but we have to turn lenient parsing off-- if we leave it on,
// it SERIOUSLY mes... | java | {
"resource": ""
} |
q27366 | DTMAxisIteratorBase.cloneIterator | train | public DTMAxisIterator cloneIterator()
{
try
{
final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone();
clone._isRestartable = false;
// return clone.reset();
return clone;
}
catch (CloneNotSupportedException e)
{
throw new org.apache.xml.utils.Wrappe... | java | {
"resource": ""
} |
q27367 | DTMAxisIteratorBase.getNodeByPosition | train | public int getNodeByPosition(int position)
{
if (position > 0) {
final int pos = isReverse() ? getLast() - position + 1
: position;
int node;
while ((node = next()) != DTMAxisIterator.END) {
if (pos == getPosition()) {
return node;
}
... | java | {
"resource": ""
} |
q27368 | ElementUtil.isPrivateInnerType | train | public static boolean isPrivateInnerType(TypeElement type) {
switch (type.getNestingKind()) {
case ANONYMOUS:
case LOCAL:
return true;
case MEMBER:
return isPrivate(type) || isPrivateInnerType((TypeElement) type.getEnclosingElement());
case TOP_LEVEL:
return isPrivate... | java | {
"resource": ""
} |
q27369 | ElementUtil.hasOuterContext | train | public static boolean hasOuterContext(TypeElement type) {
switch (type.getNestingKind()) {
case ANONYMOUS:
case LOCAL:
return !isStatic(type.getEnclosingElement());
case MEMBER:
return !isStatic(type);
case TOP_LEVEL:
return false;
}
throw new AssertionError("... | java | {
"resource": ""
} |
q27370 | ElementUtil.parsePropertyAttribute | train | public static Set<String> parsePropertyAttribute(AnnotationMirror annotation) {
assert getName(annotation.getAnnotationType().asElement()).equals("Property");
String attributesStr = (String) getAnnotationValue(annotation, "value");
Set<String> attributes = new HashSet<>();
if (attributesStr != null) {
... | java | {
"resource": ""
} |
q27371 | ElementUtil.findGetterMethod | train | public static ExecutableElement findGetterMethod(
String propertyName, TypeMirror propertyType, TypeElement declaringClass, boolean isStatic) {
// Try Objective-C getter naming convention.
ExecutableElement getter = ElementUtil.findMethod(declaringClass, propertyName);
if (getter == null) {
// T... | java | {
"resource": ""
} |
q27372 | ElementUtil.fromModifierSet | train | public static int fromModifierSet(Set<Modifier> set) {
int modifiers = 0;
if (set.contains(Modifier.PUBLIC)) {
modifiers |= java.lang.reflect.Modifier.PUBLIC;
}
if (set.contains(Modifier.PRIVATE)) {
modifiers |= java.lang.reflect.Modifier.PRIVATE;
}
if (set.contains(Modifier.PROTECTE... | java | {
"resource": ""
} |
q27373 | ElementUtil.hasNamedAnnotation | train | public static boolean hasNamedAnnotation(AnnotatedConstruct ac, String name) {
for (AnnotationMirror annotation : ac.getAnnotationMirrors()) {
if (getName(annotation.getAnnotationType().asElement()).equals(name)) {
return true;
}
}
return false;
} | java | {
"resource": ""
} |
q27374 | ElementUtil.hasNamedAnnotation | train | public static boolean hasNamedAnnotation(AnnotatedConstruct ac, Pattern pattern) {
for (AnnotationMirror annotation : ac.getAnnotationMirrors()) {
if (pattern.matcher(getName(annotation.getAnnotationType().asElement())).matches()) {
return true;
}
}
return false;
} | java | {
"resource": ""
} |
q27375 | ElementUtil.getSortedAnnotationMembers | train | public static List<ExecutableElement> getSortedAnnotationMembers(TypeElement annotation) {
List<ExecutableElement> members = Lists.newArrayList(getMethods(annotation));
Collections.sort(members, (m1, m2) -> getName(m1).compareTo(getName(m2)));
return members;
} | java | {
"resource": ""
} |
q27376 | ElementUtil.suppressesWarning | train | @SuppressWarnings("unchecked")
public static boolean suppressesWarning(String warning, Element element) {
if (element == null || isPackage(element)) {
return false;
}
AnnotationMirror annotation = getAnnotation(element, SuppressWarnings.class);
if (annotation != null) {
for (AnnotationValu... | java | {
"resource": ""
} |
q27377 | ElementUtil.getType | train | public TypeMirror getType(Element element) {
return elementTypeMap.containsKey(element) ? elementTypeMap.get(element) : element.asType();
} | java | {
"resource": ""
} |
q27378 | ElementUtil.isNonnull | train | public static boolean isNonnull(Element element, boolean parametersNonnullByDefault) {
return hasNonnullAnnotation(element)
|| isConstructor(element) // Java constructors are always non-null.
|| (isParameter(element)
&& parametersNonnullByDefault
&& !((VariableElement) eleme... | java | {
"resource": ""
} |
q27379 | ElementUtil.getSourceFile | train | public static String getSourceFile(TypeElement type) {
if (type instanceof ClassSymbol) {
JavaFileObject srcFile = ((ClassSymbol) type).sourcefile;
if (srcFile != null) {
return srcFile.getName();
}
}
return null;
} | java | {
"resource": ""
} |
q27380 | SystemIDResolver.isAbsolutePath | train | public static boolean isAbsolutePath(String systemId)
{
if(systemId == null)
return false;
final File file = new File(systemId);
return file.isAbsolute();
} | java | {
"resource": ""
} |
q27381 | SystemIDResolver.replaceChars | train | private static String replaceChars(String str)
{
StringBuffer buf = new StringBuffer(str);
int length = buf.length();
for (int i = 0; i < length; i++)
{
char currentChar = buf.charAt(i);
// Replace space with "%20"
if (currentChar == ' ')
{
buf.setCharAt(i, '%');
... | java | {
"resource": ""
} |
q27382 | ProviderList.newList | train | public static ProviderList newList(Provider ... providers) {
ProviderConfig[] configs = new ProviderConfig[providers.length];
for (int i = 0; i < providers.length; i++) {
configs[i] = new ProviderConfig(providers[i]);
}
return new ProviderList(configs, true);
} | java | {
"resource": ""
} |
q27383 | ProviderList.getJarList | train | ProviderList getJarList(String[] jarClassNames) {
List<ProviderConfig> newConfigs = new ArrayList<>();
for (String className : jarClassNames) {
ProviderConfig newConfig = new ProviderConfig(className);
for (ProviderConfig config : configs) {
// if the equivalent o... | java | {
"resource": ""
} |
q27384 | ProviderList.getProvider | train | Provider getProvider(int index) {
Provider p = configs[index].getProvider();
return (p != null) ? p : EMPTY_PROVIDER;
} | java | {
"resource": ""
} |
q27385 | ProviderList.getProvider | train | public Provider getProvider(String name) {
ProviderConfig config = getProviderConfig(name);
return (config == null) ? null : config.getProvider();
} | java | {
"resource": ""
} |
q27386 | ProviderList.getIndex | train | public int getIndex(String name) {
for (int i = 0; i < configs.length; i++) {
Provider p = getProvider(i);
if (p.getName().equals(name)) {
return i;
}
}
return -1;
} | java | {
"resource": ""
} |
q27387 | ProviderList.loadAll | train | private int loadAll() {
if (allLoaded) {
return configs.length;
}
if (debug != null) {
debug.println("Loading all providers");
new Exception("Call trace").printStackTrace();
}
int n = 0;
for (int i = 0; i < configs.length; i++) {
... | java | {
"resource": ""
} |
q27388 | ProviderList.removeInvalid | train | ProviderList removeInvalid() {
int n = loadAll();
if (n == configs.length) {
return this;
}
ProviderConfig[] newConfigs = new ProviderConfig[n];
for (int i = 0, j = 0; i < configs.length; i++) {
ProviderConfig config = configs[i];
if (config.is... | java | {
"resource": ""
} |
q27389 | ProviderList.getService | train | public Service getService(String type, String name) {
for (int i = 0; i < configs.length; i++) {
Provider p = getProvider(i);
Service s = p.getService(type, name);
if (s != null) {
return s;
}
}
return null;
} | java | {
"resource": ""
} |
q27390 | ProviderList.getServices | train | public List<Service> getServices(String type, String algorithm) {
return new ServiceList(type, algorithm);
} | java | {
"resource": ""
} |
q27391 | Formatter.format | train | public Formatter format(String format, Object ... args) {
return format(l, format, args);
} | java | {
"resource": ""
} |
q27392 | Formatter.format | train | public Formatter format(Locale l, String format, Object ... args) {
ensureOpen();
// index of last argument referenced
int last = -1;
// last ordinary index
int lasto = -1;
FormatString[] fsa = parse(format);
for (int i = 0; i < fsa.length; i++) {
Fo... | java | {
"resource": ""
} |
q27393 | Formatter.parse | train | private FormatString[] parse(String s) {
ArrayList<FormatString> al = new ArrayList<>();
for (int i = 0, len = s.length(); i < len; ) {
int nextPercent = s.indexOf('%', i);
if (s.charAt(i) != '%') {
// This is plain-text part, find the maximal plain-text
... | java | {
"resource": ""
} |
q27394 | SpoofChecker.failsChecks | train | public boolean failsChecks(String text, CheckResult checkResult) {
int length = text.length();
int result = 0;
if (checkResult != null) {
checkResult.position = 0;
checkResult.numerics = null;
checkResult.restrictionLevel = null;
}
if (0 != (... | java | {
"resource": ""
} |
q27395 | SpoofChecker.areConfusable | train | public int areConfusable(String s1, String s2) {
//
// See section 4 of UAX 39 for the algorithm for checking whether two strings are confusable,
// and for definitions of the types (single, whole, mixed-script) of confusables.
// We only care about a few of the check flags. Ignore the ... | java | {
"resource": ""
} |
q27396 | SpoofChecker.getSkeleton | train | public String getSkeleton(CharSequence str) {
// Apply the skeleton mapping to the NFD normalized input string
// Accumulate the skeleton, possibly unnormalized, in a String.
String nfdId = nfdNormalizer.normalize(str);
int normalizedLen = nfdId.length();
StringBuilder skelSB = n... | java | {
"resource": ""
} |
q27397 | SpoofChecker.getAugmentedScriptSet | train | private static void getAugmentedScriptSet(int codePoint, ScriptSet result) {
result.clear();
UScript.getScriptExtensions(codePoint, result);
// Section 5.1 step 1
if (result.get(UScript.HAN)) {
result.set(UScript.HAN_WITH_BOPOMOFO);
result.set(UScript.JAPANESE);
... | java | {
"resource": ""
} |
q27398 | SpoofChecker.getResolvedScriptSet | train | private void getResolvedScriptSet(CharSequence input, ScriptSet result) {
getResolvedScriptSetWithout(input, UScript.CODE_LIMIT, result);
} | java | {
"resource": ""
} |
q27399 | SpoofChecker.getResolvedScriptSetWithout | train | private void getResolvedScriptSetWithout(CharSequence input, int script, ScriptSet result) {
result.setAll();
ScriptSet temp = new ScriptSet();
for (int utf16Offset = 0; utf16Offset < input.length();) {
int codePoint = Character.codePointAt(input, utf16Offset);
utf16Offs... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.