rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
abstraction.onPlaneSelected(z, t); } | abstraction.onPlaneSelected(z, t); } | public void onZChange(int z, int t) { resetZSlider(z); abstraction.onPlaneSelected(z, t); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ progressNotifier.dispose(); progressNotifier = null; } | { progressNotifier.dispose(); progressNotifier = null; } | void removeProgressNotifier() { progressNotifier.dispose(); progressNotifier = null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
public void setMagFactor(double v) { magFactor = v; } | public void setMagFactor(double v) { magFactor = v; iat.setMagFactor(v); abstraction.affineTransformChanged(iat.copy()); } | public void setMagFactor(double v) { magFactor = v; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ this.presentation = presentation; } | { this.presentation = presentation; } | void setPresentation(ViewerUIF presentation) { this.presentation = presentation; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ UIUtilities.centerAndShow(dialog); } | { UIUtilities.centerAndShow(dialog); } | public void showDialog(JDialog dialog) { UIUtilities.centerAndShow(dialog); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ | { | public void showImage3DViewer() { int model = getModel(); Viewer3D v3D = new Viewer3D(this, abstraction.getPixelsDims().sizeZ, model); if (v3D.isVisible()) UIUtilities.centerAndShow(v3D); else { //TODO: tempo around before fix bug #321 abstraction.setModel(model); v3D.dispose(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
Viewer3D v3D = new Viewer3D(this, abstraction.getPixelsDims().sizeZ, model); if (v3D.isVisible()) UIUtilities.centerAndShow(v3D); else { | Viewer3D v3D = new Viewer3D(this, abstraction.getPixelsDims().sizeZ, model); if (v3D.isVisible()) UIUtilities.centerAndShow(v3D); else { | public void showImage3DViewer() { int model = getModel(); Viewer3D v3D = new Viewer3D(this, abstraction.getPixelsDims().sizeZ, model); if (v3D.isVisible()) UIUtilities.centerAndShow(v3D); else { //TODO: tempo around before fix bug #321 abstraction.setModel(model); v3D.dispose(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
} | } | public void showImage3DViewer() { int model = getModel(); Viewer3D v3D = new Viewer3D(this, abstraction.getPixelsDims().sizeZ, model); if (v3D.isVisible()) UIUtilities.centerAndShow(v3D); else { //TODO: tempo around before fix bug #321 abstraction.setModel(model); v3D.dispose(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ BufferedImage image = presentation.getDisplayImage(); | { BufferedImage image = getBufferedImage(); | public void showImageSaver() { BufferedImage image = presentation.getDisplayImage(); if (image == null) { UserNotifier un = getRegistry().getUserNotifier(); un.notifyError("Save image", "No current image displayed"); } else new ImageSaver(this, image); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
} else new ImageSaver(this, image); } | } else new ImageSaver(this); } | public void showImageSaver() { BufferedImage image = presentation.getDisplayImage(); if (image == null) { UserNotifier un = getRegistry().getUserNotifier(); un.notifyError("Save image", "No current image displayed"); } else new ImageSaver(this, image); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ | { | public void showInspector() { if (imageInspector == null) imageInspector = new ImageInspector(this, presentation.getCanvas(), magFactor); UIUtilities.centerAndShow(imageInspector); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
UIUtilities.centerAndShow(imageInspector); } | UIUtilities.centerAndShow(imageInspector); if (roiOnOff) abstraction.addRoiCanvas(false); } | public void showInspector() { if (imageInspector == null) imageInspector = new ImageInspector(this, presentation.getCanvas(), magFactor); UIUtilities.centerAndShow(imageInspector); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ | { | public void showMovie() { int maxZ = abstraction.getPixelsDims().sizeZ-1; int maxT = abstraction.getPixelsDims().sizeT-1; if (movieSettings == null) initMovieSettings(maxZ, maxT); if (moviePlayer == null) moviePlayer = new Player(this, maxT, maxZ, movieSettings); UIUtilities.centerAndShow(moviePlayer); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
if (moviePlayer == null) moviePlayer = new Player(this, maxT, maxZ, movieSettings); UIUtilities.centerAndShow(moviePlayer); } | moviePlayer = new Player(this, maxT, maxZ, movieSettings); UIUtilities.centerAndShow(moviePlayer); } | public void showMovie() { int maxZ = abstraction.getPixelsDims().sizeZ-1; int maxT = abstraction.getPixelsDims().sizeT-1; if (movieSettings == null) initMovieSettings(maxZ, maxT); if (moviePlayer == null) moviePlayer = new Player(this, maxT, maxZ, movieSettings); UIUtilities.centerAndShow(moviePlayer); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ progressNotifier = new ProgressNotifier(this, imageName); UIUtilities.centerAndShow(progressNotifier); } | { progressNotifier = new ProgressNotifier(this, imageName); UIUtilities.centerAndShow(progressNotifier); } | void showProgressNotifier(String imageName) { progressNotifier = new ProgressNotifier(this, imageName); UIUtilities.centerAndShow(progressNotifier); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ abstraction.showRendering(); } | { abstraction.showRendering(); } | public void showRendering() { abstraction.showRendering(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ Object src = e.getSource(); int valT, valZ; valT = tSlider.getValue(); valZ = zSlider.getValue(); ToolBarManager tbm = presentation.getToolBar().getManager(); if (src == tSlider) tbm.onTChange(valT); else tbm.onZChange(valZ); abstraction.onPlaneSelected(valZ, valT); } | { Object src = e.getSource(); int valT, valZ; valT = tSlider.getValue(); valZ = zSlider.getValue(); ToolBarManager tbm = presentation.getToolBar().getManager(); if (src == tSlider) tbm.onTChange(valT); else tbm.onZChange(valZ); abstraction.onPlaneSelected(valZ, valT); } | public void stateChanged(ChangeEvent e) { Object src = e.getSource(); int valT, valZ; valT = tSlider.getValue(); valZ = zSlider.getValue(); ToolBarManager tbm = presentation.getToolBar().getManager(); if (src == tSlider) tbm.onTChange(valT); else tbm.onZChange(valZ); abstraction.onPlaneSelected(valZ, valT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
public void synchPlaneSelected(int z, int previousModel) | void synchPlaneSelected(int z, int model) | public void synchPlaneSelected(int z, int previousModel) { resetZSlider(z); resetZField(z); abstraction.setModel(previousModel); abstraction.onPlaneSelected(z); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
abstraction.setModel(previousModel); | abstraction.setModel(model); | public void synchPlaneSelected(int z, int previousModel) { resetZSlider(z); resetZField(z); abstraction.setModel(previousModel); abstraction.onPlaneSelected(z); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ curT = t; view.getTField().setText(""+t); } | { curT = t; view.getTField().setText(""+t); } | public void onTChange(int t) { curT = t; view.getTField().setText(""+t); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
{ curZ = z; view.getZField().setText(""+z); } | { curZ = z; view.getZField().setText(""+z); } | public void onZChange(int z) { curZ = z; view.getZField().setText(""+z); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
initFrame(IconManager.getInstance(control.getRegistry())); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); | super(control.getReferenceFrame(), "Image Inspector"); | public ImageInspector(ViewerCtrl control) { //super(control.getReferenceFrame(), "Image Inspector"); initFrame(IconManager.getInstance(control.getRegistry())); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); init(control); setJMenuBar(menuBar); buildGUI(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/020251919a9bc041ddec075006ba48f2bcfddd48/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java |
manager.zoom(); | public ImageInspector(ViewerCtrl control) { //super(control.getReferenceFrame(), "Image Inspector"); initFrame(IconManager.getInstance(control.getRegistry())); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); init(control); setJMenuBar(menuBar); buildGUI(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/020251919a9bc041ddec075006ba48f2bcfddd48/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java |
|
" select rdef from RenderingDef rdef where " + " rdef.pixels.id = :pixid and rdef.details.owner.id = :ownerid", | "select rdef from RenderingDef as rdef " + "left outer join fetch rdef.quantization " + "left outer join fetch rdef.model " + "left outer join fetch rdef.waveRendering as cb " + "left outer join fetch cb.color " + "left outer join fetch cb.family " + "left outer join fetch rdef.spatialDomainEnhancement where " + "rdef.pixels.id = :pixid and rdef.details.owner.id = :ownerid", | public RenderingDef retrieveRndSettings(final long pixId) { final Long userId = getSecuritySystem() .getEventContext() .getCurrentUserId(); return (RenderingDef) iQuery.findByQuery( " select rdef from RenderingDef rdef where " + " rdef.pixels.id = :pixid and rdef.details.owner.id = :ownerid", new Parameters().addLong("pixid",pixId).addLong("ownerid",userId)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/PixelsImpl.java/buggy/components/server/src/ome/logic/PixelsImpl.java |
if (b==true) | if (b) | void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b==true) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(this.getX()+this.getWidth(), this.getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); lens.setVisible(b); } else lens.setVisible(b); this.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
lens.setZoomWindowLocation(this.getX()+this.getWidth(), this.getY()); | lens.setZoomWindowLocation(getX()+getWidth(), getY()); | void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b==true) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(this.getX()+this.getWidth(), this.getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); lens.setVisible(b); } else lens.setVisible(b); this.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
lens.setVisible(b); } else lens.setVisible(b); | } lens.setVisible(b); | void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b==true) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(this.getX()+this.getWidth(), this.getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); lens.setVisible(b); } else lens.setVisible(b); this.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
public String getName() { return name; } | public String getName() { if (name == null || name.length() == 0) return (String) getValue(Action.NAME); return name; } | public String getName() { return name; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ViewerAction.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/actions/ViewerAction.java |
colorModelButton.setToolTipText(getColorModelDescription( model.getColorModel())); | void resetDefaults() { boolean gs = (model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL)); Iterator i = channelButtons.iterator(); ChannelButton button; int index; while (i.hasNext()) { button = (ChannelButton) i.next(); index = button.getChannelIndex(); button.setSelected(model.isChannelActive(index)); button.setColor(model.getChannelColor(index)); button.setGrayedOut(gs); } colorModelButton.setIcon(getColorModelIcon(model.getColorModel())); setZSection(model.getDefaultZ()); setTimepoint(model.getDefaultT()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ControlPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ControlPane.java |
|
colorModelButton.setToolTipText(getColorModelDescription( model.getColorModel())); | void setColorModel() { boolean gs = (model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL)); Iterator i = channelButtons.iterator(); ChannelButton button; while (i.hasNext()) { button = (ChannelButton) i.next(); button.setSelected( model.isChannelActive(button.getChannelIndex())); button.setGrayedOut(gs); } colorModelButton.setIcon(getColorModelIcon(model.getColorModel())); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ControlPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ControlPane.java |
|
public LensComponent(JFrame parent) | public LensComponent(JFrame parent, BufferedImage planeImage) | public LensComponent(JFrame parent) { this(parent, null); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/29b0b8d77292efe37e6130bac1e4416901230654/LensComponent.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/lens/LensComponent.java |
this(parent, null); | lensModel = new LensModel(planeImage); zoomWindow = new ZoomWindow(parent, this); lens = new LensUI(this, LENS_DEFAULT_WIDTH, LENS_DEFAULT_HEIGHT); lensController = new LensController(lensModel , lens, zoomWindow); lensModel.setWidth(LENS_DEFAULT_WIDTH); lensModel.setHeight(LENS_DEFAULT_HEIGHT); lensModel.setImageZoomFactor(1.0f); lens.addController(lensController); lens.setLensColour(lensModel.getLensPreferredColour()); zoomWindow.addController(lensController); menu = new LensMenu(this); lens.setPopupMenu(menu.getPopupMenu()); zoomWindow.setMenu(menu.getMenubar()); | public LensComponent(JFrame parent) { this(parent, null); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/29b0b8d77292efe37e6130bac1e4416901230654/LensComponent.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/lens/LensComponent.java |
boolean timing = context.isTiming(); | timing = Flags.PROFILE && context.isTiming(); | final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); FastWriter out = new FastWriter(resp.getOutputStream(), resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); out.write("<body><h1><font color=\"red\">WebMacro Error: "); out.write("</font></h1><pre>"); out.write(_problem); out.write("</pre>"); out.write("Please contat the server administrator"); out.flush(); out.close(); } catch (Exception e) { _log.error(_problem,e); } return; } } try { context = newContext(req,resp); boolean timing = context.isTiming(); if (timing) context.startTiming("WMServlet",req.getRequestURI()); Template t; try { if (timing) context.startTiming("handle"); t = handle(context); } finally { context.stopTiming(); } if (t != null) { execute(t,context); } context.startTiming("WMServlet.destroyContext()"); try { destroyContext(context); } finally { if (timing) context.stopTiming(); } } catch (HandlerException e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "Your handler was unable to process the request successfully " + "for some reason. Here are the details:<p>" + e); execute(tmpl,context); } catch (Exception e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "The handler WebMacro used to handle this request failed for " + "some reason. This is likely a bug in the handler written " + "for this application. Here are the details:<p>" + e); execute(tmpl,_wcPrototype.newInstance(req,resp)); } finally { context.stopTiming(); context.clear(); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
context.stopTiming(); | if (timing) context.stopTiming(); | final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); FastWriter out = new FastWriter(resp.getOutputStream(), resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); out.write("<body><h1><font color=\"red\">WebMacro Error: "); out.write("</font></h1><pre>"); out.write(_problem); out.write("</pre>"); out.write("Please contat the server administrator"); out.flush(); out.close(); } catch (Exception e) { _log.error(_problem,e); } return; } } try { context = newContext(req,resp); boolean timing = context.isTiming(); if (timing) context.startTiming("WMServlet",req.getRequestURI()); Template t; try { if (timing) context.startTiming("handle"); t = handle(context); } finally { context.stopTiming(); } if (t != null) { execute(t,context); } context.startTiming("WMServlet.destroyContext()"); try { destroyContext(context); } finally { if (timing) context.stopTiming(); } } catch (HandlerException e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "Your handler was unable to process the request successfully " + "for some reason. Here are the details:<p>" + e); execute(tmpl,context); } catch (Exception e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "The handler WebMacro used to handle this request failed for " + "some reason. This is likely a bug in the handler written " + "for this application. Here are the details:<p>" + e); execute(tmpl,_wcPrototype.newInstance(req,resp)); } finally { context.stopTiming(); context.clear(); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
context.startTiming("WMServlet.destroyContext()"); | if (timing) context.startTiming("WMServlet.destroyContext()"); | final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); FastWriter out = new FastWriter(resp.getOutputStream(), resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); out.write("<body><h1><font color=\"red\">WebMacro Error: "); out.write("</font></h1><pre>"); out.write(_problem); out.write("</pre>"); out.write("Please contat the server administrator"); out.flush(); out.close(); } catch (Exception e) { _log.error(_problem,e); } return; } } try { context = newContext(req,resp); boolean timing = context.isTiming(); if (timing) context.startTiming("WMServlet",req.getRequestURI()); Template t; try { if (timing) context.startTiming("handle"); t = handle(context); } finally { context.stopTiming(); } if (t != null) { execute(t,context); } context.startTiming("WMServlet.destroyContext()"); try { destroyContext(context); } finally { if (timing) context.stopTiming(); } } catch (HandlerException e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "Your handler was unable to process the request successfully " + "for some reason. Here are the details:<p>" + e); execute(tmpl,context); } catch (Exception e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "The handler WebMacro used to handle this request failed for " + "some reason. This is likely a bug in the handler written " + "for this application. Here are the details:<p>" + e); execute(tmpl,_wcPrototype.newInstance(req,resp)); } finally { context.stopTiming(); context.clear(); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
context.stopTiming(); | if (timing) context.stopTiming(); | final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); FastWriter out = new FastWriter(resp.getOutputStream(), resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); out.write("<body><h1><font color=\"red\">WebMacro Error: "); out.write("</font></h1><pre>"); out.write(_problem); out.write("</pre>"); out.write("Please contat the server administrator"); out.flush(); out.close(); } catch (Exception e) { _log.error(_problem,e); } return; } } try { context = newContext(req,resp); boolean timing = context.isTiming(); if (timing) context.startTiming("WMServlet",req.getRequestURI()); Template t; try { if (timing) context.startTiming("handle"); t = handle(context); } finally { context.stopTiming(); } if (t != null) { execute(t,context); } context.startTiming("WMServlet.destroyContext()"); try { destroyContext(context); } finally { if (timing) context.stopTiming(); } } catch (HandlerException e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "Your handler was unable to process the request successfully " + "for some reason. Here are the details:<p>" + e); execute(tmpl,context); } catch (Exception e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "The handler WebMacro used to handle this request failed for " + "some reason. This is likely a bug in the handler written " + "for this application. Here are the details:<p>" + e); execute(tmpl,_wcPrototype.newInstance(req,resp)); } finally { context.stopTiming(); context.clear(); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
c.startTiming("Template.write", tmpl); | if (timing) c.startTiming("Template.write", tmpl); | final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
c.stopTiming(); | if (timing) c.stopTiming(); | final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
c.startTiming("FastWriter.close()"); | if (timing) c.startTiming("FastWriter.close()"); | final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
finally { c.stopTiming(); } | finally { if (timing) c.stopTiming(); } | final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
outputFile.getParentFile().mkdirs(); | File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } | private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; OutputStream outputStream = null; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); byte[] instrumentedClass = cw.toByteArray(); if (cv.isInstrumented()) { File outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); outputFile.getParentFile().mkdirs(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/c90bf912577c41f02b48de93ff83731fd493b0bf/Main.java/clean/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
nilObject = RubyObject.nilObject(this); | nilObject = new RubyNil(this); | private Ruby() { nilObject = RubyObject.nilObject(this); trueObject = new RubyBoolean(this, true); falseObject = new RubyBoolean(this, false); javaSupport = new JavaSupport(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/39c53cd7958c3b95ef4124a65a62d1e1cac24c84/Ruby.java/clean/src/org/jruby/Ruby.java |
condition.signalAll(); | if (!satisfied) { satisfied = true; condition.signalAll(); } | public void setSatisfied() { lock.lock(); try { condition.signalAll(); } finally { lock.unlock(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/StandardServiceConditionContext.java/buggy/kernel/src/java/org/gbean/kernel/standard/StandardServiceConditionContext.java |
return Integer.parseInt(key); | return Integer.parseInt(snum); | public int getIntegerSetting(String key) { String snum = getSetting(key); try { return Integer.parseInt(key); } catch (Exception e) { return 0; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/cf00335d59e6ece3e8d004e06e3912ec8ba807fe/Settings.java/clean/webmacro/src/org/webmacro/util/Settings.java |
public PaletteModuleView(ChainModuleData module) { super(module); | public PaletteModuleView() { super(); | public PaletteModuleView(ChainModuleData module) { super(module); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/88ea3f3e4d69cd47c4b07b42a4cbf38e087aa60c/PaletteModuleView.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/PaletteModuleView.java |
private ChainView getChainViewParent() { | private PaletteChainView getChainViewParent() { | private ChainView getChainViewParent() { PNode p = getParent(); while (p != null) { if (p instanceof ChainView) return (ChainView) p; p = p.getParent(); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/88ea3f3e4d69cd47c4b07b42a4cbf38e087aa60c/PaletteModuleView.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/PaletteModuleView.java |
if (p instanceof ChainView) return (ChainView) p; | if (p instanceof PaletteChainView) return (PaletteChainView) p; | private ChainView getChainViewParent() { PNode p = getParent(); while (p != null) { if (p instanceof ChainView) return (ChainView) p; p = p.getParent(); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/88ea3f3e4d69cd47c4b07b42a4cbf38e087aa60c/PaletteModuleView.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/PaletteModuleView.java |
protected LinkTarget getLinkTarget() { LinkTarget link = super.getLinkTarget(); | protected ModuleLinkTarget getLinkTarget() { ModuleLinkTarget link = super.getLinkTarget(); | protected LinkTarget getLinkTarget() { LinkTarget link = super.getLinkTarget(); link.setPickable(false); return link; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/88ea3f3e4d69cd47c4b07b42a4cbf38e087aa60c/PaletteModuleView.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/PaletteModuleView.java |
((ChainPaletteEventHandler) handler).animateToNode(this); | ((ChainPaletteEventHandler) handler).animateToBounds(getZoomInBounds()); | public void mouseClicked(GenericEventHandler handler) { ((ChainPaletteEventHandler) handler).animateToNode(this); ((ChainPaletteEventHandler) handler).setLastEntered(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/88ea3f3e4d69cd47c4b07b42a4cbf38e087aa60c/PaletteModuleView.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/PaletteModuleView.java |
ChainView view = getChainViewParent(); ((ChainPaletteEventHandler) handler).animateToNode(view); | PaletteChainView view = getChainViewParent(); PBounds b = view.getChainDetailBounds(); ((ChainPaletteEventHandler) handler).animateToBounds(b); | public void mousePopup(GenericEventHandler handler) { ChainView view = getChainViewParent(); ((ChainPaletteEventHandler) handler).animateToNode(view); ((ChainPaletteEventHandler) handler).setLastEntered(view); ((ChainPaletteEventHandler) handler).hideLastChainView(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/88ea3f3e4d69cd47c4b07b42a4cbf38e087aa60c/PaletteModuleView.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/PaletteModuleView.java |
((ChainPaletteEventHandler) handler).hideLastChainView(); | public void mousePopup(GenericEventHandler handler) { ChainView view = getChainViewParent(); ((ChainPaletteEventHandler) handler).animateToNode(view); ((ChainPaletteEventHandler) handler).setLastEntered(view); ((ChainPaletteEventHandler) handler).hideLastChainView(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/88ea3f3e4d69cd47c4b07b42a4cbf38e087aa60c/PaletteModuleView.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/PaletteModuleView.java |
|
return new String[] { "WEB-INF/dao.xml", | return new String[] { "WEB-INF/services.xml", "WEB-INF/dao.xml", | protected String[] getConfigLocations() { return new String[] { "WEB-INF/dao.xml", "WEB-INF/data.xml", "WEB-INF/config-test.xml" }; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/OmeroThumbnailsBugTest.java/clean/components/server/test/org/openmicroscopy/omero/server/itests/OmeroThumbnailsBugTest.java |
Query q = session.createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); | Query q = session .createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); | public void testImageThumbnailExplodsOnHessianSerialization() { HierarchyBrowsingImpl hbv = new HierarchyBrowsingImpl(); SessionFactory sessions = (SessionFactory) this.applicationContext .getBean("sessionFactory"); // Mock Dao Mock containerDao = new Mock(ContainerDao.class); hbv.setContainerDao((ContainerDao) containerDao.proxy()); HibernateTemplate ht = new HibernateTemplate(sessions); // Arguments Set ids = new HashSet(); ids.add(new Integer(1)); // Result Image img = (Image) ht.execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Query q = session.createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); return q.setMaxResults(1).uniqueResult(); } }); List result = new ArrayList(); result.add(img); // Run containerDao.expects(new InvokeOnceMatcher()).method("findPDIHierarchies").with(new IsSame(ids)).will(new ReturnStub(result)); Set set = hbv.findPDIHierarchies(ids ); containerDao.verify(); containerDao.reset(); Utils.structureSize(set); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/OmeroThumbnailsBugTest.java/clean/components/server/test/org/openmicroscopy/omero/server/itests/OmeroThumbnailsBugTest.java |
public void testImageThumbnailExplodsOnHessianSerialization() { HierarchyBrowsingImpl hbv = new HierarchyBrowsingImpl(); SessionFactory sessions = (SessionFactory) this.applicationContext .getBean("sessionFactory"); // Mock Dao Mock containerDao = new Mock(ContainerDao.class); hbv.setContainerDao((ContainerDao) containerDao.proxy()); HibernateTemplate ht = new HibernateTemplate(sessions); // Arguments Set ids = new HashSet(); ids.add(new Integer(1)); // Result Image img = (Image) ht.execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Query q = session.createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); return q.setMaxResults(1).uniqueResult(); } }); List result = new ArrayList(); result.add(img); // Run containerDao.expects(new InvokeOnceMatcher()).method("findPDIHierarchies").with(new IsSame(ids)).will(new ReturnStub(result)); Set set = hbv.findPDIHierarchies(ids ); containerDao.verify(); containerDao.reset(); Utils.structureSize(set); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/OmeroThumbnailsBugTest.java/clean/components/server/test/org/openmicroscopy/omero/server/itests/OmeroThumbnailsBugTest.java |
||
containerDao.expects(new InvokeOnceMatcher()).method("findPDIHierarchies").with(new IsSame(ids)).will(new ReturnStub(result)); Set set = hbv.findPDIHierarchies(ids ); | containerDao.expects(new InvokeOnceMatcher()).method( "findPDIHierarchies").with(new IsSame(ids)).will( new ReturnStub(result)); Set set = hbv.findPDIHierarchies(ids); | public void testImageThumbnailExplodsOnHessianSerialization() { HierarchyBrowsingImpl hbv = new HierarchyBrowsingImpl(); SessionFactory sessions = (SessionFactory) this.applicationContext .getBean("sessionFactory"); // Mock Dao Mock containerDao = new Mock(ContainerDao.class); hbv.setContainerDao((ContainerDao) containerDao.proxy()); HibernateTemplate ht = new HibernateTemplate(sessions); // Arguments Set ids = new HashSet(); ids.add(new Integer(1)); // Result Image img = (Image) ht.execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Query q = session.createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); return q.setMaxResults(1).uniqueResult(); } }); List result = new ArrayList(); result.add(img); // Run containerDao.expects(new InvokeOnceMatcher()).method("findPDIHierarchies").with(new IsSame(ids)).will(new ReturnStub(result)); Set set = hbv.findPDIHierarchies(ids ); containerDao.verify(); containerDao.reset(); Utils.structureSize(set); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/OmeroThumbnailsBugTest.java/clean/components/server/test/org/openmicroscopy/omero/server/itests/OmeroThumbnailsBugTest.java |
Query q = session.createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); | Query q = session .createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); | public Object doInHibernate(Session session) throws HibernateException { Query q = session.createQuery("from Image as i join fetch i.datasets as ds join fetch ds.projects as prj "); return q.setMaxResults(1).uniqueResult(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/OmeroThumbnailsBugTest.java/clean/components/server/test/org/openmicroscopy/omero/server/itests/OmeroThumbnailsBugTest.java |
if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } | if (!cMacro && Expression.isTrue(c)) return builder.getArg(IF_BLOCK); | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b057bf8fe5de2db1a29349b29afb8aa28c2049b/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
? elseArgs.getArg(ELSE_BLOCK, bc) : ""; | ? elseArgs.getArg(ELSE_BLOCK) : ""; | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b057bf8fe5de2db1a29349b29afb8aa28c2049b/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b057bf8fe5de2db1a29349b29afb8aa28c2049b/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
|
if (i == 0) return elseBlock; else | if (i == 0) return elseifArgs[j].getArg(ELSEIF_BLOCK); else { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b057bf8fe5de2db1a29349b29afb8aa28c2049b/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b057bf8fe5de2db1a29349b29afb8aa28c2049b/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
|
return elseBlock; | return elseArgs.getArg(ELSE_BLOCK); else elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b057bf8fe5de2db1a29349b29afb8aa28c2049b/IfDirective.java/buggy/webmacro/src/org/webmacro/directive/IfDirective.java |
/* int min = model.getMinimum(); int max = model.getMaximum(); int trackLength = trackRect.height; double valueRange = (double)max -(double)min; double pixelsPerValue = trackLength/valueRange; int trackTop = trackRect.y; int trackBottom = trackRect.y+trackRect.height-1; int yPosition = trackTop; yPosition += Math.round(pixelsPerValue*((double) max - value)); yPosition = Math.max(trackTop, yPosition); yPosition = Math.min(trackBottom, yPosition); return yPosition; */ | int yPositionForValue(int value) { /* int min = model.getMinimum(); int max = model.getMaximum(); int trackLength = trackRect.height; double valueRange = (double)max -(double)min; double pixelsPerValue = trackLength/valueRange; int trackTop = trackRect.y; int trackBottom = trackRect.y+trackRect.height-1; int yPosition = trackTop; yPosition += Math.round(pixelsPerValue*((double) max - value)); yPosition = Math.max(trackTop, yPosition); yPosition = Math.min(trackBottom, yPosition); return yPosition; */ int min = model.getMinimum(); int max = model.getMaximum(); int trackLength = trackRect.height; double valueRange = (double) max-(double) min; double pixelsPerValue = trackLength/valueRange; int trackTop = trackRect.y; int trackBottom = trackRect.y+trackRect.height-1; int yPosition= trackTop; yPosition += Math.round(pixelsPerValue*((double) max-value)); yPosition = Math.max(trackTop, yPosition); yPosition = Math.min(trackBottom, yPosition); return yPosition; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc1f48ba65faa9525239c245ae33d92d4640ca0/TwoKnobsSliderUI.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/slider/TwoKnobsSliderUI.java |
|
/* int value; int minValue = model.getMinimum(); int maxValue = model.getMaximum(); int trackLength = trackRect.height; int trackTop = trackRect.y; int trackBottom = trackRect.y+trackRect.height; if (yPosition <= trackTop ) value = maxValue; else if (yPosition >= trackBottom) value = minValue; else { double valueRange = (double) maxValue-(double) minValue; double valuePerPixel = valueRange/trackLength; value = maxValue-(int) Math.round( (yPosition-trackTop)*valuePerPixel); } return value; */ | int yValueForPosition(int yPosition) { /* int value; int minValue = model.getMinimum(); int maxValue = model.getMaximum(); int trackLength = trackRect.height; int trackTop = trackRect.y; int trackBottom = trackRect.y+trackRect.height; if (yPosition <= trackTop ) value = maxValue; else if (yPosition >= trackBottom) value = minValue; else { double valueRange = (double) maxValue-(double) minValue; double valuePerPixel = valueRange/trackLength; value = maxValue-(int) Math.round( (yPosition-trackTop)*valuePerPixel); } return value; */ int value; int minValue = model.getMinimum(); int maxValue = model.getMaximum(); int trackLength = trackRect.height; int trackTop = trackRect.y; int trackBottom = trackRect.y+trackRect.height-1; if (yPosition <= trackTop) value = maxValue; else if (yPosition >= trackBottom) value = minValue; else { int distanceFromTrackTop = yPosition-trackTop; double valueRange = (double) maxValue-(double) minValue; double valuePerPixel = valueRange/trackLength; int valueFromTrackTop = (int)Math.round(distanceFromTrackTop*valuePerPixel); value = maxValue-valueFromTrackTop; } return value; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc1f48ba65faa9525239c245ae33d92d4640ca0/TwoKnobsSliderUI.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/slider/TwoKnobsSliderUI.java |
|
StringBuffer output = new StringBuffer(); | public static IRubyObject backquote(IRubyObject recv, IRubyObject aString) { StringBuffer output = new StringBuffer(); IRuby runtime = recv.getRuntime(); runtime.getGlobalVariables().set("$?", runtime.newFixnum( runInShell(runtime, aString.toString(), output))); return recv.getRuntime().newString(output.toString()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
|
runtime.getGlobalVariables().set("$?", runtime.newFixnum( runInShell(runtime, aString.toString(), output))); | ByteArrayOutputStream output = new ByteArrayOutputStream(); int resultCode = runInShell(runtime, new IRubyObject[] {aString}, output); recv.getRuntime().getGlobalVariables().set("$?", runtime.newFixnum(resultCode)); | public static IRubyObject backquote(IRubyObject recv, IRubyObject aString) { StringBuffer output = new StringBuffer(); IRuby runtime = recv.getRuntime(); runtime.getGlobalVariables().set("$?", runtime.newFixnum( runInShell(runtime, aString.toString(), output))); return recv.getRuntime().newString(output.toString()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
StringTokenizer toker = new StringTokenizer(command, " "); StringBuffer executable = new StringBuffer(); boolean insideQuotes = false; char quoteChar = 0; loop: while (true) { String token = toker.nextToken(); if (!insideQuotes) { char first = token.charAt(0); switch (first) { case '"': case '\'': insideQuotes = true; quoteChar = first; executable.append(token + " "); break; default: executable.append(token); break loop; } } else { char last = token.charAt(token.length() - 1); executable.append(token); if (last == quoteChar) { insideQuotes = false; break loop; } else { executable.append(" "); } } | String executable = "", remainder = ""; command = command.trim(); if (command.startsWith("'")) { String [] tokens = command.split("'", 3); executable = "'"+tokens[1]+"'"; if (tokens.length > 2) remainder = tokens[2]; } else if (command.startsWith("\"")) { String [] tokens = command.split("\"", 3); executable = "\""+tokens[1]+"\""; if (tokens.length > 2) remainder = tokens[2]; } else { String [] tokens = command.split(" ", 2); executable = tokens[0]; if (tokens.length > 1) remainder = " "+tokens[1]; | private static String repairDirSeps(String command) { // TODO: This could be improved and optimized StringTokenizer toker = new StringTokenizer(command, " "); StringBuffer executable = new StringBuffer(); boolean insideQuotes = false; char quoteChar = 0; loop: while (true) { String token = toker.nextToken(); if (!insideQuotes) { char first = token.charAt(0); switch (first) { case '"': case '\'': insideQuotes = true; quoteChar = first; executable.append(token + " "); break; default: executable.append(token); break loop; } } else { char last = token.charAt(token.length() - 1); executable.append(token); if (last == quoteChar) { insideQuotes = false; break loop; } else { executable.append(" "); } } } String remainder = command.substring(executable.length()); // Matcher.replaceAll treats backslashes in the replacement string as escaped characters String replacement = File.separator; if (File.separatorChar == '\\') replacement = "\\\\"; return PATH_SEPARATORS.matcher(executable).replaceAll(replacement) + remainder; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
String remainder = command.substring(executable.length()); | private static String repairDirSeps(String command) { // TODO: This could be improved and optimized StringTokenizer toker = new StringTokenizer(command, " "); StringBuffer executable = new StringBuffer(); boolean insideQuotes = false; char quoteChar = 0; loop: while (true) { String token = toker.nextToken(); if (!insideQuotes) { char first = token.charAt(0); switch (first) { case '"': case '\'': insideQuotes = true; quoteChar = first; executable.append(token + " "); break; default: executable.append(token); break loop; } } else { char last = token.charAt(token.length() - 1); executable.append(token); if (last == quoteChar) { insideQuotes = false; break loop; } else { executable.append(" "); } } } String remainder = command.substring(executable.length()); // Matcher.replaceAll treats backslashes in the replacement string as escaped characters String replacement = File.separator; if (File.separatorChar == '\\') replacement = "\\\\"; return PATH_SEPARATORS.matcher(executable).replaceAll(replacement) + remainder; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
|
if (File.separatorChar == '\\') replacement = "\\\\"; | if (File.separatorChar == '\\') replacement = "\\\\"; | private static String repairDirSeps(String command) { // TODO: This could be improved and optimized StringTokenizer toker = new StringTokenizer(command, " "); StringBuffer executable = new StringBuffer(); boolean insideQuotes = false; char quoteChar = 0; loop: while (true) { String token = toker.nextToken(); if (!insideQuotes) { char first = token.charAt(0); switch (first) { case '"': case '\'': insideQuotes = true; quoteChar = first; executable.append(token + " "); break; default: executable.append(token); break loop; } } else { char last = token.charAt(token.length() - 1); executable.append(token); if (last == quoteChar) { insideQuotes = false; break loop; } else { executable.append(" "); } } } String remainder = command.substring(executable.length()); // Matcher.replaceAll treats backslashes in the replacement string as escaped characters String replacement = File.separator; if (File.separatorChar == '\\') replacement = "\\\\"; return PATH_SEPARATORS.matcher(executable).replaceAll(replacement) + remainder; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
} | } | private static String repairDirSeps(String command) { // TODO: This could be improved and optimized StringTokenizer toker = new StringTokenizer(command, " "); StringBuffer executable = new StringBuffer(); boolean insideQuotes = false; char quoteChar = 0; loop: while (true) { String token = toker.nextToken(); if (!insideQuotes) { char first = token.charAt(0); switch (first) { case '"': case '\'': insideQuotes = true; quoteChar = first; executable.append(token + " "); break; default: executable.append(token); break loop; } } else { char last = token.charAt(token.length() - 1); executable.append(token); if (last == quoteChar) { insideQuotes = false; break loop; } else { executable.append(" "); } } } String remainder = command.substring(executable.length()); // Matcher.replaceAll treats backslashes in the replacement string as escaped characters String replacement = File.separator; if (File.separatorChar == '\\') replacement = "\\\\"; return PATH_SEPARATORS.matcher(executable).replaceAll(replacement) + remainder; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
private static int runInShell(IRuby runtime, String command, StringBuffer output) { | private static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { | private static int runInShell(IRuby runtime, String command, StringBuffer output) { try { String shell = System.getProperty("jruby.shell"); Process aProcess; String shellSwitch = "-c"; command = repairDirSeps(command); if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; } aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); } else { aProcess = Runtime.getRuntime().exec(command); } final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
Process aProcess; String shellSwitch = "-c"; | rawArgs[0] = runtime.newString(repairDirSeps(rawArgs[0].toString())); Process aProcess = null; InProcessScript ipScript = null; | private static int runInShell(IRuby runtime, String command, StringBuffer output) { try { String shell = System.getProperty("jruby.shell"); Process aProcess; String shellSwitch = "-c"; command = repairDirSeps(command); if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; } aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); } else { aProcess = Runtime.getRuntime().exec(command); } final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
command = repairDirSeps(command); | if (isRubyCommand(rawArgs[0].toString())) { List args = parseCommandLine(rawArgs); PrintStream redirect = new PrintStream(output); String command = (String)args.get(0); String[] argArray = new String[args.size()-1]; int startIndex = command.endsWith(".rb") ? 0 : 1; args.subList(startIndex,args.size()).toArray(argArray); ipScript = new InProcessScript(argArray, System.in, redirect, redirect); ipScript.start(); ipScript.join(); } else if (shell != null && rawArgs.length == 1) { String shellSwitch = shell.endsWith("sh") ? "-c" : "/c"; String[] argArray = new String[3]; argArray[0] = shell; argArray[1] = shellSwitch; argArray[2] = rawArgs[0].toString(); aProcess = Runtime.getRuntime().exec(argArray); } else { if (rawArgs.length > 1) { String[] argArray = new String[rawArgs.length]; for (int i=0;i<rawArgs.length;i++) { argArray[i] = rawArgs[i].toString(); } aProcess = Runtime.getRuntime().exec(argArray); } else { aProcess = Runtime.getRuntime().exec(rawArgs[0].toString()); } } | private static int runInShell(IRuby runtime, String command, StringBuffer output) { try { String shell = System.getProperty("jruby.shell"); Process aProcess; String shellSwitch = "-c"; command = repairDirSeps(command); if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; } aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); } else { aProcess = Runtime.getRuntime().exec(command); } final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; | if (aProcess != null) { InputStream processOutput = aProcess.getInputStream(); int b; boolean crSeen = false; while ((b = processOutput.read()) != -1) { if (b == '\r') { crSeen = true; } else { if (crSeen) { if (b != '\n') { output.write('\r'); } crSeen = false; } output.write(b); } | private static int runInShell(IRuby runtime, String command, StringBuffer output) { try { String shell = System.getProperty("jruby.shell"); Process aProcess; String shellSwitch = "-c"; command = repairDirSeps(command); if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; } aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); } else { aProcess = Runtime.getRuntime().exec(command); } final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); | if (crSeen) { output.write('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); processOutput.close(); return aProcess.waitFor(); } else if (ipScript != null) { return ipScript.getResult(); | private static int runInShell(IRuby runtime, String command, StringBuffer output) { try { String shell = System.getProperty("jruby.shell"); Process aProcess; String shellSwitch = "-c"; command = repairDirSeps(command); if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; } aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); } else { aProcess = Runtime.getRuntime().exec(command); } final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
aProcess = Runtime.getRuntime().exec(command); | return 0; | private static int runInShell(IRuby runtime, String command, StringBuffer output) { try { String shell = System.getProperty("jruby.shell"); Process aProcess; String shellSwitch = "-c"; command = repairDirSeps(command); if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; } aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); } else { aProcess = Runtime.getRuntime().exec(command); } final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); | private static int runInShell(IRuby runtime, String command, StringBuffer output) { try { String shell = System.getProperty("jruby.shell"); Process aProcess; String shellSwitch = "-c"; command = repairDirSeps(command); if (shell != null) { if (!shell.endsWith("sh")) { shellSwitch = "/c"; } aProcess = Runtime.getRuntime().exec(new String[] { shell, shellSwitch, command }); } else { aProcess = Runtime.getRuntime().exec(command); } final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int c; boolean crSeen = false; while ((c = reader.read()) != -1) { if (c == '\r') { crSeen = true; } else { if (crSeen) { if (c != '\n') { output.append('\r'); } crSeen = false; } output.append((char)c); } } if (crSeen) { output.append('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); reader.close(); return aProcess.waitFor(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
|
if (args.length > 1) { throw runtime.newArgumentError("more arguments not yet supported"); } StringBuffer output = new StringBuffer(); int resultCode = runInShell(runtime, args[0].toString(), output); | ByteArrayOutputStream output = new ByteArrayOutputStream(); int resultCode = runInShell(runtime, args, output); | public static RubyBoolean system(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); if (args.length > 1) { throw runtime.newArgumentError("more arguments not yet supported"); } StringBuffer output = new StringBuffer(); int resultCode = runInShell(runtime, args[0].toString(), output); recv.getRuntime().getGlobalVariables().set("$?", runtime.newFixnum(resultCode)); return runtime.newBoolean(resultCode == 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
RubyString stringPattern = RubyString.stringValue(args[0]); if (stringPattern.getValue().equals(" ")) { | String stringPattern = RubyString.stringValue(args[0]).getValue(); if (stringPattern.equals(" ")) { | private RubyRegexp getPattern(IRubyObject[] args) { if (args.length == 0) { return RubyRegexp.newRegexp(runtime, "\\s+", 0); } if (args[0] instanceof RubyRegexp) { return RubyRegexp.regexpValue(args[0]); } else { RubyString stringPattern = RubyString.stringValue(args[0]); if (stringPattern.getValue().equals(" ")) { return RubyRegexp.newRegexp(runtime, "\\s+", 0); } else { return RubyRegexp.newRegexp(stringPattern, 0); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/Split.java/buggy/src/org/jruby/util/Split.java |
return RubyRegexp.newRegexp(stringPattern, 0); | return RubyRegexp.newRegexp(runtime, unescapeString(stringPattern), 0); | private RubyRegexp getPattern(IRubyObject[] args) { if (args.length == 0) { return RubyRegexp.newRegexp(runtime, "\\s+", 0); } if (args[0] instanceof RubyRegexp) { return RubyRegexp.regexpValue(args[0]); } else { RubyString stringPattern = RubyString.stringValue(args[0]); if (stringPattern.getValue().equals(" ")) { return RubyRegexp.newRegexp(runtime, "\\s+", 0); } else { return RubyRegexp.newRegexp(stringPattern, 0); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/Split.java/buggy/src/org/jruby/util/Split.java |
addResult(substring(splitee, pos, (beg == pos && end == beg) ? 1 : beg - pos)); long extraPatterns = matchData.getSize(); for (int i = 1; i < extraPatterns; i++) { addResult(((RubyString) matchData.group(i)).getValue()); | if (beg != 0 || beg == 0 && beg == end) { addResult(substring(splitee, pos, (beg == pos && end == beg) ? 1 : beg - pos)); long extraPatterns = matchData.getSize(); for (int i = 1; i < extraPatterns; i++) { addResult(((RubyString) matchData.group(i)).getValue()); } | private void process() { if (limit == 1) { result.add(splitee); return; } int pos = 0; int beg = 0; int hits = 0; int len = splitee.length(); RubyString rubySplitee = RubyString.newString(runtime, splitee); while ((beg = pattern.search(rubySplitee, pos)) > -1) { hits++; RubyMatchData matchData = (RubyMatchData) runtime.getBackref(); int end = matchData.matchEndPosition(); addResult(substring(splitee, pos, (beg == pos && end == beg) ? 1 : beg - pos)); // Add to list any /(.)/ matched. long extraPatterns = matchData.getSize(); for (int i = 1; i < extraPatterns; i++) { addResult(((RubyString) matchData.group(i)).getValue()); } pos = (end == beg) ? beg + 1 : end; if (hits + 1 == limit) { break; } } if (hits == 0) { addResult(splitee); } else if (pos <= len) { addResult(substring(splitee, pos, len - pos)); } if (limit == 0) { while (((String) result.get(result.size() - 1)).length() == 0) { result.remove(result.size() - 1); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4e8afef0dba3b66a390c9ba70b997174b975fc0e/Split.java/buggy/src/org/jruby/util/Split.java |
public Clazz(String longName) | private Clazz(String longName) | public Clazz(String longName) { if (longName == null) { throw new IllegalArgumentException("Class name can not be null."); } lines = new TreeMap(); packageName = ClassHelper.getPackageName(longName); name = ClassHelper.getBaseName(longName); numberOfBranches = 0; numberOfCoveredBranches = 0; numberOfCoveredLines = 0; numberOfLines = 0; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
numberOfBranches = 0; numberOfCoveredBranches = 0; numberOfCoveredLines = 0; numberOfLines = 0; | public Clazz(String longName) { if (longName == null) { throw new IllegalArgumentException("Class name can not be null."); } lines = new TreeMap(); packageName = ClassHelper.getPackageName(longName); name = ClassHelper.getBaseName(longName); numberOfBranches = 0; numberOfCoveredBranches = 0; numberOfCoveredLines = 0; numberOfLines = 0; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
|
return numberOfBranches; | return getRawCoverageData().getNumberOfValidBranches(); | public int getNumberOfBranches() { return numberOfBranches; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
return numberOfCoveredBranches; | return getRawCoverageData().getNumberOfCoveredBranches(); | public int getNumberOfCoveredBranches() { return numberOfCoveredBranches; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
return numberOfCoveredLines; | return getRawCoverageData().getNumberOfCoveredLines(); | public int getNumberOfCoveredLines() { return numberOfCoveredLines; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
return numberOfLines; | return getRawCoverageData().getNumberOfValidLines(); | public int getNumberOfLines() { return numberOfLines; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
public final void setRawCoverageData(CoverageData rawCoverageData) | private final void setRawCoverageData(CoverageData rawCoverageData) | public final void setRawCoverageData(CoverageData rawCoverageData) { this.rawCoverageData = rawCoverageData; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/100512ee483a0d8eebc3eb78a5d8913b7b64ddb6/Clazz.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Clazz.java |
symbolClass.defineMethod("freeze", CallbackFactory.getSelfMethod()); symbolClass.defineMethod("taint", CallbackFactory.getSelfMethod()); | symbolClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); symbolClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); | public static RubyClass createSymbolClass(Ruby ruby) { RubyClass symbolClass = ruby.defineClass("Symbol", ruby.getClasses().getObjectClass()); symbolClass.getRubyClass().undefMethod("new"); symbolClass.defineMethod("id", CallbackFactory.getMethod(RubySymbol.class, "id")); symbolClass.defineMethod("to_i", CallbackFactory.getMethod(RubySymbol.class, "to_i")); symbolClass.defineMethod("to_int", CallbackFactory.getMethod(RubySymbol.class, "to_i")); symbolClass.defineMethod("id2name", CallbackFactory.getMethod(RubySymbol.class, "to_s")); symbolClass.defineMethod("to_s", CallbackFactory.getMethod(RubySymbol.class, "to_s")); symbolClass.defineMethod("==", CallbackFactory.getMethod(RubySymbol.class, "equal", RubyObject.class)); symbolClass.defineMethod("inspect", CallbackFactory.getMethod(RubySymbol.class, "inspect")); symbolClass.defineMethod("hash", CallbackFactory.getMethod(RubySymbol.class, "hash")); symbolClass.defineMethod("dup", CallbackFactory.getMethod(RubySymbol.class, "rbClone")); symbolClass.defineMethod("clone", CallbackFactory.getMethod(RubySymbol.class, "rbClone")); symbolClass.defineMethod("freeze", CallbackFactory.getSelfMethod()); symbolClass.defineMethod("taint", CallbackFactory.getSelfMethod()); return symbolClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubySymbol.java/clean/org/jruby/RubySymbol.java |
super(ruby, ruby.getExceptions().getTypeError(), msg); | super(ruby, ruby.getExceptions().getLoadError(), msg); | public LoadError(Ruby ruby, String msg) { super(ruby, ruby.getExceptions().getTypeError(), msg); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ba3690bf7000d9d0f7aa1e0a81b4fd959794da8f/LoadError.java/buggy/org/jruby/exceptions/LoadError.java |
return Integer.parseInt(view.getMPane().getMovieEndT().getText()); | return Integer.parseInt(view.mPane.movieEndT.getText()); | public int getEndT() { return Integer.parseInt(view.getMPane().getMovieEndT().getText()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ba2070eeb46c459cbb8ad43439d3f9ab12cf63e3/PlayerUIMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/PlayerUIMng.java |
return Integer.parseInt(view.getMPane().getMovieEndZ().getText()); | return Integer.parseInt(view.mPane.movieEndZ.getText()); | public int getEndZ() { return Integer.parseInt(view.getMPane().getMovieEndZ().getText()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ba2070eeb46c459cbb8ad43439d3f9ab12cf63e3/PlayerUIMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/PlayerUIMng.java |
return Integer.parseInt(view.getMPane().getMovieStartT().getText()); | return Integer.parseInt(view.mPane.movieStartT.getText()); | public int getStartT() { return Integer.parseInt(view.getMPane().getMovieStartT().getText()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ba2070eeb46c459cbb8ad43439d3f9ab12cf63e3/PlayerUIMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/PlayerUIMng.java |
return Integer.parseInt(view.getMPane().getMovieStartZ().getText()); | return Integer.parseInt(view.mPane.movieStartZ.getText()); | public int getStartZ() { return Integer.parseInt(view.getMPane().getMovieStartZ().getText()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ba2070eeb46c459cbb8ad43439d3f9ab12cf63e3/PlayerUIMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/PlayerUIMng.java |
view.getCPane().getPlay().setBorderPainted(b); | view.cPane.play.setBorderPainted(b); | public void setBorderPlay(boolean b) { view.getCPane().getPlay().setBorderPainted(b); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ba2070eeb46c459cbb8ad43439d3f9ab12cf63e3/PlayerUIMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/PlayerUIMng.java |
if (!playerManager.isPlaying()) playerManager.setMovieType(type); | stop(); setBorderPlay(false); playerManager.setMovieType(type); | void setMovieType(int type) { if (!playerManager.isPlaying()) playerManager.setMovieType(type); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ba2070eeb46c459cbb8ad43439d3f9ab12cf63e3/PlayerUIMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/PlayerUIMng.java |
if (!playerManager.isPlaying()) playerManager.setTimerDelay(rate); | stop(); setBorderPlay(false); playerManager.setTimerDelay(rate); | void setTimerDelay(int rate) { if (!playerManager.isPlaying()) playerManager.setTimerDelay(rate); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ba2070eeb46c459cbb8ad43439d3f9ab12cf63e3/PlayerUIMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/PlayerUIMng.java |
table.setValueAt(l, k, ContextPane.NAME); table.setValueAt(Boolean.FALSE, k, ContextPane.BOOLEAN); | table.setValueAt(l, k, ContextDialog.NAME); table.setValueAt(Boolean.FALSE, k, ContextDialog.BOOLEAN); | private void buildTable(List toSelect, String name) { table = new TableComponent(toSelect.size(), 3); JPanel p; ColoredButton button; int w = table.getColumnModel().getColumn(2).getPreferredWidth(); int h = table.getRowHeight(); Dimension d = new Dimension(Math.min(w, h)-3, Math.min(w, h)-3); Iterator i = toSelect.iterator(); int j, k; k = 0; Integer l; while (i.hasNext()) { l = (Integer) i.next(); table.setValueAt(l, k, ContextPane.NAME); table.setValueAt(Boolean.FALSE, k, ContextPane.BOOLEAN); j = k%MODULO; button = getButton(defaultColors[j]); manager.attachButtonListener(button, k); p = buildComponentPanel(button, d); table.setValueAt(p, k, ContextPane.BUTTON); k++; } TableSorter sorter = new TableSorter(table.getModel()); table.setModel(sorter); sorter.addMouseListenerToHeaderInTable(table); sorter.sortByColumn(0); setTableHeader(name); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/SelectionPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/graphic/SelectionPane.java |
table.setValueAt(p, k, ContextPane.BUTTON); | table.setValueAt(p, k, ContextDialog.BUTTON); | private void buildTable(List toSelect, String name) { table = new TableComponent(toSelect.size(), 3); JPanel p; ColoredButton button; int w = table.getColumnModel().getColumn(2).getPreferredWidth(); int h = table.getRowHeight(); Dimension d = new Dimension(Math.min(w, h)-3, Math.min(w, h)-3); Iterator i = toSelect.iterator(); int j, k; k = 0; Integer l; while (i.hasNext()) { l = (Integer) i.next(); table.setValueAt(l, k, ContextPane.NAME); table.setValueAt(Boolean.FALSE, k, ContextPane.BOOLEAN); j = k%MODULO; button = getButton(defaultColors[j]); manager.attachButtonListener(button, k); p = buildComponentPanel(button, d); table.setValueAt(p, k, ContextPane.BUTTON); k++; } TableSorter sorter = new TableSorter(table.getModel()); table.setModel(sorter); sorter.addMouseListenerToHeaderInTable(table); sorter.sortByColumn(0); setTableHeader(name); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/SelectionPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/graphic/SelectionPane.java |
setTableColumnHeader(tcm.getColumn(ContextPane.NAME), rnd, up, down, s); setTableColumnHeader(tcm.getColumn(ContextPane.BOOLEAN), rnd, up, down, | setTableColumnHeader(tcm.getColumn(ContextDialog.NAME), rnd, up, down, s); setTableColumnHeader(tcm.getColumn(ContextDialog.BOOLEAN), rnd, up, down, | private void setTableHeader(String s) { IconManager im = IconManager.getInstance(getRegistry()); TableIconRenderer rnd = new TableIconRenderer(); TableColumnModel tcm = table.getTableHeader().getColumnModel(); Icon up = im.getIcon(IconManager.UP), down = im.getIcon(IconManager.DOWN); setTableColumnHeader(tcm.getColumn(ContextPane.NAME), rnd, up, down, s); setTableColumnHeader(tcm.getColumn(ContextPane.BOOLEAN), rnd, up, down, ""); setTableColumnHeader(tcm.getColumn(ContextPane.BUTTON), rnd, null, null, ""); table.setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); table.setDefaultEditor(JComponent.class, new TableComponentCellEditor()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/SelectionPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/graphic/SelectionPane.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.