rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
case 1 :
case 1:
public static double sin(double a) { if (a == Double.NEGATIVE_INFINITY || !(a < Double.POSITIVE_INFINITY)) return Double.NaN; if (abs(a) <= PI / 4) return sin(a, 0); // Argument reduction needed. double[] y = new double[2]; int n = remPiOver2(a, y); switch (n & 3) { case 0 : return sin(y[0], y[1]); case 1 : return cos(y[0], y[1]); case 2 : return -sin(y[0], y[1]); default : return -cos(y[0], y[1]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
case 2 :
case 2:
public static double sin(double a) { if (a == Double.NEGATIVE_INFINITY || !(a < Double.POSITIVE_INFINITY)) return Double.NaN; if (abs(a) <= PI / 4) return sin(a, 0); // Argument reduction needed. double[] y = new double[2]; int n = remPiOver2(a, y); switch (n & 3) { case 0 : return sin(y[0], y[1]); case 1 : return cos(y[0], y[1]); case 2 : return -sin(y[0], y[1]); default : return -cos(y[0], y[1]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
default :
default:
public static double sin(double a) { if (a == Double.NEGATIVE_INFINITY || !(a < Double.POSITIVE_INFINITY)) return Double.NaN; if (abs(a) <= PI / 4) return sin(a, 0); // Argument reduction needed. double[] y = new double[2]; int n = remPiOver2(a, y); switch (n & 3) { case 0 : return sin(y[0], y[1]); case 1 : return cos(y[0], y[1]); case 2 : return -sin(y[0], y[1]); default : return -cos(y[0], y[1]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
public static double sqrt(double x) {
public static double sqrt(double x) {
public static double sqrt(double x) { if (x < 0) return Double.NaN; if (x == 0 || !(x < Double.POSITIVE_INFINITY)) return x; // Normalize x. long bits = Double.doubleToLongBits(x); int exp = (int) (bits >> 52); if (exp == 0) // Subnormal x. { x *= TWO_54; bits = Double.doubleToLongBits(x); exp = (int) (bits >> 52) - 54; } exp -= 1023; // Unbias exponent. bits = (bits & 0x000fffffffffffffL) | 0x0010000000000000L; if ((exp & 1) == 1) // Odd exp, double x to make it even. bits <<= 1; exp >>= 1; // Generate sqrt(x) bit by bit. bits <<= 1; long q = 0; long s = 0; long r = 0x0020000000000000L; // Move r right to left. while (r != 0) { long t = s + r; if (t <= bits) { s = t + r; bits -= t; q += r; } bits <<= 1; r >>= 1; } // Use floating add to round correctly. if (bits != 0) q += q & 1; return Double.longBitsToDouble((q >> 1) + ((exp + 1022L) << 52)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
if (x == 0 || !(x < Double.POSITIVE_INFINITY))
if (x == 0 || ! (x < Double.POSITIVE_INFINITY))
public static double sqrt(double x) { if (x < 0) return Double.NaN; if (x == 0 || !(x < Double.POSITIVE_INFINITY)) return x; // Normalize x. long bits = Double.doubleToLongBits(x); int exp = (int) (bits >> 52); if (exp == 0) // Subnormal x. { x *= TWO_54; bits = Double.doubleToLongBits(x); exp = (int) (bits >> 52) - 54; } exp -= 1023; // Unbias exponent. bits = (bits & 0x000fffffffffffffL) | 0x0010000000000000L; if ((exp & 1) == 1) // Odd exp, double x to make it even. bits <<= 1; exp >>= 1; // Generate sqrt(x) bit by bit. bits <<= 1; long q = 0; long s = 0; long r = 0x0020000000000000L; // Move r right to left. while (r != 0) { long t = s + r; if (t <= bits) { s = t + r; bits -= t; q += r; } bits <<= 1; r >>= 1; } // Use floating add to round correctly. if (bits != 0) q += q & 1; return Double.longBitsToDouble((q >> 1) + ((exp + 1022L) << 52)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
while (r != 0) {
while (r != 0) {
public static double sqrt(double x) { if (x < 0) return Double.NaN; if (x == 0 || !(x < Double.POSITIVE_INFINITY)) return x; // Normalize x. long bits = Double.doubleToLongBits(x); int exp = (int) (bits >> 52); if (exp == 0) // Subnormal x. { x *= TWO_54; bits = Double.doubleToLongBits(x); exp = (int) (bits >> 52) - 54; } exp -= 1023; // Unbias exponent. bits = (bits & 0x000fffffffffffffL) | 0x0010000000000000L; if ((exp & 1) == 1) // Odd exp, double x to make it even. bits <<= 1; exp >>= 1; // Generate sqrt(x) bit by bit. bits <<= 1; long q = 0; long s = 0; long r = 0x0020000000000000L; // Move r right to left. while (r != 0) { long t = s + r; if (t <= bits) { s = t + r; bits -= t; q += r; } bits <<= 1; r >>= 1; } // Use floating add to round correctly. if (bits != 0) q += q & 1; return Double.longBitsToDouble((q >> 1) + ((exp + 1022L) << 52)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
if (t <= bits) {
if (t <= bits) {
public static double sqrt(double x) { if (x < 0) return Double.NaN; if (x == 0 || !(x < Double.POSITIVE_INFINITY)) return x; // Normalize x. long bits = Double.doubleToLongBits(x); int exp = (int) (bits >> 52); if (exp == 0) // Subnormal x. { x *= TWO_54; bits = Double.doubleToLongBits(x); exp = (int) (bits >> 52) - 54; } exp -= 1023; // Unbias exponent. bits = (bits & 0x000fffffffffffffL) | 0x0010000000000000L; if ((exp & 1) == 1) // Odd exp, double x to make it even. bits <<= 1; exp >>= 1; // Generate sqrt(x) bit by bit. bits <<= 1; long q = 0; long s = 0; long r = 0x0020000000000000L; // Move r right to left. while (r != 0) { long t = s + r; if (t <= bits) { s = t + r; bits -= t; q += r; } bits <<= 1; r >>= 1; } // Use floating add to round correctly. if (bits != 0) q += q & 1; return Double.longBitsToDouble((q >> 1) + ((exp + 1022L) << 52)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
public static double tan(double a) { if (a == Double.NEGATIVE_INFINITY || !(a < Double.POSITIVE_INFINITY))
public static double tan(double a) { if (a == Double.NEGATIVE_INFINITY || ! (a < Double.POSITIVE_INFINITY))
public static double tan(double a) { if (a == Double.NEGATIVE_INFINITY || !(a < Double.POSITIVE_INFINITY)) return Double.NaN; if (abs(a) <= PI / 4) return tan(a, 0, false); // Argument reduction needed. double[] y = new double[2]; int n = remPiOver2(a, y); return tan(y[0], y[1], (n & 1) == 1); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
public static double toDegrees(double rads) { return rads * (180 / PI);
public static double toDegrees(double rads) { return (rads * 180) / PI;
public static double toDegrees(double rads) { return rads * (180 / PI); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
public static double toRadians(double degrees) { return degrees * (PI / 180);
public static double toRadians(double degrees) { return (degrees * PI) / 180;
public static double toRadians(double degrees) { return degrees * (PI / 180); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/StrictMath.java/buggy/core/src/classpath/java/java/lang/StrictMath.java
String generateName ()
String generateName()
String generateName () { return "frame" + getUniqueLong (); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
return "frame" + getUniqueLong ();
return "frame" + getUniqueLong();
String generateName () { return "frame" + getUniqueLong (); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
getCursorType() { return(getCursor().getType()); }
public int getCursorType() { return getCursor().getType(); }
getCursorType(){ return(getCursor().getType());}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
public int getExtendedState ()
public int getExtendedState()
public int getExtendedState () { return state; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
{
{
public static Frame[] getFrames(){ int n = 0; synchronized (weakFrames) { Iterator i = weakFrames.iterator(); while (i.hasNext()) { WeakReference wr = (WeakReference) i.next(); if (wr.get() != null) ++n; } if (n == 0) return new Frame[0]; else { Frame[] frames = new Frame[n]; n = 0; i = weakFrames.iterator(); while (i.hasNext()) { WeakReference wr = (WeakReference) i.next(); if (wr.get() != null) frames[n++] = (Frame) wr.get(); } return frames; } }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
}
}
public static Frame[] getFrames(){ int n = 0; synchronized (weakFrames) { Iterator i = weakFrames.iterator(); while (i.hasNext()) { WeakReference wr = (WeakReference) i.next(); if (wr.get() != null) ++n; } if (n == 0) return new Frame[0]; else { Frame[] frames = new Frame[n]; n = 0; i = weakFrames.iterator(); while (i.hasNext()) { WeakReference wr = (WeakReference) i.next(); if (wr.get() != null) frames[n++] = (Frame) wr.get(); } return frames; } }}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
public Rectangle getMaximizedBounds ()
public Rectangle getMaximizedBounds()
public Rectangle getMaximizedBounds () { return maximizedBounds; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
private static synchronized long getUniqueLong ()
private static synchronized long getUniqueLong()
private static synchronized long getUniqueLong () { return next_frame_number++; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
public boolean isUndecorated ()
public boolean isUndecorated()
public boolean isUndecorated () { return undecorated; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
{
{
private static void noteFrame(Frame f){ weakFrames.add(new WeakReference(f));}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
}
}
private static void noteFrame(Frame f){ weakFrames.add(new WeakReference(f));}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
remove(MenuComponent menu) {
public void remove(MenuComponent menu) {
remove(MenuComponent menu){ menuBar.remove(menu);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
}
}
remove(MenuComponent menu){ menuBar.remove(menu);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
{
{
public void removeNotify(){ if (menuBar != null) menuBar.removeNotify(); super.removeNotify();}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
}
}
public void removeNotify(){ if (menuBar != null) menuBar.removeNotify(); super.removeNotify();}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
setCursor(int type) {
public void setCursor(int type) {
setCursor(int type){ setCursor(new Cursor(type));}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
}
}
setCursor(int type){ setCursor(new Cursor(type));}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
public void setExtendedState (int state)
public void setExtendedState(int state)
public void setExtendedState (int state) { this.state = state; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
public void setMaximizedBounds (Rectangle maximizedBounds)
public void setMaximizedBounds(Rectangle maximizedBounds)
public void setMaximizedBounds (Rectangle maximizedBounds) { this.maximizedBounds = maximizedBounds; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
setMenuBar(MenuBar menuBar) {
public synchronized void setMenuBar(MenuBar menuBar) {
setMenuBar(MenuBar menuBar){ if (peer != null) { if (this.menuBar != null) this.menuBar.removeNotify(); if (menuBar != null) menuBar.addNotify(); invalidateTree (); ((FramePeer) peer).setMenuBar(menuBar); } this.menuBar = menuBar;}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
}
}
setMenuBar(MenuBar menuBar){ if (peer != null) { if (this.menuBar != null) this.menuBar.removeNotify(); if (menuBar != null) menuBar.addNotify(); invalidateTree (); ((FramePeer) peer).setMenuBar(menuBar); } this.menuBar = menuBar;}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
setResizable(boolean resizable) {
public synchronized void setResizable(boolean resizable) {
setResizable(boolean resizable){ this.resizable = resizable; if (peer != null) ((FramePeer) peer).setResizable(resizable);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
}
}
setResizable(boolean resizable){ this.resizable = resizable; if (peer != null) ((FramePeer) peer).setResizable(resizable);}
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
public void setState (int state)
public void setState(int state)
public void setState (int state) { int current_state = getExtendedState (); if (state == NORMAL && (current_state & ICONIFIED) != 0) setExtendedState (current_state | ICONIFIED); if (state == ICONIFIED && (current_state & ~ICONIFIED) == 0) setExtendedState (current_state & ~ICONIFIED); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
setExtendedState (current_state | ICONIFIED);
setExtendedState(current_state | ICONIFIED);
public void setState (int state) { int current_state = getExtendedState (); if (state == NORMAL && (current_state & ICONIFIED) != 0) setExtendedState (current_state | ICONIFIED); if (state == ICONIFIED && (current_state & ~ICONIFIED) == 0) setExtendedState (current_state & ~ICONIFIED); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
setExtendedState (current_state & ~ICONIFIED);
setExtendedState(current_state & ~ICONIFIED);
public void setState (int state) { int current_state = getExtendedState (); if (state == NORMAL && (current_state & ICONIFIED) != 0) setExtendedState (current_state | ICONIFIED); if (state == ICONIFIED && (current_state & ~ICONIFIED) == 0) setExtendedState (current_state & ~ICONIFIED); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
public void setUndecorated (boolean undecorated)
public void setUndecorated(boolean undecorated)
public void setUndecorated (boolean undecorated) { if (isDisplayable ()) throw new IllegalComponentStateException (); this.undecorated = undecorated; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
if (isDisplayable ()) throw new IllegalComponentStateException ();
if (isDisplayable()) throw new IllegalComponentStateException();
public void setUndecorated (boolean undecorated) { if (isDisplayable ()) throw new IllegalComponentStateException (); this.undecorated = undecorated; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Frame.java/clean/core/src/classpath/java/java/awt/Frame.java
throw new BAD_OPERATION("Invalid completion status " + completion);
BAD_OPERATION bad = new BAD_OPERATION("Invalid completion status " + completion); bad.minor = Minor.Enumeration; throw bad;
public static CompletionStatus from_int(int completion) { try { return states [ completion ]; } catch (ArrayIndexOutOfBoundsException ex) { throw new BAD_OPERATION("Invalid completion status " + completion); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/CompletionStatus.java/clean/core/src/classpath/org/org/omg/CORBA/CompletionStatus.java
super ("UTF-16BE", null);
super ("UTF-16BE", new String[] { "UTF16BE", /* These names are provided by * http: */ "x-utf-16be", "ibm-1200", "ibm-1201", "ibm-5297", "ibm-13488", "ibm-17584", "windows-1201", "cp1200", "cp1201", "UTF16_BigEndian", "UnicodeBigUnmarked" });
UTF_16BE () { super ("UTF-16BE", null); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/d7e10284742ade2934a1d2f7548145b029098f79/UTF_16BE.java/buggy/core/src/classpath/gnu/gnu/java/nio/charset/UTF_16BE.java
public VirtualMachineError(String s) { super(s);
public VirtualMachineError() {
public VirtualMachineError(String s) { super(s); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b2ed890086e708f00d163f3e8514bfa8b353f662/VirtualMachineError.java/clean/core/src/classpath/java/java/lang/VirtualMachineError.java
public ThreadNameArgument(String name, String description) { super(name, description);
public ThreadNameArgument(String name, String description, boolean multi) { super(name, description, multi);
public ThreadNameArgument(String name, String description) { super(name, description); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/ThreadNameArgument.java/clean/shell/src/shell/org/jnode/shell/help/ThreadNameArgument.java
public void initialize() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
public static void loadKeyBindings(InputMap retMap, Object[] keys) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
public void uninitialize() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
if (c.getBorder() instanceof UIResource) c.setBorder(null);
public static void uninstallBorder(JComponent c) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
public ImageIcon(URL url)
public ImageIcon()
public ImageIcon(URL url) { this(url, null); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/ImageIcon.java/buggy/core/src/classpath/javax/javax/swing/ImageIcon.java
this(url, null); }
}
public ImageIcon(URL url) { this(url, null); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/ImageIcon.java/buggy/core/src/classpath/javax/javax/swing/ImageIcon.java
Log.errorln("FormatObject: "+formatObj.getClass());
private ArrayList formattedSplitStringIntoStringObjects ( String data , FormattedXMLDataIOStyle readObj ) { ArrayList stringObjList = new ArrayList(); List commandList = readObj.getCommands(); DataFormat dataFormat[] = CurrentArray.getDataFormatList(); int dataPosition = 0; int dataLength = data.length(); int currentDataFormat = 0; int nrofDataFormat = dataFormat.length; Log.debugln("in formattedSplitString, data :["+data+"]"); // the extraction loop // whip thru the data string, either ignoring or accepting // characters in the string as directed by the formatCmdList while (dataPosition < dataLength) { Iterator formatIter = commandList.iterator(); while (formatIter.hasNext()) { FormattedIOCmd thisCommand = (FormattedIOCmd) formatIter.next(); if (thisCommand instanceof ReadCellFormattedIOCmd) // ReadCell ==> read some data { DataFormat formatObj = dataFormat[currentDataFormat]; int endDataPosition = dataPosition + formatObj.numOfBytes(); // add in our object if(endDataPosition > dataLength) { Log.errorln("Format specification exceeded data width, Bad format?"); Log.errorln("Run in debug mode to examine formatted read. Aborting."); System.exit(-1); // throw IOException; } String thisData = data.substring(dataPosition,endDataPosition); // remove leading whitespace from what will be non-string data. if (Character.isWhitespace(thisData.charAt(0)) && !(formatObj instanceof StringDataFormat)) thisData = trimLeadingWhitespace(thisData); Log.debugln("Got Formatted DataCell:["+thisData+"]"); stringObjList.add(thisData); dataPosition = endDataPosition; // advance our pointer to the current DataFormat if (nrofDataFormat > 1) if (currentDataFormat == (nrofDataFormat - 1)) currentDataFormat = 0; else currentDataFormat++; } else if (thisCommand instanceof SkipCharFormattedIOCmd) // SkipChar ==> just adv. dataPointer { dataPosition += ((SkipCharFormattedIOCmd) thisCommand).getCount().intValue(); } else { Log.errorln("Unknown FormattedIOCmd, aborting formatted read."); // needed check ? break; } } } return stringObjList; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/9bfe7c50f0f3bab3f11b16e38d07c560a5ef32a7/SaxDocumentHandler.java/buggy/src/gov/nasa/gsfc/adc/xdf/SaxDocumentHandler.java
getDataCube().incrementDimension((Axis) axis);
public AxisInterface addAxis(AxisInterface axis) { if (axis instanceof FieldAxis) { setFieldAxis((FieldAxis) axis); } else if (canAddAxisObjToArray((Axis) axis)) { //check if the axis can be added getDataCube().incrementDimension((Axis) axis); //increment the DataCube dimension by 1 getAxes().add((Axis) axis); updateChildLocators((Axis) axis, "add"); updateNotesLocationOrder(); // reset to the current order of the axes } else { return null; } return axis; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/buggy/src/gov/nasa/gsfc/adc/xdf/Array.java
super();
super();
public FieldGroup () { super(); // use superclass constructor init(); // my init }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/FieldGroup.java/buggy/src/gov/nasa/gsfc/adc/xdf/FieldGroup.java
addMemberObject((Object) group);
addMemberObject((Object) group);
public FieldGroup addFieldGroup (FieldGroup group) { //add the group to the groupOwnedHash addMemberObject((Object) group); return group; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/FieldGroup.java/buggy/src/gov/nasa/gsfc/adc/xdf/FieldGroup.java
if (field == null) { Log.warn("in FieldAxis.addField(),Field passed in is null"); return null; }
public Field addField (Field field) { if (field == null) { Log.warn("in FieldAxis.addField(),Field passed in is null"); return null; } getFieldList().add(field); length++; return field; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/FieldAxis.java/buggy/src/gov/nasa/gsfc/adc/xdf/FieldAxis.java
if (n == null) { Log.warn("in Field.addNote(), the Note passed in is null"); return null; }
public Note addNote(Note n) { if (n == null) { Log.warn("in Field.addNote(), the Note passed in is null"); return null; } getNoteList().add(n); return n; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Field.java/buggy/src/gov/nasa/gsfc/adc/xdf/Field.java
if (tag == null || axisId== null) { Log.error("Missing information: need tag AND axisId for addAxisTag. Ignoring request. returning null"); return; }
public void setAxisTag(String tag, String axisId) { if (tag == null || axisId== null) { Log.error("Missing information: need tag AND axisId for addAxisTag. Ignoring request. returning null"); return; } //insert in hash table, return tag value tagHash.put(axisId, tag); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/TaggedXMLDataIOStyle.java/buggy/src/gov/nasa/gsfc/adc/xdf/TaggedXMLDataIOStyle.java
if (unit == null) { Log.warn("in Array.addUnit(), the Unit passed in is null"); return null; }
public Unit addUnit(Unit unit) { if (unit == null) { Log.warn("in Array.addUnit(), the Unit passed in is null"); return null; } Units u = getUnits(); if (u == null) { u = new Units(); setUnits(u); } return u.addUnit(unit); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Field.java/buggy/src/gov/nasa/gsfc/adc/xdf/Field.java
public Value () {
public Value (String strValue) {
public Value () { init(); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Value.java/buggy/src/gov/nasa/gsfc/adc/xdf/Value.java
setValue(strValue);
public Value () { init(); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Value.java/buggy/src/gov/nasa/gsfc/adc/xdf/Value.java
public void setData (Locator locator, String strValue ) throws SetDataException
public void setData (Locator locator, Object dataObj) throws SetDataException
public void setData (Locator locator, String strValue ) throws SetDataException { getDataCube().setData(locator, strValue); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/buggy/src/gov/nasa/gsfc/adc/xdf/Array.java
getDataCube().setData(locator, strValue);
if (dataObj.getClass().isArray()) { if (dataObj instanceof int[] ) this.setData (locator, (int[])dataObj); else if (dataObj instanceof long[]) this.setData (locator, (long[])dataObj); else if (dataObj instanceof float[]) this.setData (locator, (float[])dataObj); else if (dataObj instanceof double[]) this.setData (locator, (double[])dataObj); else if (dataObj instanceof String[]) this.setData (locator, (String[])dataObj); else { String msg = "Data array: " + dataObj.getClass().getName() + " is not implemented"; Log.errorln(msg); throw new SetDataException (msg); } } else { if (dataObj instanceof Double ) this.setData (locator, (Double) dataObj); else if (dataObj instanceof Integer ) this.setData (locator, (Integer) dataObj); else { String msg = "Primiary data wrapper type: " + dataObj.getClass().getName() + " is not implemented"; Log.errorln(msg); throw new SetDataException (msg); } }
public void setData (Locator locator, String strValue ) throws SetDataException { getDataCube().setData(locator, strValue); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/buggy/src/gov/nasa/gsfc/adc/xdf/Array.java
e.printStackTrace((PrintStream) output);
e.printStackTrace((PrintStream) output);
public static void printStackTrace (Exception e) { e.printStackTrace((PrintStream) output); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/1e7f6912855beedfa6f64bcbc5bc675d9beedbae/Log.java/buggy/src/gov/nasa/gsfc/adc/xdf/Log.java
public int getNextMatch(String prefix, int startIndex, Position.Bias bias)
public int getNextMatch(String prefix, int startIndex, Position.Bias direction)
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
if (startIndex > model.getSize())
if (startIndex >= model.getSize())
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
int index = -1; if (bias == Position.Bias.Forward)
int result = -1; int current = startIndex; int delta = -1; int itemCount = model.getSize(); boolean finished = false; prefix = prefix.toUpperCase(); if (direction == Position.Bias.Forward) delta = 1; while (!finished)
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } }
String itemStr = model.getElementAt(current).toString().toUpperCase(); if (itemStr.startsWith(prefix)) return current; current = (current + delta); if (current == -1) current += itemCount; else current = current % itemCount; finished = current == startIndex;
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index;
return result;
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { if (prefix == null) throw new IllegalArgumentException("The argument 'prefix' must not be" + " null."); if (startIndex < 0) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be less than zero."); int size = model.getSize(); if (startIndex > model.getSize()) throw new IllegalArgumentException("The argument 'startIndex' must not" + " be greater than the number of" + " elements in the ListModel."); int index = -1; if (bias == Position.Bias.Forward) { for (int i = startIndex; i < size; i++) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } else { for (int i = startIndex; i >= 0; i--) { String item = model.getElementAt(i).toString(); if (item.startsWith(prefix)) { index = i; break; } } } return index; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
if (orientation == VERTICAL) return visibleRect.height * direction;
int block = -1; if (orientation == SwingConstants.VERTICAL) { block = visibleRect.height; if (direction > 0) { Point p = new Point(visibleRect.x, visibleRect.y + visibleRect.height - 1); int last = locationToIndex(p); if (last != -1) { Rectangle lastR = getCellBounds(last, last); if (lastR != null) { block = lastR.y - visibleRect.y; if (block == 0&& last < getModel().getSize() - 1) block = lastR.height; } } }
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
return visibleRect.width * direction;
{ Point p = new Point(visibleRect.x, visibleRect.y - visibleRect.height); int newFirst = locationToIndex(p); if (newFirst != -1) { int first = getFirstVisibleIndex(); if (first == -1) first = locationToIndex(visibleRect.getLocation()); Rectangle newFirstR = getCellBounds(newFirst, newFirst); Rectangle firstR = getCellBounds(first, first); if (newFirstR != null && firstR != null) { while (newFirstR.y + visibleRect.height < firstR.y + firstR.height && newFirstR.y < firstR.y) { newFirst++; newFirstR = getCellBounds(newFirst, newFirst); } block = visibleRect.y - newFirstR.y; if (block <= 0 && newFirstR.y > 0) { newFirst--; newFirstR = getCellBounds(newFirst, newFirst); if (newFirstR != null) block = visibleRect.y - newFirstR.y; } } } } } else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL) { block = visibleRect.width; if (direction > 0) { Point p = new Point(visibleRect.x + visibleRect.width + 1, visibleRect.y); int last = locationToIndex(p); if (last != -1) { Rectangle lastR = getCellBounds(last, last); if (lastR != null) { block = lastR.x - visibleRect.x; if (block < 0) block += lastR.width; else if (block == 0 && last < getModel().getSize() - 1) block = lastR.width; } } } else { Point p = new Point(visibleRect.x - visibleRect.width, visibleRect.y); int first = locationToIndex(p); if (first != -1) { Rectangle firstR = getCellBounds(first, first); if (firstR != null) { if (firstR.x < visibleRect.x - visibleRect.width) { if (firstR.x + firstR.width > visibleRect.x) block = visibleRect.x - firstR.x; else block = visibleRect.x - firstR.x - firstR.width; } else block = visibleRect.x - firstR.x; } } } } return block;
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
ListUI lui = this.getUI();
int unit = -1;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
if (direction > 0)
int row = getFirstVisibleIndex(); if (row == -1) unit = 0; else if (direction > 0)
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { if (curIdx + 1 < model.getSize()) { Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height;
Rectangle bounds = getCellBounds(row, row); if (bounds != null) unit = bounds.height - (visibleRect.y - bounds.y); else unit = 0;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
return 0; }
Rectangle bounds = getCellBounds(row, row); if (row == 0 && bounds.y == visibleRect.y) unit = 0; else if (bounds.y == visibleRect.y) { Point loc = bounds.getLocation(); loc.y--; int prev = locationToIndex(loc); Rectangle prevR = getCellBounds(prev, prev); if (prevR == null || prevR.y >= bounds.y) unit = 0; else unit = prevR.height;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
{ return (curBounds.y + curBounds.height) - bottomLeft.y;
unit = visibleRect.y - bounds.y;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
else
else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL)
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y)
int i = locationToIndex(visibleRect.getLocation()); if (i != -1) { Rectangle b = getCellBounds(i, i); if (b != null)
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
if (curIdx > 0)
if (b.x != visibleRect.x)
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { return 0; }
if (direction < 0) unit = Math.abs(b.x - visibleRect.x); else unit = b.width + b.x - visibleRect.x;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
{ return curBounds.y - topLeft.y;
unit = b.width;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
return 1;
if (unit == -1) { Font f = getFont(); unit = f != null ? f.getSize() : 1; } return unit;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) { // Scrolling down Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) { // we are at the exact bottom of the current cell, so we // are being asked to scroll to the end of the next one if (curIdx + 1 < model.getSize()) { // there *is* a next item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else { // no next item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the bottom of it return (curBounds.y + curBounds.height) - bottomLeft.y; } } else { // scrolling up Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) { // we are at the exact top of the current cell, so we // are being asked to scroll to the top of the previous one if (curIdx > 0) { // there *is* a previous item in the list Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else { // no previous item, no advance possible return 0; } } else { // we are part way through an existing cell, so we are being // asked to scroll to the top of it return curBounds.y - topLeft.y; } } } // FIXME: handle horizontal scrolling (also wrapping?) return 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
return valueIsAdjusting;
return selectionModel.getValueIsAdjusting();
public boolean getValueIsAdjusting() { return valueIsAdjusting; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
valueIsAdjusting = false; visibleRowCount = 7;
visibleRowCount = 8;
private void init(ListModel m) { if (m == null) throw new IllegalArgumentException("Null model not permitted."); dragEnabled = false; fixedCellHeight = -1; fixedCellWidth = -1; layoutOrientation = VERTICAL; opaque = true; valueIsAdjusting = false; visibleRowCount = 7; cellRenderer = new DefaultListCellRenderer(); listListener = new ListListener(); model = m; if (model != null) model.addListDataListener(listListener); selectionModel = createSelectionModel(); if (selectionModel != null) { selectionModel.addListSelectionListener(listListener); selectionModel.setSelectionMode (ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } setLayout(null); updateUI(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
if (orientation < JList.VERTICAL || orientation > JList.HORIZONTAL_WRAP) throw new IllegalArgumentException();
public void setLayoutOrientation(int orientation) { if (layoutOrientation == orientation) return; int old = layoutOrientation; layoutOrientation = orientation; firePropertyChange("layoutOrientation", old, orientation); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
valueIsAdjusting = isAdjusting;
selectionModel.setValueIsAdjusting(isAdjusting);
public void setValueIsAdjusting(boolean isAdjusting) { valueIsAdjusting = isAdjusting; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
visibleRowCount = vc;
if (visibleRowCount != vc) { int oldValue = visibleRowCount; visibleRowCount = Math.max(vc, 0); firePropertyChange("visibleRowCount", oldValue, vc);
public void setVisibleRowCount(int vc) { visibleRowCount = vc; revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
}
public void setVisibleRowCount(int vc) { visibleRowCount = vc; revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/JList.java/clean/core/src/classpath/javax/javax/swing/JList.java
public int getFirstIndex() {
public int getFirstIndex() {
public int getFirstIndex() { return firstIndex; } // getFirstIndex()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ListSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/ListSelectionEvent.java
}
}
public int getFirstIndex() { return firstIndex; } // getFirstIndex()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ListSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/ListSelectionEvent.java
public int getLastIndex() {
public int getLastIndex() {
public int getLastIndex() { return lastIndex; } // getLastIndex()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ListSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/ListSelectionEvent.java
}
}
public int getLastIndex() { return lastIndex; } // getLastIndex()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ListSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/ListSelectionEvent.java
int lastIndex, boolean isAdjusting) {
int lastIndex, boolean isAdjusting) {
public ListSelectionEvent(Object source, int firstIndex, int lastIndex, boolean isAdjusting) { super(source); this.firstIndex = firstIndex; this.lastIndex = lastIndex; this.isAdjusting = isAdjusting; } // ListSelectionEvent()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ListSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/ListSelectionEvent.java
}
}
public ListSelectionEvent(Object source, int firstIndex, int lastIndex, boolean isAdjusting) { super(source); this.firstIndex = firstIndex; this.lastIndex = lastIndex; this.isAdjusting = isAdjusting; } // ListSelectionEvent()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/ListSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/ListSelectionEvent.java
public AnyHolder(Any initial_value)
public AnyHolder()
public AnyHolder(Any initial_value) { value = initial_value; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9b55eb78411ab1a82da7ba097b7b93a8cd80865/AnyHolder.java/clean/core/src/classpath/org/org/omg/CORBA/AnyHolder.java
value = initial_value;
public AnyHolder(Any initial_value) { value = initial_value; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b9b55eb78411ab1a82da7ba097b7b93a8cd80865/AnyHolder.java/clean/core/src/classpath/org/org/omg/CORBA/AnyHolder.java
bad.minor = Minor.Any;
public static ServiceContext extract(Any any) { try { return ((ServiceContextHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ServiceContext expected"); bad.initCause(cex); throw bad; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ServiceContextHelper.java/buggy/core/src/classpath/org/org/omg/IOP/ServiceContextHelper.java
if (CM != 8)
if (CM != Deflater.DEFLATED)
private void readHeader() throws IOException { /* 1. Check the two magic bytes */ CRC32 headCRC = new CRC32(); int magic = in.read(); if (magic < 0) { eos = true; return; } int magic2 = in.read(); if ((magic + (magic2 << 8)) != GZIP_MAGIC) throw new IOException("Error in GZIP header, bad magic code"); headCRC.update(magic); headCRC.update(magic2); /* 2. Check the compression type (must be 8) */ int CM = in.read(); if (CM != 8) throw new IOException("Error in GZIP header, data not in deflate format"); headCRC.update(CM); /* 3. Check the flags */ int flags = in.read(); if (flags < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(flags); /* This flag byte is divided into individual bits as follows: bit 0 FTEXT bit 1 FHCRC bit 2 FEXTRA bit 3 FNAME bit 4 FCOMMENT bit 5 reserved bit 6 reserved bit 7 reserved */ /* 3.1 Check the reserved bits are zero */ if ((flags & 0xd0) != 0) throw new IOException("Reserved flag bits in GZIP header != 0"); /* 4.-6. Skip the modification time, extra flags, and OS type */ for (int i=0; i< 6; i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } /* 7. Read extra field */ if ((flags & FEXTRA) != 0) { /* Skip subfield id */ for (int i=0; i< 2; i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } if (in.read() < 0 || in.read() < 0) throw new EOFException("Early EOF in GZIP header"); int len1, len2, extraLen; len1 = in.read(); len2 = in.read(); if ((len1 < 0) || (len2 < 0)) throw new EOFException("Early EOF in GZIP header"); headCRC.update(len1); headCRC.update(len2); extraLen = (len1 << 8) | len2; for (int i = 0; i < extraLen;i++) { int readByte = in.read(); if (readByte < 0) throw new EOFException("Early EOF in GZIP header"); headCRC.update(readByte); } } /* 8. Read file name */ if ((flags & FNAME) != 0) { int readByte; while ( (readByte = in.read()) > 0) headCRC.update(readByte); if (readByte < 0) throw new EOFException("Early EOF in GZIP file name"); headCRC.update(readByte); } /* 9. Read comment */ if ((flags & FCOMMENT) != 0) { int readByte; while ( (readByte = in.read()) > 0) headCRC.update(readByte); if (readByte < 0) throw new EOFException("Early EOF in GZIP comment"); headCRC.update(readByte); } /* 10. Read header CRC */ if ((flags & FHCRC) != 0) { int tempByte; int crcval = in.read(); if (crcval < 0) throw new EOFException("Early EOF in GZIP header"); tempByte = in.read(); if (tempByte < 0) throw new EOFException("Early EOF in GZIP header"); crcval = (crcval << 8) | tempByte; if (crcval != ((int) headCRC.getValue() & 0xffff)) throw new IOException("Header CRC value mismatch"); } readGZIPHeader = true; //System.err.println("Read GZIP header"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/eea27f084742358ddb097f7118c05cd257029453/GZIPInputStream.java/clean/core/src/classpath/java/java/util/zip/GZIPInputStream.java
public InflaterInputStream(InputStream in, Inflater inf, int size)
public InflaterInputStream(InputStream in)
public InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); this.inf = inf; this.len = 0; if (size <= 0) throw new IllegalArgumentException("size <= 0"); buf = new byte[size]; //Create the buffer }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/InflaterInputStream.java/buggy/core/src/classpath/java/java/util/zip/InflaterInputStream.java
super(in); this.inf = inf; this.len = 0; if (size <= 0) throw new IllegalArgumentException("size <= 0"); buf = new byte[size];
this(in, new Inflater(), 4096);
public InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); this.inf = inf; this.len = 0; if (size <= 0) throw new IllegalArgumentException("size <= 0"); buf = new byte[size]; //Create the buffer }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/InflaterInputStream.java/buggy/core/src/classpath/java/java/util/zip/InflaterInputStream.java
public void close() throws IOException
public synchronized void close() throws IOException
public void close() throws IOException { in.close(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/InflaterInputStream.java/buggy/core/src/classpath/java/java/util/zip/InflaterInputStream.java
in = null;
public void close() throws IOException { in.close(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/InflaterInputStream.java/buggy/core/src/classpath/java/java/util/zip/InflaterInputStream.java
public int read(byte[] b, int off, int len) throws IOException { for (;;) { int count; try { count = inf.inflate(b, off, len); } catch (DataFormatException dfe) { throw new ZipException(dfe.getMessage()); } if (count > 0) return count; if (inf.needsDictionary()) throw new ZipException("Need a dictionary"); else if (inf.finished()) return -1; else if (inf.needsInput()) fill(); else throw new InternalError("Don't know what to do"); }
public int read() throws IOException { int nread = read(onebytebuffer, 0, 1); if (nread > 0) return onebytebuffer[0] & 0xff; return -1;
public int read(byte[] b, int off, int len) throws IOException { for (;;) { int count; try { count = inf.inflate(b, off, len); } catch (DataFormatException dfe) { throw new ZipException(dfe.getMessage()); } if (count > 0) return count; if (inf.needsDictionary()) throw new ZipException("Need a dictionary"); else if (inf.finished()) return -1; else if (inf.needsInput()) fill(); else throw new InternalError("Don't know what to do"); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7c463aa3bd840a934d101c434976bb7b25d5b975/InflaterInputStream.java/buggy/core/src/classpath/java/java/util/zip/InflaterInputStream.java