rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException | public static void setLookAndFeel(LookAndFeel newLookAndFeel) throws UnsupportedLookAndFeelException | public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception setLookAndFeel(a); } |
Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); setLookAndFeel(a); | if (newLookAndFeel != null && ! newLookAndFeel.isSupportedLookAndFeel()) throw new UnsupportedLookAndFeelException(newLookAndFeel.getName()); LookAndFeel oldLookAndFeel = currentLookAndFeel; if (oldLookAndFeel != null) oldLookAndFeel.uninitialize(); currentLookAndFeel = newLookAndFeel; if (newLookAndFeel != null) { ... | public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception setLookAndFeel(a); } |
session.addSessionListener(this); | public SessionGUI (Session5250 session) { super(session); this.configurationResource = session.getConfigurationResource(); this.sessionName = session.getSessionName(); sesProps = session.sesProps; sce = new SessionChangeEvent(this); session.getConfiguration().addSessionConfigListener(th... | |
variant = variant.toUpperCase().intern(); | variant = variant.intern(); | public Locale(String language, String country, String variant) { // During bootstrap, we already know the strings being passed in are // the correct capitalization, and not null. We can't call // String.toUpperCase during this time, since that depends on the // default locale. if (defa... |
m.minor = Minor.Forwarding; | public OutputStream _invoke(String method, InputStream input, ResponseHandler handler ) throws SystemException { org.omg.CORBA.portable.InputStream in = null; org.omg.CORBA.portable.OutputStream out = null; try { try ... | |
public org.omg.CORBA.portable.OutputStream _request(String method, boolean response_expected ) | public Request _request(String method) | public org.omg.CORBA.portable.OutputStream _request(String method, boolean response_expected ) { return delegate.request(this, method, response_expected); } |
return delegate.request(this, method, response_expected); | return delegate.request(this, method); | public org.omg.CORBA.portable.OutputStream _request(String method, boolean response_expected ) { return delegate.request(this, method, response_expected); } |
throws IOException | public void write(int n) { throw new NO_IMPLEMENT(); } | |
return fcw2 | 0x20; | return (fcw2 & 0x0f) | 0x20; | public int getHighlightedAttr(){ return fcw2 | 0x20; } |
writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); | writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""); writeOutAttribute(outputstream, axisIdRef); writeOut(outputstream, "\"/>"); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, ... |
if (defined newNodeNameString) nodeName = newNodeNameString; | if (newNodeNameString != null) nodeName = newNodeNameString; | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameStri... |
a.addAttribute(AbstractDocument.ElementNameAttribute, IconElementName); | public static void setIcon(MutableAttributeSet a, Icon c) { a.addAttribute(IconAttribute, c); } | |
if (SecurityManager.current == null) { try { Class.forName("java.security.Security"); } catch (ClassNotFoundException e) { } } | public static synchronized void setSecurityManager(SecurityManager sm) { // Implementation note: the field lives in SecurityManager because of // bootstrap initialization issues. This method is synchronized so that // no other thread changes it to null before this thread makes the change. if (SecurityMan... | |
SecurityManager sm = securityManager; if (sm != null) sm.checkLink(filename); | public void load(String filename) { if (loadLib(filename) == 0) throw new UnsatisfiedLinkError("Could not load library " + filename); } | |
if (instance == null) instance = new MetalProgressBarUI(); | if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalProgressBarUI instance; if (o == null) { instance = new MetalProgressBarUI(); instances.put(component, instance); } else instance = (MetalProgressBarUI) o; | public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalProgressBarUI(); return instance; } |
throws IllegalAccessException { | throws IllegalAccessException, JNodeClassNotFoundException { | private void copyStaticField(VmType type, VmField f, Field jf, VmStatics statics, NativeStream os, ObjectEmitter emitter) throws IllegalAccessException { jf.setAccessible(true); final Object val = jf.get(null); final int fType = JvmType.SignatureToType(f.getSignature()); final... |
final Class javaType = Class.forName(type.getName()); final FieldInfo fieldInfo = emitter.getFieldInfo(javaType); final Field[] jdkFields = fieldInfo.getJdkStaticFields(); final int max = jdkFields.length; for (int k = 0; k < max; k++) { final Field jdkField = jdkFields[k]; if (jdkField != null) { final VmField f = fi... | final Class javaType = Class.forName(type.getName()); try { final FieldInfo fieldInfo = emitter.getFieldInfo(javaType); final Field[] jdkFields = fieldInfo.getJdkStaticFields(); final int max = jdkFields.length; for (int k = 0; k < max; k++) { final Field jdkField = jdkFields[k]; if (jdkField != null) { final VmField ... | protected void copyStaticFields(VmSystemClassLoader cl, VmStatics statics, NativeStream os, ObjectEmitter emitter) throws ClassNotFoundException { for (Iterator i = cl.getLoadedClasses().iterator(); i.hasNext();) { final VmType type = (VmType) i.next(); final String name = ty... |
addCompileHighOptLevel("gnu.classpath"); | protected void setupCompileHighOptLevelPackages() { addCompileHighOptLevel("java.io"); addCompileHighOptLevel("java.lang"); addCompileHighOptLevel("java.lang.ref"); addCompileHighOptLevel("java.lang.reflect"); addCompileHighOptLevel("java.net"); addCompileHighOptLevel("java... | |
Object obj = cp.getAny(i); if (obj instanceof VmConstObject) { | final Object obj = cp.getAny(i); if (obj instanceof VmResolvableConstObject) { | public final void resolveCpRefs(VmClassLoader clc) { if (!resolvedCpRefs) { prepare(); if (superClass != null) { superClass.resolveCpRefs(clc); } /** * Step 2b: Load the classes of my fields */ final int fcnt = getNoDeclaredFields(); for (int i = 0; i < fcnt; i++) { final VmField fs = fieldTab... |
public void setAccessible(boolean flag) { | public static void setAccessible(AccessibleObject[] array, boolean flag) { | public void setAccessible(boolean flag) { checkPermission(); secureSetAccessible(flag); } |
secureSetAccessible(flag); } | for (int i = 0; i < array.length; i++) array[i].secureSetAccessible(flag); } | public void setAccessible(boolean flag) { checkPermission(); secureSetAccessible(flag); } |
this.builder = builder; | public BuildObjectResolver(NativeStream os, AbstractBootImageBuilder builder) { this.os = os; this.builder = builder; } | |
public DefaultHeapManager(VmClassLoader loader, HeapHelper helper, VmStatics statics) throws ClassNotFoundException { super(helper); this.writeBarrier = null; this.firstHeap = new VmDefaultHeap(this); this.currentHeap = firstHeap; this.defaultHeapClass = (VmNormalClass)loader.loadClass(VmDefaultHeap.class.getName(), t... | public DefaultHeapManager(VmClassLoader loader, HeapHelper helper, VmStatics statics) throws ClassNotFoundException { super(helper); this.writeBarrier = null; this.firstNormalHeap = new VmDefaultHeap(this); this.currentHeap = firstNormalHeap; this.heapList = firstNormalHeap; this.defaultHeapClass = (VmNormalClass) loa... | public DefaultHeapManager(VmClassLoader loader, HeapHelper helper, VmStatics statics) throws ClassNotFoundException { super(helper); //this.writeBarrier = new DefaultWriteBarrier(helper); this.writeBarrier = null; this.firstHeap = new VmDefaultHeap(this); this.currentHeap = firstHeap; this.defaultHeapClass = (V... |
public Vm(VmArchitecture arch, VmHeapManager heapManager, VmStatics statics, boolean debugMode) { | public Vm(String version, VmArchitecture arch, VmHeapManager heapManager, VmStatics statics, boolean debugMode) { | public Vm(VmArchitecture arch, VmHeapManager heapManager, VmStatics statics, boolean debugMode) { instance = this; this.debugMode = debugMode; this.bootstrap = true; this.arch = arch; this.heapManager = heapManager; this.statics = statics; } |
this.version = version; | public Vm(VmArchitecture arch, VmHeapManager heapManager, VmStatics statics, boolean debugMode) { instance = this; this.debugMode = debugMode; this.bootstrap = true; this.arch = arch; this.heapManager = heapManager; this.statics = statics; } | |
public void get(byte[] dst, int dstOffset, int index, int length) { try { | public int get(int index) { | public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // A... |
next.get(dst, dstOffset, index - size, length); | return next.get(index - size); | public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // A... |
} else if (index + length <= size) { System.arraycopy(data, start + index, dst, dstOffset, length); | public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // A... | |
if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { l... | return data[start + index] & 0xFF; | public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // A... |
double small = getFlatness() * (1E-10); | double small = getFlatness() * EPSILON; | private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 =... |
a0 += small; | a0 -= small; | private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 =... |
a3 += small; | a3 -= small; | private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 =... |
if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) | if (Line2D.linesIntersect(b0, a0, b3, a3, EPSILON, 0.0, distance, 0.0)) | private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 =... |
if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) | if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, EPSILON, 0.0, distance)) | private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 =... |
throw new IllegalArgumentException(); | throw new IllegalArgumentException("position: " + position + ", beginIndex: " + getBeginIndex() + ", endIndex: " + getEndIndex()); | public char setIndex(int position) { if (position < getBeginIndex() || position > getEndIndex()) throw new IllegalArgumentException(); current = position; if (position == getEndIndex()) return DONE; return array[current]; } |
if (sumDelta == 0) return; | private static void adjustGreater(int allocated, SizeRequirements[] children, int[] spans, int span) { // Sum up (maxSize - prefSize) over all children int sumDelta = 0; for (int i = 0; i < children.length; i++) sumDelta += children[i].maximum - children[i].preferred;... | |
if (sumDelta == 0) return; | private static void adjustSmaller(int allocated, SizeRequirements[] children, int[] spans, int span) { // Sum up (prefSize - minSize) over all children int sumDelta = 0; for (int i = 0; i < children.length; i++) sumDelta += children[i].preferred - children[i].minimum;... | |
throw new Error("getenv no longer supported, use properties instead: " + name); | if (name == null) throw new NullPointerException(); SecurityManager sm = Runtime.securityManager; if (sm != null) sm.checkPermission(new RuntimePermission("getenv." + name)); return VMSystem.getenv(name); | public static String getenv(String name) { throw new Error("getenv no longer supported, use properties instead: " + name); } |
PublicKey pubK = new GnuRSAPublicKey(n, e); PrivateKey secK = new GnuRSAPrivateKey(p, q, e, d); | PublicKey pubK = new GnuRSAPublicKey(preferredFormat, n, e); PrivateKey secK = new GnuRSAPrivateKey(preferredFormat, p, q, e, d); | public KeyPair generate() { BigInteger p, q, n, d; // 1. Generate a prime p in the interval [2**(M-1), 2**M - 1], where // M = CEILING(L/2), and such that GCD(p, e) = 1 int M = (L + 1) / 2; BigInteger lower = TWO.pow(M - 1); BigInteger upper = TWO.pow(M).subtract(ONE); byte[] kb = new byte[(M + ... |
Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); | public void setup(Map attributes) { // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // are we given a set of RSA params or we shall use our own? RSAKeyGenParameterSpec params = (RSAKeyGenParameterSpec) attributes.get(RSA_PARAMETERS); /... | |
public BigInteger gcd(BigInteger y) | private static int gcd(int a, int b) | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return va... |
int xval = ival; int yval = y.ival; if (words == null) | int tmp; if (b > a) | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return va... |
if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); | tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; if (b == 1) return b; tmp = b; b = a % b; a = tmp; | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return va... |
xval = 1; | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return va... | |
if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words ... | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return va... | |
public JRootPane createRootPane() | protected JRootPane createRootPane() | public JRootPane createRootPane() { return new JRootPane(); } |
public void setRootPane(JRootPane root) | protected void setRootPane(JRootPane root) | public void setRootPane(JRootPane root) { if (rootPane != null) remove(rootPane); rootPane = root; add(rootPane, BorderLayout.CENTER); } |
Frame(String title) { super(); this.title = title; visible = false; | public Frame() { this(""); | Frame(String title){ super(); this.title = title; // Top-level frames are initially invisible. visible = false; noteFrame(this);} |
Class dclass = Class.forName(dcname); | Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); | public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rm... |
attributes = ctx.addAttributes(attributes, s); | addAttributes(s); | public AbstractElement(Element p, AttributeSet s) { element_parent = p; AttributeContext ctx = getAttributeContext(); attributes = ctx.getEmptySet(); if (s != null) attributes = ctx.addAttributes(attributes, s); } |
} if (getAttributeCount() > 0) { for (int i = 0; i < indent; ++i) b.append(' '); | public void dump(PrintStream stream, int indent) { StringBuffer b = new StringBuffer(); for (int i = 0; i < indent; ++i) b.append(' '); b.append('<'); b.append(getName()); // Dump attributes if there are any. if (getAttributeCount() > 0) { b.append('\n'); ... | |
return (String) getAttribute(NameAttribute); | return (String) attributes.getAttribute(ElementNameAttribute); | public String getName() { return (String) getAttribute(NameAttribute); } |
startOffset = -1; endOffset = -1; | children = new Element[1]; numChildren = 0; lastIndex = -1; | public BranchElement(Element parent, AttributeSet attributes) { super(parent, attributes); startOffset = -1; endOffset = -1; } |
if (children.length == 0) | if (numChildren == 0) | public Enumeration children() { if (children.length == 0) return null; Vector tmp = new Vector(); for (int index = 0; index < children.length; ++index) tmp.add(children[index]); return tmp.elements(); } |
for (int index = 0; index < children.length; ++index) | for (int index = 0; index < numChildren; ++index) | public Enumeration children() { if (children.length == 0) return null; Vector tmp = new Vector(); for (int index = 0; index < children.length; ++index) tmp.add(children[index]); return tmp.elements(); } |
if (index < 0 || index >= children.length) | if (index < 0 || index >= numChildren) | public Element getElement(int index) { if (index < 0 || index >= children.length) return null; return children[index]; } |
return children.length; | return numChildren; | public int getElementCount() { return children.length; } |
if (offset < getStartOffset()) return 0; for (int index = 0; index < children.length - 1; ++index) | int i0 = 0; int i1 = numChildren - 1; int index = -1; int p0 = getStartOffset(); int p1; if (numChildren == 0) index = 0; else if (offset >= getEndOffset()) index = numChildren - 1; else | public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; inde... |
Element elem = children[index]; | if (lastIndex >= i0 && lastIndex <= i1) { Element last = getElement(lastIndex); p0 = last.getStartOffset(); p1 = last.getEndOffset(); if (offset >= p0 && offset < p1) index = lastIndex; else { if (offset < p0) i1 = lastIndex; else i0 = lastIndex; } } int i = 0; while (i0 <= i1 && index == -1) { i = i0 + (i1 - i0) / ... | public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; inde... |
if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; if (children[index + 1].getStartOffset() > offset) | if (index == -1) | public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; inde... |
if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; | if (offset < p0) index = i; | public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; inde... |
return index; } | index = i + 1; | public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; inde... |
return getElementCount() - 1; | lastIndex = index; } return index; | public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; inde... |
if (children.length == 0) { if (endOffset == -1) throw new NullPointerException("BranchElement has no children."); } else endOffset = children[children.length - 1].getEndOffset(); return endOffset; | Element child = numChildren > 0 ? children[numChildren - 1] : children[0]; return child.getEndOffset(); | public int getEndOffset() { if (children.length == 0) { if (endOffset == -1) throw new NullPointerException("BranchElement has no children."); } else endOffset = children[children.length - 1].getEndOffset(); return endOffset; } |
if (children.length == 0) { if (startOffset == -1) throw new NullPointerException("BranchElement has no children."); } else startOffset = children[0].getStartOffset(); return startOffset; | return children[0].getStartOffset(); | public int getStartOffset() { if (children.length == 0) { if (startOffset == -1) throw new NullPointerException("BranchElement has no children."); } else startOffset = children[0].getStartOffset(); return startOffset; } |
for (int index = 0; index < children.length; ++index) | for (int index = 0; index < numChildren; ++index) | public Element positionToElement(int position) { // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= position) && (position < ... |
Element[] target = new Element[children.length - length + elements.length]; | int delta = elements.length - length; int copyFrom = offset + length; int copyTo = copyFrom + delta; int numMove = numChildren - copyFrom; if (numChildren + delta > children.length) { int newSize = Math.max(2 * children.length, numChildren + delta); Element[] target = new Element[newSize]; | public void replace(int offset, int length, Element[] elements) { Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, of... |
System.arraycopy(children, offset + length, target, offset + elements.length, children.length - offset - length); | System.arraycopy(children, copyFrom, target, copyTo, numMove); | public void replace(int offset, int length, Element[] elements) { Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, of... |
else { System.arraycopy(children, copyFrom, children, copyTo, numMove); System.arraycopy(elements, 0, children, offset, elements.length); } numChildren += delta; } | public void replace(int offset, int length, Element[] elements) { Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, of... | |
int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; | public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; ... | |
startPos = createPosition(start - startDelta); endPos = createPosition(end - endDelta); | startPos = createPosition(start); endPos = createPosition(end); | public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; ... |
return endPos.getOffset() + endDelta; | return endPos.getOffset(); | public int getEndOffset() { return endPos.getOffset() + endDelta; } |
return startPos.getOffset() + startDelta; | return startPos.getOffset(); | public int getStartOffset() { return startPos.getOffset() + startDelta; } |
((AbstractElement) getBidiRootElement()).dump(out, 0); | public void dump(PrintStream out) { ((AbstractElement) getDefaultRootElement()).dump(out, 0); } | |
return 0; | Object val = getProperty(AsyncLoadPriority); int prio = -1; if (val != null) prio = ((Integer) val).intValue(); return prio; | public int getAsynchronousLoadPriority() { return 0; } |
return null; | return bidiRoot; | public Element getBidiRootElement() { return null; } |
return new Position() | Position p; try | public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; } |
public int getOffset() | p = createPosition(content.length()); } catch (BadLocationException ex) | public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; } |
return getLength(); | p = null; | public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; } |
}; | return p; | public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; } |
Element[] elements = new Element[1]; | Element[] elements = new Element[2]; | public Element[] getRootElements() { Element[] elements = new Element[1]; elements[0] = getDefaultRootElement(); return elements; } |
elements[1] = getBidiRootElement(); | public Element[] getRootElements() { Element[] elements = new Element[1]; elements[0] = getDefaultRootElement(); return elements; } | |
return new Position() | Position p; try | public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; } |
public int getOffset() | p = createPosition(0); } catch (BadLocationException ex) | public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; } |
return 0; | p = null; | public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; } |
}; | return p; | public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; } |
finally { writeUnlock(); } } | public void insertString(int offset, String text, AttributeSet attributes) throws BadLocationException { // Bail out if we have a bogus insertion (Behavior observed in RI). if (text == null || text.length() == 0) return; if (documentFilter == null) insertStringImpl(offset, text, attributes)... | |
try { writeLock(); | void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEv... | |
finally { writeUnlock(); } } | void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEv... | |
if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); | protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr) { // Do nothing here. Subclasses may want to override this. } | |
if (Boolean.TRUE.equals(getProperty(I18N))) updateBidi(chng); | protected void postRemoveUpdate(DefaultDocumentEvent chng) { // Do nothing here. Subclasses may want to override this. } | |
if (TextAttribute.RUN_DIRECTION.equals(key)) { if (TextAttribute.RUN_DIRECTION_RTL.equals(value) && Boolean.FALSE.equals(getProperty(I18N))) putProperty(I18N, Boolean.TRUE); if (Boolean.TRUE.equals(getProperty(I18N))) { writeLock(); try { DefaultDocumentEvent ev = new DefaultDocumentEvent(0, getLength(), DocumentEvent... | public final void putProperty(Object key, Object value) { // FIXME: make me thread-safe if (properties == null) properties = new Hashtable(); properties.put(key, value); } | |
if (length <= 0) return; | if (length > 0) { if (offset < 0 || offset > getLength()) throw new BadLocationException("Invalid remove position", offset); if (offset + length > getLength()) throw new BadLocationException("Invalid remove length", offset); | void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try {... |
} | void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try {... | |
} finally { writeUnlock(); } | public void replace(int offset, int length, String text, AttributeSet attributes) throws BadLocationException { // Bail out if we have a bogus replacement (Behavior observed in RI). if (length == 0 && (text == null || text.length() == 0)) return; if (documentFilter == null) {... | |
Integer val = p >= 0 ? new Integer(p) : null; putProperty(AsyncLoadPriority, val); | public void setAsynchronousLoadPriority(int p) { // TODO: Implement this properly. } | |
public PrincipalHolder(Principal initial_value) | public PrincipalHolder() | public PrincipalHolder(Principal initial_value) { value = initial_value; } |
value = initial_value; | public PrincipalHolder(Principal initial_value) { value = initial_value; } | |
assert(mark <= gapStart || mark > gapEnd); | public int getOffset() { if (mark <= gapStart) return mark; else return mark - (gapEnd - gapStart); } | |
if (newGapStart == gapStart) return; else if (newGapStart < gapStart) | if (newGapStart < gapStart) | protected void shiftGap(int newGapStart) { int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new Gap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.