rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
{ Long n = null; if (data instanceof ImageData) { type = ImageData.class; n = ((ImageData) data).getAnnotationCount(); } else if (data instanceof DatasetData) { type = DatasetData.class; n = ((DatasetData) data).getAnnotationCount(); } if (n == null) return false; return (n.longValue() != 0); } | { Long n = null; if (data instanceof ImageData) { type = ImageData.class; n = ((ImageData) data).getAnnotationCount(); } else if (data instanceof DatasetData) { type = DatasetData.class; n = ((DatasetData) data).getAnnotationCount(); } if (n == null) return false; return (n.longValue() != 0); } | private boolean isObjectAnnotated(DataObject data) { Long n = null; if (data instanceof ImageData) { type = ImageData.class; n = ((ImageData) data).getAnnotationCount(); } else if (data instanceof DatasetData) { type = DatasetData.class; n = ((DatasetData) data).getAnnotationCount(); } if (n == null) return false; return (n.longValue() != 0); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorModel.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorModel.java |
setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 10)); | manager.getView().repaint(); | void showImages(List images) { removeAll(); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(Box.createRigidArea(DataManagerUIF.VBOX)); add(componentsPanel); add(Box.createRigidArea(DataManagerUIF.VBOX)); if (images != null && images.size() != 0) { add(buildImagesPanel(images)); setButtonsEnabled(true); } setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 10)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d70386d4b1bd44d70716a6be05a1c87ff487476d/CreateDatasetImagesPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/dataset/CreateDatasetImagesPane.java |
menu.add(new JMenuItem(controller.getAction(HiViewer.CLEAR))); | private JMenu createEditMenu() { JMenu menu = new JMenu("Edit"); menu.setMnemonic(KeyEvent.VK_E); menu.add(new JMenuItem(controller.getAction(HiViewer.FIND))); menu.add(new JMenuItem(controller.getAction(HiViewer.CLEAR))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(HiViewer.VIEW))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(createClassifySubMenu()); menu.add(new JMenuItem( controller.getAction(HiViewer.ANNOTATE))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(HiViewer.PROPERTIES))); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64ee7ec527da3cc538fcd8d0a21183719f854676/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java |
|
menu.setMnemonic(KeyEvent.VK_H); | menu.setMnemonic(KeyEvent.VK_F); | private JMenu createFileMenu() { JMenu menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_H); menu.add(new JMenuItem( controller.getAction(HiViewer.SAVE_THUMB))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(HiViewer.EXIT))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction(HiViewer.REFRESH))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction( HiViewer.EXIT_APPLICATION))); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64ee7ec527da3cc538fcd8d0a21183719f854676/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java |
menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction( HiViewer.EXIT_APPLICATION))); | private JMenu createFileMenu() { JMenu menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_H); menu.add(new JMenuItem( controller.getAction(HiViewer.SAVE_THUMB))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(HiViewer.EXIT))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction(HiViewer.REFRESH))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem(controller.getAction( HiViewer.EXIT_APPLICATION))); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64ee7ec527da3cc538fcd8d0a21183719f854676/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java |
|
windowsMenu = new JMenu("Windows"); | windowsMenu = new JMenu("Window"); | private void createWindowsMenu() { windowsMenu = new JMenu("Windows"); windowsMenu.setMnemonic(KeyEvent.VK_W); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64ee7ec527da3cc538fcd8d0a21183719f854676/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java |
javaObject = ((RubyString) object).getValue(); | javaObject = ((RubyString) object).toString(); | public static IRubyObject primitive_to_java(IRubyObject recv, IRubyObject object) { if (object instanceof JavaObject) { return object; } IRuby runtime = recv.getRuntime(); Object javaObject; if (object.isNil()) { javaObject = null; } else if (object instanceof RubyFixnum) { javaObject = new Long(((RubyFixnum) object).getLongValue()); } else if (object instanceof RubyBignum) { javaObject = ((RubyBignum) object).getValue(); } else if (object instanceof RubyFloat) { javaObject = new Double(((RubyFloat) object).getValue()); } else if (object instanceof RubyString) { javaObject = ((RubyString) object).getValue(); } else if (object instanceof RubyBoolean) { javaObject = Boolean.valueOf(object.isTrue()); } else if (object instanceof RubyTime) { long milliseconds = ((RubyNumeric) object.callMethod("to_i")).getLongValue(); javaObject = new Date(milliseconds); } else { javaObject = object; } return JavaObject.wrap(runtime, javaObject); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/Java.java/buggy/src/org/jruby/javasupport/Java.java |
BigInteger[] results = getValue().divideAndRemainder(bigIntValue((RubyNumeric) other)); | BigInteger otherBig = bigIntValue((RubyNumeric) other); if (otherBig.equals(BigInteger.ZERO)) { throw getRuntime().newZeroDivisionError(); } BigInteger[] results = getValue().divideAndRemainder(otherBig); | public IRubyObject op_div(IRubyObject other) { if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_div(other); } else if (other instanceof RubyNumeric) { BigInteger[] results = getValue().divideAndRemainder(bigIntValue((RubyNumeric) other)); if (results[0].compareTo(BigInteger.ZERO) <= 0 && results[1].compareTo(BigInteger.ZERO) != 0) { return bigNorm(getRuntime(), results[0].subtract(BigInteger.ONE)); } return bigNorm(getRuntime(), results[0]); } return callCoerced("/", other); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1a99d1af5cf0ec0affd4f78b7cf07aa50ed18d98/RubyBignum.java/clean/src/org/jruby/RubyBignum.java |
MultilineLabel message = new MultilineLabel(msg); | JTextPane message = UIUtilities.buildTextPane(msg);; | private void buildMessagePanel(String msg, Icon msgIcon) { messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.X_AXIS)); messagePanel.setOpaque(false); if (msgIcon != null) { JLabel iconLabel = new JLabel(msgIcon); iconLabel.setAlignmentY(TOP_ALIGNMENT); JPanel p = UIUtilities.buildComponentPanel(iconLabel); p.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(p); messagePanel.add(Box.createRigidArea(H_SPACER_SIZE)); } MultilineLabel message = new MultilineLabel(msg); message.setOpaque(false); message.setPreferredSize(MSG_AREA_SIZE); message.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(UIUtilities.buildComponentPanelRight(message)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/OptionsDialog.java/clean/SRC/org/openmicroscopy/shoola/util/ui/OptionsDialog.java |
Set dataObjects = new HashSet(); for (Iterator i = result.iterator(); i.hasNext();) { Object obj = i.next(); if (obj instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) obj; dataObjects.add(AdapterUtils.go(cg)); } else if (obj instanceof Category) { Category ca = (Category) obj; dataObjects.add(AdapterUtils.go(ca)); } else if (obj instanceof Image) { Image img = (Image) obj; dataObjects.add(AdapterUtils.go(img)); } else { throw new RuntimeException("Method returned unexpected value type:" + obj.getClass() ); } } return dataObjects; | return AdapterUtils.adaptFoundCGCIHierarchies(result); | public Set findCGCIHierarchies(Set imgIDs) { Set result = proxiedInterface.findCGCIHierarchies(imgIDs); Set dataObjects = new HashSet(); for (Iterator i = result.iterator(); i.hasNext();) { Object obj = i.next(); if (obj instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) obj; dataObjects.add(AdapterUtils.go(cg)); } else if (obj instanceof Category) { Category ca = (Category) obj; dataObjects.add(AdapterUtils.go(ca)); } else if (obj instanceof Image) { Image img = (Image) obj; dataObjects.add(AdapterUtils.go(img)); } else { throw new RuntimeException("Method returned unexpected value type:" + obj.getClass() ); } } return dataObjects; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
return goDatasetAnnotations(result); | return AdapterUtils.adaptFoundDatasetAnnotations(result); | public Map findDatasetAnnotations(Set datasetIDs) { Map result = proxiedInterface.findDatasetAnnotations(datasetIDs); return goDatasetAnnotations(result); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
return goDatasetAnnotations(result); | return AdapterUtils.adaptFoundDatasetAnnotations(result); | public Map findDatasetAnnotationsForExperimenter(Set datasetIDs, int experimenterID) { Map result = proxiedInterface.findDatasetAnnotationsForExperimenter(datasetIDs,experimenterID); return goDatasetAnnotations(result); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
return goImageAnnotations(result); | return AdapterUtils.adaptFoundImageAnnotations(result); | public Map findImageAnnotations(Set imgIDs) { Map result = proxiedInterface.findImageAnnotations(imgIDs); return goImageAnnotations(result); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
return goImageAnnotations(result); | return AdapterUtils.adaptFoundImageAnnotations(result); | public Map findImageAnnotationsForExperimenter(Set imgIDs, int experimenterID) { Map result = proxiedInterface.findImageAnnotationsForExperimenter(imgIDs,experimenterID); return goImageAnnotations(result); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
Set dataObjects = new HashSet(); for (Iterator i = result.iterator(); i.hasNext();) { Object obj = i.next(); if (obj instanceof Project) { Project prj = (Project) obj; dataObjects.add(AdapterUtils.go(prj)); } else if (obj instanceof Dataset) { Dataset ds = (Dataset) obj; dataObjects.add(AdapterUtils.go(ds)); } else if (obj instanceof Image) { Image img = (Image) obj; dataObjects.add(AdapterUtils.go(img)); } else { throw new RuntimeException("Method returned unexpected value type:" + obj.getClass() ); } } return dataObjects; | return AdapterUtils.adaptFoundPDIHierarchies(result); | public Set findPDIHierarchies(Set imgIDs) { Set result = proxiedInterface.findPDIHierarchies(imgIDs); Set dataObjects = new HashSet(); for (Iterator i = result.iterator(); i.hasNext();) { Object obj = i.next(); if (obj instanceof Project) { Project prj = (Project) obj; dataObjects.add(AdapterUtils.go(prj)); } else if (obj instanceof Dataset) { Dataset ds = (Dataset) obj; dataObjects.add(AdapterUtils.go(ds)); } else if (obj instanceof Image) { Image img = (Image) obj; dataObjects.add(AdapterUtils.go(img)); } else { throw new RuntimeException("Method returned unexpected value type:" + obj.getClass() ); } } return dataObjects; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
if (rootNodeType.equals(CategoryGroup.class)){ return AdapterUtils.go((CategoryGroup) result); } else if (rootNodeType.equals(Category.class)){ return AdapterUtils.go((Category) result); } else { throw new IllegalArgumentException("Method only takes CategoryGroup and Category as argument."); } | return AdapterUtils.adaptLoadedCGCIHierarchy(rootNodeType,result); | public DataObject loadCGCIHierarchy(Class rootNodeType, int rootNodeID) { Object result = proxiedInterface.loadCGCIHierarchy(rootNodeType, rootNodeID); if (rootNodeType.equals(CategoryGroup.class)){ return AdapterUtils.go((CategoryGroup) result); } else if (rootNodeType.equals(Category.class)){ return AdapterUtils.go((Category) result); } else { throw new IllegalArgumentException("Method only takes CategoryGroup and Category as argument."); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
if (rootNodeType.equals(Project.class)){ return AdapterUtils.go((Project) result); } else if (rootNodeType.equals(Dataset.class)){ return AdapterUtils.go((Dataset) result); } else { throw new IllegalArgumentException("Method only takes Project and Dataset as argument."); } | return AdapterUtils.adaptLoadedPDIHierarchy(rootNodeType,result); | public DataObject loadPDIHierarchy(Class rootNodeType, int rootNodeID) { Object result = proxiedInterface.loadPDIHierarchy(rootNodeType, rootNodeID); if (rootNodeType.equals(Project.class)){ return AdapterUtils.go((Project) result); } else if (rootNodeType.equals(Dataset.class)){ return AdapterUtils.go((Dataset) result); } else { throw new IllegalArgumentException("Method only takes Project and Dataset as argument."); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingAdapter.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/HierarchyBrowsingAdapter.java |
super.repaint(); | repaint(); | void updateOutputStart(int y) { yStartOutput1 = y; yStartOutput2 = y-triangleW; yStartOutput3 = y+triangleW; startPt.setLocation(startPt.getX(), (double) y); super.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6a28b54c142c80cf786f76c45b6be256d92fd0bb/PlaneSlicingPanel.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/PlaneSlicingPanel.java |
super.repaint(); | repaint(); | void updateOutputEnd(int y) { yEndOutput1 = y; yEndOutput2 = y-triangleW; yEndOutput3 = y+triangleW; endPt.setLocation(endPt.getX(), (double) y); super.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6a28b54c142c80cf786f76c45b6be256d92fd0bb/PlaneSlicingPanel.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/PlaneSlicingPanel.java |
return JavaUtil.convertJavaToRuby(ruby, bean.bean, bean.type); } | return JavaUtil.convertJavaToRuby(ruby, bean.bean, bean.type); } | public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return JavaUtil.convertJavaToRuby(ruby, bean.bean, bean.type); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/DeclaredBeanGetMethod.java/clean/org/jruby/javasupport/bsf/DeclaredBeanGetMethod.java |
public Quantization_8_16_bit(QuantumDef qd, PixelsType type) | public Quantization_8_16_bit(QuantumDef qd, PixelsType type, IPixels iPixels) | public Quantization_8_16_bit(QuantumDef qd, PixelsType type) { super(qd, type); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/Quantization_8_16_bit.java/buggy/components/rendering/src/omeis/providers/re/quantum/Quantization_8_16_bit.java |
super(qd, type); | super(qd, type, iPixels); | public Quantization_8_16_bit(QuantumDef qd, PixelsType type) { super(qd, type); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/Quantization_8_16_bit.java/buggy/components/rendering/src/omeis/providers/re/quantum/Quantization_8_16_bit.java |
ClassLoader beanClassLoader = getBeanDefinitionReader().getBeanClassLoader(); if (beanClassLoader != null) { try { return beanClassLoader.loadClass(name); } catch (ClassNotFoundException e) { } } | protected Class loadClass(String name) throws ClassNotFoundException { ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); if (contextClassLoader != null) { try { return contextClassLoader.loadClass(name); } catch (ClassNotFoundException e) { } } return getClass().getClassLoader().loadClass(name); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/0f765a7bedde7f59bcd721b233ad6b3b7425a5cb/XBeanXmlBeanDefinitionParser.java/buggy/spring/src/java/org/xbean/spring/context/impl/XBeanXmlBeanDefinitionParser.java |
|
String[][] stats = new String[2][8]; for (int i = 0; i < 8; i++) { | String[][] stats = new String[2][9]; for (int i = 0; i < 9; i++) { | public String[][] getROIStats() { String[][] stats = new String[2][8]; for (int i = 0; i < 8; i++) { stats[0][i] = ""+i; stats[1][i] = ""+2*i; } return stats; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/74972fca5ec76d6623e0be08ab05d77ca21eddc1/ROIAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/ROIAgtCtrl.java |
private UnregisterServiceManager(ServiceManager serviceManager, StopStrategy stopStrategy, Throwable[] futureThrowable) { | private UnregisterServiceManager(ServiceManager serviceManager, StopStrategy stopStrategy) { | private UnregisterServiceManager(ServiceManager serviceManager, StopStrategy stopStrategy, Throwable[] futureThrowable) { this.serviceManager = serviceManager; this.stopStrategy = stopStrategy; this.futureThrowable = futureThrowable; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/StandardKernel.java/buggy/kernel/src/java/org/gbean/kernel/standard/StandardKernel.java |
this.futureThrowable = futureThrowable; | private UnregisterServiceManager(ServiceManager serviceManager, StopStrategy stopStrategy, Throwable[] futureThrowable) { this.serviceManager = serviceManager; this.stopStrategy = stopStrategy; this.futureThrowable = futureThrowable; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/StandardKernel.java/buggy/kernel/src/java/org/gbean/kernel/standard/StandardKernel.java |
|
synchronized (futureThrowable) { futureThrowable[0] = e; | synchronized (this) { throwable = e; | public Object call() { try { serviceManager.destroy(stopStrategy); synchronized (serviceManagers) { serviceManagers.remove(serviceManager.getServiceName()); } return null; } catch (Throwable e) { // we did not destroy the service... save the exception and return the service manager // so it remains registered with the kernel synchronized (futureThrowable) { futureThrowable[0] = e; } return serviceManager; } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/StandardKernel.java/buggy/kernel/src/java/org/gbean/kernel/standard/StandardKernel.java |
if(attributeName == null || elementName == null) { return; } | private void recalibrateScale() { if(currentScaleName.equals(Scale.LINEAR_SCALE)) { currentScale = new LinearScale(gradient.getMin(),gradient.getMax()); } else if(currentScaleName.equals(Scale.LOGARITHMIC_SCALE)) { currentScale = new LogarithmicScale(gradient.getMin(),gradient.getMax()); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bb13c9484826e4d7b149c8ce9e1aa9a3fc55a6d2/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
|
browserModel.setLayoutMethod(new GraphLayoutMethod(stats)); | if(stats != null && stats.length > 0) { browserModel.setLayoutMethod(new GraphLayoutMethod(stats)); } | public void showGraphView() { if(attributeName != null && elementName != null) { BrowserModel browserModel = model.getInfoSource(); List thumbList = browserModel.getThumbnails(); Thumbnail[] thumbnails = new Thumbnail[thumbList.size()]; thumbList.toArray(thumbnails); ThumbnailDataPair[] stats = ThumbnailStatistics.sortByValue(thumbnails,currentMode, attributeName,elementName); browserModel.setLayoutMethod(new GraphLayoutMethod(stats)); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bb13c9484826e4d7b149c8ce9e1aa9a3fc55a6d2/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
if (state.runtime.getClass("Module").getConstant(iVisited.getName(), false) != null) { definition = "constant"; | try { state.runtime.getClass("Module").getConstant(iVisited.getName()); } catch (RaiseException re) { if (re.getException().isKindOf(state.runtime.getClass("NameError"))) { return null; } throw re; | public Instruction visitConstNode(ConstNode iVisited) { if (state.runtime.getClass("Module").getConstant(iVisited.getName(), false) != null) { definition = "constant"; } return null; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/DefinedVisitor.java/buggy/src/org/jruby/evaluator/DefinedVisitor.java |
definition = "constant"; | public Instruction visitConstNode(ConstNode iVisited) { if (state.runtime.getClass("Module").getConstant(iVisited.getName(), false) != null) { definition = "constant"; } return null; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/DefinedVisitor.java/buggy/src/org/jruby/evaluator/DefinedVisitor.java |
|
stop(); | final public synchronized void destroy() { _wm.destroy(); _wm = null; _started = false; super.destroy(); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/54ae4f480a1f98023740a9a059aa0c18066419b3/WMServlet.java/buggy/webmacro/src/org/webmacro/servlet/WMServlet.java |
|
newElement = new JMenuItem( controller.getAction(TreeViewerControl.CREATE_OBJECT)); | TreeViewerAction a = controller.getAction(TreeViewerControl.CREATE_OBJECT); newElement = new JMenuItem(a); newElement.setText(a.getActionName()); | private void initComponents() { newElement = new JMenuItem( controller.getAction(TreeViewerControl.CREATE_OBJECT)); initMenuItem(newElement); copyElement = new JMenuItem( controller.getAction(TreeViewerControl.COPY_OBJECT)); initMenuItem(newElement); pasteElement = new JMenuItem( controller.getAction(TreeViewerControl.PASTE_OBJECT)); initMenuItem(newElement); deleteElement = new JMenuItem( controller.getAction(TreeViewerControl.DELETE_OBJECT)); initMenuItem(newElement); existingElement = new JMenuItem( controller.getAction(TreeViewerControl.ADD_OBJECT)); initMenuItem(existingElement); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/ManagePopupMenu.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/ManagePopupMenu.java |
public DisplayedNote(NoteTreeNode treeNode, Note note) { this.treeNode = treeNode; | public DisplayedNote(DisplayedNote parent, Note note) { | public DisplayedNote(NoteTreeNode treeNode, Note note) { this.treeNode = treeNode; this.note = note; } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/DisplayedNote.java/clean/trunk/src/de/berlios/koalanotes/display/DisplayedNote.java |
this.treeNode = new NoteTreeNode(parent.treeNode, this); for (Note n : note.getChildren()) { new DisplayedNote(this, n); } | public DisplayedNote(NoteTreeNode treeNode, Note note) { this.treeNode = treeNode; this.note = note; } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/DisplayedNote.java/clean/trunk/src/de/berlios/koalanotes/display/DisplayedNote.java |
|
if (constructorMetadata.getProperties().containsKey("always-use")) { return constructorMetadata; } List constructorArgNames = getConstructorArgNames(constructorMetadata); if (constructorArgNames != null && propertyNames.containsAll(constructorArgNames)) { | if (isUsableConstructor(constructorMetadata, propertyNames)) { | private ConstructorMetadata getConstructor(RootBeanDefinition rootBeanDefinition) { Class beanType = rootBeanDefinition.getBeanClass(); // try to get the class metadata ClassMetadata classMetadata = metadataManager.getClassMetadata(beanType); // get a set containing the names of the defined properties Set propertyNames = new HashSet(); PropertyValue[] values = rootBeanDefinition.getPropertyValues().getPropertyValues(); for (int i = 0; i < values.length; i++) { propertyNames.add(values[i].getName()); } // get the constructors sorted by longest arg length first List constructors = new ArrayList(classMetadata.getConstructors()); Collections.sort(constructors, new ArgLengthComparator()); // try to find a constructor for which we have all of the properties defined for (Iterator iterator = constructors.iterator(); iterator.hasNext();) { ConstructorMetadata constructorMetadata = (ConstructorMetadata) iterator.next(); if (constructorMetadata.getProperties().containsKey("always-use")) { return constructorMetadata; } List constructorArgNames = getConstructorArgNames(constructorMetadata); if (constructorArgNames != null && propertyNames.containsAll(constructorArgNames)) { return constructorMetadata; } } return null; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/NamedConstructorArgs.java/buggy/kernel/src/java/org/gbean/spring/NamedConstructorArgs.java |
public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); | public void visitBeanDefinition(BeanDefinition beanDefinition, Object data) throws BeansException { super.visitBeanDefinition(beanDefinition, data); | public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/NamedConstructorArgs.java/buggy/kernel/src/java/org/gbean/spring/NamedConstructorArgs.java |
parametersToConstructorArgs(rootBeanDefinition); | processParameters(rootBeanDefinition); | public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/NamedConstructorArgs.java/buggy/kernel/src/java/org/gbean/spring/NamedConstructorArgs.java |
public Object get(final String query) throws NotFoundException { TimedReference r; try { r = (TimedReference) _cache.get(query); } catch (NullPointerException e) { throw new NotFoundException(this + " is not initialized", e); } Object o = null; if (r != null) { o = r.get(); } if (o == null) { // DOUBLE CHECKED LOCKING IS DANGEROUS IN JAVA: // this looks like double-checked locking but it isn't, we // synchrnoized on a less expensive lock inside _cache.get() // the following ilne lets us simultaneously load up to // writeLocks.length resources. int lockIndex = Math.abs(query.hashCode()) % _writeLocks.length; synchronized(_writeLocks[lockIndex]) { if (r != null){ o = r.get(); } if (o == null) { r = load(query); if (r != null) { _cache.put(query,r); } o = r.get(); try { _log.debug("cached: " + query + " for " + r.getTimeout()); _tl.scheduleTime( new Runnable() { public void run() { _cache.remove(query); _log.debug("cache expired: " + query); } }, r.getTimeout()); } catch (Exception e) { _log.error("CachingProvider caught an exception", e); } } } } return o; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/00af97f85c3f1eff849b9f47def81ab18c9841b1/CachingProvider.java/clean/webmacro/src/org/webmacro/resource/CachingProvider.java |
||
r = (TimedReference) _cache.get(query); | public Object get(final String query) throws NotFoundException { TimedReference r; try { r = (TimedReference) _cache.get(query); } catch (NullPointerException e) { throw new NotFoundException(this + " is not initialized", e); } Object o = null; if (r != null) { o = r.get(); } if (o == null) { // DOUBLE CHECKED LOCKING IS DANGEROUS IN JAVA: // this looks like double-checked locking but it isn't, we // synchrnoized on a less expensive lock inside _cache.get() // the following ilne lets us simultaneously load up to // writeLocks.length resources. int lockIndex = Math.abs(query.hashCode()) % _writeLocks.length; synchronized(_writeLocks[lockIndex]) { if (r != null){ o = r.get(); } if (o == null) { r = load(query); if (r != null) { _cache.put(query,r); } o = r.get(); try { _log.debug("cached: " + query + " for " + r.getTimeout()); _tl.scheduleTime( new Runnable() { public void run() { _cache.remove(query); _log.debug("cache expired: " + query); } }, r.getTimeout()); } catch (Exception e) { _log.error("CachingProvider caught an exception", e); } } } } return o; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/00af97f85c3f1eff849b9f47def81ab18c9841b1/CachingProvider.java/clean/webmacro/src/org/webmacro/resource/CachingProvider.java |
|
URL u = new URL(evt.getName()); | String name = evt.getName(); URL u; if (name.indexOf(":") < 3) { u = new URL("file",null,-1,name); } else { u = new URL(name); } | final public void resourceRequest(RequestResourceEvent evt) throws NotFoundException { try { URL u = new URL(evt.getName()); Reader in = new InputStreamReader(u.openStream()); char buf[] = new char[512]; StringWriter sw = new StringWriter(); int num; while ( (num = in.read(buf)) != -1 ) { sw.write(buf, 0, num); } evt.set(sw.toString()); in.close(); } catch (Exception e) { _log.exception(e); throw new NotFoundException( "Reactor: Unable to load URL " + evt.getName() + ":" + e); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67b2f926e6db2280edd1dbb8f53414247442c007/UrlProvider.java/buggy/webmacro/src/org/webmacro/resource/UrlProvider.java |
private static QuantumStrategy getQuantization(QuantumDef qd, PixelsType type) | private static QuantumStrategy getQuantization(QuantumDef qd, PixelsType type, IPixels iPixels) | private static QuantumStrategy getQuantization(QuantumDef qd, PixelsType type) { return new Quantization_8_16_bit(qd, type); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/QuantumFactory.java/buggy/components/rendering/src/omeis/providers/re/quantum/QuantumFactory.java |
return new Quantization_8_16_bit(qd, type); | return new Quantization_8_16_bit(qd, type, iPixels); | private static QuantumStrategy getQuantization(QuantumDef qd, PixelsType type) { return new Quantization_8_16_bit(qd, type); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/QuantumFactory.java/buggy/components/rendering/src/omeis/providers/re/quantum/QuantumFactory.java |
public Node literal_concat(ISourcePosition position, Node head, Object tail) { ListNode list; | public Node literal_concat(ISourcePosition position, Node head, Node tail) { | public Node literal_concat(ISourcePosition position, Node head, Object tail) { ListNode list; if (head == null) { list = new DStrNode(position); } else if (head instanceof EvStrNode) { list = new DStrNode(position).add(head); } else { list = (ListNode) head; } if (tail instanceof String) { tail = new StrNode(position, (String)tail); } list.add((Node)tail); return list; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e9bf476d31a1adc390bf346977ba9fb6e8419f5b/ParserSupport.java/buggy/src/org/jruby/parser/ParserSupport.java |
list = new DStrNode(position); } else if (head instanceof EvStrNode) { list = new DStrNode(position).add(head); } else { list = (ListNode) head; | assert tail == null || tail instanceof Node; return (Node) tail; | public Node literal_concat(ISourcePosition position, Node head, Object tail) { ListNode list; if (head == null) { list = new DStrNode(position); } else if (head instanceof EvStrNode) { list = new DStrNode(position).add(head); } else { list = (ListNode) head; } if (tail instanceof String) { tail = new StrNode(position, (String)tail); } list.add((Node)tail); return list; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e9bf476d31a1adc390bf346977ba9fb6e8419f5b/ParserSupport.java/buggy/src/org/jruby/parser/ParserSupport.java |
if (tail instanceof String) { tail = new StrNode(position, (String)tail); | if (tail == null) { return head; | public Node literal_concat(ISourcePosition position, Node head, Object tail) { ListNode list; if (head == null) { list = new DStrNode(position); } else if (head instanceof EvStrNode) { list = new DStrNode(position).add(head); } else { list = (ListNode) head; } if (tail instanceof String) { tail = new StrNode(position, (String)tail); } list.add((Node)tail); return list; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e9bf476d31a1adc390bf346977ba9fb6e8419f5b/ParserSupport.java/buggy/src/org/jruby/parser/ParserSupport.java |
list.add((Node)tail); | public Node literal_concat(ISourcePosition position, Node head, Object tail) { ListNode list; if (head == null) { list = new DStrNode(position); } else if (head instanceof EvStrNode) { list = new DStrNode(position).add(head); } else { list = (ListNode) head; } if (tail instanceof String) { tail = new StrNode(position, (String)tail); } list.add((Node)tail); return list; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e9bf476d31a1adc390bf346977ba9fb6e8419f5b/ParserSupport.java/buggy/src/org/jruby/parser/ParserSupport.java |
|
return list; | if (head instanceof EvStrNode) { head = new DStrNode(position).add(head); } if (tail instanceof StrNode) { if (head instanceof StrNode) { head = new StrNode(union(head, (Node) tail), ((StrNode) head).getValue() + ((StrNode) tail).getValue()); } else { ((ListNode) head).add((Node) tail); } } else if (tail instanceof DStrNode) { assert head instanceof ListNode; return list_concat((ListNode) head, tail); } else if (tail instanceof EvStrNode) { if (head instanceof StrNode) { head = new DStrNode(head.getPosition()).add(head); } ((DStrNode) head).add(tail); } return head; | public Node literal_concat(ISourcePosition position, Node head, Object tail) { ListNode list; if (head == null) { list = new DStrNode(position); } else if (head instanceof EvStrNode) { list = new DStrNode(position).add(head); } else { list = (ListNode) head; } if (tail instanceof String) { tail = new StrNode(position, (String)tail); } list.add((Node)tail); return list; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e9bf476d31a1adc390bf346977ba9fb6e8419f5b/ParserSupport.java/buggy/src/org/jruby/parser/ParserSupport.java |
setBounds(0,0,measuredWidth,titleBar.getHeight()+iconBar.getHeight()); | public BPalette(BrowserTopModel parent, String name) { backingModel = parent; final BPalette refCopy = this; this.paletteName = name; titleBar = new TitleBar(name); iconBar = new IconBar(measuredWidth); addChild(titleBar); titleBar.addChild(iconBar); // cheap way to get the whole thing to move iconBar.setOffset(0,titleBar.getHeight()); // sets the bounds setBounds(0,0,measuredWidth,titleBar.getHeight()+iconBar.getHeight()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dfa9ae97d8f563906ba2ca4ea00d949bd0915064/BPalette.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BPalette.java |
|
public BIcon(String text, boolean sticky) | public BIcon(Image imageIcon, String tooltipText, boolean sticky) | public BIcon(String text, boolean sticky) { this.sticky = sticky; init(); presentationNode = new PText(text); // TODO set font addChild(presentationNode); placeNode(presentationNode); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9ad2d2709e2cdefc9a414f2e51f6a883a2403c7a/BIcon.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BIcon.java |
presentationNode = new PText(text); | presentationNode = new PImage(imageIcon,true); | public BIcon(String text, boolean sticky) { this.sticky = sticky; init(); presentationNode = new PText(text); // TODO set font addChild(presentationNode); placeNode(presentationNode); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9ad2d2709e2cdefc9a414f2e51f6a883a2403c7a/BIcon.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BIcon.java |
this.tooltipText = tooltipText; | public BIcon(String text, boolean sticky) { this.sticky = sticky; init(); presentationNode = new PText(text); // TODO set font addChild(presentationNode); placeNode(presentationNode); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9ad2d2709e2cdefc9a414f2e51f6a883a2403c7a/BIcon.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BIcon.java |
|
RubyArray backtrace = (RubyArray) excp.callMethod(tc, "backtrace"); | IRubyObject backtrace = excp.callMethod(tc, "backtrace"); | public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } ThreadContext tc = getCurrentContext(); RubyArray backtrace = (RubyArray) excp.callMethod(tc, "backtrace"); PrintStream errorStream = getErrorStream(); if (backtrace.isNil()) { if (tc.getSourceFile() != null) { errorStream.print(tc.getPosition()); } else { errorStream.print(tc.getSourceLine()); } } else if (backtrace.getLength() == 0) { printErrorPos(errorStream); } else { IRubyObject mesg = backtrace.first(IRubyObject.NULL_ARRAY); if (mesg.isNil()) { printErrorPos(errorStream); } else { errorStream.print(mesg); } } RubyClass type = excp.getMetaClass(); String info = excp.toString(); if (type == getClass("RuntimeError") && (info == null || info.length() == 0)) { errorStream.print(": unhandled exception\n"); } else { String path = type.getName(); if (info.length() == 0) { errorStream.print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } errorStream.print(": " + info); if (path != null) { errorStream.print(" (" + path + ")\n"); } if (tail != null) { errorStream.print(tail + '\n'); } } } if (!backtrace.isNil()) { excp.printBacktrace(errorStream); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe628a940467ceda783730ea34173dec3d365fa4/Ruby.java/buggy/src/org/jruby/Ruby.java |
if (backtrace.isNil()) { | if (backtrace.isNil() || !(backtrace instanceof RubyArray)) { | public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } ThreadContext tc = getCurrentContext(); RubyArray backtrace = (RubyArray) excp.callMethod(tc, "backtrace"); PrintStream errorStream = getErrorStream(); if (backtrace.isNil()) { if (tc.getSourceFile() != null) { errorStream.print(tc.getPosition()); } else { errorStream.print(tc.getSourceLine()); } } else if (backtrace.getLength() == 0) { printErrorPos(errorStream); } else { IRubyObject mesg = backtrace.first(IRubyObject.NULL_ARRAY); if (mesg.isNil()) { printErrorPos(errorStream); } else { errorStream.print(mesg); } } RubyClass type = excp.getMetaClass(); String info = excp.toString(); if (type == getClass("RuntimeError") && (info == null || info.length() == 0)) { errorStream.print(": unhandled exception\n"); } else { String path = type.getName(); if (info.length() == 0) { errorStream.print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } errorStream.print(": " + info); if (path != null) { errorStream.print(" (" + path + ")\n"); } if (tail != null) { errorStream.print(tail + '\n'); } } } if (!backtrace.isNil()) { excp.printBacktrace(errorStream); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe628a940467ceda783730ea34173dec3d365fa4/Ruby.java/buggy/src/org/jruby/Ruby.java |
} else if (backtrace.getLength() == 0) { | } else if (((RubyArray) backtrace).getLength() == 0) { | public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } ThreadContext tc = getCurrentContext(); RubyArray backtrace = (RubyArray) excp.callMethod(tc, "backtrace"); PrintStream errorStream = getErrorStream(); if (backtrace.isNil()) { if (tc.getSourceFile() != null) { errorStream.print(tc.getPosition()); } else { errorStream.print(tc.getSourceLine()); } } else if (backtrace.getLength() == 0) { printErrorPos(errorStream); } else { IRubyObject mesg = backtrace.first(IRubyObject.NULL_ARRAY); if (mesg.isNil()) { printErrorPos(errorStream); } else { errorStream.print(mesg); } } RubyClass type = excp.getMetaClass(); String info = excp.toString(); if (type == getClass("RuntimeError") && (info == null || info.length() == 0)) { errorStream.print(": unhandled exception\n"); } else { String path = type.getName(); if (info.length() == 0) { errorStream.print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } errorStream.print(": " + info); if (path != null) { errorStream.print(" (" + path + ")\n"); } if (tail != null) { errorStream.print(tail + '\n'); } } } if (!backtrace.isNil()) { excp.printBacktrace(errorStream); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe628a940467ceda783730ea34173dec3d365fa4/Ruby.java/buggy/src/org/jruby/Ruby.java |
IRubyObject mesg = backtrace.first(IRubyObject.NULL_ARRAY); | IRubyObject mesg = ((RubyArray) backtrace).first(IRubyObject.NULL_ARRAY); | public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } ThreadContext tc = getCurrentContext(); RubyArray backtrace = (RubyArray) excp.callMethod(tc, "backtrace"); PrintStream errorStream = getErrorStream(); if (backtrace.isNil()) { if (tc.getSourceFile() != null) { errorStream.print(tc.getPosition()); } else { errorStream.print(tc.getSourceLine()); } } else if (backtrace.getLength() == 0) { printErrorPos(errorStream); } else { IRubyObject mesg = backtrace.first(IRubyObject.NULL_ARRAY); if (mesg.isNil()) { printErrorPos(errorStream); } else { errorStream.print(mesg); } } RubyClass type = excp.getMetaClass(); String info = excp.toString(); if (type == getClass("RuntimeError") && (info == null || info.length() == 0)) { errorStream.print(": unhandled exception\n"); } else { String path = type.getName(); if (info.length() == 0) { errorStream.print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } errorStream.print(": " + info); if (path != null) { errorStream.print(" (" + path + ")\n"); } if (tail != null) { errorStream.print(tail + '\n'); } } } if (!backtrace.isNil()) { excp.printBacktrace(errorStream); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe628a940467ceda783730ea34173dec3d365fa4/Ruby.java/buggy/src/org/jruby/Ruby.java |
if (!backtrace.isNil()) { excp.printBacktrace(errorStream); } | excp.printBacktrace(errorStream); | public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } ThreadContext tc = getCurrentContext(); RubyArray backtrace = (RubyArray) excp.callMethod(tc, "backtrace"); PrintStream errorStream = getErrorStream(); if (backtrace.isNil()) { if (tc.getSourceFile() != null) { errorStream.print(tc.getPosition()); } else { errorStream.print(tc.getSourceLine()); } } else if (backtrace.getLength() == 0) { printErrorPos(errorStream); } else { IRubyObject mesg = backtrace.first(IRubyObject.NULL_ARRAY); if (mesg.isNil()) { printErrorPos(errorStream); } else { errorStream.print(mesg); } } RubyClass type = excp.getMetaClass(); String info = excp.toString(); if (type == getClass("RuntimeError") && (info == null || info.length() == 0)) { errorStream.print(": unhandled exception\n"); } else { String path = type.getName(); if (info.length() == 0) { errorStream.print(": " + path + '\n'); } else { if (path.startsWith("#")) { path = null; } String tail = null; if (info.indexOf("\n") != -1) { tail = info.substring(info.indexOf("\n") + 1); info = info.substring(0, info.indexOf("\n")); } errorStream.print(": " + info); if (path != null) { errorStream.print(" (" + path + ")\n"); } if (tail != null) { errorStream.print(tail + '\n'); } } } if (!backtrace.isNil()) { excp.printBacktrace(errorStream); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe628a940467ceda783730ea34173dec3d365fa4/Ruby.java/buggy/src/org/jruby/Ruby.java |
} | } else if (target == null && src == view.refresh) control.refresh(DataManagerCtrl.CLASSIFIER); | public void actionPerformed(ActionEvent e) { Object src = e.getSource(); if (target != null) { if (src == view.properties) control.showProperties(target); else if (src == view.view && target instanceof ImageSummary) control.viewImage(((ImageSummary) target)); else if (src == view.view && target instanceof CategoryGroupData) control.viewCategoryGroup(((CategoryGroupData) target)); else if (src == view.view && target instanceof CategorySummary) control.viewCategory(((CategorySummary) target)); else if (src == view.annotate && target instanceof ImageSummary) control.annotateImage(((ImageSummary) target)); else if (src == view.refresh) control.refresh(target); } view.setVisible(false); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/059eba4bfbe6afc9941db02e314b78f1bd9c2d2e/ClassifierPopupMenuMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/ClassifierPopupMenuMng.java |
JViewport currentView = this.getViewport(); | JViewport currentView = getViewport(); | void zoomImage() { if (model.getRenderedImage() == null) return; model.createDisplayedImage(); BufferedImage img = model.getDisplayedImage(); setComponentsSize(img.getWidth(), img.getHeight()); JViewport currentView = this.getViewport(); int h = img.getHeight(); int w = img.getWidth(); int viewportW = currentView.getWidth(); int viewportH = currentView.getHeight(); int x = w/2-viewportW/2; if (x < 0) x = 0; int y = h/2-viewportH/2; if (y < 0) y = 0; currentView.setViewPosition(new Point(x, y)); browserCanvas.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/BrowserUI.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserUI.java |
model.getParentModel().addPropertyChangeListener( TreeViewer.THUMBNAIL_LOADED_PROPERTY, controller); | void initialize() { controller.initialize(view); model.getParentModel().addPropertyChangeListener( TreeViewer.THUMBNAIL_LOADED_PROPERTY, controller); view.initialize(controller, model); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/ClassifierComponent.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/clsf/ClassifierComponent.java |
|
return "LogicalChannel"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); | return "LogicalChannel"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); | public String toString(){ return "LogicalChannel"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/LogicalChannel.java/buggy/components/common/src/ome/model/LogicalChannel.java |
if (w-dw > 0) | if (w-dw>0) | private void setTBSize(int w) { Dimension d = toolBar.getSize(); int dw = d.width; if (w-dw > 0) toolBar.add(Box.createRigidArea(new Dimension(w-d.width, 1))); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/020251919a9bc041ddec075006ba48f2bcfddd48/ImageInspector.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspector.java |
DataObject object; | Object object; | public void visit(ImageNode node) { long id = ((ImageData) node.getHierarchyObject()).getId(); Iterator i = nodes.iterator(); DataObject object; while (i.hasNext()) { object = (DataObject) i.next(); if (object instanceof ImageData) { if (object.getId() == id) { node.setHierarchyObject(object); node.setNodeDecoration(); node.repaint(); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/DataSaveVisitor.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/DataSaveVisitor.java |
object = (DataObject) i.next(); | object = i.next(); | public void visit(ImageNode node) { long id = ((ImageData) node.getHierarchyObject()).getId(); Iterator i = nodes.iterator(); DataObject object; while (i.hasNext()) { object = (DataObject) i.next(); if (object instanceof ImageData) { if (object.getId() == id) { node.setHierarchyObject(object); node.setNodeDecoration(); node.repaint(); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/DataSaveVisitor.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/DataSaveVisitor.java |
if (object.getId() == id) { | if (((ImageData) object).getId() == id) { | public void visit(ImageNode node) { long id = ((ImageData) node.getHierarchyObject()).getId(); Iterator i = nodes.iterator(); DataObject object; while (i.hasNext()) { object = (DataObject) i.next(); if (object instanceof ImageData) { if (object.getId() == id) { node.setHierarchyObject(object); node.setNodeDecoration(); node.repaint(); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/DataSaveVisitor.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/DataSaveVisitor.java |
node.repaint(); | public void visit(ImageNode node) { long id = ((ImageData) node.getHierarchyObject()).getId(); Iterator i = nodes.iterator(); DataObject object; while (i.hasNext()) { object = (DataObject) i.next(); if (object instanceof ImageData) { if (object.getId() == id) { node.setHierarchyObject(object); node.setNodeDecoration(); node.repaint(); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/DataSaveVisitor.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/DataSaveVisitor.java |
|
tree.setShowsRootHandles(true); | private void initComponents() { sorter = new ViewerSorter(); tree = new TreeCheck("", null); tree.setRootVisible(false); tree.addPropertyChangeListener(TreeCheck.NODE_SELECTED_PROPERTY, controller); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ClassifierUI.java/clean/SRC/org/openmicroscopy/shoola/agents/util/classifier/view/ClassifierUI.java |
|
if (branchCoverageRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); } | public void execute() throws BuildException { if (branchCoverageRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); } if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } Iterator i = regexes.iterator(); while (i.hasNext()) { getJava().createArg().setValue("--ignore"); getJava().createArg().setValue(i.next().toString()); } if (lineCoverageRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineCoverageRate); } if (getJava().executeJava() != 0) { throw new BuildException(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/CheckTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
|
Iterator i = regexes.iterator(); while (i.hasNext()) | if (branchCoverageRate != null) | public void execute() throws BuildException { if (branchCoverageRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); } if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } Iterator i = regexes.iterator(); while (i.hasNext()) { getJava().createArg().setValue("--ignore"); getJava().createArg().setValue(i.next().toString()); } if (lineCoverageRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineCoverageRate); } if (getJava().executeJava() != 0) { throw new BuildException(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/CheckTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
getJava().createArg().setValue("--ignore"); getJava().createArg().setValue(i.next().toString()); | getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); | public void execute() throws BuildException { if (branchCoverageRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); } if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } Iterator i = regexes.iterator(); while (i.hasNext()) { getJava().createArg().setValue("--ignore"); getJava().createArg().setValue(i.next().toString()); } if (lineCoverageRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineCoverageRate); } if (getJava().executeJava() != 0) { throw new BuildException(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/CheckTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
if (getJava().executeJava() != 0) | if (totalBranchCoverageRate != null) | public void execute() throws BuildException { if (branchCoverageRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); } if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } Iterator i = regexes.iterator(); while (i.hasNext()) { getJava().createArg().setValue("--ignore"); getJava().createArg().setValue(i.next().toString()); } if (lineCoverageRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineCoverageRate); } if (getJava().executeJava() != 0) { throw new BuildException(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/CheckTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
throw new BuildException(); | getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchCoverageRate); | public void execute() throws BuildException { if (branchCoverageRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); } if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } Iterator i = regexes.iterator(); while (i.hasNext()) { getJava().createArg().setValue("--ignore"); getJava().createArg().setValue(i.next().toString()); } if (lineCoverageRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineCoverageRate); } if (getJava().executeJava() != 0) { throw new BuildException(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/CheckTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
if (totalLineCoverageRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineCoverageRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); if (returnCode == 0) System.out.println("All checks passed."); else if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else System.err.println("Coverage check failed. See messages above."); | public void execute() throws BuildException { if (branchCoverageRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchCoverageRate); } if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } Iterator i = regexes.iterator(); while (i.hasNext()) { getJava().createArg().setValue("--ignore"); getJava().createArg().setValue(i.next().toString()); } if (lineCoverageRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineCoverageRate); } if (getJava().executeJava() != 0) { throw new BuildException(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/b5fae504c12a9486e23c38b8e2fb563abfcdacb8/CheckTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java |
|
getRuby().getRubyFrame().setArgs(new ShiftableList(args)); | getRuby().getRubyFrame().setArgs(new RubyPointer(args)); | public RubyObject call0(RubyObject recv, RubyId id, RubyObject[] args, Node body, boolean noSuper) { // ... getRuby().getRubyFrame().push(); // HACK +++ getRuby().getIter().push(RubyIter.ITER_NOT); // HACK --- getRuby().getRubyFrame().setLastFunc(id); getRuby().getRubyFrame().setLastClass(noSuper ? null : this); getRuby().getRubyFrame().setSelf(recv); getRuby().getRubyFrame().setArgs(new ShiftableList(args)); RubyObject result = getRuby().getNil(); if (body instanceof CallableNode) { result = ((CallableNode)body).call(getRuby(), recv, id, args, noSuper); } else { System.out.println("{BUG] Not implemented yet (method call): " + id.toName() + ", node_type:" + body.getType()); } /*switch (body.nd_type()) { case NODE_ZSUPER: case NODE_ATTRSET: case NODE_IVAR: { result = body.interpreter.eval(recv, body); break; } case NODE_SCOPE: { NODE savedCref = null; // VALUE[] localVars = null; ShiftableList argsList = new ShiftableList(args); ShiftableList localVarsList = null; getRuby().getRubyScope().push(); if (body.nd_rval() != null) { savedCref = getRuby().getRubyCRef(); getRuby().setRubyCRef((NODE)body.nd_rval()); getRuby().getRubyFrame().setCbase(body.nd_rval()); } if (body.nd_tbl() != null) { // ? +++ List tmpList = Collections.nCopies(body.nd_tbl()[0].intValue() + 1, getRuby().getNil()); // ? --- localVarsList = new ShiftableList(new ArrayList(tmpList)); localVarsList.set(0, body); localVarsList.shift(1); getRuby().getRubyScope().setLocalTbl(body.nd_tbl()); getRuby().getRubyScope().setLocalVars(localVarsList.getList()); } else { localVarsList = getRuby().getRubyScope().getLocalVars(); getRuby().getRubyScope().setLocalVars(null); getRuby().getRubyScope().setLocalTbl(null); } body = body.nd_next(); RubyVarmap.push(getRuby()); // PUSH_TAG(PROT_FUNC); try { NODE node = null; int i; if (body.nd_type() == NODE_ARGS) { node = body; body = null; } else if (body.nd_type() == NODE_BLOCK) { node = body.nd_head(); body = body.nd_next(); } if (node != null) { if (node.nd_type() != NODE_ARGS) { // rb_bug("no argument-node"); } i = node.nd_cnt(); if (i > (args != null ? args.length : 0)) { throw new RubyArgumentException("wrong # of arguments(" + args.length + " for " + i + ")"); } if (node.nd_rest() == -1) { int opt = i; NODE optnode = node.nd_opt(); while (optnode != null) { opt++; optnode = optnode.nd_next(); } if (opt < (args != null ? args.length : 0)) { throw new RubyArgumentException("wrong # of arguments(" + args.length + " for " + opt + ")"); } getRuby().getRubyFrame().setArgs(localVarsList != null ? localVarsList.getList(2) : null); } if (localVarsList != null) { if (i > 0) { localVarsList.shift(2); for (int j = 0; j < i; j++ ) { localVarsList.set(j, argsList.get(j)); } localVarsList.shiftLeft(2); } argsList.shift(i); if (node.nd_opt() != null) { NODE opt = node.nd_opt(); while (opt != null && argsList.size() != 0) { interpreter.assign(recv, opt.nd_head(), (RubyObject)argsList.get(0), true); argsList.shift(1); opt = opt.nd_next(); } interpreter.eval(recv, opt); } if (node.nd_rest() >= 0) { RubyArray array = null; if (argsList.size() > 0) { array = RubyArray.m_newArray(getRuby(), argsList); } else { array = RubyArray.m_newArray(getRuby(), 0); } localVarsList.set(node.nd_rest(), array); } } } result = interpreter.eval(recv, body); } catch (ReturnException rExcptn) { } RubyVarmap.pop(getRuby()); getRuby().getRubyScope().pop(); getRuby().setRubyCRef(savedCref); break; } default: { System.out.println("Not implemented yet (method call): " + id.toName() + ", node_type:" + body.nd_type()); } } */ getRuby().getRubyFrame().pop(); getRuby().getIter().pop(); return result ; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/59743974f1f8d5a50153b05647dac2d75d510976/RubyModule.java/buggy/org/jruby/RubyModule.java |
public double getMax() { return max; } | public double getMax() { return max; } | public double getMax() { return max; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3acf0375531681576d4a65f174981535a8919ae/ROIPlaneStats.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/roi/ROIPlaneStats.java |
public double getMean() { return mean; } | public double getMean() { return mean; } | public double getMean() { return mean; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3acf0375531681576d4a65f174981535a8919ae/ROIPlaneStats.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/roi/ROIPlaneStats.java |
public double getMin() { return min; } | public double getMin() { return min; } | public double getMin() { return min; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3acf0375531681576d4a65f174981535a8919ae/ROIPlaneStats.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/roi/ROIPlaneStats.java |
public double getStandardDeviation() { return standardDeviation; } | public double getStandardDeviation() { return standardDeviation; } | public double getStandardDeviation() { return standardDeviation; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3acf0375531681576d4a65f174981535a8919ae/ROIPlaneStats.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/roi/ROIPlaneStats.java |
listModel.addElement(owners[i]+" ("+df.format(date)+")"); | listModel.addElement(owners[i]+" ("+df.format(date)+")"); | private void formatUsersList(String[] owners) { // remove all users from list before adding new listModel.removeAllElements(); // add each user to list Timestamp date; DateFormat df = DateFormat.getDateInstance(); AnnotationData data; List list; for (int i = 0; i < owners.length; i++) { list = getOwnerAnnotation(i); data = ((AnnotationData) list.get(0)); date = data.getLastModified(); if (date == null) date = new Timestamp((new java.util.Date()).getTime()); listModel.addElement(owners[i]+" ("+df.format(date)+")"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c4a5cadc1b56f30311b66cf2fbcf6e3ad950328a/AnnotationPaneUI.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/annotator/AnnotationPaneUI.java |
if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex); | void showAnnotations() { deleteBox.setSelected(false); ExperimenterData userDetails = model.getUserDetails(); if (userDetails == null) return; Map annotations = model.getAnnotations(); String[] owners = new String[annotations.size()]; Iterator i = annotations.keySet().iterator(); Long id; int index = 0; ownersMap = new HashMap(); List list; ExperimenterData data; while (i.hasNext()) { id = (Long) i.next(); list = (List) annotations.get(id); data = ((AnnotationData) list.get(0)).getOwner(); if (userDetails.getId() == id.intValue()) userIndex = index; String n = "Name not available"; //TODO: REMOVE ASAP try { n = data.getLastName(); } catch (Exception e) {} owners[index] = n; ownersMap.put(new Integer(index), id); index++; } //No annotation for the current user, so allow creation. if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex); setComponentsEnabled(true); formatUsersList(owners); annotatedByList.clearSelection(); //annotatedByList.setSelectedIndex(userIndex); showSingleAnnotation(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c4a5cadc1b56f30311b66cf2fbcf6e3ad950328a/AnnotationPaneUI.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/annotator/AnnotationPaneUI.java |
|
annotatedByList.clearSelection(); | if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex); | void showAnnotations() { deleteBox.setSelected(false); ExperimenterData userDetails = model.getUserDetails(); if (userDetails == null) return; Map annotations = model.getAnnotations(); String[] owners = new String[annotations.size()]; Iterator i = annotations.keySet().iterator(); Long id; int index = 0; ownersMap = new HashMap(); List list; ExperimenterData data; while (i.hasNext()) { id = (Long) i.next(); list = (List) annotations.get(id); data = ((AnnotationData) list.get(0)).getOwner(); if (userDetails.getId() == id.intValue()) userIndex = index; String n = "Name not available"; //TODO: REMOVE ASAP try { n = data.getLastName(); } catch (Exception e) {} owners[index] = n; ownersMap.put(new Integer(index), id); index++; } //No annotation for the current user, so allow creation. if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex); setComponentsEnabled(true); formatUsersList(owners); annotatedByList.clearSelection(); //annotatedByList.setSelectedIndex(userIndex); showSingleAnnotation(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c4a5cadc1b56f30311b66cf2fbcf6e3ad950328a/AnnotationPaneUI.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/annotator/AnnotationPaneUI.java |
"object ID: "+o.getId()); | "object ID: "+o.getId()); | IObject findIObject(IObject o) throws DSOutOfServiceException, DSAccessException { try { IQuery service = getIQueryService(); return service.find(o.getClass(), o.getId().longValue()); } catch (Exception e) { handleException(e, "Cannot retrieve the requested object with "+ "object ID: "+o.getId()); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/OMEROGateway.java/clean/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java |
"parent ID: "+parent.getId()+" and child ID: "+child.getId()); | "parent ID: "+parent.getId()+" and child " + "ID: "+child.getId()); | IObject findLink(IObject parent, IObject child) throws DSOutOfServiceException, DSAccessException { try { String table = getTableForLink(parent.getClass()); if (table == null) return null; String sql = "select link from "+table+" as link where " + "link.parent.id = :parentID and link.child.id = :childID"; IQuery service = getIQueryService(); Parameters param = new Parameters(); param.addLong("parentID", parent.getId()); param.addLong("childID", child.getId()); return service.findByQuery(sql, param); } catch (Exception e) { handleException(e, "Cannot retrieve the requested link for "+ "parent ID: "+parent.getId()+" and child ID: "+child.getId()); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/OMEROGateway.java/clean/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java |
"parent ID: "+parent.getId()); | "parent ID: "+parent.getId()); | List findLinks(IObject parent, List children) throws DSOutOfServiceException, DSAccessException { try { String table = getTableForLink(parent.getClass()); if (table == null) return null; String sql = "select link from "+table+" as link where " + "link.parent.id = :parentID and link.child.id in " + "(:childIDs)"; IQuery service = getIQueryService(); Parameters param = new Parameters(); param.addLong("parentID", parent.getId()); param.addList("childIDs", children); return service.findAllByQuery(sql, param); } catch (Exception e) { handleException(e, "Cannot retrieve the requested link for "+ "parent ID: "+parent.getId()); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/OMEROGateway.java/clean/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java |
e.printStackTrace(); | private ExperimenterData getUserDetails(String name) throws DSOutOfServiceException { try { IPojos service = getIPojosService(); Set set = new HashSet(1); set.add(name); Map m = PojoMapper.asDataObjects(service.getUserDetails(set, (new PojoOptions()).map())); ExperimenterData data = (ExperimenterData) m.get(name); if (data == null) { throw new DSOutOfServiceException("Cannot retrieve user's " + "data"); } return data; } catch (Exception e) { e.printStackTrace(); throw new DSOutOfServiceException("Cannot retrieve user's " + "data", e); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5aacd98a1cfb2219e218c87eed17b5a0f0e9738a/OMEROGateway.java/clean/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java |
|
int delay = 60000; int period = 30000; | int delay = 60000; int period = 30000; | private void checkRoomsForTimeout() { int delay = 60000; // delay for 5 sec. int period = 30000; // repeat every sec. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getChatContainer().getStaleChatRooms()) { // Turn tab gray int index = getChatContainer().indexOfComponent(chatRoom); SparkTab tab = getChatContainer().getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); Font oldFont = titleLabel.getFont(); Font newFont = new Font(oldFont.getFontName(), Font.BOLD, oldFont.getSize()); titleLabel.setFont(newFont); titleLabel.setForeground(Color.gray); titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/00fab4f4f794528a2db5b65568d6efec6e2e119d/ChatManager.java/buggy/src/java/org/jivesoftware/spark/ChatManager.java |
List logs = CurrentDetails.getCreationEvent().collectFromLogs(null); | List logs = CurrentDetails.getCreationEvent().collectLogs(null); | public void testSaveSimpleObject() throws Exception { Pixels p = ObjectFactory.createPixelGraph(null); p = (Pixels) iUpdate.saveAndReturnObject(p); flush(); List logs = CurrentDetails.getCreationEvent().collectFromLogs(null); assertTrue(logs.size() > 0); Pixels check = (Pixels) iQuery.queryUnique( "select p from Pixels p " + " left outer join fetch p.acquisitionContext " + " left outer join fetch p.channels " + " where p.id = ?",new Object[]{p.getId()}); assertTrue("channel ids differ",equalCollections(p.getChannels(),check.getChannels())); assertTrue("acq ctx differ", p.getAcquisitionContext().getId().equals( check.getAcquisitionContext().getId())); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/UpdateTest.java/buggy/components/server/test/ome/server/itests/update/UpdateTest.java |
KeyStroke appleStroke = KeyStroke.getKeyStroke(Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), 0); String appleString = org.jivesoftware.spark.util.StringUtils.keyStroke2String(appleStroke); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(appleString + "w"), "appleStroke"); this.getActionMap().put("appleStroke", new AbstractAction("appleStroke") { public void actionPerformed(ActionEvent evt) { closeActiveRoom(); } }); | private void addKeyNavigation() { KeyStroke leftStroke = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0); String leftStrokeString = org.jivesoftware.spark.util.StringUtils.keyStroke2String(leftStroke); // Handle Left Arrow this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("alt " + leftStrokeString + ""), "navigateLeft"); this.getActionMap().put("navigateLeft", new AbstractAction("navigateLeft") { public void actionPerformed(ActionEvent evt) { int selectedIndex = getSelectedIndex(); if (selectedIndex > 0) { setSelectedIndex(selectedIndex - 1); } else { setSelectedIndex(getTabCount() - 1); } } }); KeyStroke rightStroke = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0); String rightStrokeString = org.jivesoftware.spark.util.StringUtils.keyStroke2String(rightStroke); // Handle Right Arrow this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("alt " + rightStrokeString + ""), "navigateRight"); this.getActionMap().put("navigateRight", new AbstractAction("navigateRight") { public void actionPerformed(ActionEvent evt) { int selectedIndex = getSelectedIndex(); if (selectedIndex > -1) { int count = getTabCount(); if (selectedIndex == (count - 1)) { setSelectedIndex(0); } else { setSelectedIndex(selectedIndex + 1); } } } }); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "escape"); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control W"), "escape"); this.getActionMap().put("escape", new AbstractAction("escape") { public void actionPerformed(ActionEvent evt) { closeActiveRoom(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
|
if (index == -1) { return; } | private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
|
ChatRoom chatRoom = (ChatRoom)getComponentInTab(tab); if (chatRoom != null) { for (ChatRoom cRoom : getChatRooms()) { if (chatRoom != cRoom) { closeTab(cRoom); } } } | ChatRoom chatRoom = (ChatRoom)getComponentInTab(tab); if (chatRoom != null) { closeTab(chatRoom); | public void actionPerformed(ActionEvent e) { ChatRoom chatRoom = (ChatRoom)getComponentInTab(tab); if (chatRoom != null) { for (ChatRoom cRoom : getChatRooms()) { if (chatRoom != cRoom) { closeTab(cRoom); } } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
} | public void actionPerformed(ActionEvent e) { ChatRoom chatRoom = (ChatRoom)getComponentInTab(tab); if (chatRoom != null) { for (ChatRoom cRoom : getChatRooms()) { if (chatRoom != cRoom) { closeTab(cRoom); } } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
|
for (ChatRoom rooms : getStaleChatRooms()) { closeTab(rooms); | ChatRoom chatRoom = (ChatRoom)getComponentInTab(tab); if (chatRoom != null) { for (ChatRoom cRoom : getChatRooms()) { if (chatRoom != cRoom) { closeTab(cRoom); } } | public void actionPerformed(ActionEvent e) { for (ChatRoom rooms : getStaleChatRooms()) { closeTab(rooms); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
((ChatRoomListener)iter.next()).userHasLeft(room, userid); | ((ChatRoomListener)iter.next()).userHasJoined(room, userid); | public void run() { final Iterator iter = new HashSet(chatRoomListeners).iterator(); while (iter.hasNext()) { ((ChatRoomListener)iter.next()).userHasLeft(room, userid); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
final int index = indexOfComponent(room); if (index != -1) { room.increaseUnreadMessageCount(); int unreadMessageCount = room.getUnreadMessageCount(); String appendedMessage = ""; if (unreadMessageCount > 1) { appendedMessage = " (" + unreadMessageCount + ")"; } SparkTab tab = getTabAt(index); tab.getTitleLabel().setText(room.getTabTitle() + appendedMessage); if (room instanceof ChatRoomImpl) { checkNotificationPreferences(room); } makeTabRed(room); } | public void run() { try { boolean invokeFlash = SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(room instanceof GroupChatRoom); if (!chatFrame.isFocused() && invokeFlash) { SparkManager.getAlertManager().flashWindow(chatFrame); } } catch (Exception ex) { Log.error("Issue in ChatRooms with tab location.", ex); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
|
try { final int index = indexOfComponent(room); if (index != -1) { room.increaseUnreadMessageCount(); int unreadMessageCount = room.getUnreadMessageCount(); String appendedMessage = ""; if (unreadMessageCount > 1) { appendedMessage = " (" + unreadMessageCount + ")"; } SparkTab tab = getTabAt(index); tab.getTitleLabel().setText(room.getTabTitle() + appendedMessage); if (room instanceof ChatRoomImpl) { checkNotificationPreferences(room); } makeTabRed(room); } boolean invokeFlash = SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(room instanceof GroupChatRoom); if (!chatFrame.isFocused() && invokeFlash) { SparkManager.getAlertManager().flashWindow(chatFrame); } } catch (Exception ex) { Log.error("Issue in ChatRooms with tab location.", ex); | final Iterator iter = new HashSet(chatRoomListeners).iterator(); while (iter.hasNext()) { ((ChatRoomListener)iter.next()).userHasLeft(room, userid); | public void run() { try { final int index = indexOfComponent(room); if (index != -1) { room.increaseUnreadMessageCount(); int unreadMessageCount = room.getUnreadMessageCount(); String appendedMessage = ""; if (unreadMessageCount > 1) { appendedMessage = " (" + unreadMessageCount + ")"; } SparkTab tab = getTabAt(index); tab.getTitleLabel().setText(room.getTabTitle() + appendedMessage); // Check notifications. if (room instanceof ChatRoomImpl) { checkNotificationPreferences(room); } makeTabRed(room); } boolean invokeFlash = SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(room instanceof GroupChatRoom); if (!chatFrame.isFocused() && invokeFlash) { SparkManager.getAlertManager().flashWindow(chatFrame); } } catch (Exception ex) { Log.error("Issue in ChatRooms with tab location.", ex); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); | boolean invokeFlash = SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(room instanceof GroupChatRoom); if (!chatFrame.isFocused() && invokeFlash) { SparkManager.getAlertManager().flashWindow(chatFrame); | public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); | Log.error("Issue in ChatRooms with tab location.", ex); | public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
SparkManager.getAlertManager().stopFlashing(chatFrame); | public void run() { try { int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); useTabDefault(room); tab.getTitleLabel().setText(room.getTabTitle()); room.clearUnreadMessageCount(); } } catch (Exception ex) { Log.error("Could not stop flashing for " + room + " because " + ex.getMessage(), ex); } SparkManager.getAlertManager().stopFlashing(chatFrame); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/37d657ce06cb211de7a00e47df72ad0f160ca4ee/ChatContainer.java/buggy/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
|
} if (s.length() > 255) { UserNotifier un = TreeViewerAgent.getRegistry().getUserNotifier(); un.notifyInfo("Editor", "The name is too long. Cannot be more " + "than 255 characters long."); doBasic.resetName(); return; | void finish() { String s = doBasic.getNameText(); if (s == null || s.length() == 0) { doBasic.resetNameArea(); handleNameAreaRemove(0); return; } switch (model.getEditorType()) { case Editor.CREATE_EDITOR: controller.createObject(fillDataObject()); break; case Editor.PROPERTIES_EDITOR: finishEdit(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/39bb6f0c93c9752d3daacd9753b8402e6d393a78/EditorUI.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorUI.java |
|
if (c == '$') { | if ((c == '$') && !in.isEscaped()) { | static public Object parseQuotedString(ParseTool in) throws ParseException, IOException { int quoteChar = in.getChar(); boolean isMacro = false; if ((quoteChar != '\'') && (quoteChar != '\"')) { return null; // undefined quote char } StringBuffer str = new StringBuffer(96); QuotedStringBuilder qString = new QuotedStringBuilder(); int c = in.nextChar(); while ((c != quoteChar) && (c != in.EOF)) { if (c == '$') { Object child = parseVariable(in); // may return a string c = in.getChar(); if (child instanceof String) { str.append(child); } else { qString.addElement(str.toString()); qString.addElement(child); str.setLength(0); } } else { str.append((char) c); c = in.nextChar(); } } if (str.length() != 0) { qString.addElement(str.toString()); } str = null; if (c == quoteChar) { in.nextChar(); } else { throw new ParseException(in, "Expected closing quote: " + (char) quoteChar); } if ((qString.size() == 1) && !(qString.elementAt(0) instanceof Builder)) { // XXX: #use directive fails without this, because it needs to // access target and source during the parse phase, before the // build has been completed. return qString.elementAt(0); } else { return qString; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/edc6be3e13cffe24c6d6917bb90f6d317cf74dfb/WMParser.java/clean/webmacro/src/org/webmacro/engine/WMParser.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.