rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
if (getRubyClass() == other.getRubyClass()) { return new RubyNumeric[] {this, other}; } else { return new RubyNumeric[] {RubyFloat.newFloat(getRuby(), getDoubleValue()), RubyFloat.newFloat(getRuby(), other.getDoubleValue())}; } }
if (getRubyClass() == other.getRubyClass()) { return new RubyNumeric[] {this, other}; } else { return new RubyNumeric[] {RubyFloat.newFloat(getRuby(), getDoubleValue()), RubyFloat.newFloat(getRuby(), other.getDoubleValue())}; } }
public RubyNumeric[] getCoerce(RubyNumeric other) { if (getRubyClass() == other.getRubyClass()) { return new RubyNumeric[] {this, other}; } else { return new RubyNumeric[] {RubyFloat.newFloat(getRuby(), getDoubleValue()), RubyFloat.newFloat(getRuby(), other.getDoubleValue())}; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return getRuby().getFalse(); }
return getRuby().getFalse(); }
public RubyBoolean int_p() { return getRuby().getFalse(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return (RubyNumeric)funcall("%", other); }
return (RubyNumeric)funcall("%", other); }
public RubyNumeric modulo(RubyNumeric other) { return (RubyNumeric)funcall("%", other); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
if (funcall("zero?").isTrue()) { return getRuby().getNil(); } return this; }
if (funcall("zero?").isTrue()) { return getRuby().getNil(); } return this; }
public RubyObject nonzero_p() { if (funcall("zero?").isTrue()) { return getRuby().getNil(); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
if (arg instanceof RubyNumeric) { return ((RubyNumeric)arg).getLongValue(); } throw new TypeError(arg.getRuby(), "argument is not numeric"); }
if (arg instanceof RubyNumeric) { return ((RubyNumeric)arg).getLongValue(); } throw new TypeError(arg.getRuby(), "argument is not numeric"); }
public static long num2long(RubyObject arg) { if (arg instanceof RubyNumeric) { return ((RubyNumeric)arg).getLongValue(); } throw new TypeError(arg.getRuby(), "argument is not numeric"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
if (!(arg instanceof RubyNumeric)) { throw new TypeError(arg.getRuby(), "argument not numeric"); } return (RubyNumeric)arg; }
if (!(arg instanceof RubyNumeric)) { throw new TypeError(arg.getRuby(), "argument not numeric"); } return (RubyNumeric)arg; }
public static RubyNumeric numericValue(RubyObject arg) { if (!(arg instanceof RubyNumeric)) { throw new TypeError(arg.getRuby(), "argument not numeric"); } return (RubyNumeric)arg; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
RubyNumeric[] coerce = getCoerce(RubyFixnum.zero(getRuby())); return (RubyNumeric)coerce[1].funcall("-", coerce[0]); }
RubyNumeric[] coerce = getCoerce(RubyFixnum.zero(getRuby())); return (RubyNumeric)coerce[1].funcall("-", coerce[0]); }
public RubyNumeric op_uminus() { RubyNumeric[] coerce = getCoerce(RubyFixnum.zero(getRuby())); return (RubyNumeric)coerce[1].funcall("-", coerce[0]); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return this; }
return this; }
public RubyNumeric op_uplus() { return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return this; }
return this; }
public RubyObject rbClone() { return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
RubyNumeric mod = (RubyNumeric)funcall("%", other); final RubyNumeric zero = RubyFixnum.zero(getRuby()); if (funcall("<", zero).isTrue() && other.funcall(">", zero).isTrue() || funcall(">", zero).isTrue() && other.funcall("<", zero).isTrue()) { return (RubyNumeric)mod.funcall("-", other); } return mod; }
RubyNumeric mod = (RubyNumeric)funcall("%", other); final RubyNumeric zero = RubyFixnum.zero(getRuby()); if (funcall("<", zero).isTrue() && other.funcall(">", zero).isTrue() || funcall(">", zero).isTrue() && other.funcall("<", zero).isTrue()) { return (RubyNumeric)mod.funcall("-", other); } return mod; }
public RubyNumeric remainder(RubyNumeric other) { RubyNumeric mod = (RubyNumeric)funcall("%", other); final RubyNumeric zero = RubyFixnum.zero(getRuby()); if (funcall("<", zero).isTrue() && other.funcall(">", zero).isTrue() || funcall(">", zero).isTrue() && other.funcall("<", zero).isTrue()) { return (RubyNumeric)mod.funcall("-", other); } return mod; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return RubyFloat.newFloat(getRuby(), getDoubleValue()).round(); }
return RubyFloat.newFloat(getRuby(), getDoubleValue()).round(); }
public RubyInteger round() { return RubyFloat.newFloat(getRuby(), getDoubleValue()).round(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
String str = arg.getValue().trim(); double d = 0.0; int pos = str.length(); for (int i = 0; i < pos; i++) { if ("0123456789eE+-.".indexOf(str.charAt(i)) == -1) { pos = i + 1; break; } } for (; pos > 0; pos--) { try { d = Double.parseDouble(str.substring(0, pos)); } catch (NumberFormatException ex) { continue; } break; } return new RubyFloat(ruby, d); }
String str = arg.getValue().trim(); double d = 0.0; int pos = str.length(); for (int i = 0; i < pos; i++) { if ("0123456789eE+-.".indexOf(str.charAt(i)) == -1) { pos = i + 1; break; } } for (; pos > 0; pos--) { try { d = Double.parseDouble(str.substring(0, pos)); } catch (NumberFormatException ex) { continue; } break; } return new RubyFloat(ruby, d); }
public static RubyFloat str2fnum(Ruby ruby, RubyString arg) { String str = arg.getValue().trim(); double d = 0.0; int pos = str.length(); for (int i = 0; i < pos; i++) { if ("0123456789eE+-.".indexOf(str.charAt(i)) == -1) { pos = i + 1; break; } } for (; pos > 0; pos--) { try { d = Double.parseDouble(str.substring(0, pos)); } catch (NumberFormatException ex) { continue; } break; } return new RubyFloat(ruby, d); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
StringBuffer sbuf = new StringBuffer(str.getValue().trim()); if (sbuf.length() == 0) { return RubyFixnum.zero(ruby); } int pos = 0; int radix = (base != 0) ? base : 10; boolean digitsFound = false; if (sbuf.charAt(pos) == '-') { pos++; } else if (sbuf.charAt(pos) == '+') { sbuf.deleteCharAt(pos); } if (pos == sbuf.length()) { return RubyFixnum.zero(ruby); } if (sbuf.charAt(pos) == '0') { sbuf.deleteCharAt(pos); if (pos == sbuf.length()) { return RubyFixnum.zero(ruby); } if (sbuf.charAt(pos) == 'x' || sbuf.charAt(pos) == 'X') { if (base == 0 || base == 16) { radix = 16; sbuf.deleteCharAt(pos); } } else if (sbuf.charAt(pos) == 'b' || sbuf.charAt(pos) == 'B') { if (base == 0 || base == 2) { radix = 2; sbuf.deleteCharAt(pos); } } else { radix = (base == 0) ? 8 : base; } } while (pos < sbuf.length()) { if (sbuf.charAt(pos) == '_') { sbuf.deleteCharAt(pos); } else if (Character.digit(sbuf.charAt(pos), radix) != -1) { digitsFound = true; pos++; } else { break; } } if (!digitsFound) { return RubyFixnum.zero(ruby); } try { long l = Long.parseLong(sbuf.substring(0, pos), radix); return RubyFixnum.newFixnum(ruby, l); } catch (NumberFormatException ex) { BigInteger bi = new BigInteger(sbuf.substring(0, pos), radix); return new RubyBignum(ruby, bi); } }
StringBuffer sbuf = new StringBuffer(str.getValue().trim()); if (sbuf.length() == 0) { return RubyFixnum.zero(ruby); } int pos = 0; int radix = (base != 0) ? base : 10; boolean digitsFound = false; if (sbuf.charAt(pos) == '-') { pos++; } else if (sbuf.charAt(pos) == '+') { sbuf.deleteCharAt(pos); } if (pos == sbuf.length()) { return RubyFixnum.zero(ruby); } if (sbuf.charAt(pos) == '0') { sbuf.deleteCharAt(pos); if (pos == sbuf.length()) { return RubyFixnum.zero(ruby); } if (sbuf.charAt(pos) == 'x' || sbuf.charAt(pos) == 'X') { if (base == 0 || base == 16) { radix = 16; sbuf.deleteCharAt(pos); } } else if (sbuf.charAt(pos) == 'b' || sbuf.charAt(pos) == 'B') { if (base == 0 || base == 2) { radix = 2; sbuf.deleteCharAt(pos); } } else { radix = (base == 0) ? 8 : base; } } while (pos < sbuf.length()) { if (sbuf.charAt(pos) == '_') { sbuf.deleteCharAt(pos); } else if (Character.digit(sbuf.charAt(pos), radix) != -1) { digitsFound = true; pos++; } else { break; } } if (!digitsFound) { return RubyFixnum.zero(ruby); } try { long l = Long.parseLong(sbuf.substring(0, pos), radix); return RubyFixnum.newFixnum(ruby, l); } catch (NumberFormatException ex) { BigInteger bi = new BigInteger(sbuf.substring(0, pos), radix); return new RubyBignum(ruby, bi); } }
public static RubyInteger str2inum(Ruby ruby, RubyString str, int base) { StringBuffer sbuf = new StringBuffer(str.getValue().trim()); if (sbuf.length() == 0) { return RubyFixnum.zero(ruby); } int pos = 0; int radix = (base != 0) ? base : 10; boolean digitsFound = false; if (sbuf.charAt(pos) == '-') { pos++; } else if (sbuf.charAt(pos) == '+') { sbuf.deleteCharAt(pos); } if (pos == sbuf.length()) { return RubyFixnum.zero(ruby); } if (sbuf.charAt(pos) == '0') { sbuf.deleteCharAt(pos); if (pos == sbuf.length()) { return RubyFixnum.zero(ruby); } if (sbuf.charAt(pos) == 'x' || sbuf.charAt(pos) == 'X') { if (base == 0 || base == 16) { radix = 16; sbuf.deleteCharAt(pos); } } else if (sbuf.charAt(pos) == 'b' || sbuf.charAt(pos) == 'B') { if (base == 0 || base == 2) { radix = 2; sbuf.deleteCharAt(pos); } } else { radix = (base == 0) ? 8 : base; } } while (pos < sbuf.length()) { if (sbuf.charAt(pos) == '_') { sbuf.deleteCharAt(pos); } else if (Character.digit(sbuf.charAt(pos), radix) != -1) { digitsFound = true; pos++; } else { break; } } if (!digitsFound) { return RubyFixnum.zero(ruby); } try { long l = Long.parseLong(sbuf.substring(0, pos), radix); return RubyFixnum.newFixnum(ruby, l); } catch (NumberFormatException ex) { BigInteger bi = new BigInteger(sbuf.substring(0, pos), radix); return new RubyBignum(ruby, bi); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return RubyFloat.newFloat(getRuby(), getDoubleValue()).truncate(); }
return RubyFloat.newFloat(getRuby(), getDoubleValue()).truncate(); }
public RubyInteger truncate() { return RubyFloat.newFloat(getRuby(), getDoubleValue()).truncate(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return equal(RubyFixnum.zero(getRuby())); }
return equal(RubyFixnum.zero(getRuby())); }
public RubyBoolean zero_p() { return equal(RubyFixnum.zero(getRuby())); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
currentLoader = new ThumbnailLoader(component, browser.getImages());
currentLoader = new ThumbnailLoader(component, images);
void fireThumbnailLoading() { state = HiViewer.LOADING_THUMBNAILS; currentLoader = new ThumbnailLoader(component, browser.getImages()); currentLoader.load(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e123367d3b024349b8d299ef57fb0e01d9f51942/HiViewerModel.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerModel.java
System.err.println(footprint.getWidth()+","+footprint.getWidth()); System.err.println("dim:"+width+","+height);
public void setZoomLevel(double zoomLevel) { // error condition if(zoomLevel <= 0) { return; } if(scaleToShow) return; Dimension dim = getSize(); double width = dim.getWidth(); double height = dim.getHeight(); double scale = getCamera().getViewScale(); double viewWidth = getCamera().getViewBounds().getWidth(); double viewHeight = getCamera().getViewBounds().getHeight(); double viewCenterX = getCamera().getViewBounds().getCenterX(); double viewCenterY = getCamera().getViewBounds().getCenterY(); double scaleX = 0; double scaleY = 0; System.err.println(footprint.getWidth()+","+footprint.getWidth()); System.err.println("dim:"+width+","+height); if(width/zoomLevel < footprint.getWidth()) { scaleX = viewCenterX; if((viewCenterX - (scale/zoomLevel)*viewWidth/2) < 0) { scaleX = 0; } } if(height/zoomLevel < footprint.getHeight()) { scaleY = viewCenterY; if((viewCenterY - (scale/zoomLevel)*viewWidth/2) < 0) { scaleY = 0; } } System.err.println("scaleX="+scaleX+", scaleY="+scaleY); getCamera().scaleViewAboutPoint(zoomLevel/scale,scaleX,scaleY); updateConstraints(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserView.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserView.java
if((viewCenterY - (scale/zoomLevel)*viewWidth/2) < 0)
if((viewCenterY - (scale/zoomLevel)*viewHeight/2) < 0)
public void setZoomLevel(double zoomLevel) { // error condition if(zoomLevel <= 0) { return; } if(scaleToShow) return; Dimension dim = getSize(); double width = dim.getWidth(); double height = dim.getHeight(); double scale = getCamera().getViewScale(); double viewWidth = getCamera().getViewBounds().getWidth(); double viewHeight = getCamera().getViewBounds().getHeight(); double viewCenterX = getCamera().getViewBounds().getCenterX(); double viewCenterY = getCamera().getViewBounds().getCenterY(); double scaleX = 0; double scaleY = 0; System.err.println(footprint.getWidth()+","+footprint.getWidth()); System.err.println("dim:"+width+","+height); if(width/zoomLevel < footprint.getWidth()) { scaleX = viewCenterX; if((viewCenterX - (scale/zoomLevel)*viewWidth/2) < 0) { scaleX = 0; } } if(height/zoomLevel < footprint.getHeight()) { scaleY = viewCenterY; if((viewCenterY - (scale/zoomLevel)*viewWidth/2) < 0) { scaleY = 0; } } System.err.println("scaleX="+scaleX+", scaleY="+scaleY); getCamera().scaleViewAboutPoint(zoomLevel/scale,scaleX,scaleY); updateConstraints(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserView.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserView.java
public void updateConstraints() { Dimension dimension = getSize(); double width = dimension.getWidth(); double height = dimension.getHeight(); double xRatio = width / footprint.getWidth(); double yRatio = height / footprint.getHeight(); if(Math.min(xRatio,yRatio) != minZoomLevel) { minZoomLevel = Math.min(xRatio,yRatio); for(Iterator iter = zoomParamListeners.iterator(); iter.hasNext();) { ZoomParamListener listener = (ZoomParamListener)iter.next(); listener.minZoomLevelChanged(minZoomLevel); } } // for some reason, setting setViewScale(0) screws things up // in a big way. if(scaleToShow) { if((xRatio < 1 || yRatio < 1) && (xRatio != 0 && yRatio != 0)) { double min = Math.min(xRatio,yRatio); getCamera().setViewScale(min); } else { getCamera().setViewScale(1); } } boundCameraPosition(); double viewScale = getCamera().getViewScale(); backgroundNode.setBounds(0,0,width/viewScale,height/viewScale); // update things for(Iterator iter = regionSensitive.iterator(); iter.hasNext();) { RegionSensitive rs = (RegionSensitive)iter.next(); rs.setActiveRegion(footprint); } System.err.println(footprint); System.err.println("Dim: "+width+","+height); overlayCamera.cameraResized(new Rectangle2D.Double(0,0,width,height)); for(Iterator iter = zoomParamListeners.iterator(); iter.hasNext();) { ZoomParamListener listener = (ZoomParamListener)iter.next(); listener.zoomLevelChanged(viewScale); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserView.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserView.java
System.err.println(footprint); System.err.println("Dim: "+width+","+height);
public void updateConstraints() { Dimension dimension = getSize(); double width = dimension.getWidth(); double height = dimension.getHeight(); double xRatio = width / footprint.getWidth(); double yRatio = height / footprint.getHeight(); if(Math.min(xRatio,yRatio) != minZoomLevel) { minZoomLevel = Math.min(xRatio,yRatio); for(Iterator iter = zoomParamListeners.iterator(); iter.hasNext();) { ZoomParamListener listener = (ZoomParamListener)iter.next(); listener.minZoomLevelChanged(minZoomLevel); } } // for some reason, setting setViewScale(0) screws things up // in a big way. if(scaleToShow) { if((xRatio < 1 || yRatio < 1) && (xRatio != 0 && yRatio != 0)) { double min = Math.min(xRatio,yRatio); getCamera().setViewScale(min); } else { getCamera().setViewScale(1); } } boundCameraPosition(); double viewScale = getCamera().getViewScale(); backgroundNode.setBounds(0,0,width/viewScale,height/viewScale); // update things for(Iterator iter = regionSensitive.iterator(); iter.hasNext();) { RegionSensitive rs = (RegionSensitive)iter.next(); rs.setActiveRegion(footprint); } System.err.println(footprint); System.err.println("Dim: "+width+","+height); overlayCamera.cameraResized(new Rectangle2D.Double(0,0,width,height)); for(Iterator iter = zoomParamListeners.iterator(); iter.hasNext();) { ZoomParamListener listener = (ZoomParamListener)iter.next(); listener.zoomLevelChanged(viewScale); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserView.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserView.java
{ super(control.getReferenceFrame(), "Image inspector"); init(control, canvas, magFactor); setJMenuBar(menuBar); buildGUI();
{ super(control.getReferenceFrame(), "Image inspector"); init(control, canvas, magFactor); setJMenuBar(menuBar); buildGUI();
public ImageInspector(ViewerCtrl control, ImageCanvas canvas, double magFactor) { super(control.getReferenceFrame(), "Image inspector"); init(control, canvas, magFactor); setJMenuBar(menuBar); buildGUI(); pack(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java
}
}
public ImageInspector(ViewerCtrl control, ImageCanvas canvas, double magFactor) { super(control.getReferenceFrame(), "Image inspector"); init(control, canvas, magFactor); setJMenuBar(menuBar); buildGUI(); pack(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java
{
{
private void buildGUI() { setResizable(false); getContentPane().add(toolBar, BorderLayout.NORTH); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java
getContentPane().add(toolBar, BorderLayout.NORTH); }
getContentPane().add(toolBar, BorderLayout.NORTH); }
private void buildGUI() { setResizable(false); getContentPane().add(toolBar, BorderLayout.NORTH); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java
{ Registry reg = control.getRegistry(); manager = new ImageInspectorManager(this, control, magFactor);
{ Registry reg = control.getRegistry(); manager = new ImageInspectorManager(this, control, magFactor);
private void init(ViewerCtrl control, ImageCanvas canvas, double magFactor) { Registry reg = control.getRegistry(); manager = new ImageInspectorManager(this, control, magFactor); BufferedImage img = control.getBufferedImage(); manager.setImageDimension(img.getWidth(), img.getHeight()); manager.setCanvas(canvas); menuBar = new MenuBar(manager, magFactor); toolBar = new ToolBar(reg, manager, magFactor); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java
manager.setImageDimension(img.getWidth(), img.getHeight());
manager.setImageDimension(img.getWidth(), img.getHeight());
private void init(ViewerCtrl control, ImageCanvas canvas, double magFactor) { Registry reg = control.getRegistry(); manager = new ImageInspectorManager(this, control, magFactor); BufferedImage img = control.getBufferedImage(); manager.setImageDimension(img.getWidth(), img.getHeight()); manager.setCanvas(canvas); menuBar = new MenuBar(manager, magFactor); toolBar = new ToolBar(reg, manager, magFactor); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java
menuBar = new MenuBar(manager, magFactor); toolBar = new ToolBar(reg, manager, magFactor); }
menuBar = new MenuBar(manager, magFactor); toolBar = new ToolBar(reg, manager, magFactor); }
private void init(ViewerCtrl control, ImageCanvas canvas, double magFactor) { Registry reg = control.getRegistry(); manager = new ImageInspectorManager(this, control, magFactor); BufferedImage img = control.getBufferedImage(); manager.setImageDimension(img.getWidth(), img.getHeight()); manager.setCanvas(canvas); menuBar = new MenuBar(manager, magFactor); toolBar = new ToolBar(reg, manager, magFactor); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java
this.outStream = new BufferedOutputStream(new FileOutputStream(file, append));
this.outStream = new BufferedOutputStream(new FileOutputStream(file.getAbsolutePath(), append));
protected void openInternal(String path, String mode) { this.path = path; setMode(mode); File file = new File(path); try { if (isReadable()) { this.inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); } if (isWriteable()) { this.outStream = new BufferedOutputStream(new FileOutputStream(file, append)); } } catch (IOException ioExcptn) { throw new IOError(getRuby(), ioExcptn.getMessage()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/263d8797aa5be7bc604097d1d483cf474b827c91/RubyFile.java/buggy/org/jruby/RubyFile.java
test that row is gone.
fail("test that row is gone.");
public void testAndHeresHowWeUnlinkThings() throws Exception { // Method 1: saveImage(); List updated = unlinkImage(); iUpdate.saveCollection( updated ); test that row is gone. // Method 2: saveImage(); updated = unlinkImage(); iPojos.udpateDataObjects( (IObject[]) updated.toArray(new IObject[updated.size()]), null); // Method 3: Dataset d = new Dataset(); Project p = new Project(); p = (Project) iPojos.createDataObject( p, null ); d = (Dataset) iPojos.createDataObject( d, null ); ProjectDatasetLink link = new ProjectDatasetLink(); link.setParent( p ); link.setChild( c ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/219ccffc5a6aec003f33d7752f571d33549cce00/PojosServiceTest.java/clean/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java
link.setChild( c );
link.setChild( d );
public void testAndHeresHowWeUnlinkThings() throws Exception { // Method 1: saveImage(); List updated = unlinkImage(); iUpdate.saveCollection( updated ); test that row is gone. // Method 2: saveImage(); updated = unlinkImage(); iPojos.udpateDataObjects( (IObject[]) updated.toArray(new IObject[updated.size()]), null); // Method 3: Dataset d = new Dataset(); Project p = new Project(); p = (Project) iPojos.createDataObject( p, null ); d = (Dataset) iPojos.createDataObject( d, null ); ProjectDatasetLink link = new ProjectDatasetLink(); link.setParent( p ); link.setChild( c ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/219ccffc5a6aec003f33d7752f571d33549cce00/PojosServiceTest.java/clean/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java
console.setLayout(new BorderLayout());
console.getContentPane().setLayout(new BorderLayout());
public static void main(String[] args) { final IRBConsole console = new IRBConsole("JRuby IRB Console"); PipedInputStream pipeIn = new PipedInputStream(); console.setLayout(new BorderLayout()); console.setSize(700, 600); JEditorPane text = new JTextPane(); text.setMargin(new Insets(8,8,8,8)); text.setCaretColor(new Color(0xa4, 0x00, 0x00)); text.setBackground(new Color(0xf2, 0xf2, 0xf2)); text.setForeground(new Color(0xa4, 0x00, 0x00)); Font font = console.findFont("Monospaced", Font.PLAIN, 14, new String[] {"Monaco", "Andale Mono"}); text.setFont(font); JScrollPane pane = new JScrollPane(); pane.setViewportView(text); pane.setBorder(BorderFactory.createLineBorder(Color.darkGray)); console.add(pane); console.validate(); TextAreaReadline tar = new TextAreaReadline(text, " Welcome to the JRuby IRB Console \n\n"); final IRuby runtime = Ruby.newInstance(pipeIn, new PrintStream(tar), new PrintStream(tar), false); IRubyObject argumentArray = runtime.newArray(JavaUtil.convertJavaArrayToRuby(runtime, args)); runtime.defineGlobalConstant("ARGV", argumentArray); runtime.getGlobalVariables().defineReadonly("$*", new ValueAccessor(argumentArray)); runtime.getGlobalVariables().defineReadonly("$$", new ValueAccessor(runtime.newFixnum(System.identityHashCode(runtime)))); runtime.getLoadService().init(new ArrayList()); tar.hookIntoRuntime(runtime); Thread t2 = new Thread() { public void run() { console.setVisible(true); runtime.evalScript("require 'irb'; require 'irb/completion'; IRB.start"); } }; t2.start(); try { t2.join(); } catch (InterruptedException ie) { // ignore } System.exit(0); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a757121012744f77b135696456ba9a8170135244/IRBConsole.java/buggy/src/org/jruby/demo/IRBConsole.java
console.add(pane);
console.getContentPane().add(pane);
public static void main(String[] args) { final IRBConsole console = new IRBConsole("JRuby IRB Console"); PipedInputStream pipeIn = new PipedInputStream(); console.setLayout(new BorderLayout()); console.setSize(700, 600); JEditorPane text = new JTextPane(); text.setMargin(new Insets(8,8,8,8)); text.setCaretColor(new Color(0xa4, 0x00, 0x00)); text.setBackground(new Color(0xf2, 0xf2, 0xf2)); text.setForeground(new Color(0xa4, 0x00, 0x00)); Font font = console.findFont("Monospaced", Font.PLAIN, 14, new String[] {"Monaco", "Andale Mono"}); text.setFont(font); JScrollPane pane = new JScrollPane(); pane.setViewportView(text); pane.setBorder(BorderFactory.createLineBorder(Color.darkGray)); console.add(pane); console.validate(); TextAreaReadline tar = new TextAreaReadline(text, " Welcome to the JRuby IRB Console \n\n"); final IRuby runtime = Ruby.newInstance(pipeIn, new PrintStream(tar), new PrintStream(tar), false); IRubyObject argumentArray = runtime.newArray(JavaUtil.convertJavaArrayToRuby(runtime, args)); runtime.defineGlobalConstant("ARGV", argumentArray); runtime.getGlobalVariables().defineReadonly("$*", new ValueAccessor(argumentArray)); runtime.getGlobalVariables().defineReadonly("$$", new ValueAccessor(runtime.newFixnum(System.identityHashCode(runtime)))); runtime.getLoadService().init(new ArrayList()); tar.hookIntoRuntime(runtime); Thread t2 = new Thread() { public void run() { console.setVisible(true); runtime.evalScript("require 'irb'; require 'irb/completion'; IRB.start"); } }; t2.start(); try { t2.join(); } catch (InterruptedException ie) { // ignore } System.exit(0); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a757121012744f77b135696456ba9a8170135244/IRBConsole.java/buggy/src/org/jruby/demo/IRBConsole.java
for (int i = 0, len = getLength(); i < len; i++) { if (obj.callMethod(context, "==", entry(i)).isTrue()) {
int len = getLength(); for (int i = 0; i < len; i++) { if (entry(i).callMethod(context, "==", obj).isTrue()) {
public IRubyObject index(IRubyObject obj) { ThreadContext context = getRuntime().getCurrentContext(); for (int i = 0, len = getLength(); i < len; i++) { if (obj.callMethod(context, "==", entry(i)).isTrue()) { return getRuntime().newFixnum(i); } } return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1e0d087fdeb07557be3a064979fee7e0534c215f/RubyArray.java/buggy/src/org/jruby/RubyArray.java
if (obj.callMethod(context, "==", entry(i)).isTrue()) {
if (entry(i).callMethod(context, "==", obj).isTrue()) {
public IRubyObject rindex(IRubyObject obj) { ThreadContext context = getRuntime().getCurrentContext(); for (int i = getLength() - 1; i >= 0; i--) { if (obj.callMethod(context, "==", entry(i)).isTrue()) { return getRuntime().newFixnum(i); } } return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1e0d087fdeb07557be3a064979fee7e0534c215f/RubyArray.java/buggy/src/org/jruby/RubyArray.java
if (argCount(args, 1, 2) == 2) { int beg = RubyNumeric.fix2int(args[0]); int len = RubyNumeric.fix2int(args[1]); return substr(beg, len); } if (args[0] instanceof RubyFixnum) { int idx = RubyNumeric.fix2int(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuntime().getNil(); } return RubyFixnum.newFixnum(getRuntime(), getValue().charAt(idx)); } if (args[0] instanceof RubyRegexp) { if (RubyRegexp.regexpValue(args[0]).search(this, 0) >= 0) { return RubyRegexp.last_match(getRuntime().getBackref()); } return getRuntime().getNil(); } if (args[0] instanceof RubyString) { if (getValue().indexOf(stringValue(args[0]).getValue()) != -1) { return args[0]; } return getRuntime().getNil(); } if (args[0] instanceof RubyRange) { long[] begLen = ((RubyRange) args[0]).getBeginLength(getValue().length(), true, false); if (begLen == null) { return getRuntime().getNil(); } return substr((int) begLen[0], (int) begLen[1]); } int idx = (int) RubyNumeric.num2long(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuntime().getNil(); } return RubyFixnum.newFixnum(getRuntime(), getValue().charAt(idx));
try { return arefWithErrors(args); } catch (IndexError e) { } catch (RangeError e) { } return getRuntime().getNil();
public IRubyObject aref(IRubyObject[] args) { if (argCount(args, 1, 2) == 2) { int beg = RubyNumeric.fix2int(args[0]); int len = RubyNumeric.fix2int(args[1]); return substr(beg, len); } if (args[0] instanceof RubyFixnum) { int idx = RubyNumeric.fix2int(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuntime().getNil(); } return RubyFixnum.newFixnum(getRuntime(), getValue().charAt(idx)); } if (args[0] instanceof RubyRegexp) { if (RubyRegexp.regexpValue(args[0]).search(this, 0) >= 0) { return RubyRegexp.last_match(getRuntime().getBackref()); } return getRuntime().getNil(); } if (args[0] instanceof RubyString) { if (getValue().indexOf(stringValue(args[0]).getValue()) != -1) { return args[0]; } return getRuntime().getNil(); } if (args[0] instanceof RubyRange) { long[] begLen = ((RubyRange) args[0]).getBeginLength(getValue().length(), true, false); if (begLen == null) { return getRuntime().getNil(); } return substr((int) begLen[0], (int) begLen[1]); } int idx = (int) RubyNumeric.num2long(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuntime().getNil(); } return RubyFixnum.newFixnum(getRuntime(), getValue().charAt(idx)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/RubyString.java/clean/src/org/jruby/RubyString.java
/* use Java implementatiom */ return getValue().compareTo(other.getValue());
int value = getValue().compareTo(other.getValue()); return value < 0 ? -1 : value > 0 ? 1 : 0;
public int cmp(RubyString other) { /* use Java implementatiom */ return getValue().compareTo(other.getValue()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/RubyString.java/clean/src/org/jruby/RubyString.java
IRubyObject result = aref(args);
IRubyObject result = arefWithErrors(args);
public IRubyObject slice_bang(IRubyObject[] args) { int argc = argCount(args, 1, 2); IRubyObject[] newArgs = new IRubyObject[argc + 1]; newArgs[0] = args[0]; if (argc > 1) { newArgs[1] = args[1]; } newArgs[argc] = newString(""); IRubyObject result = aref(args); aset(newArgs); return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/RubyString.java/clean/src/org/jruby/RubyString.java
RubyString newString = newString(getValue()); return newString.swapcase_bang();
RubyString newString = newString(getValue()); IRubyObject swappedString = newString.swapcase_bang(); if (swappedString.isNil() == true) { return newString; } return (RubyString) swappedString;
public RubyString swapcase() { RubyString newString = newString(getValue()); return newString.swapcase_bang(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/RubyString.java/clean/src/org/jruby/RubyString.java
public RubyString swapcase_bang() {
public IRubyObject swapcase_bang() {
public RubyString swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { sb.append(Character.toUpperCase(chars[i])); } else { sb.append(Character.toLowerCase(chars[i])); } } setValue(getValue().toLowerCase()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/RubyString.java/clean/src/org/jruby/RubyString.java
setValue(getValue().toLowerCase());
if (changesMade) { setValue(sb.toString()); return this; }
public RubyString swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { sb.append(Character.toUpperCase(chars[i])); } else { sb.append(Character.toLowerCase(chars[i])); } } setValue(getValue().toLowerCase()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/RubyString.java/clean/src/org/jruby/RubyString.java
return this;
return runtime.getNil();
public RubyString swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { sb.append(Character.toUpperCase(chars[i])); } else { sb.append(Character.toLowerCase(chars[i])); } } setValue(getValue().toLowerCase()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/RubyString.java/clean/src/org/jruby/RubyString.java
runInterpreter(args[i], "command line " + i);
runInterpreter(args[i], "command line " + i, new String[0]);
public static void main (String args[]) { System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); // Benchmark long now = -1; if (args.length == 0) { printUsage(); } else { int lenArg = args.length; for (int i = 0; i < lenArg; i++) { if (args[i].equals("-h") || args[i].equals("-help")) { printUsage(); } else if (args[i].equals("-e")) { if (i++ >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -e must be followed by an expression to evaluate"); printUsage(); } else { runInterpreter(args[i], "command line " + i); } } else if (args[i].equals("-b")) { // Benchmark now = System.currentTimeMillis(); } else { runInterpreterOnFile(args[i]); } } } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cf644c556d410c47305ebeba5728efa25f7756dc/Main.java/clean/org/jruby/Main.java
runInterpreterOnFile(args[i]);
String[] argv = new String[lenArg - i - 1]; System.arraycopy(args, i + 1, argv, 0, argv.length); runInterpreterOnFile(args[i], argv); break;
public static void main (String args[]) { System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); // Benchmark long now = -1; if (args.length == 0) { printUsage(); } else { int lenArg = args.length; for (int i = 0; i < lenArg; i++) { if (args[i].equals("-h") || args[i].equals("-help")) { printUsage(); } else if (args[i].equals("-e")) { if (i++ >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -e must be followed by an expression to evaluate"); printUsage(); } else { runInterpreter(args[i], "command line " + i); } } else if (args[i].equals("-b")) { // Benchmark now = System.currentTimeMillis(); } else { runInterpreterOnFile(args[i]); } } } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cf644c556d410c47305ebeba5728efa25f7756dc/Main.java/clean/org/jruby/Main.java
protected static void runInterpreter(String iString2Eval, String iFileName) {
protected static void runInterpreter(String iString2Eval, String iFileName, String[] args) {
protected static void runInterpreter(String iString2Eval, String iFileName) { // Initialize Runtime Ruby ruby = new Ruby(); // Parse and interpret file RubyString rs = RubyString.m_newString(ruby, iString2Eval); // New Version // // ruby.getInterpreter().eval(ruby.getClasses().getObjectClass(), ruby.getRubyParser().compileString(iFileName, rs, 0)); // Old Version // // Initialize Parser parse p = new parse(ruby); ruby.getInterpreter().eval(ruby.getClasses().getObjectClass(), p.rb_compile_string(iFileName, rs, 0)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cf644c556d410c47305ebeba5728efa25f7756dc/Main.java/clean/org/jruby/Main.java
ruby.getInterpreter().eval(ruby.getClasses().getObjectClass(), p.rb_compile_string(iFileName, rs, 0));
ruby.getInterpreter().eval(ruby.getRubyTopSelf(), p.rb_compile_string(iFileName, rs, 0));
protected static void runInterpreter(String iString2Eval, String iFileName) { // Initialize Runtime Ruby ruby = new Ruby(); // Parse and interpret file RubyString rs = RubyString.m_newString(ruby, iString2Eval); // New Version // // ruby.getInterpreter().eval(ruby.getClasses().getObjectClass(), ruby.getRubyParser().compileString(iFileName, rs, 0)); // Old Version // // Initialize Parser parse p = new parse(ruby); ruby.getInterpreter().eval(ruby.getClasses().getObjectClass(), p.rb_compile_string(iFileName, rs, 0)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cf644c556d410c47305ebeba5728efa25f7756dc/Main.java/clean/org/jruby/Main.java
protected static void runInterpreterOnFile(String fileName) {
protected static void runInterpreterOnFile(String fileName, String[] args) {
protected static void runInterpreterOnFile(String fileName) { File rubyFile = new File(fileName); if (!rubyFile.canRead()) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); } else { try { StringBuffer sb = new StringBuffer((int)rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); runInterpreter(sb.toString(), fileName); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cf644c556d410c47305ebeba5728efa25f7756dc/Main.java/clean/org/jruby/Main.java
runInterpreter(sb.toString(), fileName);
runInterpreter(sb.toString(), fileName, args);
protected static void runInterpreterOnFile(String fileName) { File rubyFile = new File(fileName); if (!rubyFile.canRead()) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); } else { try { StringBuffer sb = new StringBuffer((int)rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); runInterpreter(sb.toString(), fileName); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cf644c556d410c47305ebeba5728efa25f7756dc/Main.java/clean/org/jruby/Main.java
item.setCacheEnabled(false);
private UIComponent getPreviewPanel() { String ref = ARTICLE_ITEM_BEAN_ID + "."; WFComponentSelector cs = new WFComponentSelector(); cs.setId(COMPONENT_SELECTOR_ID); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(1); p.setId(NO_ARTICLE_ID); p.getChildren().add(WFResourceUtil.getResourceUtilArticle().getHeaderTextVB("no_article_selected")); cs.add(p); ArticleItemViewer item = new ArticleItemViewer(); item.setId(ARTICLE_VIEW_ID); WFUtil.setValueBinding(item, "author", ref+"author"); WFUtil.setValueBinding(item, "creation_date", ref+"creationDate"); WFUtil.setValueBinding(item, "headline", ref+"headline"); WFUtil.setValueBinding(item, "teaser", ref+"teaser"); WFUtil.setValueBinding(item, "body", ref+"body"); cs.add(item); cs.setSelectedId(NO_ARTICLE_ID, true); return cs; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/ArticlePreview.java/clean/src/java/com/idega/block/article/component/ArticlePreview.java
String headline = WFUtil.getStringValue(ARTICLE_ITEM_BEAN_ID, "headline");
ArticleItemBean articleBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String headline = articleBean.getHeadline();
private void selectComponent() { WFComponentSelector cs = (WFComponentSelector) findComponent(COMPONENT_SELECTOR_ID); String headline = WFUtil.getStringValue(ARTICLE_ITEM_BEAN_ID, "headline"); if (cs != null) { if (headline == null || headline.length() == 0) { cs.setSelectedId(NO_ARTICLE_ID, true); cs.setSelectedId(ARTICLE_VIEW_ID, false); }else { cs.setSelectedId(NO_ARTICLE_ID, false); cs.setSelectedId(ARTICLE_VIEW_ID, true); } }else { cs.setSelectedId(NO_ARTICLE_ID, false); cs.setSelectedId(ARTICLE_VIEW_ID, true); System.out.println("Could not find the Component selector!!!"); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/18f3f17c7d7e21ff910a232da3187e72e9de9847/ArticlePreview.java/clean/src/java/com/idega/block/article/component/ArticlePreview.java
fw.reset(out);
if (fw != null) { fw.reset(out); return fw; }
public static FastWriter getInstance(OutputStream out, String encoding) throws UnsupportedEncodingException { FastWriter fw = null; SimpleStack ss = (SimpleStack) _writerCache.get(encoding); if (ss != null) { fw = (FastWriter) ss.pop(); fw.reset(out); } if (fw == null) { fw = new FastWriter(out,encoding); } return fw; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/cb054e2b23a228172377a547332c169ee70338d4/FastWriter.java/clean/webmacro/src/org/webmacro/FastWriter.java
if (fw == null) { fw = new FastWriter(out,encoding); } return fw;
return new FastWriter(out,encoding);
public static FastWriter getInstance(OutputStream out, String encoding) throws UnsupportedEncodingException { FastWriter fw = null; SimpleStack ss = (SimpleStack) _writerCache.get(encoding); if (ss != null) { fw = (FastWriter) ss.pop(); fw.reset(out); } if (fw == null) { fw = new FastWriter(out,encoding); } return fw; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/cb054e2b23a228172377a547332c169ee70338d4/FastWriter.java/clean/webmacro/src/org/webmacro/FastWriter.java
} else if (obj instanceof HashMap) {
} else if (obj instanceof Map) {
Object clean(Object obj) { //TODO push OMEModel down into all calls if (null != obj) { if (obj instanceof OMEModel) { daoUtils.clean((OMEModel) obj); } else if (obj instanceof Set) { daoUtils.clean((Set) obj); } else if (obj instanceof HashMap) { //daoUtils.clean(((Map) obj).keySet());TODO here only integers, but... daoUtils.clean(new HashSet(((Map) obj).values())); } else { String msg = "Instances of " + obj.getClass().getName() + " not supported."; throw new IllegalArgumentException(msg); } } return obj; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java
return sortDatasetAnnotations(result);
return (Map) clean(sortDatasetAnnotations(result));
public Map findDatasetAnnotationsForExperimenter(final Set arg0, final int arg1) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashMap(); } List result = annotationDao.findDataListAnnotationForExperimenter(arg0, arg1); return sortDatasetAnnotations(result); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java
return RubyArray.create(this, new IRubyObject[] { begin(index), end(index)});
return RubyArray.newArray(getRuntime(), new IRubyObject[] { begin(index), end(index)});
public IRubyObject offset(RubyFixnum index) { if (outOfBounds(index)) { return getRuntime().getNil(); } return RubyArray.create(this, new IRubyObject[] { begin(index), end(index)}); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3acff782b00a5f6892fe6bd44e0665cc6194f9aa/RubyMatchData.java/clean/org/jruby/RubyMatchData.java
assertFalse(none.isGranted(USER, USE));
public void testCopyConstructor() throws Exception { Permissions p1 = new Permissions(); p1.revoke(GROUP, WRITE); assertFalse(p1.isGranted(GROUP, WRITE)); Permissions p2 = new Permissions(p1); assertFalse(p2.isGranted(GROUP, WRITE)); Permissions none = new Permissions(Permissions.EMPTY); assertFalse(none.isGranted(USER, READ)); assertFalse(none.isGranted(USER, WRITE)); assertFalse(none.isGranted(USER, USE)); assertFalse(none.isGranted(GROUP, READ)); assertFalse(none.isGranted(GROUP, WRITE)); assertFalse(none.isGranted(GROUP, USE)); assertFalse(none.isGranted(WORLD, READ)); assertFalse(none.isGranted(WORLD, WRITE)); assertFalse(none.isGranted(WORLD, USE)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
assertFalse(none.isGranted(GROUP, USE));
public void testCopyConstructor() throws Exception { Permissions p1 = new Permissions(); p1.revoke(GROUP, WRITE); assertFalse(p1.isGranted(GROUP, WRITE)); Permissions p2 = new Permissions(p1); assertFalse(p2.isGranted(GROUP, WRITE)); Permissions none = new Permissions(Permissions.EMPTY); assertFalse(none.isGranted(USER, READ)); assertFalse(none.isGranted(USER, WRITE)); assertFalse(none.isGranted(USER, USE)); assertFalse(none.isGranted(GROUP, READ)); assertFalse(none.isGranted(GROUP, WRITE)); assertFalse(none.isGranted(GROUP, USE)); assertFalse(none.isGranted(WORLD, READ)); assertFalse(none.isGranted(WORLD, WRITE)); assertFalse(none.isGranted(WORLD, USE)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
assertFalse(none.isGranted(WORLD, USE));
public void testCopyConstructor() throws Exception { Permissions p1 = new Permissions(); p1.revoke(GROUP, WRITE); assertFalse(p1.isGranted(GROUP, WRITE)); Permissions p2 = new Permissions(p1); assertFalse(p2.isGranted(GROUP, WRITE)); Permissions none = new Permissions(Permissions.EMPTY); assertFalse(none.isGranted(USER, READ)); assertFalse(none.isGranted(USER, WRITE)); assertFalse(none.isGranted(USER, USE)); assertFalse(none.isGranted(GROUP, READ)); assertFalse(none.isGranted(GROUP, WRITE)); assertFalse(none.isGranted(GROUP, USE)); assertFalse(none.isGranted(WORLD, READ)); assertFalse(none.isGranted(WORLD, WRITE)); assertFalse(none.isGranted(WORLD, USE)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
revokeGrantCheck(USER, USE);
public void testGrantAndRevokePermissions() throws Exception { revokeGrantCheck(USER, READ); revokeGrantCheck(USER, WRITE); revokeGrantCheck(USER, USE); revokeGrantCheck(GROUP, READ); revokeGrantCheck(GROUP, WRITE); revokeGrantCheck(GROUP, USE); revokeGrantCheck(WORLD, READ); revokeGrantCheck(WORLD, WRITE); revokeGrantCheck(WORLD, USE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
revokeGrantCheck(GROUP, USE);
public void testGrantAndRevokePermissions() throws Exception { revokeGrantCheck(USER, READ); revokeGrantCheck(USER, WRITE); revokeGrantCheck(USER, USE); revokeGrantCheck(GROUP, READ); revokeGrantCheck(GROUP, WRITE); revokeGrantCheck(GROUP, USE); revokeGrantCheck(WORLD, READ); revokeGrantCheck(WORLD, WRITE); revokeGrantCheck(WORLD, USE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
revokeGrantCheck(WORLD, USE);
public void testGrantAndRevokePermissions() throws Exception { revokeGrantCheck(USER, READ); revokeGrantCheck(USER, WRITE); revokeGrantCheck(USER, USE); revokeGrantCheck(GROUP, READ); revokeGrantCheck(GROUP, WRITE); revokeGrantCheck(GROUP, USE); revokeGrantCheck(WORLD, READ); revokeGrantCheck(WORLD, WRITE); revokeGrantCheck(WORLD, USE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
assertTrue(p.isGranted(USER, USE));
public void testSimplePermissionsAllowsEverything() throws Exception { assertTrue(p.isGranted(USER, READ)); assertTrue(p.isGranted(USER, WRITE)); assertTrue(p.isGranted(USER, USE)); assertTrue(p.isGranted(GROUP, READ)); assertTrue(p.isGranted(GROUP, WRITE)); assertTrue(p.isGranted(GROUP, USE)); assertTrue(p.isGranted(WORLD, READ)); assertTrue(p.isGranted(WORLD, WRITE)); assertTrue(p.isGranted(WORLD, USE)); // assertTrue( p.isGranted(ALL, READ) ); // assertTrue( p.isGranted(ALL, WRITE) ); // assertTrue( p.isGranted(ALL, USE) ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
assertTrue(p.isGranted(GROUP, USE));
public void testSimplePermissionsAllowsEverything() throws Exception { assertTrue(p.isGranted(USER, READ)); assertTrue(p.isGranted(USER, WRITE)); assertTrue(p.isGranted(USER, USE)); assertTrue(p.isGranted(GROUP, READ)); assertTrue(p.isGranted(GROUP, WRITE)); assertTrue(p.isGranted(GROUP, USE)); assertTrue(p.isGranted(WORLD, READ)); assertTrue(p.isGranted(WORLD, WRITE)); assertTrue(p.isGranted(WORLD, USE)); // assertTrue( p.isGranted(ALL, READ) ); // assertTrue( p.isGranted(ALL, WRITE) ); // assertTrue( p.isGranted(ALL, USE) ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
assertTrue(p.isGranted(WORLD, USE));
public void testSimplePermissionsAllowsEverything() throws Exception { assertTrue(p.isGranted(USER, READ)); assertTrue(p.isGranted(USER, WRITE)); assertTrue(p.isGranted(USER, USE)); assertTrue(p.isGranted(GROUP, READ)); assertTrue(p.isGranted(GROUP, WRITE)); assertTrue(p.isGranted(GROUP, USE)); assertTrue(p.isGranted(WORLD, READ)); assertTrue(p.isGranted(WORLD, WRITE)); assertTrue(p.isGranted(WORLD, USE)); // assertTrue( p.isGranted(ALL, READ) ); // assertTrue( p.isGranted(ALL, WRITE) ); // assertTrue( p.isGranted(ALL, USE) ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
bitCompare(USER, USE);
public void testToBits() throws Exception { bitCompare(USER, READ); bitCompare(USER, WRITE); bitCompare(USER, USE); bitCompare(GROUP, READ); bitCompare(GROUP, WRITE); bitCompare(GROUP, USE); bitCompare(WORLD, READ); bitCompare(WORLD, WRITE); bitCompare(WORLD, USE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
bitCompare(GROUP, USE);
public void testToBits() throws Exception { bitCompare(USER, READ); bitCompare(USER, WRITE); bitCompare(USER, USE); bitCompare(GROUP, READ); bitCompare(GROUP, WRITE); bitCompare(GROUP, USE); bitCompare(WORLD, READ); bitCompare(WORLD, WRITE); bitCompare(WORLD, USE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
bitCompare(WORLD, USE);
public void testToBits() throws Exception { bitCompare(USER, READ); bitCompare(USER, WRITE); bitCompare(USER, USE); bitCompare(GROUP, READ); bitCompare(GROUP, WRITE); bitCompare(GROUP, USE); bitCompare(WORLD, READ); bitCompare(WORLD, WRITE); bitCompare(WORLD, USE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
p.revoke(GROUP, USE,READ,WRITE);
p.revoke(GROUP, READ,WRITE);
public void testVarArgs() throws Exception { p.revoke(GROUP, USE,READ,WRITE); assertFalse( p.isGranted(GROUP, READ)); assertFalse( p.isGranted(GROUP, WRITE)); assertFalse( p.isGranted(GROUP, USE)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
assertFalse( p.isGranted(GROUP, USE));
public void testVarArgs() throws Exception { p.revoke(GROUP, USE,READ,WRITE); assertFalse( p.isGranted(GROUP, READ)); assertFalse( p.isGranted(GROUP, WRITE)); assertFalse( p.isGranted(GROUP, USE)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/PermissionsTest.java/buggy/components/common/test/ome/model/utests/PermissionsTest.java
DataHandler dh = model.annotateDataObjects(nodes);
DataHandler dh = model.annotateDataObjects(view, nodes);
public void annotate(TreeImageDisplay[] nodes) { if (model.getState() == DISCARDED) throw new IllegalStateException("This method cannot be invoked " + "in the DISCARDED state."); if (nodes == null) throw new IllegalArgumentException("No dataObject to annotate"); if (nodes.length == 1) { PropertiesCmd cmd = new PropertiesCmd(this); cmd.execute(); return; } DataHandler dh = model.annotateDataObjects(nodes); dh.addPropertyChangeListener(controller); dh.activate(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/TreeViewerComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java
firePropertyChange(THUMBNAIL_LOADED_PROPERTY, null, thumbnail);
model.getEditor().setThumbnail(thumbnail);
public void setThumbnail(BufferedImage thumbnail) { if (model.getState() == LOADING_THUMBNAIL) { model.setState(READY); if (thumbnail != null) firePropertyChange(THUMBNAIL_LOADED_PROPERTY, null, thumbnail); fireStateChange(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/TreeViewerComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java
DataHandler dh = model.classifyImageObjects(images, mode);
DataHandler dh = model.classifyImageObjects(view, images, mode);
public void showClassifier(ImageData[] images, int mode) { switch (model.getState()) { //case READY: case DISCARDED: throw new IllegalStateException("This method should cannot " + "be invoked in the DISCARDED state."); } if (images == null) throw new IllegalArgumentException("Object cannot be null."); if (images.length == 0) throw new IllegalArgumentException("No images to classify or " + "declassify."); DataHandler dh = model.classifyImageObjects(images, mode); dh.addPropertyChangeListener(controller); dh.activate(); /* model.cancel(); // cancel annotation loader or thumbnail loader removeEditor(); model.setEditorType(CLASSIFIER_EDITOR); Classifier classifier = ClassifierFactory.getClassifier(this, mode, images); classifier.addPropertyChangeListener(controller); classifier.activate(); view.addComponent(classifier.getUI()); */ }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/TreeViewerComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java
defineMethod("binding", Arity.noArguments(), "binding");
protected void initializeClass() { defineMethod("arity", Arity.noArguments(), "arity"); defineMethod("call", Arity.optional(), "call"); defineAlias("[]", "call"); defineMethod("to_proc", Arity.noArguments(), "to_proc"); defineSingletonMethod("new", Arity.optional(), "newInstance"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/62395b140d1fb0b5b75ba224eb0f4b564f70979b/ProcMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/ProcMetaClass.java
thumbnails.add(thumb.getImageFor(node));
thumbnails.add(thumb.getDisplayedImage());
public void visit(ImageNode node) { Thumbnail thumb = node.getThumbnail(); thumbnails.add(thumb.getImageFor(node)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2509d546984c0580d2b4a547fed842ec745b87b2/SaveThumbnailsVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/SaveThumbnailsVisitor.java
public PDILoader(HiViewer viewer, Set images)
public PDILoader(HiViewer viewer, Set images, boolean refresh)
public PDILoader(HiViewer viewer, Set images) { super(viewer); this.images = images; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/PDILoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/PDILoader.java
this.refresh = refresh;
public PDILoader(HiViewer viewer, Set images) { super(viewer); this.images = images; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/PDILoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/PDILoader.java
viewer.setHierarchyRoots((Set) result, false);
viewer.setHierarchyRoots((Set) result, false, refresh);
public void handleResult(Object result) { if (viewer.getState() == HiViewer.DISCARDED) return; //Async cancel. viewer.setHierarchyRoots((Set) result, false); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/PDILoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/PDILoader.java
scanner = new StringScanner(((RubyString)args[0]).getValue());
scanner = new StringScanner(args[0].convertToString().getValue());
public IRubyObject initialize(IRubyObject[] args) { if (checkArgumentCount(args, 0, 2) > 0) { scanner = new StringScanner(((RubyString)args[0]).getValue()); } else { scanner = new StringScanner(); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ea4e25f1262c817873877b14c2a82825f1420dd0/RubyStringScanner.java/buggy/src/org/jruby/RubyStringScanner.java
if (proxy.searchMethod(methodName) == UndefinedMethod.getInstance()) {
if (!methodName.equals("class")) {
private void define_instance_method_for_proxy(final RubyClass proxy, List names, final RubyArray methods) { final RubyModule javaUtilities = getRuntime().getModule("JavaUtilities"); Callback method = new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] argsArray = new IRubyObject[args.length + 1]; argsArray[0] = self.callMethod("java_object"); RubyArray argsAsArray = getRuntime().newArray(); for (int j = 0; j < args.length; j++) { argsArray[j+1] = Java.ruby_to_java(proxy, args[j]); argsAsArray.append(argsArray[j+1]); } IRubyObject[] mmArgs = new IRubyObject[] {methods, argsAsArray}; IRubyObject result = javaUtilities.callMethod("matching_method", mmArgs); return Java.java_to_ruby(self, result.callMethod("invoke", argsArray)); } public Arity getArity() { return Arity.optional(); } }; for(Iterator iter = names.iterator(); iter.hasNext(); ) { String methodName = (String) iter.next(); // Do not override a built-in Ruby method. This begs a question or two... if (proxy.searchMethod(methodName) == UndefinedMethod.getInstance()) { proxy.defineMethod(methodName, method); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6c72dd872794347590986a952270341cce06e028/JavaClass.java/buggy/src/org/jruby/javasupport/JavaClass.java
LogSystem.removeInstance(_ls);
public synchronized void stopClient() { if ( --_count == 0 ) { shutdown(); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/eaf4eda3d1dc696e065fa02b661b072950526e26/Broker.java/clean/webmacro/src/org/webmacro/Broker.java
_servletContext.log(e, _mf.format(_args));
_servletContext.log(_mf.format(_args),e);
public void log(Date date, String name, String level, String message, Exception e) { synchronized(_args) { _args[0] = date; _args[1] = name; _args[2] = level; _args[3] = message; if (e == null) _servletContext.log(_mf.format(_args)); else _servletContext.log(e, _mf.format(_args)); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4603f6cee8b46d51274d6e6b533212c93f0fb160/ServletLog.java/clean/webmacro/src/org/webmacro/servlet/ServletLog.java
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/82093f7731a5d1d2d6298791315369b8e96be576/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java
HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source");
HtmlInputText sourceArea = WFUtil.getInputText(SOURCE_ID, ref + "source");
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/82093f7731a5d1d2d6298791315369b8e96be576/EditArticleView.java/buggy/src/java/com/idega/block/article/component/EditArticleView.java
emptyMessagePanel.setBounds(0, r.height-h, w, h);
emptyMessagePanel.setBounds(0, r.height-h, 3*w/2, h);
private void buildEmptyPanel() { if (emptyMessagePanel != null) return; emptyMessagePanel = new JPanel(); emptyMessagePanel.setOpaque(true); emptyMessagePanel.setBorder( BorderFactory.createLineBorder(Color.BLACK)); Rectangle r = titlePanel.getBounds(); emptyMessagePanel.setLayout(new BoxLayout(emptyMessagePanel, BoxLayout.X_AXIS)); IconManager im = IconManager.getInstance(); JLabel label = new JLabel(im.getIcon(IconManager.ERROR)); emptyMessagePanel.add(label); int w = label.getWidth(); label = new JLabel(EMPTY_MSG); int h = label.getFontMetrics(label.getFont()).getHeight(); w += getFontMetrics(getFont()).stringWidth(EMPTY_MSG); emptyMessagePanel.add(label); Insets i = emptyMessagePanel.getInsets(); h += i.top+i.bottom+2; emptyMessagePanel.setBounds(0, r.height-h, w, h); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3e0df27168af6ddebdb1c3476bb00aa3cf2fc92/EditorUI.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorUI.java
testPlane[i] = 127;
testPlane[i] = 126;
private byte[] getTestPlane() { if (testPlane == null) { Integer planeSize = pixbuf.getPlaneSize(); testPlane = new byte[planeSize.intValue()]; for (int i = 0; i < planeSize; i++) { if (i % 2 == 0) testPlane[i] = -128; else testPlane[i] = 127; } byte[] md = Helper.calculateMessageDigest(testPlane); originalDigest = Helper.bytesToHex(md); } return testPlane; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/PlaneWriteUnitTest.java/clean/components/omeio-nio/test/ome/io/nio/itests/PlaneWriteUnitTest.java
service = new PixelsService();
service = new PixelsService(PixelsService.ROOT_DEFAULT);
protected void setUp() throws IOException { // Create set up the base fixture which sets up the database for us baseFixture = new PixbufIOFixture(); pixels = baseFixture.setUp(); // "Our" fixture which creates the planes needed for this test case. service = new PixelsService(); pixbuf = service.createPixelBuffer(pixels); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/PlaneWriteUnitTest.java/clean/components/omeio-nio/test/ome/io/nio/itests/PlaneWriteUnitTest.java
searchContacts("");
SparkManager.getUserManager().searchContacts("", SparkManager.getWorkspace().getContactList());
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem(Res.getString("menuitem.add.contact"), SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem(Res.getString("menuitem.add.contact.group"), SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem(Res.getString("menuitem.remove.from.group"), SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem(Res.getString("menuitem.start.a.chat"), SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem(Res.getString("menuitem.rename"), SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new BorderLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(treeScroller, BorderLayout.CENTER); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(unfiledGroup); addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); commandPanel.add(addContactButton); addContactButton.setToolTipText(Res.getString("message.add.a.contact")); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
searchContacts("");
SparkManager.getUserManager().searchContacts("", SparkManager.getWorkspace().getContactList());
public void actionPerformed(ActionEvent evt) { searchContacts(""); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
activateChat(activeItem.getContactJID(), activeItem.getNickname());
SparkManager.getChatManager().activateChat(activeItem.getContactJID(), activeItem.getNickname());
public void actionPerformed(ActionEvent e) { if (e.getSource() == addingGroupButton) { new RosterDialog().showRosterDialog(); } else if (e.getSource() == chatMenu) { if (activeItem != null) { activateChat(activeItem.getContactJID(), activeItem.getNickname()); } } else if (e.getSource() == addContactMenu) { RosterDialog rosterDialog = new RosterDialog(); if (activeGroup != null) { rosterDialog.setDefaultGroup(activeGroup); } rosterDialog.showRosterDialog(); } else if (e.getSource() == removeContactFromGroupMenu) { if (activeItem != null) { removeContactFromGroup(activeItem); } } else if (e.getSource() == renameMenu) { if (activeItem == null) { return; } String oldNickname = activeItem.getNickname(); String newNickname = JOptionPane.showInputDialog(this, Res.getString("label.rename.to") + ":", oldNickname); if (ModelUtil.hasLength(newNickname)) { String address = activeItem.getFullJID(); ContactGroup contactGroup = getContactGroup(activeItem.getGroupName()); ContactItem contactItem = contactGroup.getContactItemByNickname(activeItem.getNickname()); contactItem.setNickname(newNickname); final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(address); entry.setName(newNickname); final Iterator contactGroups = groupList.iterator(); String user = StringUtils.parseBareAddress(address); while (contactGroups.hasNext()) { ContactGroup cg = (ContactGroup)contactGroups.next(); ContactItem ci = cg.getContactItemByJID(user); if (ci != null) { ci.setNickname(newNickname); } } } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
new RosterDialog().showRosterDialog();
String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } }
public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } }
showEmptyGroups(showHideMenu.isSelected());
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
subscriptionRequest(presence.getFrom());
Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } }
public void run() { subscriptionRequest(presence.getFrom()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub);
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid);
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry);
SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid);
});
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
SwingUtilities.invokeLater(new Runnable() { public void run() {
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
}); }
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
&& RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) {
&& RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) {
private void buildContactList() { XMPPConnection con = SparkManager.getConnection(); final Roster roster = con.getRoster(); roster.addRosterListener(this); for (RosterGroup group : roster.getGroups()) { ContactGroup contactGroup = addContactGroup(group.getName()); for (RosterEntry entry : group.getEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); contactItem.setPresence(null); if ((entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Add to contact group. contactGroup.addContactItem(contactItem); contactGroup.setVisible(true); } else { if (offlineGroup.getContactItemByJID(entry.getUser()) == null) { offlineGroup.addContactItem(contactItem); } } } } // Add Unfiled Group // addContactGroup(unfiledGroup); for (RosterEntry entry : roster.getUnfiledEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); offlineGroup.addContactItem(contactItem); } unfiledGroup.setVisible(false); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster();
String newName = JOptionPane.showInputDialog(group, Res.getString("label.rename.to") + ":", Res.getString("title.rename.roster.group"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster();
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java
RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } }
RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) {
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d2c9c1910f8cad82e65ab912959a96c5121978/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java