rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
mouseListener = AWTEventMulticaster.remove(mouseListener, l);
mouseListener = AWTEventMulticaster.remove(mouseListener, listener);
public synchronized void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
public synchronized void removeMouseMotionListener(MouseMotionListener l)
public synchronized void removeMouseMotionListener(MouseMotionListener listener)
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l);
mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, listener);
public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
public synchronized void removeMouseWheelListener(MouseWheelListener l)
public synchronized void removeMouseWheelListener(MouseWheelListener listener)
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l);
mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, listener);
public synchronized void removeMouseWheelListener(MouseWheelListener l) { mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
if (isLightweight())
if (isLightweight() && isShowing ())
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { boolean shouldRepaintParent = false; boolean shouldRepaintSelf = false; if (parent != null) { Rectangle parentBounds = parent.getBounds(); Rectangle oldBounds = new Rectangle(parent.getX() + oldx, parent.getY() + oldy, oldwidth, oldheight); Rectangle newBounds = new Rectangle(parent.getX() + x, parent.getY() + y, width, height); shouldRepaintParent = parentBounds.intersects(oldBounds); shouldRepaintSelf = parentBounds.intersects(newBounds); } if (shouldRepaintParent) parent.repaint(oldx, oldy, oldwidth, oldheight); if (shouldRepaintSelf) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
if (shouldRepaintParent)
if (shouldRepaintParent && parent != null)
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { boolean shouldRepaintParent = false; boolean shouldRepaintSelf = false; if (parent != null) { Rectangle parentBounds = parent.getBounds(); Rectangle oldBounds = new Rectangle(parent.getX() + oldx, parent.getY() + oldy, oldwidth, oldheight); Rectangle newBounds = new Rectangle(parent.getX() + x, parent.getY() + y, width, height); shouldRepaintParent = parentBounds.intersects(oldBounds); shouldRepaintSelf = parentBounds.intersects(newBounds); } if (shouldRepaintParent) parent.repaint(oldx, oldy, oldwidth, oldheight); if (shouldRepaintSelf) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
if (oldx != x || oldy != y)
if (isShowing () && (oldx != x || oldy != y))
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { boolean shouldRepaintParent = false; boolean shouldRepaintSelf = false; if (parent != null) { Rectangle parentBounds = parent.getBounds(); Rectangle oldBounds = new Rectangle(parent.getX() + oldx, parent.getY() + oldy, oldwidth, oldheight); Rectangle newBounds = new Rectangle(parent.getX() + x, parent.getY() + y, width, height); shouldRepaintParent = parentBounds.intersects(oldBounds); shouldRepaintSelf = parentBounds.intersects(newBounds); } if (shouldRepaintParent) parent.repaint(oldx, oldy, oldwidth, oldheight); if (shouldRepaintSelf) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
if (oldwidth != width || oldheight != height)
if (isShowing () && (oldwidth != width || oldheight != height))
public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { boolean shouldRepaintParent = false; boolean shouldRepaintSelf = false; if (parent != null) { Rectangle parentBounds = parent.getBounds(); Rectangle oldBounds = new Rectangle(parent.getX() + oldx, parent.getY() + oldy, oldwidth, oldheight); Rectangle newBounds = new Rectangle(parent.getX() + x, parent.getY() + y, width, height); shouldRepaintParent = parentBounds.intersects(oldBounds); shouldRepaintSelf = parentBounds.intersects(newBounds); } if (shouldRepaintParent) parent.repaint(oldx, oldy, oldwidth, oldheight); if (shouldRepaintSelf) repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
public void setFont(Font f)
public void setFont(Font newFont)
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
firePropertyChange("font", font, f);
if (font == newFont) return; Font oldFont = font; font = newFont;
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
peer.setFont(f);
peer.setFont(font); firePropertyChange("font", oldFont, newFont);
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
font = f;
public void setFont(Font f) { firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); invalidate(); font = f; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
public void setLocale(Locale l)
public void setLocale(Locale newLocale)
public void setLocale(Locale l) { firePropertyChange("locale", locale, l); locale = l; // New writing/layout direction or more/less room for localized labels. invalidate(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
firePropertyChange("locale", locale, l); locale = l;
if (locale == newLocale) return; Locale oldLocale = locale; locale = newLocale; firePropertyChange("locale", oldLocale, newLocale);
public void setLocale(Locale l) { firePropertyChange("locale", locale, l); locale = l; // New writing/layout direction or more/less room for localized labels. invalidate(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/cdb624bf4a3742cc4374523f5c6856a06dcd8f92/Component.java/clean/core/src/classpath/java/java/awt/Component.java
Log.debug("in XMLDataIOStyle, setParentArray()");
protected void setParentArray(Array parentArray) { Log.debug("in XMLDataIOStyle, setParentArray()"); this.parentArray = parentArray; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/7fa5363afbd86a328df98e44ab6771da5707fc10/XMLDataIOStyle.java/clean/src/gov/nasa/gsfc/adc/xdf/XMLDataIOStyle.java
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length)
public void send(IPv4Header ipHdr, TCPHeader hdr)
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TCPOutChannel.java/clean/net/src/net/org/jnode/net/ipv4/tcp/TCPOutChannel.java
log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss");
if (hdr.getDataLength() != 0) { throw new IllegalArgumentException("dataLength must be 0");
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TCPOutChannel.java/clean/net/src/net/org/jnode/net/ipv4/tcp/TCPOutChannel.java
while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } final int bufOfs = dataBuffer.add(data, offset, length); hdr.setDataLength(length);
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TCPOutChannel.java/clean/net/src/net/org/jnode/net/ipv4/tcp/TCPOutChannel.java
sendHelper(ipHdr, hdr, bufOfs);
sendHelper(ipHdr, hdr, 0);
public synchronized void send(IPv4Header ipHdr, TCPHeader hdr, byte[] data, int offset, int length) throws SocketException { log.debug("outChannel.send(ipHdr,hdr,data," + offset + ", " + length + ")"); // Check for maximum datalength if (length > mss) { throw new IllegalArgumentException("dataLength must be <= mss"); } // Wait until there is space in the output buffer while ((length > dataBuffer.getFreeSize()) && !controlBlock.isReset()) { try { wait(); } catch (InterruptedException ex) { // Ignore } } if (controlBlock.isReset()) { throw new SocketException("Connection reset"); } // Add to databuffer final int bufOfs = dataBuffer.add(data, offset, length); // Update tcp header hdr.setDataLength(length); // Do the actual send sendHelper(ipHdr, hdr, bufOfs); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/TCPOutChannel.java/clean/net/src/net/org/jnode/net/ipv4/tcp/TCPOutChannel.java
public abstract void add(String item, int index);
void add (String item, int index);
public abstract void add(String item, int index);
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/ChoicePeer.java/buggy/core/src/classpath/java/java/awt/peer/ChoicePeer.java
public abstract void remove(int index);
void remove (int index);
public abstract void remove(int index);
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/ChoicePeer.java/buggy/core/src/classpath/java/java/awt/peer/ChoicePeer.java
public abstract void select(int index);
void select (int index);
public abstract void select(int index);
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/ChoicePeer.java/buggy/core/src/classpath/java/java/awt/peer/ChoicePeer.java
super(name, description, MANDATORY); }
super(name, description, MANDATORY); }
public Option(String name, String description) { super(name, description, MANDATORY); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/OptionArgument.java/clean/shell/src/shell/org/jnode/shell/help/OptionArgument.java
public OptionArgument(String name, String description, Option[] options, boolean multi) { super(name, description, multi); this.options = options; }
public OptionArgument(String name, String description, Option[] options, boolean multi) { super(name, description, multi); this.options = options; }
public OptionArgument(String name, String description, Option[] options, boolean multi) { super(name, description, multi); this.options = options; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/OptionArgument.java/clean/shell/src/shell/org/jnode/shell/help/OptionArgument.java
List opts = new ArrayList(); for( int i = 0; i < options.length; i++ ) { if( options[i].getName().startsWith(partial) ) opts.add(options[i].getName()); }
List opts = new ArrayList(); for (int i = 0; i < options.length; i++) { if (options[ i].getName().startsWith(partial)) opts.add(options[ i].getName()); }
public String complete(String partial) { List opts = new ArrayList(); for( int i = 0; i < options.length; i++ ) { if( options[i].getName().startsWith(partial) ) opts.add(options[i].getName()); } return complete(partial, opts); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/OptionArgument.java/clean/shell/src/shell/org/jnode/shell/help/OptionArgument.java
return complete(partial, opts); }
return complete(partial, opts); }
public String complete(String partial) { List opts = new ArrayList(); for( int i = 0; i < options.length; i++ ) { if( options[i].getName().startsWith(partial) ) opts.add(options[i].getName()); } return complete(partial, opts); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/OptionArgument.java/clean/shell/src/shell/org/jnode/shell/help/OptionArgument.java
for (int i = 0; i < options.length; i++) options[i].describe(help); }
for (int i = 0; i < options.length; i++) options[ i].describe(help); }
public void describe(Help help) { for (int i = 0; i < options.length; i++) options[i].describe(help); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/OptionArgument.java/clean/shell/src/shell/org/jnode/shell/help/OptionArgument.java
if (options.length == 0) return ""; String result = options[0].getName(); for (int i = 1; i < options.length; i++) result += "|" + options[i].getName(); return result; }
if (options.length == 0) return ""; String result = options[ 0].getName(); for (int i = 1; i < options.length; i++) result += "|" + options[ i].getName(); return result; }
public String format() { if (options.length == 0) return ""; String result = options[0].getName(); for (int i = 1; i < options.length; i++) result += "|" + options[i].getName(); return result; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/8475fed231619f209c4398ccad2ba966899e292d/OptionArgument.java/clean/shell/src/shell/org/jnode/shell/help/OptionArgument.java
throw new IllegalArgumentException ();
throw new IllegalArgumentException ();
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JLayeredPane.java/buggy/core/src/classpath/javax/javax/swing/JLayeredPane.java
position = (bot - top) - 1;
position = (bot - top) - 1;
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JLayeredPane.java/buggy/core/src/classpath/javax/javax/swing/JLayeredPane.java
{
{
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JLayeredPane.java/buggy/core/src/classpath/javax/javax/swing/JLayeredPane.java
}
}
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JLayeredPane.java/buggy/core/src/classpath/javax/javax/swing/JLayeredPane.java
public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JLayeredPane.java/buggy/core/src/classpath/javax/javax/swing/JLayeredPane.java
&& style != WARNING_DIALOG)
&& style != WARNING_DIALOG && style != PLAIN_DIALOG)
public void setWindowDecorationStyle(int style) { if (style != NONE && style != FRAME && style != INFORMATION_DIALOG && style != ERROR_DIALOG && style != COLOR_CHOOSER_DIALOG && style != FILE_CHOOSER_DIALOG && style != QUESTION_DIALOG && style != WARNING_DIALOG) throw new IllegalArgumentException("invalid style"); int oldStyle = windowDecorationStyle; windowDecorationStyle = style; firePropertyChange("windowDecorationStyle", oldStyle, style); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/JRootPane.java/buggy/core/src/classpath/javax/javax/swing/JRootPane.java
if (n == null) { Log.warn("in Parameter.addNote(), the Note passed in is null"); return null; }
public Note addNote(Note n) { if (n == null) { Log.warn("in Parameter.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/74ec06d81e881d59f7cd859f9b2e12ee8a27dd78/Parameter.java/buggy/src/gov/nasa/gsfc/adc/xdf/Parameter.java
if (v == null) { Log.warn("in Parameter.addValue(), the Value passed in is null"); return null; }
public Value addValue(Value v) { if (v == null) { Log.warn("in Parameter.addValue(), the Value passed in is null"); return null; } getValueList().add(v); return v; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/74ec06d81e881d59f7cd859f9b2e12ee8a27dd78/Parameter.java/buggy/src/gov/nasa/gsfc/adc/xdf/Parameter.java
if (group !=null) {
public ValueGroup addValueGroup (ValueGroup group) { if (group !=null) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Parameter,addValueGroup(). ValueGroup passed in is null"); return null; } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/74ec06d81e881d59f7cd859f9b2e12ee8a27dd78/Parameter.java/buggy/src/gov/nasa/gsfc/adc/xdf/Parameter.java
} else { Log.warn("in Parameter,addValueGroup(). ValueGroup passed in is null"); return null; }
public ValueGroup addValueGroup (ValueGroup group) { if (group !=null) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Parameter,addValueGroup(). ValueGroup passed in is null"); return null; } }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/74ec06d81e881d59f7cd859f9b2e12ee8a27dd78/Parameter.java/buggy/src/gov/nasa/gsfc/adc/xdf/Parameter.java
cloneObj.valueGroupOwnedHash.add(iter.next());
cloneObj.valueGroupOwnedHash.add(((Group)iter.next()).clone());
public Object clone() throws CloneNotSupportedException { Parameter cloneObj = (Parameter) super.clone(); //deep copy of the valueGroupOwnedHash synchronized (this.valueGroupOwnedHash) { synchronized(cloneObj.valueGroupOwnedHash) { cloneObj.valueGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.valueGroupOwnedHash.size())); Iterator iter = this.valueGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.valueGroupOwnedHash.add(iter.next()); } } } return cloneObj; }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/74ec06d81e881d59f7cd859f9b2e12ee8a27dd78/Parameter.java/buggy/src/gov/nasa/gsfc/adc/xdf/Parameter.java
if (group == null) { Log.warn("in Axis,removeValueGroup(). ValueGroup passed in is null"); return false; }
public boolean removeValueGroup(ValueGroup group) { if (group == null) { Log.warn("in Axis,removeValueGroup(). ValueGroup passed in is null"); return false; } return valueGroupOwnedHash.remove(group); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/74ec06d81e881d59f7cd859f9b2e12ee8a27dd78/Parameter.java/buggy/src/gov/nasa/gsfc/adc/xdf/Parameter.java
if (member < 1) throw new IllegalArgumentException("member may not be less than 1");
public CopiesSupported(int member) { super(member); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/CopiesSupported.java/clean/core/src/classpath/javax/javax/print/attribute/standard/CopiesSupported.java
return (this.getClass() + "[" + getName() + "]");
return (this.getClass() + "[type=" + getType() + ",name=" + getName() + "]");
public String toString() { return (this.getClass() + "[" + getName() + "]"); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/Cursor.java/clean/core/src/classpath/java/java/awt/Cursor.java
SwingToolkit.add(sb, this); SwingToolkit.copyAwtProperties(sb, this); setOrientation(sb.getOrientation()); setBlockIncrement(sb.getBlockIncrement()); setUnitIncrement(sb.getUnitIncrement()); setValues(sb.getValue(), sb.getVisibleAmount(), sb.getMinimum(), sb.getMaximum()); }
this.scrollbar = sb; SwingToolkit.add(sb, this); SwingToolkit.copyAwtProperties(sb, this); setOrientation(sb.getOrientation()); setBlockIncrement(sb.getBlockIncrement()); setUnitIncrement(sb.getUnitIncrement()); setValues(sb.getValue(), sb.getVisibleAmount(), sb.getMinimum(), sb .getMaximum()); }
public SwingScrollbarPeer(Scrollbar sb) { SwingToolkit.add(sb, this); SwingToolkit.copyAwtProperties(sb, this); setOrientation(sb.getOrientation()); setBlockIncrement(sb.getBlockIncrement()); setUnitIncrement(sb.getUnitIncrement()); setValues(sb.getValue(), sb.getVisibleAmount(), sb.getMinimum(), sb.getMaximum()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
return false; }
return false; }
public boolean canDetermineObscurity() { return false; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
System.err.println(e); }
System.err.println(e); }
public void coalescePaintEvent(PaintEvent e) { System.err.println(e); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void createBuffers(int x, BufferCapabilities bufferCapabilities) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void destroyBuffers() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void dispose() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void flip(BufferCapabilities.FlipContents flipContents) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
return null; }
return null; }
public Image getBackBuffer() { return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void handleEvent(AWTEvent e) { //System.err.println(e); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
return false; }
return false; }
public boolean handlesWheelScrolling() { return false; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
return false; }
return false; }
public boolean isObscured() { return false; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
boolean focusedWindowChangeAllowed, long time) { return true; }
boolean focusedWindowChangeAllowed, long time) { return true; }
public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time) { return true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
public void setEventMask(long mask) { // TODO Auto-generated method stub }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void setEventMask(long mask) { // TODO Auto-generated method stub }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void setLineIncrement(int l) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void setPageIncrement(int l) { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
}
}
public void updateCursorImmediately() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ae9db4fc68ede9647d01b988919ce05ed61bf034/SwingScrollbarPeer.java/clean/gui/src/awt/org/jnode/awt/swingpeers/SwingScrollbarPeer.java
Ext2Debugger.debug("INode.getIMode(): "+Ext2Debugger.hexFormat(iMode), 3);
log.debug("INode.getIMode(): "+NumberUtils.hex(iMode));
public int getMode() { int iMode=Ext2Utils.get16(data, 0); Ext2Debugger.debug("INode.getIMode(): "+Ext2Debugger.hexFormat(iMode), 3); return iMode; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/95169e195210009513efbf3cd307b4f1185f9ce5/INode.java/buggy/fs/src/fs/org/jnode/fs/ext2/INode.java
specificDataFormatName = "exponent";
specificDataFormatName = "exponential";
private void init() { specificDataFormatName = "exponent"; //add attributes attribOrder.add(0,"exponent"); attribOrder.add(0,"precision"); attribOrder.add(0, "width"); attribHash.put("exponent", new XMLAttribute( new Integer(0), Constants.INTEGER_TYPE)); attribHash.put("precision", new XMLAttribute(new Integer(0), Constants.INTEGER_TYPE)); attribHash.put("width", new XMLAttribute( new Integer(0), Constants.INTEGER_TYPE)); generateFormatPattern(); }
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/87211e4d3d51e06356f6a400e3fedb13cb7790d5/ExponentialDataFormat.java/buggy/src/gov/nasa/gsfc/adc/xdf/ExponentialDataFormat.java
new Random ().nextBytes(M);
PRNG.getInstance().nextBytes(M);
public boolean selfTest() { final int[] mLen = new int[] { 16, 20, 32, 48, 64 }; final byte[] M = new byte[mLen[mLen.length - 1]]; new Random ().nextBytes(M); final byte[] EM = new byte[1024]; byte[] p; int bs, i, j; for (bs = 256; bs < 1025; bs += 256) { init(bs); for (i = 0; i < mLen.length; i++) { j = mLen[i]; p = pad(M, 0, j); if (j + p.length != blockSize) { new RuntimeException(name()).printStackTrace(System.err); return false; } System.arraycopy(p, 0, EM, 0, p.length); System.arraycopy(M, 0, EM, p.length, j); try { if (p.length != unpad(EM, 0, blockSize)) { new RuntimeException(name()).printStackTrace(System.err); return false; } } catch (WrongPaddingException x) { x.printStackTrace(System.err); return false; } } reset(); } return true; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/PKCS1_V1_5.java/clean/core/src/classpath/gnu/gnu/javax/crypto/pad/PKCS1_V1_5.java
Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = getToolkit().getFontMetrics(getFont()); SwingUtilities.layoutCompoundLabel((JLabel) this, fm, getText(), getIcon(), getVerticalAlignment(), getHorizontalAlignment(), getVerticalTextPosition(), getHorizontalTextPosition(), vr, ir, tr, getIconTextGap()); Rectangle cr = ir.union(tr); return new Dimension(cr.width, cr.height);
Dimension size = super.getPreferredSize(); size.width += 3; return size;
public Dimension getPreferredSize() { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = getToolkit().getFontMetrics(getFont()); SwingUtilities.layoutCompoundLabel((JLabel) this, fm, getText(), getIcon(), getVerticalAlignment(), getHorizontalAlignment(), getVerticalTextPosition(), getHorizontalTextPosition(), vr, ir, tr, getIconTextGap()); Rectangle cr = ir.union(tr); return new Dimension(cr.width, cr.height); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/DefaultTreeCellRenderer.java/clean/core/src/classpath/javax/javax/swing/tree/DefaultTreeCellRenderer.java
this.p = p;
this.p = (1. - (p / 100.)) / 3.;
public GrayFilter(boolean b, int p) { this.b = b; //FIXME - HANDLE THIS this.p = p; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/GrayFilter.java/clean/core/src/classpath/javax/javax/swing/GrayFilter.java
return (int) (p * (0.299 * ((0xff0000 & rgb) >> 16) + 0.587 * ((0xff00 & rgb) >> 8) + 0.114 * (0xff & rgb)));
int alpha = 0xff000000 & rgb; int red = (0xff0000 & rgb) >> 16; int green = (0xff00 & rgb) >> 8; int blue = (0xff & rgb); int gray = (int) ((0.299 * red + 0.587 * green + 0.114 * blue) * p); if (b) gray = Math.min(gray + 128, 255); return gray | gray << 8 | gray << 16 | alpha ;
public int filterRGB(int x, int y, int rgb) { return (int) (p * (0.299 * ((0xff0000 & rgb) >> 16) + 0.587 * ((0xff00 & rgb) >> 8) + 0.114 * (0xff & rgb))); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/GrayFilter.java/clean/core/src/classpath/javax/javax/swing/GrayFilter.java
JLabel lab = (JLabel)c;
JLabel lab = (JLabel) c;
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel)c; Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = lab.getInsets(); FontMetrics fm = lab.getToolkit().getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = tr.union(ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/BasicLabelUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicLabelUI.java
return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom);
return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom);
public Dimension getPreferredSize(JComponent c) { JLabel lab = (JLabel)c; Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = lab.getInsets(); FontMetrics fm = lab.getToolkit().getFontMetrics(lab.getFont()); layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr); Rectangle cr = tr.union(ir); return new Dimension(insets.left + cr.width + insets.right, insets.top + cr.height + insets.bottom); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/BasicLabelUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicLabelUI.java
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/BasicLabelUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicLabelUI.java
label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap());
label.getVerticalAlignment(), label.getHorizontalAlignment(), label .getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap());
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { return SwingUtilities.layoutCompoundLabel(label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/BasicLabelUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicLabelUI.java
if (text != null && ! text.equals(""))
if (text != null && !text.equals(""))
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; Font saved_font = g.getFont(); Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); vr = SwingUtilities.calculateInnerArea(c, vr); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); if (text != null && ! text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } g.setFont(saved_font); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/BasicLabelUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicLabelUI.java
public void paint(Graphics g, JComponent c) { JLabel b = (JLabel) c; Font saved_font = g.getFont(); Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); vr = SwingUtilities.calculateInnerArea(c, vr); if (vr.width < 0) vr.width = 0; if (vr.height < 0) vr.height = 0; Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon(); String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr); if (icon != null) icon.paintIcon(b, g, ir.x, ir.y); if (text != null && ! text.equals("")) { if (b.isEnabled()) paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent()); else paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent()); } g.setFont(saved_font); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f7b0a77266671350e38451a50ce054282a5860ef/BasicLabelUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicLabelUI.java
Font font) {
Font font,int botOffset) {
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
(fmHeight * (row + 1)),
(fmHeight * (row + 1)) - botOffset,
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
fmHeight / 2
(fmHeight / 2) - botOffset
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
fmHeight
fmHeight - botOffset
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
fmHeight / 2
(fmHeight / 2) - botOffset
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1);
g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset); s.updateImage(0,fmHeight * (row + 1)- botOffset,bi.getWidth(null),1);
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1));
g2.drawLine(0,(fmHeight * (row + 1))- botOffset,bi.getWidth(null),(fmHeight * (row + 1))- botOffset);
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1);
s.updateImage(0,(fmHeight * (row + 1)) - botOffset,bi.getWidth(null),1);
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
public void drawCursor(Screen5250 s,int row, int col, int fmWidth, int fmHeight, boolean insertMode, int crossHair, int cursorSize, Color colorCursor, Color colorBg,Color colorWhite, Font font) {// synchronized (lock) { Graphics2D g2 = getDrawingArea();// if (g2 == null)// return; switch (cursorSize) { case 0: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1)), fmWidth, 1 ); break; case 1: cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); break; case 2: cursor.setRect( fmWidth * (col), (fmHeight * row), fmWidth, fmHeight ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( fmWidth * (col), (fmHeight * (row + 1) - fmHeight / 2), fmWidth, fmHeight / 2 ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(colorCursor); g2.setXORMode(colorBg); g2.fill(cursor);// cursorActive = true; s.updateImage(r); switch (crossHair) { case 1: // horizontal g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; case 3: // horizontal & vertical g2.drawLine(0,fmHeight * (row + 1),bi.getWidth(null),fmHeight * (row + 1)); g2.drawLine(r.x,0,r.x,bi.getHeight(null) - fmHeight - fmHeight); s.updateImage(0,fmHeight * (row + 1),bi.getWidth(null),1); s.updateImage(r.x,0,1,bi.getHeight(null) - fmHeight - fmHeight); break; } g2.dispose(); g2 = getWritingArea(font); g2.setPaint(colorBg); g2.fill(pArea); g2.setColor(colorWhite);// g2.drawString((getRow(lastPos) + 1) + "/" + (getCol(lastPos) + 1)// ,(float)pArea.getX(),// (float)pArea.getY() + fmHeight); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + fmHeight); s.updateImage(pArea.getBounds()); g2.dispose(); // tell waiting threads to wake up// lock.notify();// } }
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/be319bbdd8024ad2c91541f2e005828a779a5afe/GuiGraphicBuffer.java/buggy/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java
else
else if (span > 1)
private void distributeSizeAndWeight (int size, double weight, int start, int span, int[] sizes, double[] weights) { if (span == 1) { sizes[start] = Math.max(sizes[start], size); weights[start] = Math.max(weights[start], weight); } else { int numOccupied = span; int lastOccupied = -1; for(int i = start; i < start + span; i++) { if (sizes[i] == 0.0) numOccupied--; else { size -= sizes[i]; lastOccupied = i; } } // A component needs to occupy at least one row. if(numOccupied == 0) sizes[start + span - 1] = size; else if (size > 0) sizes[lastOccupied] += size; calcCellWeights(weight, weights, start, span); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/GridBagLayout.java/clean/core/src/classpath/java/java/awt/GridBagLayout.java
else if (clone.gridwidth < 0 && clone.gridwidth != GridBagConstraints.REMAINDER && clone.gridwidth != GridBagConstraints.RELATIVE)
else if (clone.gridwidth < 0)
public void setConstraints (Component component, GridBagConstraints constraints) { GridBagConstraints clone = (GridBagConstraints) constraints.clone(); if (clone.gridx < 0) clone.gridx = GridBagConstraints.RELATIVE; if (clone.gridy < 0) clone.gridy = GridBagConstraints.RELATIVE; if (clone.gridwidth == 0) clone.gridwidth = GridBagConstraints.REMAINDER; else if (clone.gridwidth < 0 && clone.gridwidth != GridBagConstraints.REMAINDER && clone.gridwidth != GridBagConstraints.RELATIVE) clone.gridwidth = 1; if (clone.gridheight == 0) clone.gridheight = GridBagConstraints.REMAINDER; else if (clone.gridheight < 0 && clone.gridheight != GridBagConstraints.REMAINDER && clone.gridheight != GridBagConstraints.RELATIVE) clone.gridheight = 1; comptable.put (component, clone); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/GridBagLayout.java/clean/core/src/classpath/java/java/awt/GridBagLayout.java
else if (clone.gridheight < 0 && clone.gridheight != GridBagConstraints.REMAINDER && clone.gridheight != GridBagConstraints.RELATIVE)
else if (clone.gridheight < 0)
public void setConstraints (Component component, GridBagConstraints constraints) { GridBagConstraints clone = (GridBagConstraints) constraints.clone(); if (clone.gridx < 0) clone.gridx = GridBagConstraints.RELATIVE; if (clone.gridy < 0) clone.gridy = GridBagConstraints.RELATIVE; if (clone.gridwidth == 0) clone.gridwidth = GridBagConstraints.REMAINDER; else if (clone.gridwidth < 0 && clone.gridwidth != GridBagConstraints.REMAINDER && clone.gridwidth != GridBagConstraints.RELATIVE) clone.gridwidth = 1; if (clone.gridheight == 0) clone.gridheight = GridBagConstraints.REMAINDER; else if (clone.gridheight < 0 && clone.gridheight != GridBagConstraints.REMAINDER && clone.gridheight != GridBagConstraints.RELATIVE) clone.gridheight = 1; comptable.put (component, clone); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/1e7aa2954f7fa9e45a7b68da25c13d3846158a39/GridBagLayout.java/clean/core/src/classpath/java/java/awt/GridBagLayout.java
for (int i = 0; i < keys.length - 1; i+= 2)
for (int i = 0; i < keys.length - 1; i += 2)
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
keyStroke = (KeyStroke)key;
keyStroke = (KeyStroke) key;
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]);
keyStroke = KeyStroke.getKeyStroke((String) key); retMap.put(keyStroke, keys[i + 1]);
public static void loadKeyBindings(InputMap retMap, Object[] keys) { if (keys == null) return; for (int i = 0; i < keys.length - 1; i+= 2) { Object key = keys[i]; KeyStroke keyStroke; if (key instanceof KeyStroke) keyStroke = (KeyStroke)key; else keyStroke = KeyStroke.getKeyStroke((String)key); retMap.put(keyStroke, keys[i+1]); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
for (int i = 0; i < keyBindingList.length - 1; i+= 2)
for (int i = 0; i < keyBindingList.length - 1; i += 2)
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
stroke = (KeyStroke)keyBindingList[i];
stroke = (KeyStroke) keyBindingList[i];
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]);
stroke = KeyStroke.getKeyStroke((String) keyBindingList[i]); retBindings[i / 2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i + 1]);
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LookAndFeel.java/clean/core/src/classpath/javax/javax/swing/LookAndFeel.java
public CommandShell(TextConsole cons) throws ShellException { try { this.console = cons; this.out = this.console.getOut(); this.err = this.console.getErr(); this.currentLine = new Line(console, this, out); this.console.addKeyboardListener(this); defaultCommandInvoker = new DefaultCommandInvoker(this); threadCommandInvoker = new ThreadCommandInvoker(this); this.commandInvoker = threadCommandInvoker; aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME)) .createAliasManager(); AccessController.doPrivileged(new SetPropertyAction( PROMPT_PROPERTY_NAME, DEFAULT_PROMPT)); } catch (NameNotFoundException ex) { throw new ShellException("Cannot find required resource", ex); }
public CommandShell() throws NameNotFoundException, ShellException { this((TextConsole) ((ConsoleManager) InitialNaming .lookup(ConsoleManager.NAME)).getFocus());
public CommandShell(TextConsole cons) throws ShellException { try { this.console = cons; this.out = this.console.getOut(); this.err = this.console.getErr(); this.currentLine = new Line(console, this, out); // listen to the keyboard this.console.addKeyboardListener(this); defaultCommandInvoker = new DefaultCommandInvoker(this); threadCommandInvoker = new ThreadCommandInvoker(this); this.commandInvoker = threadCommandInvoker; // default to separate // threads for commands. aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME)) .createAliasManager(); AccessController.doPrivileged(new SetPropertyAction( PROMPT_PROPERTY_NAME, DEFAULT_PROMPT)); // ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { throw new ShellException("Cannot find required resource", ex); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0b9131f1ddc74c6881f272322f3fc9437ad4f01c/CommandShell.java/clean/shell/src/shell/org/jnode/shell/CommandShell.java
exitted = true;
exit0();
public void exit(){ exitted = true; console.close(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0b9131f1ddc74c6881f272322f3fc9437ad4f01c/CommandShell.java/clean/shell/src/shell/org/jnode/shell/CommandShell.java
public void exit(){ exitted = true; console.close(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0b9131f1ddc74c6881f272322f3fc9437ad4f01c/CommandShell.java/clean/shell/src/shell/org/jnode/shell/CommandShell.java
String prompt = System.getProperty(PROMPT_PROPERTY_NAME);
String prompt = (String) AccessController.doPrivileged( new GetPropertyAction(PROMPT_PROPERTY_NAME));
protected String prompt() { String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0b9131f1ddc74c6881f272322f3fc9437ad4f01c/CommandShell.java/clean/shell/src/shell/org/jnode/shell/CommandShell.java
result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir"))));
result.append(new File((String) AccessController .doPrivileged(new GetPropertyAction("user.dir"))));
protected String prompt() { String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0b9131f1ddc74c6881f272322f3fc9437ad4f01c/CommandShell.java/clean/shell/src/shell/org/jnode/shell/CommandShell.java
ownThread = Thread.currentThread();
public void run() { // Here, we are running in the CommandShell (main) Thread // so, we can register ourself as the current shell // (it will also be the current shell for all children Thread) try { ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException e1) { e1.printStackTrace(); } // Run commands from the JNode commandline first final String cmdLine = (String) AccessController .doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final StringTokenizer tok = new StringTokenizer(cmdLine); while (tok.hasMoreTokens()) { final String e = tok.nextToken(); try { if (e.startsWith(command)) { final String cmd = e.substring(command.length()); currentPrompt = prompt(); out.println(currentPrompt + cmd); processCommand(cmd); } } catch (Throwable ex) { ex.printStackTrace(err); } } final String user_home = (String) AccessController.doPrivileged(new GetPropertyAction("user.home", "")); AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { final File shell_ini = new File(user_home + "/shell.ini"); if(shell_ini.exists()) executeFile(shell_ini); } catch(IOException ioe){ ioe.printStackTrace(); } return null; } }); // Now become interactive while (!isExitted()) { try { synchronized (this) { // Catch keyboard events isActive = true; currentPrompt = prompt(); out.print(currentPrompt); currentLine.start(); // wait until enter is hit threadSuspended = true; while (threadSuspended) { wait(); } String line = currentLine.getContent().trim(); if (line.length() > 0) { processCommand(line); } // if (currentLine.trim().equals("halt")) halt = true; historyIndex = -1; if (VmSystem.isShuttingDown()) { exitted = true; } } } catch (Throwable ex) { ex.printStackTrace(err); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/0b9131f1ddc74c6881f272322f3fc9437ad4f01c/CommandShell.java/clean/shell/src/shell/org/jnode/shell/CommandShell.java
public void start(boolean keepContent) { if (keepContent) { consoleY = console.getCursorY(); } else { consoleX = console.getCursorX(); consoleY = console.getCursorY(); setContent(""); console.setCursor( consoleX,consoleY); }
public void start() { start(false);
public void start(boolean keepContent) { if (keepContent) { // we stay at the same position in X coordinate // only Y may have changed consoleY = console.getCursorY(); } else { consoleX = console.getCursorX(); consoleY = console.getCursorY(); setContent(""); console.setCursor( consoleX,consoleY);//move the cursor to the start of the line. } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/Line.java/buggy/shell/src/shell/org/jnode/shell/Line.java
UNKNOWN(String reason, int minor, CompletionStatus completed)
public UNKNOWN(String message)
UNKNOWN(String reason, int minor, CompletionStatus completed) { super(reason, minor, completed); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/72c2f223affb33a2850592b25490f4663c651bee/UNKNOWN.java/clean/core/src/classpath/org/org/omg/CORBA/UNKNOWN.java