rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
for (int i = 0; i < len; i++) {
RubyClass fixnumClass = getRuntime().getClass("Fixnum"); for (int i = 0; i < minCommon; i++) {
public IRubyObject op_cmp(IRubyObject other) { RubyArray ary = other.convertToArray(); int otherLen = ary.getLength(); int len = getLength(); if (len != otherLen) { return (len > otherLen) ? RubyFixnum.one(getRuntime()) : RubyFixnum.minus_one(getRuntime()); } ThreadContext context = getRuntime().getCurrentContext(); for (int i = 0; i < len; i++) { IRubyObject result = entry(i).callMethod(context, "<=>", ary.entry(i)); if (result.isNil() || ((RubyFixnum)result).getLongValue() != 0) { return result; } } return RubyFixnum.zero(getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5efec819547c1904f24520251cba220ba8d4a25/RubyArray.java/buggy/src/org/jruby/RubyArray.java
if (result.isNil() || ((RubyFixnum)result).getLongValue() != 0) {
if (! result.isKindOf(fixnumClass) || RubyFixnum.fix2int(result) != 0) {
public IRubyObject op_cmp(IRubyObject other) { RubyArray ary = other.convertToArray(); int otherLen = ary.getLength(); int len = getLength(); if (len != otherLen) { return (len > otherLen) ? RubyFixnum.one(getRuntime()) : RubyFixnum.minus_one(getRuntime()); } ThreadContext context = getRuntime().getCurrentContext(); for (int i = 0; i < len; i++) { IRubyObject result = entry(i).callMethod(context, "<=>", ary.entry(i)); if (result.isNil() || ((RubyFixnum)result).getLongValue() != 0) { return result; } } return RubyFixnum.zero(getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5efec819547c1904f24520251cba220ba8d4a25/RubyArray.java/buggy/src/org/jruby/RubyArray.java
if (len != otherLen) { return len < otherLen ? RubyFixnum.minus_one(getRuntime()) : RubyFixnum.one(getRuntime()); }
public IRubyObject op_cmp(IRubyObject other) { RubyArray ary = other.convertToArray(); int otherLen = ary.getLength(); int len = getLength(); if (len != otherLen) { return (len > otherLen) ? RubyFixnum.one(getRuntime()) : RubyFixnum.minus_one(getRuntime()); } ThreadContext context = getRuntime().getCurrentContext(); for (int i = 0; i < len; i++) { IRubyObject result = entry(i).callMethod(context, "<=>", ary.entry(i)); if (result.isNil() || ((RubyFixnum)result).getLongValue() != 0) { return result; } } return RubyFixnum.zero(getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5efec819547c1904f24520251cba220ba8d4a25/RubyArray.java/buggy/src/org/jruby/RubyArray.java
model.addPropertyChangeListener(Browser.SELECTED_DISPLAY_PROPERTY, this);
BrowserControl(BrowserModel model, RootDisplay view) { if (model == null) throw new NullPointerException("No model."); if (view == null) throw new NullPointerException("No view."); this.model = model; this.view = view; popupTrigger = false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/BrowserControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/browser/BrowserControl.java
view.setTitle(model.currentPathString());
public void mousePressed(MouseEvent me) { ImageDisplay d = findParentDisplay(me.getSource()); d.moveToFront(); model.setSelectedDisplay(d); view.setTitle(model.currentPathString()); if (me.isPopupTrigger()) popupTrigger = true; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/BrowserControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/browser/BrowserControl.java
if (visitor.getFoundNodes().size() == 0) loadData(); else model.loadRefreshedData(visitor.getFoundNodes());
model.loadRefreshedData(visitor.getFoundNodes(), visitor.getExpandedTopNodes());
public void refreshTree() { switch (model.getState()) { case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } TreeImageDisplay root = view.getTreeRoot(); if (!root.isChildrenLoaded()) return; if (!model.isSelected()) { //view.clearTree(); //return; } if (model.getBrowserType() == IMAGES_EXPLORER) { root.removeAllChildrenDisplay(); model.setSelectedDisplay(root); loadFilteredImagesForHierarchy(); } else { RefreshVisitor visitor = new RefreshVisitor(this); accept(visitor, TreeImageDisplayVisitor.TREEIMAGE_SET_ONLY); root.removeAllChildrenDisplay(); model.setSelectedDisplay(root); if (visitor.getFoundNodes().size() == 0) loadData(); else model.loadRefreshedData(visitor.getFoundNodes()); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java
groupID), true);
groupID));
public void setContainerNodes(Set nodes, TreeImageDisplay parent) { int state = model.getState(); if (state != LOADING_DATA) throw new IllegalStateException( "This method can only be invoked in the LOADING_DATA "+ "state."); if (nodes == null) throw new NullPointerException("No nodes."); TreeImageDisplay parentDisplay = model.getLastSelectedDisplay(); long userID = model.getUserID(); long groupID = model.getRootGroupID(); if (parent == null) { //root view.setViews(TreeViewerTranslator.transformHierarchy(nodes, userID, groupID), true); } else view.setViews(TreeViewerTranslator.transformContainers(nodes, userID, groupID), parentDisplay); if (parentDisplay != null) parentDisplay.setChildrenLoaded(Boolean.TRUE); model.fireContainerCountLoading(); model.getParentModel().setStatus(false, "", true); fireStateChange(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java
view.setViews(visNodes, true);
view.setViews(visNodes);
public void setNodes(Set nodes) { if (model.getState() != LOADING_DATA) throw new IllegalStateException( "This method can only be invoked in the LOADING_DATA "+ "state."); if (nodes == null) throw new NullPointerException("No nodes."); long userID = model.getUserID(); long groupID = model.getRootGroupID(); Set visNodes = TreeViewerTranslator.transformHierarchy(nodes, userID, groupID); view.setViews(visNodes, true); model.setState(READY); model.getParentModel().setStatus(false, "", true); fireStateChange(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java
public void setRefreshedHierarchy(Map nodes)
public void setRefreshedHierarchy(Map nodes, List expandedTopNodes)
public void setRefreshedHierarchy(Map nodes) { if (model.getState() != LOADING_DATA) throw new IllegalStateException("This method cannot be invoked "+ "in the LOADING_DATA state."); long userID = model.getUserID(); long groupID = model.getRootGroupID(); view.setViews(TreeViewerTranslator.refreshHierarchy(nodes, userID, groupID), false); model.fireContainerCountLoading(); model.getParentModel().setStatus(false, "", true); fireStateChange(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java
view.setViews(TreeViewerTranslator.refreshHierarchy(nodes, userID, groupID), false);
view.setViews(TreeViewerTranslator.refreshHierarchy(nodes, expandedTopNodes, userID, groupID));
public void setRefreshedHierarchy(Map nodes) { if (model.getState() != LOADING_DATA) throw new IllegalStateException("This method cannot be invoked "+ "in the LOADING_DATA state."); long userID = model.getUserID(); long groupID = model.getRootGroupID(); view.setViews(TreeViewerTranslator.refreshHierarchy(nodes, userID, groupID), false); model.fireContainerCountLoading(); model.getParentModel().setStatus(false, "", true); fireStateChange(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java
List getImagesInUserDatasetsDiff(DatasetData data)
List getImagesInUserDatasetsDiff(DatasetData data, List datasets)
List getImagesInUserDatasetsDiff(DatasetData data) { List imagesDiff = new ArrayList(); try { imagesDiff = getUsedImages(); List images = data.getImages(); ImageSummary isg; Iterator i; for (int j = 0; j < imagesDiff.size(); j++) { isg = (ImageSummary) imagesDiff.get(j); i = images.iterator(); while (i.hasNext()) { if (((ImageSummary) i.next()).getID() == isg.getID()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java
imagesDiff = getUsedImages();
imagesDiff = getImagesInDatasets(datasets);
List getImagesInUserDatasetsDiff(DatasetData data) { List imagesDiff = new ArrayList(); try { imagesDiff = getUsedImages(); List images = data.getImages(); ImageSummary isg; Iterator i; for (int j = 0; j < imagesDiff.size(); j++) { isg = (ImageSummary) imagesDiff.get(j); i = images.iterator(); while (i.hasNext()) { if (((ImageSummary) i.next()).getID() == isg.getID()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java
List retrieveImagesDiffInUserDatasetsNotInCategoryGroup(CategoryData data)
List retrieveImagesDiffInUserDatasetsNotInCategoryGroup(CategoryData data, List datasets)
List retrieveImagesDiffInUserDatasetsNotInCategoryGroup(CategoryData data) { List imagesDiff = new ArrayList(); try { imagesDiff = retrieveImagesInUserDatasetsNotInCategoryGroup( data.getCategoryGroup()); List images = data.getImages(); ImageSummary isg; Iterator i; for (int j = 0; j < imagesDiff.size(); j++) { isg = (ImageSummary) imagesDiff.get(j); i = images.iterator(); while (i.hasNext()) { if (((ImageSummary) i.next()).getID() == isg.getID()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java
data.getCategoryGroup());
data.getCategoryGroup(), datasets);
List retrieveImagesDiffInUserDatasetsNotInCategoryGroup(CategoryData data) { List imagesDiff = new ArrayList(); try { imagesDiff = retrieveImagesInUserDatasetsNotInCategoryGroup( data.getCategoryGroup()); List images = data.getImages(); ImageSummary isg; Iterator i; for (int j = 0; j < imagesDiff.size(); j++) { isg = (ImageSummary) imagesDiff.get(j); i = images.iterator(); while (i.hasNext()) { if (((ImageSummary) i.next()).getID() == isg.getID()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java
List retrieveImagesInUserDatasetsNotInCategoryGroup(CategoryGroupData group)
List retrieveImagesInUserDatasetsNotInCategoryGroup(CategoryGroupData group, List datasets)
List retrieveImagesInUserDatasetsNotInCategoryGroup(CategoryGroupData group) throws DSAccessException { try { SemanticTypesService sts = registry.getSemanticTypesService(); return sts.retrieveImagesInUserDatasetsNotInCategoryGroup(group); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } return new ArrayList(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java
return sts.retrieveImagesInUserDatasetsNotInCategoryGroup(group);
return sts.retrieveImagesInUserDatasetsNotInCategoryGroup(group, ids);
List retrieveImagesInUserDatasetsNotInCategoryGroup(CategoryGroupData group) throws DSAccessException { try { SemanticTypesService sts = registry.getSemanticTypesService(); return sts.retrieveImagesInUserDatasetsNotInCategoryGroup(group); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } return new ArrayList(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java
LoadDataset request = new LoadDataset(datasetID); registry.getEventBus().post(request);
getRegistry().getUserNotifier().notifyInfo("Browser", "Sorry, not yet implemented ");
void viewDataset(int datasetID) { LoadDataset request = new LoadDataset(datasetID); registry.getEventBus().post(request); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java
public TestRubyBase(String name) { super(name);
public TestRubyBase() {
public TestRubyBase(String name) { super(name); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/de4c49d21f91fafaad36890ce5108ebf5c0404e8/TestRubyBase.java/buggy/test/org/jruby/test/TestRubyBase.java
if(attributes == null) { thumbnailColorMap.put(tdm,alpha); return; }
public static PaintMethod getOverlayMethod(final ColorPairModel colorModel) { PaintMethod pm = new AbstractPaintMethod() { // TODO figure out to do when image reclassified private Map thumbnailColorMap = new IdentityHashMap(); private Color alpha = new Color(0,0,0,0); public void paint(PPaintContext context, Thumbnail t) { Graphics2D g = context.getGraphics(); Rectangle2D bounds = t.getBounds().getBounds2D(); if(thumbnailColorMap.containsKey(t)) { Paint p = (Paint)thumbnailColorMap.get(t.getModel()); g.setPaint(p); g.fill(bounds); } else { setupMethod(t.getModel(),colorModel); Paint p = (Paint)thumbnailColorMap.get(t.getModel()); if(p != null) { g.setPaint(p); g.fill(bounds); } } } private void setupMethod(ThumbnailDataModel tdm, ColorPairModel cpm) { AttributeMap attrMap = tdm.getAttributeMap(); List attributes = attrMap.getAttributes("Classification"); for(Iterator iter = attributes.iterator(); iter.hasNext();) { Classification c = (Classification)iter.next(); Category cat = c.getCategory(); if(cpm.getColor(cat) != null) { Color col = cpm.getColor(cat); Color newColor = new Color(col.getRed(),col.getGreen(), col.getBlue(),128); thumbnailColorMap.put(tdm,newColor); return; } } thumbnailColorMap.put(tdm,alpha); } }; return pm; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/ColorMapPMFactory.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/colormap/ColorMapPMFactory.java
if(attributes == null) { thumbnailColorMap.put(tdm,alpha); return; }
private void setupMethod(ThumbnailDataModel tdm, ColorPairModel cpm) { AttributeMap attrMap = tdm.getAttributeMap(); List attributes = attrMap.getAttributes("Classification"); for(Iterator iter = attributes.iterator(); iter.hasNext();) { Classification c = (Classification)iter.next(); Category cat = c.getCategory(); if(cpm.getColor(cat) != null) { Color col = cpm.getColor(cat); Color newColor = new Color(col.getRed(),col.getGreen(), col.getBlue(),128); thumbnailColorMap.put(tdm,newColor); return; } } thumbnailColorMap.put(tdm,alpha); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/ColorMapPMFactory.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/colormap/ColorMapPMFactory.java
throw getRuntime().newNameError("uninitialized constant " + name.asSymbol() + " at " + getName());
throw getRuntime().newNameError("uninitialized constant " + getName() + "::" + name.asSymbol());
public IRubyObject const_missing(IRubyObject name) { /* Uninitialized constant */ if (this != getRuntime().getObject()) { throw getRuntime().newNameError("uninitialized constant " + name.asSymbol() + " at " + getName()); } throw getRuntime().newNameError("uninitialized constant " + name.asSymbol()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8bc77fd935108392c0bf8a671462f28f423e48c1/RubyModule.java/clean/src/org/jruby/RubyModule.java
System.setProperty("org.jruby.HOME", "RubyHome");
System.setProperty("jruby.home", "RubyHome");
public void testInitLoad() { ArrayList list = new ArrayList(); //check without a RubyHome and with one parameter list.add("toto"); ruby.initLoad(list); //check that the global vars are correctly valuated RubyObject lCol = ruby.getGlobalVar("$:"); RubyObject lI = ruby.getGlobalVar("$-I"); RubyObject lLoad = ruby.getGlobalVar("$LOAD_PATH"); assertTrue(lCol == lI && lI == lLoad && lLoad != null); RubyArray lLoadA = (RubyArray)lLoad; //check that we have 2 non null element assertTrue(((RubyFixnum)lLoadA.nitems()).getValue()== 2); //check that it is what we expect, a RubyString of the correct type assertTrue(new RubyString(ruby,"toto").equal(lLoadA.shift())); assertTrue(new RubyString(ruby,".").equal(lLoadA.shift())); //check the case when RubyHome is valuated System.setProperty("org.jruby.HOME", "RubyHome"); //MRI result /*C:\dev\jruby>ruby -e "puts $:"/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/i386-cygwin/cygdrive/d/ruby/lib/ruby/site_ruby/cygdrive/d/ruby/lib/ruby/1.6/cygdrive/d/ruby/lib/ruby/1.6/i386-cygwin. */ ruby.initLoad(new ArrayList()); if (File.separatorChar == '/') { assertEquals("6", eval("$:.size")); String wanted = "RubyHome/lib/ruby/site_ruby/1.6" + "RubyHome/lib/ruby/site_ruby/1.6/JAVA" + "RubyHome/lib/ruby/site_ruby" + "RubyHome/lib/ruby/1.6" + "RubyHome/lib/ruby/1.6/JAVA" + ".\n"; assertEquals(wanted, eval("puts $:")); } else { String result = eval("puts $:"); String wanted = "RubyHome\\lib\\ruby\\site_ruby\\1.6" + "RubyHome\\lib\\ruby\\site_ruby\\1.6\\JAVA" + "RubyHome\\lib\\ruby\\site_ruby" + "RubyHome\\lib\\ruby\\1.6" + "RubyHome\\lib\\ruby\\1.6\\JAVA" + "."; assertEquals(wanted, result); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f93ac546a790349119dda4661966a31b1d7ed83/TestRuby.java/clean/org/jruby/test/TestRuby.java
defineGlobalKCODE(runtime);
private static void initializeRuntime(final Ruby runtime, String filename) { IRubyObject argumentArray = runtime.newArray(JavaUtil.convertJavaArrayToRuby(runtime, commandline.scriptArguments)); runtime.setVerbose(runtime.newBoolean(commandline.verbose)); defineGlobalKCODE(runtime); defineGlobalVERBOSE(runtime); runtime.getClasses().getObjectClass().setConstant("$VERBOSE", commandline.verbose ? runtime.getTrue() : runtime.getNil()); runtime.defineGlobalConstant("ARGV", argumentArray); // I guess ENV is not a hash, but should support a to_hash, though // it supposedly supports methods of a Hash? Also, I think that // RubyGlobal may need to create an empty ENV var in the case that // the runtime is not initialized by Main. Properties envs = new Properties(); runtime.defineGlobalConstant("ENV", RubyHash.newHash(runtime, envs, null)); defineGlobal(runtime, "$-p", commandline.assumePrinting); defineGlobal(runtime, "$-n", commandline.assumeLoop); defineGlobal(runtime, "$-a", commandline.sDoSplit); defineGlobal(runtime, "$-l", commandline.processLineEnds); runtime.getGlobalVariables().defineReadonly("$*", new ValueAccessor(argumentArray)); // TODO this is a fake cause we have no real process number in Java runtime.getGlobalVariables().defineReadonly("$$", new ValueAccessor(runtime.newFixnum(runtime.hashCode()))); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", runtime.newString(filename))); runtime.getLoadService().init(commandline.loadPaths()); Iterator iter = commandline.requiredLibraries().iterator(); while (iter.hasNext()) { String scriptName = (String) iter.next(); RubyKernel.require(runtime.getTopSelf(), runtime.newString(scriptName)); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/312172d22abc380ccb723b1458f5effeddfc51fa/Main.java/clean/src/org/jruby/Main.java
try { ruby.setRegexpAdapterClass(Class.forName("org.jruby.regexp.GNURegexpAdapter")); } catch (Exception e) { throw new RuntimeException("Class GNURegexpAdapter not found"); }
ruby.setRegexpAdapterClass(org.jruby.regexp.GNURegexpAdapter.class);
public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); ruby = new Ruby(); try { ruby.setRegexpAdapterClass(Class.forName("org.jruby.regexp.GNURegexpAdapter")); } catch (Exception e) { throw new RuntimeException("Class GNURegexpAdapter not found"); } ruby.init(); topSelf = ruby.getRubyTopSelf(); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { BSFDeclaredBean bean = (BSFDeclaredBean)declaredBeans.elementAt(i); topSelf.getSingletonClass().defineMethod(bean.name, new DeclaredBeanGetMethod(bean)); topSelf.getSingletonClass().defineMethod(bean.name + "=", new DeclaredBeanSetMethod(bean)); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2c6d31ae5651a0a0c68c2bb382ab68cea34c67d7/JRubyEngine.java/clean/org/jruby/javasupport/bsf/JRubyEngine.java
this.bean = bean; }
this.bean = bean; }
public DeclaredBeanGetMethod(BSFDeclaredBean bean) { this.bean = bean; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/DeclaredBeanGetMethod.java/buggy/org/jruby/javasupport/bsf/DeclaredBeanGetMethod.java
public void actionPerformed(ActionEvent e) { String username = regPanel.getScreenName(); String password = regPanel.getPassword(); if (!ModelUtil.hasLength(username) || !ModelUtil.hasLength(password)) { JOptionPane.showMessageDialog(mainPanel, "Username and/or Password need to be supplied.", "Registration Error", JOptionPane.ERROR_MESSAGE); return; } try { registerUser(con, serviceName, username, password); // Send updated presence. } catch (XMPPException e1) { JOptionPane.showMessageDialog(mainPanel, "Unable to register with Transport.", "Registration Error", JOptionPane.ERROR_MESSAGE); } dialog.dispose(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/TransportManager.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/gateways/transports/TransportManager.java
titlePanel = new TitlePanel("AIM Registration", transport.getTitle(), transport.getIcon(), true);
titlePanel = new TitlePanel(transport.getTitle(), transport.getInstructions(), transport.getIcon(), true);
public TransportRegistrationPanel(String serviceName) { setLayout(new GridBagLayout()); final Transport transport = TransportManager.getTransport(serviceName); titlePanel = new TitlePanel("AIM Registration", transport.getTitle(), transport.getIcon(), true); add(titlePanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); final JLabel usernameLabel = new JLabel(); usernameLabel.setFont(new Font("Dialog", Font.BOLD, 11)); ResourceUtils.resLabel(usernameLabel, usernameField, "&Username:"); add(usernameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(usernameField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); final JLabel passwordLabel = new JLabel(); passwordLabel.setFont(new Font("Dialog", Font.BOLD, 11)); ResourceUtils.resLabel(passwordLabel, passwordField, "&Password:"); add(passwordLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(passwordField, new GridBagConstraints(1, 2, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/741ee521da25f1d1608a575dbda0a84d216ed278/TransportRegistrationPanel.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/gateways/TransportRegistrationPanel.java
return JavaUtil.convertJavaToRuby(ruby, bean.bean);
return JavaUtil.convertJavaToRuby(this.ruby, bean.bean);
public RubyObject get() { return JavaUtil.convertJavaToRuby(ruby, bean.bean); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6f94b922572fd349eaac09bd1ccecaa1bf198460/JRubyEngine.java/clean/org/jruby/javasupport/bsf/JRubyEngine.java
bean.bean = JavaUtil.convertRubyToJava(ruby, value, bean.type);
bean.bean = JavaUtil.convertRubyToJava(this.ruby, value, bean.type);
public RubyObject set(RubyObject value) { bean.bean = JavaUtil.convertRubyToJava(ruby, value, bean.type); return value; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6f94b922572fd349eaac09bd1ccecaa1bf198460/JRubyEngine.java/clean/org/jruby/javasupport/bsf/JRubyEngine.java
public final Object evaluate(Context context) { // do nothing try { if (myValue instanceof Macro) { myVariable.setValue(context, ((Macro) myValue).evaluate(context)); } else { myVariable.setValue(context, myValue); } } catch (PropertyException e) { context.getLog("engine").warning("Set: Unable to set value: " + myVariable); return ("<!--\n Unable to set value: " + myVariable + " \n-->"); } return null; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/1163a46afccd305c843985eac05d684da7bc14d8/SetDirective.java/buggy/webmacro/src/org/webmacro/engine/SetDirective.java
if (timer != null) timer.stop();
public void propertyChange(PropertyChangeEvent pce) { String propName = pce.getPropertyName(); if (ImViewer.Z_SELECTED_PROPERTY.equals(propName)) { view.setZSection(((Integer) pce.getNewValue()).intValue()); } else if (ImViewer.T_SELECTED_PROPERTY.equals(propName)) { view.setTimepoint(((Integer) pce.getNewValue()).intValue()); } else if (ChannelButton.CHANNEL_SELECTED_PROPERTY.equals(propName)) { Map map = (Map) pce.getNewValue(); if (map == null) return; if (map.size() != 1) return; Iterator i = map.keySet().iterator(); Integer index; while (i.hasNext()) { index = (Integer) i.next(); model.setChannelSelection(index.intValue(), ((Boolean) map.get(index)).booleanValue()); } } else if (ZoomAction.ZOOM_PROPERTY.equals(propName)) { view.setZoomFactor((ViewerAction) pce.getNewValue()); } else if (RateImageAction.RATE_IMAGE_PROPERTY.equals(propName)) { view.setRatingFactor((ViewerAction) pce.getNewValue()); } else if (LoadingWindow.CLOSED_PROPERTY.equals(propName)) { model.discard(); } else if (Renderer.RENDER_PLANE_PROPERTY.equals(propName)) { model.renderXYPlane(); } else if (Renderer.SELECTED_CHANNEL_PROPERTY.equals(propName)) { if (model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL)) { int c = ((Integer) pce.getNewValue()).intValue(); for (int i = 0; i < model.getMaxC(); i++) model.setChannelActive(i, i == c); model.displayChannelMovie(); } } else if (ChannelButton.INFO_PROPERTY.equals(propName)) { int index = ((Integer) pce.getNewValue()).intValue(); ChannelMetadata data = model.getChannelMetadata(index); if (data != null) { InfoDialog dialog = new InfoDialog(model.getUI(), data); dialog.addPropertyChangeListener(this); UIUtilities.setLocationRelativeToAndShow(view, dialog); } else { UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); un.notifyInfo("Channel info", "No metadata for the " + "selected channel."); } } else if (ChannelButton.CHANNEL_COLOR_PROPERTY.equals(propName) || ChannelColorMenuItem.CHANNEL_COLOR_PROPERTY.equals(propName)) { colorPickerIndex = ((Integer) pce.getNewValue()).intValue(); Color c = model.getChannelColor(colorPickerIndex); ColourPicker dialog = new ColourPicker(view, c); dialog.addPropertyChangeListener(this); UIUtilities.setLocationRelativeToAndShow(view, dialog); } else if (ColourPicker.COLOUR_PROPERTY.equals(propName)) { Color c = (Color) pce.getNewValue(); if (colorPickerIndex != -1) { model.setChannelColor(colorPickerIndex, c); } } else if (UnitBarSizeDialog.UNIT_BAR_VALUE_PROPERTY.equals(propName)) { double v = ((Double) pce.getNewValue()).doubleValue(); model.setUnitBarSize(v); } else if (InfoDialog.UPDATE_PROPERTY.equals(propName)) { //TODO: implement method } else if (ImViewer.ICONIFIED_PROPERTY.equals(propName)) { view.onIconified(); if (timer != null) timer.stop(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/ImViewerControl.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerControl.java
timer.stop(); timer.start();
public void stateChanged(ChangeEvent e) { int state = model.getState(); switch (state) { case ImViewer.DISCARDED: LoadingWindow window = view.getLoadingWindow(); window.setVisible(false); window.dispose(); view.setVisible(false); view.dispose(); if (view.isLensVisible()) view.setLensVisible(false); historyState = state; break; case ImViewer.LOADING_RENDERING_CONTROL: UIUtilities.centerAndShow(view.getLoadingWindow()); historyState = state; break; case ImViewer.LOADING_IMAGE: //if (historyState == ImViewer.LOADING_METADATA) if (historyState == ImViewer.LOADING_RENDERING_CONTROL) view.getLoadingWindow().setVisible(false); view.onStateChange(false); historyState = state; break; case ImViewer.READY: view.getLoadingWindow().setVisible(false); if (historyState == ImViewer.CHANNEL_MOVIE) view.onStateChange(false); else { view.onStateChange(true); historyState = state; } timer.stop(); timer.start(); break; case ImViewer.CHANNEL_MOVIE: historyState = ImViewer.CHANNEL_MOVIE; view.onStateChange(false); } //historyState = state; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/ImViewerControl.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerControl.java
public void stateChanged(ChangeEvent e) { int state = model.getState(); switch (state) { case ImViewer.DISCARDED: LoadingWindow window = view.getLoadingWindow(); window.setVisible(false); window.dispose(); view.setVisible(false); view.dispose(); if (view.isLensVisible()) view.setLensVisible(false); historyState = state; break; case ImViewer.LOADING_RENDERING_CONTROL: UIUtilities.centerAndShow(view.getLoadingWindow()); historyState = state; break; case ImViewer.LOADING_IMAGE: //if (historyState == ImViewer.LOADING_METADATA) if (historyState == ImViewer.LOADING_RENDERING_CONTROL) view.getLoadingWindow().setVisible(false); view.onStateChange(false); historyState = state; break; case ImViewer.READY: view.getLoadingWindow().setVisible(false); if (historyState == ImViewer.CHANNEL_MOVIE) view.onStateChange(false); else { view.onStateChange(true); historyState = state; } timer.stop(); timer.start(); break; case ImViewer.CHANNEL_MOVIE: historyState = ImViewer.CHANNEL_MOVIE; view.onStateChange(false); } //historyState = state; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/ImViewerControl.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerControl.java
case M_TO_F:
case FixnumDefinition.TO_F:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_TO_S:
case FixnumDefinition.TO_S:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_LSHIFT:
case FixnumDefinition.OP_LSHIFT:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_RSHIFT:
case FixnumDefinition.OP_RSHIFT:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_PLUS:
case FixnumDefinition.OP_PLUS:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_MINUS:
case FixnumDefinition.OP_MINUS:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_MUL:
case FixnumDefinition.OP_MUL:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_DIV:
case FixnumDefinition.OP_DIV:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_MOD:
case FixnumDefinition.OP_MOD:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_POW:
case FixnumDefinition.OP_POW:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_EQUAL:
case FixnumDefinition.EQUAL:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_CMP:
case FixnumDefinition.OP_CMP:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_GT:
case FixnumDefinition.OP_GT:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_GE:
case FixnumDefinition.OP_GE:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_LT:
case FixnumDefinition.OP_LT:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_LE:
case FixnumDefinition.OP_LE:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_OP_AND:
case FixnumDefinition.OP_AND:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_SIZE:
case FixnumDefinition.SIZE:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_HASH:
case FixnumDefinition.HASH:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_ID2NAME:
case FixnumDefinition.ID2NAME:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_INVERT:
case FixnumDefinition.INVERT:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case M_ID:
case FixnumDefinition.ID:
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
case FixnumDefinition.TAINT: return taint(); case FixnumDefinition.FREEZE: return freeze();
public IRubyObject callIndexed(int index, IRubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); case M_ID2NAME: return id2name(); case M_INVERT: return invert(); case M_ID: return id(); } return super.callIndexed(index, args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule());
public static RubyClass createFixnumClass(Ruby runtime) { RubyClass fixnumClass = new FixnumDefinition(runtime).getType();
public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); fixnumClass.defineMethod("~", IndexedCallback.create(M_INVERT, 0)); fixnumClass.defineMethod("id", IndexedCallback.create(M_ID, 0)); return fixnumClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class));
fixnumClass.includeModule(runtime.getClasses().getPrecisionModule());
public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); fixnumClass.defineMethod("~", IndexedCallback.create(M_INVERT, 0)); fixnumClass.defineMethod("id", IndexedCallback.create(M_ID, 0)); return fixnumClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1));
public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); fixnumClass.defineMethod("~", IndexedCallback.create(M_INVERT, 0)); fixnumClass.defineMethod("id", IndexedCallback.create(M_ID, 0)); return fixnumClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0));
public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); fixnumClass.defineMethod("~", IndexedCallback.create(M_INVERT, 0)); fixnumClass.defineMethod("id", IndexedCallback.create(M_ID, 0)); return fixnumClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); fixnumClass.defineMethod("~", IndexedCallback.create(M_INVERT, 0)); fixnumClass.defineMethod("id", IndexedCallback.create(M_ID, 0));
public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); fixnumClass.defineMethod("~", IndexedCallback.create(M_INVERT, 0)); fixnumClass.defineMethod("id", IndexedCallback.create(M_ID, 0)); return fixnumClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5f6bd2ce57ff6ed96fea5760d028882d8af6113c/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java
context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) };
try { context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) };
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/278b4a35f5c73b37a3381dc75821bfaa4d3aa3d0/StreamTemplate.java/clean/webmacro/src/org/webmacro/engine/StreamTemplate.java
SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl);
SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl);
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/278b4a35f5c73b37a3381dc75821bfaa4d3aa3d0/StreamTemplate.java/clean/webmacro/src/org/webmacro/engine/StreamTemplate.java
context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false));
context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false));
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/278b4a35f5c73b37a3381dc75821bfaa4d3aa3d0/StreamTemplate.java/clean/webmacro/src/org/webmacro/engine/StreamTemplate.java
System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -");
context.registerTool("testTool", new TestTool());
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/278b4a35f5c73b37a3381dc75821bfaa4d3aa3d0/StreamTemplate.java/clean/webmacro/src/org/webmacro/engine/StreamTemplate.java
try {
System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -");
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/278b4a35f5c73b37a3381dc75821bfaa4d3aa3d0/StreamTemplate.java/clean/webmacro/src/org/webmacro/engine/StreamTemplate.java
throw getRuntime().newNameError("no matching java constructor");
throw getRuntime().newNameError("no matching java constructor", null);
public JavaConstructor constructor(IRubyObject[] args) { try { Class[] parameterTypes = buildClassArgs(args); Constructor constructor; constructor = javaClass().getConstructor(parameterTypes); return new JavaConstructor(getRuntime(), constructor); } catch (NoSuchMethodException nsme) { throw getRuntime().newNameError("no matching java constructor"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/JavaClass.java/clean/src/org/jruby/javasupport/JavaClass.java
throw getRuntime().newNameError("no matching java constructor");
throw getRuntime().newNameError("no matching java constructor", null);
public JavaConstructor declared_constructor(IRubyObject[] args) { try { Class[] parameterTypes = buildClassArgs(args); Constructor constructor; constructor = javaClass().getDeclaredConstructor (parameterTypes); return new JavaConstructor(getRuntime(), constructor); } catch (NoSuchMethodException nsme) { throw getRuntime().newNameError("no matching java constructor"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/JavaClass.java/clean/src/org/jruby/javasupport/JavaClass.java
throw getRuntime().newNameError(undefinedFieldMessage(stringName));
throw undefinedFieldError(stringName);
public JavaField declared_field(IRubyObject name) { String stringName = name.asSymbol(); try { Field field = javaClass().getDeclaredField(stringName); return new JavaField(getRuntime(),field); } catch (NoSuchFieldException nsfe) { throw getRuntime().newNameError(undefinedFieldMessage(stringName)); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/JavaClass.java/clean/src/org/jruby/javasupport/JavaClass.java
throw getRuntime().newNameError(undefinedFieldMessage(stringName));
throw undefinedFieldError(stringName);
public JavaField field(IRubyObject name) { String stringName = name.asSymbol(); try { Field field = javaClass().getField(stringName); return new JavaField(getRuntime(),field); } catch (NoSuchFieldException nsfe) { throw getRuntime().newNameError(undefinedFieldMessage(stringName)); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/JavaClass.java/clean/src/org/jruby/javasupport/JavaClass.java
public void mousePressed(MouseEvent me) {}
public void mousePressed(MouseEvent me) { ThumbWinPopupMenu.hideMenu(); }
public void mousePressed(MouseEvent me) {}
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/11fc11c4e769e382f5279d4e21088d468940d1b6/ThumbWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/ThumbWin.java
return (getValue() != null && getValue().equals(((JavaObject) other).getValue()))
if (getValue() == null && ((JavaObject) other).getValue() == null) { return getRuntime().getTrue(); } return (getValue().equals(((JavaObject) other).getValue()))
public RubyBoolean equal(IRubyObject other) { if (other instanceof JavaObject) { return (getValue() != null && getValue().equals(((JavaObject) other).getValue())) ? getRuntime().getTrue() : getRuntime().getFalse(); } return getRuntime().getFalse(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/206c7b0b7eb0c58d4a00f4aaa94c9013ad204adc/JavaObject.java/buggy/src/org/jruby/javasupport/JavaObject.java
return RubyFixnum.newFixnum(runtime, value.hashCode());
int result; if (value == null) { result = 0; } else { result = value.hashCode(); } return RubyFixnum.newFixnum(runtime, result);
public RubyFixnum hash() { return RubyFixnum.newFixnum(runtime, value.hashCode()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/206c7b0b7eb0c58d4a00f4aaa94c9013ad204adc/JavaObject.java/buggy/src/org/jruby/javasupport/JavaObject.java
return RubyString.newString(getRuntime(), getValue().toString());
String result; if (getValue() == null) { result = "null"; } else { result = getValue().toString(); } return RubyString.newString(getRuntime(), result);
public RubyString to_s() { return RubyString.newString(getRuntime(), getValue().toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/206c7b0b7eb0c58d4a00f4aaa94c9013ad204adc/JavaObject.java/buggy/src/org/jruby/javasupport/JavaObject.java
presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence);
Presence p = new Presence(presence.getType(), presence.getStatus(), presence.getPriority(), presence.getMode()); p.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(p);
private void registerPresenceListener() { SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportUtils.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; if (presence.getType() == Presence.Type.unavailable) { registered = false; } GatewayButton button = uiMap.get(transport); button.signedIn(registered); } } }, new PacketTypeFilter(Presence.class)); ChatManager chatManager = SparkManager.getChatManager(); chatManager.addContactItemHandler(this); // Iterate through Contacts and check for final ContactList contactList = SparkManager.getWorkspace().getContactList(); for (ContactGroup contactGroup : contactList.getContactGroups()) { for (ContactItem contactItem : contactGroup.getContactItems()) { Presence presence = contactItem.getPresence(); if (presence != null) { String domain = StringUtils.parseServer(presence.getFrom()); Transport transport = TransportUtils.getTransport(domain); if (transport != null) { handlePresence(contactItem, presence); contactGroup.fireContactGroupUpdated(); } } } } SparkManager.getSessionManager().addPresenceListener(new PresenceListener() { public void presenceChanged(Presence presence) { for (Transport transport : TransportUtils.getTransports()) { presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/65023340f7287fee8d2f1535446bf62c3ed50749/GatewayPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/gateways/GatewayPlugin.java
presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence);
Presence p = new Presence(presence.getType(), presence.getStatus(), presence.getPriority(), presence.getMode()); p.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(p);
public void presenceChanged(Presence presence) { for (Transport transport : TransportUtils.getTransports()) { presence.setTo(transport.getServiceName()); SparkManager.getConnection().sendPacket(presence); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/65023340f7287fee8d2f1535446bf62c3ed50749/GatewayPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/gateways/GatewayPlugin.java
while (iter.hasNext()) {
while (iter.hasNext()) {
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getChildren()); } return sourceFiles; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/ProjectData.java/clean/cobertura/src/net/sourceforge/cobertura/coveragedata/ProjectData.java
sourceFiles.addAll(packageData.getChildren());
sourceFiles.addAll(packageData.getSourceFiles());
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getChildren()); } return sourceFiles; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/ProjectData.java/clean/cobertura/src/net/sourceforge/cobertura/coveragedata/ProjectData.java
public Collection getSubPackages(String packageName)
public SortedSet getSubPackages(String packageName)
public Collection getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/ProjectData.java/clean/cobertura/src/net/sourceforge/cobertura/coveragedata/ProjectData.java
Collection subPackages = new HashSet();
SortedSet subPackages = new TreeSet();
public Collection getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/ProjectData.java/clean/cobertura/src/net/sourceforge/cobertura/coveragedata/ProjectData.java
if (packageData.getName().equals(packageName))
if (packageData.getName().startsWith(packageName))
public Collection getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/ProjectData.java/clean/cobertura/src/net/sourceforge/cobertura/coveragedata/ProjectData.java
defineMethod("tty?", Arity.noArguments(), "tty"); defineAlias("isatty", "tty?");
protected void initializeClass() { includeModule(getRuntime().getModule("Enumerable")); // TODO: Implement tty? and isatty. We have no real capability to // determine this from java, but if we could set tty status, then // we could invoke jruby differently to allow stdin to return true // on this. This would allow things like cgi.rb to work properly. defineSingletonMethod("foreach", Arity.optional()); defineSingletonMethod("read", Arity.optional()); defineSingletonMethod("readlines", Arity.optional()); defineSingletonMethod("popen", Arity.optional()); defineMethod("<<", Arity.singleArgument(), "addString"); defineMethod("binmode", Arity.noArguments()); defineMethod("clone", Arity.noArguments(), "clone_IO"); defineMethod("close", Arity.noArguments()); defineMethod("closed?", Arity.noArguments(), "closed"); defineMethod("each", Arity.optional(), "each_line"); defineMethod("each_byte", Arity.noArguments()); defineMethod("each_line", Arity.optional()); defineMethod("eof", Arity.noArguments()); defineAlias("eof?", "eof"); defineMethod("fileno", Arity.noArguments()); defineMethod("flush", Arity.noArguments()); defineMethod("fsync", Arity.noArguments()); defineMethod("getc", Arity.noArguments()); defineMethod("gets", Arity.optional()); defineMethod("initialize", Arity.optional()); defineMethod("lineno", Arity.noArguments()); defineMethod("lineno=", Arity.singleArgument(), "lineno_set"); defineMethod("pid", Arity.noArguments()); defineMethod("pos", Arity.noArguments()); defineMethod("pos=", Arity.singleArgument(), "pos_set"); defineMethod("print", Arity.optional()); defineMethod("printf", Arity.optional()); defineMethod("putc", Arity.singleArgument()); defineMethod("puts", Arity.optional()); defineMethod("read", Arity.optional()); defineMethod("readchar", Arity.noArguments()); defineMethod("readline", Arity.optional()); defineMethod("readlines", Arity.optional()); defineMethod("reopen", Arity.optional()); defineMethod("rewind", Arity.noArguments()); defineMethod("seek", Arity.optional()); defineMethod("sync", Arity.noArguments()); defineMethod("sync=", Arity.singleArgument(), "sync_set"); defineMethod("sysread", Arity.singleArgument()); defineMethod("syswrite", Arity.singleArgument()); defineAlias("tell", "pos"); defineAlias("to_i", "fileno"); defineMethod("to_io", Arity.noArguments()); defineMethod("ungetc", Arity.singleArgument()); defineMethod("write", Arity.singleArgument()); // Constants for seek setConstant("SEEK_SET", getRuntime().newFixnum(IOHandler.SEEK_SET)); setConstant("SEEK_CUR", getRuntime().newFixnum(IOHandler.SEEK_CUR)); setConstant("SEEK_END", getRuntime().newFixnum(IOHandler.SEEK_END)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/IOMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/IOMetaClass.java
public RubyClass newSubClass(String name, RubyModule parent) { return new IOMetaClass(name, this, parent);
public RubyClass newSubClass(String name, SinglyLinkedList parentCRef) { return new IOMetaClass(name, this, parentCRef);
public RubyClass newSubClass(String name, RubyModule parent) { return new IOMetaClass(name, this, parent); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/IOMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/IOMetaClass.java
{ setText("Zooming"); manager = new ZoomMenuManager(mng); buildGUI(magFactor); }
{ setText("Zooming"); manager = new ZoomMenuManager(mng); buildGUI(magFactor); }
public ZoomMenu(ImageInspectorManager mng, double magFactor) { setText("Zooming"); manager = new ZoomMenuManager(mng); buildGUI(magFactor); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomMenu.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomMenu.java
public CategoryLoader(HiViewer viewer, Set categoriesID)
public CategoryLoader(HiViewer viewer, Set categoriesID, boolean refresh)
public CategoryLoader(HiViewer viewer, Set categoriesID) { super(viewer); this.categoriesID = categoriesID; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/CategoryLoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/CategoryLoader.java
this.refresh = refresh;
public CategoryLoader(HiViewer viewer, Set categoriesID) { super(viewer); this.categoriesID = categoriesID; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/CategoryLoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/CategoryLoader.java
viewer.setHierarchyRoots((Set) result, false);
viewer.setHierarchyRoots((Set) result, false, refresh);
public void handleResult(Object result) { if (viewer.getState() == HiViewer.DISCARDED) return; //Async cancel. viewer.setHierarchyRoots((Set) result, false); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fb3743d6f75abbf12f788b3b2925f4a6f4606dd6/CategoryLoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/CategoryLoader.java
List logs = CurrentDetails.getCreationEvent().collectFromLogs( null );
List logs = CurrentDetails.getCreationEvent().collectLogs( null );
private void afterSave() { // Save all that and go back to AUTO flush. getHibernateTemplate().flush(); // TODO performance? currentSession().setFlushMode(FlushMode.AUTO); // Let's save the event again using a temporary event. Event currentEvent = CurrentDetails.getCreationEvent(); EventType afterSave = new EventType(); afterSave.setValue( "afterSave" ); CurrentDetails.newEvent( afterSave ); getHibernateTemplate().saveOrUpdate( currentEvent ); // Checks. List logs = CurrentDetails.getCreationEvent().collectFromLogs( null ); if (logs.size() > 0) log.error("New logs created on update.afterSave:\n"+logs); // FIXME we shouldn't be updating experimenter etc. here. // Return the previous event. CurrentDetails.setCreationEvent( currentEvent ); // Cleanup filter = null; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java
super(ruby, rubyClass); }
super(ruby, rubyClass); }
public RubyNumeric(Ruby ruby, RubyClass rubyClass) { super(ruby, rubyClass); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
if (funcall("<", RubyFixnum.zero(getRuby())).isTrue()) { return (RubyNumeric)funcall("-@"); } else { return this; } }
if (funcall("<", RubyFixnum.zero(getRuby())).isTrue()) { return (RubyNumeric)funcall("-@"); } else { return this; } }
public RubyNumeric abs() { if (funcall("<", RubyFixnum.zero(getRuby())).isTrue()) { return (RubyNumeric)funcall("-@"); } else { return this; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return RubyFloat.newFloat(getRuby(), getDoubleValue()).ceil(); }
return RubyFloat.newFloat(getRuby(), getDoubleValue()).ceil(); }
public RubyInteger ceil() { return RubyFloat.newFloat(getRuby(), getDoubleValue()).ceil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
RubyNumeric other = numericValue(num); if (getRubyClass() == other.getRubyClass()) { return RubyArray.newArray(getRuby(), this, other); } else { return RubyArray.newArray(getRuby(), Arrays.asList(getCoerce((RubyNumeric)num))); } }
RubyNumeric other = numericValue(num); if (getRubyClass() == other.getRubyClass()) { return RubyArray.newArray(getRuby(), other, this); } else { return RubyArray.newArray(getRuby(), RubyFloat.newFloat(getRuby(), other.getDoubleValue()), RubyFloat.newFloat(getRuby(), getDoubleValue())); } }
public RubyArray coerce(RubyObject num) { RubyNumeric other = numericValue(num); if (getRubyClass() == other.getRubyClass()) { return RubyArray.newArray(getRuby(), this, other); } else { return RubyArray.newArray(getRuby(), Arrays.asList(getCoerce((RubyNumeric)num))); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
RubyClass numericClass = ruby.defineClass("Numeric", ruby.getClasses().getObjectClass()); numericClass.includeModule(ruby.getClasses().getComparableModule()); numericClass.defineMethod("coerce", CallbackFactory.getMethod(RubyNumeric.class, "coerce", RubyObject.class)); numericClass.defineMethod("clone", CallbackFactory.getMethod(RubyNumeric.class, "rbClone")); numericClass.defineMethod("+@", CallbackFactory.getMethod(RubyNumeric.class, "op_uplus")); numericClass.defineMethod("-@", CallbackFactory.getMethod(RubyNumeric.class, "op_uminus")); numericClass.defineMethod("===", CallbackFactory.getMethod(RubyNumeric.class, "equal", RubyObject.class)); numericClass.defineMethod("eql?", CallbackFactory.getMethod(RubyNumeric.class, "eql", RubyObject.class)); numericClass.defineMethod("divmod", CallbackFactory.getMethod(RubyNumeric.class, "divmod", RubyNumeric.class)); numericClass.defineMethod("modulo", CallbackFactory.getMethod(RubyNumeric.class, "modulo", RubyNumeric.class)); numericClass.defineMethod("remainder", CallbackFactory.getMethod(RubyNumeric.class, "remainder", RubyNumeric.class)); numericClass.defineMethod("abs", CallbackFactory.getMethod(RubyNumeric.class, "abs")); numericClass.defineMethod("integer?", CallbackFactory.getMethod(RubyNumeric.class, "int_p")); numericClass.defineMethod("zero?", CallbackFactory.getMethod(RubyNumeric.class, "zero_p")); numericClass.defineMethod("nonzero?", CallbackFactory.getMethod(RubyNumeric.class, "nonzero_p")); numericClass.defineMethod("floor", CallbackFactory.getMethod(RubyNumeric.class, "floor")); numericClass.defineMethod("ceil", CallbackFactory.getMethod(RubyNumeric.class, "ceil")); numericClass.defineMethod("round", CallbackFactory.getMethod(RubyNumeric.class, "round")); numericClass.defineMethod("truncate", CallbackFactory.getMethod(RubyNumeric.class, "truncate"));
RubyClass numericClass = ruby.defineClass("Numeric", ruby.getClasses().getObjectClass());
public static RubyClass createNumericClass(Ruby ruby) { RubyClass numericClass = ruby.defineClass("Numeric", ruby.getClasses().getObjectClass()); numericClass.includeModule(ruby.getClasses().getComparableModule()); numericClass.defineMethod("coerce", CallbackFactory.getMethod(RubyNumeric.class, "coerce", RubyObject.class)); numericClass.defineMethod("clone", CallbackFactory.getMethod(RubyNumeric.class, "rbClone")); numericClass.defineMethod("+@", CallbackFactory.getMethod(RubyNumeric.class, "op_uplus")); numericClass.defineMethod("-@", CallbackFactory.getMethod(RubyNumeric.class, "op_uminus")); numericClass.defineMethod("===", CallbackFactory.getMethod(RubyNumeric.class, "equal", RubyObject.class)); numericClass.defineMethod("eql?", CallbackFactory.getMethod(RubyNumeric.class, "eql", RubyObject.class)); numericClass.defineMethod("divmod", CallbackFactory.getMethod(RubyNumeric.class, "divmod", RubyNumeric.class)); numericClass.defineMethod("modulo", CallbackFactory.getMethod(RubyNumeric.class, "modulo", RubyNumeric.class)); numericClass.defineMethod("remainder", CallbackFactory.getMethod(RubyNumeric.class, "remainder", RubyNumeric.class)); numericClass.defineMethod("abs", CallbackFactory.getMethod(RubyNumeric.class, "abs")); numericClass.defineMethod("integer?", CallbackFactory.getMethod(RubyNumeric.class, "int_p")); numericClass.defineMethod("zero?", CallbackFactory.getMethod(RubyNumeric.class, "zero_p")); numericClass.defineMethod("nonzero?", CallbackFactory.getMethod(RubyNumeric.class, "nonzero_p")); numericClass.defineMethod("floor", CallbackFactory.getMethod(RubyNumeric.class, "floor")); numericClass.defineMethod("ceil", CallbackFactory.getMethod(RubyNumeric.class, "ceil")); numericClass.defineMethod("round", CallbackFactory.getMethod(RubyNumeric.class, "round")); numericClass.defineMethod("truncate", CallbackFactory.getMethod(RubyNumeric.class, "truncate")); return numericClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return numericClass; }
numericClass.includeModule(ruby.getClasses().getComparableModule()); numericClass.defineMethod("coerce", CallbackFactory.getMethod(RubyNumeric.class, "coerce", RubyObject.class)); numericClass.defineMethod("clone", CallbackFactory.getMethod(RubyNumeric.class, "rbClone")); numericClass.defineMethod("+@", CallbackFactory.getMethod(RubyNumeric.class, "op_uplus")); numericClass.defineMethod("-@", CallbackFactory.getMethod(RubyNumeric.class, "op_uminus")); numericClass.defineMethod("===", CallbackFactory.getMethod(RubyNumeric.class, "equal", RubyObject.class)); numericClass.defineMethod("eql?", CallbackFactory.getMethod(RubyNumeric.class, "eql", RubyObject.class)); numericClass.defineMethod("divmod", CallbackFactory.getMethod(RubyNumeric.class, "divmod", RubyNumeric.class)); numericClass.defineMethod("modulo", CallbackFactory.getMethod(RubyNumeric.class, "modulo", RubyNumeric.class)); numericClass.defineMethod("remainder", CallbackFactory.getMethod(RubyNumeric.class, "remainder", RubyNumeric.class)); numericClass.defineMethod("abs", CallbackFactory.getMethod(RubyNumeric.class, "abs")); numericClass.defineMethod("integer?", CallbackFactory.getMethod(RubyNumeric.class, "int_p")); numericClass.defineMethod("zero?", CallbackFactory.getMethod(RubyNumeric.class, "zero_p")); numericClass.defineMethod("nonzero?", CallbackFactory.getMethod(RubyNumeric.class, "nonzero_p")); numericClass.defineMethod("floor", CallbackFactory.getMethod(RubyNumeric.class, "floor")); numericClass.defineMethod("ceil", CallbackFactory.getMethod(RubyNumeric.class, "ceil")); numericClass.defineMethod("round", CallbackFactory.getMethod(RubyNumeric.class, "round")); numericClass.defineMethod("truncate", CallbackFactory.getMethod(RubyNumeric.class, "truncate")); return numericClass; }
public static RubyClass createNumericClass(Ruby ruby) { RubyClass numericClass = ruby.defineClass("Numeric", ruby.getClasses().getObjectClass()); numericClass.includeModule(ruby.getClasses().getComparableModule()); numericClass.defineMethod("coerce", CallbackFactory.getMethod(RubyNumeric.class, "coerce", RubyObject.class)); numericClass.defineMethod("clone", CallbackFactory.getMethod(RubyNumeric.class, "rbClone")); numericClass.defineMethod("+@", CallbackFactory.getMethod(RubyNumeric.class, "op_uplus")); numericClass.defineMethod("-@", CallbackFactory.getMethod(RubyNumeric.class, "op_uminus")); numericClass.defineMethod("===", CallbackFactory.getMethod(RubyNumeric.class, "equal", RubyObject.class)); numericClass.defineMethod("eql?", CallbackFactory.getMethod(RubyNumeric.class, "eql", RubyObject.class)); numericClass.defineMethod("divmod", CallbackFactory.getMethod(RubyNumeric.class, "divmod", RubyNumeric.class)); numericClass.defineMethod("modulo", CallbackFactory.getMethod(RubyNumeric.class, "modulo", RubyNumeric.class)); numericClass.defineMethod("remainder", CallbackFactory.getMethod(RubyNumeric.class, "remainder", RubyNumeric.class)); numericClass.defineMethod("abs", CallbackFactory.getMethod(RubyNumeric.class, "abs")); numericClass.defineMethod("integer?", CallbackFactory.getMethod(RubyNumeric.class, "int_p")); numericClass.defineMethod("zero?", CallbackFactory.getMethod(RubyNumeric.class, "zero_p")); numericClass.defineMethod("nonzero?", CallbackFactory.getMethod(RubyNumeric.class, "nonzero_p")); numericClass.defineMethod("floor", CallbackFactory.getMethod(RubyNumeric.class, "floor")); numericClass.defineMethod("ceil", CallbackFactory.getMethod(RubyNumeric.class, "ceil")); numericClass.defineMethod("round", CallbackFactory.getMethod(RubyNumeric.class, "round")); numericClass.defineMethod("truncate", CallbackFactory.getMethod(RubyNumeric.class, "truncate")); return numericClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
RubyNumeric div = (RubyNumeric)funcall("/", other); if (div instanceof RubyFloat) { double d = Math.floor(((RubyFloat)div).getValue()); if (((RubyFloat)div).getValue() > d) { div = RubyFloat.newFloat(getRuby(), d); } } RubyNumeric mod = (RubyNumeric)funcall("%", other); return RubyArray.newArray(getRuby(), div, mod); }
RubyNumeric div = (RubyNumeric)funcall("/", other); if (div instanceof RubyFloat) { double d = Math.floor(((RubyFloat)div).getValue()); if (((RubyFloat)div).getValue() > d) { div = RubyFloat.newFloat(getRuby(), d); } } RubyNumeric mod = (RubyNumeric)funcall("%", other); return RubyArray.newArray(getRuby(), div, mod); }
public RubyArray divmod(RubyNumeric other) { RubyNumeric div = (RubyNumeric)funcall("/", other); if (div instanceof RubyFloat) { double d = Math.floor(((RubyFloat)div).getValue()); if (((RubyFloat)div).getValue() > d) { div = RubyFloat.newFloat(getRuby(), d); } } RubyNumeric mod = (RubyNumeric)funcall("%", other); return RubyArray.newArray(getRuby(), div, mod); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
if (getRubyClass() != other.getRubyClass()) { return getRuby().getFalse(); } else { return super.equal(other); } }
if (getRubyClass() != other.getRubyClass()) { return getRuby().getFalse(); } else { return super.equal(other); } }
public RubyBoolean eql(RubyObject other) { if (getRubyClass() != other.getRubyClass()) { return getRuby().getFalse(); } else { return super.equal(other); // +++ rb_equal } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return super.equal(other); }
return super.equal(other); }
public RubyBoolean equal(RubyObject other) { return super.equal(other); // +++ rb_equal }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
long val = fix2long(arg); if (val > Integer.MAX_VALUE || val < Integer.MIN_VALUE) { throw new TypeError(arg.getRuby(), "argument value is too big to convert to int"); } return (int)val; }
long val = fix2long(arg); if (val > Integer.MAX_VALUE || val < Integer.MIN_VALUE) { throw new TypeError(arg.getRuby(), "argument value is too big to convert to int"); } return (int)val; }
public static int fix2int(RubyObject arg) { long val = fix2long(arg); if (val > Integer.MAX_VALUE || val < Integer.MIN_VALUE) { throw new TypeError(arg.getRuby(), "argument value is too big to convert to int"); } return (int)val; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
if (arg instanceof RubyFixnum) { return ((RubyFixnum)arg).getLongValue(); } throw new TypeError(arg.getRuby(), "argument is not a Fixnum"); }
if (arg instanceof RubyFixnum) { return ((RubyFixnum)arg).getLongValue(); } throw new TypeError(arg.getRuby(), "argument is not a Fixnum"); }
public static long fix2long(RubyObject arg) { if (arg instanceof RubyFixnum) { return ((RubyFixnum)arg).getLongValue(); } throw new TypeError(arg.getRuby(), "argument is not a Fixnum"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java
return RubyFloat.newFloat(getRuby(), getDoubleValue()).floor(); }
return RubyFloat.newFloat(getRuby(), getDoubleValue()).floor(); }
public RubyInteger floor() { return RubyFloat.newFloat(getRuby(), getDoubleValue()).floor(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e3f72aab20ef1fc8576d8fa6823d9722ed33c55c/RubyNumeric.java/buggy/org/jruby/RubyNumeric.java