rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
getViewport().setBackground(BACKGROUND); | private void buildGUI() { getViewport().add(layeredPane); getViewport().setBackground(BACKGROUND); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/4077a713b0e44eebe43adbb3a899add85b8ca9c2/BrowserUI.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserUI.java |
|
throw getRuntime().newIOError(e.getMessage()); | throw getRuntime().newIOError(e.getMessage()); | public RubyBoolean eof() { try { boolean isEOF = handler.isEOF(); return isEOF ? getRuntime().getTrue() : getRuntime().getFalse(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/RubyIO.java/buggy/src/org/jruby/RubyIO.java |
if (! widestClassInterfaces.contains(iface)) { | if (!widestClassInterfaces.contains(iface)) { | private static Class returnedObjectType(Object javaResult, Method returningMethod) { Class widestClass = returningMethod.getReturnType(); if (javaResult == null) { return widestClass; } Class narrowestClass = javaResult.getClass(); if (narrowestClass.isPrimitive()) { return narrowestClass; } if (widestClass.isPrimitive()) { return widestClass; } Asserts.isTrue(widestClass.isAssignableFrom(narrowestClass)); if (Modifier.isPublic(narrowestClass.getModifiers())) { return narrowestClass; } if (widestClass.isInterface()) { return widestClass; } // If there is any interface on the narrowest that isn't on the widest, // then we should use that. The theory is that this should minimize information // loss. (This theory is open to discussion ;-) Iterator narrowestClassInterfaces = Arrays.asList(narrowestClass.getInterfaces()).iterator(); List widestClassInterfaces = Arrays.asList(widestClass.getInterfaces()); while (narrowestClassInterfaces.hasNext()) { Class iface = (Class) narrowestClassInterfaces.next(); if (! widestClassInterfaces.contains(iface)) { return iface; } } while (true) { narrowestClass = narrowestClass.getSuperclass(); Asserts.isTrue(narrowestClass != null); if (Modifier.isPublic(narrowestClass.getModifiers())) { return narrowestClass; } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/05c7de156620b4e1926ea77f476287db1b42b4cc/JavaUtil.java/buggy/src/org/jruby/javasupport/JavaUtil.java |
public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyObject[] args, boolean noSuper) { | public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyPointer args, boolean noSuper) { | public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyObject[] args, boolean noSuper) { return eval(ruby, recv); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f629550c5947df9c1dbe414645f3dc76bcb70df4/AttrSetNode.java/buggy/org/jruby/nodes/AttrSetNode.java |
List catIds = cg.collectFromCategoryLinks( new IdBlock() ); | List catIds = cg.eachLinkedCategory( new IdBlock() ); | private void check_cgc_ids(List ids) { for (CategoryGroup cg: (List<CategoryGroup>) list) { List catIds = cg.collectFromCategoryLinks( new IdBlock() ); assertTrue( "And our categories weren't there", catIds.containsAll( ids )); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
for (Category cat: (List<Category>) cg.collectFromCategoryLinks(null)) | for (Category cat: (List<Category>) cg.eachLinkedCategory(null)) | private void check_cgci_ids(List ids1, List ids2) { check_cgc_ids( ids1 ); for (CategoryGroup cg: (List<CategoryGroup>) list) { for (Category cat: (List<Category>) cg.collectFromCategoryLinks(null)) { List imagesIds = cat.collectFromImageLinks( new IdBlock() ); assertTrue( "Missing images", imagesIds.containsAll( ids2 )); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
List imagesIds = cat.collectFromImageLinks( new IdBlock() ); | List imagesIds = cat.eachLinkedImage( new IdBlock() ); | private void check_cgci_ids(List ids1, List ids2) { check_cgc_ids( ids1 ); for (CategoryGroup cg: (List<CategoryGroup>) list) { for (Category cat: (List<Category>) cg.collectFromCategoryLinks(null)) { List imagesIds = cat.collectFromImageLinks( new IdBlock() ); assertTrue( "Missing images", imagesIds.containsAll( ids2 )); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
List imgIds = cat.collectFromImageLinks( new IdBlock() ); | List imgIds = cat.eachLinkedImage( new IdBlock() ); | private void check_ci_ids(List ids) { for (Category cat: (List<Category>) list) { List imgIds = cat.collectFromImageLinks( new IdBlock() ); assertTrue( "And our images weren't there", imgIds.containsAll( ids )); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
List imgIds = ds.collectFromImageLinks( new IdBlock() ); | List imgIds = ds.eachLinkedImage( new IdBlock() ); | private void check_di_ids(List ids) { for (Dataset ds: (List<Dataset>) list) { List imgIds = ds.collectFromImageLinks( new IdBlock() ); assertTrue( "And our images weren't there", imgIds.containsAll( ids )); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
List datasetIds = prj.collectFromDatasetLinks( new IdBlock() ); | List datasetIds = prj.eachLinkedDataset( new IdBlock() ); | private void check_pd_ids(List ids) { for (Project prj : (List<Project>) list) { List datasetIds = prj.collectFromDatasetLinks( new IdBlock() ); assertTrue( "And our datasets weren't there", datasetIds.containsAll( ids )); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
for (Dataset ds : (List<Dataset>) prj.collectFromDatasetLinks(null)) | for (Dataset ds : (List<Dataset>) prj.eachLinkedDataset(null)) | private void check_pdi_ids(List ids1, List ids2) { check_pd_ids( ids1 ); for (Project prj : (List<Project>) list) { for (Dataset ds : (List<Dataset>) prj.collectFromDatasetLinks(null)) { List imagesIds = ds.collectFromImageLinks( new IdBlock() ); assertTrue( "Missing images", imagesIds.containsAll( ids2 )); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
List imagesIds = ds.collectFromImageLinks( new IdBlock() ); | List imagesIds = ds.eachLinkedImage( new IdBlock() ); | private void check_pdi_ids(List ids1, List ids2) { check_pd_ids( ids1 ); for (Project prj : (List<Project>) list) { for (Dataset ds : (List<Dataset>) prj.collectFromDatasetLinks(null)) { List imagesIds = ds.collectFromImageLinks( new IdBlock() ); assertTrue( "Missing images", imagesIds.containsAll( ids2 )); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/LoadContainersQueryTest.java/clean/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java |
this.rubyThreadList = Collections.synchronizedList(new ArrayList()); | this.rubyThreadList = Collections.synchronizedSet(new WeakHashSet()); | public ThreadService(IRuby runtime) { this.runtime = runtime; this.mainContext = new ThreadContext(runtime); this.localContext = new ThreadLocal(); this.rubyThreadGroup = new ThreadGroup("Ruby Threads#" + runtime.hashCode()); this.rubyThreadList = Collections.synchronizedList(new ArrayList()); // Must be called from main thread (it is currently, but this bothers me) mainThread = Thread.currentThread(); localContext.set(mainContext); rubyThreadList.add(mainThread); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff0051fc6f996525d3eadb673203837473cc3e41/ThreadService.java/buggy/src/org/jruby/internal/runtime/ThreadService.java |
gammaSlider = new JSlider(JSlider.HORIZONTAL, MIN_GAMMA, MAX_GAMMA, | gammaSlider = new JSlider(SwingConstants.HORIZONTAL, MIN_GAMMA, MAX_GAMMA, | private void initComponents() { graphicsPane = new GraphicsPane(model, controller); familyBox = new JComboBox(model.getFamilies().toArray()); String family = model.getFamily(); familyBox.setSelectedItem(family); familyBox.addActionListener(this); familyBox.setActionCommand(""+FAMILY); double k = model.getCurveCoefficient(); gammaSlider = new JSlider(JSlider.HORIZONTAL, MIN_GAMMA, MAX_GAMMA, (int) (k*FACTOR)); gammaSlider.setEnabled(!(family.equals(RendererModel.LINEAR) || family.equals(RendererModel.LOGARITHMIC))); gammaSlider.addChangeListener(this); gammaLabel = new JTextField(""+k); gammaLabel.setEnabled(false); gammaLabel.setEditable(false); int v = model.getBitResolution(); bitDepthSlider = new JSlider(JSlider.HORIZONTAL, MIN_BIT_DEPTH, MAX_BIT_DEPTH, convertBitResolution(v)); bitDepthSlider.addChangeListener(this); bitDepthLabel = new JTextField(""+v); bitDepthLabel.setEnabled(false); bitDepthLabel.setEditable(false); noiseReduction = new JCheckBox(); noiseReduction.setSelected(model.isNoiseReduction()); noiseReduction.setAction( controller.getAction(RendererControl.NOISE_REDUCTION)); histogramButton = new JButton( controller.getAction(RendererControl.HISTOGRAM)); channelList = new ArrayList(); channelButtonPanel = createChannelButtons(); isAdvancedSettingsShowing = false; advancedOptionsButton = new JButton(SHOW_ADVANCED_OPTIONS); advancedOptionsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleClick(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/014315640235a4a52d00b660672441a07dfa10ea/DomainPane.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/rnd/DomainPane.java |
bitDepthSlider = new JSlider(JSlider.HORIZONTAL, MIN_BIT_DEPTH, | bitDepthSlider = new JSlider(SwingConstants.HORIZONTAL, MIN_BIT_DEPTH, | private void initComponents() { graphicsPane = new GraphicsPane(model, controller); familyBox = new JComboBox(model.getFamilies().toArray()); String family = model.getFamily(); familyBox.setSelectedItem(family); familyBox.addActionListener(this); familyBox.setActionCommand(""+FAMILY); double k = model.getCurveCoefficient(); gammaSlider = new JSlider(JSlider.HORIZONTAL, MIN_GAMMA, MAX_GAMMA, (int) (k*FACTOR)); gammaSlider.setEnabled(!(family.equals(RendererModel.LINEAR) || family.equals(RendererModel.LOGARITHMIC))); gammaSlider.addChangeListener(this); gammaLabel = new JTextField(""+k); gammaLabel.setEnabled(false); gammaLabel.setEditable(false); int v = model.getBitResolution(); bitDepthSlider = new JSlider(JSlider.HORIZONTAL, MIN_BIT_DEPTH, MAX_BIT_DEPTH, convertBitResolution(v)); bitDepthSlider.addChangeListener(this); bitDepthLabel = new JTextField(""+v); bitDepthLabel.setEnabled(false); bitDepthLabel.setEditable(false); noiseReduction = new JCheckBox(); noiseReduction.setSelected(model.isNoiseReduction()); noiseReduction.setAction( controller.getAction(RendererControl.NOISE_REDUCTION)); histogramButton = new JButton( controller.getAction(RendererControl.HISTOGRAM)); channelList = new ArrayList(); channelButtonPanel = createChannelButtons(); isAdvancedSettingsShowing = false; advancedOptionsButton = new JButton(SHOW_ADVANCED_OPTIONS); advancedOptionsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleClick(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/014315640235a4a52d00b660672441a07dfa10ea/DomainPane.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/rnd/DomainPane.java |
Writer out = null; | FastWriter fw = null; | final protected void execute(Template tmpl, WebContext c) { Writer out = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/782bc2d5740244aa5e935d4efb75c599edb7c97a/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
FastWriter fw; | final protected void execute(Template tmpl, WebContext c) { Writer out = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/782bc2d5740244aa5e935d4efb75c599edb7c97a/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
|
HttpServletResponse resp= c.getResponse(); | HttpServletResponse resp= c.getResponse(); Locale locale = (Locale) tmpl.getParam( WMConstants.TEMPLATE_LOCALE); _log.debug("TemplateLocale="+locale); if (locale != null) { setLocale(resp, locale); } String encoding = (String) tmpl.getParam( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding(); } _log.debug("Using output encoding "+encoding); | final protected void execute(Template tmpl, WebContext c) { Writer out = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/782bc2d5740244aa5e935d4efb75c599edb7c97a/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
resp.getOutputStream(), resp.getCharacterEncoding()); | resp.getOutputStream(), encoding); | final protected void execute(Template tmpl, WebContext c) { Writer out = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/782bc2d5740244aa5e935d4efb75c599edb7c97a/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
try { out.write(error); } catch (Exception ignore) { } | try { fw.write(error); } catch (Exception ignore) { } | final protected void execute(Template tmpl, WebContext c) { Writer out = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/782bc2d5740244aa5e935d4efb75c599edb7c97a/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
if (out != null) { out.flush(); out.close(); | if (fw != null) { fw.flush(); fw.close(); | final protected void execute(Template tmpl, WebContext c) { Writer out = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/782bc2d5740244aa5e935d4efb75c599edb7c97a/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
return cond1(node, 0); | if (node == null) { return null; } if (node.getType() == Constants.NODE_NEWLINE) { node.setNextNode(cond0(node.getNextNode()/*, logop*/)); return node; } return cond0(node/*, logop*/); | public Node cond(Node node) { return cond1(node, 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
private Node cond0(Node node, int logop) { | private Node cond0(Node node /*, int logop*/) { | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
case Constants.NODE_DSTR : | /*case Constants.NODE_DSTR : | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
break; | break;*/ | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
warning_unless_e_option("regex literal in condition"); | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
|
node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); | Node flipNode = new FlipNode(cond2(node.getBeginNode()/*, logop*/), cond2(node.getEndNode()/*, logop*/), exclusive); flipNode.setCount(registerLocal(null)); | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; | return flipNode; | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
warning_unless_e_option("regex literal in condition"); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); | getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch(node); } else if (node.getLiteral() instanceof RubyString) { getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch(nf.newLit(RubyRegexp.newRegexp(ruby, (RubyString)node.getLiteral(), 0))); | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
return node; | private Node cond0(Node node, int logop) { int type = node.getType(); // enum node_type assign_in_cond(node); switch (type) { case Constants.NODE_DSTR : case Constants.NODE_STR : if (logop != 0) { break; } rb_warn("string literal in condition"); break; case Constants.NODE_DREGX : case Constants.NODE_DREGX_ONCE : warning_unless_e_option("regex literal in condition"); getLocalIndex("_"); getLocalIndex("~"); return nf.newMatch2(node, nf.newGVar("$_")); case Constants.NODE_DOT2 : case Constants.NODE_DOT3 : node.setBeginNode(range_op(node.getBeginNode(), logop)); node.setEndNode(range_op(node.getEndNode(), logop)); ((DotNode) node).setFlip(true); node.setCount(registerLocal(null)); warning_unless_e_option("range literal in condition"); break; case Constants.NODE_LIT : if (node.getLiteral() instanceof RubyRegexp) { warning_unless_e_option("regex literal in condition"); // +++ // node.nd_set_type(Constants.NODE_MATCH); throw new RuntimeException("[BUG] node.nd_set_type(Constants.NODE_MATCH)"); // local_cnt("_"); // local_cnt("~"); // --- } } return node; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
|
return new AndNode(cond1(left, 1), cond1(right, 1)); | return new AndNode(cond(left), cond(right)); | public Node logop(int type, Node left, Node right) { value_expr(left); switch (type) { case Constants.NODE_AND : return new AndNode(cond1(left, 1), cond1(right, 1)); case Constants.NODE_OR : return new OrNode(cond1(left, 1), cond1(right, 1)); default : throw new RuntimeException("[BUG] ParserHelper#logop: Nodetype=" + type); } // return nf.newDefaultNode(type, cond1(left, 1), cond1(right, 1), null); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
return new OrNode(cond1(left, 1), cond1(right, 1)); | return new OrNode(cond(left), cond(right)); | public Node logop(int type, Node left, Node right) { value_expr(left); switch (type) { case Constants.NODE_AND : return new AndNode(cond1(left, 1), cond1(right, 1)); case Constants.NODE_OR : return new OrNode(cond1(left, 1), cond1(right, 1)); default : throw new RuntimeException("[BUG] ParserHelper#logop: Nodetype=" + type); } // return nf.newDefaultNode(type, cond1(left, 1), cond1(right, 1), null); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
name = name.intern(); | name = name != null ? name.intern() : null; | private int registerLocal(String name) { name = name.intern(); if (lvtbl.tbl == null) { lvtbl.tbl = new ArrayList(); lvtbl.tbl.add("_"); lvtbl.tbl.add("~"); if (name == "_") { return 0; } else if (name == "~") { return 1; } } lvtbl.tbl.add(name); return lvtbl.cnt() - 1; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f6d418b0c7d9027a0d80f0c8a2a854790ba53aa/ParserHelper.java/buggy/org/jruby/parser/ParserHelper.java |
rubyClass.defineAlias("<=>", "compareTo"); | rubyClass.defineAlias("<=>", "compareTo"); | private void addDefaultModules(RubyClass rubyClass) { if (rubyClass.isMethodDefined("hasNext") && rubyClass.isMethodDefined("next")) { rubyClass.includeModule(ruby.getClasses().getEnumerableModule()); rubyClass.defineMethod("each", new JavaEachMethod("hasNext", "next")); } else if (rubyClass.isMethodDefined("hasNext") && rubyClass.isMethodDefined("next")) { rubyClass.includeModule(ruby.getClasses().getEnumerableModule()); rubyClass.defineMethod("each", new JavaEachMethod("hasMoreElements", "nextElement")); } if (rubyClass.isMethodDefined("compareTo")) { rubyClass.includeModule(ruby.getClasses().getComparableModule()); if (!rubyClass.isMethodDefined("<=>")) { rubyClass.defineAlias("<=>", "compareTo"); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
defineFields(javaClass, rubyClass); | private RubyClass createRubyClass(Class javaClass, String rubyName) { RubyClass superClass = (RubyClass) loadClass(javaClass.getSuperclass(), null); RubyClass rubyClass = ruby.defineClass(rubyName, superClass); defineWrapperMethods(javaClass, rubyClass, true); defineConstants(javaClass, rubyClass); addDefaultModules(rubyClass); loadedJavaClasses.put(javaClass, rubyClass); return rubyClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
|
private RubyModule createRubyInterface(Class javaInterface, String rubyName) { RubyModule newInterface = ruby.defineModule(rubyName); Map methods = sortMethodsByName(Arrays.asList(javaInterface.getMethods())); for (Iterator iter = methods.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry)iter.next(); newInterface.defineModuleFunction((String)entry.getKey(), new JavaInterfaceMethod((String)entry.getKey(), (Set)entry.getValue())); } newInterface.defineModuleFunction("new" + rubyName, new JavaInterfaceConstructor(javaInterface)); return newInterface; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
private RubyModule createRubyInterface(Class javaInterface, String rubyName) { RubyModule newInterface = ruby.defineModule(rubyName); Map methods = sortMethodsByName(Arrays.asList(javaInterface.getMethods())); for (Iterator iter = methods.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry)iter.next(); newInterface.defineModuleFunction((String)entry.getKey(), new JavaInterfaceMethod((String)entry.getKey(), (Set)entry.getValue())); } newInterface.defineModuleFunction("new" + rubyName, new JavaInterfaceConstructor(javaInterface)); return newInterface; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
Map.Entry entry = (Map.Entry)iter.next(); newInterface.defineModuleFunction((String)entry.getKey(), new JavaInterfaceMethod((String)entry.getKey(), (Set)entry.getValue())); | Map.Entry entry = (Map.Entry) iter.next(); newInterface.defineModuleFunction((String) entry.getKey(), new JavaInterfaceMethod((String) entry.getKey(), (Set) entry.getValue())); | private RubyModule createRubyInterface(Class javaInterface, String rubyName) { RubyModule newInterface = ruby.defineModule(rubyName); Map methods = sortMethodsByName(Arrays.asList(javaInterface.getMethods())); for (Iterator iter = methods.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry)iter.next(); newInterface.defineModuleFunction((String)entry.getKey(), new JavaInterfaceMethod((String)entry.getKey(), (Set)entry.getValue())); } newInterface.defineModuleFunction("new" + rubyName, new JavaInterfaceConstructor(javaInterface)); return newInterface; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
private void defineConstants(Class javaClass, RubyClass rubyClass) { // add constants Field[] fields = javaClass.getFields(); for (int i = 0; i < fields.length; i++) { int modifiers = fields[i].getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) { try { String name = fields[i].getName(); // Uppercase first character of the constant name name = Character.toUpperCase(name.charAt(0)) + name.substring(1); rubyClass.defineConstant(name, JavaUtil.convertJavaToRuby(ruby, fields[i].get(null), fields[i].getType())); } catch (IllegalAccessException iaExcptn) { } } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
private void defineConstants(Class javaClass, RubyClass rubyClass) { // add constants Field[] fields = javaClass.getFields(); for (int i = 0; i < fields.length; i++) { int modifiers = fields[i].getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) { try { String name = fields[i].getName(); // Uppercase first character of the constant name name = Character.toUpperCase(name.charAt(0)) + name.substring(1); rubyClass.defineConstant(name, JavaUtil.convertJavaToRuby(ruby, fields[i].get(null), fields[i].getType())); } catch (IllegalAccessException iaExcptn) { } } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
private void defineConstants(Class javaClass, RubyClass rubyClass) { // add constants Field[] fields = javaClass.getFields(); for (int i = 0; i < fields.length; i++) { int modifiers = fields[i].getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) { try { String name = fields[i].getName(); // Uppercase first character of the constant name name = Character.toUpperCase(name.charAt(0)) + name.substring(1); rubyClass.defineConstant(name, JavaUtil.convertJavaToRuby(ruby, fields[i].get(null), fields[i].getType())); } catch (IllegalAccessException iaExcptn) { } } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
} | } | private void defineConstants(Class javaClass, RubyClass rubyClass) { // add constants Field[] fields = javaClass.getFields(); for (int i = 0; i < fields.length; i++) { int modifiers = fields[i].getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) { try { String name = fields[i].getName(); // Uppercase first character of the constant name name = Character.toUpperCase(name.charAt(0)) + name.substring(1); rubyClass.defineConstant(name, JavaUtil.convertJavaToRuby(ruby, fields[i].get(null), fields[i].getType())); } catch (IllegalAccessException iaExcptn) { } } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
String javaName = (String)entry.getKey(); | String javaName = (String) entry.getKey(); | private void defineWrapperMethods(Class javaClass, RubyClass rubyClass, boolean searchSuper) { Map methodMap = new HashMap(); Map singletonMethodMap = new HashMap(); Method[] methods = javaClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { String methodName = methods[i].getName(); if (Modifier.isStatic(methods[i].getModifiers())) { if (singletonMethodMap.get(methods[i].getName()) == null) { singletonMethodMap.put(methods[i].getName(), new LinkedList()); } ((List) singletonMethodMap.get(methods[i].getName())).add(methods[i]); } else { if (methodMap.get(methods[i].getName()) == null) { methodMap.put(methods[i].getName(), new LinkedList()); } ((List) methodMap.get(methods[i].getName())).add(methods[i]); } } if (javaClass.getConstructors().length > 0) { rubyClass.defineSingletonMethod("new", new JavaConstructor(javaClass.getConstructors())); } else { rubyClass.getSingletonClass().undefMethod("new"); } Iterator iter = methodMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); methods = (Method[]) ((List) entry.getValue()).toArray(new Method[((List) entry.getValue()).size()]); String javaName = (String)entry.getKey(); String rubyName = toRubyName(javaName); rubyClass.defineMethod(javaName, new JavaMethod(methods, searchSuper)); if (!rubyClass.isMethodDefined(rubyName)) { rubyClass.defineAlias(rubyName, javaName); } } iter = singletonMethodMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); methods = (Method[]) ((List) entry.getValue()).toArray(new Method[((List) entry.getValue()).size()]); rubyClass.defineSingletonMethod((String)entry.getKey(), new JavaMethod(methods, searchSuper, true)); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
rubyClass.defineSingletonMethod((String)entry.getKey(), new JavaMethod(methods, searchSuper, true)); | rubyClass.defineSingletonMethod((String) entry.getKey(), new JavaMethod(methods, searchSuper, true)); | private void defineWrapperMethods(Class javaClass, RubyClass rubyClass, boolean searchSuper) { Map methodMap = new HashMap(); Map singletonMethodMap = new HashMap(); Method[] methods = javaClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { String methodName = methods[i].getName(); if (Modifier.isStatic(methods[i].getModifiers())) { if (singletonMethodMap.get(methods[i].getName()) == null) { singletonMethodMap.put(methods[i].getName(), new LinkedList()); } ((List) singletonMethodMap.get(methods[i].getName())).add(methods[i]); } else { if (methodMap.get(methods[i].getName()) == null) { methodMap.put(methods[i].getName(), new LinkedList()); } ((List) methodMap.get(methods[i].getName())).add(methods[i]); } } if (javaClass.getConstructors().length > 0) { rubyClass.defineSingletonMethod("new", new JavaConstructor(javaClass.getConstructors())); } else { rubyClass.getSingletonClass().undefMethod("new"); } Iterator iter = methodMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); methods = (Method[]) ((List) entry.getValue()).toArray(new Method[((List) entry.getValue()).size()]); String javaName = (String)entry.getKey(); String rubyName = toRubyName(javaName); rubyClass.defineMethod(javaName, new JavaMethod(methods, searchSuper)); if (!rubyClass.isMethodDefined(rubyName)) { rubyClass.defineAlias(rubyName, javaName); } } iter = singletonMethodMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); methods = (Method[]) ((List) entry.getValue()).toArray(new Method[((List) entry.getValue()).size()]); rubyClass.defineSingletonMethod((String)entry.getKey(), new JavaMethod(methods, searchSuper, true)); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
if (rubyName == null) { String javaName = javaClass.getName(); rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); } | if (rubyName == null) { String javaName = javaClass.getName(); rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); } | public RubyModule loadClass(Class javaClass, String rubyName) { if (javaClass == Object.class) { return ruby.getClasses().getJavaObjectClass(); } else if (loadedJavaClasses.get(javaClass) != null) { return (RubyModule) loadedJavaClasses.get(javaClass); } else { if (rubyName == null) { String javaName = javaClass.getName(); rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); } if (javaClass.isInterface()) { return createRubyInterface(javaClass, rubyName); } else { return createRubyClass(javaClass, rubyName); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
private static Map sortMethodsByName(List methodList) { Map methodMap = new HashMap(); Iterator iter = methodList.iterator(); while (iter.hasNext()) { Method method = (Method) iter.next(); if (!methodMap.containsKey(method.getName())) { methodMap.put(method.getName(), new HashSet()); } ((Set)methodMap.get(method.getName())).add(method); } return methodMap; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
private static Map sortMethodsByName(List methodList) { Map methodMap = new HashMap(); Iterator iter = methodList.iterator(); while (iter.hasNext()) { Method method = (Method) iter.next(); if (!methodMap.containsKey(method.getName())) { methodMap.put(method.getName(), new HashSet()); } ((Set)methodMap.get(method.getName())).add(method); } return methodMap; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
((Set)methodMap.get(method.getName())).add(method); | ((Set) methodMap.get(method.getName())).add(method); | private static Map sortMethodsByName(List methodList) { Map methodMap = new HashMap(); Iterator iter = methodList.iterator(); while (iter.hasNext()) { Method method = (Method) iter.next(); if (!methodMap.containsKey(method.getName())) { methodMap.put(method.getName(), new HashSet()); } ((Set)methodMap.get(method.getName())).add(method); } return methodMap; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
private static Map sortMethodsByName(List methodList) { Map methodMap = new HashMap(); Iterator iter = methodList.iterator(); while (iter.hasNext()) { Method method = (Method) iter.next(); if (!methodMap.containsKey(method.getName())) { methodMap.put(method.getName(), new HashSet()); } ((Set)methodMap.get(method.getName())).add(method); } return methodMap; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/JavaSupport.java/buggy/org/jruby/javasupport/JavaSupport.java |
||
in.close(); | try { in.close(); } catch (IOException e) { } | private static void copyResourceFromJar(String resourceName, File directory) throws IOException { int n; byte[] buf = new byte[1024]; InputStream in = null; FileOutputStream out = null; directory.mkdirs(); try { in = CopyFiles.class.getResourceAsStream(resourceName); if (in == null) throw new IllegalArgumentException("Resource " + resourceName + " does not exist in this package."); out = new FileOutputStream(new File(directory, resourceName)); while ((n = in.read(buf, 0, buf.length)) != -1) { out.write(buf, 0, n); } } finally { if (in != null) { in.close(); } if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/4d63a8c9fa3cc11c9152b3635695cdd64fa70119/CopyFiles.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/files/CopyFiles.java |
out.close(); | try { out.close(); } catch (IOException e) { } | private static void copyResourceFromJar(String resourceName, File directory) throws IOException { int n; byte[] buf = new byte[1024]; InputStream in = null; FileOutputStream out = null; directory.mkdirs(); try { in = CopyFiles.class.getResourceAsStream(resourceName); if (in == null) throw new IllegalArgumentException("Resource " + resourceName + " does not exist in this package."); out = new FileOutputStream(new File(directory, resourceName)); while ((n = in.read(buf, 0, buf.length)) != -1) { out.write(buf, 0, n); } } finally { if (in != null) { in.close(); } if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/4d63a8c9fa3cc11c9152b3635695cdd64fa70119/CopyFiles.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/files/CopyFiles.java |
JPanel p = new JPanel(); p.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); p. setBorder(BorderFactory.createEtchedBorder()); add(UIUtilities.buildComponentPanelRight(progressBar)); uiDelegate.setCanvas(p); | uiDelegate.setCanvas(progressBar); | private void buildGUI() { JProgressBar progressBar = new JProgressBar(); progressBar.setVisible(true); progressBar.setIndeterminate(true); JPanel p = new JPanel(); p.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); p. setBorder(BorderFactory.createEtchedBorder()); add(UIUtilities.buildComponentPanelRight(progressBar)); uiDelegate.setCanvas(p); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/423006aa061b61c5fd6f0a1b95754e8a9a2c0fef/LoadingWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clsf/LoadingWin.java |
DatasetData dd = simpleDatasetData(); Set dss = new HashSet(); dss.add(dd); imgData = simpleImageData(); imgData.setDatasets(dss); | imgData = simpleImageDataWithDatasets(); | public void testAndSaveSomtheingWithParents() throws Exception { DatasetData dd = simpleDatasetData(); Set dss = new HashSet(); dss.add(dd); imgData = simpleImageData(); imgData.setDatasets(dss); img = (Image) reverse.map(imgData); img = (Image) iUpdate.saveAndReturnObject(img); assertTrue("It better have a dataset link", img.sizeOfDatasetLinks()>0); ds = (Dataset) img.iterateOverDatasetLinks().next(); Long id = ds.getId(); // another copy Image img2 = (Image) iQuery.queryUnique( "select i from Image i " + "left outer join fetch i.datasetLinks " + "where i.id = ?", new Object[]{img.getId()}); assertTrue("It better have a dataset link too", img2.sizeOfDatasetLinks()>0); Dataset ds2 = (Dataset) img2.iterateOverDatasetLinks().next(); assertTrue("And the ids have to be the same",id.equals(ds2.getId())); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a39e29573bdd486ca5c91592a592b445e6d4625e/PojosServiceTest.java/buggy/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java |
PojoOptions po = new PojoOptions().exp( new Long(0L) ); results = iPojos.loadContainerHierarchy(Project.class, null, po.map() ); | public void test_loadContainerHierarchy() throws Exception { ids = new HashSet(data.getMax("Project.ids",2)); results = iPojos.loadContainerHierarchy(Project.class, ids, null); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a39e29573bdd486ca5c91592a592b445e6d4625e/PojosServiceTest.java/buggy/components/shoola-adapter/test/ome/adapters/pojos/itests/PojosServiceTest.java |
|
if (config.getSetting("TemplatePath").length() > 0) { | if (config.getSetting("TemplatePath","").length() > 0) { | public void init(Broker broker,Settings config) throws InitException { super.init(broker,config); this.broker = broker; log = broker.getLog("resource","DelegatingTemplateProvider"); String factoryClass = config.getSetting("TemplateLoaderFactory",""); log.info("DelegatingTemplateProvider: Using TemplateLoaderFactory "+factoryClass); factory = createFactory(factoryClass); List loaders = new ArrayList(); // for compatability reasons, check old TemplatePath setting if (config.getBooleanSetting("DelegatingTemplateProvider.EmulateTemplatePath",false)) { if (config.getSetting("TemplatePath").length() > 0) { TemplateLoader loader = new TemplatePathTemplateLoader(); loader.init(broker,config); loader.setConfig(""); loaders.add(loader); } } int i = 0; String loader = config.getSetting("TemplateLoaderPath.".concat(String.valueOf(i+1))); while (loader != null) { loaders.add(factory.getTemplateLoader(broker,loader)); i++; loader = config.getSetting("TemplateLoaderPath.".concat(String.valueOf(i+1))); } templateLoaders = new TemplateLoader[loaders.size()]; loaders.toArray(templateLoaders); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2564ec5be02ff55e4afaa8412d6bd4793b9e404c/DelegatingTemplateProvider.java/clean/webmacro/src/org/webmacro/resource/DelegatingTemplateProvider.java |
} else if (! ns.getNamespaceModule().getInstanceVariable(name).isNil()) { | } else if (ns.getNamespaceModule().hasInstanceVariable(name)) { | public IRubyObject getConstant(IRubyObject self, String name) { for (Namespace ns = this; ns != null && ns.getParent() != null; ns = ns.getParent()) { if (ns.getNamespaceModule() == null) { return self.getInternalClass().getConstant(name); } else if (! ns.getNamespaceModule().getInstanceVariable(name).isNil()) { return (IRubyObject) ns.getNamespaceModule().getInstanceVariable(name); } } return getNamespaceModule().getConstant(name); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/095520dd469b76e5c1b4ca012804294c66855e55/Namespace.java/buggy/org/jruby/runtime/Namespace.java |
if(e.getTargetException() instanceof MainExitException) { throw (RuntimeException)e.getTargetException(); } | public IRubyObject execute(IRubyObject recv, IRubyObject[] oargs) { arity.checkArity(recv.getRuntime(), oargs); Object[] methodArgs = oargs; if (isRestArgs) { methodArgs = packageRestArgumentsForReflection(methodArgs); } try { IRubyObject receiver = recv; if (isStaticMethod) { Object[] args = new Object[methodArgs.length + 1]; System.arraycopy(methodArgs, 0, args, 1, methodArgs.length); args[0] = recv; receiver = null; methodArgs = args; } return (IRubyObject) method.invoke(receiver, methodArgs); } catch (InvocationTargetException e) { if (e.getTargetException() instanceof RaiseException) { throw (RaiseException) e.getTargetException(); } else if (e.getTargetException() instanceof JumpException) { throw (JumpException) e.getTargetException(); } else if (e.getTargetException() instanceof ThreadKill) { // allow it to bubble up throw (ThreadKill) e.getTargetException(); } else if (e.getTargetException() instanceof Exception) { recv.getRuntime().getJavaSupport().handleNativeException(e.getTargetException()); return recv.getRuntime().getNil(); } else { throw (Error) e.getTargetException(); } } catch (IllegalAccessException e) { StringBuffer message = new StringBuffer(); message.append(e.getMessage()); message.append(':'); message.append(" methodName=").append(methodName); message.append(" recv=").append(recv.toString()); message.append(" type=").append(type.getName()); message.append(" methodArgs=["); for (int i = 0; i < methodArgs.length; i++) { message.append(methodArgs[i]); message.append(' '); } message.append(']'); assert false : message.toString(); return null; } catch (final IllegalArgumentException e) {/* StringBuffer message = new StringBuffer(); message.append(e.getMessage()); message.append(':'); message.append(" methodName=").append(methodName); message.append(" recv=").append(recv.toString()); message.append(" type=").append(type.getName()); message.append(" methodArgs=["); for (int i = 0; i < methodArgs.length; i++) { message.append(methodArgs[i]); message.append(' '); } message.append(']');*/ assert false : e; return null; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4312f891f233f275731e5d8afa842df31058fc8e/ReflectionCallback.java/buggy/src/org/jruby/runtime/callback/ReflectionCallback.java |
|
SpringApplicationContext applicationContext = new ResourceXmlApplicationContext(new FileSystemResource(file), xmlPreprocessors, parentContext, beanFactoryPostProcessors); | SpringApplicationContext applicationContext = new ResourceXmlApplicationContext(new FileSystemResource(file), xmlPreprocessors, parentContext, beanFactoryPostProcessors, false); | protected void createServiceForFile(String name, File file, ClassLoader classLoader, ApplicationContext parentContext) throws ServiceAlreadyExistsException, ServiceRegistrationException, BeansException, IOException { if (isSpringConfigFile(file)) { // make the current directory available to spring files System.setProperty("xbean.current.file", file.getAbsolutePath()); System.setProperty("xbean.current.dir", file.getParent()); // we have to set the context class loader while loading the spring // file // so we can auto-discover xbean configurations // and perform introspection ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); log.debug("Loading file: " + file + " using classLoader: " + classLoader); try { SpringApplicationContext applicationContext = new ResourceXmlApplicationContext(new FileSystemResource(file), xmlPreprocessors, parentContext, beanFactoryPostProcessors); applicationContext.setDisplayName(name); ServiceFactory serviceFactory = new SpringConfigurationServiceFactory(applicationContext); log.info("Registering spring services service: " + name + " from: " + file.getAbsolutePath() + " into the Kernel"); kernel.registerService(new StringServiceName(name), serviceFactory); } finally { Thread.currentThread().setContextClassLoader(oldClassLoader); } } else { if (showIgnoredFiles) { log.info("Ignoring file: " + file.getName() + " in directory: " + file.getParent()); } } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c60ad9116626de2c6d3638075063ca9ed4876ccd/FileDeployer.java/clean/xbean-server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java |
applicationContext.setClassLoader(classLoader); | protected void createServiceForFile(String name, File file, ClassLoader classLoader, ApplicationContext parentContext) throws ServiceAlreadyExistsException, ServiceRegistrationException, BeansException, IOException { if (isSpringConfigFile(file)) { // make the current directory available to spring files System.setProperty("xbean.current.file", file.getAbsolutePath()); System.setProperty("xbean.current.dir", file.getParent()); // we have to set the context class loader while loading the spring // file // so we can auto-discover xbean configurations // and perform introspection ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); log.debug("Loading file: " + file + " using classLoader: " + classLoader); try { SpringApplicationContext applicationContext = new ResourceXmlApplicationContext(new FileSystemResource(file), xmlPreprocessors, parentContext, beanFactoryPostProcessors); applicationContext.setDisplayName(name); ServiceFactory serviceFactory = new SpringConfigurationServiceFactory(applicationContext); log.info("Registering spring services service: " + name + " from: " + file.getAbsolutePath() + " into the Kernel"); kernel.registerService(new StringServiceName(name), serviceFactory); } finally { Thread.currentThread().setContextClassLoader(oldClassLoader); } } else { if (showIgnoredFiles) { log.info("Ignoring file: " + file.getName() + " in directory: " + file.getParent()); } } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/c60ad9116626de2c6d3638075063ca9ed4876ccd/FileDeployer.java/clean/xbean-server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java |
|
viewer3D.setEnabled(maxZ == 0); | viewer3D.setEnabled(maxZ != 0); | private void initComponents(Registry registry, int maxZ, int maxT) { //buttons IconManager im = IconManager.getInstance(registry); viewer3D = new JButton(im.getIcon(IconManager.VIEWER3D)); viewer3D.setToolTipText( UIUtilities.formatToolTipText("Bring up the image3D viewer.")); viewer3D.setEnabled(maxZ == 0); saveAs = new JButton(im.getIcon(IconManager.SAVEAS)); saveAs.setToolTipText( UIUtilities.formatToolTipText("Bring up the save image window.")); inspector = new JButton(im.getIcon(IconManager.INSPECTOR)); inspector.setToolTipText( UIUtilities.formatToolTipText("Bring up the inspector panel.")); render = new JButton(im.getIcon(IconManager.RENDER)); render.setToolTipText( UIUtilities.formatToolTipText("Bring up the rendering panel.")); movie = new JButton(im.getIcon(IconManager.MOVIE)); movie.setToolTipText( UIUtilities.formatToolTipText("Bring up the movie panel.")); roi = new JButton(im.getIcon(IconManager.ROI)); roi.setToolTipText( UIUtilities.formatToolTipText("Bring up the roi panel.")); if (maxT == 0 && maxZ == 0) movie.setEnabled(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/69d9ca849e67dccda3286f8ae868fd51e5634768/ToolBar.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBar.java |
private void initComponents(Registry registry, int maxZ, int maxT) { //buttons IconManager im = IconManager.getInstance(registry); viewer3D = new JButton(im.getIcon(IconManager.VIEWER3D)); viewer3D.setToolTipText( UIUtilities.formatToolTipText("Bring up the image3D viewer.")); viewer3D.setEnabled(maxZ == 0); saveAs = new JButton(im.getIcon(IconManager.SAVEAS)); saveAs.setToolTipText( UIUtilities.formatToolTipText("Bring up the save image window.")); inspector = new JButton(im.getIcon(IconManager.INSPECTOR)); inspector.setToolTipText( UIUtilities.formatToolTipText("Bring up the inspector panel.")); render = new JButton(im.getIcon(IconManager.RENDER)); render.setToolTipText( UIUtilities.formatToolTipText("Bring up the rendering panel.")); movie = new JButton(im.getIcon(IconManager.MOVIE)); movie.setToolTipText( UIUtilities.formatToolTipText("Bring up the movie panel.")); roi = new JButton(im.getIcon(IconManager.ROI)); roi.setToolTipText( UIUtilities.formatToolTipText("Bring up the roi panel.")); if (maxT == 0 && maxZ == 0) movie.setEnabled(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/69d9ca849e67dccda3286f8ae868fd51e5634768/ToolBar.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBar.java |
||
if (maxT == 0 && maxZ == 0) movie.setEnabled(false); | private void initComponents(Registry registry, int maxZ, int maxT) { //buttons IconManager im = IconManager.getInstance(registry); viewer3D = new JButton(im.getIcon(IconManager.VIEWER3D)); viewer3D.setToolTipText( UIUtilities.formatToolTipText("Bring up the image3D viewer.")); viewer3D.setEnabled(maxZ == 0); saveAs = new JButton(im.getIcon(IconManager.SAVEAS)); saveAs.setToolTipText( UIUtilities.formatToolTipText("Bring up the save image window.")); inspector = new JButton(im.getIcon(IconManager.INSPECTOR)); inspector.setToolTipText( UIUtilities.formatToolTipText("Bring up the inspector panel.")); render = new JButton(im.getIcon(IconManager.RENDER)); render.setToolTipText( UIUtilities.formatToolTipText("Bring up the rendering panel.")); movie = new JButton(im.getIcon(IconManager.MOVIE)); movie.setToolTipText( UIUtilities.formatToolTipText("Bring up the movie panel.")); roi = new JButton(im.getIcon(IconManager.ROI)); roi.setToolTipText( UIUtilities.formatToolTipText("Bring up the roi panel.")); if (maxT == 0 && maxZ == 0) movie.setEnabled(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/69d9ca849e67dccda3286f8ae868fd51e5634768/ToolBar.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBar.java |
|
private void initTextFields(int t, int z, int maxT, int maxZ) { zLabel = new JLabel("/"+maxZ); tLabel = new JLabel("/"+maxT); tField = new JTextField(""+t, (""+maxT).length()); //if (maxT == 0) tField.setEditable(false); tField.setEditable(maxT != 0); tField.setForeground(Viewer.STEELBLUE); tField.setToolTipText( UIUtilities.formatToolTipText("Enter a timepoint.")); zField = new JTextField(""+z, (""+maxZ).length()); zField.setForeground(Viewer.STEELBLUE); zField.setToolTipText( UIUtilities.formatToolTipText("Enter a Z point")); //if (maxZ-1 == 0) zField.setEditable(maxZ != 0); zField.setEditable(maxZ != 0); ztPanel = textFieldsPanel((""+maxZ).length(), (""+maxT).length()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/69d9ca849e67dccda3286f8ae868fd51e5634768/ToolBar.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBar.java |
||
private void initTextFields(int t, int z, int maxT, int maxZ) { zLabel = new JLabel("/"+maxZ); tLabel = new JLabel("/"+maxT); tField = new JTextField(""+t, (""+maxT).length()); //if (maxT == 0) tField.setEditable(false); tField.setEditable(maxT != 0); tField.setForeground(Viewer.STEELBLUE); tField.setToolTipText( UIUtilities.formatToolTipText("Enter a timepoint.")); zField = new JTextField(""+z, (""+maxZ).length()); zField.setForeground(Viewer.STEELBLUE); zField.setToolTipText( UIUtilities.formatToolTipText("Enter a Z point")); //if (maxZ-1 == 0) zField.setEditable(maxZ != 0); zField.setEditable(maxZ != 0); ztPanel = textFieldsPanel((""+maxZ).length(), (""+maxT).length()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/69d9ca849e67dccda3286f8ae868fd51e5634768/ToolBar.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBar.java |
||
} catch (ClassCastException e) { | } catch (ClassCastException e) { | public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { try { target = (Variable) builder.getArg(ALTERNATE_TARGET, bc); } catch (ClassCastException e) { throw new NotVariableBuildException(myDescr.name, e); } list = builder.getArg(ALTERNATE_LIST, bc); return this; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f1ee3e6d8769e6b0caff01371f0351a1c7e3950d/AlternateDirective.java/buggy/webmacro/src/org/webmacro/directive/AlternateDirective.java |
Object[] arr; | Object l = null; | public void write(FastWriter out, Context context) throws PropertyException, IOException { Object[] arr; try { if (list instanceof Macro) arr = (Object[]) ((Macro) list).evaluate(context); else arr = (Object[]) list; target.setValue(context, (Object) new Alternator(arr)); } catch (ClassCastException e) { String errorText = "#alternate: target is not a list: " + list; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } catch (PropertyException e) { String errorText = "#alternate: Unable to set value: " + target + "\n" + e.toString(); context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f1ee3e6d8769e6b0caff01371f0351a1c7e3950d/AlternateDirective.java/buggy/webmacro/src/org/webmacro/directive/AlternateDirective.java |
arr = (Object[]) ((Macro) list).evaluate(context); | l = ((Macro) list).evaluate(context); | public void write(FastWriter out, Context context) throws PropertyException, IOException { Object[] arr; try { if (list instanceof Macro) arr = (Object[]) ((Macro) list).evaluate(context); else arr = (Object[]) list; target.setValue(context, (Object) new Alternator(arr)); } catch (ClassCastException e) { String errorText = "#alternate: target is not a list: " + list; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } catch (PropertyException e) { String errorText = "#alternate: Unable to set value: " + target + "\n" + e.toString(); context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f1ee3e6d8769e6b0caff01371f0351a1c7e3950d/AlternateDirective.java/buggy/webmacro/src/org/webmacro/directive/AlternateDirective.java |
arr = (Object[]) list; | l = list; Iterator itr = context.getBroker()._propertyOperators.getIterator(l); | public void write(FastWriter out, Context context) throws PropertyException, IOException { Object[] arr; try { if (list instanceof Macro) arr = (Object[]) ((Macro) list).evaluate(context); else arr = (Object[]) list; target.setValue(context, (Object) new Alternator(arr)); } catch (ClassCastException e) { String errorText = "#alternate: target is not a list: " + list; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } catch (PropertyException e) { String errorText = "#alternate: Unable to set value: " + target + "\n" + e.toString(); context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f1ee3e6d8769e6b0caff01371f0351a1c7e3950d/AlternateDirective.java/buggy/webmacro/src/org/webmacro/directive/AlternateDirective.java |
target.setValue(context, (Object) new Alternator(arr)); } catch (ClassCastException e) { String errorText = "#alternate: target is not a list: " + list; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } catch (PropertyException e) { String errorText = "#alternate: Unable to set value: " + target + "\n" + e.toString(); context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); | target.setValue(context, (Object) new IteratorAlternator(itr)); } catch (Exception e) { String warning = "#alternate: list argument is not a list: " + l; context.getLog("engine").warning(warning + "; " + e); writeWarning(warning, context, out); return; | public void write(FastWriter out, Context context) throws PropertyException, IOException { Object[] arr; try { if (list instanceof Macro) arr = (Object[]) ((Macro) list).evaluate(context); else arr = (Object[]) list; target.setValue(context, (Object) new Alternator(arr)); } catch (ClassCastException e) { String errorText = "#alternate: target is not a list: " + list; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } catch (PropertyException e) { String errorText = "#alternate: Unable to set value: " + target + "\n" + e.toString(); context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, context, out); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f1ee3e6d8769e6b0caff01371f0351a1c7e3950d/AlternateDirective.java/buggy/webmacro/src/org/webmacro/directive/AlternateDirective.java |
public Object evaluate(Context context) { Object o = list[index++]; if (index == list.length) index = 0; return o; } | public abstract Object evaluate (Context context); | public Object evaluate(Context context) { Object o = list[index++]; if (index == list.length) index = 0; return o; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f1ee3e6d8769e6b0caff01371f0351a1c7e3950d/AlternateDirective.java/buggy/webmacro/src/org/webmacro/directive/AlternateDirective.java |
public void write(FastWriter out, Context context) throws PropertyException, IOException { Object o = evaluate(context); if (o != null) out.write(o.toString()); } | public void write(FastWriter out, Context context) throws PropertyException, IOException { Object o = evaluate(context); if (o != null) out.write(o.toString()); } | public void write(FastWriter out, Context context) throws PropertyException, IOException { Object o = evaluate(context); if (o != null) out.write(o.toString()); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f1ee3e6d8769e6b0caff01371f0351a1c7e3950d/AlternateDirective.java/buggy/webmacro/src/org/webmacro/directive/AlternateDirective.java |
public void setUp() { | public void setUp() throws Exception { super.setUp(); | public void setUp() { runtime = Ruby.getDefaultInstance(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/TestObjectSpace.java/buggy/test/org/jruby/test/TestObjectSpace.java |
target = new ObjectSpace(); | public void setUp() { runtime = Ruby.getDefaultInstance(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/TestObjectSpace.java/buggy/test/org/jruby/test/TestObjectSpace.java |
|
ObjectSpace os = new ObjectSpace(); | public void testObjectSpace() { ObjectSpace os = new ObjectSpace(); IRubyObject o1 = runtime.newFixnum(10); IRubyObject o2 = runtime.newFixnum(20); IRubyObject o3 = runtime.newFixnum(30); IRubyObject o4 = runtime.newString("hello"); os.add(o1); os.add(o2); os.add(o3); os.add(o4); List storedFixnums = new ArrayList(3); storedFixnums.add(o1); storedFixnums.add(o2); storedFixnums.add(o3); Iterator strings = os.iterator(runtime.getString()); assertSame(o4, strings.next()); assertEquals(null, strings.next()); Iterator numerics = os.iterator(runtime.getClass("Numeric")); for (int i = 0; i < 3; i++) { Object item = numerics.next(); assertTrue(storedFixnums.contains(item)); } assertEquals(null, numerics.next()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/TestObjectSpace.java/buggy/test/org/jruby/test/TestObjectSpace.java |
|
os.add(o1); os.add(o2); os.add(o3); os.add(o4); | target.add(o1); target.add(o2); target.add(o3); target.add(o4); | public void testObjectSpace() { ObjectSpace os = new ObjectSpace(); IRubyObject o1 = runtime.newFixnum(10); IRubyObject o2 = runtime.newFixnum(20); IRubyObject o3 = runtime.newFixnum(30); IRubyObject o4 = runtime.newString("hello"); os.add(o1); os.add(o2); os.add(o3); os.add(o4); List storedFixnums = new ArrayList(3); storedFixnums.add(o1); storedFixnums.add(o2); storedFixnums.add(o3); Iterator strings = os.iterator(runtime.getString()); assertSame(o4, strings.next()); assertEquals(null, strings.next()); Iterator numerics = os.iterator(runtime.getClass("Numeric")); for (int i = 0; i < 3; i++) { Object item = numerics.next(); assertTrue(storedFixnums.contains(item)); } assertEquals(null, numerics.next()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/TestObjectSpace.java/buggy/test/org/jruby/test/TestObjectSpace.java |
Iterator strings = os.iterator(runtime.getString()); | Iterator strings = target.iterator(runtime.getString()); | public void testObjectSpace() { ObjectSpace os = new ObjectSpace(); IRubyObject o1 = runtime.newFixnum(10); IRubyObject o2 = runtime.newFixnum(20); IRubyObject o3 = runtime.newFixnum(30); IRubyObject o4 = runtime.newString("hello"); os.add(o1); os.add(o2); os.add(o3); os.add(o4); List storedFixnums = new ArrayList(3); storedFixnums.add(o1); storedFixnums.add(o2); storedFixnums.add(o3); Iterator strings = os.iterator(runtime.getString()); assertSame(o4, strings.next()); assertEquals(null, strings.next()); Iterator numerics = os.iterator(runtime.getClass("Numeric")); for (int i = 0; i < 3; i++) { Object item = numerics.next(); assertTrue(storedFixnums.contains(item)); } assertEquals(null, numerics.next()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/TestObjectSpace.java/buggy/test/org/jruby/test/TestObjectSpace.java |
Iterator numerics = os.iterator(runtime.getClass("Numeric")); | Iterator numerics = target.iterator(runtime.getClass("Numeric")); | public void testObjectSpace() { ObjectSpace os = new ObjectSpace(); IRubyObject o1 = runtime.newFixnum(10); IRubyObject o2 = runtime.newFixnum(20); IRubyObject o3 = runtime.newFixnum(30); IRubyObject o4 = runtime.newString("hello"); os.add(o1); os.add(o2); os.add(o3); os.add(o4); List storedFixnums = new ArrayList(3); storedFixnums.add(o1); storedFixnums.add(o2); storedFixnums.add(o3); Iterator strings = os.iterator(runtime.getString()); assertSame(o4, strings.next()); assertEquals(null, strings.next()); Iterator numerics = os.iterator(runtime.getClass("Numeric")); for (int i = 0; i < 3; i++) { Object item = numerics.next(); assertTrue(storedFixnums.contains(item)); } assertEquals(null, numerics.next()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c8b66db475de1dc66f347884891dd70d9943689b/TestObjectSpace.java/buggy/test/org/jruby/test/TestObjectSpace.java |
iVisited.accept(_Payload); | _Payload.visitAliasNode(iVisited); | public void visitAliasNode(AliasNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitAndNode(iVisited); | public void visitAndNode(AndNode iVisited) { iVisited.getFirstNode().accept(this); iVisited.accept(_Payload); iVisited.getSecondNode().accept(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitArgsCatNode(iVisited); | public void visitArgsCatNode(ArgsCatNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitArgsNode(iVisited); | public void visitArgsNode(ArgsNode iVisited) { iVisited.accept(_Payload); Node lOptNode = iVisited.getOptNode(); if (lOptNode != null) { lOptNode.accept(this); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitArgsPushNode(iVisited); | public void visitArgsPushNode(ArgsPushNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitArrayNode(iVisited); | public void visitArrayNode(ArrayNode iVisited) { iVisited.accept(_Payload); for (Node node = iVisited; node != null; node = node.getNextNode()) { node.getHeadNode().accept(this); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitAttrSetNode(iVisited); | public void visitAttrSetNode(AttrSetNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitBackRefNode(iVisited); | public void visitBackRefNode(BackRefNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitBeginNode(iVisited); | public void visitBeginNode(BeginNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitBlockArgNode(iVisited); | public void visitBlockArgNode(BlockArgNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitBlockNode(iVisited); | public void visitBlockNode(BlockNode iVisited) { iVisited.accept(_Payload); for (Node node = iVisited; node != null; node = node.getNextNode()) { node.getHeadNode().accept(this); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitBlockPassNode(iVisited); | public void visitBlockPassNode(BlockPassNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitBreakNode(iVisited); | public void visitBreakNode(BreakNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCDeclNode(iVisited); | public void visitCDeclNode(CDeclNode iVisited) { iVisited.accept(_Payload); iVisited.getValueNode().accept(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCFuncNode(iVisited); | public void visitCFuncNode(CFuncNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCVAsgnNode(iVisited); | public void visitCVAsgnNode(CVAsgnNode iVisited) { iVisited.accept(_Payload); iVisited.getValueNode().accept(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCVDeclNode(iVisited); | public void visitCVDeclNode(CVDeclNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCVar2Node(iVisited); | public void visitCVar2Node(CVar2Node iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCVarNode(iVisited); | public void visitCVarNode(CVarNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCallNode(iVisited); | public void visitCallNode(CallNode iVisited) { iVisited.getRecvNode().accept(this); for (Node node = iVisited.getArgsNode(); node != null; node = node.getNextNode()) { node.getHeadNode().accept(this); } iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitCaseNode(iVisited); | public void visitCaseNode(CaseNode iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitClassNode(iVisited); | public void visitClassNode(ClassNode iVisited) { iVisited.accept(_Payload); Node lSuperNode = iVisited.getSuperNode(); if (lSuperNode != null) lSuperNode.accept(this); //NOTE: suprised that this is not used //iVisited.getBodyNode().accept(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
iVisited.accept(_Payload); | _Payload.visitColon2Node(iVisited); | public void visitColon2Node(Colon2Node iVisited) { iVisited.accept(_Payload); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/043fa4419ad506aa6f8843684eb8114b226fe4b5/DefaultIteratorVisitor.java/clean/org/jruby/nodes/visitor/DefaultIteratorVisitor.java |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.