_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q27200
GlobalizationPreferences.setBreakIterator
train
public GlobalizationPreferences setBreakIterator(int type, BreakIterator iterator) { if (type < BI_CHARACTER || type >= BI_LIMIT) { throw new IllegalArgumentException("Illegal break iterator type"); } if (isFrozen()) { throw new UnsupportedOperationException("Attempt to m...
java
{ "resource": "" }
q27201
GlobalizationPreferences.setDateFormat
train
public GlobalizationPreferences setDateFormat(int dateStyle, int timeStyle, DateFormat format) { if (isFrozen()) { throw new UnsupportedOperationException("Attempt to modify immutable object"); } if (dateFormats == null) { dateFormats = new DateFormat[DF_LIMIT][DF_LIMIT];...
java
{ "resource": "" }
q27202
GlobalizationPreferences.setNumberFormat
train
public GlobalizationPreferences setNumberFormat(int style, NumberFormat format) { if (isFrozen()) { throw new UnsupportedOperationException("Attempt to modify immutable object"); } if (numberFormats == null) { numberFormats = new NumberFormat[NF_LIMIT]; } ...
java
{ "resource": "" }
q27203
GlobalizationPreferences.reset
train
public GlobalizationPreferences reset() { if (isFrozen()) { throw new UnsupportedOperationException("Attempt to modify immutable object"); } locales = null; territory = null; calendar = null; collator = null; breakIterators = null; timezone = n...
java
{ "resource": "" }
q27204
GlobalizationPreferences.guessTerritory
train
protected String guessTerritory() { String result; // pass through locales to see if there is a territory. for (ULocale locale : getLocales()) { result = locale.getCountry(); if (result.length() != 0) { return result; } } // if ...
java
{ "resource": "" }
q27205
DefaultErrorHandler.error
train
public void error(TransformerException exception) throws TransformerException { // If the m_throwExceptionOnError flag is true, rethrow the exception. // Otherwise report the error to System.err. if (m_throwExceptionOnError) throw exception; else { PrintWriter pw = getErrorWriter(); ...
java
{ "resource": "" }
q27206
Scanner.readInput
train
private void readInput() { if (buf.limit() == buf.capacity()) makeSpace(); // Prepare to receive data int p = buf.position(); buf.position(buf.limit()); buf.limit(buf.capacity()); int n = 0; try { n = source.read(buf); } catch (IO...
java
{ "resource": "" }
q27207
Scanner.makeSpace
train
private boolean makeSpace() { clearCaches(); int offset = savedScannerPosition == -1 ? position : savedScannerPosition; buf.position(offset); // Gain space by compacting buffer if (offset > 0) { buf.compact(); translateSavedIndexes(offset); ...
java
{ "resource": "" }
q27208
Scanner.hasTokenInBuffer
train
private boolean hasTokenInBuffer() { matchValid = false; matcher.usePattern(delimPattern); matcher.region(position, buf.limit()); // Skip delims first if (matcher.lookingAt()) position = matcher.end(); // If we are sitting at the end, no more tokens in buffe...
java
{ "resource": "" }
q27209
Scanner.findPatternInBuffer
train
private String findPatternInBuffer(Pattern pattern, int horizon) { matchValid = false; matcher.usePattern(pattern); int bufferLimit = buf.limit(); int horizonLimit = -1; int searchLimit = bufferLimit; if (horizon > 0) { horizonLimit = position + horizon; ...
java
{ "resource": "" }
q27210
Scanner.matchPatternInBuffer
train
private String matchPatternInBuffer(Pattern pattern) { matchValid = false; matcher.usePattern(pattern); matcher.region(position, buf.limit()); if (matcher.lookingAt()) { if (matcher.hitEnd() && (!sourceClosed)) { // Get more input and try again ...
java
{ "resource": "" }
q27211
Scanner.close
train
public void close() { if (closed) return; if (source instanceof Closeable) { try { ((Closeable)source).close(); } catch (IOException ioe) { lastException = ioe; } } sourceClosed = true; source = null;...
java
{ "resource": "" }
q27212
Scanner.useLocale
train
public Scanner useLocale(Locale locale) { if (locale.equals(this.locale)) return this; this.locale = locale; DecimalFormat df = (DecimalFormat)NumberFormat.getNumberInstance(locale); DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(locale); //...
java
{ "resource": "" }
q27213
Scanner.useRadix
train
public Scanner useRadix(int radix) { if ((radix < Character.MIN_RADIX) || (radix > Character.MAX_RADIX)) throw new IllegalArgumentException("radix:"+radix); if (this.defaultRadix == radix) return this; this.defaultRadix = radix; // Force rebuilding and recompilat...
java
{ "resource": "" }
q27214
Scanner.setRadix
train
private void setRadix(int radix) { // Android-changed: Complain loudly if a bogus radix is being set. if (radix > Character.MAX_RADIX) { throw new IllegalArgumentException("radix == " + radix); } if (this.radix != radix) { // Force rebuilding and recompilation of...
java
{ "resource": "" }
q27215
Scanner.hasNext
train
public boolean hasNext() { ensureOpen(); saveState(); while (!sourceClosed) { if (hasTokenInBuffer()) return revertState(true); readInput(); } boolean result = hasTokenInBuffer(); return revertState(result); }
java
{ "resource": "" }
q27216
Scanner.hasNext
train
public boolean hasNext(Pattern pattern) { ensureOpen(); if (pattern == null) throw new NullPointerException(); hasNextPattern = null; saveState(); while (true) { if (getCompleteTokenInBuffer(pattern) != null) { matchValid = true; ...
java
{ "resource": "" }
q27217
Scanner.hasNextLine
train
public boolean hasNextLine() { saveState(); String result = findWithinHorizon(linePattern(), 0); if (result != null) { MatchResult mr = this.match(); String lineSep = mr.group(1); if (lineSep != null) { result = result.substring(0, result.leng...
java
{ "resource": "" }
q27218
Scanner.nextLine
train
public String nextLine() { if (hasNextPattern == linePattern()) return getCachedResult(); clearCaches(); String result = findWithinHorizon(linePattern, 0); if (result == null) throw new NoSuchElementException("No line found"); MatchResult mr = this.match(...
java
{ "resource": "" }
q27219
Scanner.findWithinHorizon
train
public String findWithinHorizon(String pattern, int horizon) { return findWithinHorizon(patternCache.forName(pattern), horizon); }
java
{ "resource": "" }
q27220
Scanner.findWithinHorizon
train
public String findWithinHorizon(Pattern pattern, int horizon) { ensureOpen(); if (pattern == null) throw new NullPointerException(); if (horizon < 0) throw new IllegalArgumentException("horizon < 0"); clearCaches(); // Search for the pattern while...
java
{ "resource": "" }
q27221
Scanner.skip
train
public Scanner skip(Pattern pattern) { ensureOpen(); if (pattern == null) throw new NullPointerException(); clearCaches(); // Search for the pattern while (true) { String token = matchPatternInBuffer(pattern); if (token != null) { ...
java
{ "resource": "" }
q27222
Scanner.processIntegerToken
train
private String processIntegerToken(String token) { String result = token.replaceAll(""+groupSeparator, ""); boolean isNegative = false; int preLen = negativePrefix.length(); if ((preLen > 0) && result.startsWith(negativePrefix)) { isNegative = true; result = resul...
java
{ "resource": "" }
q27223
Scanner.processFloatToken
train
private String processFloatToken(String token) { String result = token.replaceAll(groupSeparator, ""); if (!decimalSeparator.equals("\\.")) result = result.replaceAll(decimalSeparator, "."); boolean isNegative = false; int preLen = negativePrefix.length(); if ((preLen...
java
{ "resource": "" }
q27224
Scanner.reset
train
public Scanner reset() { delimPattern = WHITESPACE_PATTERN; useLocale(Locale.getDefault(Locale.Category.FORMAT)); useRadix(10); clearCaches(); return this; }
java
{ "resource": "" }
q27225
Attributes2Impl.removeAttribute
train
public void removeAttribute (int index) { int origMax = getLength () - 1; super.removeAttribute (index); if (index != origMax) { System.arraycopy (declared, index + 1, declared, index, origMax - index); System.arraycopy (specified, index + 1, specified, index, or...
java
{ "resource": "" }
q27226
Attributes2Impl.setDeclared
train
public void setDeclared (int index, boolean value) { if (index < 0 || index >= getLength ()) throw new ArrayIndexOutOfBoundsException ( "No attribute at index: " + index); declared [index] = value; }
java
{ "resource": "" }
q27227
Attributes2Impl.setSpecified
train
public void setSpecified (int index, boolean value) { if (index < 0 || index >= getLength ()) throw new ArrayIndexOutOfBoundsException ( "No attribute at index: " + index); specified [index] = value; }
java
{ "resource": "" }
q27228
FuncExtFunction.getArg
train
public Expression getArg(int n) { if (n >= 0 && n < m_argVec.size()) return (Expression) m_argVec.elementAt(n); else return null; }
java
{ "resource": "" }
q27229
FuncExtFunction.callArgVisitors
train
public void callArgVisitors(XPathVisitor visitor) { for (int i = 0; i < m_argVec.size(); i++) { Expression exp = (Expression)m_argVec.elementAt(i); exp.callVisitors(new ArgExtOwner(exp), visitor); } }
java
{ "resource": "" }
q27230
FuncExtFunction.exprSetParent
train
public void exprSetParent(ExpressionNode n) { super.exprSetParent(n); int nArgs = m_argVec.size(); for (int i = 0; i < nArgs; i++) { Expression arg = (Expression) m_argVec.elementAt(i); arg.exprSetParent(n); } }
java
{ "resource": "" }
q27231
FuncExtFunction.reportWrongNumberArgs
train
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); ...
java
{ "resource": "" }
q27232
ElemTextLiteral.execute
train
public void execute( TransformerImpl transformer) throws TransformerException { try { SerializationHandler rth = transformer.getResultTreeHandler(); if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING...
java
{ "resource": "" }
q27233
ClassFile.getRelativePath
train
public String getRelativePath() { StringBuilder sb = new StringBuilder(); String pkg = typeRef.getPackageName().replace('.', '/'); if (pkg.length() > 0) { sb.append(pkg); sb.append('/'); } appendDeclaringTypes(typeRef, '$', sb); sb.append(typeRef.getSimpleName()); sb.append(".cla...
java
{ "resource": "" }
q27234
ClassFile.appendDeclaringTypes
train
private static void appendDeclaringTypes(TypeReference typeRef, char innerClassDelimiter, StringBuilder sb) { TypeReference declaringType = typeRef.getDeclaringType(); if (declaringType != null) { appendDeclaringTypes(declaringType, innerClassDelimiter, sb); sb.append(declaringType.getSimpleNa...
java
{ "resource": "" }
q27235
ClassFile.getFieldNode
train
public FieldDeclaration getFieldNode(String name, String signature) { for (EntityDeclaration node : type.getMembers()) { if (node.getEntityType() == EntityType.FIELD) { FieldDeclaration field = (FieldDeclaration) node; if (field.getName().equals(name) && signature(field.getReturnTy...
java
{ "resource": "" }
q27236
ClassFile.getMethod
train
public MethodDeclaration getMethod(String name, String signature) { for (EntityDeclaration node : type.getMembers()) { if (node.getEntityType() == EntityType.METHOD) { MethodDeclaration method = (MethodDeclaration) node; if (method.getName().equals(name) && signature.equals(signature(method)))...
java
{ "resource": "" }
q27237
ClassFile.getConstructor
train
public ConstructorDeclaration getConstructor(String signature) { for (EntityDeclaration node : type.getMembers()) { if (node.getEntityType() == EntityType.CONSTRUCTOR) { ConstructorDeclaration cons = (ConstructorDeclaration) node; if (signature.equals(signature(cons))) { return cons;...
java
{ "resource": "" }
q27238
BasicPeriodFormatterService.getInstance
train
public static BasicPeriodFormatterService getInstance() { if (instance == null) { PeriodFormatterDataService ds = ResourceBasedPeriodFormatterDataService .getInstance(); instance = new BasicPeriodFormatterService(ds); } return instance; }
java
{ "resource": "" }
q27239
AsyncTask.get
train
public final Result get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return mFuture.get(timeout, unit); }
java
{ "resource": "" }
q27240
StringCharacterIterator.setText
train
@Deprecated public void setText(String text) { if (text == null) { throw new NullPointerException(); } this.text = text; this.begin = 0; this.end = text.length(); this.pos = 0; }
java
{ "resource": "" }
q27241
SignatureFileVerifier.isBlockOrSF
train
public static boolean isBlockOrSF(String s) { // we currently only support DSA and RSA PKCS7 blocks if (s.endsWith(".SF") || s.endsWith(".DSA") || s.endsWith(".RSA") || s.endsWith(".EC")) { return true; } return false; }
java
{ "resource": "" }
q27242
SignatureFileVerifier.getDigest
train
private MessageDigest getDigest(String algorithm) { if (createdDigests == null) createdDigests = new HashMap<String, MessageDigest>(); MessageDigest digest = createdDigests.get(algorithm); if (digest == null) { try { digest = MessageDigest.getInstanc...
java
{ "resource": "" }
q27243
SignatureFileVerifier.process
train
public void process(Hashtable<String, CodeSigner[]> signers, List manifestDigests) throws IOException, SignatureException, NoSuchAlgorithmException, JarException, CertificateException { // calls Signature.getInstance() and MessageDigest.getInstance() // need to use lo...
java
{ "resource": "" }
q27244
SignatureFileVerifier.verifyManifestHash
train
private boolean verifyManifestHash(Manifest sf, ManifestDigester md, BASE64Decoder decoder, List manifestDigests) throws IOException { Attributes mattr = sf.getMainAttributes(); ...
java
{ "resource": "" }
q27245
SignatureFileVerifier.verifySection
train
private boolean verifySection(Attributes sfAttr, String name, ManifestDigester md, BASE64Decoder decoder) throws IOException { boolean oneDigestVerified = false; ManifestDigester.Entry mde ...
java
{ "resource": "" }
q27246
SignatureFileVerifier.toHex
train
static String toHex(byte[] data) { StringBuffer sb = new StringBuffer(data.length*2); for (int i=0; i<data.length; i++) { sb.append(hexc[(data[i] >>4) & 0x0f]); sb.append(hexc[data[i] & 0x0f]); } return sb.toString(); }
java
{ "resource": "" }
q27247
SignatureFileVerifier.contains
train
static boolean contains(CodeSigner[] set, CodeSigner signer) { for (int i = 0; i < set.length; i++) { if (set[i].equals(signer)) return true; } return false; }
java
{ "resource": "" }
q27248
SignatureFileVerifier.isSubSet
train
static boolean isSubSet(CodeSigner[] subset, CodeSigner[] set) { // check for the same object if (set == subset) return true; boolean match; for (int i = 0; i < subset.length; i++) { if (!contains(set, subset[i])) return false; } ...
java
{ "resource": "" }
q27249
SignatureFileVerifier.matches
train
static boolean matches(CodeSigner[] signers, CodeSigner[] oldSigners, CodeSigner[] newSigners) { // special case if ((oldSigners == null) && (signers == newSigners)) return true; boolean match; // make sure all oldSigners are in signers if ((oldSigners != n...
java
{ "resource": "" }
q27250
NewInstance.newInstance
train
static Object newInstance (ClassLoader classLoader, String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { Class driverClass; if (classLoader == null) { driverClass = Class.forName(className); } else { dri...
java
{ "resource": "" }
q27251
JarOutputStream.putNextEntry
train
public void putNextEntry(ZipEntry ze) throws IOException { if (firstEntry) { // Make sure that extra field data for first JAR // entry includes JAR magic number id. byte[] edata = ze.getExtra(); if (edata == null || !hasMagic(edata)) { if (edata ==...
java
{ "resource": "" }
q27252
TypeDeclarationGenerator.printInstanceVariables
train
protected void printInstanceVariables() { Iterable<VariableDeclarationFragment> fields = getInstanceFields(); if (Iterables.isEmpty(fields)) { newline(); return; } // Need direct access to fields possibly from inner classes that are // promoted to top level classes, so must make all visi...
java
{ "resource": "" }
q27253
TypeDeclarationGenerator.printDeadClassConstant
train
protected void printDeadClassConstant(VariableDeclarationFragment fragment) { VariableElement var = fragment.getVariableElement(); Object value = var.getConstantValue(); assert value != null; String declType = getDeclarationType(var); declType += (declType.endsWith("*") ? "" : " "); String name ...
java
{ "resource": "" }
q27254
TypeDeclarationGenerator.printMethodDeclaration
train
private void printMethodDeclaration(MethodDeclaration m, boolean isCompanionClass) { ExecutableElement methodElement = m.getExecutableElement(); TypeElement typeElement = ElementUtil.getDeclaringClass(methodElement); if (typeElement.getKind().isInterface()) { // isCompanion and isStatic must be both ...
java
{ "resource": "" }
q27255
TypeDeclarationGenerator.nullability
train
@Override protected String nullability(Element element) { if (options.nullability()) { if (ElementUtil.hasNullableAnnotation(element)) { return " __nullable"; } if (ElementUtil.isNonnull(element, parametersNonnullByDefault)) { return " __nonnull"; } } return ""; }
java
{ "resource": "" }
q27256
MappedByteBuffer.mappingOffset
train
private long mappingOffset() { int ps = Bits.pageSize(); long offset = address % ps; return (offset >= 0) ? offset : (ps + offset); }
java
{ "resource": "" }
q27257
MappedByteBuffer.isLoaded
train
public final boolean isLoaded() { checkMapped(); if ((address == 0) || (capacity() == 0)) return true; long offset = mappingOffset(); long length = mappingLength(offset); return isLoaded0(mappingAddress(offset), length, Bits.pageCount(length)); }
java
{ "resource": "" }
q27258
MappedByteBuffer.load
train
public final MappedByteBuffer load() { checkMapped(); if ((address == 0) || (capacity() == 0)) return this; long offset = mappingOffset(); long length = mappingLength(offset); load0(mappingAddress(offset), length); // Read a byte from each page to bring it in...
java
{ "resource": "" }
q27259
MappedByteBuffer.force
train
public final MappedByteBuffer force() { checkMapped(); if ((address != 0) && (capacity() != 0)) { long offset = mappingOffset(); force0(fd, mappingAddress(offset), mappingLength(offset)); } return this; }
java
{ "resource": "" }
q27260
ListFormatter.getInstance
train
public static ListFormatter getInstance(Locale locale) { return getInstance(ULocale.forLocale(locale), Style.STANDARD); }
java
{ "resource": "" }
q27261
ListFormatter.getInstance
train
@Deprecated public static ListFormatter getInstance(ULocale locale, Style style) { return cache.get(locale, style.getName()); }
java
{ "resource": "" }
q27262
ListFormatter.format
train
FormattedListBuilder format(Collection<?> items, int index) { Iterator<?> it = items.iterator(); int count = items.size(); switch (count) { case 0: return new FormattedListBuilder("", false); case 1: return new FormattedListBuilder(it.next(), index == 0); ...
java
{ "resource": "" }
q27263
ListFormatter.getPatternForNumItems
train
public String getPatternForNumItems(int count) { if (count <= 0) { throw new IllegalArgumentException("count must be > 0"); } ArrayList<String> list = new ArrayList<String>(); for (int i = 0; i < count; i++) { list.add(String.format("{%d}", i)); } ...
java
{ "resource": "" }
q27264
UnusedCodeTracker.markUsedElements
train
public void markUsedElements(CodeReferenceMap publicRootSet) { if (publicRootSet == null) { markUsedElements(); return; } //Add all public methods in publicRootClasses to root set for (String clazz : publicRootSet.getReferencedClasses()) { ClassReferenceNode classNode = (ClassReference...
java
{ "resource": "" }
q27265
UnusedCodeTracker.traverseMethod
train
public void traverseMethod(String methodID) { MethodReferenceNode node = (MethodReferenceNode) elementReferenceMap.get(methodID); if (node == null) { //TODO(malvania): This might never be reached, because we create a node for every method, // both invoked and declared. ErrorUtil...
java
{ "resource": "" }
q27266
Cipher.init
train
public final void init(int opmode, Key key) throws InvalidKeyException { init(opmode, key, JceSecurity.RANDOM); }
java
{ "resource": "" }
q27267
Cipher.init
train
public final void init(int opmode, Key key, SecureRandom random) throws InvalidKeyException { initialized = false; checkOpmode(opmode); try { chooseProvider(InitType.KEY, opmode, key, null, null, random); } catch (InvalidAlgorithmParameterException e) { ...
java
{ "resource": "" }
q27268
Cipher.init
train
public final void init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { initialized = false; checkOpmode(opmode); chooseProvider(InitType.ALGORITHM_PARAM_SPEC, opm...
java
{ "resource": "" }
q27269
Cipher.init
train
public final void init(int opmode, Certificate certificate, SecureRandom random) throws InvalidKeyException { initialized = false; checkOpmode(opmode); // Check key usage if the certificate is of // type X.509. if (certificate instanceof ja...
java
{ "resource": "" }
q27270
Cipher.doFinal
train
public final int doFinal(byte[] output, int outputOffset) throws IllegalBlockSizeException, ShortBufferException, BadPaddingException { checkCipherState(); // Input sanity check if ((output == null) || (outputOffset < 0)) { throw new IllegalArgumentExcepti...
java
{ "resource": "" }
q27271
Cipher.wrap
train
public final byte[] wrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { if (!(this instanceof NullCipher)) { if (!initialized) { throw new IllegalStateException("Cipher not initialized"); } if (opmode != Cipher.WRAP_MODE) { ...
java
{ "resource": "" }
q27272
Cipher.unwrap
train
public final Key unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException { if (!(this instanceof NullCipher)) { if (!initialized) { throw new Il...
java
{ "resource": "" }
q27273
Cipher.getMaxAllowedParameterSpec
train
public static final AlgorithmParameterSpec getMaxAllowedParameterSpec( String transformation) throws NoSuchAlgorithmException { // Android-changed: Remove references to CryptoPermission and throw early // if transformation == null or isn't valid. // // CryptoPermission cp = g...
java
{ "resource": "" }
q27274
Cipher.matchAttribute
train
static boolean matchAttribute(Provider.Service service, String attr, String value) { if (value == null) { return true; } final String pattern = service.getAttribute(attr); if (pattern == null) { return true; } final String valueUc = value.toUpperCa...
java
{ "resource": "" }
q27275
StringTrieBuilder.registerNode
train
private final Node registerNode(Node newNode) { if(state==State.BUILDING_FAST) { return newNode; } // BUILDING_SMALL Node oldNode=nodes.get(newNode); if(oldNode!=null) { return oldNode; } // If put() returns a non-null value from an equival...
java
{ "resource": "" }
q27276
StringTrieBuilder.registerFinalValue
train
private final ValueNode registerFinalValue(int value) { // We always register final values because while ADDING // we do not know yet whether we will build fast or small. lookupFinalValueNode.setFinalValue(value); Node oldNode=nodes.get(lookupFinalValueNode); if(oldNode!=null) { ...
java
{ "resource": "" }
q27277
ProcessorLRE.getStylesheetRoot
train
protected Stylesheet getStylesheetRoot(StylesheetHandler handler) throws TransformerConfigurationException { StylesheetRoot stylesheet; stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener()); if (handler.getStylesheetProcessor().isSecureProcessing()) ...
java
{ "resource": "" }
q27278
SignatureGenerator.createTypeSignature
train
public String createTypeSignature(TypeMirror type) { StringBuilder sb = new StringBuilder(); genTypeSignature(type, sb); return sb.toString(); }
java
{ "resource": "" }
q27279
SignatureGenerator.createClassSignature
train
public String createClassSignature(TypeElement type) { if (!hasGenericSignature(type)) { return null; } StringBuilder sb = new StringBuilder(); genClassSignature(type, sb); return sb.toString(); }
java
{ "resource": "" }
q27280
SignatureGenerator.createFieldTypeSignature
train
public String createFieldTypeSignature(VariableElement variable) { if (!hasGenericSignature(variable.asType())) { return null; } StringBuilder sb = new StringBuilder(); genTypeSignature(variable.asType(), sb); return sb.toString(); }
java
{ "resource": "" }
q27281
SignatureGenerator.createMethodTypeSignature
train
public String createMethodTypeSignature(ExecutableElement method) { if (!hasGenericSignature(method)) { return null; } StringBuilder sb = new StringBuilder(); genMethodTypeSignature(method, sb); return sb.toString(); }
java
{ "resource": "" }
q27282
GetInstance.checkSuperClass
train
public static void checkSuperClass(Service s, Class<?> subClass, Class<?> superClass) throws NoSuchAlgorithmException { if (superClass == null) { return; } if (superClass.isAssignableFrom(subClass) == false) { throw new NoSuchAlgorithmException ...
java
{ "resource": "" }
q27283
SignatureSpi.engineInitSign
train
protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException { this.appRandom = random; engineInitSign(privateKey); }
java
{ "resource": "" }
q27284
StringTokenizer.setMaxDelimCodePoint
train
private void setMaxDelimCodePoint() { if (delimiters == null) { maxDelimCodePoint = 0; return; } int m = 0; int c; int count = 0; for (int i = 0; i < delimiters.length(); i += Character.charCount(c)) { c = delimiters.charAt(i); ...
java
{ "resource": "" }
q27285
StringTokenizer.skipDelimiters
train
private int skipDelimiters(int startPos) { if (delimiters == null) throw new NullPointerException(); int position = startPos; while (!retDelims && position < maxPosition) { if (!hasSurrogates) { char c = str.charAt(position); if ((c > maxD...
java
{ "resource": "" }
q27286
StringTokenizer.scanToken
train
private int scanToken(int startPos) { int position = startPos; while (position < maxPosition) { if (!hasSurrogates) { char c = str.charAt(position); if ((c <= maxDelimCodePoint) && (delimiters.indexOf(c) >= 0)) break; positi...
java
{ "resource": "" }
q27287
ReasonFlags.set
train
private void set(int position, boolean val) { // enlarge bitString if necessary if (position >= bitString.length) { boolean[] tmp = new boolean[position+1]; System.arraycopy(bitString, 0, tmp, 0, bitString.length); bitString = tmp; } bitString[position...
java
{ "resource": "" }
q27288
NFRule.makeRules
train
public static void makeRules(String description, NFRuleSet owner, NFRule predecessor, RuleBasedNumberFormat ownersOwner, List<NFRule> ...
java
{ "resource": "" }
q27289
NFRule.extractSubstitutions
train
private void extractSubstitutions(NFRuleSet owner, String ruleText, NFRule predecessor) { this.ruleText = ruleText; sub1 = extractSubstitution(owner, predecessor); if (sub1 == nu...
java
{ "resource": "" }
q27290
NFRule.extractSubstitution
train
private NFSubstitution extractSubstitution(NFRuleSet owner, NFRule predecessor) { NFSubstitution result; int subStart; int subEnd; // search the rule's rule text for the first two characters of // a substi...
java
{ "resource": "" }
q27291
NFRule.setBaseValue
train
final void setBaseValue(long newBaseValue) { // set the base value baseValue = newBaseValue; radix = 10; // if this isn't a special rule, recalculate the radix and exponent // (the radix always defaults to 10; if it's supposed to be something // else, it's cleaned up by ...
java
{ "resource": "" }
q27292
NFRule.expectedExponent
train
private short expectedExponent() { // since the log of 0, or the log base 0 of something, causes an // error, declare the exponent in these cases to be 0 (we also // deal with the special-rule identifiers here) if (radix == 0 || baseValue < 1) { return 0; } /...
java
{ "resource": "" }
q27293
NFRule.indexOfAnyRulePrefix
train
private static int indexOfAnyRulePrefix(String ruleText) { int result = -1; if (ruleText.length() > 0) { int pos; for (String string : RULE_PREFIXES) { pos = ruleText.indexOf(string); if (pos != -1 && (result == -1 || pos < result)) { ...
java
{ "resource": "" }
q27294
NFRule.doFormat
train
public void doFormat(double number, StringBuilder toInsertInto, int pos, int recursionCount) { // first, insert the rule's rule text into toInsertInto at the // specified position, then insert the results of the substitutions // into the right places in toInsertInto // [again, we have tw...
java
{ "resource": "" }
q27295
NFRule.power
train
static long power(long base, short exponent) { if (exponent < 0) { throw new IllegalArgumentException("Exponent can not be negative"); } if (base < 0) { throw new IllegalArgumentException("Base can not be negative"); } long result = 1; while (expon...
java
{ "resource": "" }
q27296
NFRule.doParse
train
public Number doParse(String text, ParsePosition parsePosition, boolean isFractionRule, double upperBound) { // internally we operate on a copy of the string being parsed // (because we're going to change it) and use our own ParsePosition ParsePosition pp = new ParsePo...
java
{ "resource": "" }
q27297
NFRule.allIgnorable
train
private boolean allIgnorable(String str) { // if the string is empty, we can just return true if (str == null || str.length() == 0) { return true; } RbnfLenientScanner scanner = formatter.getLenientScanner(); return scanner != null && scanner.allIgnorable(str); }
java
{ "resource": "" }
q27298
Trie2.serializeHeader
train
protected int serializeHeader(DataOutputStream dos) throws IOException { // Write the header. It is already set and ready to use, having been // created when the Trie2 was unserialized or when it was frozen. int bytesWritten = 0; dos.writeInt(header.signature); dos.writeShort...
java
{ "resource": "" }
q27299
Trie2.rangeEnd
train
int rangeEnd(int start, int limitp, int val) { int c; int limit = Math.min(highStart, limitp); for (c = start+1; c < limit; c++) { if (get(c) != val) { break; } } if (c >= highStart) { c = limitp; } return c - 1...
java
{ "resource": "" }