rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
ParseTool(String name, Reader inputStream) { _escaped = false; _name = name; LineNumberReader in = new LineNumberReader(inputStream); _cur = _last = _len = _pos = EOF; _buf = ""; _in = in; for (int i = 0; i < MAX_MARKS; i++) { _marks[i] = new Mark(); } read(); | ParseTool(String name, InputStream in) throws IOException { this(name, new InputStreamReader(in)); | ParseTool(String name, Reader inputStream) { _escaped = false; _name = name; LineNumberReader in = new LineNumberReader(inputStream); _cur = _last = _len = _pos = EOF; _buf = ""; // must be non-null or we will abort before we start _in = in; for (int i = 0; i < MAX_MARKS; i++) { _marks[i] = new Mark(); } read(); // get it started (read the extra newline) } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b09d2b26d0e942a7d01885758ceee8a4a6c40b05/ParseTool.java/buggy/webmacro/src/org/webmacro/engine/ParseTool.java |
public final void parseUntil(StringBuffer buf, String marker) throws ParseException | public final boolean parseUntil(StringBuffer buf, char c) throws IOException | public final void parseUntil(StringBuffer buf, String marker) throws ParseException { if (marker == null) { return; } if (marker.length() < 1) { return; } char start = marker.charAt(0); int mark = DUMMY_MARK; buf.setLength(0); LOOKING: while(_cur != EOF) { if (_cur == start) { mark = mark(); try { for (int i = 0; i < marker.length(); i++) { if (_cur != marker.charAt(i)) { rewind(mark); buf.append((char) _cur); read(); continue LOOKING; } read(); } buf.append(marker); return; } finally { clearMark(mark); } } buf.append((char) _cur); read(); } clearMark(mark); throw new ParseException(this,"Expected " + marker + " but reached end of file"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b09d2b26d0e942a7d01885758ceee8a4a6c40b05/ParseTool.java/buggy/webmacro/src/org/webmacro/engine/ParseTool.java |
if (marker == null) { return; } if (marker.length() < 1) { return; } char start = marker.charAt(0); int mark = DUMMY_MARK; buf.setLength(0); LOOKING: while(_cur != EOF) { if (_cur == start) { mark = mark(); try { for (int i = 0; i < marker.length(); i++) { if (_cur != marker.charAt(i)) { rewind(mark); buf.append((char) _cur); read(); continue LOOKING; } read(); } buf.append(marker); return; } finally { clearMark(mark); } } | boolean readSome = false; while (((_cur != c) || _escaped) && (_cur != EOF)) { | public final void parseUntil(StringBuffer buf, String marker) throws ParseException { if (marker == null) { return; } if (marker.length() < 1) { return; } char start = marker.charAt(0); int mark = DUMMY_MARK; buf.setLength(0); LOOKING: while(_cur != EOF) { if (_cur == start) { mark = mark(); try { for (int i = 0; i < marker.length(); i++) { if (_cur != marker.charAt(i)) { rewind(mark); buf.append((char) _cur); read(); continue LOOKING; } read(); } buf.append(marker); return; } finally { clearMark(mark); } } buf.append((char) _cur); read(); } clearMark(mark); throw new ParseException(this,"Expected " + marker + " but reached end of file"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b09d2b26d0e942a7d01885758ceee8a4a6c40b05/ParseTool.java/buggy/webmacro/src/org/webmacro/engine/ParseTool.java |
clearMark(mark); throw new ParseException(this,"Expected " + marker + " but reached end of file"); | return readSome; | public final void parseUntil(StringBuffer buf, String marker) throws ParseException { if (marker == null) { return; } if (marker.length() < 1) { return; } char start = marker.charAt(0); int mark = DUMMY_MARK; buf.setLength(0); LOOKING: while(_cur != EOF) { if (_cur == start) { mark = mark(); try { for (int i = 0; i < marker.length(); i++) { if (_cur != marker.charAt(i)) { rewind(mark); buf.append((char) _cur); read(); continue LOOKING; } read(); } buf.append(marker); return; } finally { clearMark(mark); } } buf.append((char) _cur); read(); } clearMark(mark); throw new ParseException(this,"Expected " + marker + " but reached end of file"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b09d2b26d0e942a7d01885758ceee8a4a6c40b05/ParseTool.java/buggy/webmacro/src/org/webmacro/engine/ParseTool.java |
public final boolean isNameStartChar() { return isNameStartChar(_cur); | static public final boolean isNameStartChar(int c) { return ((c != '$') && (Character.isJavaIdentifierStart((char) c))); | public final boolean isNameStartChar() { return isNameStartChar(_cur); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b09d2b26d0e942a7d01885758ceee8a4a6c40b05/ParseTool.java/buggy/webmacro/src/org/webmacro/engine/ParseTool.java |
context.create("clone", CLONE, 0); | context.create("clone", RBCLONE, 0); | protected void defineMethods(MethodContext context) { context.create("==", EQUAL, 1); context.createAlias("===", "=="); context.create("=~", MATCH, 1); context.create("class", TYPE, 0); context.create("clone", CLONE, 0); context.create("dup", DUP, 0); context.create("eql?", EQUAL, 1); context.createAlias("equal?", "=="); context.createOptional("extend", EXTEND, 1); context.create("freeze", FREEZE, 0); context.create("frozen?", FROZEN, 0); context.create("hash", HASH, 0); context.create("id", ID, 0); context.create("__id__", ID, 0); context.create("inspect", INSPECT, 0); context.createOptional("instance_eval", INSTANCE_EVAL); context.create("instance_of?", INSTANCE_OF, 1); context.create("instance_variables", INSTANCE_VARIABLES, 0); context.create("is_a?", KIND_OF, 1); context.create("kind_of?", KIND_OF, 1); context.create("method", METHOD, 1); context.create("methods", METHODS, 0); context.createOptional("method_missing", METHOD_MISSING); context.create("nil?", NIL, 0); context.create("private_methods", PRIVATE_METHODS, 0); context.create("protected_methods", PROTECTED_METHODS, 0); context.create("public_methods", METHODS, 0); context.createOptional("respond_to?", RESPOND_TO, 1); context.createOptional("send", SEND, 1); context.createOptional("__send__", SEND, 1); context.create("singleton_methods", SINGLETON_METHODS, 0); context.create("taint", TAINT, 0); context.create("tainted?", TAINTED, 0); context.create("to_a", TO_A, 0); context.create("to_s", TO_S, 0); context.create("type", TYPE, 0); context.create("untaint", UNTAINT, 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/dcea3e9f2f6ecba04f862dbfb01b220d7890a706/ObjectDefinition.java/clean/src/org/jruby/internal/runtime/builtin/definitions/ObjectDefinition.java |
context.create("frozen?", FROZEN, 0); | context.create("frozen?", FROZEN_P, 0); | protected void defineMethods(MethodContext context) { context.create("==", EQUAL, 1); context.createAlias("===", "=="); context.create("=~", MATCH, 1); context.create("class", TYPE, 0); context.create("clone", CLONE, 0); context.create("dup", DUP, 0); context.create("eql?", EQUAL, 1); context.createAlias("equal?", "=="); context.createOptional("extend", EXTEND, 1); context.create("freeze", FREEZE, 0); context.create("frozen?", FROZEN, 0); context.create("hash", HASH, 0); context.create("id", ID, 0); context.create("__id__", ID, 0); context.create("inspect", INSPECT, 0); context.createOptional("instance_eval", INSTANCE_EVAL); context.create("instance_of?", INSTANCE_OF, 1); context.create("instance_variables", INSTANCE_VARIABLES, 0); context.create("is_a?", KIND_OF, 1); context.create("kind_of?", KIND_OF, 1); context.create("method", METHOD, 1); context.create("methods", METHODS, 0); context.createOptional("method_missing", METHOD_MISSING); context.create("nil?", NIL, 0); context.create("private_methods", PRIVATE_METHODS, 0); context.create("protected_methods", PROTECTED_METHODS, 0); context.create("public_methods", METHODS, 0); context.createOptional("respond_to?", RESPOND_TO, 1); context.createOptional("send", SEND, 1); context.createOptional("__send__", SEND, 1); context.create("singleton_methods", SINGLETON_METHODS, 0); context.create("taint", TAINT, 0); context.create("tainted?", TAINTED, 0); context.create("to_a", TO_A, 0); context.create("to_s", TO_S, 0); context.create("type", TYPE, 0); context.create("untaint", UNTAINT, 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/dcea3e9f2f6ecba04f862dbfb01b220d7890a706/ObjectDefinition.java/clean/src/org/jruby/internal/runtime/builtin/definitions/ObjectDefinition.java |
public void bind(String name, Object obj) | public void bind(String name, Object value) | public void bind(String name, Object obj) { entriesMap.put(name, obj); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/930bc29b9720793c48424a89988a93925f544043/RegistryImpl.java/buggy/SRC/org/openmicroscopy/shoola/env/config/RegistryImpl.java |
entriesMap.put(name, obj); | if (name != null) { ObjectEntry entry = new ObjectEntry(name); entry.setContent(value); entriesMap.put(name, entry); } | public void bind(String name, Object obj) { entriesMap.put(name, obj); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/930bc29b9720793c48424a89988a93925f544043/RegistryImpl.java/buggy/SRC/org/openmicroscopy/shoola/env/config/RegistryImpl.java |
public static RubyModule m_new(Ruby ruby, RubyModule rubyClass) { | public static RubyModule m_new(Ruby ruby, RubyObject recv) { | public static RubyModule m_new(Ruby ruby, RubyModule rubyClass) { RubyModule mod = RubyModule.m_newModule(ruby); mod.setRubyClass(rubyClass); ruby.getModuleClass().callInit(null); return mod; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a9420f23379e292698ea011ab08fb480b4decbcc/RubyModule.java/buggy/org/jruby/RubyModule.java |
mod.setRubyClass(rubyClass); | mod.setRubyClass((RubyModule)recv); | public static RubyModule m_new(Ruby ruby, RubyModule rubyClass) { RubyModule mod = RubyModule.m_newModule(ruby); mod.setRubyClass(rubyClass); ruby.getModuleClass().callInit(null); return mod; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a9420f23379e292698ea011ab08fb480b4decbcc/RubyModule.java/buggy/org/jruby/RubyModule.java |
input.register(result); | public static RubyArray unmarshalFrom(UnmarshalStream input) throws java.io.IOException { RubyArray result = newArray(input.getRuntime()); int size = input.unmarshalInt(); for (int i = 0; i < size; i++) { result.append(input.unmarshalObject()); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9db4d278a734c4fdfd9a83ed95575a45577f1e1b/RubyArray.java/clean/org/jruby/RubyArray.java |
|
return new PDILoader(component, images); | return new PDILoader(component, ids); | protected DataLoader createHierarchyLoader() { Set ids = new HashSet(images.size()); Iterator i = images.iterator(); while (i.hasNext()) ids.add(new Integer(((ImageData) i.next()).getId())); switch (type) { case HiViewer.PDI_HIERARCHY: return new PDILoader(component, images); case HiViewer.CGCI_HIERARCHY: return new CGCILoader(component, ids); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64ee7ec527da3cc538fcd8d0a21183719f854676/HierarchyModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HierarchyModel.java |
RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_mul(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_mul(other); } else { long otherValue = other.getLongValue(); long result = value * otherValue; if (result > MAX || result < MIN || result / otherValue != value) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_mul(other); } else { return newFixnum(result); } } | return numericValue(num).multiplyWith(this); | public RubyNumeric op_mul(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_mul(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_mul(other); } else { long otherValue = other.getLongValue(); long result = value * otherValue; if (result > MAX || result < MIN || result / otherValue != value) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_mul(other); } else { return newFixnum(result); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a25fc494ea7daeb4b5b479e0173372332cf7d4ac/RubyFixnum.java/clean/src/org/jruby/RubyFixnum.java |
JPanel p = new JPanel(); p.setLayout(new BorderLayout(0, 0)); p.add(histogramPanel, BorderLayout.CENTER); getContentPane().add(p); | getContentPane().add(histogramPanel); | void buildGUI() { JPanel p = new JPanel(); p.setLayout(new BorderLayout(0, 0)); p.add(histogramPanel, BorderLayout.CENTER); //getContentPane().add(histogramPanel); getContentPane().add(p); setSize(HistogramPanel.WIDTH, HEIGHT_WIN); setResizable(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6a28b54c142c80cf786f76c45b6be256d92fd0bb/HistogramDialog.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialog.java |
{ this.view = view; this.control = control; inputStartKnob = false; inputEndKnob = false; | { this.view = view; this.control = control; inputStartKnob = false; inputEndKnob = false; | HistogramDialogManager(HistogramDialog view, QuantumPaneManager control) { this.view = view; this.control = control; inputStartKnob = false; inputEndKnob = false; boxInputStart = new Rectangle(); boxInputEnd = new Rectangle(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
} | } | HistogramDialogManager(HistogramDialog view, QuantumPaneManager control) { this.view = view; this.control = control; inputStartKnob = false; inputEndKnob = false; boxInputStart = new Rectangle(); boxInputEnd = new Rectangle(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
{ lS = HistogramPanel.leftBorder+view.getHistogramPanel().getWidthStat(); | { lS = HistogramPanel.leftBorder+view.getHistogramPanel().getWidthStat(); | void initRectangles(int yStart, int yEnd) { lS = HistogramPanel.leftBorder+view.getHistogramPanel().getWidthStat(); setInputStartBox(yStart); setInputEndBox(yEnd); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
} | } | void initRectangles(int yStart, int yEnd) { lS = HistogramPanel.leftBorder+view.getHistogramPanel().getWidthStat(); setInputStartBox(yStart); setInputEndBox(yEnd); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
{ view.getHistogramPanel().addMouseListener(this); view.getHistogramPanel().addMouseMotionListener(this); view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { view.dispose(); } }); } | { view.getHistogramPanel().addMouseListener(this); view.getHistogramPanel().addMouseMotionListener(this); view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { view.dispose(); } }); } | void attachListeners() { view.getHistogramPanel().addMouseListener(this); view.getHistogramPanel().addMouseMotionListener(this); view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { view.dispose(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
PixelsDimensions pxsDims = renderingControl.getPixelsDims(); | private void handleImageLoaded(ImageLoaded response) { LoadImage request = (LoadImage) response.getACT(); renderingControl = response.getProxy(); PixelsDimensions pxsDims = renderingControl.getPixelsDims(); //TODO: REMOVE COMMENTS //control.removeProgressNotifier(); if (curImageID != request.getImageID()) { if (presentation == null) buildPresentation(pxsDims); initPresentation(request.getImageName(), pxsDims, false); curImageID = request.getImageID(); curPixelsID = request.getPixelsID(); registry.getEventBus().post(new RenderImage(curPixelsID)); // have to dispose all windows linked control.disposeDialogs(); } showPresentation(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/02bc3351cbc1f2e45d28539c79317f881c2ec11b/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
|
if (curImageID != request.getImageID()) { if (presentation == null) buildPresentation(pxsDims); | if (curImageID != request.getImageID()) { presentationDispose(); PixelsDimensions pxsDims = renderingControl.getPixelsDims(); buildPresentation(pxsDims); | private void handleImageLoaded(ImageLoaded response) { LoadImage request = (LoadImage) response.getACT(); renderingControl = response.getProxy(); PixelsDimensions pxsDims = renderingControl.getPixelsDims(); //TODO: REMOVE COMMENTS //control.removeProgressNotifier(); if (curImageID != request.getImageID()) { if (presentation == null) buildPresentation(pxsDims); initPresentation(request.getImageName(), pxsDims, false); curImageID = request.getImageID(); curPixelsID = request.getPixelsID(); registry.getEventBus().post(new RenderImage(curPixelsID)); // have to dispose all windows linked control.disposeDialogs(); } showPresentation(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/02bc3351cbc1f2e45d28539c79317f881c2ec11b/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
control.disposeDialogs(); } showPresentation(); | } else presentation.deIconify(); | private void handleImageLoaded(ImageLoaded response) { LoadImage request = (LoadImage) response.getACT(); renderingControl = response.getProxy(); PixelsDimensions pxsDims = renderingControl.getPixelsDims(); //TODO: REMOVE COMMENTS //control.removeProgressNotifier(); if (curImageID != request.getImageID()) { if (presentation == null) buildPresentation(pxsDims); initPresentation(request.getImageName(), pxsDims, false); curImageID = request.getImageID(); curPixelsID = request.getPixelsID(); registry.getEventBus().post(new RenderImage(curPixelsID)); // have to dispose all windows linked control.disposeDialogs(); } showPresentation(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/02bc3351cbc1f2e45d28539c79317f881c2ec11b/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
curImage = null; | private void handleImageRendered(ImageRendered response) { curImage = null; curImage = response.getRenderedImage(); presentation.setImage(curImage); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/02bc3351cbc1f2e45d28539c79317f881c2ec11b/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
|
if (!display) presentation.setOnScreen(); | private void handleImageRendered(ImageRendered response) { curImage = null; curImage = response.getRenderedImage(); presentation.setImage(curImage); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/02bc3351cbc1f2e45d28539c79317f881c2ec11b/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
|
boolean active) | boolean b) | private void initPresentation(String imageName, PixelsDimensions pxsDims, boolean active) { curImageName = imageName; presentation.setDefaultZT(getDefaultT(), getDefaultZ(), pxsDims.sizeT, pxsDims.sizeZ); presentation.setImageName(imageName); presentation.setActive(active); presentation.resetMagFactor(); presentation.setUnitBarSize(pxsDims.pixelSizeX); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/02bc3351cbc1f2e45d28539c79317f881c2ec11b/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
presentation.setActive(active); | presentation.setImageDisplay(b); | private void initPresentation(String imageName, PixelsDimensions pxsDims, boolean active) { curImageName = imageName; presentation.setDefaultZT(getDefaultT(), getDefaultZ(), pxsDims.sizeT, pxsDims.sizeZ); presentation.setImageName(imageName); presentation.setActive(active); presentation.resetMagFactor(); presentation.setUnitBarSize(pxsDims.pixelSizeX); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/02bc3351cbc1f2e45d28539c79317f881c2ec11b/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
if (moviePlayer != null) moviePlayer.dispose(); | if (moviePlayer != null) moviePlayer.close(); | void disposeDialogs() { if (moviePlayer != null) moviePlayer.dispose(); if (imageInspector != null) imageInspector.dispose(); roiOnOff = false; presentation.removeCanvasFromLayer(presentation.getDrawingCanvas()); presentation.getBottomBar().resetMessage(BottomBar.LENS); presentation.getDrawingCanvas().setOnOff(true); moviePlayer = null; imageInspector = null; movieSettings = null; iat.setMagFactor(ImageInspector.ZOOM_DEFAULT); //Need to remove the drawing canvas. and erase all color. // will post an even to kill the ROIAgt. } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0a711d50cfe02a185f8d314b378ca4c49e92ab2f/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
PojosQP.ids(c.getIds(key)), PojosQP.String("field",key) | PojosQP.String("field",key), PojosQP.ids(c.getIds(key)) | private void collectCounts(Collection queryResults, PojoOptions po) { if (po.hasCountFields() && po.isCounts()) { CountCollector c = new CountCollector(po.countFields()); c.collect(queryResults); for (String key : po.countFields()) { Query q_c = queryFactory.lookup( /* TODO po.map() here */ CollectionCountQueryDefinition.class.getName(), PojosQP.ids(c.getIds(key)), PojosQP.String("field",key) ); List l_c = (List) iQuery.execute(q_c); for (Object o : l_c) { Object[] results = (Object[]) o; Long id = (Long) results[0]; Integer count = (Integer) results[1]; c.addCounts(key,id,count); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
@NotNull @Validate(Integer.class) Set rootNodeIds, @Validate(Integer.class) Set annotatorIds, Map options) { | @NotNull @Validate(Long.class) Set rootNodeIds, @Validate(Long.class) Set annotatorIds, Map options) { | public Map findAnnotations(Class rootNodeType, @NotNull @Validate(Integer.class) Set rootNodeIds, @Validate(Integer.class) Set annotatorIds, Map options) { if (rootNodeIds.size()==0) return new HashMap(); PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.FindAnnotationsQueryDefinition", PojosQP.klass(rootNodeType), PojosQP.ids(rootNodeIds), PojosQP.Set("annotatorIds",annotatorIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); // no count collection if (Dataset.class.equals(rootNodeType)){ return AnnotationTransformations.sortDatasetAnnotatiosn(new HashSet(l)); } else if (Image.class.equals(rootNodeType)){ return AnnotationTransformations.sortImageAnnotatiosn(new HashSet(l)); } else { throw new IllegalArgumentException( "Class parameter for findAnnotation() must be in " + "{Dataset,Image}, not "+ rootNodeType); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
"ome.servics.query.FindAnnotationsQueryDefinition", | PojosFindAnnotationsQueryDefinition.class.getName(), | public Map findAnnotations(Class rootNodeType, @NotNull @Validate(Integer.class) Set rootNodeIds, @Validate(Integer.class) Set annotatorIds, Map options) { if (rootNodeIds.size()==0) return new HashMap(); PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.FindAnnotationsQueryDefinition", PojosQP.klass(rootNodeType), PojosQP.ids(rootNodeIds), PojosQP.Set("annotatorIds",annotatorIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); // no count collection if (Dataset.class.equals(rootNodeType)){ return AnnotationTransformations.sortDatasetAnnotatiosn(new HashSet(l)); } else if (Image.class.equals(rootNodeType)){ return AnnotationTransformations.sortImageAnnotatiosn(new HashSet(l)); } else { throw new IllegalArgumentException( "Class parameter for findAnnotation() must be in " + "{Dataset,Image}, not "+ rootNodeType); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
for (Object object : l) { iQuery.evict(object); } | public Map findAnnotations(Class rootNodeType, @NotNull @Validate(Integer.class) Set rootNodeIds, @Validate(Integer.class) Set annotatorIds, Map options) { if (rootNodeIds.size()==0) return new HashMap(); PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.FindAnnotationsQueryDefinition", PojosQP.klass(rootNodeType), PojosQP.ids(rootNodeIds), PojosQP.Set("annotatorIds",annotatorIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); // no count collection if (Dataset.class.equals(rootNodeType)){ return AnnotationTransformations.sortDatasetAnnotatiosn(new HashSet(l)); } else if (Image.class.equals(rootNodeType)){ return AnnotationTransformations.sortImageAnnotatiosn(new HashSet(l)); } else { throw new IllegalArgumentException( "Class parameter for findAnnotation() must be in " + "{Dataset,Image}, not "+ rootNodeType); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
|
public Set findCGCPaths(@NotNull @Validate(Integer.class) Set imgIds, | public Set findCGCPaths(@NotNull @Validate(Long.class) Set imgIds, | public Set findCGCPaths(@NotNull @Validate(Integer.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.FindCGCPathsQueryDefinition", PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.addCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
"ome.servics.query.FindCGCPathsQueryDefinition", | PojosCGCPathsQueryDefinition.class.getName(), | public Set findCGCPaths(@NotNull @Validate(Integer.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.FindCGCPathsQueryDefinition", PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.addCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
public Set findCGCPaths(@NotNull @Validate(Integer.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.FindCGCPathsQueryDefinition", PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.addCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
||
public Set findCGCPaths(@NotNull @Validate(Integer.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.FindCGCPathsQueryDefinition", PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.addCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
||
@NotNull @Validate(Integer.class) Set imageIds, Map options) { | @NotNull @Validate(Long.class) Set imageIds, Map options) { | public Set findContainerHierarchies(@NotNull Class rootNodeType, @NotNull @Validate(Integer.class) Set imageIds, Map options) { PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosFindHierarchiesQueryDefinition.class.getName(), PojosQP.klass(rootNodeType), PojosQP.ids(imageIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); collectCounts(l,po); // TODO; this if-else statement could be removed if Transformations // did their own dispatching // TODO: logging, null checking. daos should never return null // TODO then size! if (Project.class.equals(rootNodeType)) { if (imageIds.size()==0){ return new HashSet(); } return HierarchyTransformations.invertPDI(new HashSet(l)); } else if (CategoryGroup.class.equals(rootNodeType)){ if (imageIds.size()==0){ return new HashSet(); } return HierarchyTransformations.invertCGCI(new HashSet(l)); } else {throw new IllegalArgumentException( "Class parameter for findContainerHierarchies() must be" + " in {Project,CategoryGroup}, not " + rootNodeType); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
for (Object object : l) { iQuery.evict(object); } | public Set findContainerHierarchies(@NotNull Class rootNodeType, @NotNull @Validate(Integer.class) Set imageIds, Map options) { PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosFindHierarchiesQueryDefinition.class.getName(), PojosQP.klass(rootNodeType), PojosQP.ids(imageIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); collectCounts(l,po); // TODO; this if-else statement could be removed if Transformations // did their own dispatching // TODO: logging, null checking. daos should never return null // TODO then size! if (Project.class.equals(rootNodeType)) { if (imageIds.size()==0){ return new HashSet(); } return HierarchyTransformations.invertPDI(new HashSet(l)); } else if (CategoryGroup.class.equals(rootNodeType)){ if (imageIds.size()==0){ return new HashSet(); } return HierarchyTransformations.invertCGCI(new HashSet(l)); } else {throw new IllegalArgumentException( "Class parameter for findContainerHierarchies() must be" + " in {Project,CategoryGroup}, not " + rootNodeType); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
|
public Set findContainerHierarchies(@NotNull Class rootNodeType, @NotNull @Validate(Integer.class) Set imageIds, Map options) { PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosFindHierarchiesQueryDefinition.class.getName(), PojosQP.klass(rootNodeType), PojosQP.ids(imageIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); collectCounts(l,po); // TODO; this if-else statement could be removed if Transformations // did their own dispatching // TODO: logging, null checking. daos should never return null // TODO then size! if (Project.class.equals(rootNodeType)) { if (imageIds.size()==0){ return new HashSet(); } return HierarchyTransformations.invertPDI(new HashSet(l)); } else if (CategoryGroup.class.equals(rootNodeType)){ if (imageIds.size()==0){ return new HashSet(); } return HierarchyTransformations.invertCGCI(new HashSet(l)); } else {throw new IllegalArgumentException( "Class parameter for findContainerHierarchies() must be" + " in {Project,CategoryGroup}, not " + rootNodeType); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
||
@NotNull @Validate(Integer.class) Set ids, Map options) | @NotNull @Validate(Long.class) Set ids, Map options) | public Map getCollectionCount(@NotNull String type, @NotNull String property, @NotNull @Validate(Integer.class) Set ids, Map options) { Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; // TODO annotations if (!type.matches(alphaNumericDotted)) { throw new IllegalArgumentException("Type argument to getCollectionCount may ONLY be alpha-numeric with dots ("+alphaNumericDotted+")"); } if (!property.matches(alphaNumeric)) { throw new IllegalArgumentException("Property argument to getCollectionCount may ONLY be alpha-numeric ("+alphaNumeric+")"); } if (iQuery.checkType(type)) { throw new IllegalArgumentException(type+"."+property+" is an unknown type."); } if (iQuery.checkProperty(type,property)) { throw new IllegalArgumentException(type+"."+property+" is an unknown property on type "+type); } String query = "select size(table."+property+") from "+type+" table where table.id = ?"; // FIXME: optimize by doing new list(id,size(table.property)) ... group by id for (Iterator iter = ids.iterator(); iter.hasNext();) { Integer id = (Integer) iter.next(); Integer count = (Integer) iQuery.queryUnique(query,new Object[]{id}); results.put(id,count); } return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; | String parsedProperty = LsidUtils.parseField(property); | public Map getCollectionCount(@NotNull String type, @NotNull String property, @NotNull @Validate(Integer.class) Set ids, Map options) { Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; // TODO annotations if (!type.matches(alphaNumericDotted)) { throw new IllegalArgumentException("Type argument to getCollectionCount may ONLY be alpha-numeric with dots ("+alphaNumericDotted+")"); } if (!property.matches(alphaNumeric)) { throw new IllegalArgumentException("Property argument to getCollectionCount may ONLY be alpha-numeric ("+alphaNumeric+")"); } if (iQuery.checkType(type)) { throw new IllegalArgumentException(type+"."+property+" is an unknown type."); } if (iQuery.checkProperty(type,property)) { throw new IllegalArgumentException(type+"."+property+" is an unknown property on type "+type); } String query = "select size(table."+property+") from "+type+" table where table.id = ?"; // FIXME: optimize by doing new list(id,size(table.property)) ... group by id for (Iterator iter = ids.iterator(); iter.hasNext();) { Integer id = (Integer) iter.next(); Integer count = (Integer) iQuery.queryUnique(query,new Object[]{id}); results.put(id,count); } return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
if (!type.matches(alphaNumericDotted)) { throw new IllegalArgumentException("Type argument to getCollectionCount may ONLY be alpha-numeric with dots ("+alphaNumericDotted+")"); } | checkType(type); checkProperty(type,parsedProperty); | public Map getCollectionCount(@NotNull String type, @NotNull String property, @NotNull @Validate(Integer.class) Set ids, Map options) { Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; // TODO annotations if (!type.matches(alphaNumericDotted)) { throw new IllegalArgumentException("Type argument to getCollectionCount may ONLY be alpha-numeric with dots ("+alphaNumericDotted+")"); } if (!property.matches(alphaNumeric)) { throw new IllegalArgumentException("Property argument to getCollectionCount may ONLY be alpha-numeric ("+alphaNumeric+")"); } if (iQuery.checkType(type)) { throw new IllegalArgumentException(type+"."+property+" is an unknown type."); } if (iQuery.checkProperty(type,property)) { throw new IllegalArgumentException(type+"."+property+" is an unknown property on type "+type); } String query = "select size(table."+property+") from "+type+" table where table.id = ?"; // FIXME: optimize by doing new list(id,size(table.property)) ... group by id for (Iterator iter = ids.iterator(); iter.hasNext();) { Integer id = (Integer) iter.next(); Integer count = (Integer) iQuery.queryUnique(query,new Object[]{id}); results.put(id,count); } return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
if (!property.matches(alphaNumeric)) { throw new IllegalArgumentException("Property argument to getCollectionCount may ONLY be alpha-numeric ("+alphaNumeric+")"); } if (iQuery.checkType(type)) { throw new IllegalArgumentException(type+"."+property+" is an unknown type."); } if (iQuery.checkProperty(type,property)) { throw new IllegalArgumentException(type+"."+property+" is an unknown property on type "+type); } String query = "select size(table."+property+") from "+type+" table where table.id = ?"; | String query = "select size(table."+parsedProperty+") from "+type+" table where table.id = ?"; | public Map getCollectionCount(@NotNull String type, @NotNull String property, @NotNull @Validate(Integer.class) Set ids, Map options) { Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; // TODO annotations if (!type.matches(alphaNumericDotted)) { throw new IllegalArgumentException("Type argument to getCollectionCount may ONLY be alpha-numeric with dots ("+alphaNumericDotted+")"); } if (!property.matches(alphaNumeric)) { throw new IllegalArgumentException("Property argument to getCollectionCount may ONLY be alpha-numeric ("+alphaNumeric+")"); } if (iQuery.checkType(type)) { throw new IllegalArgumentException(type+"."+property+" is an unknown type."); } if (iQuery.checkProperty(type,property)) { throw new IllegalArgumentException(type+"."+property+" is an unknown property on type "+type); } String query = "select size(table."+property+") from "+type+" table where table.id = ?"; // FIXME: optimize by doing new list(id,size(table.property)) ... group by id for (Iterator iter = ids.iterator(); iter.hasNext();) { Integer id = (Integer) iter.next(); Integer count = (Integer) iQuery.queryUnique(query,new Object[]{id}); results.put(id,count); } return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
Integer id = (Integer) iter.next(); | Long id = (Long) iter.next(); | public Map getCollectionCount(@NotNull String type, @NotNull String property, @NotNull @Validate(Integer.class) Set ids, Map options) { Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; // TODO annotations if (!type.matches(alphaNumericDotted)) { throw new IllegalArgumentException("Type argument to getCollectionCount may ONLY be alpha-numeric with dots ("+alphaNumericDotted+")"); } if (!property.matches(alphaNumeric)) { throw new IllegalArgumentException("Property argument to getCollectionCount may ONLY be alpha-numeric ("+alphaNumeric+")"); } if (iQuery.checkType(type)) { throw new IllegalArgumentException(type+"."+property+" is an unknown type."); } if (iQuery.checkProperty(type,property)) { throw new IllegalArgumentException(type+"."+property+" is an unknown property on type "+type); } String query = "select size(table."+property+") from "+type+" table where table.id = ?"; // FIXME: optimize by doing new list(id,size(table.property)) ... group by id for (Iterator iter = ids.iterator(); iter.hasNext();) { Integer id = (Integer) iter.next(); Integer count = (Integer) iQuery.queryUnique(query,new Object[]{id}); results.put(id,count); } return results; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
@NotNull @Validate(Integer.class) Set rootNodeIds, Map options) { | @NotNull @Validate(Long.class) Set rootNodeIds, Map options) { | public Set getImages(@NotNull Class rootNodeType, @NotNull @Validate(Integer.class) Set rootNodeIds, Map options) { if (rootNodeIds.size()==0){ return new HashSet(); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.GetImagesQueryDefinition", PojosQP.klass(rootNodeType), PojosQP.ids(rootNodeIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); collectCounts(l,po); return new HashSet(l); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
"ome.servics.query.GetImagesQueryDefinition", | PojosGetImagesQueryDefinition.class.getName(), | public Set getImages(@NotNull Class rootNodeType, @NotNull @Validate(Integer.class) Set rootNodeIds, Map options) { if (rootNodeIds.size()==0){ return new HashSet(); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( "ome.servics.query.GetImagesQueryDefinition", PojosQP.klass(rootNodeType), PojosQP.ids(rootNodeIds), PojosQP.options(po.map())); List l = (List) iQuery.execute(q); collectCounts(l,po); return new HashSet(l); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
"left outer join fetch e.group " + "left outer join fetch e.groups " + | "left outer join fetch e.groupExperimenterMap gs " + "left outer join fetch gs.child g " + | public Map getUserDetails(@NotNull @Validate(String.class) Set names, Map options) { List results; Map<String, Experimenter> map = new HashMap<String, Experimenter>(); /* query only if we have some ids */ if (names.size() > 0) { Map<String, Set> params = new HashMap<String, Set>(); params.put("name_list",names); results = iQuery.queryListMap( "select e from Experimenter e " + "left outer join fetch e.group " + "left outer join fetch e.groups " + "where e.omeName in ( :name_list )", params ); for (Object object : results) { Experimenter e = (Experimenter) object; map.put(e.getOmeName(),e); } } /* ensures all ids appear in map */ for (Object object : names) { String name = (String) object; if (! map.containsKey(name)){ map.put(name,null); } } return map; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
Query q = queryFactory.lookup( "ome.servics.query.GetImagesQueryDefinition", PojosQP.options(po.map())); | Query q = queryFactory.lookup(" select i from Image i " + "where i.details.owner.id = :id ", PojosQP.Long("id",po.getExperimenter())); | public Set getUserImages(Map options) { PojoOptions po = new PojoOptions(options); if (!po.isExperimenter() ) { // FIXME && !po.isGroup()){ throw new IllegalArgumentException( "experimenter or group option " + "is required for getUserImages()."); } Query q = queryFactory.lookup( "ome.servics.query.GetImagesQueryDefinition", PojosQP.options(po.map())); List l = (List) iQuery.execute(q); collectCounts(l,po); return new HashSet(l); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
@Validate(Integer.class) Set rootNodeIds, Map options) { | @Validate(Long.class) Set rootNodeIds, Map options) { | public Set loadContainerHierarchy(Class rootNodeType, @Validate(Integer.class) Set rootNodeIds, Map options) { PojoOptions po = new PojoOptions(options); if (null==rootNodeIds && !po.isExperimenter()) throw new IllegalArgumentException( "Set of ids for loadContainerHierarchy() may not be null " + "if experimenter and group options are null."); if (! Project.class.equals(rootNodeType) && ! Dataset.class.equals(rootNodeType) && ! CategoryGroup.class.equals(rootNodeType) && ! Category.class.equals(rootNodeType)) throw new IllegalArgumentException( "Class parameter for loadContainerIHierarchy() must be in " + "{Project,Dataset,Category,CategoryGroup}, not " + rootNodeType); Query q = queryFactory.lookup( PojosLoadHierarchyQueryDefinition.class.getName(), PojosQP.klass(rootNodeType), PojosQP.ids(rootNodeIds), PojosQP.options(po.map())); // TODO Move PojosQP to PojosOptions List l = (List) iQuery.execute(q); collectCounts(l, po); return new HashSet(l); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
return (Collection) context.retrieve(arg1); | Collection c = (Collection) context.retrieve(arg1); iQuery.initialize(c); return c; | public Collection retrieveCollection(IObject arg0, String arg1, Map arg2) { IObject context = (IObject) iQuery.getById(arg0.getClass(),arg0.getId()); return (Collection) context.retrieve(arg1); // FIXME not type.o.null safe } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
} else | } else { | private void datasetNodeNavigation(DatasetData d, DefaultMutableTreeNode node, boolean isExpanding) { DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel(); Integer datasetID = new Integer(d.getId()); node.removeAllChildren(); if (isExpanding) { Set images = agentCtrl.getImages(d.getId()); //TODO: loading will never be displayed b/c we are in the // same thread. if (images.size() != 0) { addNodesToDatasetMaps(datasetID, node, images); addImagesToDataset(images, node); } else treeModel.insertNodeInto(new DefaultMutableTreeNode(EMPTY), node, node.getChildCount()); } else treeModel.insertNodeInto(new DefaultMutableTreeNode(LOADING), node, node.getChildCount()); treeModel.reload(node); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5d253e1d8b8b563bd79074b962fe0a01fca0a091/ExplorerPaneManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/ExplorerPaneManager.java |
node, node.getChildCount()); | node, node.getChildCount()); } | private void datasetNodeNavigation(DatasetData d, DefaultMutableTreeNode node, boolean isExpanding) { DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel(); Integer datasetID = new Integer(d.getId()); node.removeAllChildren(); if (isExpanding) { Set images = agentCtrl.getImages(d.getId()); //TODO: loading will never be displayed b/c we are in the // same thread. if (images.size() != 0) { addNodesToDatasetMaps(datasetID, node, images); addImagesToDataset(images, node); } else treeModel.insertNodeInto(new DefaultMutableTreeNode(EMPTY), node, node.getChildCount()); } else treeModel.insertNodeInto(new DefaultMutableTreeNode(LOADING), node, node.getChildCount()); treeModel.reload(node); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5d253e1d8b8b563bd79074b962fe0a01fca0a091/ExplorerPaneManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/ExplorerPaneManager.java |
recv.getRuntime().getRuntime().setTraceFunction((RubyProc) trace_func); | public static IRubyObject set_trace_func(IRubyObject recv, IRubyObject trace_func) { if (trace_func.isNil()) { recv.getRuntime().getRuntime().setTraceFunction(null); } else if (!(trace_func instanceof RubyProc)) { throw new TypeError(recv.getRuntime(), "trace_func needs to be Proc."); } recv.getRuntime().getRuntime().setTraceFunction((RubyProc) trace_func); return trace_func; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7b41d102019836c9a5ec6884b2d9b9380f9853a7/KernelModule.java/clean/org/jruby/KernelModule.java |
|
blockArg = runtime.newProc(); blockArg.getBlock().isLambda = context.getCurrentBlock().isLambda; | public IRubyObject internalCall(ThreadContext context, IRubyObject receiver, RubyModule lastClass, String name, IRubyObject[] args, boolean noSuper) { assert args != null; IRuby runtime = context.getRuntime(); RubyProc blockArg = null; if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { // We pass depth zero since we know this only applies to newly created local scope blockArg = runtime.newProc(); blockArg.getBlock().isLambda = context.getCurrentBlock().isLambda; context.getCurrentScope().setValue(argsNode.getBlockArgNode().getCount(), blockArg, 0); } try { prepareArguments(context, runtime, receiver, args); getArity().checkArity(runtime, args); traceCall(context, runtime, receiver, name); return EvaluationState.eval(context, body, receiver); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { if (je.getPrimaryData() == this) { return (IRubyObject)je.getSecondaryData(); } } throw je; } finally { traceReturn(context, runtime, receiver, name); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/048e5b9179a657d1e786630b4cb43ae2bfdfbe4a/DefaultMethod.java/buggy/src/org/jruby/internal/runtime/methods/DefaultMethod.java |
|
RubyObject[] args = ArgsUtil.setupArgs(ruby, self, getArgsNode().getNextNode()); RubyList argsList = new RubyList(args); argsList.remove(args.length - 1); RubyObject val = recv.funcall(ruby.intern("[]"), argsList.toRubyArray()); | RubyPointer args = ArgsUtil.setupArgs(ruby, self, getArgsNode().getNextNode()); args.remove(args.size() - 1); RubyObject val = recv.funcall(ruby.intern("[]"), args); | public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyObject recv = getRecvNode().eval(ruby, self); Node rval = getArgsNode().getHeadNode(); RubyObject[] args = ArgsUtil.setupArgs(ruby, self, getArgsNode().getNextNode()); RubyList argsList = new RubyList(args); argsList.remove(args.length - 1); RubyObject val = recv.funcall(ruby.intern("[]"), argsList.toRubyArray()); switch (getMId().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } else { val = rval.eval(ruby, self); } break; case 1: /* AND */ if (val.isFalse()) { return val; } else { val = rval.eval(ruby, self); } break; default: val = val.funcall(getMId(), rval.eval(ruby, self)); } args[args.length - 1] = val; return recv.funcall(ruby.intern("[]="), args); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/OpAsgn1Node.java/buggy/org/jruby/nodes/OpAsgn1Node.java |
args[args.length - 1] = val; | args.set(args.size() - 1, val); | public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyObject recv = getRecvNode().eval(ruby, self); Node rval = getArgsNode().getHeadNode(); RubyObject[] args = ArgsUtil.setupArgs(ruby, self, getArgsNode().getNextNode()); RubyList argsList = new RubyList(args); argsList.remove(args.length - 1); RubyObject val = recv.funcall(ruby.intern("[]"), argsList.toRubyArray()); switch (getMId().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } else { val = rval.eval(ruby, self); } break; case 1: /* AND */ if (val.isFalse()) { return val; } else { val = rval.eval(ruby, self); } break; default: val = val.funcall(getMId(), rval.eval(ruby, self)); } args[args.length - 1] = val; return recv.funcall(ruby.intern("[]="), args); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/OpAsgn1Node.java/buggy/org/jruby/nodes/OpAsgn1Node.java |
int index = view.getSearchType(); String regEx = view.getSearchValue(); FindRegExCmd cmd = new FindRegExCmd(view.model.getParentModel(), regEx, index); cmd.execute(); | try { int index = view.getSearchType(); String regEx = view.getSearchValue(); Pattern p = RegExFactory.createCaseInsensitivePattern(regEx); FindRegExCmd cmd = new FindRegExCmd(view.model.getParentModel(), p, index); cmd.execute(); } catch (PatternSyntaxException pse) { UserNotifier un = HiViewerAgent.getRegistry().getUserNotifier(); un.notifyInfo("Search", "The expression entered contains non " + "valid characters."); view.clearSearchValue(); } | private void performSearch() { int index = view.getSearchType(); String regEx = view.getSearchValue(); FindRegExCmd cmd = new FindRegExCmd(view.model.getParentModel(), regEx, index); cmd.execute(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c7517f5d0ece413452f58f3f0a071be2ccbee2e/CBSearchTabViewMng.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/CBSearchTabViewMng.java |
registry.getUserNotifier().notifyInfo("Data Saving Cancellation", info); | public void handleCancellation() { String info = "The data saving has been cancelled."; registry.getLogger().info(this, info); registry.getUserNotifier().notifyInfo("Data Saving Cancellation", info); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/EditorLoader.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/EditorLoader.java |
|
e.printStackTrace(); | public final Template handle(WebContext wc) throws HandlerException { String pageName = null; WikiPage wikiPage = null; // who is trying to do something? WikiUser user = getUser (wc); // which action wants to respond to this request? PageAction action = _actionManager.getAction (wc, user); // use the action to determine which WikiPage // we should be dealing with if (action != null) pageName = action.getWikiPageName (_wiki, wc); if (pageName != null) wikiPage = _wiki.getPage (pageName); // stuff the webcontext with useful stuff stuffContext (wc, wikiPage, user, pageName); if (action == null) throw new HandlerException ("Unable to find a PageAction to handle" + " this request."); try { // attempt to perform the action against the page action.perform (_wiki, wc, user, wikiPage); } catch (PageAction.RedirectException re) { // action wants us to redirect somewhere else try { wc.getResponse().sendRedirect (re.getURL()); } catch (IOException ioe) { throw new HandlerException ("Cannot redirect to " + re.getURL(), ioe); } return null; } catch (Exception e) { // something bad happened while performing the action // TODO: Handle error and error template ourselves throw new HandlerException (e.toString()); } finally { if (user != null) _wiki.updateUser(user); } // the action performed successfully, so now return // the template it wants us to use try { // determine the template name and return String templateName = action.getTemplateName(_wiki, wikiPage); return getTemplate (templateName); } catch (ResourceException re) { throw new HandlerException ("Could not get template", re); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/76bb847e1a32516a74762100398ded03f39feec8/WikiServlet.java/buggy/wiki/src/org/tcdi/opensource/wiki/servlet/WikiServlet.java |
|
return Collections.EMPTY_LIST; | return EMPTY_LIST; | public List childNodes() { return Collections.EMPTY_LIST; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/ClassVarNode.java/clean/src/org/jruby/ast/ClassVarNode.java |
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, ArrayNode node) { | public static RubyPointer setupArgs(Ruby ruby, RubyObject self, ArrayNode node) { | public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, ArrayNode node) { String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); RubyObject[] args = node.getArray(ruby, self); ruby.setSourceFile(file); ruby.setSourceLine(line); return args; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/ArgsUtil.java/buggy/org/jruby/nodes/util/ArgsUtil.java |
RubyObject[] args = node.getArray(ruby, self); | RubyPointer args = new RubyPointer(node.getArrayList(ruby, self)); | public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, ArrayNode node) { String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); RubyObject[] args = node.getArray(ruby, self); ruby.setSourceFile(file); ruby.setSourceLine(line); return args; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/ArgsUtil.java/buggy/org/jruby/nodes/util/ArgsUtil.java |
return super.filter(fieldId,f); | return result; | public Filterable filter(String fieldId, Filterable f) { /* TODO here's where we could use a single call back for each filter method. (onFilter) also (onFilterX) beforeFilter / afterFilter etc. */ addIfHit(fieldId); return super.filter(fieldId,f); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5455b73a435a252c2c058cc4c625f039b667cd2f/CountCollector.java/clean/components/server/src/ome/services/util/CountCollector.java |
DumpVisitor lVisitor = new DumpVisitor(); lScript.accept(lVisitor); ruby.getRuntime().getOutputStream().println(lVisitor.dump()); | protected static void runInterpreter(Reader iReader2Eval, String iFileName, String[] args) { // Initialize Runtime Ruby ruby = Ruby.getDefaultInstance(sRegexpAdapter); // Parse and interpret file IRubyObject lArgv = JavaUtil.convertJavaToRuby(ruby, args); ruby.setVerbose(warning); ruby.defineReadonlyVariable("$VERBOSE", warning ? ruby.getTrue() : ruby.getNil()); ruby.defineGlobalConstant("ARGV", lArgv); ruby.defineReadonlyVariable("$-p", (sDoPrint ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-n", (sDoLoop ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-a", (sDoSplit ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$-l", (sDoLine ? ruby.getTrue() : ruby.getNil())); ruby.defineReadonlyVariable("$*", lArgv); ruby.defineVariable(new RubyGlobal.StringGlobalVariable(ruby, "$0", RubyString.newString(ruby, iFileName))); ruby.initLoad(sLoadDirectories); //require additional libraries int lNbRequire = sRequireFirst.size(); try { for (int i = 0; i < lNbRequire; i++) RubyKernel.require(ruby.getRubyTopSelf(), new RubyString(ruby, (String) sRequireFirst.get(i))); // +++ INode lScript = ruby.parse(iReader2Eval, iFileName); // DumpVisitor laVisitor = new DumpVisitor(); // lScript.accept(laVisitor); // ruby.getRuntime().getOutputStream().println(laVisitor.dump()); if (sDoPrint) { // FIXME lScript = new ParserSupport().appendPrintToBlock(lScript); // ruby.getParserHelper().rb_parser_append_print(); } if (sDoLoop) { // FIXME lScript = new ParserSupport().appendWhileLoopToBlock(lScript, sDoLine, sDoSplit); // ruby.getParserHelper().rb_parser_while_loop(sDoLine, sDoSplit); } if (sCheckOnly) { DumpVisitor lVisitor = new DumpVisitor(); lScript.accept(lVisitor); ruby.getRuntime().getOutputStream().println(lVisitor.dump()); } else { ruby.eval(lScript); } } catch (RaiseException rExcptn) { ruby.getRuntime().printError(rExcptn.getException()); } catch (ThrowJump throwJump) { ruby.getRuntime().printError(throwJump.getNameError()); } catch (RubyBugException lBug) { ruby.getRuntime().getErrorStream().print(lBug.getMessage()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/615c030e9e2e4f7129fe3e92d877dd15dd313c3d/Main.java/buggy/org/jruby/Main.java |
|
|| textFound.startsWith("https: | || textFound.startsWith("https: | private String filterBody(String text) { EmoticonManager emoticonManager = EmoticonManager.getInstance(); StringBuilder builder = new StringBuilder(); final StringTokenizer tokenizer = new StringTokenizer(text, " \n \t", true); while (tokenizer.hasMoreTokens()) { String textFound = tokenizer.nextToken(); if (textFound.startsWith("http://") || textFound.startsWith("ftp://") || textFound.startsWith("https://") || textFound.startsWith("www.") || textFound.startsWith("\\") || textFound.indexOf("://") != -1) { builder.append("<a href=\"").append(textFound).append("\" target=_blank>").append(textFound).append("</a>"); } else if (emoticonManager.getEmoticon(textFound) != null) { Emoticon emot = emoticonManager.getEmoticon(textFound); URL url = emoticonManager.getEmoticonURL(emot); File file = URLFileSystem.url2File(url); builder.append("<img src=\"").append(url.toExternalForm()).append("\" />"); } else { builder.append(textFound); } } return builder.toString(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ad8343da83861b145373d811238d8e2939352153/TranscriptWindow.java/clean/src/java/org/jivesoftware/spark/ui/TranscriptWindow.java |
} throw new IllegalArgumentException("DataObject not supported."); | } else throw new IllegalArgumentException("Child and parent are not" + " compatible."); | public static IObject createIObject(DataObject child, DataObject parent) { if (child instanceof ProjectData) { ProjectData data = (ProjectData) child; Project model = new Project(); model.setName(data.getName()); model.setDescription(data.getDescription()); return model; } else if (child instanceof CategoryGroupData) { CategoryGroupData data = (CategoryGroupData) child; CategoryGroup model = new CategoryGroup(); model.setName(data.getName()); model.setDescription(data.getDescription()); return model; } else if (child instanceof DatasetData) { if (!(parent instanceof ProjectData)) throw new IllegalArgumentException("Parent not valid."); DatasetData data = (DatasetData) child; Dataset model = new Dataset(); model.setName(data.getName()); model.setDescription(data.getDescription()); model.linkProject(new Project(new Long(parent.getId()), false)); return model; } else if (child instanceof CategoryData) { if (!(parent instanceof CategoryGroupData)) throw new IllegalArgumentException("Parent not valid."); CategoryData data = (CategoryData) child; Category model = new Category(); model.setName(data.getName()); model.setDescription(data.getDescription()); model.linkCategoryGroup(new CategoryGroup(new Long(parent.getId()), false)); return model; } else if (child instanceof ImageData) { if (!(parent instanceof CategoryData) && !(parent instanceof DatasetData)) throw new IllegalArgumentException("Parent not valid."); ImageData data = (ImageData) child; Image model = new Image(); model.setName(data.getName()); model.setDescription(data.getDescription()); if (parent instanceof CategoryData) model.linkCategory(new Category(new Long(parent.getId()), false)); else if (parent instanceof DatasetData) model.linkDataset(new Dataset(new Long(parent.getId()), false)); return model; } throw new IllegalArgumentException("DataObject not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/557c1489203604f61421342df46753983ef62091/ModelMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/util/ModelMapper.java |
} throw new IllegalArgumentException("DataObject not supported."); | } else throw new IllegalArgumentException("DataObject not supported."); | public static void linkParentToChild(IObject child, IObject parent) { if (parent == null) return; if (child == null) throw new IllegalArgumentException("Child cannot" + "be null."); if (parent instanceof Project) { if (!(child instanceof Dataset)) throw new IllegalArgumentException("Child not valid."); Project p = (Project) parent; Dataset d = (Dataset) child; ProjectDatasetLink link; Iterator it = d.iterateProjectLinks(); while (it.hasNext()) { link = (ProjectDatasetLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addProjectDatasetLink(link, false); } } else if (parent instanceof CategoryGroup) { if (!(child instanceof Category)) throw new IllegalArgumentException("Child not valid."); CategoryGroup p = (CategoryGroup) parent; Category d = (Category) child; CategoryGroupCategoryLink link; Iterator it = d.iterateCategoryGroupLinks(); while (it.hasNext()) { link = (CategoryGroupCategoryLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryGroupCategoryLink(link, false); } } else if (parent instanceof Dataset) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Dataset p = (Dataset) parent; Image d = (Image) child; DatasetImageLink link; Iterator it = d.iterateDatasetLinks(); while (it.hasNext()) { link = (DatasetImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addDatasetImageLink(link, false); } } else if (parent instanceof Category) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Category p = (Category) parent; Image d = (Image) child; CategoryImageLink link; Iterator it = d.iterateCategoryLinks(); while (it.hasNext()) { link = (CategoryImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryImageLink(link, false); } } throw new IllegalArgumentException("DataObject not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/557c1489203604f61421342df46753983ef62091/ModelMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/util/ModelMapper.java |
public MockServiceFactory() throws NullPointerException { | private MockServiceFactory() throws NullPointerException { | public MockServiceFactory() throws NullPointerException { super(SERVICE); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/2ea7b1ef6a6941dce6f02e1ac520e7e82d2bc346/StandardKernelTest.java/clean/kernel/src/test/org/gbean/kernel/standard/StandardKernelTest.java |
public ISourcePosition getPosition(ISourcePosition startPosition) { return src.getPosition(startPosition); | public ISourcePosition getPosition() { return currentPos; | public ISourcePosition getPosition(ISourcePosition startPosition) { return src.getPosition(startPosition); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1d8ec540dc793b2d5ad5084d2cb6b204087302b7/RubyYaccLexer.java/buggy/src/org/jruby/lexer/yacc/RubyYaccLexer.java |
int r = i1.getInserted().compareTo(i2.getInserted()); | Timestamp t1 = i1.getInserted(); Timestamp t2 = i2.getInserted(); if (t1 == null) t1 = TreeViewerTranslator.getDefaultTimestamp(); if (t2 == null) t2 = TreeViewerTranslator.getDefaultTimestamp(); int r = t1.compareTo(t2); | private List sort(List nodes, final boolean ascending) { Comparator c; switch (sortType) { case Browser.SORT_NODES_BY_DATE: c = new Comparator() { public int compare(Object o1, Object o2) { ImageData i1 = (ImageData) (((TreeImageDisplay) o1).getUserObject()); ImageData i2 = (ImageData) (((TreeImageDisplay) o2).getUserObject()); int r = i1.getInserted().compareTo(i2.getInserted()); int v = 0; if (r < 0) v = -1; else if (r > 0) v = 1; if (ascending) return v; return -v; } }; break; case Browser.SORT_NODES_BY_NAME: default: c = new Comparator() { public int compare(Object o1, Object o2) { String s1 = o1.toString().toLowerCase(); String s2 = o2.toString().toLowerCase(); int result = s1.compareTo(s2); int v = 0; if (result < 0) v = -1; else if (result > 0) v = 1; if (ascending) return v; return -v; } }; } Collections.sort(nodes, c); return nodes; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5cd0be53036d59904eb6332d7e2a1c1e964bdc06/SortCmd.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/cmd/SortCmd.java |
int r = i1.getInserted().compareTo(i2.getInserted()); | Timestamp t1 = i1.getInserted(); Timestamp t2 = i2.getInserted(); if (t1 == null) t1 = TreeViewerTranslator.getDefaultTimestamp(); if (t2 == null) t2 = TreeViewerTranslator.getDefaultTimestamp(); int r = t1.compareTo(t2); | public int compare(Object o1, Object o2) { ImageData i1 = (ImageData) (((TreeImageDisplay) o1).getUserObject()); ImageData i2 = (ImageData) (((TreeImageDisplay) o2).getUserObject()); int r = i1.getInserted().compareTo(i2.getInserted()); int v = 0; if (r < 0) v = -1; else if (r > 0) v = 1; if (ascending) return v; return -v; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5cd0be53036d59904eb6332d7e2a1c1e964bdc06/SortCmd.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/cmd/SortCmd.java |
saveSettings(); break; case SAVE: | public void actionPerformed(ActionEvent e) { String s = (String) e.getActionCommand(); try { int index = Integer.parseInt(s); switch (index) { case APPLY: applySettings(); break; case CANCEL: saveSettings(); break; case SAVE: cancel(); break; case R_AREA: checkFieldValue(R_AREA); break; case G_AREA: checkFieldValue(G_AREA); break; case B_AREA: checkFieldValue(B_AREA); }// end switch } catch(NumberFormatException nfe) { throw nfe; //just to be on the safe side... } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooserManager.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooserManager.java |
|
String valRed = view.getRArea().getText(), red = ""+colorSelected.getRed(); String valGreen = view.getGArea().getText(), green = ""+colorSelected.getGreen(); String valBlue = view.getBArea().getText(), blue = ""+colorSelected.getBlue(); | String valRed = view.getRArea().getText(), red = ""+colorSelected.getRed(); String valGreen = view.getGArea().getText(), green = ""+colorSelected.getGreen(); String valBlue = view.getBArea().getText(), blue = ""+colorSelected.getBlue(); | public void focusLost(FocusEvent e) { String valRed = view.getRArea().getText(), red = ""+colorSelected.getRed(); String valGreen = view.getGArea().getText(), green = ""+colorSelected.getGreen(); String valBlue = view.getBArea().getText(), blue = ""+colorSelected.getBlue(); if (valRed == null || !valRed.equals(red)) view.getRArea().setText(red); if (valGreen == null || !valGreen.equals(green)) view.getGArea().setText(green); if (valBlue == null || !valBlue.equals(blue)) view.getBArea().setText(blue); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooserManager.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooserManager.java |
preferences.showDatesInChat(showTime); return preferences; | return pref; | public Object getData() { LocalPreferences pref = SettingsManager.getLocalPreferences(); String nickname = pref.getDefaultNickname(); if (nickname == null) { nickname = SparkManager.getSessionManager().getUsername(); } boolean showTime = pref.isTimeDisplayedInChat(); preferences.showDatesInChat(showTime); return preferences; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/ChatPreference.java/buggy/src/java/org/jivesoftware/sparkimpl/preference/chat/ChatPreference.java |
return new XmlDataSet(new FileInputStream("sql/db-export.xml")); | URL file = this.getClass().getClassLoader().getResource("db-export.xml"); return new XmlDataSet(new FileInputStream(file.getFile())); | public IDataSet getData() throws Exception { return new XmlDataSet(new FileInputStream("sql/db-export.xml")); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/HierarchyBrowsingDbUnitTest.java/buggy/components/server/test/org/openmicroscopy/omero/server/utests/HierarchyBrowsingDbUnitTest.java |
protected void setUp() throws Exception { ctx = getContext(getConfigLocations()); if (null == cdao || null == adao || null == ds) { cdao = (ContainerDao) ctx.getBean("containerDao"); adao = (AnnotationDao) ctx.getBean("annotationDao"); ds = (DataSource) ctx.getBean("dataSource"); } if (null==c) { c = new DatabaseConnection(ds.getConnection()); DatabaseOperation.CLEAN_INSERT.execute(c,getData()); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/HierarchyBrowsingDbUnitTest.java/buggy/components/server/test/org/openmicroscopy/omero/server/utests/HierarchyBrowsingDbUnitTest.java |
||
c = new DatabaseConnection(ds.getConnection()); DatabaseOperation.CLEAN_INSERT.execute(c,getData()); | try { c = new DatabaseConnection(ds.getConnection()); DatabaseOperation.CLEAN_INSERT.execute(c,getData()); } catch (Exception e){ c = null; throw e; } | protected void setUp() throws Exception { ctx = getContext(getConfigLocations()); if (null == cdao || null == adao || null == ds) { cdao = (ContainerDao) ctx.getBean("containerDao"); adao = (AnnotationDao) ctx.getBean("annotationDao"); ds = (DataSource) ctx.getBean("dataSource"); } if (null==c) { c = new DatabaseConnection(ds.getConnection()); DatabaseOperation.CLEAN_INSERT.execute(c,getData()); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/HierarchyBrowsingDbUnitTest.java/buggy/components/server/test/org/openmicroscopy/omero/server/utests/HierarchyBrowsingDbUnitTest.java |
List result = cdao.findPDIHierarchies(set); assertTrue("Should have found all the images but Zero", result.size()==set.size()+1); | List tmp = cdao.findPDIHierarchies(set); Set result = new HashSet(tmp); assertTrue("Should have found all the images but Zero but found "+result.size(), result.size()+1==set.size()); | public void testFindPDIHierarchies(){ Set set = getSetFromInt(new int[]{1,5,6,7,8,9,0}); List result = cdao.findPDIHierarchies(set); assertTrue("Should have found all the images but Zero", result.size()==set.size()+1); for (Iterator i = result.iterator(); i.hasNext();) { Image img = (Image) i.next(); assertTrue("Fully initialized",Hibernate.isInitialized(img.getDatasets())); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/HierarchyBrowsingDbUnitTest.java/buggy/components/server/test/org/openmicroscopy/omero/server/utests/HierarchyBrowsingDbUnitTest.java |
assertTrue("Fully initialized",Hibernate.isInitialized(img.getDatasets())); | Set ds = img.getDatasets(); assertTrue("Fully initialized datasets",Hibernate.isInitialized(ds)); for (Iterator j = ds.iterator(); j.hasNext();) { Dataset d = (Dataset) j.next(); assertTrue("Fully initialized projects",Hibernate.isInitialized(d.getProjects())); } | public void testFindPDIHierarchies(){ Set set = getSetFromInt(new int[]{1,5,6,7,8,9,0}); List result = cdao.findPDIHierarchies(set); assertTrue("Should have found all the images but Zero", result.size()==set.size()+1); for (Iterator i = result.iterator(); i.hasNext();) { Image img = (Image) i.next(); assertTrue("Fully initialized",Hibernate.isInitialized(img.getDatasets())); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9cc885fa28a62ed7b7bf1dbcf110c443345339d1/HierarchyBrowsingDbUnitTest.java/buggy/components/server/test/org/openmicroscopy/omero/server/utests/HierarchyBrowsingDbUnitTest.java |
getParent().removeChild(this); | if(getParent() != null) getParent().removeChild(this); | public void respondMouseClick(PInputEvent event) { getParent().removeChild(this); t.respondMouseClick(pushParentNode(event,t)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/07357b3d8cbf047af1ecb7b0a4514d2c06b4b04f/ImageNameNode.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/ImageNameNode.java |
getParent().removeChild(this); | if(getParent() != null) getParent().removeChild(this); | public void respondMouseDoubleClick(PInputEvent event) { getParent().removeChild(this); t.respondMouseDoubleClick(pushParentNode(event,t)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/07357b3d8cbf047af1ecb7b0a4514d2c06b4b04f/ImageNameNode.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/ImageNameNode.java |
getParent().removeChild(this); | if(getParent() != null) getParent().removeChild(this); | public void respondMousePress(PInputEvent event) { getParent().removeChild(this); t.respondMousePress(pushParentNode(event,t)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/07357b3d8cbf047af1ecb7b0a4514d2c06b4b04f/ImageNameNode.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/ImageNameNode.java |
getParent().removeChild(this); | if(getParent() != null) getParent().removeChild(this); | public void respondMouseRelease(PInputEvent event) { getParent().removeChild(this); t.respondMouseRelease(pushParentNode(event,t)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/07357b3d8cbf047af1ecb7b0a4514d2c06b4b04f/ImageNameNode.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/ImageNameNode.java |
*/ | public void actionPerformed(ActionEvent ae) { Rectangle oldBounds = model.getUI().getBounds(); HiViewer newOne = HiViewerFactory.reinstantiate(model); model.discard(); newOne.activate(oldBounds); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/RefreshAction.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/actions/RefreshAction.java |
|
Object o = enum.nextElement(); hasNext = enum.hasMoreElements(); | Object o = enumeration.nextElement(); hasNext = enumeration.hasMoreElements(); | final public Object next () throws NoSuchElementException { if (!hasNext) { throw new NoSuchElementException("advanced past end of list"); } Object o = enum.nextElement(); hasNext = enum.hasMoreElements(); return o; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/66b6fa23bd4cbc41e75a36f1705ebb0db3d2f013/EnumIterator.java/buggy/webmacro/src/org/webmacro/util/EnumIterator.java |
p.linkDataset( d1 ); p.linkDataset( d2 ); p.linkDataset( d3 ); d1.linkImage( i1 ); d1.linkImage( i2 ); d1.linkImage( i3 ); | protected void setUp() throws Exception { mapper=new Model2PojosMapper(); p = new Project(new Long(1)); d1 = new Dataset(new Long(2)); d2 = new Dataset(new Long(3)); d3 = new Dataset(new Long(4)); i1 = new Image(new Long(5)); i2 = new Image(new Long(6)); i3 = new Image(new Long(7));// p.setDatasets(new HashSet(Arrays.asList(new Dataset[]{d1,d2,d2})));// d1.setImages(new HashSet(Arrays.asList(new Image[]{i1})));// d2.setImages(new HashSet(Arrays.asList(new Image[]{i2})));// d3.setImages(new HashSet(Arrays.asList(new Image[]{i3})));// i1.setCreated(new Date());// i2.setInserted(new Date());// i1.setDatasets(new HashSet(Arrays.asList(new Dataset[]{d1})));// i2.setDatasets(new HashSet(Arrays.asList(new Dataset[]{d2})));// i3.setDatasets(new HashSet(Arrays.asList(new Dataset[]{d3}))); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5f68082026bcb57849846aaa0e4de7e32b6ebf72/Model2PojosMapperTest.java/buggy/components/shoola-adapter/test/ome/adapters/pojos/utests/Model2PojosMapperTest.java |
|
for (DisplayedNote removeMe : dd.getTree().getSelectedNotes()) { | while (dd.getTree().getSelectedNotes().size() > 0) { DisplayedNote removeMe = dd.getTree().getSelectedNotes().get(0); | public void removeNotes(Event e) { for (DisplayedNote removeMe : dd.getTree().getSelectedNotes()) { removeMe.deleteSelfAndChildren(); } } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/7ad283aaa04b8b53a82e0693b22ac284bcd6637b/NoteMenuController.java/buggy/trunk/src/de/berlios/koalanotes/display/menus/NoteMenuController.java |
String table = null; Class klass = parent.getClass(); if (klass.equals(Category.class)) table = "CategoryImageLink"; else if (klass.equals(Dataset.class)) table = "DatasetImageLink"; else if (klass.equals(Project.class)) table = "ProjectDatasetLink"; else if (klass.equals(CategoryGroup.class)) table = "CategoryGroupCategoryLink"; | String table = getTableForLink(parent.getClass()); | IObject findLink(IObject parent, IObject child) throws DSOutOfServiceException, DSAccessException { try { String table = null; Class klass = parent.getClass(); if (klass.equals(Category.class)) table = "CategoryImageLink"; else if (klass.equals(Dataset.class)) table = "DatasetImageLink"; else if (klass.equals(Project.class)) table = "ProjectDatasetLink"; else if (klass.equals(CategoryGroup.class)) table = "CategoryGroupCategoryLink"; if (table == null) return null; String sql = "select link from "+table+" as link where " + "link.parent.id = :parentID and link.child.id = :childID"; IQuery service = getIQueryService(); Parameters param = new Parameters(); param.addLong("parentID", parent.getId()); param.addLong("childID", child.getId()); return service.findByQuery(sql, param); } catch (Exception e) { handleException(e, "Cannot retrieve the requested link for "+ "parent ID: "+parent.getId()+" and child ID: "+child.getId()); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/87f0144809415c3236dabaa1afd6162d13a14ebe/OMEROGateway.java/clean/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java |
String table = null; Class klass = parent.getClass(); if (klass.equals(Category.class)) table = "CategoryImageLink"; else if (klass.equals(Dataset.class)) table = "DatasetImageLink"; else if (klass.equals(Project.class)) table = "ProjectDatasetLink"; else if (klass.equals(CategoryGroup.class)) table = "CategoryGroupCategoryLink"; | String table = getTableForLink(parent.getClass()); | List findLinks(IObject parent, List children) throws DSOutOfServiceException, DSAccessException { try { String table = null; Class klass = parent.getClass(); if (klass.equals(Category.class)) table = "CategoryImageLink"; else if (klass.equals(Dataset.class)) table = "DatasetImageLink"; else if (klass.equals(Project.class)) table = "ProjectDatasetLink"; else if (klass.equals(CategoryGroup.class)) table = "CategoryGroupCategoryLink"; if (table == null) return null; String sql = "select link from "+table+" as link where " + "link.parent.id = :parentID and link.child.id in " + "(:childIDs)"; IQuery service = getIQueryService(); Parameters param = new Parameters(); param.addLong("parentID", parent.getId()); param.addList("childIDs", children); return service.findAllByQuery(sql, param); } catch (Exception e) { handleException(e, "Cannot retrieve the requested link for "+ "parent ID: "+parent.getId()); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/87f0144809415c3236dabaa1afd6162d13a14ebe/OMEROGateway.java/clean/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java |
tmpl = "#if (true)\n { pass\n }\n #else\n { fail\n }"; assertStringTemplateEquals (tmpl, " pass\n "); | public void testBeginEnd () throws Exception { String tmpl = "#if (true) #begin pass #end #else #begin fail #end"; assertStringTemplateEquals (tmpl, "pass"); tmpl = "#if (true)\n #begin pass\n #end\n #else\n #begin fail\n #end"; assertStringTemplateEquals (tmpl, "pass\n"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/TestBlocks.java/clean/webmacro/test/unit/org/webmacro/template/TestBlocks.java |
|
public RubyRegexpException(String msg) { super(msg); | public RubyRegexpException() { | public RubyRegexpException(String msg) { super(msg); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9a05f18f2b6207bf93455d756436fe8f0002b542/RubyRegexpException.java/buggy/org/jruby/exceptions/RubyRegexpException.java |
ruby.getRubyParser().compileString(sb.toString(), fname, 0); | ruby.getRubyParser().compileString(fname.getValue(), RubyString.m_newString(ruby, sb.toString()), 0); | public void load(RubyString fname, boolean wrap) { RubyObject self = ruby.getRubyTopSelf(); NODE savedCRef = ruby.getRubyCRef(); // TMP_PROTECT; if (wrap && ruby.getSecurityLevel() >= 4) { // Check_Type(fname, T_STRING); } else { // Check_SafeStr(fname); } // fname = findFile(fname); if (fname == null) { throw new RubyException("No such file to load -- " + fname.getValue()); } // volatile ID last_func; // volatile VALUE wrapper = 0; // ruby_errinfo = Qnil; /* ensure */ RubyVarmap.push(ruby); pushClass(); RubyModule wrapper = ruby_wrapper; ruby.setRubyCRef(ruby.getTopCRef()); if (!wrap) { ruby.secure(4); /* should alter global state */ ruby.setRubyClass(ruby.getClasses().getObjectClass()); ruby_wrapper = null; } else { /* load in anonymous module as toplevel */ ruby_wrapper = RubyModule.m_newModule(ruby); ruby.setRubyClass(ruby_wrapper); self = ruby.getRubyTopSelf().m_clone(); self.extendObject(ruby.getRubyClass()); PUSH_CREF(ruby_wrapper); } ruby.getRubyFrame().push(); ruby.getRubyFrame().setLastFunc(null); ruby.getRubyFrame().setLastClass(null); ruby.getRubyFrame().setSelf(self); ruby.getRubyFrame().setCbase(new NodeFactory(ruby).newDefaultNode(NODE.NODE_CREF, ruby.getRubyClass(), null, null)); ruby.getRubyScope().push(); /* default visibility is private at loading toplevel */ setActMethodScope(SCOPE_PRIVATE); RubyId last_func = ruby.getRubyFrame().getLastFunc(); try { // RubyId last_func = ruby.getRubyFrame().getLastFunc(); // DEFER_INTS; ruby.setInEval(ruby.getInEval() + 1); // +++ try { File rubyFile = new File(fname.getValue()); StringBuffer sb = new StringBuffer((int)rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); ruby.getRubyParser().compileString(sb.toString(), fname, 0); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fname.getValue() + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } // --- ruby.setInEval(ruby.getInEval() - 1); eval(self, ruby.getParserHelper().getEvalTree()); // evalNode } catch (RubyException excptn) { } ruby.getRubyFrame().setLastFunc(last_func); /*if (ruby.getRubyScope().getFlags() == SCOPE_ALLOCA && ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { if (ruby_scope->local_tbl) free(ruby_scope->local_tbl); }*/ ruby.setRubyCRef(savedCRef); ruby.getRubyScope().pop(); ruby.getRubyFrame().pop(); popClass(); RubyVarmap.pop(ruby); ruby_wrapper = wrapper; /*if (ruby_nerrs > 0) { ruby_nerrs = 0; rb_exc_raise(ruby_errinfo); }*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6fb3288b71aaedfe3a7b5e8d1e561e0bc249dc6/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java |
eval(self, ruby.getParserHelper().getEvalTree()); } catch (RubyException excptn) { | if (ruby.getParserHelper().getEvalTreeBegin() != null) { System.out.println("EvalTreeBegin"); eval(self, ruby.getParserHelper().getEvalTreeBegin()); ruby.getParserHelper().setEvalTreeBegin(null); } if (ruby.getParserHelper().getEvalTree() != null) { System.out.println("EvalTree"); eval(self, ruby.getParserHelper().getEvalTree()); } } catch (Exception excptn) { excptn.printStackTrace(); | public void load(RubyString fname, boolean wrap) { RubyObject self = ruby.getRubyTopSelf(); NODE savedCRef = ruby.getRubyCRef(); // TMP_PROTECT; if (wrap && ruby.getSecurityLevel() >= 4) { // Check_Type(fname, T_STRING); } else { // Check_SafeStr(fname); } // fname = findFile(fname); if (fname == null) { throw new RubyException("No such file to load -- " + fname.getValue()); } // volatile ID last_func; // volatile VALUE wrapper = 0; // ruby_errinfo = Qnil; /* ensure */ RubyVarmap.push(ruby); pushClass(); RubyModule wrapper = ruby_wrapper; ruby.setRubyCRef(ruby.getTopCRef()); if (!wrap) { ruby.secure(4); /* should alter global state */ ruby.setRubyClass(ruby.getClasses().getObjectClass()); ruby_wrapper = null; } else { /* load in anonymous module as toplevel */ ruby_wrapper = RubyModule.m_newModule(ruby); ruby.setRubyClass(ruby_wrapper); self = ruby.getRubyTopSelf().m_clone(); self.extendObject(ruby.getRubyClass()); PUSH_CREF(ruby_wrapper); } ruby.getRubyFrame().push(); ruby.getRubyFrame().setLastFunc(null); ruby.getRubyFrame().setLastClass(null); ruby.getRubyFrame().setSelf(self); ruby.getRubyFrame().setCbase(new NodeFactory(ruby).newDefaultNode(NODE.NODE_CREF, ruby.getRubyClass(), null, null)); ruby.getRubyScope().push(); /* default visibility is private at loading toplevel */ setActMethodScope(SCOPE_PRIVATE); RubyId last_func = ruby.getRubyFrame().getLastFunc(); try { // RubyId last_func = ruby.getRubyFrame().getLastFunc(); // DEFER_INTS; ruby.setInEval(ruby.getInEval() + 1); // +++ try { File rubyFile = new File(fname.getValue()); StringBuffer sb = new StringBuffer((int)rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); ruby.getRubyParser().compileString(sb.toString(), fname, 0); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fname.getValue() + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } // --- ruby.setInEval(ruby.getInEval() - 1); eval(self, ruby.getParserHelper().getEvalTree()); // evalNode } catch (RubyException excptn) { } ruby.getRubyFrame().setLastFunc(last_func); /*if (ruby.getRubyScope().getFlags() == SCOPE_ALLOCA && ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { if (ruby_scope->local_tbl) free(ruby_scope->local_tbl); }*/ ruby.setRubyCRef(savedCRef); ruby.getRubyScope().pop(); ruby.getRubyFrame().pop(); popClass(); RubyVarmap.pop(ruby); ruby_wrapper = wrapper; /*if (ruby_nerrs > 0) { ruby_nerrs = 0; rb_exc_raise(ruby_errinfo); }*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6fb3288b71aaedfe3a7b5e8d1e561e0bc249dc6/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java |
if (!name.startsWith("/")) name = "/" + name; URL u = _servletContext.getResource(name); | String contextName = name; if (name.startsWith("/")) { name = name.substring(1); } else { StringBuffer b = new StringBuffer(name.length()+1); b.append("/"); b.append(name); contextName = b.toString(); } URL u = _servletContext.getResource(contextName); | public URL getResource(String name) { try { // NOTE: Tomcat4 needs a leading '/'. // If this doesn't work with your 2.2+ container, try commenting out the following line if (!name.startsWith("/")) name = "/" + name; URL u = _servletContext.getResource(name); if (u != null && u.getProtocol().equals("file")) { File f = new File(u.getFile()); if (!f.exists()) u = null; } if (u == null) u = _servletClassLoader.getResource(name); if (u == null) u = super.getResource(name); return u; } catch (MalformedURLException e) { _log.warning("MalformedURLException caught in " + "ServletBroker.getResource for " + name); return null; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8fa9b52e736aaea7b8b1845ed47dba457c9a7c94/Servlet22Broker.java/clean/webmacro/src/org/webmacro/servlet/Servlet22Broker.java |
File f = new File(u.getFile()); if (!f.exists()) u = null; | File f = new File(u.getFile()); if (!f.exists()) u = null; | public URL getResource(String name) { try { // NOTE: Tomcat4 needs a leading '/'. // If this doesn't work with your 2.2+ container, try commenting out the following line if (!name.startsWith("/")) name = "/" + name; URL u = _servletContext.getResource(name); if (u != null && u.getProtocol().equals("file")) { File f = new File(u.getFile()); if (!f.exists()) u = null; } if (u == null) u = _servletClassLoader.getResource(name); if (u == null) u = super.getResource(name); return u; } catch (MalformedURLException e) { _log.warning("MalformedURLException caught in " + "ServletBroker.getResource for " + name); return null; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8fa9b52e736aaea7b8b1845ed47dba457c9a7c94/Servlet22Broker.java/clean/webmacro/src/org/webmacro/servlet/Servlet22Broker.java |
if (u == null) | if (u == null) { | public URL getResource(String name) { try { // NOTE: Tomcat4 needs a leading '/'. // If this doesn't work with your 2.2+ container, try commenting out the following line if (!name.startsWith("/")) name = "/" + name; URL u = _servletContext.getResource(name); if (u != null && u.getProtocol().equals("file")) { File f = new File(u.getFile()); if (!f.exists()) u = null; } if (u == null) u = _servletClassLoader.getResource(name); if (u == null) u = super.getResource(name); return u; } catch (MalformedURLException e) { _log.warning("MalformedURLException caught in " + "ServletBroker.getResource for " + name); return null; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8fa9b52e736aaea7b8b1845ed47dba457c9a7c94/Servlet22Broker.java/clean/webmacro/src/org/webmacro/servlet/Servlet22Broker.java |
if (u == null) | } if (u == null) | public URL getResource(String name) { try { // NOTE: Tomcat4 needs a leading '/'. // If this doesn't work with your 2.2+ container, try commenting out the following line if (!name.startsWith("/")) name = "/" + name; URL u = _servletContext.getResource(name); if (u != null && u.getProtocol().equals("file")) { File f = new File(u.getFile()); if (!f.exists()) u = null; } if (u == null) u = _servletClassLoader.getResource(name); if (u == null) u = super.getResource(name); return u; } catch (MalformedURLException e) { _log.warning("MalformedURLException caught in " + "ServletBroker.getResource for " + name); return null; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8fa9b52e736aaea7b8b1845ed47dba457c9a7c94/Servlet22Broker.java/clean/webmacro/src/org/webmacro/servlet/Servlet22Broker.java |
public void actionPerformed(ActionEvent e) { long now = System.currentTimeMillis(); if (now - lastTypedCharTime > 2000) { if (!sendNotification) { // send cancel SparkManager.getMessageEventManager().sendCancelledNotification(getParticipantJID(), threadID); sendNotification = true; } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0bc7db8cc68c7433cd601f93a8d06f275e576e91/ChatRoomImpl.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/ChatRoomImpl.java |
||
SparkManager.getMessageEventManager().removeMessageEventRequestListener(messageEventRequestListener); | public void closeChatRoom() { super.closeChatRoom(); SparkManager.getMessageEventManager().removeMessageEventRequestListener(messageEventRequestListener); SparkManager.getChatManager().removeChat(this); SparkManager.getConnection().removePacketListener(this); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0bc7db8cc68c7433cd601f93a8d06f275e576e91/ChatRoomImpl.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/ChatRoomImpl.java |
|
typingTimer.stop(); | public void closeChatRoom() { super.closeChatRoom(); SparkManager.getMessageEventManager().removeMessageEventRequestListener(messageEventRequestListener); SparkManager.getChatManager().removeChat(this); SparkManager.getConnection().removePacketListener(this); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0bc7db8cc68c7433cd601f93a8d06f275e576e91/ChatRoomImpl.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/ChatRoomImpl.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.