_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q28000 | PrintStream.format | train | public PrintStream format(String format, Object ... args) {
try {
synchronized (this) {
ensureOpen();
if ((formatter == null)
|| (formatter.locale() != Locale.getDefault()))
formatter = new Formatter((Appendable) WeakProxy.forOb... | java | {
"resource": ""
} |
q28001 | PrintStream.append | train | public PrintStream append(CharSequence csq) {
if (csq == null)
print("null");
else
print(csq.toString());
return this;
} | java | {
"resource": ""
} |
q28002 | CharsetRecog_mbcs.match | train | int match(CharsetDetector det, int [] commonChars) {
@SuppressWarnings("unused")
int singleByteCharCount = 0; //TODO Do we really need this?
int doubleByteCharCount = 0;
int commonCharCount = 0;
int badCharCount = 0;
int totalCharCount = 0;
... | java | {
"resource": ""
} |
q28003 | MessagePatternUtil.buildMessageNode | train | public static MessageNode buildMessageNode(MessagePattern pattern) {
int limit = pattern.countParts() - 1;
if (limit < 0) {
throw new IllegalArgumentException("The MessagePattern is empty");
} else if (pattern.getPartType(0) != MessagePattern.Part.Type.MSG_START) {
throw ... | java | {
"resource": ""
} |
q28004 | XPathContext.reset | train | public void reset()
{
releaseDTMXRTreeFrags();
// These couldn't be disposed of earlier (see comments in release()); zap them now.
if(m_rtfdtm_stack!=null)
for (java.util.Enumeration e = m_rtfdtm_stack.elements() ; e.hasMoreElements() ;)
m_dtmManager.release((DTM)e.nextElement(), true);
m_r... | java | {
"resource": ""
} |
q28005 | XPathContext.getErrorListener | train | public final ErrorListener getErrorListener()
{
if (null != m_errorListener)
return m_errorListener;
ErrorListener retval = null;
try {
if (null != m_ownerGetErrorListener)
retval = (ErrorListener) m_ownerGetErrorListener.invoke(m_owner, new Object[] {});
}
catch (Exceptio... | java | {
"resource": ""
} |
q28006 | XPathContext.setErrorListener | train | public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
{
if (listener == null)
throw new IllegalArgumentException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler");
m_errorListener = listener;
} | java | {
"resource": ""
} |
q28007 | XPathContext.pushExpressionState | train | public final void pushExpressionState(int cn, int en, PrefixResolver nc)
{
m_currentNodes.push(cn);
m_currentExpressionNodes.push(cn);
m_prefixResolvers.push(nc);
} | java | {
"resource": ""
} |
q28008 | XPathContext.popRTFContext | train | public void popRTFContext()
{
int previous=m_last_pushed_rtfdtm.pop();
if(null==m_rtfdtm_stack)
return;
if(m_which_rtfdtm==previous)
{
if(previous>=0) // guard against none-active
{
boolean isEmpty=((SAX2RTFDTM)(m_rtfdtm_stack.elementAt(previous))).popRewindMark();
}
}
else w... | java | {
"resource": ""
} |
q28009 | XPathContext.getDTMXRTreeFrag | train | public DTMXRTreeFrag getDTMXRTreeFrag(int dtmIdentity){
if(m_DTMXRTreeFrags == null){
m_DTMXRTreeFrags = new HashMap();
}
if(m_DTMXRTreeFrags.containsKey(new Integer(dtmIdentity))){
return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(new Integer(dtmIdentity));
}else{
final DTMXRTreeF... | java | {
"resource": ""
} |
q28010 | XPathContext.releaseDTMXRTreeFrags | train | private final void releaseDTMXRTreeFrags(){
if(m_DTMXRTreeFrags == null){
return;
}
final Iterator iter = (m_DTMXRTreeFrags.values()).iterator();
while(iter.hasNext()){
DTMXRTreeFrag frag = (DTMXRTreeFrag)iter.next();
frag.destruct();
iter.remove();
}
m_DTMXRTreeFrags = n... | java | {
"resource": ""
} |
q28011 | ElemValueOf.setSelect | train | public void setSelect(XPath v)
{
if (null != v)
{
String s = v.getPatternString();
m_isDot = (null != s) && s.equals(".");
}
m_selectExpression = v;
} | java | {
"resource": ""
} |
q28012 | DTMDefaultBase.ensureSizeOfIndex | train | protected void ensureSizeOfIndex(int namespaceID, int LocalNameID)
{
if (null == m_elemIndexes)
{
m_elemIndexes = new int[namespaceID + 20][][];
}
else if (m_elemIndexes.length <= namespaceID)
{
int[][][] indexes = m_elemIndexes;
m_elemIndexes = new int[namespaceID + 20][][];
... | java | {
"resource": ""
} |
q28013 | DTMDefaultBase.indexNode | train | protected void indexNode(int expandedTypeID, int identity)
{
ExpandedNameTable ent = m_expandedNameTable;
short type = ent.getType(expandedTypeID);
if (DTM.ELEMENT_NODE == type)
{
int namespaceID = ent.getNamespaceID(expandedTypeID);
int localNameID = ent.getLocalNameID(expandedTypeID);
... | java | {
"resource": ""
} |
q28014 | DTMDefaultBase.findGTE | train | protected int findGTE(int[] list, int start, int len, int value)
{
int low = start;
int high = start + (len - 1);
int end = high;
while (low <= high)
{
int mid = (low + high) / 2;
int c = list[mid];
if (c > value)
high = mid - 1;
else if (c < value)
low =... | java | {
"resource": ""
} |
q28015 | DTMDefaultBase.findElementFromIndex | train | int findElementFromIndex(int nsIndex, int lnIndex, int firstPotential)
{
int[][][] indexes = m_elemIndexes;
if (null != indexes && nsIndex < indexes.length)
{
int[][] lnIndexs = indexes[nsIndex];
if (null != lnIndexs && lnIndex < lnIndexs.length)
{
int[] elems = lnIndexs[lnInd... | java | {
"resource": ""
} |
q28016 | DTMDefaultBase._type | train | protected short _type(int identity)
{
int info = _exptype(identity);
if (NULL != info)
return m_expandedNameTable.getType(info);
else
return NULL;
} | java | {
"resource": ""
} |
q28017 | DTMDefaultBase._exptype | train | protected int _exptype(int identity)
{
if (identity == DTM.NULL)
return NULL;
// Reorganized test and loop into single flow
// Tiny performance improvement, saves a few bytes of code, clearer.
// %OPT% Other internal getters could be treated simliarly
while (identity>=m_size)
{
if (!ne... | java | {
"resource": ""
} |
q28018 | DTMDefaultBase._level | train | protected int _level(int identity)
{
while (identity>=m_size)
{
boolean isMore = nextNode();
if (!isMore && identity >= m_size)
return NULL;
}
int i=0;
while(NULL != (identity=_parent(identity)))
++i;
return i;
} | java | {
"resource": ""
} |
q28019 | DTMDefaultBase._firstch | train | protected int _firstch(int identity)
{
// Boiler-plate code for each of the _xxx functions, except for the array.
int info = (identity >= m_size) ? NOTPROCESSED : m_firstch.elementAt(identity);
// Check to see if the information requested has been processed, and,
// if not, advance the iterator unti... | java | {
"resource": ""
} |
q28020 | DTMDefaultBase._nextsib | train | protected int _nextsib(int identity)
{
// Boiler-plate code for each of the _xxx functions, except for the array.
int info = (identity >= m_size) ? NOTPROCESSED : m_nextsib.elementAt(identity);
// Check to see if the information requested has been processed, and,
// if not, advance the iterator until... | java | {
"resource": ""
} |
q28021 | DTMDefaultBase._prevsib | train | protected int _prevsib(int identity)
{
if (identity < m_size)
return m_prevsib.elementAt(identity);
// Check to see if the information requested has been processed, and,
// if not, advance the iterator until we the information has been
// processed.
while (true)
{
boolean isMore ... | java | {
"resource": ""
} |
q28022 | DTMDefaultBase._parent | train | protected int _parent(int identity)
{
if (identity < m_size)
return m_parent.elementAt(identity);
// Check to see if the information requested has been processed, and,
// if not, advance the iterator until we the information has been
// processed.
while (true)
{
boolean isMore = ... | java | {
"resource": ""
} |
q28023 | DTMDefaultBase.dumpNode | train | public String dumpNode(int nodeHandle)
{
if(nodeHandle==DTM.NULL)
return "[null]";
String typestring;
switch (getNodeType(nodeHandle))
{
case DTM.ATTRIBUTE_NODE :
typestring = "ATTR";
break;
case DTM.CDATA_SECTION_NODE :
typestring =... | java | {
"resource": ""
} |
q28024 | DTMDefaultBase.getFirstAttributeIdentity | train | protected int getFirstAttributeIdentity(int identity) {
int type = _type(identity);
if (DTM.ELEMENT_NODE == type)
{
// Assume that attributes and namespaces immediately follow the element.
while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
{
// Assume this can not be ... | java | {
"resource": ""
} |
q28025 | DTMDefaultBase.getTypedAttribute | train | protected int getTypedAttribute(int nodeHandle, int attType) {
int type = getNodeType(nodeHandle);
if (DTM.ELEMENT_NODE == type) {
int identity = makeNodeIdentity(nodeHandle);
while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
{
type = _type(identity);
if (type ==... | java | {
"resource": ""
} |
q28026 | DTMDefaultBase.getNextAttribute | train | public int getNextAttribute(int nodeHandle) {
int nodeID = makeNodeIdentity(nodeHandle);
if (_type(nodeID) == DTM.ATTRIBUTE_NODE) {
return makeNodeHandle(getNextAttributeIdentity(nodeID));
}
return DTM.NULL;
} | java | {
"resource": ""
} |
q28027 | DTMDefaultBase.getNextAttributeIdentity | train | protected int getNextAttributeIdentity(int identity) {
// Assume that attributes and namespace nodes immediately follow the element
while (DTM.NULL != (identity = getNextNodeIdentity(identity))) {
int type = _type(identity);
if (type == DTM.ATTRIBUTE_NODE) {
return identity;
} else if... | java | {
"resource": ""
} |
q28028 | DTMDefaultBase.declareNamespaceInContext | train | protected void declareNamespaceInContext(int elementNodeIndex,int namespaceNodeIndex)
{
SuballocatedIntVector nsList=null;
if(m_namespaceDeclSets==null)
{
// First
m_namespaceDeclSetElements=new SuballocatedIntVector(32);
m_namespaceDeclSetElements.addElement(elementNodeIndex);
... | java | {
"resource": ""
} |
q28029 | DTMDefaultBase.findNamespaceContext | train | protected SuballocatedIntVector findNamespaceContext(int elementNodeIndex)
{
if (null!=m_namespaceDeclSetElements)
{
// %OPT% Is binary-search really saving us a lot versus linear?
// (... It may be, in large docs with many NS decls.)
int wouldBeAt=findInSortedSuballocatedIntVector(m... | java | {
"resource": ""
} |
q28030 | DTMDefaultBase.getFirstNamespaceNode | train | public int getFirstNamespaceNode(int nodeHandle, boolean inScope)
{
if(inScope)
{
int identity = makeNodeIdentity(nodeHandle);
if (_type(identity) == DTM.ELEMENT_NODE)
{
SuballocatedIntVector nsContext=findNamespaceContext(identity);
if(n... | java | {
"resource": ""
} |
q28031 | DTMDefaultBase.getNextNamespaceNode | train | public int getNextNamespaceNode(int baseHandle, int nodeHandle,
boolean inScope)
{
if(inScope)
{
//Since we've been given the base, try direct lookup
//(could look from nodeHandle but this is at least one
//comparison/get-parent f... | java | {
"resource": ""
} |
q28032 | DTMDefaultBase.getParent | train | public int getParent(int nodeHandle)
{
int identity = makeNodeIdentity(nodeHandle);
if (identity > 0)
return makeNodeHandle(_parent(identity));
else
return DTM.NULL;
} | java | {
"resource": ""
} |
q28033 | DTMDefaultBase.getOwnerDocument | train | public int getOwnerDocument(int nodeHandle)
{
if (DTM.DOCUMENT_NODE == getNodeType(nodeHandle))
return DTM.NULL;
return getDocumentRoot(nodeHandle);
} | java | {
"resource": ""
} |
q28034 | DTMDefaultBase.getNamespaceType | train | public int getNamespaceType(final int nodeHandle)
{
int identity = makeNodeIdentity(nodeHandle);
int expandedNameID = _exptype(identity);
return m_expandedNameTable.getNamespaceID(expandedNameID);
} | java | {
"resource": ""
} |
q28035 | DTMDefaultBase.appendChild | train | public void appendChild(int newChild, boolean clone, boolean cloneDepth)
{
error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"appendChild not yet supported!");
} | java | {
"resource": ""
} |
q28036 | DTMDefaultBase.migrateTo | train | public void migrateTo(DTMManager mgr)
{
m_mgr = mgr;
if(mgr instanceof DTMManagerDefault)
m_mgrDefault=(DTMManagerDefault)mgr;
} | java | {
"resource": ""
} |
q28037 | CharArrayReader.skip | train | public long skip(long n) throws IOException {
synchronized (lock) {
ensureOpen();
long avail = count - pos;
if (n > avail) {
n = avail;
}
if (n < 0) {
return 0;
}
pos += n;
return n;
... | java | {
"resource": ""
} |
q28038 | TextImpl.firstTextNodeInCurrentRun | train | private TextImpl firstTextNodeInCurrentRun() {
TextImpl firstTextInCurrentRun = this;
for (Node p = getPreviousSibling(); p != null; p = p.getPreviousSibling()) {
short nodeType = p.getNodeType();
if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
... | java | {
"resource": ""
} |
q28039 | TextImpl.nextTextNode | train | private TextImpl nextTextNode() {
Node nextSibling = getNextSibling();
if (nextSibling == null) {
return null;
}
short nodeType = nextSibling.getNodeType();
return nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE
? (TextImpl) nextSibl... | java | {
"resource": ""
} |
q28040 | TextImpl.minimize | train | public final TextImpl minimize() {
if (getLength() == 0) {
parent.removeChild(this);
return null;
}
Node previous = getPreviousSibling();
if (previous == null || previous.getNodeType() != Node.TEXT_NODE) {
return this;
}
TextImpl prev... | java | {
"resource": ""
} |
q28041 | PatternSyntaxException.getMessage | train | public String getMessage() {
StringBuffer sb = new StringBuffer();
sb.append(desc);
if (index >= 0) {
sb.append(" near index ");
sb.append(index);
}
sb.append(nl);
sb.append(pattern);
if (index >= 0) {
sb.append(nl);
... | java | {
"resource": ""
} |
q28042 | ArrayUtils.appendElement | train | @SuppressWarnings("unchecked")
public static <T> T[] appendElement(Class<T> kind, T[] array, T element) {
final T[] result;
final int end;
if (array != null) {
end = array.length;
result = (T[])Array.newInstance(kind, end + 1);
System.arraycopy(array, 0, r... | java | {
"resource": ""
} |
q28043 | ArrayUtils.removeElement | train | @SuppressWarnings("unchecked")
public static <T> T[] removeElement(Class<T> kind, T[] array, T element) {
if (array != null) {
final int length = array.length;
for (int i = 0; i < length; i++) {
if (array[i] == element) {
if (length == 1) {
... | java | {
"resource": ""
} |
q28044 | DeflaterInputStream.close | train | public void close() throws IOException {
if (in != null) {
try {
// Clean up
if (usesDefaultDeflater) {
def.end();
}
in.close();
} finally {
in = null;
}
}
} | java | {
"resource": ""
} |
q28045 | DeflaterInputStream.read | train | public int read(byte[] b, int off, int len) throws IOException {
// Sanity checks
ensureOpen();
if (b == null) {
throw new NullPointerException("Null buffer for read");
} else if (off < 0 || len < 0 || len > b.length - off) {
throw new IndexOutOfBoundsException();... | java | {
"resource": ""
} |
q28046 | NetworkInterface.getByName | train | public static NetworkInterface getByName(String name) throws SocketException {
if (name == null)
throw new NullPointerException();
return getByName0(name);
} | java | {
"resource": ""
} |
q28047 | NetworkInterface.getNetworkInterfaces | train | public static Enumeration<NetworkInterface> getNetworkInterfaces()
throws SocketException {
final NetworkInterface[] netifs = getAll();
// specified to return null if no network interfaces
if (netifs == null)
return null;
return new Enumeration<NetworkInterface>() {... | java | {
"resource": ""
} |
q28048 | GregorianCalendar.getYearOffsetInMillis | train | private long getYearOffsetInMillis() {
long t = (internalGet(DAY_OF_YEAR) - 1) * 24;
t += internalGet(HOUR_OF_DAY);
t *= 60;
t += internalGet(MINUTE);
t *= 60;
t += internalGet(SECOND);
t *= 1000;
return t + internalGet(MILLISECOND) -
(internal... | java | {
"resource": ""
} |
q28049 | GregorianCalendar.getWeekNumber | train | private int getWeekNumber(long fixedDay1, long fixedDate) {
// We can always use `gcal' since Julian and Gregorian are the
// same thing for this calculation.
long fixedDay1st = Gregorian.getDayOfWeekDateOnOrBefore(fixedDay1 + 6,
ge... | java | {
"resource": ""
} |
q28050 | GregorianCalendar.getCalendarDate | train | private BaseCalendar.Date getCalendarDate(long fd) {
BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
cal.getCalendarDateFromFixedDate(d, fd);
return d;
} | java | {
"resource": ""
} |
q28051 | GregorianCalendar.getRolledValue | train | private static int getRolledValue(int value, int amount, int min, int max) {
assert value >= min && value <= max;
int range = max - min + 1;
amount %= range;
int n = value + amount;
if (n > max) {
n -= range;
} else if (n < min) {
n += range;
... | java | {
"resource": ""
} |
q28052 | GregorianCalendar.readObject | train | private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
if (gdate == null) {
gdate = (BaseCalendar.Date) gcal.newCalendarDate(getZone());
cachedFixedDate = Long.MIN_VALUE;
}
setGregoria... | java | {
"resource": ""
} |
q28053 | CompactCharArray.elementAt | train | @Deprecated
public char elementAt(char index)
{
int ix = (indices[index >> BLOCKSHIFT] & 0xFFFF)
+ (index & BLOCKMASK);
return ix >= values.length ? defaultValue : values[ix];
} | java | {
"resource": ""
} |
q28054 | CompactCharArray.setElementAt | train | @Deprecated
public void setElementAt(char index, char value)
{
if (isCompact)
expand();
values[index] = value;
touchBlock(index >> BLOCKSHIFT, value);
} | java | {
"resource": ""
} |
q28055 | CompactCharArray.setElementAt | train | @Deprecated
public void setElementAt(char start, char end, char value)
{
int i;
if (isCompact) {
expand();
}
for (i = start; i <= end; ++i) {
values[i] = value;
touchBlock(i >> BLOCKSHIFT, value);
}
} | java | {
"resource": ""
} |
q28056 | CompactCharArray.arrayRegionMatches | train | final static boolean arrayRegionMatches(char[] source, int sourceStart,
char[] target, int targetStart,
int len)
{
int sourceEnd = sourceStart + len;
int delta = targetStart - sourceStart;
for (int i = so... | java | {
"resource": ""
} |
q28057 | EmulatedFieldsForDumping.write | train | @Override
@Deprecated
public void write(ObjectOutput output) throws IOException {
if (!output.equals(oos)) {
throw new IllegalArgumentException("Attempting to write to a different stream than the one that created this PutField");
}
for (EmulatedFields.ObjectSlot slot : emulat... | java | {
"resource": ""
} |
q28058 | AbstractQueuedLongSynchronizer.setHeadAndPropagate | train | private void setHeadAndPropagate(Node node, long propagate) {
Node h = head; // Record old head for check below
setHead(node);
/*
* Try to signal next queued node if:
* Propagation was indicated by caller,
* or was recorded (as h.waitStatus either before
... | java | {
"resource": ""
} |
q28059 | AbstractQueuedLongSynchronizer.doAcquireInterruptibly | train | private void doAcquireInterruptibly(long arg)
throws InterruptedException {
final Node node = addWaiter(Node.EXCLUSIVE);
try {
for (;;) {
final Node p = node.predecessor();
if (p == head && tryAcquire(arg)) {
setHead(node);
... | java | {
"resource": ""
} |
q28060 | AbstractQueuedLongSynchronizer.doAcquireNanos | train | private boolean doAcquireNanos(long arg, long nanosTimeout)
throws InterruptedException {
if (nanosTimeout <= 0L)
return false;
final long deadline = System.nanoTime() + nanosTimeout;
final Node node = addWaiter(Node.EXCLUSIVE);
try {
for (;;) {
... | java | {
"resource": ""
} |
q28061 | AbstractQueuedLongSynchronizer.doAcquireShared | train | private void doAcquireShared(long arg) {
final Node node = addWaiter(Node.SHARED);
try {
boolean interrupted = false;
for (;;) {
final Node p = node.predecessor();
if (p == head) {
long r = tryAcquireShared(arg);
... | java | {
"resource": ""
} |
q28062 | AbstractQueuedLongSynchronizer.fullyRelease | train | final long fullyRelease(Node node) {
try {
long savedState = getState();
if (release(savedState))
return savedState;
throw new IllegalMonitorStateException();
} catch (Throwable t) {
node.waitStatus = Node.CANCELLED;
throw t;
... | java | {
"resource": ""
} |
q28063 | Inet4Address.writeReplace | train | private Object writeReplace() throws ObjectStreamException {
// will replace the to be serialized 'this' object
InetAddress inet = new InetAddress();
inet.holder().hostName = holder().getHostName();
inet.holder().address = holder().getAddress();
/**
* Prior to 1.4 an In... | java | {
"resource": ""
} |
q28064 | UnicodeDecompressor.decompress | train | public static String decompress(byte [] buffer){
char [] buf = decompress(buffer, 0, buffer.length);
return new String(buf);
} | java | {
"resource": ""
} |
q28065 | UnicodeDecompressor.reset | train | public void reset()
{
// reset dynamic windows
fOffsets[0] = 0x0080; // Latin-1
fOffsets[1] = 0x00C0; // Latin-1 Supplement + Latin Extended-A
fOffsets[2] = 0x0400; // Cyrillic
fOffsets[3] = 0x0600; // Arabic
fOffsets[4] = 0x0900; // Devanagari
... | java | {
"resource": ""
} |
q28066 | Vector.elementAt | train | public synchronized E elementAt(int index) {
if (index >= elementCount) {
throw new ArrayIndexOutOfBoundsException(index + " >= " + elementCount);
}
return elementData(index);
} | java | {
"resource": ""
} |
q28067 | Vector.removeAllElements | train | public synchronized void removeAllElements() {
modCount++;
// Let gc do its work
for (int i = 0; i < elementCount; i++)
elementData[i] = null;
elementCount = 0;
} | java | {
"resource": ""
} |
q28068 | Vector.toArray | train | @SuppressWarnings("unchecked")
public synchronized <T> T[] toArray(T[] a) {
if (a.length < elementCount)
return (T[]) Arrays.copyOf(elementData, elementCount, a.getClass());
System.arraycopy(elementData, 0, a, 0, elementCount);
if (a.length > elementCount)
a[element... | java | {
"resource": ""
} |
q28069 | Vector.add | train | public synchronized boolean add(E e) {
modCount++;
ensureCapacityHelper(elementCount + 1);
elementData[elementCount++] = e;
return true;
} | java | {
"resource": ""
} |
q28070 | BuildStep.getIssuerName | train | public String getIssuerName(String defaultName) {
return (cert == null ? defaultName
: cert.getIssuerX500Principal().toString());
} | java | {
"resource": ""
} |
q28071 | BuildStep.getSubjectName | train | public String getSubjectName(String defaultName) {
return (cert == null ? defaultName
: cert.getSubjectX500Principal().toString());
} | java | {
"resource": ""
} |
q28072 | BuildStep.resultToString | train | public String resultToString(int res) {
String resultString = "";
switch (res) {
case POSSIBLE:
resultString = "Certificate to be tried.\n";
break;
case BACK:
resultString = "Certificate backed out since path does not "
... | java | {
"resource": ""
} |
q28073 | BuildStep.verboseToString | train | public String verboseToString() {
String out = resultToString(getResult());
switch (result) {
case BACK:
case FAIL:
out = out + vertex.throwableToString();
break;
case FOLLOW:
case SUCCEED:
out = out + vertex.moreToString();
... | java | {
"resource": ""
} |
q28074 | MutableBigInteger.getMagnitudeArray | train | private int[] getMagnitudeArray() {
if (offset > 0 || value.length != intLen)
return Arrays.copyOfRange(value, offset, offset + intLen);
return value;
} | java | {
"resource": ""
} |
q28075 | MutableBigInteger.toLong | train | private long toLong() {
assert (intLen <= 2) : "this MutableBigInteger exceeds the range of long";
if (intLen == 0)
return 0;
long d = value[offset] & LONG_MASK;
return (intLen == 2) ? d << 32 | (value[offset + 1] & LONG_MASK) : d;
} | java | {
"resource": ""
} |
q28076 | MutableBigInteger.toBigInteger | train | BigInteger toBigInteger(int sign) {
if (intLen == 0 || sign == 0)
return BigInteger.ZERO;
return new BigInteger(getMagnitudeArray(), sign);
} | java | {
"resource": ""
} |
q28077 | MutableBigInteger.toBigDecimal | train | BigDecimal toBigDecimal(int sign, int scale) {
if (intLen == 0 || sign == 0)
return BigDecimal.zeroValueOf(scale);
int[] mag = getMagnitudeArray();
int len = mag.length;
int d = mag[0];
// If this MutableBigInteger can't be fit into long, we need to
// make a ... | java | {
"resource": ""
} |
q28078 | MutableBigInteger.toCompactValue | train | long toCompactValue(int sign) {
if (intLen == 0 || sign == 0)
return 0L;
int[] mag = getMagnitudeArray();
int len = mag.length;
int d = mag[0];
// If this MutableBigInteger can not be fitted into long, we need to
// make a BigInteger object for the resultant B... | java | {
"resource": ""
} |
q28079 | MutableBigInteger.clear | train | void clear() {
offset = intLen = 0;
for (int index=0, n=value.length; index < n; index++)
value[index] = 0;
} | java | {
"resource": ""
} |
q28080 | MutableBigInteger.getLowestSetBit | train | private final int getLowestSetBit() {
if (intLen == 0)
return -1;
int j, b;
for (j=intLen-1; (j > 0) && (value[j+offset] == 0); j--)
;
b = value[j+offset];
if (b == 0)
return -1;
return ((intLen-1-j)<<5) + Integer.numberOfTrailingZeros(... | java | {
"resource": ""
} |
q28081 | MutableBigInteger.normalize | train | final void normalize() {
if (intLen == 0) {
offset = 0;
return;
}
int index = offset;
if (value[index] != 0)
return;
int indexBound = index+intLen;
do {
index++;
} while(index < indexBound && value[index] == 0);
... | java | {
"resource": ""
} |
q28082 | MutableBigInteger.ensureCapacity | train | private final void ensureCapacity(int len) {
if (value.length < len) {
value = new int[len];
offset = 0;
intLen = len;
}
} | java | {
"resource": ""
} |
q28083 | MutableBigInteger.toIntArray | train | int[] toIntArray() {
int[] result = new int[intLen];
for(int i=0; i < intLen; i++)
result[i] = value[offset+i];
return result;
} | java | {
"resource": ""
} |
q28084 | MutableBigInteger.copyValue | train | void copyValue(MutableBigInteger src) {
int len = src.intLen;
if (value.length < len)
value = new int[len];
System.arraycopy(src.value, src.offset, value, 0, len);
intLen = len;
offset = 0;
} | java | {
"resource": ""
} |
q28085 | MutableBigInteger.copyValue | train | void copyValue(int[] val) {
int len = val.length;
if (value.length < len)
value = new int[len];
System.arraycopy(val, 0, value, 0, len);
intLen = len;
offset = 0;
} | java | {
"resource": ""
} |
q28086 | MutableBigInteger.isNormal | train | boolean isNormal() {
if (intLen + offset > value.length)
return false;
if (intLen == 0)
return true;
return (value[offset] != 0);
} | java | {
"resource": ""
} |
q28087 | MutableBigInteger.rightShift | train | void rightShift(int n) {
if (intLen == 0)
return;
int nInts = n >>> 5;
int nBits = n & 0x1F;
this.intLen -= nInts;
if (nBits == 0)
return;
int bitsInHighWord = BigInteger.bitLengthForInt(value[offset]);
if (nBits >= bitsInHighWord) {
... | java | {
"resource": ""
} |
q28088 | MutableBigInteger.leftShift | train | void leftShift(int n) {
/*
* If there is enough storage space in this MutableBigInteger already
* the available space will be used. Space to the right of the used
* ints in the value array is faster to utilize, so the extra space
* will be taken from the right if possible.
... | java | {
"resource": ""
} |
q28089 | MutableBigInteger.divadd | train | private int divadd(int[] a, int[] result, int offset) {
long carry = 0;
for (int j=a.length-1; j >= 0; j--) {
long sum = (a[j] & LONG_MASK) +
(result[j+offset] & LONG_MASK) + carry;
result[j+offset] = (int)sum;
carry = sum >>> 32;
}
... | java | {
"resource": ""
} |
q28090 | MutableBigInteger.primitiveRightShift | train | private final void primitiveRightShift(int n) {
int[] val = value;
int n2 = 32 - n;
for (int i=offset+intLen-1, c=val[i]; i > offset; i--) {
int b = c;
c = val[i-1];
val[i] = (c << n2) | (b >>> n);
}
val[offset] >>>= n;
} | java | {
"resource": ""
} |
q28091 | MutableBigInteger.primitiveLeftShift | train | private final void primitiveLeftShift(int n) {
int[] val = value;
int n2 = 32 - n;
for (int i=offset, c=val[i], m=i+intLen-1; i < m; i++) {
int b = c;
c = val[i+1];
val[i] = (b << n) | (c >>> n2);
}
val[offset+intLen-1] <<= n;
} | java | {
"resource": ""
} |
q28092 | MutableBigInteger.add | train | void add(MutableBigInteger addend) {
int x = intLen;
int y = addend.intLen;
int resultLen = (intLen > addend.intLen ? intLen : addend.intLen);
int[] result = (value.length < resultLen ? new int[resultLen] : value);
int rstart = result.length-1;
long sum;
long car... | java | {
"resource": ""
} |
q28093 | MutableBigInteger.subtract | train | int subtract(MutableBigInteger b) {
MutableBigInteger a = this;
int[] result = value;
int sign = a.compare(b);
if (sign == 0) {
reset();
return 0;
}
if (sign < 0) {
MutableBigInteger tmp = a;
a = b;
b = tmp;
... | java | {
"resource": ""
} |
q28094 | MutableBigInteger.difference | train | private int difference(MutableBigInteger b) {
MutableBigInteger a = this;
int sign = a.compare(b);
if (sign == 0)
return 0;
if (sign < 0) {
MutableBigInteger tmp = a;
a = b;
b = tmp;
}
long diff = 0;
int x = a.intLe... | java | {
"resource": ""
} |
q28095 | MutableBigInteger.multiply | train | void multiply(MutableBigInteger y, MutableBigInteger z) {
int xLen = intLen;
int yLen = y.intLen;
int newLen = xLen + yLen;
// Put z into an appropriate state to receive product
if (z.value.length < newLen)
z.value = new int[newLen];
z.offset = 0;
z.i... | java | {
"resource": ""
} |
q28096 | MutableBigInteger.mul | train | void mul(int y, MutableBigInteger z) {
if (y == 1) {
z.copyValue(this);
return;
}
if (y == 0) {
z.clear();
return;
}
// Perform the multiplication word by word
long ylong = y & LONG_MASK;
int[] zval = (z.value.leng... | java | {
"resource": ""
} |
q28097 | MutableBigInteger.divideOneWord | train | int divideOneWord(int divisor, MutableBigInteger quotient) {
long divisorLong = divisor & LONG_MASK;
// Special case of one word dividend
if (intLen == 1) {
long dividendValue = value[offset] & LONG_MASK;
int q = (int) (dividendValue / divisorLong);
int r = (... | java | {
"resource": ""
} |
q28098 | MutableBigInteger.divide | train | long divide(long v, MutableBigInteger quotient) {
if (v == 0)
throw new ArithmeticException("BigInteger divide by zero");
// Dividend is zero
if (intLen == 0) {
quotient.intLen = quotient.offset = 0;
return 0;
}
if (v < 0)
v = -v;
... | java | {
"resource": ""
} |
q28099 | MutableBigInteger.divaddLong | train | private int divaddLong(int dh, int dl, int[] result, int offset) {
long carry = 0;
long sum = (dl & LONG_MASK) + (result[1+offset] & LONG_MASK);
result[1+offset] = (int)sum;
sum = (dh & LONG_MASK) + (result[offset] & LONG_MASK) + carry;
result[offset] = (int)sum;
carry ... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.