rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
super(control.getReferenceFrame(), "ROI Results"); | super(control.getReferenceFrame(), "ROI Results", true); | public ROIStats(ROIAgtCtrl control, Registry reg) { super(control.getReferenceFrame(), "ROI Results"); manager = new ROIStatsMng(this, control); IconManager im = IconManager.getInstance(reg); init(im); manager.attachListeners(); buildGUI(im); pack(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0f84715d97fb9bad35cd75d5c742a1473fe1f109/ROIStats.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/util/ROIStats.java |
private JToolBar buildBar() | private JPanel buildBar() | private JToolBar buildBar() { JToolBar bar = new JToolBar(); bar.setBorder(BorderFactory.createEtchedBorder()); bar.setFloatable(true); bar.putClientProperty("JToolBar.isRollover", Boolean.TRUE); bar.add(save); bar.add(Box.createRigidArea(HBOX)); bar.add(close); return bar; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0f84715d97fb9bad35cd75d5c742a1473fe1f109/ROIStats.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/util/ROIStats.java |
return bar; | JPanel p = new JPanel(); p.setLayout(new FlowLayout(FlowLayout.RIGHT)); p.add(bar); return p; | private JToolBar buildBar() { JToolBar bar = new JToolBar(); bar.setBorder(BorderFactory.createEtchedBorder()); bar.setFloatable(true); bar.putClientProperty("JToolBar.isRollover", Boolean.TRUE); bar.add(save); bar.add(Box.createRigidArea(HBOX)); bar.add(close); return bar; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0f84715d97fb9bad35cd75d5c742a1473fe1f109/ROIStats.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/util/ROIStats.java |
"text file.")); | "text or XML file.")); | private void init(IconManager im) { close = new JButton(im.getIcon(IconManager.CLOSE)); save = new JButton(im.getIcon(IconManager.SAVE)); close.setToolTipText( UIUtilities.formatToolTipText("Close the window.")); save.setToolTipText( UIUtilities.formatToolTipText("Save the result as a " + "text file.")); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0f84715d97fb9bad35cd75d5c742a1473fe1f109/ROIStats.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/util/ROIStats.java |
return getRuntime().newFixnum(toString().hashCode()); | return getRuntime().newFixnum(hashCode()); | public RubyFixnum hash() { return getRuntime().newFixnum(toString().hashCode()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/accd69543aeec606dd2490c5f67964fb52c543a5/RubyString.java/clean/src/org/jruby/RubyString.java |
Dataset d = (Dataset) createNewData(Dataset.class); d.setID(retVal.getID()); d.setName(retVal.getName()); d.setDescription(retVal.getDescription()); updateData(d); | public void updateDataset(DatasetData retVal) { } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5466bd473afcbdaa8b3ad0642cfb46e7843a2afe/DMSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/DMSAdapter.java |
|
Project p = (Project) createNewData(Project.class); p.setID(retVal.getID()); p.setName(retVal.getName()); p.setDescription(retVal.getDescription()); updateData(p); | public void updateProject(ProjectData retVal) { } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5466bd473afcbdaa8b3ad0642cfb46e7843a2afe/DMSAdapter.java/clean/SRC/org/openmicroscopy/shoola/env/data/DMSAdapter.java |
|
private UIComponent getMetadataPanel() { String path = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getFolderLocation"); String fileName = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getHeadline");// System.out.println("path = "+path+"/"+fileName+".xml"); WebDAVMetadata metadataUI = new WebDAVMetadata(path+"/"+fileName+".xml"); return metadataUI; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/e75e5a35d9b917c44d8a58d117a43ccf5ad660b4/ArticleItemView.java/buggy/src/java/com/idega/block/article/component/ArticleItemView.java |
||
WebDAVMetadata metadataUI = new WebDAVMetadata(path+"/"+fileName+".xml"); | WebDAVMetadata metadataUI = new WebDAVMetadata(path+"/"+fileName+ArticleItemBean.ARTICLE_SUFFIX); | private UIComponent getMetadataPanel() { String path = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getFolderLocation"); String fileName = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getHeadline");// System.out.println("path = "+path+"/"+fileName+".xml"); WebDAVMetadata metadataUI = new WebDAVMetadata(path+"/"+fileName+".xml"); return metadataUI; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/e75e5a35d9b917c44d8a58d117a43ccf5ad660b4/ArticleItemView.java/buggy/src/java/com/idega/block/article/component/ArticleItemView.java |
/* if (model.getSelectedBrowser() != null) { if (model.getSelectedBrowser().getSelectedDisplays().length > 1) { setEnabled(false); return; } } */ | protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { name = NAME; setEnabled(false); return; } /* if (model.getSelectedBrowser() != null) { if (model.getSelectedBrowser().getSelectedDisplays().length > 1) { setEnabled(false); return; } } */ Browser browser = model.getSelectedBrowser(); if (browser == null) { name = NAME; setEnabled(false); return; } if (browser.getBrowserType() == Browser.IMAGES_EXPLORER) { name = NAME; setEnabled(false); return; } Object ho = selectedDisplay.getUserObject(); if ((ho instanceof ProjectData) || (ho instanceof CategoryGroupData)) { name = NAME; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof DatasetData) { name = NAME_PROJECT; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof CategoryData) { name = NAME_CATEGORYGROUP; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof ImageData) { Object p = selectedDisplay.getParentDisplay().getUserObject(); if (p instanceof DatasetData) name = NAME_DATASET; else name = NAME_CATEGORY; setEnabled(model.isObjectWritable((DataObject) ho)); } else setEnabled(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/DeleteAction.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/DeleteAction.java |
|
if ((ho instanceof ProjectData) || (ho instanceof CategoryGroupData)) { name = NAME; | if (ho instanceof ProjectData) { name = NAME_ROOT_P; putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION_ROOT_P)); setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof CategoryGroupData) { name = NAME_ROOT_CG; putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION_ROOT_CG)); | protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { name = NAME; setEnabled(false); return; } /* if (model.getSelectedBrowser() != null) { if (model.getSelectedBrowser().getSelectedDisplays().length > 1) { setEnabled(false); return; } } */ Browser browser = model.getSelectedBrowser(); if (browser == null) { name = NAME; setEnabled(false); return; } if (browser.getBrowserType() == Browser.IMAGES_EXPLORER) { name = NAME; setEnabled(false); return; } Object ho = selectedDisplay.getUserObject(); if ((ho instanceof ProjectData) || (ho instanceof CategoryGroupData)) { name = NAME; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof DatasetData) { name = NAME_PROJECT; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof CategoryData) { name = NAME_CATEGORYGROUP; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof ImageData) { Object p = selectedDisplay.getParentDisplay().getUserObject(); if (p instanceof DatasetData) name = NAME_DATASET; else name = NAME_CATEGORY; setEnabled(model.isObjectWritable((DataObject) ho)); } else setEnabled(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/DeleteAction.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/DeleteAction.java |
if (p instanceof DatasetData) name = NAME_DATASET; else name = NAME_CATEGORY; | if (p instanceof DatasetData) { name = NAME_DATASET; putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION_DATASET)); } else { name = NAME_CATEGORY; putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION_CATEGORY)); } | protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { name = NAME; setEnabled(false); return; } /* if (model.getSelectedBrowser() != null) { if (model.getSelectedBrowser().getSelectedDisplays().length > 1) { setEnabled(false); return; } } */ Browser browser = model.getSelectedBrowser(); if (browser == null) { name = NAME; setEnabled(false); return; } if (browser.getBrowserType() == Browser.IMAGES_EXPLORER) { name = NAME; setEnabled(false); return; } Object ho = selectedDisplay.getUserObject(); if ((ho instanceof ProjectData) || (ho instanceof CategoryGroupData)) { name = NAME; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof DatasetData) { name = NAME_PROJECT; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof CategoryData) { name = NAME_CATEGORYGROUP; setEnabled(model.isObjectWritable((DataObject) ho)); } else if (ho instanceof ImageData) { Object p = selectedDisplay.getParentDisplay().getUserObject(); if (p instanceof DatasetData) name = NAME_DATASET; else name = NAME_CATEGORY; setEnabled(model.isObjectWritable((DataObject) ho)); } else setEnabled(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/DeleteAction.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/DeleteAction.java |
public Query(QueryParameter... parameters) { this.options = options; this.qps = parameters; defineParameters(); checkParameters(); } | private Query() { /* have to have the Parameters */ } | public Query(QueryParameter... parameters) { this.options = options; this.qps = parameters; defineParameters(); checkParameters(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/Query.java/clean/components/server/src/ome/services/query/Query.java |
for (int i = 0; i < qps.length; i++) | for (int i = 0; i < defs.length; i++) | protected void checkParameters(){ if (defs == null) throw new IllegalStateException( "Query parameter definitions not set."); if (qps == null) throw new IllegalArgumentException( "Null arrays "+ "are not valid for definitions."); if (defs.length > qps.length) throw new IllegalArgumentException( "As many Query parameters needed " + "as Query parameter defitions. Currently missing "+ (defs.length-qps.length)); for (int i = 0; i < qps.length; i++) { QueryParameter parameter = qps[i]; QueryParameterDef def = defs[i]; if (!def.name.equals(parameter.name)) throw new IllegalArgumentException( String.format( " Parameter name %d doesn't match: %s != %s", i,def.name,parameter.name )); if ( parameter.type == null ) { if (! def.optional) throw new IllegalArgumentException("Parameter type cannot " + "be null if not optional."); } else { if (!def.type.isAssignableFrom(parameter.type)) throw new IllegalArgumentException( String.format( " Parameter type %d doesn't match: %s != %s", i,def.type,parameter.type)); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/Query.java/clean/components/server/src/ome/services/query/Query.java |
model.setId(this.getId()); | model.setId(new Long(this.getId())); | public boolean fill(IObject model) { model.setId(this.getId()); model.setDetails(new Details()); if (!this.isLoaded()){ model.unload(); return false; } else { for (Iterator it = this.filtered.iterator(); it.hasNext();) { model.getDetails().addFiltered((String)it.next()); } return true; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73a1afa2d25923d96be1e1cc467e96ddaca80e9f/DataObject.java/clean/components/shoola-adapter/src/pojos/DataObject.java |
setTitle(TITLE); setModal(true); | setProperties(); | public ImgSaver(JFrame owner, ImViewer model) { super(owner); if (model == null) throw new IllegalArgumentException("No model."); this.model = model; setTitle(TITLE); setModal(true); uiDelegate = new ImgSaverUI(this); pack(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/ImgSaver.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java |
BufferedImage.TYPE_INT_RGB); | BufferedImage.TYPE_INT_RGB); | void saveImage() { //Builds the image to display. boolean unitBar = model.isUnitBar(); String v = model.getUnitBarValue(); int s = (int) model.getUnitBarSize(); if (imageComponents == null) { int width = mainImage.getWidth(); int h = mainImage.getHeight(); BufferedImage newImage = new BufferedImage(width, h, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = (Graphics2D) newImage.getGraphics(); g2.setColor(Color.WHITE); ImagePaintingFactory.setGraphicRenderingSettings(g2); //Paint the original image. g2.drawImage(mainImage, null, 0, 0); if (unitBar && v != null) ImagePaintingFactory.paintScaleBar(g2, width-s-10, h-10, s, v); writeImage(newImage, name); } else { int width = mainImage.getWidth(); int h = mainImage.getHeight(); int n = imageComponents.size(); int w = width*(n+1)+ImgSaverPreviewer.SPACE*(n-1); BufferedImage newImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = (Graphics2D) newImage.getGraphics(); g2.setColor(Color.WHITE); ImagePaintingFactory.setGraphicRenderingSettings(g2); //Paint the original image. Iterator i = imageComponents.iterator(); int x = 0; while (i.hasNext()) { g2.drawImage((BufferedImage) i.next(), null, x, 0); if (unitBar && v != null) ImagePaintingFactory.paintScaleBar(g2, x+width-s-10, h-10, s, v); x += width; g2.fillRect(x, 0, ImgSaverPreviewer.SPACE, h); x += ImgSaverPreviewer.SPACE; } g2.drawImage(mainImage, null, x, 0); if (unitBar && v != null) ImagePaintingFactory.paintScaleBar(g2, x+width-s-10, h-10, s, v); writeImage(newImage, name); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/ImgSaver.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java |
e.printStackTrace(); | ImViewerAgent.getRegistry().getLogger().error(this, e.getMessage()); | private void writeImage(BufferedImage image, String n) { UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); n += "."+format; File f = new File(n); try { if (format.equals(TIFFFilter.TIF)) { Encoder encoder = new TIFFEncoder(Factory.createImage(image), new DataOutputStream(new FileOutputStream(f))); WriterImage.saveImage(encoder); } else WriterImage.saveImage(f, image, format); un.notifyInfo("Image Saved", saveMessage); setClosed(true); } catch (Exception e) { e.printStackTrace(); f.delete(); un.notifyError("Save image failure", "Unable to save the image", e); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/ImgSaver.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java |
} if (channel instanceof AbstractSelectableChannel) { ((AbstractSelectableChannel)channel).configureBlocking(false); | public IOHandlerNio(IRuby runtime, Channel channel) throws IOException { super(runtime); String mode = ""; this.channel = channel; if (channel instanceof ReadableByteChannel) { mode += "r"; isOpen = true; } if (channel instanceof WritableByteChannel) { mode += "w"; isOpen = true; } if ("rw".equals(mode)) { modes = new IOModes(runtime, IOModes.RDWR); isOpen = true; } else { if (!isOpen) { // Neither stream exists? // throw new IOException("Opening nothing?"); // Hack to cover the ServerSocketChannel case mode = "r"; isOpen = true; } modes = new IOModes(runtime, mode); } fileno = RubyIO.getNewFileno(); outBuffer = ByteBuffer.allocate(BLOCK_SIZE); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/69fa0b1be0ae2b0e938046a77771ab15ebec6d4e/IOHandlerNio.java/clean/src/org/jruby/util/IOHandlerNio.java |
|
if (((ReadableByteChannel) channel).read(buffer) < 0) { | int bytesRead = ((ReadableByteChannel) channel).read(buffer); if (bytesRead < 0) { | public String sysread(int length) throws EOFException, BadDescriptorException, IOException { checkReadable(); checkBuffered(); ByteBuffer buffer = ByteBuffer.allocate(length); boolean eof = false; while (buffer.hasRemaining()) { if (((ReadableByteChannel) channel).read(buffer) < 0) { eof = true; break; } } if (buffer.position() == 0 && eof == true) { throw new EOFException(); } byte[] ret; if (buffer.hasRemaining()) { buffer.flip(); ret = new byte[buffer.remaining()]; buffer.get(ret); } else { ret = buffer.array(); } return RubyString.bytesToString(ret); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/69fa0b1be0ae2b0e938046a77771ab15ebec6d4e/IOHandlerNio.java/clean/src/org/jruby/util/IOHandlerNio.java |
if (bytesRead == 0) { break; } | public String sysread(int length) throws EOFException, BadDescriptorException, IOException { checkReadable(); checkBuffered(); ByteBuffer buffer = ByteBuffer.allocate(length); boolean eof = false; while (buffer.hasRemaining()) { if (((ReadableByteChannel) channel).read(buffer) < 0) { eof = true; break; } } if (buffer.position() == 0 && eof == true) { throw new EOFException(); } byte[] ret; if (buffer.hasRemaining()) { buffer.flip(); ret = new byte[buffer.remaining()]; buffer.get(ret); } else { ret = buffer.array(); } return RubyString.bytesToString(ret); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/69fa0b1be0ae2b0e938046a77771ab15ebec6d4e/IOHandlerNio.java/clean/src/org/jruby/util/IOHandlerNio.java |
|
if (lastRead == '\n') { | if (offset > 0 && buffer.charAt(offset-1) == '\n') { | public char read() { synchronized (buffer) { if (lastRead == '\n') { // The \n has already been read, but we increment on first char // of new line line++; } readIntoBuffer(); lastRead = buffer.charAt(offset++); return lastRead; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/56ea311750a6deff58586137a9fa05dc3bdd35fd/AbstractLexerSource.java/buggy/src/org/ablaf/internal/lexer/AbstractLexerSource.java |
if (offset > 0 && buffer.charAt(offset-1) == '\n') { | public void unread() { synchronized (buffer) { char result; if (offset > 0) { result = buffer.charAt(--offset); } else { result = 0; } lastRead = result;// todo: create a test case where this code matters (and works):// if (offset > 0 && buffer.charAt(offset-1)=='\n')// { // We have just unread the first char of a new line, so // now we decrement the line number// line--;// } return; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/56ea311750a6deff58586137a9fa05dc3bdd35fd/AbstractLexerSource.java/buggy/src/org/ablaf/internal/lexer/AbstractLexerSource.java |
|
line--; } | public void unread() { synchronized (buffer) { char result; if (offset > 0) { result = buffer.charAt(--offset); } else { result = 0; } lastRead = result;// todo: create a test case where this code matters (and works):// if (offset > 0 && buffer.charAt(offset-1)=='\n')// { // We have just unread the first char of a new line, so // now we decrement the line number// line--;// } return; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/56ea311750a6deff58586137a9fa05dc3bdd35fd/AbstractLexerSource.java/buggy/src/org/ablaf/internal/lexer/AbstractLexerSource.java |
|
nameArea.getDocument().addDocumentListener( new DocumentListener() { | nameAreaListener = new DocumentListener() { | private void initComponents() { tabbedPane = new JTabbedPane(); nameArea = new JTextField(); setTextAreaDefault(nameArea); descriptionArea = new MultilineLabel(); setTextAreaDefault(descriptionArea); if (model.getEditorType() == Editor.PROPERTIES_EDITOR) { nameArea.setText(model.getDataObjectName()); descriptionArea.setText(model.getDataObjectDescription()); descriptionArea.getDocument().addDocumentListener( new DocumentListener() { public void insertUpdate(DocumentEvent de) { view.handleDescriptionAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) {} /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); if (!(model.isEditable())) { nameArea.setEditable(false); descriptionArea.setEditable(false); } if (model.isAnnotable()) { annotator = new DOAnnotation(view, model); IconManager im = IconManager.getInstance(); //tabbedPane.ins tabbedPane.addTab(ANNOTATION, im.getIcon(IconManager.ANNOTATION), annotator); } if (model.isClassified()) { classifier = new DOClassification(model); tabbedPane.addTab(CLASSIFICATION, IconManager.getInstance().getIcon(IconManager.CATEGORY), classifier); } } nameArea.getDocument().addDocumentListener( new DocumentListener() { /** * Updates the editor's controlswhen some text is inserted. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { view.handleNameAreaInsert(); } /** * Displays an error message when the data object has no name. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { if (de.getDocument().getLength() == 0) view.handleEmptyNameArea(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bde0d9ea0ad5bcb7ca080ea7ee82bc689e6bd9da/DOBasic.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/DOBasic.java |
}); | }; nameArea.getDocument().addDocumentListener(nameAreaListener); | private void initComponents() { tabbedPane = new JTabbedPane(); nameArea = new JTextField(); setTextAreaDefault(nameArea); descriptionArea = new MultilineLabel(); setTextAreaDefault(descriptionArea); if (model.getEditorType() == Editor.PROPERTIES_EDITOR) { nameArea.setText(model.getDataObjectName()); descriptionArea.setText(model.getDataObjectDescription()); descriptionArea.getDocument().addDocumentListener( new DocumentListener() { public void insertUpdate(DocumentEvent de) { view.handleDescriptionAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) {} /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); if (!(model.isEditable())) { nameArea.setEditable(false); descriptionArea.setEditable(false); } if (model.isAnnotable()) { annotator = new DOAnnotation(view, model); IconManager im = IconManager.getInstance(); //tabbedPane.ins tabbedPane.addTab(ANNOTATION, im.getIcon(IconManager.ANNOTATION), annotator); } if (model.isClassified()) { classifier = new DOClassification(model); tabbedPane.addTab(CLASSIFICATION, IconManager.getInstance().getIcon(IconManager.CATEGORY), classifier); } } nameArea.getDocument().addDocumentListener( new DocumentListener() { /** * Updates the editor's controlswhen some text is inserted. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { view.handleNameAreaInsert(); } /** * Displays an error message when the data object has no name. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { if (de.getDocument().getLength() == 0) view.handleEmptyNameArea(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bde0d9ea0ad5bcb7ca080ea7ee82bc689e6bd9da/DOBasic.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/DOBasic.java |
*/ | public static Criteria buildCategoryGroupCriteria(int groupID, int userID) { Criteria c = new Criteria(); c.addWantedField("Name"); c.addWantedField("Description"); c.addWantedField("CategoryList"); //wanted fields for CategoryList c.addWantedField("CategoryList", "Name"); c.addWantedField("CategoryList", "Description"); c.addWantedField("CategoryList", "ClassificationList"); c.addWantedField("CategoryList", "module_execution"); //May add filter c.addWantedField("CategoryList.module_execution", "experimenter"); //wanted fields for ClassificationList c.addWantedField("CategoryList.ClassificationList", "Valid"); c.addWantedField("CategoryList.ClassificationList", "Confidence"); c.addWantedField("CategoryList.ClassificationList", "image"); //May add filtering c.addWantedField("CategoryList.ClassificationList", "module_execution"); c.addWantedField("CategoryList.ClassificationList.module_execution", "experimenter"); //wanted fields for images c.addWantedField("CategoryList.ClassificationList.image", "name"); c.addWantedField("CategoryList.ClassificationList.image", "created"); c.addWantedField("CategoryList.ClassificationList.image", "default_pixels"); c.addWantedField("CategoryList.ClassificationList.image.default_pixels", "ImageServerID"); c.addWantedField("CategoryList.ClassificationList.image.default_pixels", "Repository"); c.addWantedField( "CategoryList.ClassificationList.image.default_pixels.Repository", "ImageServerURL"); if (groupID != -1) c.addFilter("id", new Integer(groupID)); if (userID != -1) c.addFilter("module_execution.experimenter_id", new Integer(userID)); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/CategoryMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
|
is = new ImageSummary(); ImageMapper.buildImageSummary(classification.getImage(), is); | is = ImageMapper.buildImageSummary(classification.getImage(), null); | private static CategoryData fillCategory(CategoryGroupData gData, CategoryData proto, Category c) { CategoryData model = (CategoryData) proto.makeNew(); model.setID(c.getID()); model.setName(c.getName()); model.setDescription(c.getDescription()); model.setCategoryGroup(gData); Iterator i = c.getClassificationList().iterator(); Classification classification; ClassificationData cData; ImageSummary is; Map map = new HashMap(); while (i.hasNext()) { classification = (Classification) i.next(); //filter doesn't work when applies at the criteria level. if (classification.isValid() != null && classification.isValid().equals(Boolean.TRUE)) { cData = buildClassificationData(classification); is = new ImageSummary(); ImageMapper.buildImageSummary(classification.getImage(), is); map.put(is, cData); } } model.setClassifications(map); return model; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/CategoryMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/CategoryMapper.java |
List getImages() { return getDatasetData().getImages(); } | List getImages() { List l = getDatasetData().getImages(); if (l == null) l = new ArrayList(); return l; } | List getImages() { return getDatasetData().getImages(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9a6c82df9be190d9173204c3d22c6d17ab56ccc0/DatasetEditorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/editors/dataset/DatasetEditorManager.java |
IWApplicationContext iwac = iwuc.getApplicationContext(); | public void load(String path) throws XmlException, IOException{ System.out.println("Attempting to load path "+path); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavResource webdavResource = session.getWebdavResource(path); ArticleDocument articleDoc; articleDoc = ArticleDocument.Factory.parse(webdavResource.getMethodDataAsString()); ArticleDocument.Article article = articleDoc.getArticle();// ArticleItemBean articleBean = new ArticleItemBean(); setHeadline(article.getHeadline()); setBody(article.getBody()); setTeaser(article.getTeaser()); setAuthor(article.getAuthor()); setSource(article.getSource()); setComment(article.getComment()); String category = ""; int lastSlash = path.lastIndexOf('/'); if(lastSlash>0) { category = path.substring(0,lastSlash); } setMainCategory(category); // System.out.println("loaded "+getBody()); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/3be5b072f03b106a663adb9d9077f7370a7695b3/ArticleItemBean.java/buggy/src/java/com/idega/block/article/bean/ArticleItemBean.java |
|
IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); | public void load(String path) throws XmlException, IOException{ System.out.println("Attempting to load path "+path); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavResource webdavResource = session.getWebdavResource(path); ArticleDocument articleDoc; articleDoc = ArticleDocument.Factory.parse(webdavResource.getMethodDataAsString()); ArticleDocument.Article article = articleDoc.getArticle();// ArticleItemBean articleBean = new ArticleItemBean(); setHeadline(article.getHeadline()); setBody(article.getBody()); setTeaser(article.getTeaser()); setAuthor(article.getAuthor()); setSource(article.getSource()); setComment(article.getComment()); String category = ""; int lastSlash = path.lastIndexOf('/'); if(lastSlash>0) { category = path.substring(0,lastSlash); } setMainCategory(category); // System.out.println("loaded "+getBody()); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/3be5b072f03b106a663adb9d9077f7370a7695b3/ArticleItemBean.java/buggy/src/java/com/idega/block/article/bean/ArticleItemBean.java |
|
System.out.println("webdavServerURL = "+service.getWebdavServerURL()); System.out.println("webdavServletURL = "+getWebdavServletURL(iwuc)); System.out.println("Main category = "+getMainCategory()); | public void store() throws IDOStoreException{// public Boolean store() { boolean storeOk = true; clearErrorKeys(); ArticleDocument articleDoc = ArticleDocument.Factory.newInstance(); ArticleDocument.Article article = articleDoc.addNewArticle(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } article.setHeadline(getHeadline()); article.setBody(getBody()); article.setTeaser(getTeaser()); article.setAuthor(getAuthor()); article.setSource(getSource()); article.setComment(getComment());// article.setImage(getImages());// article.setAttachment(getAttachments());// article.setRelatedItems(getRelatedContentItems());//Need to create article.setCategory(getCategory()); String filename = getHeadline(); if(null==filename || filename.length()==0) { filename = "empty"; }/* File path = new File(getMainCategory()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); System.out.println("webdavServerURL = "+service.getWebdavServerURL()); System.out.println("webdavServletURL = "+getWebdavServletURL(iwuc)); System.out.println("Main category = "+getMainCategory()); WebdavRootResource rootResource = session.getWebdavRootResource();// boolean success = webdavResource.mkcolMethod("/servlet/webdav/files/test/test2"); String filePath = service.getWebdavServerURI()+getMainCategory(); boolean success = rootResource.mkcolMethod(filePath); System.out.println("success "+success);// boolean success = rootResource.mkcolMethod(getWebdavServletURL(iwuc)+getMainCategory()); System.out.println(filePath); success = rootResource.putMethod(getWebdavServletURL(iwuc)+getMainCategory()+"/"+filename+".xml",articleDoc.toString()); System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getMainCategory();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getMainCategory());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getMainCategory()+"/"+filename+".xml");// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+".xml");// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+".xml");// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+".xml")); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml"); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getMainCategory()+"/"+filename+".xml"));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/3be5b072f03b106a663adb9d9077f7370a7695b3/ArticleItemBean.java/buggy/src/java/com/idega/block/article/bean/ArticleItemBean.java |
|
System.out.println(filePath); | public void store() throws IDOStoreException{// public Boolean store() { boolean storeOk = true; clearErrorKeys(); ArticleDocument articleDoc = ArticleDocument.Factory.newInstance(); ArticleDocument.Article article = articleDoc.addNewArticle(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } article.setHeadline(getHeadline()); article.setBody(getBody()); article.setTeaser(getTeaser()); article.setAuthor(getAuthor()); article.setSource(getSource()); article.setComment(getComment());// article.setImage(getImages());// article.setAttachment(getAttachments());// article.setRelatedItems(getRelatedContentItems());//Need to create article.setCategory(getCategory()); String filename = getHeadline(); if(null==filename || filename.length()==0) { filename = "empty"; }/* File path = new File(getMainCategory()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); System.out.println("webdavServerURL = "+service.getWebdavServerURL()); System.out.println("webdavServletURL = "+getWebdavServletURL(iwuc)); System.out.println("Main category = "+getMainCategory()); WebdavRootResource rootResource = session.getWebdavRootResource();// boolean success = webdavResource.mkcolMethod("/servlet/webdav/files/test/test2"); String filePath = service.getWebdavServerURI()+getMainCategory(); boolean success = rootResource.mkcolMethod(filePath); System.out.println("success "+success);// boolean success = rootResource.mkcolMethod(getWebdavServletURL(iwuc)+getMainCategory()); System.out.println(filePath); success = rootResource.putMethod(getWebdavServletURL(iwuc)+getMainCategory()+"/"+filename+".xml",articleDoc.toString()); System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getMainCategory();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getMainCategory());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getMainCategory()+"/"+filename+".xml");// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+".xml");// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+".xml");// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+".xml")); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml"); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+".xml", "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getMainCategory()+"/"+filename+".xml"));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/3be5b072f03b106a663adb9d9077f7370a7695b3/ArticleItemBean.java/buggy/src/java/com/idega/block/article/bean/ArticleItemBean.java |
|
if (target instanceof RubySymbol) { target = ((RubySymbol) target).to_s(); } | public IRubyObject match(IRubyObject target) { if (target.isNil()) { return getRuntime().getFalse(); } int result = search(target, 0); return result < 0 ? getRuntime().getNil() : getRuntime().newFixnum(result); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/79e935db5c7a68676c9c113d21a3544014842401/RubyRegexp.java/clean/src/org/jruby/RubyRegexp.java |
|
String str = RubyString.stringValue(target).toString(); | String str = RubyString.stringValue(target).toString(); | public int search(IRubyObject target, int pos) { String str = RubyString.stringValue(target).toString(); if (pos > str.length()) { return -1; } recompileIfNeeded(); // If nothing match then nil will be returned IRubyObject result = match(str, pos); getRuntime().getCurrentContext().setBackref(result); // If nothing match then -1 will be returned return result instanceof RubyMatchData ? ((RubyMatchData) result).matchStartPosition() : -1; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/79e935db5c7a68676c9c113d21a3544014842401/RubyRegexp.java/clean/src/org/jruby/RubyRegexp.java |
versionLabel.setText(VERSION+"(rev "+m.group()+")"+OMERO_VERSION); | versionLabel.setText(VERSION+OMERO_VERSION); | private void initFields() { user = new JTextField(); user.setFont(FONT); user.setForeground(FONT_COLOR); user.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); pass = new JPasswordField(); pass.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); pass.setFont(FONT); pass.setForeground(FONT_COLOR); versionLabel = new JLabel(); versionLabel.setDoubleBuffered(false); String version = "$Rev$"; Pattern p = Pattern.compile("\\d{1,9}"); Matcher m = p.matcher(version); m.find(); versionLabel.setText(VERSION+"(rev "+m.group()+")"+OMERO_VERSION); versionLabel.setForeground(VERSION_FONT_COLOR); versionLabel.setFont(VERSION_FONT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/SplashScreenView.java/clean/SRC/org/openmicroscopy/shoola/env/ui/SplashScreenView.java |
public String getName() { return _name; } | final public String getName() { return _name; } | public String getName() { return _name; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/af8b9e04f0dcb3a0994b2882f87f1d6c81e86fc1/Argument.java/buggy/webmacro/src/org/webmacro/engine/Argument.java |
public Object getValue() { return _value; } | final public Object getValue() { return _value; } | public Object getValue() { return _value; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/af8b9e04f0dcb3a0994b2882f87f1d6c81e86fc1/Argument.java/buggy/webmacro/src/org/webmacro/engine/Argument.java |
block.addElement(MacroAdapter.createMacro(buf.toString())); | block.addElement(MacroAdapter.createMacro(buf.toString(),bc.getEncoding())); | final public Object build(BuildContext bc) throws BuildException { Vector block = new Vector(20); StringBuffer buf = new StringBuffer(512); flatten(bc,block,buf,elements()); if (buf.length() > 0) { block.addElement(MacroAdapter.createMacro(buf.toString())); } Macro[] result = new Macro[block.size()]; block.copyInto(result); return new Block(result); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/9dc4324fb914abcbf2ec188e4eb77b1bf503f330/BlockBuilder.java/buggy/webmacro/src/org/webmacro/engine/BlockBuilder.java |
block.addElement(MacroAdapter.createMacro(buf.toString())); | block.addElement(MacroAdapter.createMacro(buf.toString(),bc.getEncoding())); | private void flatten(BuildContext bc, Vector block, StringBuffer buf, Enumeration e) throws BuildException { while(e.hasMoreElements()) { Object cur = e.nextElement(); Object o = cur; if (o instanceof BlockBuilder) { Enumeration e2 = ((BlockBuilder) o).elements(); flatten(bc,block,buf,e2); } else { if (o instanceof Builder) { o = ((Builder) o).build(bc); } if (o instanceof Macro) { if (buf.length() > 0) { block.addElement(MacroAdapter.createMacro(buf.toString())); buf.setLength(0); } block.addElement((Macro) o); } else { if (o != null) { buf.append(o.toString()); } } } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/9dc4324fb914abcbf2ec188e4eb77b1bf503f330/BlockBuilder.java/buggy/webmacro/src/org/webmacro/engine/BlockBuilder.java |
if (null == imgIds || imgIds.size() == 0) { return new HashSet(); } | public Set findCGCPaths(Set imgIds, boolean contained) { List l = containerDao.findCGCPaths(imgIds,contained); Set<CategoryGroup> s = new HashSet<CategoryGroup>(l); for (CategoryGroup cg : s){ for (Object o : cg.getCategories()){ Category c = (Category) o; c.setClassifications(null); } } return s; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b6382cda97f15631c059881b08c1708cc8b2b7d8/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
|
v /= zoomFactor; | v *= zoomFactor; | double getUnitBarSize() { double v = unitInMicrons; if (getPixelsSizeX() > 0) v = unitInMicrons/getPixelsSizeX(); v /= zoomFactor; return v; //if (unit == -1) setUnitBarSize(5); //return unit; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/70af2b53ede1e70eb3573db44238cd870bea85cd/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserModel.java |
Locale locale = (Locale) tmpl.getParam( WMConstants.TEMPLATE_LOCALE); _log.debug("TemplateLocale="+locale); if (locale != null) { setLocale(resp, locale); } String encoding = (String) tmpl.getParam( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding(); } _log.debug("Using output encoding "+encoding); | final protected void execute(Template tmpl, WebContext c) { FastWriter fw = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); try { HttpServletResponse resp= c.getResponse(); Locale locale = (Locale) tmpl.getParam( WMConstants.TEMPLATE_LOCALE); _log.debug("TemplateLocale="+locale); if (locale != null) { setLocale(resp, locale); } String encoding = (String) tmpl.getParam( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding(); } _log.debug("Using output encoding "+encoding); fw = FastWriter.getInstance( resp.getOutputStream(), encoding); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { fw.write(error); } catch (Exception ignore) { } } finally { try { if (fw != null) { fw.flush(); fw.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c2d009387a686003be3c3f30bc84f3a302311279/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
|
resp.getOutputStream(), encoding); | resp.getOutputStream(), resp.getCharacterEncoding()); | final protected void execute(Template tmpl, WebContext c) { FastWriter fw = null; boolean timing = Flags.PROFILE && c.isTiming(); try { if (timing) c.startTiming("Template.write", tmpl); try { HttpServletResponse resp= c.getResponse(); Locale locale = (Locale) tmpl.getParam( WMConstants.TEMPLATE_LOCALE); _log.debug("TemplateLocale="+locale); if (locale != null) { setLocale(resp, locale); } String encoding = (String) tmpl.getParam( WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding==null) { encoding = resp.getCharacterEncoding(); } _log.debug("Using output encoding "+encoding); fw = FastWriter.getInstance( resp.getOutputStream(), encoding); tmpl.write(fw, c); } finally { if (timing) c.stopTiming(); } if (timing) c.startTiming("FastWriter.close()"); try { fw.close(); } finally { if (timing) c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { fw.write(error); } catch (Exception ignore) { } } finally { try { if (fw != null) { fw.flush(); fw.close(); } } catch (Exception e3) { // ignore disconnect } } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c2d009387a686003be3c3f30bc84f3a302311279/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
ClassLoader cl = this.getClass().getClassLoader(); System.out.println("WMServlet init: classloader="+cl); if (cl == null) { return new WM(); } else { System.out.println("WMServlet init: defaults="+cl.getResource("WebMacro.defaults")); return new WM(cl); } | return new WM(); | public WebMacro initWebMacro() throws InitException { ClassLoader cl = this.getClass().getClassLoader(); System.out.println("WMServlet init: classloader="+cl); if (cl == null) { return new WM(); } else { System.out.println("WMServlet init: defaults="+cl.getResource("WebMacro.defaults")); return new WM(cl); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c2d009387a686003be3c3f30bc84f3a302311279/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
System.out.println("Cobertura coverage check"); | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
|
LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, | LongOpt[] longOpts = new LongOpt[6]; longOpts[0] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[1] = new LongOpt("regex", LongOpt.REQUIRED_ARGUMENT, null, 'r'); longOpts[2] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); | longOpts[3] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); longOpts[4] = new LongOpt("totalbranch", LongOpt.REQUIRED_ARGUMENT, null, 'B'); longOpts[5] = new LongOpt("totalline", LongOpt.REQUIRED_ARGUMENT, null, 'L'); | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", | Getopt g = new Getopt(getClass().getName(), args, ":b:B:d:l:L:r", | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; | File dataFile = CoverageDataFileHandler.getDefaultDataFile(); double branchCoverageRate = 0.0; double lineCoverageRate = 0.0; double totalBranchCoverageRate = 0.0; double totalLineCoverageRate = 0.0; | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); | case 'B': totalBranchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
case 'i': setMinimumCoverageRate(g.getOptarg()); | case 'd': dataFile = new File(g.getOptarg()); | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
minimumCoverageRate = new CoverageRate(lineCoverageRate, | ProjectData projectData = CoverageDataFileHandler .loadCoverageData(dataFile); if (projectData == null) { System.err.println("Error: Unable to read from data file " + dataFile.getAbsolutePath()); System.exit(1); } if ((branchCoverageRate == 0) && (lineCoverageRate == 0) && (totalLineCoverageRate == 0) && (totalBranchCoverageRate == 0) && (this.minimumCoverageRates.size() == 0)) { branchCoverageRate = 0.5; lineCoverageRate = 0.5; totalBranchCoverageRate = 0.5; totalLineCoverageRate = 0.5; } this.minimumCoverageRate = new CoverageRate(lineCoverageRate, | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } | double totalLines = 0; double totalLinesCovered = 0; double totalBranches = 0; double totalBranchesCovered = 0; | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
if (logger.isInfoEnabled()) | if (totalBranchCoverageRate > 0.0) | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); | totalBranches += classData.getNumberOfValidBranches(); totalBranchesCovered += classData.getNumberOfCoveredBranches(); } if (totalLineCoverageRate > 0.0) { totalLines += classData.getNumberOfValidLines(); totalLinesCovered += classData.getNumberOfCoveredLines(); } logger.debug("Class " + classData.getName() + ", line coverage rate: " + percentage(classData.getLineCoverageRate()) + "%, branch coverage rate: " + percentage(classData.getBranchCoverageRate()) + "%"); if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { System.err.println(classData.getName() + " failed check. Branch coverage rate of " + percentage(classData.getBranchCoverageRate()) + "% is below " + percentage(coverageRate.getBranchCoverageRate()) + "%"); exitStatus |= 2; | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); | System.err.println(classData.getName() + " failed check. Line coverage rate of " + percentage(classData.getLineCoverageRate()) + "% is below " + percentage(coverageRate.getLineCoverageRate()) + "%"); exitStatus |= 4; | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
if ((totalBranches > 0) && (totalBranchCoverageRate > (totalBranchesCovered / totalBranches))) { System.err .println("Project failed check. " + "Total branch coverage rate of " + percentage(totalBranchesCovered / totalBranches) + "% is below " + percentage(totalBranchCoverageRate) + "%"); exitStatus |= 8; } if ((totalLines > 0) && (totalLineCoverageRate > (totalLinesCovered / totalLines))) { System.err.println("Project failed check. " + "Total line coverage rate of " + percentage(totalLinesCovered / totalLines) + "% is below " + percentage(totalLineCoverageRate) + "%"); exitStatus |= 16; } System.exit(exitStatus); | public Main(String[] args) throws MalformedPatternException { Header.print(System.out); System.out.println("Cobertura coverage check"); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("branch", LongOpt.REQUIRED_ARGUMENT, null, 'b'); longOpts[2] = new LongOpt("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[3] = new LongOpt("ignore", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[1] = new LongOpt("line", LongOpt.REQUIRED_ARGUMENT, null, 'l'); Getopt g = new Getopt(getClass().getName(), args, ":b:d:i:l:", longOpts); int c; double branchCoverageRate = 0.8; double lineCoverageRate = 0.7; while ((c = g.getopt()) != -1) { switch (c) { case 'b': branchCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; case 'd': CoverageDataFileHandler.setDefaultDataFile(g.getOptarg()); break; case 'i': setMinimumCoverageRate(g.getOptarg()); break; case 'l': lineCoverageRate = inRangeAndDivideByOneHundred(g .getOptarg()); break; } } minimumCoverageRate = new CoverageRate(lineCoverageRate, branchCoverageRate); // Load coverage data ProjectData projectData = ProjectData.getGlobalProjectData(); if (logger.isInfoEnabled()) { logger.info("Coverage data has " + projectData.getNumberOfClasses() + " classes"); } Iterator iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); CoverageRate coverageRate = findMinimumCoverageRate(classData .getName()); if (logger.isInfoEnabled()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(", line: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getLineCoverageRate())); sb.append("%), branch: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% ("); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("%)"); logger.info(sb.toString()); } if (classData.getLineCoverageRate() < coverageRate .getLineCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" line coverage rate of: "); sb.append(percentage(classData.getLineCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getLineCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } if (classData.getBranchCoverageRate() < coverageRate .getBranchCoverageRate()) { StringBuffer sb = new StringBuffer(); sb.append(classData.getName()); sb.append(" branch coverage rate of: "); sb.append(percentage(classData.getBranchCoverageRate())); sb.append("% (required: "); sb.append(percentage(coverageRate.getBranchCoverageRate())); sb.append("%)"); System.out.println(sb.toString()); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
|
Iterator i = minimumCoverageRates.entrySet().iterator(); while (i.hasNext()) | Iterator iter = this.minimumCoverageRates.entrySet().iterator(); while (iter.hasNext()) | CoverageRate findMinimumCoverageRate(String classname) { Iterator i = minimumCoverageRates.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); if (pm.matches(classname, (Pattern)entry.getKey())) { return (CoverageRate)entry.getValue(); } } return minimumCoverageRate; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
Map.Entry entry = (Map.Entry)i.next(); | Map.Entry entry = (Map.Entry)iter.next(); | CoverageRate findMinimumCoverageRate(String classname) { Iterator i = minimumCoverageRates.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); if (pm.matches(classname, (Pattern)entry.getKey())) { return (CoverageRate)entry.getValue(); } } return minimumCoverageRate; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
return minimumCoverageRate; | return this.minimumCoverageRate; | CoverageRate findMinimumCoverageRate(String classname) { Iterator i = minimumCoverageRates.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); if (pm.matches(classname, (Pattern)entry.getKey())) { return (CoverageRate)entry.getValue(); } } return minimumCoverageRate; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
minimumCoverageRates.put(pc.compile(tokenizer.nextToken()), | this.minimumCoverageRates.put(pc.compile(tokenizer.nextToken()), | void setMinimumCoverageRate(String minimumCoverageRate) throws MalformedPatternException { StringTokenizer tokenizer = new StringTokenizer(minimumCoverageRate, ":"); minimumCoverageRates.put(pc.compile(tokenizer.nextToken()), new CoverageRate(inRangeAndDivideByOneHundred(tokenizer .nextToken()), inRangeAndDivideByOneHundred(tokenizer .nextToken()))); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/check/Main.java |
if (getScopeStack().hasLocalValues()) { | if (getScopeStack().hasLocalVariables()) { | public IRubyObject getBackref() { if (getScopeStack().hasLocalValues()) { return getScopeStack().getValue(1); } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6e143e1ded2275ed4da3449d4a13446b099f800d/ThreadContext.java/clean/src/org/jruby/runtime/ThreadContext.java |
module.defineMethod("initialize_copy", new ReflectionCallback(RubyObject.class, "initialize_copy", Arity.fixed(1))); | public static void createObjectClass(RubyClass module) { CallbackFactory callbackFactory = module.getRuntime().callbackFactory(RubyObject.class); Callback equal = callbackFactory.getMethod("equal", IRubyObject.class); module.defineMethod("==", equal); module.defineMethod("===", equal); module.defineMethod("to_s", callbackFactory.getMethod("to_s")); module.defineMethod("nil?", callbackFactory.getFalseMethod(0)); module.defineMethod("to_a", callbackFactory.getMethod("to_a")); module.defineMethod("hash", callbackFactory.getMethod("hash")); module.defineMethod("id", callbackFactory.getMethod("id")); module.defineMethod("__id__", callbackFactory.getMethod("id")); module.defineAlias("object_id", "__id__"); module.defineMethod("is_a?", callbackFactory.getMethod("kind_of", IRubyObject.class)); module.defineMethod("kind_of?", callbackFactory.getMethod("kind_of", IRubyObject.class)); module.defineMethod("dup", callbackFactory.getMethod("dup")); module.defineMethod("eql?", equal); module.defineMethod("equal?", callbackFactory.getMethod("same", IRubyObject.class)); module.defineMethod("type", callbackFactory.getMethod("type_deprecated")); module.defineMethod("class", callbackFactory.getMethod("type")); module.defineMethod("inspect", callbackFactory.getMethod("inspect")); module.defineMethod("=~", callbackFactory.getFalseMethod(1)); module.defineMethod("clone", callbackFactory.getMethod("rbClone")); module.defineMethod("display", callbackFactory.getOptMethod("display")); module.defineMethod("extend", callbackFactory.getOptMethod("extend")); module.defineMethod("freeze", callbackFactory.getMethod("freeze")); module.defineMethod("frozen?", callbackFactory.getMethod("frozen")); module.defineMethod("instance_eval", callbackFactory.getOptMethod("instance_eval")); module.defineMethod("instance_of?", callbackFactory.getMethod("instance_of", IRubyObject.class)); module.defineMethod("instance_variables", callbackFactory.getMethod("instance_variables")); module.defineMethod("instance_variable_get", callbackFactory.getMethod("instance_variable_get", IRubyObject.class)); module.defineMethod("instance_variable_set", callbackFactory.getMethod("instance_variable_set", IRubyObject.class, IRubyObject.class)); module.defineMethod("method", callbackFactory.getMethod("method", IRubyObject.class)); module.defineMethod("methods", callbackFactory.getOptMethod("methods")); //module.defineMethod("method_missing", callbackFactory.getOptMethod(RubyObject.class, "method_missing")); module.defineMethod("private_methods", callbackFactory.getMethod("private_methods")); module.defineMethod("protected_methods", callbackFactory.getMethod("protected_methods")); module.defineMethod("public_methods", callbackFactory.getMethod("methods")); module.defineMethod("respond_to?", callbackFactory.getOptMethod("respond_to")); Callback send = callbackFactory.getOptMethod("send"); module.defineMethod("send", send); module.defineMethod("__send__", send); module.defineMethod("singleton_methods", callbackFactory.getMethod("singleton_methods")); module.defineMethod("taint", callbackFactory.getMethod("taint")); module.defineMethod("tainted?", callbackFactory.getMethod("tainted")); module.defineMethod("untaint", callbackFactory.getMethod("untaint")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4442343885cd87eb52f7b519abf1fac2bbfe523d/RubyObject.java/buggy/src/org/jruby/RubyObject.java |
|
setInstanceVariables(new HashMap(original.getInstanceVariables())); | if (original.getInstanceVariables() != null) { setInstanceVariables(new HashMap(original.getInstanceVariables())); } | public void initCopy(IRubyObject original) { assert !isFrozen() : "frozen object (" + getMetaClass().getName() + ") allocated"; setInstanceVariables(new HashMap(original.getInstanceVariables())); callMethod("initialize_copy", original); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4442343885cd87eb52f7b519abf1fac2bbfe523d/RubyObject.java/buggy/src/org/jruby/RubyObject.java |
public RubyFixnum aref(IRubyObject other) { RubyNumeric numericPosition = numericValue(other); long position = numericPosition.getLongValue(); | public RubyFixnum aref(RubyNumeric other) { long position = other.getLongValue(); | public RubyFixnum aref(IRubyObject other) { RubyNumeric numericPosition = numericValue(other); long position = numericPosition.getLongValue(); // Seems mighty expensive to keep creating over and over again. // How else can this be done though? if (position > BIT_SIZE) { RubyBignum bignum = RubyBignum.newBignum(runtime, value); return bignum.aref(numericPosition); } return newFixnum((value & (1L << position)) == 0 ? 0 : 1); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
if (position > BIT_SIZE) { RubyBignum bignum = RubyBignum.newBignum(runtime, value); return bignum.aref(numericPosition); } | if (position > BIT_SIZE) { RubyBignum bignum = RubyBignum.newBignum(runtime, value); return bignum.aref(other); } | public RubyFixnum aref(IRubyObject other) { RubyNumeric numericPosition = numericValue(other); long position = numericPosition.getLongValue(); // Seems mighty expensive to keep creating over and over again. // How else can this be done though? if (position > BIT_SIZE) { RubyBignum bignum = RubyBignum.newBignum(runtime, value); return bignum.aref(numericPosition); } return newFixnum((value & (1L << position)) == 0 ? 0 : 1); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
fixnumClass.defineMethod("<<", callbackFactory.getMethod(RubyFixnum.class, "op_lshift", IRubyObject.class)); fixnumClass.defineMethod(">>", callbackFactory.getMethod(RubyFixnum.class, "op_rshift", IRubyObject.class)); fixnumClass.defineMethod("+", callbackFactory.getMethod(RubyFixnum.class, "op_plus", IRubyObject.class)); fixnumClass.defineMethod("-", callbackFactory.getMethod(RubyFixnum.class, "op_minus", IRubyObject.class)); fixnumClass.defineMethod("*", callbackFactory.getMethod(RubyFixnum.class, "op_mul", IRubyObject.class)); fixnumClass.defineMethod("/", callbackFactory.getMethod(RubyFixnum.class, "op_div", IRubyObject.class)); fixnumClass.defineMethod("%", callbackFactory.getMethod(RubyFixnum.class, "op_mod", IRubyObject.class)); fixnumClass.defineMethod("**", callbackFactory.getMethod(RubyFixnum.class, "op_pow", IRubyObject.class)); fixnumClass.defineMethod("==", callbackFactory.getMethod(RubyFixnum.class, "equal", IRubyObject.class)); fixnumClass.defineMethod("eql?", callbackFactory.getMethod(RubyFixnum.class, "veryEqual", IRubyObject.class)); fixnumClass.defineMethod("equal?", callbackFactory.getMethod(RubyFixnum.class, "veryEqual", IRubyObject.class)); fixnumClass.defineMethod("<=>", callbackFactory.getMethod(RubyFixnum.class, "op_cmp", IRubyObject.class)); fixnumClass.defineMethod(">", callbackFactory.getMethod(RubyFixnum.class, "op_gt", IRubyObject.class)); fixnumClass.defineMethod(">=", callbackFactory.getMethod(RubyFixnum.class, "op_ge", IRubyObject.class)); fixnumClass.defineMethod("<", callbackFactory.getMethod(RubyFixnum.class, "op_lt", IRubyObject.class)); fixnumClass.defineMethod("<=", callbackFactory.getMethod(RubyFixnum.class, "op_le", IRubyObject.class)); fixnumClass.defineMethod("&", callbackFactory.getMethod(RubyFixnum.class, "op_and", IRubyObject.class)); fixnumClass.defineMethod("|", callbackFactory.getMethod(RubyFixnum.class, "op_or", IRubyObject.class)); fixnumClass.defineMethod("^", callbackFactory.getMethod(RubyFixnum.class, "op_xor", IRubyObject.class)); | fixnumClass.defineMethod("<<", callbackFactory.getMethod(RubyFixnum.class, "op_lshift", RubyNumeric.class)); fixnumClass.defineMethod(">>", callbackFactory.getMethod(RubyFixnum.class, "op_rshift", RubyNumeric.class)); fixnumClass.defineMethod("+", callbackFactory.getMethod(RubyFixnum.class, "op_plus", RubyNumeric.class)); fixnumClass.defineMethod("-", callbackFactory.getMethod(RubyFixnum.class, "op_minus", RubyNumeric.class)); fixnumClass.defineMethod("*", callbackFactory.getMethod(RubyFixnum.class, "op_mul", RubyNumeric.class)); fixnumClass.defineMethod("/", callbackFactory.getMethod(RubyFixnum.class, "op_div", RubyNumeric.class)); fixnumClass.defineMethod("%", callbackFactory.getMethod(RubyFixnum.class, "op_mod", RubyNumeric.class)); fixnumClass.defineMethod("**", callbackFactory.getMethod(RubyFixnum.class, "op_pow", RubyNumeric.class)); fixnumClass.defineMethod("&", callbackFactory.getMethod(RubyFixnum.class, "op_and", RubyNumeric.class)); fixnumClass.defineMethod("|", callbackFactory.getMethod(RubyFixnum.class, "op_or", RubyNumeric.class)); fixnumClass.defineMethod("^", callbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyNumeric.class)); | public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); fixnumClass.defineMethod("to_f", callbackFactory.getMethod(RubyFixnum.class, "to_f")); fixnumClass.defineMethod("to_i", callbackFactory.getMethod(RubyFixnum.class, "to_i")); fixnumClass.defineMethod("to_s", callbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("to_str", callbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("taint", callbackFactory.getMethod(RubyFixnum.class, "taint")); fixnumClass.defineMethod("freeze", callbackFactory.getMethod(RubyFixnum.class, "freeze")); fixnumClass.defineMethod("<<", callbackFactory.getMethod(RubyFixnum.class, "op_lshift", IRubyObject.class)); fixnumClass.defineMethod(">>", callbackFactory.getMethod(RubyFixnum.class, "op_rshift", IRubyObject.class)); fixnumClass.defineMethod("+", callbackFactory.getMethod(RubyFixnum.class, "op_plus", IRubyObject.class)); fixnumClass.defineMethod("-", callbackFactory.getMethod(RubyFixnum.class, "op_minus", IRubyObject.class)); fixnumClass.defineMethod("*", callbackFactory.getMethod(RubyFixnum.class, "op_mul", IRubyObject.class)); fixnumClass.defineMethod("/", callbackFactory.getMethod(RubyFixnum.class, "op_div", IRubyObject.class)); fixnumClass.defineMethod("%", callbackFactory.getMethod(RubyFixnum.class, "op_mod", IRubyObject.class)); fixnumClass.defineMethod("**", callbackFactory.getMethod(RubyFixnum.class, "op_pow", IRubyObject.class)); fixnumClass.defineMethod("==", callbackFactory.getMethod(RubyFixnum.class, "equal", IRubyObject.class)); fixnumClass.defineMethod("eql?", callbackFactory.getMethod(RubyFixnum.class, "veryEqual", IRubyObject.class)); fixnumClass.defineMethod("equal?", callbackFactory.getMethod(RubyFixnum.class, "veryEqual", IRubyObject.class)); fixnumClass.defineMethod("<=>", callbackFactory.getMethod(RubyFixnum.class, "op_cmp", IRubyObject.class)); fixnumClass.defineMethod(">", callbackFactory.getMethod(RubyFixnum.class, "op_gt", IRubyObject.class)); fixnumClass.defineMethod(">=", callbackFactory.getMethod(RubyFixnum.class, "op_ge", IRubyObject.class)); fixnumClass.defineMethod("<", callbackFactory.getMethod(RubyFixnum.class, "op_lt", IRubyObject.class)); fixnumClass.defineMethod("<=", callbackFactory.getMethod(RubyFixnum.class, "op_le", IRubyObject.class)); fixnumClass.defineMethod("&", callbackFactory.getMethod(RubyFixnum.class, "op_and", IRubyObject.class)); fixnumClass.defineMethod("|", callbackFactory.getMethod(RubyFixnum.class, "op_or", IRubyObject.class)); fixnumClass.defineMethod("^", callbackFactory.getMethod(RubyFixnum.class, "op_xor", IRubyObject.class)); fixnumClass.defineMethod("size", callbackFactory.getMethod(RubyFixnum.class, "size")); fixnumClass.defineMethod("[]", callbackFactory.getMethod(RubyFixnum.class, "aref", IRubyObject.class)); fixnumClass.defineMethod("hash", callbackFactory.getMethod(RubyFixnum.class, "hash")); fixnumClass.defineMethod("id2name", callbackFactory.getMethod(RubyFixnum.class, "id2name")); fixnumClass.defineMethod("~", callbackFactory.getMethod(RubyFixnum.class, "invert")); fixnumClass.defineMethod("id", callbackFactory.getMethod(RubyFixnum.class, "id")); fixnumClass.defineSingletonMethod("induced_from", callbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); return fixnumClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
fixnumClass.defineMethod("[]", callbackFactory.getMethod(RubyFixnum.class, "aref", IRubyObject.class)); | fixnumClass.defineMethod("[]", callbackFactory.getMethod(RubyFixnum.class, "aref", RubyNumeric.class)); | public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); fixnumClass.defineMethod("to_f", callbackFactory.getMethod(RubyFixnum.class, "to_f")); fixnumClass.defineMethod("to_i", callbackFactory.getMethod(RubyFixnum.class, "to_i")); fixnumClass.defineMethod("to_s", callbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("to_str", callbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("taint", callbackFactory.getMethod(RubyFixnum.class, "taint")); fixnumClass.defineMethod("freeze", callbackFactory.getMethod(RubyFixnum.class, "freeze")); fixnumClass.defineMethod("<<", callbackFactory.getMethod(RubyFixnum.class, "op_lshift", IRubyObject.class)); fixnumClass.defineMethod(">>", callbackFactory.getMethod(RubyFixnum.class, "op_rshift", IRubyObject.class)); fixnumClass.defineMethod("+", callbackFactory.getMethod(RubyFixnum.class, "op_plus", IRubyObject.class)); fixnumClass.defineMethod("-", callbackFactory.getMethod(RubyFixnum.class, "op_minus", IRubyObject.class)); fixnumClass.defineMethod("*", callbackFactory.getMethod(RubyFixnum.class, "op_mul", IRubyObject.class)); fixnumClass.defineMethod("/", callbackFactory.getMethod(RubyFixnum.class, "op_div", IRubyObject.class)); fixnumClass.defineMethod("%", callbackFactory.getMethod(RubyFixnum.class, "op_mod", IRubyObject.class)); fixnumClass.defineMethod("**", callbackFactory.getMethod(RubyFixnum.class, "op_pow", IRubyObject.class)); fixnumClass.defineMethod("==", callbackFactory.getMethod(RubyFixnum.class, "equal", IRubyObject.class)); fixnumClass.defineMethod("eql?", callbackFactory.getMethod(RubyFixnum.class, "veryEqual", IRubyObject.class)); fixnumClass.defineMethod("equal?", callbackFactory.getMethod(RubyFixnum.class, "veryEqual", IRubyObject.class)); fixnumClass.defineMethod("<=>", callbackFactory.getMethod(RubyFixnum.class, "op_cmp", IRubyObject.class)); fixnumClass.defineMethod(">", callbackFactory.getMethod(RubyFixnum.class, "op_gt", IRubyObject.class)); fixnumClass.defineMethod(">=", callbackFactory.getMethod(RubyFixnum.class, "op_ge", IRubyObject.class)); fixnumClass.defineMethod("<", callbackFactory.getMethod(RubyFixnum.class, "op_lt", IRubyObject.class)); fixnumClass.defineMethod("<=", callbackFactory.getMethod(RubyFixnum.class, "op_le", IRubyObject.class)); fixnumClass.defineMethod("&", callbackFactory.getMethod(RubyFixnum.class, "op_and", IRubyObject.class)); fixnumClass.defineMethod("|", callbackFactory.getMethod(RubyFixnum.class, "op_or", IRubyObject.class)); fixnumClass.defineMethod("^", callbackFactory.getMethod(RubyFixnum.class, "op_xor", IRubyObject.class)); fixnumClass.defineMethod("size", callbackFactory.getMethod(RubyFixnum.class, "size")); fixnumClass.defineMethod("[]", callbackFactory.getMethod(RubyFixnum.class, "aref", IRubyObject.class)); fixnumClass.defineMethod("hash", callbackFactory.getMethod(RubyFixnum.class, "hash")); fixnumClass.defineMethod("id2name", callbackFactory.getMethod(RubyFixnum.class, "id2name")); fixnumClass.defineMethod("~", callbackFactory.getMethod(RubyFixnum.class, "invert")); fixnumClass.defineMethod("id", callbackFactory.getMethod(RubyFixnum.class, "id")); fixnumClass.defineSingletonMethod("induced_from", callbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", IRubyObject.class)); return fixnumClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyNumeric op_and(IRubyObject other) { RubyNumeric otherNumeric = numericValue(other); long otherLong = otherNumeric.getTruncatedLongValue(); return newFixnum(value & otherLong); | public RubyNumeric op_and(RubyNumeric other) { return newFixnum(value & other.getTruncatedLongValue()); | public RubyNumeric op_and(IRubyObject other) { RubyNumeric otherNumeric = numericValue(other); long otherLong = otherNumeric.getTruncatedLongValue(); return newFixnum(value & otherLong); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyNumeric op_div(IRubyObject num) { RubyNumeric other = numericValue(num); | public RubyNumeric op_div(RubyNumeric other) { | public RubyNumeric op_div(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_div(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_div(other); } else { // Java / and % are not the same as ruby long x = getLongValue(); long y = other.getLongValue(); long div = x / y; long mod = x % y; if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) { div -= 1; } return newFixnum(getRuntime(), div); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyInteger op_lshift(IRubyObject num) { RubyNumeric other = numericValue(num); | public RubyInteger op_lshift(RubyNumeric other) { | public RubyInteger op_lshift(IRubyObject num) { RubyNumeric other = numericValue(num); long width = other.getLongValue(); if (width < 0) return op_rshift(other.op_uminus()); if (value > 0) { if (width >= BIT_SIZE - 2 || value >> (BIT_SIZE - width) > 0) { RubyBignum lBigValue = RubyBignum.newBignum(runtime, RubyBignum.bigIntValue(this)); return lBigValue.op_lshift(other); } } else { if (width >= BIT_SIZE - 1 || value >> (BIT_SIZE - width) < -1) { RubyBignum lBigValue = RubyBignum.newBignum(runtime, RubyBignum.bigIntValue(this)); return lBigValue.op_lshift(other); } } return newFixnum(value << width); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyNumeric op_minus(IRubyObject num) { RubyNumeric other = numericValue(num); | public RubyNumeric op_minus(RubyNumeric other) { | public RubyNumeric op_minus(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_minus(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } else { long otherValue = other.getLongValue(); long result = value - otherValue; if ((value <= 0 && otherValue >= 0 && (result > 0 || result < -MAX)) || (value >= 0 && otherValue <= 0 && (result < 0 || result > MAX))) { return RubyBignum.newBignum(getRuntime(), value).op_minus(other); } return newFixnum(result); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyNumeric op_mod(IRubyObject num) { RubyNumeric other = numericValue(num); | public RubyNumeric op_mod(RubyNumeric other) { | public RubyNumeric op_mod(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_mod(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_mod(other); } else { // Java / and % are not the same as ruby long x = getLongValue(); long y = other.getLongValue(); long div = x / y; long mod = x % y; if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) { mod += y; } return newFixnum(getRuntime(), mod); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyNumeric op_mul(IRubyObject num) { return numericValue(num).multiplyWith(this); | public RubyNumeric op_mul(RubyNumeric other) { return other.multiplyWith(this); | public RubyNumeric op_mul(IRubyObject num) { return numericValue(num).multiplyWith(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyInteger op_or(IRubyObject other) { | public RubyInteger op_or(RubyNumeric other) { | public RubyInteger op_or(IRubyObject other) { if (other instanceof RubyBignum) { return (RubyInteger) other.callMethod("|", this); } RubyNumeric otherNumeric = numericValue(other); return newFixnum(value | otherNumeric.getLongValue()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
RubyNumeric otherNumeric = numericValue(other); return newFixnum(value | otherNumeric.getLongValue()); | return newFixnum(value | other.getLongValue()); | public RubyInteger op_or(IRubyObject other) { if (other instanceof RubyBignum) { return (RubyInteger) other.callMethod("|", this); } RubyNumeric otherNumeric = numericValue(other); return newFixnum(value | otherNumeric.getLongValue()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyNumeric op_plus(IRubyObject num) { RubyNumeric other = numericValue(num); | public RubyNumeric op_plus(RubyNumeric other) { | public RubyNumeric op_plus(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return ((RubyFloat)other).op_plus(this); } else if (other instanceof RubyBignum) { return ((RubyBignum)other).op_plus(this); } else { long otherValue = other.getLongValue(); long result = value + otherValue; if ((value < 0 && otherValue < 0 && (result > 0 || result < -MAX)) || (value > 0 && otherValue > 0 && (result < 0 || result > MAX))) { return RubyBignum.newBignum(getRuntime(), value).op_plus(other); } return newFixnum(result); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyNumeric op_pow(IRubyObject num) { RubyNumeric other = numericValue(num); | public RubyNumeric op_pow(RubyNumeric other) { | public RubyNumeric op_pow(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_pow(other); } else { if (other.getLongValue() == 0) { return newFixnum(getRuntime(), 1); } else if (other.getLongValue() == 1) { return this; } else if (other.getLongValue() > 1) { return RubyBignum.newBignum(getRuntime(), getLongValue()).op_pow(other); } else { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_pow(other); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyInteger op_rshift(IRubyObject num) { RubyNumeric other = numericValue(num); | public RubyInteger op_rshift(RubyNumeric other) { | public RubyInteger op_rshift(IRubyObject num) { RubyNumeric other = numericValue(num); long width = other.getLongValue(); if (width < 0) return op_lshift(other.op_uminus()); return newFixnum(value >> width); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RubyInteger op_xor(IRubyObject other) { | public RubyInteger op_xor(RubyNumeric other) { | public RubyInteger op_xor(IRubyObject other) { if (other instanceof RubyBignum) { return (RubyInteger) other.callMethod("^", this); } RubyNumeric otherNumeric = numericValue(other); return newFixnum(value ^ otherNumeric.getLongValue()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
RubyNumeric otherNumeric = numericValue(other); return newFixnum(value ^ otherNumeric.getLongValue()); | return newFixnum(value ^ other.getLongValue()); | public RubyInteger op_xor(IRubyObject other) { if (other instanceof RubyBignum) { return (RubyInteger) other.callMethod("^", this); } RubyNumeric otherNumeric = numericValue(other); return newFixnum(value ^ otherNumeric.getLongValue()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyFixnum.java/buggy/src/org/jruby/RubyFixnum.java |
public RaiseException newNameError(String message) { | public RaiseException newNameError(String message, String name) { | public RaiseException newNameError(String message) { throw new MockException(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/BaseMockRuby.java/clean/test/org/jruby/test/BaseMockRuby.java |
public RaiseException newNoMethodError(String message) { | public RaiseException newNoMethodError(String message, String name) { | public RaiseException newNoMethodError(String message) { throw new MockException(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/BaseMockRuby.java/clean/test/org/jruby/test/BaseMockRuby.java |
kernelModule.defineMethod("sleep", callbackFactory.getSingletonMethod(KernelModule.class, "sleep", IRubyObject.class)); | kernelModule.defineMethod("sleep", callbackFactory.getSingletonMethod(KernelModule.class, "sleep", RubyNumeric.class)); | public static RubyModule createKernelModule(Ruby ruby) { RubyModule kernelModule = ruby.defineModule("Kernel"); CallbackFactory callbackFactory = ruby.callbackFactory(); kernelModule.defineMethod("Array", callbackFactory.getSingletonMethod(KernelModule.class, "new_array", IRubyObject.class)); kernelModule.defineMethod("autoload", callbackFactory.getSingletonMethod(KernelModule.class, "autoload", IRubyObject.class, IRubyObject.class)); kernelModule.defineMethod("`", callbackFactory.getSingletonMethod(KernelModule.class, "backquote", IRubyObject.class)); kernelModule.defineMethod("block_given?", callbackFactory.getSingletonMethod(KernelModule.class, "block_given")); kernelModule.defineMethod("iterator?", callbackFactory.getSingletonMethod(KernelModule.class, "block_given")); kernelModule.defineMethod("caller", callbackFactory.getOptSingletonMethod(KernelModule.class, "caller")); kernelModule.defineMethod("catch", callbackFactory.getSingletonMethod(KernelModule.class, "rbCatch", IRubyObject.class)); kernelModule.defineMethod("chomp", callbackFactory.getOptSingletonMethod(KernelModule.class, "chomp")); kernelModule.defineMethod("chomp!", callbackFactory.getOptSingletonMethod(KernelModule.class, "chomp_bang")); kernelModule.defineMethod("chop", callbackFactory.getSingletonMethod(KernelModule.class, "chop")); kernelModule.defineMethod("chop!", callbackFactory.getSingletonMethod(KernelModule.class, "chop_bang")); kernelModule.defineMethod("eval", callbackFactory.getOptSingletonMethod(KernelModule.class, "eval")); kernelModule.defineMethod("exit", callbackFactory.getOptSingletonMethod(KernelModule.class, "exit")); kernelModule.defineMethod("Float", callbackFactory.getSingletonMethod(KernelModule.class, "new_float", IRubyObject.class)); kernelModule.defineMethod("format", callbackFactory.getOptSingletonMethod(KernelModule.class, "sprintf")); kernelModule.defineMethod("gets", callbackFactory.getOptSingletonMethod(KernelModule.class, "gets")); kernelModule.defineMethod("global_variables", callbackFactory.getSingletonMethod(KernelModule.class, "global_variables")); kernelModule.defineMethod("gsub", callbackFactory.getOptSingletonMethod(KernelModule.class, "gsub")); kernelModule.defineMethod("gsub!", callbackFactory.getOptSingletonMethod(KernelModule.class, "gsub_bang")); kernelModule.defineMethod("Integer", callbackFactory.getSingletonMethod(KernelModule.class, "new_integer", IRubyObject.class)); kernelModule.defineMethod("lambda", callbackFactory.getSingletonMethod(KernelModule.class, "proc")); kernelModule.defineMethod("load", callbackFactory.getOptSingletonMethod(KernelModule.class, "load")); kernelModule.defineMethod("local_variables", callbackFactory.getSingletonMethod(KernelModule.class, "local_variables")); kernelModule.defineMethod("loop", callbackFactory.getSingletonMethod(KernelModule.class, "loop")); kernelModule.defineMethod("open", callbackFactory.getOptSingletonMethod(KernelModule.class, "open")); kernelModule.defineMethod("p", callbackFactory.getOptSingletonMethod(KernelModule.class, "p")); kernelModule.defineMethod("puts", callbackFactory.getOptSingletonMethod(KernelModule.class, "puts")); kernelModule.defineMethod("print", callbackFactory.getOptSingletonMethod(KernelModule.class, "print")); kernelModule.defineMethod("printf", callbackFactory.getOptSingletonMethod(KernelModule.class, "printf")); kernelModule.defineMethod("proc", callbackFactory.getSingletonMethod(KernelModule.class, "proc")); kernelModule.defineMethod("raise", callbackFactory.getOptSingletonMethod(KernelModule.class, "raise")); kernelModule.defineMethod("rand", callbackFactory.getOptSingletonMethod(KernelModule.class, "rand")); kernelModule.defineMethod("readline", callbackFactory.getOptSingletonMethod(KernelModule.class, "readline")); kernelModule.defineMethod("readlines", callbackFactory.getOptSingletonMethod(KernelModule.class, "readlines")); kernelModule.defineMethod("require", callbackFactory.getSingletonMethod(KernelModule.class, "require", IRubyObject.class)); kernelModule.defineMethod("scan", callbackFactory.getSingletonMethod(KernelModule.class, "scan", IRubyObject.class)); kernelModule.defineMethod("set_trace_func", callbackFactory.getSingletonMethod(KernelModule.class, "set_trace_func", IRubyObject.class)); kernelModule.defineMethod("singleton_method_added", callbackFactory.getSingletonMethod(KernelModule.class, "singleton_method_added", IRubyObject.class)); kernelModule.defineMethod("sleep", callbackFactory.getSingletonMethod(KernelModule.class, "sleep", IRubyObject.class)); kernelModule.defineMethod("split", callbackFactory.getOptSingletonMethod(KernelModule.class, "split")); kernelModule.defineMethod("sprintf", callbackFactory.getOptSingletonMethod(KernelModule.class, "sprintf")); kernelModule.defineMethod("srand", callbackFactory.getOptSingletonMethod(KernelModule.class, "srand")); kernelModule.defineMethod("String", callbackFactory.getSingletonMethod(KernelModule.class, "new_string", IRubyObject.class)); kernelModule.defineMethod("sub", callbackFactory.getOptSingletonMethod(KernelModule.class, "sub")); kernelModule.defineMethod("sub!", callbackFactory.getOptSingletonMethod(KernelModule.class, "sub_bang")); kernelModule.defineMethod("system", callbackFactory.getOptSingletonMethod(KernelModule.class, "system")); kernelModule.defineMethod("throw", callbackFactory.getOptSingletonMethod(KernelModule.class, "rbThrow")); return kernelModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/KernelModule.java/clean/src/org/jruby/KernelModule.java |
public static IRubyObject sleep(IRubyObject recv, IRubyObject seconds) { | public static IRubyObject sleep(IRubyObject recv, RubyNumeric seconds) { | public static IRubyObject sleep(IRubyObject recv, IRubyObject seconds) { try { Thread.sleep((long) (RubyNumeric.numericValue(seconds).getDoubleValue() * 1000.0)); } catch (InterruptedException iExcptn) { } return recv; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/KernelModule.java/clean/src/org/jruby/KernelModule.java |
Thread.sleep((long) (RubyNumeric.numericValue(seconds).getDoubleValue() * 1000.0)); | Thread.sleep((long) (seconds.getDoubleValue() * 1000.0)); | public static IRubyObject sleep(IRubyObject recv, IRubyObject seconds) { try { Thread.sleep((long) (RubyNumeric.numericValue(seconds).getDoubleValue() * 1000.0)); } catch (InterruptedException iExcptn) { } return recv; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/KernelModule.java/clean/src/org/jruby/KernelModule.java |
public VALUE nd_lit() { return (VALUE)u1; } | public RubyObject nd_lit() { return (RubyObject)u1; } | public VALUE nd_lit() { return (VALUE)u1; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/NODE.java/clean/org/jruby/original/NODE.java |
if ( klass == null ) throw new ApiUsageException( "Class argument to find cannot be null." ); | public IObject find(@NotNull final Class klass, final long id) { if ( klass == null ) throw new ApiUsageException( "Class argument to find cannot be null." ); return (IObject) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { IObject o = (IObject) session.get(klass,id); Hibernate.initialize(o); return o; } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/QueryImpl.java/buggy/components/server/src/ome/logic/QueryImpl.java |
|
public List findAllByExample(final IObject example, final Filter filter) | public List findAllByExample(@NotNull final IObject example, final Filter filter) | public List findAllByExample(final IObject example, final Filter filter) { if ( example == null ) throw new ApiUsageException( "Example argument to findAllByExample cannot be null."); return (List) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Criteria c = session.createCriteria(example.getClass()); c.add(Example.create(example)); parseFilter(c,filter); return c.list(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/QueryImpl.java/buggy/components/server/src/ome/logic/QueryImpl.java |
if ( example == null ) throw new ApiUsageException( "Example argument to findAllByExample cannot be null."); | public List findAllByExample(final IObject example, final Filter filter) { if ( example == null ) throw new ApiUsageException( "Example argument to findAllByExample cannot be null."); return (List) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Criteria c = session.createCriteria(example.getClass()); c.add(Example.create(example)); parseFilter(c,filter); return c.list(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/QueryImpl.java/buggy/components/server/src/ome/logic/QueryImpl.java |
|
if ( example == null ) throw new ApiUsageException( "Example argument to findByExample cannot be null."); | public IObject findByExample(@NotNull final IObject example) throws ApiUsageException { if ( example == null ) throw new ApiUsageException( "Example argument to findByExample cannot be null."); return (IObject) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Criteria c = session.createCriteria(example.getClass()); c.add(Example.create(example)); return c.uniqueResult(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/QueryImpl.java/buggy/components/server/src/ome/logic/QueryImpl.java |
|
} catch (NonUniqueResultException nure) { throw new ApiUsageException( "Query named:\n\t"+queryName+"\n" + "has returned more than one Object\n" + "findByQuery must return a single value.\n" + "Please try findAllByQuery for queries which return Lists." ); | public IObject findByQuery(@NotNull String queryName, Parameters params) throws ValidationException { // specify that we should only return a single value if possible params.getFilter().unique(); Query<IObject> q = queryFactory.lookup( queryName, params ); IObject result = null; try { result = execute(q); } catch (ClassCastException cce) { throw new ApiUsageException( "Query named:\n\t"+queryName+"\n" + "has returned an Object of type "+cce.getMessage()+"\n" + "Queries must return IObjects when using findByQuery. \n" + "Please try findAllByQuery for queries which return Lists." ); } return result; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/QueryImpl.java/buggy/components/server/src/ome/logic/QueryImpl.java |
|
{ int b = control.getGlobalMaximum(); int c = control.getGlobalMinimum(); int y = x-tW; double a = (c-b)/ (double) rangeGraphics; int r = (int) (a*y+b); if (r < c) r = c; if (r > b) r = b; return r; } | { int b = control.getGlobalMaximum(); int c = control.getGlobalMinimum(); int y = x-tW; double a = (c-b)/ (double) rangeGraphics; int r = (int) (a*y+b); if (r < c) r = c; if (r > b) r = b; return r; } | int convertGraphicsIntoReal(int x) { int b = control.getGlobalMaximum(); int c = control.getGlobalMinimum(); int y = x-tW; double a = (c-b)/ (double) rangeGraphics; //b/c of the way values are computed. int r = (int) (a*y+b); if (r < c) r = c; if (r > b) r = b; return r; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
{ Point p = e.getPoint(); if (dragging) { if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { | { Point p = e.getPoint(); if (dragging) { if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { | public void mouseDragged(MouseEvent e) { Point p = e.getPoint(); if (dragging) { if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { inputStartKnob = true; inputEndKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; inputStartKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; inputStartKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } } | curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; inputStartKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } } | public void mouseDragged(MouseEvent e) { Point p = e.getPoint(); if (dragging) { if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { inputStartKnob = true; inputEndKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; inputStartKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
{ Point p = e.getPoint(); if (!dragging) { dragging = true; if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { inputStartKnob = true; | { Point p = e.getPoint(); if (!dragging) { dragging = true; if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { inputStartKnob = true; | public void mousePressed(MouseEvent e) { Point p = e.getPoint(); if (!dragging) { dragging = true; if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { inputStartKnob = true; inputEndKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; inputStartKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } //else dragging already in progress } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; | curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; | public void mousePressed(MouseEvent e) { Point p = e.getPoint(); if (!dragging) { dragging = true; if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { inputStartKnob = true; inputEndKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; inputStartKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } //else dragging already in progress } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } } | curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } } | public void mousePressed(MouseEvent e) { Point p = e.getPoint(); if (!dragging) { dragging = true; if (boxInputStart.contains(p) && p.y >= minEndInputY && p.y <= absStart) { inputStartKnob = true; inputEndKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowStart(curRealValue); } if (boxInputEnd.contains(p) && p.y <= maxStartInputY && p.y >= absEnd) { inputEndKnob = true; inputStartKnob = false; curRealValue = convertGraphicsIntoReal(p.y); control.setInputWindowEnd(curRealValue); } } //else dragging already in progress } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
{ if (inputStartKnob) control.setChannelWindowStart(curRealValue); else if (inputEndKnob) control.setChannelWindowEnd(curRealValue); dragging = false; inputStartKnob = false; inputEndKnob = false; } | { if (inputStartKnob) control.setChannelWindowStart(curRealValue); else if (inputEndKnob) control.setChannelWindowEnd(curRealValue); dragging = false; inputStartKnob = false; inputEndKnob = false; } | public void mouseReleased(MouseEvent e) { if (inputStartKnob) control.setChannelWindowStart(curRealValue); else if (inputEndKnob) control.setChannelWindowEnd(curRealValue); dragging = false; inputStartKnob = false; inputEndKnob = false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.