rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
mathModule.defineSingletonMethod("atan2", atan2); mathModule.defineSingletonMethod("cos", cos); mathModule.defineSingletonMethod("exp", exp); mathModule.defineSingletonMethod("ldexp", ldexp); mathModule.defineSingletonMethod("log", log); mathModule.defineSingletonMethod("log10", log10); mathModule.defineSingletonMethod("sin", sin); mathModule.defineSingletonMethod("sqrt", sqrt); mathModule.defineSingletonMethod("tan", tan);
mathModule.defineSingletonMethod( "atan2", CallbackFactory.getSingletonMethod(RubyMath.class, "atan2", RubyNumeric.class, RubyNumeric.class)); mathModule.defineSingletonMethod("cos", CallbackFactory.getSingletonMethod(RubyMath.class, "cos", RubyNumeric.class)); mathModule.defineSingletonMethod("exp", CallbackFactory.getSingletonMethod(RubyMath.class, "exp", RubyNumeric.class)); mathModule.defineSingletonMethod("ldexp", CallbackFactory.getSingletonMethod(RubyMath.class, "ldexp", RubyFloat.class, RubyInteger.class)); mathModule.defineSingletonMethod("log", CallbackFactory.getSingletonMethod(RubyMath.class, "log", RubyNumeric.class)); mathModule.defineSingletonMethod("log10", CallbackFactory.getSingletonMethod(RubyMath.class, "log10", RubyNumeric.class)); mathModule.defineSingletonMethod("sin", CallbackFactory.getSingletonMethod(RubyMath.class, "sin", RubyNumeric.class)); mathModule.defineSingletonMethod("sqrt", CallbackFactory.getSingletonMethod(RubyMath.class, "sqrt", RubyNumeric.class)); mathModule.defineSingletonMethod("tan", CallbackFactory.getSingletonMethod(RubyMath.class, "tan", RubyNumeric.class));
public static RubyModule createMathModule(Ruby ruby) { Callback atan2 = new ReflectionCallbackMethod(RubyMath.class, "atan2", new Class[] { RubyNumeric.class, RubyNumeric.class }); Callback cos = new ReflectionCallbackMethod(RubyMath.class, "cos", RubyNumeric.class); Callback exp = new ReflectionCallbackMethod(RubyMath.class, "exp", RubyNumeric.class); Callback frexp = new ReflectionCallbackMethod(RubyMath.class, "frexp", RubyNumeric.class); Callback ldexp = new ReflectionCallbackMethod(RubyMath.class, "ldexp", new Class[] { RubyFloat.class, RubyInteger.class }); Callback log = new ReflectionCallbackMethod(RubyMath.class, "log", RubyNumeric.class); Callback log10 = new ReflectionCallbackMethod(RubyMath.class, "log10", RubyNumeric.class); Callback sin = new ReflectionCallbackMethod(RubyMath.class, "sin", RubyNumeric.class); Callback sqrt = new ReflectionCallbackMethod(RubyMath.class, "sqrt", RubyNumeric.class); Callback tan = new ReflectionCallbackMethod(RubyMath.class, "tan", RubyNumeric.class); RubyModule mathModule = ruby.defineModule("Math"); mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); mathModule.defineSingletonMethod("atan2", atan2); mathModule.defineSingletonMethod("cos", cos); mathModule.defineSingletonMethod("exp", exp);// mathModule.defineSingletonMethod("frexp", frexp); mathModule.defineSingletonMethod("ldexp", ldexp); mathModule.defineSingletonMethod("log", log); mathModule.defineSingletonMethod("log10", log10); mathModule.defineSingletonMethod("sin", sin); mathModule.defineSingletonMethod("sqrt", sqrt); mathModule.defineSingletonMethod("tan", tan); return mathModule; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyMath.java/buggy/org/jruby/RubyMath.java
IRubyObject clone = getMetaClass().getRealClass().allocate();
IRubyObject clone = doClone();
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49aa6e52e2393f8c17a3c126aed59b8fd08b68aa/RubyObject.java/buggy/src/org/jruby/RubyObject.java
clone.setFrozen(false);
clone.setTaint(this.isTaint());
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49aa6e52e2393f8c17a3c126aed59b8fd08b68aa/RubyObject.java/buggy/src/org/jruby/RubyObject.java
if (isFrozen()) { clone.setFrozen(true); }
clone.setFrozen(isFrozen());
public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49aa6e52e2393f8c17a3c126aed59b8fd08b68aa/RubyObject.java/buggy/src/org/jruby/RubyObject.java
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/7f438929157b8c8e2d71ff069907dd3a40e18263/ListArticlesBean.java/buggy/src/java/com/idega/block/article/bean/ListArticlesBean.java
ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");
String id = articleItemBean[i].getMainCategory()+"/"+articleItemBean[i].getHeadline()+".xml"; ListArticlesBean bean = new ListArticlesBean(id, articleItemBean[i].getHeadline(), "");
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/7f438929157b8c8e2d71ff069907dd3a40e18263/ListArticlesBean.java/buggy/src/java/com/idega/block/article/bean/ListArticlesBean.java
isName = false;
ImageEditorManager(ImageEditor view, DataManagerCtrl control, ImageData model) { this.view = view; this.control = control; this.model = model; nameChange = false; isName = false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ImageEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/image/ImageEditorManager.java
nameField.addMouseListener(this);
void initListeners() { attachButtonListener(view.getSaveButton(), SAVE); attachButtonListener(view.getViewButton(), VIEW); JTextArea nameField = view.getNameField(); nameField.getDocument().addDocumentListener(this); nameField.addMouseListener(this); JTextArea descriptionArea = view.getDescriptionArea(); descriptionArea.getDocument().addDocumentListener(this); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ImageEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/image/ImageEditorManager.java
view.getSaveButton().setEnabled(isName);
view.getSaveButton().setEnabled(true);
public void insertUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ImageEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/image/ImageEditorManager.java
view.getSaveButton().setEnabled(isName);
view.getSaveButton().setEnabled(true);
public void removeUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ImageEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/image/ImageEditorManager.java
public Filterable filter(String fieldId, Filterable f) { if (null==f || !Hibernate.isInitialized(f)){
public Filterable filter(String fieldId, Filterable f) { if (f == null) return null; if (!Hibernate.isInitialized(f)) {
public Filterable filter(String fieldId, Filterable f) { if (null==f || !Hibernate.isInitialized(f)){ if (f instanceof IObject) { IObject proxy = (IObject) f; IObject unloaded = (IObject) Utils.trueInstance(f.getClass()); unloaded.setId(proxy.getId()); // TODO is this causing a DB hit? unloaded.unload(); return unloaded; } return null; } return super.filter(fieldId, f); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ProxyCleanupFilter.java/buggy/components/server/src/ome/tools/hibernate/ProxyCleanupFilter.java
return null; } return super.filter(fieldId, f); }
} return super.filter(fieldId, f); }
public Filterable filter(String fieldId, Filterable f) { if (null==f || !Hibernate.isInitialized(f)){ if (f instanceof IObject) { IObject proxy = (IObject) f; IObject unloaded = (IObject) Utils.trueInstance(f.getClass()); unloaded.setId(proxy.getId()); // TODO is this causing a DB hit? unloaded.unload(); return unloaded; } return null; } return super.filter(fieldId, f); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ProxyCleanupFilter.java/buggy/components/server/src/ome/tools/hibernate/ProxyCleanupFilter.java
public Object invoke(MethodInvocation arg0) throws Throwable { return filter(null,arg0.proceed()); }
public Object invoke(MethodInvocation arg0) throws Throwable { return filter(null, arg0.proceed()); }
public Object invoke(MethodInvocation arg0) throws Throwable { return filter(null,arg0.proceed()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ProxyCleanupFilter.java/buggy/components/server/src/ome/tools/hibernate/ProxyCleanupFilter.java
return new RubyFixnum(getRuby(), getValue().charAt(idx));
return RubyFixnum.newFixnum(getRuby(), getValue().charAt(idx));
public RubyObject aref(RubyObject[] args) { if (argCount(args, 1, 2) == 2) { int beg = RubyNumeric.fix2int(args[0]); int len = RubyNumeric.fix2int(args[1]); return substr(beg, len); } if (args[0] instanceof RubyFixnum) { int idx = RubyNumeric.fix2int(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuby().getNil(); } return new RubyFixnum(getRuby(), getValue().charAt(idx)); } if (args[0] instanceof RubyRegexp) { if (RubyRegexp.regexpValue(args[0]).search(this, 0) >= 0) { return RubyRegexp.last_match(getRuby().getBackref()); } return getRuby().getNil(); } if (args[0] instanceof RubyString) { if (getValue().indexOf(stringValue(args[0]).getValue()) != -1) { return args[0]; } return getRuby().getNil(); } if (args[0] instanceof RubyRange) { long[] begLen = ((RubyRange) args[0]).getBeginLength(getValue().length(), true, false); if (begLen == null) { return getRuby().getNil(); } return substr((int) begLen[0], (int) begLen[1]); } int idx = (int) RubyNumeric.num2long(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuby().getNil(); } return new RubyFixnum(getRuby(), getValue().charAt(idx)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/afb67c3765f6466c476317e6bb0c72f6593f05f3/RubyString.java/buggy/org/jruby/RubyString.java
return new RubyFixnum(getRuby(), getValue().charAt(idx));
return RubyFixnum.newFixnum(getRuby(), getValue().charAt(idx));
public RubyObject aref(RubyObject[] args) { if (argCount(args, 1, 2) == 2) { int beg = RubyNumeric.fix2int(args[0]); int len = RubyNumeric.fix2int(args[1]); return substr(beg, len); } if (args[0] instanceof RubyFixnum) { int idx = RubyNumeric.fix2int(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuby().getNil(); } return new RubyFixnum(getRuby(), getValue().charAt(idx)); } if (args[0] instanceof RubyRegexp) { if (RubyRegexp.regexpValue(args[0]).search(this, 0) >= 0) { return RubyRegexp.last_match(getRuby().getBackref()); } return getRuby().getNil(); } if (args[0] instanceof RubyString) { if (getValue().indexOf(stringValue(args[0]).getValue()) != -1) { return args[0]; } return getRuby().getNil(); } if (args[0] instanceof RubyRange) { long[] begLen = ((RubyRange) args[0]).getBeginLength(getValue().length(), true, false); if (begLen == null) { return getRuby().getNil(); } return substr((int) begLen[0], (int) begLen[1]); } int idx = (int) RubyNumeric.num2long(args[0]); if (idx < 0) { idx += getValue().length(); } if (idx < 0 || idx >= getValue().length()) { return getRuby().getNil(); } return new RubyFixnum(getRuby(), getValue().charAt(idx)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/afb67c3765f6466c476317e6bb0c72f6593f05f3/RubyString.java/buggy/org/jruby/RubyString.java
ruby.yield(new RubyFixnum(ruby, lByteValue[i]));
ruby.yield(RubyFixnum.newFixnum(ruby, lByteValue[i]));
public RubyString each_byte() { byte[] lByteValue = toByteArray(); int lLength = lByteValue.length; for (int i = 0; i < lLength; i++) { ruby.yield(new RubyFixnum(ruby, lByteValue[i])); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/afb67c3765f6466c476317e6bb0c72f6593f05f3/RubyString.java/buggy/org/jruby/RubyString.java
return new RubyBoolean(getRuby(), getValue().length() == 0);
return RubyBoolean.newBoolean(getRuby(), getValue().length() == 0);
public RubyBoolean empty() { return new RubyBoolean(getRuby(), getValue().length() == 0); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/afb67c3765f6466c476317e6bb0c72f6593f05f3/RubyString.java/buggy/org/jruby/RubyString.java
return new RubyFixnum(getRuby(), getValue().length());
return RubyFixnum.newFixnum(getRuby(), getValue().length());
public RubyFixnum length() { return new RubyFixnum(getRuby(), getValue().length()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/afb67c3765f6466c476317e6bb0c72f6593f05f3/RubyString.java/buggy/org/jruby/RubyString.java
WFTabBar tb = new WFTabBar();
WFTabbedPane tb = new WFTabbedPane();
protected UIComponent getMainTaskbar() { String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setMainAreaStyleClass(null); tb.setId(MAIN_TASKBAR_ID); WFTab buttonContent = tb.addButtonVB(TASK_ID_CONTENT, bref + "content", getContentPerspective()); buttonContent.addActionListener(this); WFTab buttonEdit = tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditPerspective()); buttonEdit.addActionListener(this); tb.addTaskbarListener(this); UICommand debugButton = new HtmlCommandButton(); debugButton.setId("debugbutton"); debugButton.setValue("debug"); debugButton.setImmediate(true); debugButton.addActionListener(this); this.getChildren().add(debugButton); return tb; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/CMSPage.java/clean/src/java/com/idega/block/article/CMSPage.java
tb.addTaskbarListener(this);
tb.addTabListener(this);
protected UIComponent getMainTaskbar() { String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setMainAreaStyleClass(null); tb.setId(MAIN_TASKBAR_ID); WFTab buttonContent = tb.addButtonVB(TASK_ID_CONTENT, bref + "content", getContentPerspective()); buttonContent.addActionListener(this); WFTab buttonEdit = tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditPerspective()); buttonEdit.addActionListener(this); tb.addTaskbarListener(this); UICommand debugButton = new HtmlCommandButton(); debugButton.setId("debugbutton"); debugButton.setValue("debug"); debugButton.setImmediate(true); debugButton.addActionListener(this); this.getChildren().add(debugButton); return tb; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/CMSPage.java/clean/src/java/com/idega/block/article/CMSPage.java
WFTabBar tb = (WFTabBar) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID);
WFTabbedPane tb = (WFTabbedPane) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID);
public void processAction(ActionEvent event) { UIComponent link = event.getComponent(); String id = WFUtil.getParameter(link, "id"); WFTabBar tb = (WFTabBar) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "sv"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", "headline"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", "author"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setComment", "comment"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setDescription", "description"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setSource", "source"); if (link.getId().equals(ArticleListBean.ARTICLE_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_PUBLISHED); } else { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_UNDER_REVIEW); } WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setMainCategoryId", new Integer(3)); ab.updateEditButtons(); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/CMSPage.java/clean/src/java/com/idega/block/article/CMSPage.java
tb.setSelectedButtonId(TASK_ID_EDIT);
tb.setSelectedMenuItemId(TASK_ID_EDIT);
public void processAction(ActionEvent event) { UIComponent link = event.getComponent(); String id = WFUtil.getParameter(link, "id"); WFTabBar tb = (WFTabBar) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "sv"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", "headline"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", "author"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setComment", "comment"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setDescription", "description"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setSource", "source"); if (link.getId().equals(ArticleListBean.ARTICLE_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_PUBLISHED); } else { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_UNDER_REVIEW); } WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setMainCategoryId", new Integer(3)); ab.updateEditButtons(); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/CMSPage.java/clean/src/java/com/idega/block/article/CMSPage.java
WFTabBar tb = (WFTabBar) findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT);
WFTabbedPane tb = (WFTabbedPane) findComponent(MAIN_TASKBAR_ID); tb.setSelectedMenuItemId(TASK_ID_EDIT);
public void setEditMode() { WFTabBar tb = (WFTabBar) findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/CMSPage.java/clean/src/java/com/idega/block/article/CMSPage.java
WFTabBar t = e.getTaskbar();
WFTabbedPane t = e.getTaskbar();
public void tabPressed(WFTabEvent e) { WFTabBar t = e.getTaskbar(); UIComponent articleVersionBlock = t.findComponent(ArticleVersionBlock.ARTICLE_VERSION_BLOCK_ID); if (t.getSelectedButtonId().equals(ArticleBlock.TASK_ID_PREVIEW)) { articleVersionBlock.setRendered(true); } else { articleVersionBlock.setRendered(false); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/CMSPage.java/clean/src/java/com/idega/block/article/CMSPage.java
if (t.getSelectedButtonId().equals(ArticleBlock.TASK_ID_PREVIEW)) {
if (t.getSelectedMenuItemId().equals(ArticleBlock.TASK_ID_PREVIEW)) {
public void tabPressed(WFTabEvent e) { WFTabBar t = e.getTaskbar(); UIComponent articleVersionBlock = t.findComponent(ArticleVersionBlock.ARTICLE_VERSION_BLOCK_ID); if (t.getSelectedButtonId().equals(ArticleBlock.TASK_ID_PREVIEW)) { articleVersionBlock.setRendered(true); } else { articleVersionBlock.setRendered(false); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/CMSPage.java/clean/src/java/com/idega/block/article/CMSPage.java
public static BeanDefinitionHolder createBeanDefinition(String propertyName, Set patterns, String referenceType) {
public static BeanDefinitionHolder createBeanDefinition(String name, Set patterns, String referenceType) {
public static BeanDefinitionHolder createBeanDefinition(String propertyName, Set patterns, String referenceType) { RootBeanDefinition beanDefinition = new RootBeanDefinition(SingletonReference.class, 0); ConstructorArgumentValues args = beanDefinition.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, propertyName, String.class.getName()); args.addIndexedArgumentValue(1, patterns, Set.class.getName()); args.addIndexedArgumentValue(2, referenceType, String.class.getName()); return new BeanDefinitionHolder(beanDefinition, SingletonReference.class.getName()); }
52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SingletonReference.java/buggy/kernel/src/java/org/gbean/geronimo/SingletonReference.java
ConstructorArgumentValues args = beanDefinition.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, propertyName, String.class.getName()); args.addIndexedArgumentValue(1, patterns, Set.class.getName()); args.addIndexedArgumentValue(2, referenceType, String.class.getName());
MutablePropertyValues propertyValues = beanDefinition.getPropertyValues(); propertyValues.addPropertyValue("name", name); propertyValues.addPropertyValue("patterns", patterns); propertyValues.addPropertyValue("referenceType", referenceType);
public static BeanDefinitionHolder createBeanDefinition(String propertyName, Set patterns, String referenceType) { RootBeanDefinition beanDefinition = new RootBeanDefinition(SingletonReference.class, 0); ConstructorArgumentValues args = beanDefinition.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, propertyName, String.class.getName()); args.addIndexedArgumentValue(1, patterns, Set.class.getName()); args.addIndexedArgumentValue(2, referenceType, String.class.getName()); return new BeanDefinitionHolder(beanDefinition, SingletonReference.class.getName()); }
52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SingletonReference.java/buggy/kernel/src/java/org/gbean/geronimo/SingletonReference.java
Details trustedDetails = (Details) previousState[idx]; markLockedIfNecessary( iobj, trustedDetails);
secSys.markLockedIfNecessary( iobj );
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) { debug("Intercepted update."); boolean altered = false; if ( entity instanceof IObject) { IObject iobj = (IObject) entity; int idx = detailsIndex( propertyNames ); // If this instance was formerly locked, relock it regardless. Details trustedDetails = (Details) previousState[idx]; markLockedIfNecessary( iobj, trustedDetails); altered |= resetDetails( iobj, currentState, previousState, idx ); } return altered; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9c53370b3f7a88f29e38673527398c205d19f7d6/OmeroInterceptor.java/buggy/components/server/src/ome/tools/hibernate/OmeroInterceptor.java
markLockedIfNecessary( iobj, null );
secSys.markLockedIfNecessary( iobj );
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { debug("Intercepted save."); if ( entity instanceof IObject ) { IObject iobj = (IObject) entity; int idx = detailsIndex( propertyNames ); // New instances don't inherently need to be locked // as they have no trustedDetails markLockedIfNecessary( iobj, null ); // Get a new details based on the current context Details d = secSys.transientDetails( iobj ); state[idx] = d; } return true; // transferDetails ALWAYS edits the new entity. }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9c53370b3f7a88f29e38673527398c205d19f7d6/OmeroInterceptor.java/buggy/components/server/src/ome/tools/hibernate/OmeroInterceptor.java
tif.toFront();
void showAnnotationDialog(AnnotateImage requestEvent) { ImageAnnotationCtrl iac = new ImageAnnotationCtrl(this,requestEvent); activeControls.add(iac); TextAnnotationUIF tif = new TextAnnotationUIF(iac,registry); if(requestEvent.isLocationSpecified()) { Point point = requestEvent.getSpecifiedLocation(); tif.setBounds(point.x,point.y,tif.getWidth(),tif.getHeight()); } else { // TODO center on screen. } tif.show(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/be6c39ec5b6fd49ef9c5f748ff5da7c2e4b7cf9a/Annotator.java/buggy/SRC/org/openmicroscopy/shoola/agents/annotator/Annotator.java
if (userVCard.getError() != null) {
if (userVCard.getError() != null || userVCard == null) {
public void viewProfile(final String jid, final JComponent parent) { SwingWorker worker = new SwingWorker() { VCard userVCard = new VCard(); public Object construct() { userVCard = getVCard(jid); return vcard; } public void finished() { if (userVCard.getError() != null) { // Show vcard not found JOptionPane.showMessageDialog(parent, "Unable to locate a profile for " + jid, "Profile Not Found", JOptionPane.ERROR_MESSAGE); return; } else { showUserProfile(jid, userVCard, parent); } } }; worker.start(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/7645851bdaa2a933966642360f8bb4b56e708043/VCardManager.java/buggy/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java
if (userVCard.getError() != null) {
if (userVCard.getError() != null || userVCard == null) {
public void finished() { if (userVCard.getError() != null) { // Show vcard not found JOptionPane.showMessageDialog(parent, "Unable to locate a profile for " + jid, "Profile Not Found", JOptionPane.ERROR_MESSAGE); return; } else { showUserProfile(jid, userVCard, parent); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/7645851bdaa2a933966642360f8bb4b56e708043/VCardManager.java/buggy/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java
stuffContext (wc, wikiPage, user);
stuffContext (wc, wikiPage, user, pageName);
public final Template handle(WebContext wc) throws HandlerException { String pageName = null; WikiPage wikiPage = null; // who is trying to do something? WikiUser user = getUser (wc); // which action wants to respond to this request? PageAction action = _actionManager.getAction (wc, user); // use the action to determine which WikiPage // we should be dealing with if (action != null) pageName = action.getWikiPageName (_wiki, wc); if (pageName != null) wikiPage = _wiki.getPage (pageName); // stuff the webcontext with useful stuff stuffContext (wc, wikiPage, user); if (action == null) throw new HandlerException ("Unable to find a PageAction to handle" + " this request."); try { // attempt to perform the action against the page action.perform (_wiki, wc, user, wikiPage); } catch (PageAction.RedirectException re) { // action wants us to redirect somewhere else try { wc.getResponse().sendRedirect (re.getURL()); } catch (IOException ioe) { throw new HandlerException ("Cannot redirect to " + re.getURL(), ioe); } return null; } catch (Exception e) { // something bad happened while performing the action // TODO: Handle error and error template ourselves _log.error ("Could not perform action", e); throw new HandlerException (e.toString()); } // the action performed successfully, so now return // the template it wants us to use try { // determine the template name and return String templateName = action.getTemplateName(_wiki, wikiPage); return getTemplate (templateName); } catch (ResourceException re) { throw new HandlerException ("Could not get template", re); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/a24ecb46046b93185ca4901af358792a86cb2c81/WikiServlet.java/clean/wiki/src/org/tcdi/opensource/wiki/servlet/WikiServlet.java
private void stuffContext (WebContext wc, WikiPage page, WikiUser user) {
private void stuffContext (WebContext wc, WikiPage page, WikiUser user, String pageName) {
private void stuffContext (WebContext wc, WikiPage page, WikiUser user) { wc.put ("Wiki", _wiki); wc.put ("WikiUtil", WikiUtil.getInstance()); wc.put ("Renderer", _wiki.getPageRenderer()); wc.put ("Page", page); wc.put ("User", user); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/a24ecb46046b93185ca4901af358792a86cb2c81/WikiServlet.java/clean/wiki/src/org/tcdi/opensource/wiki/servlet/WikiServlet.java
wc.put ("PageName", pageName);
private void stuffContext (WebContext wc, WikiPage page, WikiUser user) { wc.put ("Wiki", _wiki); wc.put ("WikiUtil", WikiUtil.getInstance()); wc.put ("Renderer", _wiki.getPageRenderer()); wc.put ("Page", page); wc.put ("User", user); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/a24ecb46046b93185ca4901af358792a86cb2c81/WikiServlet.java/clean/wiki/src/org/tcdi/opensource/wiki/servlet/WikiServlet.java
Iterator c = img.linkedCategoryIterator();
List<Category> c_list = img.linkedCategoryList(); Iterator c = c_list.iterator();
public static Set invertCGCI(Set imagesAll) { Set cleared = new HashSet(); Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Iterator c = img.linkedCategoryIterator(); if ( ! c.hasNext() ) { hierarchies.add(img); } else { while (c.hasNext()) { Category ca = (Category) c.next(); if ( ! cleared.contains( ca )) { ca.clearImageLinks(); cleared.add( ca ); } ca.linkImage( img ); Iterator g = ca.linkedCategoryGroupIterator(); if ( ! g.hasNext() ) { hierarchies.add(ca); } else { while (g.hasNext()){ CategoryGroup cg = (CategoryGroup) g.next(); if ( ! cleared.contains( cg )) { cg.clearCategoryLinks(); cleared.add( cg ); } cg.linkCategory( ca ); hierarchies.add( cg ); } } } } } return hierarchies; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b392b9e221ea1005e6899480c0f32ea062003c59/HierarchyTransformations.java/buggy/components/server/src/ome/tools/HierarchyTransformations.java
Iterator g = ca.linkedCategoryGroupIterator();
List<CategoryGroup> cg_list = ca.linkedCategoryGroupList(); Iterator g = cg_list.iterator();
public static Set invertCGCI(Set imagesAll) { Set cleared = new HashSet(); Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Iterator c = img.linkedCategoryIterator(); if ( ! c.hasNext() ) { hierarchies.add(img); } else { while (c.hasNext()) { Category ca = (Category) c.next(); if ( ! cleared.contains( ca )) { ca.clearImageLinks(); cleared.add( ca ); } ca.linkImage( img ); Iterator g = ca.linkedCategoryGroupIterator(); if ( ! g.hasNext() ) { hierarchies.add(ca); } else { while (g.hasNext()){ CategoryGroup cg = (CategoryGroup) g.next(); if ( ! cleared.contains( cg )) { cg.clearCategoryLinks(); cleared.add( cg ); } cg.linkCategory( ca ); hierarchies.add( cg ); } } } } } return hierarchies; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b392b9e221ea1005e6899480c0f32ea062003c59/HierarchyTransformations.java/buggy/components/server/src/ome/tools/HierarchyTransformations.java
Iterator d = img.linkedDatasetIterator();
List<Dataset> d_list = img.linkedDatasetList(); Iterator d = d_list.iterator();
public static Set invertPDI(Set imagesAll) { Set cleared = new HashSet(); Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Iterator d = img.linkedDatasetIterator(); if ( ! d.hasNext() ) { hierarchies.add(img); } else { while (d.hasNext()) { Dataset ds = (Dataset) d.next(); if ( ! cleared.contains( ds )) { ds.clearImageLinks(); cleared.add( ds ); } ds.linkImage( img ); Iterator p = ds.linkedProjectIterator(); if ( ! p.hasNext() ) { hierarchies.add( ds ); } else { while (p.hasNext()) { Project prj = (Project) p.next(); if ( ! cleared.contains( p )) { prj.clearDatasetLinks(); cleared.add( prj ); } prj.linkDataset( ds ); hierarchies.add(prj); } } } } } return hierarchies; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b392b9e221ea1005e6899480c0f32ea062003c59/HierarchyTransformations.java/buggy/components/server/src/ome/tools/HierarchyTransformations.java
Iterator p = ds.linkedProjectIterator();
List<Project> p_list = ds.linkedProjectList(); Iterator p = p_list.iterator();
public static Set invertPDI(Set imagesAll) { Set cleared = new HashSet(); Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Iterator d = img.linkedDatasetIterator(); if ( ! d.hasNext() ) { hierarchies.add(img); } else { while (d.hasNext()) { Dataset ds = (Dataset) d.next(); if ( ! cleared.contains( ds )) { ds.clearImageLinks(); cleared.add( ds ); } ds.linkImage( img ); Iterator p = ds.linkedProjectIterator(); if ( ! p.hasNext() ) { hierarchies.add( ds ); } else { while (p.hasNext()) { Project prj = (Project) p.next(); if ( ! cleared.contains( p )) { prj.clearDatasetLinks(); cleared.add( prj ); } prj.linkDataset( ds ); hierarchies.add(prj); } } } } } return hierarchies; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b392b9e221ea1005e6899480c0f32ea062003c59/HierarchyTransformations.java/buggy/components/server/src/ome/tools/HierarchyTransformations.java
PixelBuffer pixbuf = new PixelBuffer(pixels);
PixelBuffer pixbuf = new PixelBuffer(getPixelsPath(pixels.getId()),pixels);
public PixelBuffer createPixelBuffer(Pixels pixels) throws IOException { PixelBuffer pixbuf = new PixelBuffer(pixels); initPixelBuffer(pixbuf); return pixbuf; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/PixelsService.java/clean/components/omeio-nio/src/ome/io/nio/PixelsService.java
return new PixelBuffer(pixels);
return new PixelBuffer(getPixelsPath(pixels.getId()),pixels);
public PixelBuffer getPixelBuffer(Pixels pixels) { return new PixelBuffer(pixels); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/PixelsService.java/clean/components/omeio-nio/src/ome/io/nio/PixelsService.java
String path = Helper.getPixelsPath(pixbuf.getId());
String path = getPixelsPath(pixbuf.getId());
private void initPixelBuffer(PixelBuffer pixbuf) throws IOException { String path = Helper.getPixelsPath(pixbuf.getId()); byte[] padding = new byte[pixbuf.getPlaneSize() - NULL_PLANE_SIZE]; FileOutputStream stream = new FileOutputStream(path); for (int z = 0; z < pixbuf.getSizeZ(); z++) { for (int c = 0; c < pixbuf.getSizeC(); c++) { for (int t = 0; t < pixbuf.getSizeT(); t++) { stream.write(nullPlane); stream.write(padding); } } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/PixelsService.java/clean/components/omeio-nio/src/ome/io/nio/PixelsService.java
fixnumClass.defineMethod("&", CallbackFactory.getMethod(RubyFixnum.class, "op_and", RubyObject.class));
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", RubyObject.class)); fixnumClass.defineMethod("to_f", CallbackFactory.getMethod(RubyFixnum.class, "to_f")); fixnumClass.defineMethod("to_s", CallbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("to_str", CallbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("hash", CallbackFactory.getMethod(RubyFixnum.class, "hash")); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod()); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod()); fixnumClass.defineMethod("<<", CallbackFactory.getMethod(RubyFixnum.class, "op_lshift", RubyObject.class)); fixnumClass.defineMethod(">>", CallbackFactory.getMethod(RubyFixnum.class, "op_rshift", RubyObject.class)); fixnumClass.defineMethod("+", CallbackFactory.getMethod(RubyFixnum.class, "op_plus", RubyObject.class)); fixnumClass.defineMethod("-", CallbackFactory.getMethod(RubyFixnum.class, "op_minus", RubyObject.class)); fixnumClass.defineMethod("*", CallbackFactory.getMethod(RubyFixnum.class, "op_mul", RubyObject.class)); fixnumClass.defineMethod("/", CallbackFactory.getMethod(RubyFixnum.class, "op_div", RubyObject.class)); fixnumClass.defineMethod("%", CallbackFactory.getMethod(RubyFixnum.class, "op_mod", RubyObject.class)); fixnumClass.defineMethod("**", CallbackFactory.getMethod(RubyFixnum.class, "op_pow", RubyObject.class)); fixnumClass.defineMethod("==", CallbackFactory.getMethod(RubyFixnum.class, "op_equal", RubyObject.class)); fixnumClass.defineMethod("<=>", CallbackFactory.getMethod(RubyFixnum.class, "op_cmp", RubyObject.class)); fixnumClass.defineMethod(">", CallbackFactory.getMethod(RubyFixnum.class, "op_gt", RubyObject.class)); fixnumClass.defineMethod(">=", CallbackFactory.getMethod(RubyFixnum.class, "op_ge", RubyObject.class)); fixnumClass.defineMethod("<", CallbackFactory.getMethod(RubyFixnum.class, "op_lt", RubyObject.class)); fixnumClass.defineMethod("<=", CallbackFactory.getMethod(RubyFixnum.class, "op_le", RubyObject.class)); fixnumClass.defineMethod("size", CallbackFactory.getMethod(RubyFixnum.class, "size")); return fixnumClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0d05f52f4b20deb7938755dd220bb81c2c2b208e/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java
if (!(oldValue.getClass().equals(newValue.getClass()))) model.setEditorSelectedPane(Editor.PROPERTIES_INDEX);
public void propertyChange(PropertyChangeEvent pce) { String name = pce.getPropertyName(); if (name == null) return; if (name.equals(TreeViewer.CANCEL_LOADING_PROPERTY)) { Browser browser = model.getSelectedBrowser(); if (browser != null) browser.cancel(); } else if (name.equals(Browser.POPUP_MENU_PROPERTY)) { Component c = (Component) pce.getNewValue(); Browser browser = model.getSelectedBrowser(); if (browser != null && c != null) view.showPopup(c, browser.getClickPoint()); } else if (name.equals(Browser.CLOSE_PROPERTY)) { Browser browser = (Browser) pce.getNewValue(); if (browser != null) view.removeBrowser(browser); } else if (name.equals(Editor.CLOSE_EDITOR_PROPERTY)) { Browser b = model.getSelectedBrowser(); TreeImageDisplay d = null; if (b != null) d = b.getLastSelectedDisplay(); int editorType = model.getEditorType(); model.removeEditor(); model.onComponentStateChange(true); if (editorType == TreeViewer.CREATE_EDITOR) resetSelectedDisplay(d); } else if (name.equals(Classifier.CLOSE_CLASSIFIER_PROPERTY)) { Browser b = model.getSelectedBrowser(); if (b != null) resetSelectedDisplay(b.getLastSelectedDisplay()); model.onComponentStateChange(true); } else if (name.equals(TreeViewer.FINDER_VISIBLE_PROPERTY)) { Boolean b = (Boolean) pce.getNewValue(); if (!b.booleanValue()) { model.clearFoundResults(); model.onComponentStateChange(true); } } else if (name.equals(TreeViewer.SELECTED_BROWSER_PROPERTY)) { Browser b = model.getSelectedBrowser(); Iterator i = model.getBrowsers().values().iterator(); Browser browser; while (i.hasNext()) { browser = (Browser) i.next(); browser.setSelected(browser.equals(b)); } } else if (name.equals(TreeViewer.THUMBNAIL_LOADING_PROPERTY)) { model.retrieveThumbnail((ImageData) pce.getNewValue()); } else if (name.equals(Browser.SELECTED_DISPLAY_PROPERTY)) { Object oldValue = pce.getOldValue(); Object newValue = pce.getNewValue(); if (oldValue != null && newValue != null) { if (!(oldValue.getClass().equals(newValue.getClass()))) model.setEditorSelectedPane(Editor.PROPERTIES_INDEX); } model.onSelectedDisplay(); view.updateMenuItems(); } else if (name.equals(TreeViewer.HIERARCHY_ROOT_PROPERTY)) { Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } else if (name.equals( AddExistingObjectsDialog.EXISTING_ADD_PROPERTY)) { model.addExistingObjects((Set) pce.getNewValue()); } else if (name.equals(EditorSaverDialog.SAVING_DATA_EDITOR_PROPERTY)) { boolean b = ((Boolean) pce.getNewValue()).booleanValue(); model.saveInEditor(b); } else if (name.equals(DataHandler.ANNOTATED_PROPERTY) || name.equals(DataHandler.CLASSIFIED_PROPERTY)) { if (view.getDataHandler() == null) return; view.discardDataHandler(); Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9794ffbd035a4de717ee211573b4844dd0eb3371/TreeViewerControl.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java
loadScript(scriptName.getValue(), new StringReader(source.getValue()), wrap);
loadScript(scriptName.toString(), new StringReader(source.toString()), wrap);
public void loadScript(RubyString scriptName, RubyString source, boolean wrap) { loadScript(scriptName.getValue(), new StringReader(source.getValue()), wrap); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/Ruby.java/buggy/src/org/jruby/Ruby.java
String name = RubyString.stringValue(args[0]).getValue();
String name = RubyString.stringValue(args[0]).toString();
public IRubyObject basename(IRubyObject[] args) { checkArgumentCount(args, 1, 2); String name = RubyString.stringValue(args[0]).getValue(); if (name.length() > 1 && name.charAt(name.length() - 1) == '/') { name = name.substring(0, name.length() - 1); } // Paths which end in "/" or "\\" must be stripped off. int slashCount = 0; int length = name.length(); for (int i = length - 1; i >= 0; i--) { char c = name.charAt(i); if (c != '/' && c != '\\') { break; } slashCount++; } if (slashCount > 0 && length > 1) { name = name.substring(0, name.length() - slashCount); } int index = name.lastIndexOf('/'); if (index == -1) { // XXX actually only on windows... index = name.lastIndexOf('\\'); } if (!name.equals("/") && index != -1) { name = name.substring(index + 1); } if (args.length == 2) { String ext = RubyString.stringValue(args[1]).getValue(); if (".*".equals(ext)) { index = name.lastIndexOf('.'); if (index != -1) { name = name.substring(0, index); } } else if (name.endsWith(ext)) { name = name.substring(0, name.length() - ext.length()); } } return getRuntime().newString(name).infectBy(args[0]); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
String ext = RubyString.stringValue(args[1]).getValue();
String ext = RubyString.stringValue(args[1]).toString();
public IRubyObject basename(IRubyObject[] args) { checkArgumentCount(args, 1, 2); String name = RubyString.stringValue(args[0]).getValue(); if (name.length() > 1 && name.charAt(name.length() - 1) == '/') { name = name.substring(0, name.length() - 1); } // Paths which end in "/" or "\\" must be stripped off. int slashCount = 0; int length = name.length(); for (int i = length - 1; i >= 0; i--) { char c = name.charAt(i); if (c != '/' && c != '\\') { break; } slashCount++; } if (slashCount > 0 && length > 1) { name = name.substring(0, name.length() - slashCount); } int index = name.lastIndexOf('/'); if (index == -1) { // XXX actually only on windows... index = name.lastIndexOf('\\'); } if (!name.equals("/") && index != -1) { name = name.substring(index + 1); } if (args.length == 2) { String ext = RubyString.stringValue(args[1]).getValue(); if (".*".equals(ext)) { index = name.lastIndexOf('.'); if (index != -1) { name = name.substring(0, index); } } else if (name.endsWith(ext)) { name = name.substring(0, name.length() - ext.length()); } } return getRuntime().newString(name).infectBy(args[0]); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
String relativePath = RubyString.stringValue(args[0]).getValue();
String relativePath = RubyString.stringValue(args[0]).toString();
public IRubyObject expand_path(IRubyObject[] args) { checkArgumentCount(args, 1, 2); String relativePath = RubyString.stringValue(args[0]).getValue(); int pathLength = relativePath.length(); if (pathLength >= 1 && relativePath.charAt(0) == '~') { // Enebo : Should ~frogger\\foo work (it doesnt in linux ruby)? int userEnd = relativePath.indexOf('/'); if (userEnd == -1) { if (pathLength == 1) { // Single '~' as whole path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue(); } else { // No directory delimeter. Rest of string is username userEnd = pathLength; } } if (userEnd == 1) { // '~/...' as path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue() + relativePath.substring(1); } else if (userEnd > 1){ // '~user/...' as path to expand String user = relativePath.substring(1, userEnd); IRubyObject dir = RubyDir.getHomeDirectoryPath(this, user); if (dir.isNil()) { throw getRuntime().newArgumentError("user " + user + " does not exist"); } relativePath = "" + dir + (pathLength == userEnd ? "" : relativePath.substring(userEnd)); } } if (new NormalizedFile(relativePath).isAbsolute()) { return getRuntime().newString(relativePath); } String cwd = getRuntime().getCurrentDirectory(); if (args.length == 2 && !args[1].isNil()) { cwd = RubyString.stringValue(args[1]).getValue(); } // Something wrong we don't know the cwd... if (cwd == null) { return getRuntime().getNil(); } NormalizedFile path = new NormalizedFile(cwd, relativePath); String extractedPath; try { extractedPath = path.getCanonicalPath(); } catch (IOException e) { extractedPath = path.getAbsolutePath(); } return getRuntime().newString(extractedPath); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
relativePath = RubyDir.getHomeDirectoryPath(this).getValue();
relativePath = RubyDir.getHomeDirectoryPath(this).toString();
public IRubyObject expand_path(IRubyObject[] args) { checkArgumentCount(args, 1, 2); String relativePath = RubyString.stringValue(args[0]).getValue(); int pathLength = relativePath.length(); if (pathLength >= 1 && relativePath.charAt(0) == '~') { // Enebo : Should ~frogger\\foo work (it doesnt in linux ruby)? int userEnd = relativePath.indexOf('/'); if (userEnd == -1) { if (pathLength == 1) { // Single '~' as whole path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue(); } else { // No directory delimeter. Rest of string is username userEnd = pathLength; } } if (userEnd == 1) { // '~/...' as path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue() + relativePath.substring(1); } else if (userEnd > 1){ // '~user/...' as path to expand String user = relativePath.substring(1, userEnd); IRubyObject dir = RubyDir.getHomeDirectoryPath(this, user); if (dir.isNil()) { throw getRuntime().newArgumentError("user " + user + " does not exist"); } relativePath = "" + dir + (pathLength == userEnd ? "" : relativePath.substring(userEnd)); } } if (new NormalizedFile(relativePath).isAbsolute()) { return getRuntime().newString(relativePath); } String cwd = getRuntime().getCurrentDirectory(); if (args.length == 2 && !args[1].isNil()) { cwd = RubyString.stringValue(args[1]).getValue(); } // Something wrong we don't know the cwd... if (cwd == null) { return getRuntime().getNil(); } NormalizedFile path = new NormalizedFile(cwd, relativePath); String extractedPath; try { extractedPath = path.getCanonicalPath(); } catch (IOException e) { extractedPath = path.getAbsolutePath(); } return getRuntime().newString(extractedPath); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
relativePath = RubyDir.getHomeDirectoryPath(this).getValue() +
relativePath = RubyDir.getHomeDirectoryPath(this).toString() +
public IRubyObject expand_path(IRubyObject[] args) { checkArgumentCount(args, 1, 2); String relativePath = RubyString.stringValue(args[0]).getValue(); int pathLength = relativePath.length(); if (pathLength >= 1 && relativePath.charAt(0) == '~') { // Enebo : Should ~frogger\\foo work (it doesnt in linux ruby)? int userEnd = relativePath.indexOf('/'); if (userEnd == -1) { if (pathLength == 1) { // Single '~' as whole path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue(); } else { // No directory delimeter. Rest of string is username userEnd = pathLength; } } if (userEnd == 1) { // '~/...' as path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue() + relativePath.substring(1); } else if (userEnd > 1){ // '~user/...' as path to expand String user = relativePath.substring(1, userEnd); IRubyObject dir = RubyDir.getHomeDirectoryPath(this, user); if (dir.isNil()) { throw getRuntime().newArgumentError("user " + user + " does not exist"); } relativePath = "" + dir + (pathLength == userEnd ? "" : relativePath.substring(userEnd)); } } if (new NormalizedFile(relativePath).isAbsolute()) { return getRuntime().newString(relativePath); } String cwd = getRuntime().getCurrentDirectory(); if (args.length == 2 && !args[1].isNil()) { cwd = RubyString.stringValue(args[1]).getValue(); } // Something wrong we don't know the cwd... if (cwd == null) { return getRuntime().getNil(); } NormalizedFile path = new NormalizedFile(cwd, relativePath); String extractedPath; try { extractedPath = path.getCanonicalPath(); } catch (IOException e) { extractedPath = path.getAbsolutePath(); } return getRuntime().newString(extractedPath); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
cwd = RubyString.stringValue(args[1]).getValue();
cwd = RubyString.stringValue(args[1]).toString();
public IRubyObject expand_path(IRubyObject[] args) { checkArgumentCount(args, 1, 2); String relativePath = RubyString.stringValue(args[0]).getValue(); int pathLength = relativePath.length(); if (pathLength >= 1 && relativePath.charAt(0) == '~') { // Enebo : Should ~frogger\\foo work (it doesnt in linux ruby)? int userEnd = relativePath.indexOf('/'); if (userEnd == -1) { if (pathLength == 1) { // Single '~' as whole path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue(); } else { // No directory delimeter. Rest of string is username userEnd = pathLength; } } if (userEnd == 1) { // '~/...' as path to expand relativePath = RubyDir.getHomeDirectoryPath(this).getValue() + relativePath.substring(1); } else if (userEnd > 1){ // '~user/...' as path to expand String user = relativePath.substring(1, userEnd); IRubyObject dir = RubyDir.getHomeDirectoryPath(this, user); if (dir.isNil()) { throw getRuntime().newArgumentError("user " + user + " does not exist"); } relativePath = "" + dir + (pathLength == userEnd ? "" : relativePath.substring(userEnd)); } } if (new NormalizedFile(relativePath).isAbsolute()) { return getRuntime().newString(relativePath); } String cwd = getRuntime().getCurrentDirectory(); if (args.length == 2 && !args[1].isNil()) { cwd = RubyString.stringValue(args[1]).getValue(); } // Something wrong we don't know the cwd... if (cwd == null) { return getRuntime().getNil(); } NormalizedFile path = new NormalizedFile(cwd, relativePath); String extractedPath; try { extractedPath = path.getCanonicalPath(); } catch (IOException e) { extractedPath = path.getAbsolutePath(); } return getRuntime().newString(extractedPath); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
return new IOModes(getRuntime(), ((RubyString)object).getValue());
return new IOModes(getRuntime(), ((RubyString)object).toString());
private IOModes getModes(IRubyObject object) { if (object instanceof RubyString) { return new IOModes(getRuntime(), ((RubyString)object).getValue()); } else if (object instanceof RubyFixnum) { return new IOModes(getRuntime(), ((RubyFixnum)object).getLongValue()); } throw getRuntime().newTypeError("Invalid type for modes"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
RubyString fixedStr = RubyString.newString(getRuntime(), MULTIPLE_DIR_SEPS.matcher(str.getValue()).replaceAll("/"));
RubyString fixedStr = RubyString.newString(getRuntime(), MULTIPLE_DIR_SEPS.matcher(str.toString()).replaceAll("/"));
public RubyString join(IRubyObject[] args) { RubyArray argArray = getRuntime().newArray(args); RubyString str = argArray.join(RubyString.newString(getRuntime(), "/")); // create ruby string, cleaning out double dir separators RubyString fixedStr = RubyString.newString(getRuntime(), MULTIPLE_DIR_SEPS.matcher(str.getValue()).replaceAll("/")); fixedStr.setTaint(str.isTaint()); return fixedStr; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
return getRuntime().newRubyFileStat(new NormalizedFile(name.getValue()));
return getRuntime().newRubyFileStat(new NormalizedFile(name.toString()));
public IRubyObject lstat(IRubyObject filename) { RubyString name = RubyString.stringValue(filename); return getRuntime().newRubyFileStat(new NormalizedFile(name.getValue())); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
return getRuntime().newFixnum(new NormalizedFile(name.getValue()).lastModified());
return getRuntime().newFixnum(new NormalizedFile(name.toString()).lastModified());
public IRubyObject mtime(IRubyObject filename) { RubyString name = RubyString.stringValue(filename); return getRuntime().newFixnum(new NormalizedFile(name.getValue()).lastModified()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
NormalizedFile oldFile = new NormalizedFile(oldNameString.getValue());
NormalizedFile oldFile = new NormalizedFile(oldNameString.toString());
public IRubyObject rename(IRubyObject oldName, IRubyObject newName) { RubyString oldNameString = RubyString.stringValue(oldName); RubyString newNameString = RubyString.stringValue(newName); oldNameString.checkSafeString(); newNameString.checkSafeString(); NormalizedFile oldFile = new NormalizedFile(oldNameString.getValue()); if (!oldFile.exists()) { throw getRuntime().newErrnoENOENTError("No such file: " + oldNameString.getValue()); } oldFile.renameTo(new NormalizedFile(newNameString.getValue())); return RubyFixnum.zero(getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
throw getRuntime().newErrnoENOENTError("No such file: " + oldNameString.getValue());
throw getRuntime().newErrnoENOENTError("No such file: " + oldNameString);
public IRubyObject rename(IRubyObject oldName, IRubyObject newName) { RubyString oldNameString = RubyString.stringValue(oldName); RubyString newNameString = RubyString.stringValue(newName); oldNameString.checkSafeString(); newNameString.checkSafeString(); NormalizedFile oldFile = new NormalizedFile(oldNameString.getValue()); if (!oldFile.exists()) { throw getRuntime().newErrnoENOENTError("No such file: " + oldNameString.getValue()); } oldFile.renameTo(new NormalizedFile(newNameString.getValue())); return RubyFixnum.zero(getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
oldFile.renameTo(new NormalizedFile(newNameString.getValue()));
oldFile.renameTo(new NormalizedFile(newNameString.toString()));
public IRubyObject rename(IRubyObject oldName, IRubyObject newName) { RubyString oldNameString = RubyString.stringValue(oldName); RubyString newNameString = RubyString.stringValue(newName); oldNameString.checkSafeString(); newNameString.checkSafeString(); NormalizedFile oldFile = new NormalizedFile(oldNameString.getValue()); if (!oldFile.exists()) { throw getRuntime().newErrnoENOENTError("No such file: " + oldNameString.getValue()); } oldFile.renameTo(new NormalizedFile(newNameString.getValue())); return RubyFixnum.zero(getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
NormalizedFile lToDelete = new NormalizedFile(filename.getValue());
NormalizedFile lToDelete = new NormalizedFile(filename.toString());
public IRubyObject unlink(IRubyObject[] args) { for (int i = 0; i < args.length; i++) { RubyString filename = RubyString.stringValue(args[i]); filename.checkSafeString(); NormalizedFile lToDelete = new NormalizedFile(filename.getValue()); if (!lToDelete.exists()) { throw getRuntime().newErrnoENOENTError(" No such file or directory - \"" + filename.getValue() + "\""); } if (!lToDelete.delete()) { return getRuntime().getFalse(); } } return getRuntime().newFixnum(args.length); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
throw getRuntime().newErrnoENOENTError(" No such file or directory - \"" + filename.getValue() + "\"");
throw getRuntime().newErrnoENOENTError(" No such file or directory - \"" + filename + "\"");
public IRubyObject unlink(IRubyObject[] args) { for (int i = 0; i < args.length; i++) { RubyString filename = RubyString.stringValue(args[i]); filename.checkSafeString(); NormalizedFile lToDelete = new NormalizedFile(filename.getValue()); if (!lToDelete.exists()) { throw getRuntime().newErrnoENOENTError(" No such file or directory - \"" + filename.getValue() + "\""); } if (!lToDelete.delete()) { return getRuntime().getFalse(); } } return getRuntime().newFixnum(args.length); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
NormalizedFile fileToTouch = new NormalizedFile(filename.getValue());
NormalizedFile fileToTouch = new NormalizedFile(filename.toString());
public IRubyObject utime(IRubyObject[] args) { checkArgumentCount(args, 2, -1); // Ignore access_time argument since Java does not support it. long mtime; if (args[1] instanceof RubyTime) { mtime = ((RubyTime) args[1]).getJavaDate().getTime(); } else if (args[1] instanceof RubyNumeric) { mtime = RubyNumeric.num2long(args[1]); } else { mtime = 0; } for (int i = 2, j = args.length; i < j; i++) { RubyString filename = RubyString.stringValue(args[i]); filename.checkSafeString(); NormalizedFile fileToTouch = new NormalizedFile(filename.getValue()); if (!fileToTouch.exists()) { throw getRuntime().newErrnoENOENTError(" No such file or directory - \"" + filename.getValue() + "\""); } fileToTouch.setLastModified(mtime); } return getRuntime().newFixnum(args.length - 2); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
filename.getValue() + "\"");
filename + "\"");
public IRubyObject utime(IRubyObject[] args) { checkArgumentCount(args, 2, -1); // Ignore access_time argument since Java does not support it. long mtime; if (args[1] instanceof RubyTime) { mtime = ((RubyTime) args[1]).getJavaDate().getTime(); } else if (args[1] instanceof RubyNumeric) { mtime = RubyNumeric.num2long(args[1]); } else { mtime = 0; } for (int i = 2, j = args.length; i < j; i++) { RubyString filename = RubyString.stringValue(args[i]); filename.checkSafeString(); NormalizedFile fileToTouch = new NormalizedFile(filename.getValue()); if (!fileToTouch.exists()) { throw getRuntime().newErrnoENOENTError(" No such file or directory - \"" + filename.getValue() + "\""); } fileToTouch.setLastModified(mtime); } return getRuntime().newFixnum(args.length - 2); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
public static RubyString getHomeDirectoryPath(IRubyObject recv) { RubyHash hash = (RubyHash) recv.getRuntime().getObject().getConstant("ENV"); IRubyObject home = hash.aref(recv.getRuntime().newString("HOME")); if (home == null || home.isNil()) { home = hash.aref(recv.getRuntime().newString("LOGDIR")); } if (home == null || home.isNil()) { throw recv.getRuntime().newArgumentError("HOME/LOGDIR not set"); } return (RubyString) home;
public static IRubyObject getHomeDirectoryPath(IRubyObject recv, String user) { return recv.getRuntime().evalScript("File.open('/etc/passwd') do |f| f.readlines.each do" + "|l| f = l.split(':'); return f[5] if f[0] == '" + user + "'; end; end; nil");
public static RubyString getHomeDirectoryPath(IRubyObject recv) { RubyHash hash = (RubyHash) recv.getRuntime().getObject().getConstant("ENV"); IRubyObject home = hash.aref(recv.getRuntime().newString("HOME")); if (home == null || home.isNil()) { home = hash.aref(recv.getRuntime().newString("LOGDIR")); } if (home == null || home.isNil()) { throw recv.getRuntime().newArgumentError("HOME/LOGDIR not set"); } return (RubyString) home; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/295cdd11472f7ae4b0426336dc7cdcabe946fdc1/RubyDir.java/buggy/src/org/jruby/RubyDir.java
RubyString string = (RubyString) args[1]; RubyException excptn = RubyException.newException(runtime, (RubyClass)args[0], string.getValue());
string = (RubyString) args[1]; excptn = RubyException.newException(runtime, (RubyClass)args[0], string.getValue()); throw new RaiseException(excptn); case 3: if (args[0] == runtime.getClasses().getExceptionClass()) { throw new RaiseException((RubyException) args[0].callMethod("exception", args[1])); } string = (RubyString) args[1]; excptn = RubyException.newException(runtime, (RubyClass)args[0], string.getValue()); excptn.set_backtrace(args[2]);
public static IRubyObject raise(IRubyObject recv, IRubyObject[] args) { // FIXME special case in ruby // recv.checkArgumentCount(args, 0, 2); Ruby runtime = recv.getRuntime(); switch (args.length) { case 0 : IRubyObject defaultException = runtime.getGlobalVariables().get("$!"); if (defaultException.isNil()) { throw new RaiseException(runtime, runtime.getExceptions().getRuntimeError(), "", false); } throw new RaiseException((RubyException) defaultException); case 1 : if (args[0] instanceof RubyException) { throw new RaiseException((RubyException) args[0]); } throw new RaiseException(RubyException.newInstance(runtime.getExceptions().getRuntimeError(), args)); case 2 : if (args[0] == runtime.getClasses().getExceptionClass()) { throw new RaiseException((RubyException) args[0].callMethod("exception", args[1])); } RubyString string = (RubyString) args[1]; RubyException excptn = RubyException.newException(runtime, (RubyClass)args[0], string.getValue()); throw new RaiseException(excptn); default : throw new ArgumentError(runtime, "wrong number of arguments"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12416797c2bfe7a2abf102c5d0998e2e09f9e691/RubyKernel.java/clean/src/org/jruby/RubyKernel.java
runtime.defineVariable(new StringGlobalVariable(runtime, "$KCODE", runtime.newString("UTF8")));
public static void createGlobals(Ruby runtime) { // Version information: IRubyObject version = runtime.newString(Constants.RUBY_VERSION).freeze(); IRubyObject release = runtime.newString(Constants.COMPILE_DATE).freeze(); IRubyObject platform = runtime.newString(Constants.PLATFORM).freeze(); runtime.defineGlobalConstant("RUBY_VERSION", version); runtime.defineGlobalConstant("RUBY_RELEASE_DATE", release); runtime.defineGlobalConstant("RUBY_PLATFORM", platform); runtime.defineGlobalConstant("VERSION", version); runtime.defineGlobalConstant("RELEASE_DATE", release); runtime.defineGlobalConstant("PLATFORM", platform); runtime.defineVariable(new StringGlobalVariable(runtime, "$/", runtime.newString("\n"))); runtime.defineVariable(new StringGlobalVariable(runtime, "$\\", runtime.getNil())); runtime.defineVariable(new StringGlobalVariable(runtime, "$,", runtime.getNil())); runtime.defineVariable(new LineNumberGlobalVariable(runtime, "$.", RubyFixnum.one(runtime))); runtime.defineVariable(new LastlineGlobalVariable(runtime, "$_")); runtime.defineVariable(new ErrorInfoGlobalVariable(runtime, "$!", runtime.getNil())); runtime.defineVariable(new SafeGlobalVariable(runtime, "$SAFE")); runtime.defineVariable(new BacktraceGlobalVariable(runtime, "$@")); IRubyObject stdin = RubyIO.fdOpen(runtime, RubyIO.STDIN); IRubyObject stdout = RubyIO.fdOpen(runtime, RubyIO.STDOUT); IRubyObject stderr = RubyIO.fdOpen(runtime, RubyIO.STDERR); runtime.defineVariable(new InputGlobalVariable(runtime, "$stdin", stdin)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$stdout", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$stderr", stderr)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$>", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$defout", stdout)); runtime.defineVariable(new OutputGlobalVariable(runtime, "$deferr", stderr)); runtime.defineGlobalConstant("STDIN", stdin); runtime.defineGlobalConstant("STDOUT", stdout); runtime.defineGlobalConstant("STDERR", stderr); runtime.defineVariable(new LoadedFeatures(runtime, "$\"")); runtime.defineVariable(new LoadPath(runtime, "$:")); runtime.defineVariable(new LoadPath(runtime, "$-I")); runtime.defineVariable(new LoadPath(runtime, "$LOAD_PATH")); // ARGF, $< object RubyArgsFile argsFile = new RubyArgsFile(runtime); argsFile.initArgsFile(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/312172d22abc380ccb723b1458f5effeddfc51fa/RubyGlobal.java/clean/src/org/jruby/RubyGlobal.java
ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder(new File("/Test/article/")).toArray(new ArticleItemBean[0]);
ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]);
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder(new File("/Test/article/")).toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/72fe15183822be99f6dfa9d697bce89864c5f7d8/ListArticlesBean.java/buggy/src/java/com/idega/block/article/bean/ListArticlesBean.java
catch (XMPPException e) { return;
catch (Exception e) {
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (XMPPException e) { return; } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/06a8365c61222dcafb7753ee86fd2c12dc1fb6df/ConferenceRooms.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRooms.java
public Project(Integer projectId, String view, String name, String description, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set datasets) { this.projectId = projectId; this.view = view; this.name = name; this.description = description; this.group = group; this.experimenter = experimenter; this.datasets = datasets;
public Project() {
public Project(Integer projectId, String view, String name, String description, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set datasets) { this.projectId = projectId; this.view = view; this.name = name; this.description = description; this.group = group; this.experimenter = experimenter; this.datasets = datasets; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Project.java/clean/components/common/src/org/openmicroscopy/omero/model/Project.java
public org.openmicroscopy.omero.model.Experimenter getExperimenter() {
public Experimenter getExperimenter() {
public org.openmicroscopy.omero.model.Experimenter getExperimenter() { return this.experimenter; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Project.java/clean/components/common/src/org/openmicroscopy/omero/model/Project.java
public org.openmicroscopy.omero.model.Group getGroup() {
public Group getGroup() {
public org.openmicroscopy.omero.model.Group getGroup() { return this.group; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Project.java/clean/components/common/src/org/openmicroscopy/omero/model/Project.java
public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) {
public void setExperimenter(Experimenter experimenter) {
public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) { this.experimenter = experimenter; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Project.java/clean/components/common/src/org/openmicroscopy/omero/model/Project.java
public void setGroup(org.openmicroscopy.omero.model.Group group) {
public void setGroup(Group group) {
public void setGroup(org.openmicroscopy.omero.model.Group group) { this.group = group; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Project.java/clean/components/common/src/org/openmicroscopy/omero/model/Project.java
System.err.println(absoluteLocation);
public void respondMouseClick(PInputEvent event) { Point2D pos = event.getPositionRelativeTo(this); if(prevImageShape != null) { if(prevImageShape.contains(pos)) { parentThumbnail.showPreviousImage(); setImage(thumbnailImages[parentThumbnail.getMultipleImageIndex()]); setBounds(border); repaint(); return; } } if(nextImageShape != null) { if(nextImageShape.contains(pos)) { parentThumbnail.showNextImage(); setImage(thumbnailImages[parentThumbnail.getMultipleImageIndex()]); setBounds(border); repaint(); return; } } if(openIconShape != null) { if(openIconShape.contains(pos)) { BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); agent.loadImage(parentThumbnail); return; } } if(closeIconShape != null) { if(closeIconShape.contains(pos)) { getParent().removeChild(this); } } if(annotateIconShape != null) { if(annotateIconShape.contains(pos)) { PiccoloAction action = PiccoloActionFactory.getAnnotateImageAction(parentThumbnail, absoluteLocation); System.err.println(absoluteLocation); action.execute(); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/28e98417641b00a2e12a791f10f204dc4562dec1/SemanticZoomNode.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/SemanticZoomNode.java
if (iVisited.getArgsNode() == null) { result = null; }
public void visitYieldNode(YieldNode iVisited) { eval(iVisited.getArgsNode()); result = threadContext.yield(result, null, null, false, iVisited.getCheckState()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e868362278466196d97116a61006e44bf1ac3742/EvaluateVisitor.java/buggy/src/org/jruby/evaluator/EvaluateVisitor.java
ruby.setGlobalVar("$*", RubyArray.newArray(ruby));
public static Ruby getDefaultInstance(Class regexpAdapterClass) { Ruby ruby = new Ruby(); ruby.setRegexpAdapterClass(regexpAdapterClass); ruby.init(); return ruby; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/Ruby.java/clean/org/jruby/Ruby.java
String msg = "Wrong number of arguments for method '" + ruby.getRubyFrame().getLastFunc() + "' in class " + getRubyClass().toName() + ". " + args.length + " is not in Range " + min + ".." + max; throw new RubyArgumentException(getRuby(), msg);
throw new RubyArgumentException(getRuby(), "Wrong # of arguments for method. " + args.length + " is not in Range " + min + ".." + max);
protected int argCount(RubyObject[] args, int min, int max) { int len = args.length; if (len < min || (max > -1 && len > max)) { String msg = "Wrong number of arguments for method '" + ruby.getRubyFrame().getLastFunc() + "' in class " + getRubyClass().toName() + ". " + args.length + " is not in Range " + min + ".." + max; throw new RubyArgumentException(getRuby(), msg); } return len; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyObject.java/buggy/org/jruby/RubyObject.java
public RubyObject callSuper(RubyObject[] args) { if (ruby.getRubyFrame().getLastClass() == null) { throw new NameError(ruby, "superclass method '" + ruby.getRubyFrame().getLastFunc() + "' must be enabled by enableSuper()."); } ruby.getIter().push(); RubyObject result = ruby.getNil(); try { result = ruby.getRubyFrame().getLastClass().getSuperClass().call(ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3); } finally { ruby.getIter().pop(); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
public RubyObject callSuper(RubyObject[] args) { if (ruby.getRubyFrame().getLastClass() == null) { throw new NameError(ruby, "superclass method '" + ruby.getRubyFrame().getLastFunc() + "' must be enabled by enableSuper()."); } ruby.getIter().push(); RubyObject result = ruby.getNil(); try { result = ruby.getRubyFrame().getLastClass().getSuperClass().call(ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3); } finally { ruby.getIter().pop(); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
public RubyObject callSuper(RubyObject[] args) { if (ruby.getRubyFrame().getLastClass() == null) { throw new NameError(ruby, "superclass method '" + ruby.getRubyFrame().getLastFunc() + "' must be enabled by enableSuper()."); } ruby.getIter().push(); RubyObject result = ruby.getNil(); try { result = ruby.getRubyFrame().getLastClass().getSuperClass().call(ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3); } finally { ruby.getIter().pop(); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
result = ruby.getRubyFrame().getLastClass().getSuperClass().call(ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3);
result = ruby.getRubyFrame().getLastClass().getSuperClass().call( ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3);
public RubyObject callSuper(RubyObject[] args) { if (ruby.getRubyFrame().getLastClass() == null) { throw new NameError(ruby, "superclass method '" + ruby.getRubyFrame().getLastFunc() + "' must be enabled by enableSuper()."); } ruby.getIter().push(); RubyObject result = ruby.getNil(); try { result = ruby.getRubyFrame().getLastClass().getSuperClass().call(ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3); } finally { ruby.getIter().pop(); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
ruby.getIter().pop();
ruby.getIter().pop();
public RubyObject callSuper(RubyObject[] args) { if (ruby.getRubyFrame().getLastClass() == null) { throw new NameError(ruby, "superclass method '" + ruby.getRubyFrame().getLastFunc() + "' must be enabled by enableSuper()."); } ruby.getIter().push(); RubyObject result = ruby.getNil(); try { result = ruby.getRubyFrame().getLastClass().getSuperClass().call(ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3); } finally { ruby.getIter().pop(); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
public RubyObject callSuper(RubyObject[] args) { if (ruby.getRubyFrame().getLastClass() == null) { throw new NameError(ruby, "superclass method '" + ruby.getRubyFrame().getLastFunc() + "' must be enabled by enableSuper()."); } ruby.getIter().push(); RubyObject result = ruby.getNil(); try { result = ruby.getRubyFrame().getLastClass().getSuperClass().call(ruby.getRubyFrame().getSelf(), ruby.getRubyFrame().getLastFunc(), new RubyPointer(args), 3); } finally { ruby.getIter().pop(); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
return errorStream != null ? errorStream : System.err; }
return new PrintStream(((RubyIO) ruby.getGlobalVar("$stderr")).getOutStream()); }
public PrintStream getErrorStream() { return errorStream != null ? errorStream : System.err; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
return inputStream != null ? inputStream : System.in; }
return ((RubyIO) ruby.getGlobalVar("$stdin")).getInStream(); }
public InputStream getInputStream() { return inputStream != null ? inputStream : System.in; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
return outputStream != null ? outputStream : System.out; }
return new PrintStream(((RubyIO) ruby.getGlobalVar("$stdout")).getOutStream()); }
public PrintStream getOutputStream() { return outputStream != null ? outputStream : System.out; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
return printBugs; }
return printBugs; }
public boolean getPrintBugs() { return printBugs; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
if (iFile == null) { throw new RuntimeException("No such file to load"); }
if (iFile == null) { throw new RuntimeException("No such file to load"); }
public void loadFile(File iFile, boolean wrap) { if (iFile == null) { throw new RuntimeException("No such file to load"); } try { StringBuffer source = new StringBuffer((int) iFile.length()); BufferedReader br = new BufferedReader(new FileReader(iFile)); String line; while ((line = br.readLine()) != null) { source.append(line).append('\n'); } br.close(); loadScript(new RubyString(ruby, iFile.getPath()), new RubyString(ruby, source.toString()), wrap); } catch (IOException ioExcptn) { getErrorStream().println("Cannot read Rubyfile: \"" + iFile.getPath() + "\""); getErrorStream().println("IOEception: " + ioExcptn.getMessage()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
try { StringBuffer source = new StringBuffer((int) iFile.length()); BufferedReader br = new BufferedReader(new FileReader(iFile)); String line; while ((line = br.readLine()) != null) { source.append(line).append('\n'); } br.close();
try { StringBuffer source = new StringBuffer((int) iFile.length()); BufferedReader br = new BufferedReader(new FileReader(iFile)); String line; while ((line = br.readLine()) != null) { source.append(line).append('\n'); } br.close();
public void loadFile(File iFile, boolean wrap) { if (iFile == null) { throw new RuntimeException("No such file to load"); } try { StringBuffer source = new StringBuffer((int) iFile.length()); BufferedReader br = new BufferedReader(new FileReader(iFile)); String line; while ((line = br.readLine()) != null) { source.append(line).append('\n'); } br.close(); loadScript(new RubyString(ruby, iFile.getPath()), new RubyString(ruby, source.toString()), wrap); } catch (IOException ioExcptn) { getErrorStream().println("Cannot read Rubyfile: \"" + iFile.getPath() + "\""); getErrorStream().println("IOEception: " + ioExcptn.getMessage()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
loadScript(new RubyString(ruby, iFile.getPath()), new RubyString(ruby, source.toString()), wrap);
loadScript(new RubyString(ruby, iFile.getPath()), new RubyString(ruby, source.toString()), wrap);
public void loadFile(File iFile, boolean wrap) { if (iFile == null) { throw new RuntimeException("No such file to load"); } try { StringBuffer source = new StringBuffer((int) iFile.length()); BufferedReader br = new BufferedReader(new FileReader(iFile)); String line; while ((line = br.readLine()) != null) { source.append(line).append('\n'); } br.close(); loadScript(new RubyString(ruby, iFile.getPath()), new RubyString(ruby, source.toString()), wrap); } catch (IOException ioExcptn) { getErrorStream().println("Cannot read Rubyfile: \"" + iFile.getPath() + "\""); getErrorStream().println("IOEception: " + ioExcptn.getMessage()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
} catch (IOException ioExcptn) { getErrorStream().println("Cannot read Rubyfile: \"" + iFile.getPath() + "\""); getErrorStream().println("IOEception: " + ioExcptn.getMessage()); } }
} catch (IOException ioExcptn) { getErrorStream().println("Cannot read Rubyfile: \"" + iFile.getPath() + "\""); getErrorStream().println("IOEception: " + ioExcptn.getMessage()); } }
public void loadFile(File iFile, boolean wrap) { if (iFile == null) { throw new RuntimeException("No such file to load"); } try { StringBuffer source = new StringBuffer((int) iFile.length()); BufferedReader br = new BufferedReader(new FileReader(iFile)); String line; while ((line = br.readLine()) != null) { source.append(line).append('\n'); } br.close(); loadScript(new RubyString(ruby, iFile.getPath()), new RubyString(ruby, source.toString()), wrap); } catch (IOException ioExcptn) { getErrorStream().println("Cannot read Rubyfile: \"" + iFile.getPath() + "\""); getErrorStream().println("IOEception: " + ioExcptn.getMessage()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
public void loadScript(RubyString scriptName, RubyString source, boolean wrap) { RubyObject self = ruby.getRubyTopSelf(); CRefNode savedCRef = ruby.getCRef(); // TMP_PROTECT; if (wrap && ruby.getSafeLevel() >= 4) { // Check_Type(fname, T_STRING); } else { // Check_SafeStr(fname); } // volatile ID last_func; // ruby_errinfo = Qnil; /* ensure */ RubyVarmap.push(ruby); ruby.pushClass(); RubyModule wrapper = ruby.getWrapper(); ruby.setCRef(ruby.getTopCRef()); if (!wrap) { ruby.secure(4); /* should alter global state */ ruby.setRubyClass(ruby.getClasses().getObjectClass()); ruby.setWrapper(null); } else { /* load in anonymous module as toplevel */ ruby.setWrapper(RubyModule.newModule(ruby)); ruby.setRubyClass(ruby.getWrapper()); self = ruby.getRubyTopSelf().rbClone(); self.extendObject(ruby.getRubyClass()); ruby.getCRef().push(ruby.getWrapper()); } ruby.getRubyFrame().push(); ruby.getRubyFrame().setLastFunc(null); ruby.getRubyFrame().setLastClass(null); ruby.getRubyFrame().setSelf(self); ruby.getRubyFrame().setCbase(new CRefNode(ruby.getRubyClass(), null)); ruby.getScope().push(); /* default visibility is private at loading toplevel */ ruby.setActMethodScope(Constants.SCOPE_PRIVATE); String last_func = ruby.getRubyFrame().getLastFunc(); try { // RubyId last_func = ruby.getRubyFrame().getLastFunc(); // DEFER_INTS; ruby.setInEval(ruby.getInEval() + 1); ruby.getRubyParser().compileString(scriptName.getValue(), source, 0); // --- ruby.setInEval(ruby.getInEval() - 1); self.evalNode(ruby.getParserHelper().getEvalTree()); } finally { ruby.getRubyFrame().setLastFunc(last_func); /*if (ruby.getRubyScope().getFlags() == SCOPE_ALLOCA && ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { if (ruby_scope->local_tbl) free(ruby_scope->local_tbl); }*/ ruby.setCRef(savedCRef); ruby.getScope().pop(); ruby.getRubyFrame().pop(); ruby.popClass(); RubyVarmap.pop(ruby); ruby.setWrapper(wrapper); } /*if (ruby_nerrs > 0) { ruby_nerrs = 0; rb_exc_raise(ruby_errinfo); }*/ }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
} finally {
} finally {
public void loadScript(RubyString scriptName, RubyString source, boolean wrap) { RubyObject self = ruby.getRubyTopSelf(); CRefNode savedCRef = ruby.getCRef(); // TMP_PROTECT; if (wrap && ruby.getSafeLevel() >= 4) { // Check_Type(fname, T_STRING); } else { // Check_SafeStr(fname); } // volatile ID last_func; // ruby_errinfo = Qnil; /* ensure */ RubyVarmap.push(ruby); ruby.pushClass(); RubyModule wrapper = ruby.getWrapper(); ruby.setCRef(ruby.getTopCRef()); if (!wrap) { ruby.secure(4); /* should alter global state */ ruby.setRubyClass(ruby.getClasses().getObjectClass()); ruby.setWrapper(null); } else { /* load in anonymous module as toplevel */ ruby.setWrapper(RubyModule.newModule(ruby)); ruby.setRubyClass(ruby.getWrapper()); self = ruby.getRubyTopSelf().rbClone(); self.extendObject(ruby.getRubyClass()); ruby.getCRef().push(ruby.getWrapper()); } ruby.getRubyFrame().push(); ruby.getRubyFrame().setLastFunc(null); ruby.getRubyFrame().setLastClass(null); ruby.getRubyFrame().setSelf(self); ruby.getRubyFrame().setCbase(new CRefNode(ruby.getRubyClass(), null)); ruby.getScope().push(); /* default visibility is private at loading toplevel */ ruby.setActMethodScope(Constants.SCOPE_PRIVATE); String last_func = ruby.getRubyFrame().getLastFunc(); try { // RubyId last_func = ruby.getRubyFrame().getLastFunc(); // DEFER_INTS; ruby.setInEval(ruby.getInEval() + 1); ruby.getRubyParser().compileString(scriptName.getValue(), source, 0); // --- ruby.setInEval(ruby.getInEval() - 1); self.evalNode(ruby.getParserHelper().getEvalTree()); } finally { ruby.getRubyFrame().setLastFunc(last_func); /*if (ruby.getRubyScope().getFlags() == SCOPE_ALLOCA && ruby.getRubyClass() == ruby.getClasses().getObjectClass()) { if (ruby_scope->local_tbl) free(ruby_scope->local_tbl); }*/ ruby.setCRef(savedCRef); ruby.getScope().pop(); ruby.getRubyFrame().pop(); ruby.popClass(); RubyVarmap.pop(ruby); ruby.setWrapper(wrapper); } /*if (ruby_nerrs > 0) { ruby_nerrs = 0; rb_exc_raise(ruby_errinfo); }*/ }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
if (excp == null || excp.isNil()) { return; } RubyArray backtrace = (RubyArray)excp.funcall("backtrace"); if (backtrace.isNil()) { if (ruby.getSourceFile() != null) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); } else { getErrorStream().print(ruby.getSourceLine()); } } else if (backtrace.getLength() == 0){ printErrorPos(); } else { RubyObject mesg = backtrace.entry(0); if (mesg.isNil()) { printErrorPos(); } else { getErrorStream().print(mesg); } } RubyClass type = excp.getRubyClass(); String info = excp.toString();
if (excp == null || excp.isNil()) { return; }
public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } RubyArray backtrace = (RubyArray)excp.funcall("backtrace"); if (backtrace.isNil()) { if (ruby.getSourceFile() != null) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); } else { getErrorStream().print(ruby.getSourceLine()); } } else if (backtrace.getLength() == 0){ printErrorPos(); } else { RubyObject mesg = backtrace.entry(0); if (mesg.isNil()) { printErrorPos(); } else { getErrorStream().print(mesg); } } RubyClass type = excp.getRubyClass(); String info = excp.toString(); if (type == ruby.getExceptions().getRuntimeError() && info.length() == 0) { getErrorStream().print(": unhandled exception\n"); } else { String path = type.getClassPath().toString(); if (info.length() == 0) { getErrorStream().print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } getErrorStream().print(": " + info); if (path != null) { getErrorStream().print(" (" + path + ")\n"); } if (tail != null) { getErrorStream().print(tail + '\n'); } } } if (!backtrace.isNil()) { RubyObject[] elements = backtrace.toJavaArray(); for (int i = 0; i < elements.length; i++) { if (elements[i] instanceof RubyString) { getErrorStream().print("\tfrom " + elements[i] + '\n'); } if (i == TRACE_HEAD && elements.length > TRACE_MAX) { getErrorStream().print("\t ... " + (elements.length - TRACE_HEAD - TRACE_TAIL) + "levels...\n"); i = elements.length - TRACE_TAIL; } } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
if (type == ruby.getExceptions().getRuntimeError() && info.length() == 0) { getErrorStream().print(": unhandled exception\n"); } else { String path = type.getClassPath().toString(); if (info.length() == 0) { getErrorStream().print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } getErrorStream().print(": " + info); if (path != null) { getErrorStream().print(" (" + path + ")\n"); } if (tail != null) { getErrorStream().print(tail + '\n'); } } } if (!backtrace.isNil()) { RubyObject[] elements = backtrace.toJavaArray(); for (int i = 0; i < elements.length; i++) { if (elements[i] instanceof RubyString) { getErrorStream().print("\tfrom " + elements[i] + '\n'); } if (i == TRACE_HEAD && elements.length > TRACE_MAX) { getErrorStream().print("\t ... " + (elements.length - TRACE_HEAD - TRACE_TAIL) + "levels...\n"); i = elements.length - TRACE_TAIL; } } } }
RubyArray backtrace = (RubyArray) excp.funcall("backtrace"); if (backtrace.isNil()) { if (ruby.getSourceFile() != null) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); } else { getErrorStream().print(ruby.getSourceLine()); } } else if (backtrace.getLength() == 0) { printErrorPos(); } else { RubyObject mesg = backtrace.entry(0); if (mesg.isNil()) { printErrorPos(); } else { getErrorStream().print(mesg); } } RubyClass type = excp.getRubyClass(); String info = excp.toString(); if (type == ruby.getExceptions().getRuntimeError() && info.length() == 0) { getErrorStream().print(": unhandled exception\n"); } else { String path = type.getClassPath().toString(); if (info.length() == 0) { getErrorStream().print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } getErrorStream().print(": " + info); if (path != null) { getErrorStream().print(" (" + path + ")\n"); } if (tail != null) { getErrorStream().print(tail + '\n'); } } } if (!backtrace.isNil()) { RubyObject[] elements = backtrace.toJavaArray(); for (int i = 0; i < elements.length; i++) { if (elements[i] instanceof RubyString) { getErrorStream().print("\tfrom " + elements[i] + '\n'); } if (i == TRACE_HEAD && elements.length > TRACE_MAX) { getErrorStream().print("\t ... " + (elements.length - TRACE_HEAD - TRACE_TAIL) + "levels...\n"); i = elements.length - TRACE_TAIL; } } } }
public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } RubyArray backtrace = (RubyArray)excp.funcall("backtrace"); if (backtrace.isNil()) { if (ruby.getSourceFile() != null) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); } else { getErrorStream().print(ruby.getSourceLine()); } } else if (backtrace.getLength() == 0){ printErrorPos(); } else { RubyObject mesg = backtrace.entry(0); if (mesg.isNil()) { printErrorPos(); } else { getErrorStream().print(mesg); } } RubyClass type = excp.getRubyClass(); String info = excp.toString(); if (type == ruby.getExceptions().getRuntimeError() && info.length() == 0) { getErrorStream().print(": unhandled exception\n"); } else { String path = type.getClassPath().toString(); if (info.length() == 0) { getErrorStream().print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } getErrorStream().print(": " + info); if (path != null) { getErrorStream().print(" (" + path + ")\n"); } if (tail != null) { getErrorStream().print(tail + '\n'); } } } if (!backtrace.isNil()) { RubyObject[] elements = backtrace.toJavaArray(); for (int i = 0; i < elements.length; i++) { if (elements[i] instanceof RubyString) { getErrorStream().print("\tfrom " + elements[i] + '\n'); } if (i == TRACE_HEAD && elements.length > TRACE_MAX) { getErrorStream().print("\t ... " + (elements.length - TRACE_HEAD - TRACE_TAIL) + "levels...\n"); i = elements.length - TRACE_TAIL; } } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
if (ruby.getSourceFile() != null) { if (ruby.getRubyFrame().getLastFunc() != null) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); getErrorStream().print(":in '" + ruby.getRubyFrame().getLastFunc() + '\''); } else if (ruby.getSourceLine() != 0) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); } else { getErrorStream().print(ruby.getSourceFile()); } } }
if (ruby.getSourceFile() != null) { if (ruby.getRubyFrame().getLastFunc() != null) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); getErrorStream().print(":in '" + ruby.getRubyFrame().getLastFunc() + '\''); } else if (ruby.getSourceLine() != 0) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); } else { getErrorStream().print(ruby.getSourceFile()); } } }
private void printErrorPos() { if (ruby.getSourceFile() != null) { if (ruby.getRubyFrame().getLastFunc() != null) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); getErrorStream().print(":in '" + ruby.getRubyFrame().getLastFunc() + '\''); } else if (ruby.getSourceLine() != 0) { getErrorStream().print(ruby.getSourceFile() + ':' + ruby.getSourceLine()); } else { getErrorStream().print(ruby.getSourceFile()); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
public void setErrorStream(PrintStream errorStream) { this.errorStream = errorStream; }
public void setErrorStream(PrintStream errStream) { ruby.setGlobalVar("$stderr", RubyIO.stderr(ruby, ruby.getClasses().getIoClass(), errStream)); }
public void setErrorStream(PrintStream errorStream) { this.errorStream = errorStream; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
public void setInputStream(InputStream inputStream) { this.inputStream = inputStream; }
public void setInputStream(InputStream inStream) { ruby.setGlobalVar("$stdin", RubyIO.stdin(ruby, ruby.getClasses().getIoClass(), inStream)); }
public void setInputStream(InputStream inputStream) { this.inputStream = inputStream; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
public void setOutputStream(PrintStream outputStream) { this.outputStream = outputStream; }
public void setOutputStream(PrintStream outStream) { RubyObject stdout = RubyIO.stdout(ruby, ruby.getClasses().getIoClass(), outStream); if (ruby.getGlobalVar("$stdout") == ruby.getGlobalVar("$>")) { ruby.setGlobalVar("$>", stdout); } ruby.setGlobalVar("$stdout", stdout); }
public void setOutputStream(PrintStream outputStream) { this.outputStream = outputStream; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
this.printBugs = printBugs; }
this.printBugs = printBugs; }
public void setPrintBugs(boolean printBugs) { this.printBugs = printBugs; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyRuntime.java/clean/org/jruby/runtime/RubyRuntime.java
viewHistoryAction.putValue(Action.NAME, Res.getString("menuitem.view.contact.history "));
viewHistoryAction.putValue(Action.NAME, Res.getString("menuitem.view.contact.history"));
public void initialize() { SparkManager.getChatManager().addChatRoomListener(this); final ContactList contactList = SparkManager.getWorkspace().getContactList(); final Action viewHistoryAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { ContactItem item = (ContactItem)contactList.getSelectedUsers().iterator().next(); final String jid = item.getFullJID(); showHistory(jid); } }; viewHistoryAction.putValue(Action.NAME, Res.getString("menuitem.view.contact.history ")); viewHistoryAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.HISTORY_16x16)); contactList.addContextMenuListener(new ContextMenuListener() { public void poppingUp(Object object, JPopupMenu popup) { if (object instanceof ContactItem) { popup.add(viewHistoryAction); } } public void poppingDown(JPopupMenu popup) { } public boolean handleDefaultAction(MouseEvent e) { return false; } }); SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { persistConversations(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(new ConnectionListener() { public void connectionClosed() { } public void connectionClosedOnError(Exception e) { persistConversations(); } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/558e9531ecfa541b9a4cd26214ce3d63392b1175/ChatTranscriptPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java