_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q27400 | SpoofChecker.getNumerics | train | private void getNumerics(String input, UnicodeSet result) {
result.clear();
for (int utf16Offset = 0; utf16Offset < input.length();) {
int codePoint = Character.codePointAt(input, utf16Offset);
utf16Offset += Character.charCount(codePoint);
// Store a representative... | java | {
"resource": ""
} |
q27401 | SpoofChecker.getRestrictionLevel | train | private RestrictionLevel getRestrictionLevel(String input) {
// Section 5.2 step 1:
if (!fAllowedCharsSet.containsAll(input)) {
return RestrictionLevel.UNRESTRICTIVE;
}
// Section 5.2 step 2:
if (ASCII.containsAll(input)) {
return RestrictionLevel.ASCII;
... | java | {
"resource": ""
} |
q27402 | IndexedCollectionCertStore.buildIndex | train | private void buildIndex(Collection<?> coll) {
certSubjects = new HashMap<X500Principal, Object>();
crlIssuers = new HashMap<X500Principal, Object>();
otherCertificates = null;
otherCRLs = null;
for (Object obj : coll) {
if (obj instanceof X509Certificate) {
... | java | {
"resource": ""
} |
q27403 | IndexedCollectionCertStore.indexCertificate | train | private void indexCertificate(X509Certificate cert) {
X500Principal subject = cert.getSubjectX500Principal();
Object oldEntry = certSubjects.put(subject, cert);
if (oldEntry != null) { // assume this is unlikely
if (oldEntry instanceof X509Certificate) {
if (cert.equa... | java | {
"resource": ""
} |
q27404 | IndexedCollectionCertStore.indexCRL | train | private void indexCRL(X509CRL crl) {
X500Principal issuer = crl.getIssuerX500Principal();
Object oldEntry = crlIssuers.put(issuer, crl);
if (oldEntry != null) { // assume this is unlikely
if (oldEntry instanceof X509CRL) {
if (crl.equals(oldEntry)) {
... | java | {
"resource": ""
} |
q27405 | IndexedCollectionCertStore.matchX509Certs | train | private void matchX509Certs(CertSelector selector,
Collection<Certificate> matches) {
for (Object obj : certSubjects.values()) {
if (obj instanceof X509Certificate) {
X509Certificate cert = (X509Certificate)obj;
if (selector.match(cert)) {
... | java | {
"resource": ""
} |
q27406 | IndexedCollectionCertStore.matchX509CRLs | train | private void matchX509CRLs(CRLSelector selector, Collection<CRL> matches) {
for (Object obj : crlIssuers.values()) {
if (obj instanceof X509CRL) {
X509CRL crl = (X509CRL)obj;
if (selector.match(crl)) {
matches.add(crl);
}
... | java | {
"resource": ""
} |
q27407 | UnImplNode.renameNode | train | public Node renameNode(Node n,
String namespaceURI,
String name)
throws DOMException{
return n;
} | java | {
"resource": ""
} |
q27408 | ElemAttribute.resolvePrefix | train | protected String resolvePrefix(SerializationHandler rhandler,
String prefix, String nodeNamespace)
throws TransformerException
{
if (null != prefix && (prefix.length() == 0 || prefix.equals("xmlns")))
{
// Since we can't use default namespace, in this case we try an... | java | {
"resource": ""
} |
q27409 | ElemAttribute.validateNodeName | train | protected boolean validateNodeName(String nodeName)
{
if(null == nodeName)
return false;
if(nodeName.equals("xmlns"))
return false;
return XML11Char.isXML11ValidQName(nodeName);
} | java | {
"resource": ""
} |
q27410 | DoublePipeline.limit | train | @Override
public final DoubleStream limit(long maxSize) {
if (maxSize < 0)
throw new IllegalArgumentException(Long.toString(maxSize));
return SliceOps.makeDouble(this, (long) 0, maxSize);
} | java | {
"resource": ""
} |
q27411 | BoolStack.grow | train | private void grow()
{
m_allocatedSize *= 2;
boolean newVector[] = new boolean[m_allocatedSize];
System.arraycopy(m_values, 0, newVector, 0, m_index + 1);
m_values = newVector;
} | java | {
"resource": ""
} |
q27412 | GaiException.getMessage | train | @Override public String getMessage() {
String gaiName = OsConstants.gaiName(error);
if (gaiName == null) {
gaiName = "GAI_ error " + error;
}
String description = NetworkOs.gai_strerror(error);
return functionName + " failed: " + gaiName + " (" + description + ")";
} | java | {
"resource": ""
} |
q27413 | ZoneId.ofWithPrefix | train | private static ZoneId ofWithPrefix(String zoneId, int prefixLength, boolean checkAvailable) {
String prefix = zoneId.substring(0, prefixLength);
if (zoneId.length() == prefixLength) {
return ofOffset(prefix, ZoneOffset.UTC);
}
if (zoneId.charAt(prefixLength) != '+' && zoneId.... | java | {
"resource": ""
} |
q27414 | ElemUnknown.executeFallbacks | train | private void executeFallbacks(
TransformerImpl transformer)
throws TransformerException
{
for (ElemTemplateElement child = m_firstChild; child != null;
child = child.m_nextSibling)
{
if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK)
{
try
{
... | java | {
"resource": ""
} |
q27415 | ElemUnknown.execute | train | public void execute(TransformerImpl transformer)
throws TransformerException
{
try {
if (hasFallbackChildren()) {
executeFallbacks(transformer);
} else {
// do nothing
}
} catch (TransformerException e) {
transformer.getErrorListener().fatalError(e);
}
} | java | {
"resource": ""
} |
q27416 | OutputStreamWriter.close | train | @Override
public void close() throws IOException {
synchronized (lock) {
if (encoder != null) {
drainEncoder();
flushBytes(false);
out.close();
encoder = null;
bytes = null;
}
}
} | java | {
"resource": ""
} |
q27417 | X500Name.rdns | train | public List<RDN> rdns() {
List<RDN> list = rdnList;
if (list == null) {
list = Collections.unmodifiableList(Arrays.asList(names));
rdnList = list;
}
return list;
} | java | {
"resource": ""
} |
q27418 | X500Name.allAvas | train | public List<AVA> allAvas() {
List<AVA> list = allAvaList;
if (list == null) {
list = new ArrayList<AVA>();
for (int i = 0; i < names.length; i++) {
list.addAll(names[i].avas());
}
}
return list;
} | java | {
"resource": ""
} |
q27419 | X500Name.isEmpty | train | public boolean isEmpty() {
int n = names.length;
if (n == 0) {
return true;
}
for (int i = 0; i < n; i++) {
if (names[i].assertion.length != 0) {
return false;
}
}
return true;
} | java | {
"resource": ""
} |
q27420 | X500Name.encode | train | public void encode(DerOutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
for (int i = 0; i < names.length; i++) {
names[i].encode(tmp);
}
out.write(DerValue.tag_Sequence, tmp);
} | java | {
"resource": ""
} |
q27421 | X500Name.getEncodedInternal | train | public byte[] getEncodedInternal() throws IOException {
if (encoded == null) {
DerOutputStream out = new DerOutputStream();
DerOutputStream tmp = new DerOutputStream();
for (int i = 0; i < names.length; i++) {
names[i].encode(tmp);
}
... | java | {
"resource": ""
} |
q27422 | X500Name.checkNoNewLinesNorTabsAtBeginningOfDN | train | private void checkNoNewLinesNorTabsAtBeginningOfDN(String input) {
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if (c != ' ') {
if (c == '\t' || c == '\n') {
throw new IllegalArgumentException("DN cannot start with newline nor t... | java | {
"resource": ""
} |
q27423 | X500Name.isWithinSubtree | train | private boolean isWithinSubtree(X500Name other) {
if (this == other) {
return true;
}
if (other == null) {
return false;
}
if (other.names.length == 0) {
return true;
}
if (this.names.length == 0) {
return false;
... | java | {
"resource": ""
} |
q27424 | X500Name.commonAncestor | train | public X500Name commonAncestor(X500Name other) {
if (other == null) {
return null;
}
int otherLen = other.names.length;
int thisLen = this.names.length;
if (thisLen == 0 || otherLen == 0) {
return null;
}
int minLen = (thisLen < otherLen) ... | java | {
"resource": ""
} |
q27425 | X500Name.asX500Principal | train | public X500Principal asX500Principal() {
if (x500Principal == null) {
try {
Object[] args = new Object[] {this};
x500Principal =
(X500Principal)principalConstructor.newInstance(args);
} catch (Exception e) {
throw ne... | java | {
"resource": ""
} |
q27426 | X500Name.asX500Name | train | public static X500Name asX500Name(X500Principal p) {
try {
X500Name name = (X500Name)principalField.get(p);
name.x500Principal = p;
return name;
} catch (Exception e) {
throw new RuntimeException("Unexpected exception", e);
}
} | java | {
"resource": ""
} |
q27427 | AtomicIntegerFieldUpdater.updateAndGet | train | public final int updateAndGet(T obj, IntUnaryOperator updateFunction) {
int prev, next;
do {
prev = get(obj);
next = updateFunction.applyAsInt(prev);
} while (!compareAndSet(obj, prev, next));
return next;
} | java | {
"resource": ""
} |
q27428 | ManifestEntryVerifier.verify | train | public CodeSigner[] verify(Hashtable<String, CodeSigner[]> verifiedSigners,
Hashtable<String, CodeSigner[]> sigFileSigners)
throws JarException
{
if (skip) {
return null;
}
if (signers != null)
return signers;
for (int i=0; i < digest... | java | {
"resource": ""
} |
q27429 | AttributesImplSerializer.getIndex | train | public final int getIndex(String qname)
{
int index;
if (super.getLength() < MAX)
{
// if we haven't got too many attributes let the
// super class look it up
index = super.getIndex(qname);
return index;
}
// we have too many a... | java | {
"resource": ""
} |
q27430 | AttributesImplSerializer.switchOverToHash | train | private void switchOverToHash(int numAtts)
{
for (int index = 0; index < numAtts; index++)
{
String qName = super.getQName(index);
Integer i = new Integer(index);
m_indexFromQName.put(qName, i);
// Add quick look-up to find with uri/local ... | java | {
"resource": ""
} |
q27431 | AttributesImplSerializer.getIndex | train | public final int getIndex(String uri, String localName)
{
int index;
if (super.getLength() < MAX)
{
// if we haven't got too many attributes let the
// super class look it up
index = super.getIndex(uri,localName);
return index;
}
... | java | {
"resource": ""
} |
q27432 | CRLReasonCodeExtension.getReasonCode | train | public CRLReason getReasonCode() {
// if out-of-range, return UNSPECIFIED
if (reasonCode > 0 && reasonCode < values.length) {
return values[reasonCode];
} else {
return CRLReason.UNSPECIFIED;
}
} | java | {
"resource": ""
} |
q27433 | BaseLocale.createInstance | train | public static BaseLocale createInstance(String language, String region) {
BaseLocale base = new BaseLocale(language, region);
CACHE.put(new Key(language, region), base);
return base;
} | java | {
"resource": ""
} |
q27434 | DateIntervalInfo.initializeFromReadOnlyPatterns | train | private void initializeFromReadOnlyPatterns(DateIntervalInfo dii) {
fFallbackIntervalPattern = dii.fFallbackIntervalPattern;
fFirstDateInPtnIsLaterDate = dii.fFirstDateInPtnIsLaterDate;
fIntervalPatterns = dii.fIntervalPatterns;
fIntervalPatternsReadOnly = true;
} | java | {
"resource": ""
} |
q27435 | DateIntervalInfo.genPatternInfo | train | @Deprecated
public static PatternInfo genPatternInfo(String intervalPattern,
boolean laterDateFirst) {
int splitPoint = splitPatternInto2Part(intervalPattern);
String firstPart = intervalPattern.substring(0, splitPoint);
String secondPart = null;
... | java | {
"resource": ""
} |
q27436 | DateIntervalInfo.getIntervalPattern | train | public PatternInfo getIntervalPattern(String skeleton, int field)
{
if ( field > MINIMUM_SUPPORTED_CALENDAR_FIELD ) {
throw new IllegalArgumentException("no support for field less than SECOND");
}
Map<String, PatternInfo> patternsOfOneSkeleton = fIntervalPatterns.get(skeleton);
... | java | {
"resource": ""
} |
q27437 | DateIntervalInfo.setFallbackIntervalPattern | train | public void setFallbackIntervalPattern(String fallbackPattern)
{
if ( frozen ) {
throw new UnsupportedOperationException("no modification is allowed after DII is frozen");
}
int firstPatternIndex = fallbackPattern.indexOf("{0}");
int secondPatternIndex = fallbackPattern.i... | java | {
"resource": ""
} |
q27438 | DateIntervalInfo.parseSkeleton | train | static void parseSkeleton(String skeleton, int[] skeletonFieldWidth) {
int PATTERN_CHAR_BASE = 0x41;
for ( int i = 0; i < skeleton.length(); ++i ) {
++skeletonFieldWidth[skeleton.charAt(i) - PATTERN_CHAR_BASE];
}
} | java | {
"resource": ""
} |
q27439 | DateIntervalInfo.getRawPatterns | train | @Deprecated
public Map<String, Map<String, PatternInfo>> getRawPatterns() {
LinkedHashMap<String, Map<String, PatternInfo>> result = new LinkedHashMap<String, Map<String, PatternInfo>>();
for (Entry<String, Map<String, PatternInfo>> entry : fIntervalPatterns.entrySet()) {
result.put(entr... | java | {
"resource": ""
} |
q27440 | SAXParseException.init | train | private void init (String publicId, String systemId,
int lineNumber, int columnNumber)
{
this.publicId = publicId;
this.systemId = systemId;
this.lineNumber = lineNumber;
this.columnNumber = columnNumber;
} | java | {
"resource": ""
} |
q27441 | PolicyNodeImpl.addExpectedPolicy | train | void addExpectedPolicy(String expectedPolicy) {
if (isImmutable) {
throw new IllegalStateException("PolicyNode is immutable");
}
if (mOriginalExpectedPolicySet) {
mExpectedPolicySet.clear();
mOriginalExpectedPolicySet = false;
}
mExpectedPolicy... | java | {
"resource": ""
} |
q27442 | PolicyNodeImpl.prune | train | void prune(int depth) {
if (isImmutable)
throw new IllegalStateException("PolicyNode is immutable");
// if we have no children, we can't prune below us...
if (mChildren.size() == 0)
return;
Iterator<PolicyNodeImpl> it = mChildren.iterator();
while (it.ha... | java | {
"resource": ""
} |
q27443 | PolicyNodeImpl.getPolicyNodes | train | Set<PolicyNodeImpl> getPolicyNodes(int depth) {
Set<PolicyNodeImpl> set = new HashSet<>();
getPolicyNodes(depth, set);
return set;
} | java | {
"resource": ""
} |
q27444 | PolicyNodeImpl.getPolicyNodes | train | private void getPolicyNodes(int depth, Set<PolicyNodeImpl> set) {
// if we've reached the desired depth, then return ourself
if (mDepth == depth) {
set.add(this);
} else {
for (PolicyNodeImpl node : mChildren) {
node.getPolicyNodes(depth, set);
... | java | {
"resource": ""
} |
q27445 | PolicyNodeImpl.getPolicyNodesValid | train | Set<PolicyNodeImpl> getPolicyNodesValid(int depth, String validOID) {
HashSet<PolicyNodeImpl> set = new HashSet<>();
if (mDepth < depth) {
for (PolicyNodeImpl node : mChildren) {
set.addAll(node.getPolicyNodesValid(depth, validOID));
}
} else {
... | java | {
"resource": ""
} |
q27446 | PolicyNodeImpl.asString | train | String asString() {
if (mParent == null) {
return "anyPolicy ROOT\n";
} else {
StringBuilder sb = new StringBuilder();
for (int i = 0, n = getDepth(); i < n; i++) {
sb.append(" ");
}
sb.append(policyToString(getValidPolicy()))... | java | {
"resource": ""
} |
q27447 | ElementImpl.getElementById | train | Element getElementById(String name) {
for (Attr attr : attributes) {
if (attr.isId() && name.equals(attr.getValue())) {
return this;
}
}
/*
* TODO: Remove this behavior.
* The spec explicitly says that this is a bad idea. From
*... | java | {
"resource": ""
} |
q27448 | ResourceBundle.strip | train | private static Locale strip(Locale locale) {
String language = locale.getLanguage();
String country = locale.getCountry();
String variant = locale.getVariant();
if (!variant.isEmpty()) {
variant = "";
} else if (!country.isEmpty()) {
country = "";
... | java | {
"resource": ""
} |
q27449 | Bidi.getBaseDirection | train | public static byte getBaseDirection(CharSequence paragraph) {
if (paragraph == null || paragraph.length() == 0) {
return NEUTRAL;
}
int length = paragraph.length();
int c;// codepoint
byte direction;
for (int i = 0; i < length; ) {
// U16_NEXT(pa... | java | {
"resource": ""
} |
q27450 | Bidi.firstL_R_AL | train | private byte firstL_R_AL() {
byte result = ON;
for (int i = 0; i < prologue.length(); ) {
int uchar = prologue.codePointAt(i);
i += Character.charCount(uchar);
byte dirProp = (byte)getCustomizedClass(uchar);
if (result == ON) {
if (dirProp ... | java | {
"resource": ""
} |
q27451 | Bidi.lastL_R_AL | train | private byte lastL_R_AL() {
for (int i = prologue.length(); i > 0; ) {
int uchar = prologue.codePointBefore(i);
i -= Character.charCount(uchar);
byte dirProp = (byte)getCustomizedClass(uchar);
if (dirProp == L) {
return _L;
}
... | java | {
"resource": ""
} |
q27452 | Bidi.firstL_R_AL_EN_AN | train | private byte firstL_R_AL_EN_AN() {
for (int i = 0; i < epilogue.length(); ) {
int uchar = epilogue.codePointAt(i);
i += Character.charCount(uchar);
byte dirProp = (byte)getCustomizedClass(uchar);
if (dirProp == L) {
return _L;
}
... | java | {
"resource": ""
} |
q27453 | Bidi.getParagraphByIndex | train | public BidiRun getParagraphByIndex(int paraIndex)
{
verifyValidParaOrLine();
verifyRange(paraIndex, 0, paraCount);
Bidi bidi = paraBidi; /* get Para object if Line object */
int paraStart;
if (paraIndex == 0) {
paraStart = 0;
} else {
... | java | {
"resource": ""
} |
q27454 | Bidi.getLogicalToVisualRunsMap | train | void getLogicalToVisualRunsMap()
{
if (isGoodLogicalToVisualRunsMap) {
return;
}
int count = countRuns();
if ((logicalToVisualRunsMap == null) ||
(logicalToVisualRunsMap.length < count)) {
logicalToVisualRunsMap = new int[count];
}
... | java | {
"resource": ""
} |
q27455 | Bidi.getRunLevel | train | public int getRunLevel(int run)
{
verifyValidParaOrLine();
BidiLine.getRuns(this);
verifyRange(run, 0, runCount);
getLogicalToVisualRunsMap();
return runs[logicalToVisualRunsMap[run]].level;
} | java | {
"resource": ""
} |
q27456 | Bidi.getRunStart | train | public int getRunStart(int run)
{
verifyValidParaOrLine();
BidiLine.getRuns(this);
verifyRange(run, 0, runCount);
getLogicalToVisualRunsMap();
return runs[logicalToVisualRunsMap[run]].start;
} | java | {
"resource": ""
} |
q27457 | Bidi.getRunLimit | train | public int getRunLimit(int run)
{
verifyValidParaOrLine();
BidiLine.getRuns(this);
verifyRange(run, 0, runCount);
getLogicalToVisualRunsMap();
int idx = logicalToVisualRunsMap[run];
int len = idx == 0 ? runs[idx].limit :
runs[idx].limit... | java | {
"resource": ""
} |
q27458 | Bidi.requiresBidi | train | public static boolean requiresBidi(char[] text,
int start,
int limit)
{
final int RTLMask = (1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT |
1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC |
1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING |
... | java | {
"resource": ""
} |
q27459 | Bidi.writeReverse | train | public static String writeReverse(String src, int options)
{
/* error checking */
if (src == null) {
throw new IllegalArgumentException();
}
if (src.length() > 0) {
return BidiWriter.writeReverse(src, options);
} else {
/* nothing to do */... | java | {
"resource": ""
} |
q27460 | CollationFastLatinBuilder.compareInt64AsUnsigned | train | private static final int compareInt64AsUnsigned(long a, long b) {
a += 0x8000000000000000L;
b += 0x8000000000000000L;
if(a < b) {
return -1;
} else if(a > b) {
return 1;
} else {
return 0;
}
} | java | {
"resource": ""
} |
q27461 | IdentityHashMap.containsKey | train | public boolean containsKey(Object key) {
Object k = maskNull(key);
Object[] tab = table;
int len = tab.length;
int i = hash(k, len);
while (true) {
Object item = tab[i];
if (item == k)
return true;
if (item == null)
... | java | {
"resource": ""
} |
q27462 | IdentityHashMap.containsValue | train | public boolean containsValue(Object value) {
Object[] tab = table;
for (int i = 1; i < tab.length; i += 2)
if (tab[i] == value && tab[i - 1] != null)
return true;
return false;
} | java | {
"resource": ""
} |
q27463 | IdentityHashMap.resize | train | private boolean resize(int newCapacity) {
// assert (newCapacity & -newCapacity) == newCapacity; // power of 2
int newLength = newCapacity * 2;
Object[] oldTable = table;
int oldLength = oldTable.length;
if (oldLength == 2 * MAXIMUM_CAPACITY) { // can't expand any further
... | java | {
"resource": ""
} |
q27464 | IdentityHashMap.removeMapping | train | private boolean removeMapping(Object key, Object value) {
Object k = maskNull(key);
Object[] tab = table;
int len = tab.length;
int i = hash(k, len);
while (true) {
Object item = tab[i];
if (item == k) {
if (tab[i + 1] != value)
... | java | {
"resource": ""
} |
q27465 | IdentityHashMap.closeDeletion | train | private void closeDeletion(int d) {
// Adapted from Knuth Section 6.4 Algorithm R
Object[] tab = table;
int len = tab.length;
// Look for items to swap into newly vacated slot
// starting at index immediately following deletion,
// and continuing until a null slot is see... | java | {
"resource": ""
} |
q27466 | IdentityHashMap.putForCreate | train | private void putForCreate(K key, V value)
throws java.io.StreamCorruptedException
{
Object k = maskNull(key);
Object[] tab = table;
int len = tab.length;
int i = hash(k, len);
Object item;
while ( (item = tab[i]) != null) {
if (item == k)
... | java | {
"resource": ""
} |
q27467 | TransformerFactoryImpl.setAttribute | train | public void setAttribute(String name, Object value)
throws IllegalArgumentException
{
if (name.equals(FEATURE_INCREMENTAL))
{
if(value instanceof Boolean)
{
// Accept a Boolean object..
m_incremental = ((Boolean)value).booleanValue();
}
else if(value instanceo... | java | {
"resource": ""
} |
q27468 | TransformerFactoryImpl.getAttribute | train | public Object getAttribute(String name) throws IllegalArgumentException
{
if (name.equals(FEATURE_INCREMENTAL))
{
return new Boolean(m_incremental);
}
else if (name.equals(FEATURE_OPTIMIZE))
{
return new Boolean(m_optimize);
}
else if (name.equals(FEATURE_SOURCE_LOC... | java | {
"resource": ""
} |
q27469 | TransformerFactoryImpl.newTransformerHandler | train | public TransformerHandler newTransformerHandler(Source src)
throws TransformerConfigurationException
{
Templates templates = newTemplates(src);
if( templates==null ) return null;
return newTransformerHandler(templates);
} | java | {
"resource": ""
} |
q27470 | TransformerFactoryImpl.newTransformerHandler | train | public TransformerHandler newTransformerHandler(Templates templates)
throws TransformerConfigurationException
{
try {
TransformerImpl transformer =
(TransformerImpl) templates.newTransformer();
transformer.setURIResolver(m_uriResolver);
TransformerHandler th =
(Transfor... | java | {
"resource": ""
} |
q27471 | TransformerFactoryImpl.newTransformer | train | public Transformer newTransformer(Source source)
throws TransformerConfigurationException
{
try
{
Templates tmpl=newTemplates( source );
/* this can happen if an ErrorListener is present and it doesn't
throw any exception in fatalError.
The spec says: "a Transformer m... | java | {
"resource": ""
} |
q27472 | TransformerFactoryImpl.newTemplates | train | public Templates newTemplates(Source source)
throws TransformerConfigurationException
{
String baseID = source.getSystemId();
if (null != baseID) {
baseID = SystemIDResolver.getAbsoluteURI(baseID);
}
if (source instanceof DOMSource)
{
DOMSource dsource = (DOMSource) sour... | java | {
"resource": ""
} |
q27473 | TransformerFactoryImpl.setErrorListener | train | public void setErrorListener(ErrorListener listener)
throws IllegalArgumentException
{
if (null == listener)
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null));
// "ErrorListener");
m_errorListener = listener;
} | java | {
"resource": ""
} |
q27474 | ValidIdentifiers.isValid | train | public static Datasubtype isValid(Datatype datatype, Set<Datasubtype> datasubtypes, String code) {
Map<Datasubtype, ValiditySet> subtable = ValidityData.data.get(datatype);
if (subtable != null) {
for (Datasubtype datasubtype : datasubtypes) {
ValiditySet validitySet = subtab... | java | {
"resource": ""
} |
q27475 | ParserAdapter.setup | train | private void setup (Parser parser)
{
if (parser == null) {
throw new
NullPointerException("Parser argument must not be null");
}
this.parser = parser;
atts = new AttributesImpl();
nsSupport = new NamespaceSupport();
attAdapter = new AttributeListAdapter();
} | java | {
"resource": ""
} |
q27476 | ParserAdapter.setFeature | train | public void setFeature (String name, boolean value)
throws SAXNotRecognizedException, SAXNotSupportedException
{
if (name.equals(NAMESPACES)) {
checkNotParsing("feature", name);
namespaces = value;
if (!namespaces && !prefixes) {
prefixes = true;
}
} else if (name... | java | {
"resource": ""
} |
q27477 | ParserAdapter.getFeature | train | public boolean getFeature (String name)
throws SAXNotRecognizedException, SAXNotSupportedException
{
if (name.equals(NAMESPACES)) {
return namespaces;
} else if (name.equals(NAMESPACE_PREFIXES)) {
return prefixes;
} else if (name.equals(XMLNS_URIs)) {
return uris;
} else ... | java | {
"resource": ""
} |
q27478 | ParserAdapter.endElement | train | public void endElement (String qName)
throws SAXException
{
// If we're not doing Namespace
// processing, dispatch this quickly.
if (!namespaces) {
if (contentHandler != null) {
contentHandler.endElement("", "", qName.intern());
}
return;
... | java | {
"resource": ""
} |
q27479 | ParserAdapter.ignorableWhitespace | train | public void ignorableWhitespace (char ch[], int start, int length)
throws SAXException
{
if (contentHandler != null) {
contentHandler.ignorableWhitespace(ch, start, length);
}
} | java | {
"resource": ""
} |
q27480 | ParserAdapter.processingInstruction | train | public void processingInstruction (String target, String data)
throws SAXException
{
if (contentHandler != null) {
contentHandler.processingInstruction(target, data);
}
} | java | {
"resource": ""
} |
q27481 | ParserAdapter.setupParser | train | private void setupParser ()
{
// catch an illegal "nonsense" state.
if (!prefixes && !namespaces)
throw new IllegalStateException ();
nsSupport.reset();
if (uris)
nsSupport.setNamespaceDeclUris (true);
if (entityResolver != null) {
parser.setEntityResolver(entityResolve... | java | {
"resource": ""
} |
q27482 | ParserAdapter.reportError | train | void reportError (String message)
throws SAXException
{
if (errorHandler != null)
errorHandler.error(makeException(message));
} | java | {
"resource": ""
} |
q27483 | ParserAdapter.makeException | train | private SAXParseException makeException (String message)
{
if (locator != null) {
return new SAXParseException(message, locator);
} else {
return new SAXParseException(message, null, null, -1, -1);
}
} | java | {
"resource": ""
} |
q27484 | ParserAdapter.checkNotParsing | train | private void checkNotParsing (String type, String name)
throws SAXNotSupportedException
{
if (parsing) {
throw new SAXNotSupportedException("Cannot change " +
type + ' ' +
name + " while parsing");
}
} | java | {
"resource": ""
} |
q27485 | URI.isConformantSchemeName | train | public static boolean isConformantSchemeName(String p_scheme)
{
if (p_scheme == null || p_scheme.trim().length() == 0)
{
return false;
}
if (!isAlpha(p_scheme.charAt(0)))
{
return false;
}
char testChar;
for (int i = 1; i < p_scheme.length(); i++)
{
testChar =... | java | {
"resource": ""
} |
q27486 | DigitList.setBigDecimalDigits | train | private void setBigDecimalDigits(String stringDigits,
int maximumDigits, boolean fixedPoint) {
//| // Find the first non-zero digit, the decimal, and the last non-zero digit.
//| int first=-1, last=stringDigits.length()-1, decimal=-1;
//| for (int i=0; (first<0 ... | java | {
"resource": ""
} |
q27487 | FunctionPattern.execute | train | public XObject execute(XPathContext xctxt, int context)
throws javax.xml.transform.TransformerException
{
DTMIterator nl = m_functionExpr.asIterator(xctxt, context);
XNumber score = SCORE_NONE;
if (null != nl)
{
int n;
while (DTM.NULL != (n = nl.nextNode()))
{
sc... | java | {
"resource": ""
} |
q27488 | ClassFileConverter.setClassPath | train | private void setClassPath() throws IOException {
String fullPath = file.getAbsolutePath();
String rootPath = fullPath.substring(0, fullPath.lastIndexOf(classFile.getRelativePath()));
List<File> classPath = new ArrayList<>();
classPath.add(new File(rootPath));
parserEnv.fileManager().setLocation(Stan... | java | {
"resource": ""
} |
q27489 | ClassFileConverter.convertClassInitializer | train | private void convertClassInitializer(AbstractTypeDeclaration typeDecl) {
EntityDeclaration decl = classFile.getMethod("<clinit>", "()V");
if (decl == null) {
return; // Class doesn't have a static initializer.
}
MethodTranslator translator = new MethodTranslator(
parserEnv, translationEnv... | java | {
"resource": ""
} |
q27490 | JarHandler.toExternalForm | train | @Override
protected String toExternalForm(URL url) {
StringBuilder sb = new StringBuilder();
sb.append("jar:");
sb.append(url.getFile());
String ref = url.getRef();
if (ref != null) {
sb.append(ref);
}
return sb.toString();
} | java | {
"resource": ""
} |
q27491 | GeneralSubtrees.encode | train | public void encode(DerOutputStream out) throws IOException {
DerOutputStream seq = new DerOutputStream();
for (int i = 0, n = size(); i < n; i++) {
get(i).encode(seq);
}
out.write(DerValue.tag_Sequence, seq);
} | java | {
"resource": ""
} |
q27492 | GeneralSubtrees.minimize | train | private void minimize() {
// Algorithm: compare each entry n to all subsequent entries in
// the list: if any subsequent entry matches or widens entry n,
// remove entry n. If any subsequent entries narrow entry n, remove
// the subsequent entries.
for (int i = 0; i < size(); i+... | java | {
"resource": ""
} |
q27493 | GeneralSubtrees.createWidestSubtree | train | private GeneralSubtree createWidestSubtree(GeneralNameInterface name) {
try {
GeneralName newName;
switch (name.getType()) {
case GeneralNameInterface.NAME_ANY:
// Create new OtherName with same OID as baseName, but
// empty value
... | java | {
"resource": ""
} |
q27494 | GeneralSubtrees.union | train | public void union(GeneralSubtrees other) {
if (other != null) {
for (int i = 0, n = other.size(); i < n; i++) {
add(other.get(i));
}
// Minimize this
minimize();
}
} | java | {
"resource": ""
} |
q27495 | GeneralSubtrees.reduce | train | public void reduce(GeneralSubtrees excluded) {
if (excluded == null) {
return;
}
for (int i = 0, n = excluded.size(); i < n; i++) {
GeneralNameInterface excludedName = excluded.getGeneralNameInterface(i);
for (int j = 0; j < size(); j++) {
Gene... | java | {
"resource": ""
} |
q27496 | FunctionTable.getFunctionName | train | String getFunctionName(int funcID) {
if (funcID < NUM_BUILT_IN_FUNCS) return m_functions[funcID].getName();
else return m_functions_customer[funcID - NUM_BUILT_IN_FUNCS].getName();
} | java | {
"resource": ""
} |
q27497 | FunctionTable.getFunction | train | Function getFunction(int which)
throws javax.xml.transform.TransformerException
{
try{
if (which < NUM_BUILT_IN_FUNCS)
return (Function) m_functions[which].newInstance();
else
return (Function) m_functions_customer[
... | java | {
"resource": ""
} |
q27498 | FunctionTable.getFunctionID | train | Object getFunctionID(String key){
Object id = m_functionID_customer.get(key);
if (null == id) id = m_functionID.get(key);
return id;
} | java | {
"resource": ""
} |
q27499 | FunctionTable.installFunction | train | public int installFunction(String name, Class func)
{
int funcIndex;
Object funcIndexObj = getFunctionID(name);
if (null != funcIndexObj)
{
funcIndex = ((Integer) funcIndexObj).intValue();
if (funcIndex < NUM_BUILT_IN_FUNCS){
funcIndex = m_funcNextFreeIndex++;
... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.