rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JTabbedPane) { JTabbedPane tab = (JTabbedPane) e.getSource(); Component c = tab.getSelectedComponent(); int index = tab.getSelectedIndex(); if (c instanceof DOInfo) { DOInfo info = (DOInfo) c; switch (info.getInfoType()) { case DOInfo.INFO_TYPE: model.retrieveChannelsData(); break; } view.setEditorSelectedPane(index); } else { view.setEditorSelectedPane(index); if (index == EditorUI.PROPERTIES_INDEX) { int subIndex = model.getSelectedSubPane(); if (subIndex == EditorUI.ANNOTATION_SUB_INDEX) retrieveAnnotations(); else if (subIndex == EditorUI.CLASSIFICATION_SUB_INDEX) loadClassifications(); } } } else { view.onStateChanged(model.getState() == Editor.READY); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9794ffbd035a4de717ee211573b4844dd0eb3371/EditorControl.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorControl.java |
||
runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newSymbol("java")); | public void test() { IRuby runtime = Ruby.getDefaultInstance(); JavaClass javaClass = JavaClass.get(runtime, String.class); assertSame(javaClass, JavaClass.get(runtime, String.class)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f621b644a7b64cb12bdf5d848d9e284e023964f4/TestJavaClass.java/clean/test/org/jruby/javasupport/TestJavaClass.java |
|
public void testXMLReportValidity() throws Exception { String[] args; ProjectData.saveGlobalProjectData(); String dataFileName = CoverageDataFileHandler.getDefaultDataFile() .getAbsolutePath(); args = new String[] { "-f", "xml", "--datafile", dataFileName, "-o", pathToTestOutput, "-s", pathToSourceCode }; net.sourceforge.cobertura.reporting.Main.main(args); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); DocumentBuilder documentBuilder = factory.newDocumentBuilder(); documentBuilder.setEntityResolver(new JUnitXMLParserEntityResolver( basedir)); documentBuilder.setErrorHandler(new JUnitXMLParserErrorHandler()); InputStream inputStream = null; try { inputStream = new FileInputStream(pathToXMLReport); documentBuilder.parse(inputStream); } finally { if (inputStream != null) inputStream.close(); } | public void testXMLReportValidity() throws Exception { | public void testXMLReportValidity() throws Exception { String[] args; // Serialize the current coverage data to disk ProjectData.saveGlobalProjectData(); String dataFileName = CoverageDataFileHandler.getDefaultDataFile() .getAbsolutePath(); // Then we need to generate the XML report args = new String[] { "-f", "xml", "--datafile", dataFileName, "-o", pathToTestOutput, "-s", pathToSourceCode }; net.sourceforge.cobertura.reporting.Main.main(args); // Create a validating XML document parser DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); DocumentBuilder documentBuilder = factory.newDocumentBuilder(); documentBuilder.setEntityResolver(new JUnitXMLParserEntityResolver( basedir)); documentBuilder.setErrorHandler(new JUnitXMLParserErrorHandler()); // Parse the XML report InputStream inputStream = null; try { inputStream = new FileInputStream(pathToXMLReport); documentBuilder.parse(inputStream); } finally { if (inputStream != null) inputStream.close(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/XMLReportTest.java/buggy/cobertura/test/net/sourceforge/cobertura/reporting/xml/XMLReportTest.java |
if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex); | void showAnnotations() { ExperimenterData userDetails = model.getUserDetails(); if (userDetails == null) return; Map annotations = model.getAnnotations(); if (annotations == null) return; 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); if (list != null || list.size() > 0) { data = ((AnnotationData) list.get(0)).getOwner(); if (userDetails.getId() == id.intValue()) userIndex = index; String n = "Name not available"; //tmp fix 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/adfc1c6109de30a5fa2f263c29c3f0359c5d4601/DOAnnotation.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/DOAnnotation.java |
|
annotatedByList.clearSelection(); annotatedByList.setSelectedIndex(userIndex); | if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex); | void showAnnotations() { ExperimenterData userDetails = model.getUserDetails(); if (userDetails == null) return; Map annotations = model.getAnnotations(); if (annotations == null) return; 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); if (list != null || list.size() > 0) { data = ((AnnotationData) list.get(0)).getOwner(); if (userDetails.getId() == id.intValue()) userIndex = index; String n = "Name not available"; //tmp fix 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/adfc1c6109de30a5fa2f263c29c3f0359c5d4601/DOAnnotation.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/DOAnnotation.java |
System.out.println("index "+index); | private void showSingleAnnotation() { int index = annotatedByList.getSelectedIndex(); view.handleAnnotationAreaInsert(); if (index == -1) { ExperimenterData details = model.getUserDetails(); addAnnotationText(DEFAULT_TEXT+details.getFirstName()+" "+ details.getLastName()); defaultText = true; setComponentsEnabled(true); deleteBox.setEnabled(false); return; } List list = getOwnerAnnotation(index); if (list.size() > 0) { AnnotationData data = (AnnotationData) list.get(0); addAnnotationText(data.getText()); } setComponentsEnabled(index == userIndex); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/adfc1c6109de30a5fa2f263c29c3f0359c5d4601/DOAnnotation.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/DOAnnotation.java |
|
isg = (pojos.ImageData) i.next(); | isg = (pojos.ImageData) i.next(); | Set getImagesDiff(pojos.DatasetData data, Map filters, Map complexFilters) { Set imagesDiff = new HashSet(); try { imagesDiff = getImportedImages(filters, complexFilters); pojos.ImageData isg; Iterator i = imagesDiff.iterator(); Set images = data.getImages(); Iterator j; while (i.hasNext()) { isg = (pojos.ImageData) i.next(); j = images.iterator(); while (j.hasNext()) { if (((pojos.ImageData) j.next()).getId() == isg.getId()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; /* List imagesDiff = new ArrayList(); try { imagesDiff = getImportedImages(filters, complexFilters); Set images = data.getImages(); pojos.ImageData isg; Iterator i; for (int j = 0; j < imagesDiff.size(); j++) { isg = (pojos.ImageData) imagesDiff.get(j); i = images.iterator(); while (i.hasNext()) { if (((pojos.ImageData) i.next()).getId() == isg.getId()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; */ } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5d253e1d8b8b563bd79074b962fe0a01fca0a091/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java |
Set getImagesDiff(pojos.DatasetData data, Map filters, Map complexFilters) { Set imagesDiff = new HashSet(); try { imagesDiff = getImportedImages(filters, complexFilters); pojos.ImageData isg; Iterator i = imagesDiff.iterator(); Set images = data.getImages(); Iterator j; while (i.hasNext()) { isg = (pojos.ImageData) i.next(); j = images.iterator(); while (j.hasNext()) { if (((pojos.ImageData) j.next()).getId() == isg.getId()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; /* List imagesDiff = new ArrayList(); try { imagesDiff = getImportedImages(filters, complexFilters); Set images = data.getImages(); pojos.ImageData isg; Iterator i; for (int j = 0; j < imagesDiff.size(); j++) { isg = (pojos.ImageData) imagesDiff.get(j); i = images.iterator(); while (i.hasNext()) { if (((pojos.ImageData) i.next()).getId() == isg.getId()) imagesDiff.remove(isg); } } } catch(DSAccessException dsae) { String s = "Can't retrieve user's images."; getRegistry().getLogger().error(this, s+" Error: "+dsae); getRegistry().getUserNotifier().notifyError("Data Retrieval " + "Failure", s, dsae); } return imagesDiff; */ } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5d253e1d8b8b563bd79074b962fe0a01fca0a091/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java |
||
PixelsService service = PixelsService.getInstance(); | PixelsService service = new PixelsService(PixelsService.ROOT_DEFAULT); | protected void setUp() { pixels = new Pixels(); pixels.setId(1L); pixels.setSizeX(1024); pixels.setSizeY(1024); pixels.setSizeZ(64); pixels.setSizeC(3); pixels.setSizeT(50); PixelsType type = new PixelsType(); pixels.setPixelsType(type); // FIXME PixelsService service = PixelsService.getInstance(); pixelBuffer = service.getPixelBuffer(pixels); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/HugePixelBufferUnitTest.java/buggy/components/omeio-nio/test/ome/io/nio/utests/HugePixelBufferUnitTest.java |
_tl.interrupt(); | public void destroy() { // @@@ We should shut down TimeLoop too somehow _cache = null; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/65c210c2e5230f99b78b769799e9e54e3fcce30a/SMapCacheManager.java/buggy/webmacro/src/org/webmacro/resource/SMapCacheManager.java |
|
JTabbedPane tabs = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT); tabs.setAlignmentX(LEFT_ALIGNMENT); | private JPanel buildTabbedPanel(ROIAgtCtrl control, IconManager im, int sizeT, int sizeZ) { JTabbedPane tabs = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT); tabs.setAlignmentX(LEFT_ALIGNMENT); ResultsPerROIPane roiPane; StatsResultsPane pane; int c = 0; Icon up = im.getIcon(IconManager.UP), down = im.getIcon(IconManager.DOWN); List analysedROI = control.getAnalyzedROI(); Iterator i = analysedROI.iterator(); ScreenROI roi; ROIStats roiStats; Map results = control.getROIResults(); String[] channels = control.getAnalyzedChannels(); int channel = control.getAnalyzedChannel(0); listROIs = new String[analysedROI.size()]; while (i.hasNext()) { roi = (ScreenROI) i.next(); roiStats = (ROIStats) results.get(roi.getActualROI()); roiPane = new ResultsPerROIPane(c, manager, channels, roi.getName(), roi.getAnnotation()); pane = new StatsResultsPane(manager, roiStats, sizeT, sizeZ, channel, channels.length, up, down); roiPane.addToContainer(pane); paneMap.put(new Integer(c), pane); tabs.insertTab("ROI #"+roi.getIndex(), null, roiPane, null, c); listROIs[c] = "ROI #"+roi.getIndex(); c++; } JPanel p = new JPanel(); p.setLayout(new BorderLayout(0, 0)); p.add(tabs, BorderLayout.CENTER); return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/ROIResults.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/ROIResults.java |
|
channel, channels.length, up, down); | channel, channels.length, up, down, roiIndex, length); | private JPanel buildTabbedPanel(ROIAgtCtrl control, IconManager im, int sizeT, int sizeZ) { JTabbedPane tabs = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT); tabs.setAlignmentX(LEFT_ALIGNMENT); ResultsPerROIPane roiPane; StatsResultsPane pane; int c = 0; Icon up = im.getIcon(IconManager.UP), down = im.getIcon(IconManager.DOWN); List analysedROI = control.getAnalyzedROI(); Iterator i = analysedROI.iterator(); ScreenROI roi; ROIStats roiStats; Map results = control.getROIResults(); String[] channels = control.getAnalyzedChannels(); int channel = control.getAnalyzedChannel(0); listROIs = new String[analysedROI.size()]; while (i.hasNext()) { roi = (ScreenROI) i.next(); roiStats = (ROIStats) results.get(roi.getActualROI()); roiPane = new ResultsPerROIPane(c, manager, channels, roi.getName(), roi.getAnnotation()); pane = new StatsResultsPane(manager, roiStats, sizeT, sizeZ, channel, channels.length, up, down); roiPane.addToContainer(pane); paneMap.put(new Integer(c), pane); tabs.insertTab("ROI #"+roi.getIndex(), null, roiPane, null, c); listROIs[c] = "ROI #"+roi.getIndex(); c++; } JPanel p = new JPanel(); p.setLayout(new BorderLayout(0, 0)); p.add(tabs, BorderLayout.CENTER); return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/ROIResults.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/ROIResults.java |
tabs.insertTab("ROI #"+roi.getIndex(), null, roiPane, null, c); listROIs[c] = "ROI #"+roi.getIndex(); | tabs.insertTab("ROI #"+roiIndex, null, roiPane, null, c); listROIs[c] = "ROI #"+roiIndex; | private JPanel buildTabbedPanel(ROIAgtCtrl control, IconManager im, int sizeT, int sizeZ) { JTabbedPane tabs = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT); tabs.setAlignmentX(LEFT_ALIGNMENT); ResultsPerROIPane roiPane; StatsResultsPane pane; int c = 0; Icon up = im.getIcon(IconManager.UP), down = im.getIcon(IconManager.DOWN); List analysedROI = control.getAnalyzedROI(); Iterator i = analysedROI.iterator(); ScreenROI roi; ROIStats roiStats; Map results = control.getROIResults(); String[] channels = control.getAnalyzedChannels(); int channel = control.getAnalyzedChannel(0); listROIs = new String[analysedROI.size()]; while (i.hasNext()) { roi = (ScreenROI) i.next(); roiStats = (ROIStats) results.get(roi.getActualROI()); roiPane = new ResultsPerROIPane(c, manager, channels, roi.getName(), roi.getAnnotation()); pane = new StatsResultsPane(manager, roiStats, sizeT, sizeZ, channel, channels.length, up, down); roiPane.addToContainer(pane); paneMap.put(new Integer(c), pane); tabs.insertTab("ROI #"+roi.getIndex(), null, roiPane, null, c); listROIs[c] = "ROI #"+roi.getIndex(); c++; } JPanel p = new JPanel(); p.setLayout(new BorderLayout(0, 0)); p.add(tabs, BorderLayout.CENTER); return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/ROIResults.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/ROIResults.java |
int sizeZ, int channel, int l, Icon up, Icon down) | int sizeZ, int channel, int l, Icon up, Icon down, int roiIndex, int length) | public StatsResultsPane(ROIResultsMng mng, ROIStats stats, int sizeT, int sizeZ, int channel, int l, Icon up, Icon down) { manager = new StatsResultsPaneMng(this, mng, sizeT, sizeZ, stats, l); table = new StatsTable(up, down); table.initTable(manager.getDataToDisplay(channel)); bar = new BottomBar(manager, mng.getRegistry()); buildGUI(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/StatsResultsPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/StatsResultsPane.java |
bar = new BottomBar(manager, mng.getRegistry()); | bar = new BottomBar(manager, mng.getRegistry(), length); | public StatsResultsPane(ROIResultsMng mng, ROIStats stats, int sizeT, int sizeZ, int channel, int l, Icon up, Icon down) { manager = new StatsResultsPaneMng(this, mng, sizeT, sizeZ, stats, l); table = new StatsTable(up, down); table.initTable(manager.getDataToDisplay(channel)); bar = new BottomBar(manager, mng.getRegistry()); buildGUI(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/StatsResultsPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/StatsResultsPane.java |
return input.readChar(); | return input.readUnsignedByte(); | public int read() throws IOException { return input.readChar(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e5bbece4f7bb6e057b0dbd1399cf47c6a0f44d4d/DataInputBridgeStream.java/buggy/src/org/jruby/util/DataInputBridgeStream.java |
JMenu menu = view.getWindowsMenu(); | JMenu menu = ImViewerFactory.getWindowsMenu(); | private void attachWindowListeners() { JMenu menu = view.getWindowsMenu(); menu.addMenuListener(new MenuListener() { public void menuSelected(MenuEvent e) { createWindowsMenuItems(); } /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuListener#menuCanceled(MenuEvent) */ public void menuCanceled(MenuEvent e) {} /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuListener#menuDeselected(MenuEvent) */ public void menuDeselected(MenuEvent e) {} }); //Listen to keyboard selection menu.addMenuKeyListener(new MenuKeyListener() { public void menuKeyReleased(MenuKeyEvent e) { createWindowsMenuItems(); } /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuKeyListener#menuKeyPressed(MenuKeyEvent) */ public void menuKeyPressed(MenuKeyEvent e) {} /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuKeyListener#menuKeyTyped(MenuKeyEvent) */ public void menuKeyTyped(MenuKeyEvent e) {} }); view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { model.discard(); } public void windowDeiconified(WindowEvent e) { model.iconified(false); } public void windowIconified(WindowEvent e) { model.iconified(true); } }); view.getLoadingWindow().addPropertyChangeListener( LoadingWindow.CLOSED_PROPERTY, this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8b5ed57b1a06841fc56344f3b4489a5dc633e6c0/ImViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerControl.java |
JMenu menu = view.getWindowsMenu(); | JMenu menu = ImViewerFactory.getWindowsMenu(); | private void createWindowsMenuItems() { Set viewers = ImViewerFactory.getViewers(); Iterator i = viewers.iterator(); JMenu menu = view.getWindowsMenu(); menu.removeAll(); ImViewer viewer; while (i.hasNext()) { viewer = (ImViewer) i.next(); //if (!(viewer == model)) menu.add(new JMenuItem(new ActivationAction(viewer))); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8b5ed57b1a06841fc56344f3b4489a5dc633e6c0/ImViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerControl.java |
super(ruby, "$" + bean.name, null); | super(ruby, GlobalVariable.variableName(bean.name), null); | public BeanGlobalVariable(Ruby ruby, BSFDeclaredBean bean) { super(ruby, "$" + bean.name, null); this.bean = bean; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe90dd6c556fab30e7ced54beb6d47e382ea6ee0/JRubyEngine.java/buggy/src/org/jruby/javasupport/bsf/JRubyEngine.java |
ruby.undefineGlobalVar(bean.name); | ruby.undefineGlobalVar(GlobalVariable.variableName(bean.name)); | public void undeclareBean(BSFDeclaredBean bean) throws BSFException { ruby.undefineGlobalVar(bean.name); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe90dd6c556fab30e7ced54beb6d47e382ea6ee0/JRubyEngine.java/buggy/src/org/jruby/javasupport/bsf/JRubyEngine.java |
_q = (IQuery) applicationContext.getBean("queryService"); | _q = new ServiceFactory( (OmeroContext) applicationContext ).getQueryService(); | protected void onSetUp() throws Exception { _q = (IQuery) applicationContext.getBean("queryService"); po = new PojoOptions().exp(1L); ids = new HashSet<Integer>(Arrays.asList(new Integer[]{1,2,3,4,5,6,250,253,249,258})); m = new HashMap(); m.put("id_list",ids); m.put("exp",po.getExperimenter()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/PojosDaoTest.java/buggy/components/server/test/ome/server/itests/PojosDaoTest.java |
static List checkGettersAndSetters(Method[] methods) { List goodMethods = new ArrayList(); if (null == methods) return goodMethods; for (int i = 0; i < methods.length; i++) { boolean ok = true; Method method = methods[i]; int mod = method.getModifiers(); if (!Modifier.isPublic(mod) || Modifier.isStatic(mod)) { ok = false; } if (method.getName().startsWith("get")) { if (0 != method.getParameterTypes().length) { ok = false; } } else if (method.getName().startsWith("set")) { // No constaints yet on setters. } else { ok = false; } if (ok) goodMethods.add(method); } return goodMethods; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ReflectionUtils.java/clean/components/common/src/org/openmicroscopy/omero/util/ReflectionUtils.java |
||
super.init(b,config); | public void init(Broker b, Properties config) throws InitException { _broker = b; _log = b.getLog("resource"); try { try { String cacheStr = config.getProperty("TemplateExpireTime"); _cacheDuration = Integer.valueOf(cacheStr).intValue(); } catch (Exception ee) { // use default } _templatePath = config.getProperty("TemplatePath"); StringTokenizer st = new StringTokenizer(_templatePath, _pathSeparator); _templateDirectory = new String[ st.countTokens() ]; int i; for (i=0; i < _templateDirectory.length; i++) { String dir = st.nextToken(); _templateDirectory[i] = dir; } } catch(Exception e) { throw new InitException("Could not initialize: " + e); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/TemplateProvider.java/clean/webmacro/src/org/webmacro/resource/TemplateProvider.java |
|
Object locale = null; try { Field f = Locale.class.getField(field); locale = f.get(null); } catch (Exception ne) { StringTokenizer st = new StringTokenizer(field,"_"); String[] parts = new String[] {"","",""}; try { for (int i=0; i<3; i++) { parts[i] = st.nextToken(); } } catch (NoSuchElementException e) {} locale = new Locale(parts[0], parts[1], parts[2]); } return locale; | return buildLocale(field); | final public Object get(String field) { Object locale = null; try { Field f = Locale.class.getField(field); locale = f.get(null); } catch (Exception ne) { StringTokenizer st = new StringTokenizer(field,"_"); String[] parts = new String[] {"","",""}; try { for (int i=0; i<3; i++) { parts[i] = st.nextToken(); } } catch (NoSuchElementException e) {}// System.out.println("Creating Locale: "// +parts[0]+"-"+parts[1]+"-"+parts[2]); locale = new Locale(parts[0], parts[1], parts[2]); }// System.out.println("Returning locale for "+field+" -> "+locale); return locale; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c6a528c19767039b6640003266b3bd96a892994e/LocaleTool.java/clean/webmacro/src/org/webmacro/servlet/LocaleTool.java |
if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) | if (coberturaFile.isClass() && shouldInstrument(coberturaFile.getPathname())) | private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/73cd6cee6c47bb171b3c10fb87c9d986322605f8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, | File relativeFile = new File(coberturaFile.getPathname(), contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.getBaseDir(), | private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/73cd6cee6c47bb171b3c10fb87c9d986322605f8/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
rs.setLexFileIo(true); | /*rs.setLexFileIo(true); | public Node compileFile(String f, RubyObject file, int start) { rs.setLexFileIo(true); rs.setLexInput(file); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(start - 1); return yycompile(f, start); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/DefaultRubyParser.java/buggy/org/jruby/parser/DefaultRubyParser.java |
rs.setLexPEnd(0); | rs.setLexPEnd(0);*/ | public Node compileFile(String f, RubyObject file, int start) { rs.setLexFileIo(true); rs.setLexInput(file); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(start - 1); return yycompile(f, start); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/DefaultRubyParser.java/buggy/org/jruby/parser/DefaultRubyParser.java |
rs.setLexFileIo(false); | /*rs.setLexFileIo(false); | public Node compileString(String f, RubyObject s, int line) { rs.setLexFileIo(false); rs.setLexGetsPtr(0); rs.setLexInput(s); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(line - 1); ph.setCompileForEval(ruby.getInEval()); return yycompile(f, line); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/DefaultRubyParser.java/buggy/org/jruby/parser/DefaultRubyParser.java |
rs.setLexPEnd(0); | rs.setLexPEnd(0);*/ | public Node compileString(String f, RubyObject s, int line) { rs.setLexFileIo(false); rs.setLexGetsPtr(0); rs.setLexInput(s); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(line - 1); ph.setCompileForEval(ruby.getInEval()); return yycompile(f, line); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/DefaultRubyParser.java/buggy/org/jruby/parser/DefaultRubyParser.java |
rs.setSource(new StringScannerSource(f, s.toString())); | public Node compileString(String f, RubyObject s, int line) { rs.setLexFileIo(false); rs.setLexGetsPtr(0); rs.setLexInput(s); rs.setLexP(0); rs.setLexPEnd(0); ruby.setSourceLine(line - 1); ph.setCompileForEval(ruby.getInEval()); return yycompile(f, line); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/DefaultRubyParser.java/buggy/org/jruby/parser/DefaultRubyParser.java |
|
return getTemplate(name); | return getResource(name); | public URL getTemplate(String name) { if (_templatePrefix == null) return getTemplate(name); else { URL u = getResource(_templatePrefix + name); return (u != null) ? u : getResource(name); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/74225abbfc0a04f290f49f77d0f5c6ecf6286030/Servlet22Broker.java/clean/webmacro/src/org/webmacro/servlet/Servlet22Broker.java |
super(name); | super(name); | public TestRuby(String name) { super(name); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
assertTrue(iObj.isTrue()); | assertTrue(iObj.isTrue()); | private void assertTrue(RubyObject iObj) { assertTrue(iObj.isTrue()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); | ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); | public void setUp() { ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
super.tearDown(); | super.tearDown(); | public void tearDown() { super.tearDown(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
ArrayList list = new ArrayList(); ruby.initLoad(list); list.clear(); File testFile = new File("fib.rb"); try { ruby.findFile(testFile); fail("should have thrown an exception, the file fib.rb is not in the search path"); } catch (Exception e) { } list.add("./samples"); ruby.initLoad(list); assertEquals(new File("./samples/fib.rb"), ruby.findFile(testFile)); | ArrayList list = new ArrayList(); ruby.initLoad(list); list.clear(); File testFile = new File("fib.rb"); try { ruby.findFile(testFile); fail("should have thrown an exception, the file fib.rb is not in the search path"); } catch (Exception e) { } list.add("./samples"); ruby.initLoad(list); assertEquals(new File("./samples/fib.rb"), ruby.findFile(testFile)); | public void testFindFile() { ArrayList list = new ArrayList(); ruby.initLoad(list); list.clear(); File testFile = new File("fib.rb"); try { ruby.findFile(testFile); fail("should have thrown an exception, the file fib.rb is not in the search path"); } catch (Exception e) { } list.add("./samples"); //now we valuate the path ruby.initLoad(list); assertEquals(new File("./samples/fib.rb"), ruby.findFile(testFile)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
ArrayList list = new ArrayList(); list.add("toto"); ruby.initLoad(list); RubyObject lCol = ruby.getGlobalVar("$:"); RubyObject lI = ruby.getGlobalVar("$-I"); RubyObject lLoad = ruby.getGlobalVar("$LOAD_PATH"); assertTrue(lCol == lI && lI == lLoad && lLoad != null); RubyArray lLoadA = (RubyArray)lLoad; assertTrue(((RubyFixnum)lLoadA.nitems()).getValue()== 2); assertTrue(new RubyString(ruby,"toto").equal(lLoadA.shift())); assertTrue(new RubyString(ruby,".").equal(lLoadA.shift())); System.setProperty("jruby.home", "RubyHome"); /* C:\dev\jruby>ruby -e "puts $:" /cygdrive/d/ruby/lib/ruby/site_ruby/1.6 /cygdrive/d/ruby/lib/ruby/site_ruby/1.6/i386-cygwin /cygdrive/d/ruby/lib/ruby/site_ruby /cygdrive/d/ruby/lib/ruby/1.6 /cygdrive/d/ruby/lib/ruby/1.6/i386-cygwin . */ ruby.initLoad(new ArrayList()); String wanted; if (File.separatorChar == '/') { wanted = "RubyHome/lib/ruby/site_ruby/1.6" + "RubyHome/lib/ruby/site_ruby/1.6/JAVA" + "RubyHome/lib/ruby/site_ruby" + "RubyHome/lib/ruby/1.6" + "RubyHome/lib/ruby/1.6/JAVA" + ".\n"; } else { wanted = "RubyHome\\lib\\ruby\\site_ruby\\1.6" + "RubyHome\\lib\\ruby\\site_ruby\\1.6\\JAVA" + "RubyHome\\lib\\ruby\\site_ruby" + "RubyHome\\lib\\ruby\\1.6" + "RubyHome\\lib\\ruby\\1.6\\JAVA" + "."; } assertEquals(wanted, eval("puts $:")); | ArrayList list = new ArrayList(); System.setProperty("jruby.home", ""); list.add("toto"); ruby.initLoad(list); RubyObject lCol = ruby.getGlobalVar("$:"); RubyObject lI = ruby.getGlobalVar("$-I"); RubyObject lLoad = ruby.getGlobalVar("$LOAD_PATH"); assertTrue(lCol == lI && lI == lLoad && lLoad != null); RubyArray lLoadA = (RubyArray) lLoad; assertTrue(((RubyFixnum) lLoadA.nitems()).getValue() == 2); assertTrue(new RubyString(ruby, "toto").equal(lLoadA.shift())); assertTrue(new RubyString(ruby, ".").equal(lLoadA.shift())); System.setProperty("jruby.home", "RubyHome"); /* C:\dev\jruby>ruby -e "puts $:" /cygdrive/d/ruby/lib/ruby/site_ruby/1.6 /cygdrive/d/ruby/lib/ruby/site_ruby/1.6/i386-cygwin /cygdrive/d/ruby/lib/ruby/site_ruby /cygdrive/d/ruby/lib/ruby/1.6 /cygdrive/d/ruby/lib/ruby/1.6/i386-cygwin . */ ruby.initLoad(new ArrayList()); String wanted; if (File.separatorChar == '/') { wanted = "RubyHome/lib/ruby/site_ruby/1.6" + "RubyHome/lib/ruby/site_ruby/1.6/JAVA" + "RubyHome/lib/ruby/site_ruby" + "RubyHome/lib/ruby/1.6" + "RubyHome/lib/ruby/1.6/JAVA" + "."; } else { wanted = "RubyHome\\lib\\ruby\\site_ruby\\1.6" + "RubyHome\\lib\\ruby\\site_ruby\\1.6\\JAVA" + "RubyHome\\lib\\ruby\\site_ruby" + "RubyHome\\lib\\ruby\\1.6" + "RubyHome\\lib\\ruby\\1.6\\JAVA" + "."; } assertEquals(wanted, eval("puts $:")); | public void testInitLoad() { ArrayList list = new ArrayList(); //check without a RubyHome and with one parameter list.add("toto"); ruby.initLoad(list); //check that the global vars are correctly valuated RubyObject lCol = ruby.getGlobalVar("$:"); RubyObject lI = ruby.getGlobalVar("$-I"); RubyObject lLoad = ruby.getGlobalVar("$LOAD_PATH"); assertTrue(lCol == lI && lI == lLoad && lLoad != null); RubyArray lLoadA = (RubyArray)lLoad; //check that we have 2 non null element assertTrue(((RubyFixnum)lLoadA.nitems()).getValue()== 2); //check that it is what we expect, a RubyString of the correct type assertTrue(new RubyString(ruby,"toto").equal(lLoadA.shift())); assertTrue(new RubyString(ruby,".").equal(lLoadA.shift())); //check the case when RubyHome is valuated System.setProperty("jruby.home", "RubyHome"); //MRI result /*C:\dev\jruby>ruby -e "puts $:"/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/cygdrive/d/ruby/lib/ruby/site_ruby/1.6/i386-cygwin/cygdrive/d/ruby/lib/ruby/site_ruby/cygdrive/d/ruby/lib/ruby/1.6/cygdrive/d/ruby/lib/ruby/1.6/i386-cygwin. */ ruby.initLoad(new ArrayList()); String wanted; if (File.separatorChar == '/') { wanted = "RubyHome/lib/ruby/site_ruby/1.6" + "RubyHome/lib/ruby/site_ruby/1.6/JAVA" + "RubyHome/lib/ruby/site_ruby" + "RubyHome/lib/ruby/1.6" + "RubyHome/lib/ruby/1.6/JAVA" + ".\n"; } else { wanted = "RubyHome\\lib\\ruby\\site_ruby\\1.6" + "RubyHome\\lib\\ruby\\site_ruby\\1.6\\JAVA" + "RubyHome\\lib\\ruby\\site_ruby" + "RubyHome\\lib\\ruby\\1.6" + "RubyHome\\lib\\ruby\\1.6\\JAVA" + "."; } assertEquals(wanted, eval("puts $:")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
public void testVarAndMet() { ArrayList list = new ArrayList(); ruby.initLoad(list); eval("load './test/testVariableAndMethod.rb'"); assertEquals("Hello World", eval("puts($a)")); assertEquals("dlroW olleH", eval("puts $b")); assertEquals("Hello World", eval("puts $d.reverse, $c, $e.reverse")); assertEquals("135 20 3", eval("puts $f, \" \", $g, \" \", $h")); | public void testVarAndMet() { ArrayList list = new ArrayList(); ruby.initLoad(list); eval("load './test/testVariableAndMethod.rb'"); assertEquals("Hello World", eval("puts($a)")); assertEquals("dlroW olleH", eval("puts $b")); assertEquals("Hello World", eval("puts $d.reverse, $c, $e.reverse")); assertEquals("135 20 3", eval("puts $f, \" \", $g, \" \", $h")); | public void testVarAndMet() { ArrayList list = new ArrayList(); ruby.initLoad(list); eval("load './test/testVariableAndMethod.rb'"); assertEquals("Hello World", eval("puts($a)")); assertEquals("dlroW olleH", eval("puts $b")); assertEquals("Hello World", eval("puts $d.reverse, $c, $e.reverse")); assertEquals("135 20 3", eval("puts $f, \" \", $g, \" \", $h")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
String errorText = "Set: Unable to set value: " + target; | String errorText = "#set: Unable to set value: " + target; | public void write(FastWriter out, Context context) throws ContextException, IOException { boolean done=false; try { if (result instanceof Macro) target.setValue(context, ((Macro) result).evaluate(context)); else target.setValue(context, result); } catch (ContextException e) { String errorText = "Set: Unable to set value: " + target; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/3b361f35f3cd9fe5023b969ea9dd1ebdd30219a1/SetDirective.java/clean/webmacro/src/org/webmacro/directive/SetDirective.java |
"Required parameters missing from query:"+ | "Required parameters missing from query: "+ | 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 (! qps.keySet().containsAll( defs.keySet() ) ) throw new IllegalArgumentException( "Required parameters missing from query:"+ new HashSet( qps.keySet() ).removeAll( defs.keySet() )); for (String name : defs.keySet()) { QueryParameter parameter = qps.get( name ); QueryParameterDef def = defs.get( name ); def.errorIfInvalid( parameter ); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5a7691e42b193b6eb28c3405cac3380da0cd70ab/Query.java/buggy/components/server/src/ome/services/query/Query.java |
dumpString(marshaled.getValue()); | dumpString(marshaled.toString()); | private void userMarshal(IRubyObject value) throws IOException { out.write(TYPE_USERDEF); dumpObject(RubySymbol.newSymbol(runtime, value.getMetaClass().getName())); RubyString marshaled = (RubyString) value.callMethod("_dump", runtime.newFixnum(depthLimit)); dumpString(marshaled.getValue()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/MarshalStream.java/clean/src/org/jruby/runtime/marshal/MarshalStream.java |
String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); | if (chatRoom instanceof ChatRoomImpl) { String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); | 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); if (index == -1) { return; } 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/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
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)); | if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); | 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); if (index == -1) { return; } 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/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
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)); | 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)); } | 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); if (index == -1) { return; } 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/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); | if (chatRoom instanceof ChatRoomImpl) { String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); | public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } 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(); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
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)); | if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); | public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } 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(); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
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)); | 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)); } | public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } 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(); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
setSelectedIndex(tabLocation); | if (tabLocation != -1) { setSelectedIndex(tabLocation); } | private void checkNotificationPreferences(final ChatRoom room) { LocalPreferences pref = SettingsManager.getLocalPreferences(); if (pref.getWindowTakesFocus()) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); } if (pref.getShowToasterPopup()) { SparkToaster toaster = new SparkToaster(); toaster.setCustomAction(new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); } }); toaster.setDisplayTime(5000); toaster.setBorder(BorderFactory.createBevelBorder(0)); String nickname = ((ChatRoomImpl)room).getParticipantNickname(); toaster.setTitle(nickname); toaster.setToasterHeight(150); toaster.setToasterWidth(200); int size = room.getTranscripts().size(); if (size > 0) { Message message = (Message)room.getTranscripts().get(size - 1); toaster.showToaster(room.getTabIcon(), message.getBody()); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
setSelectedIndex(tabLocation); | if (tabLocation != -1) { setSelectedIndex(tabLocation); } | public void actionPerformed(ActionEvent actionEvent) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dc58eb5ce4764d1cb940501d26d4b3adb78a5813/ChatContainer.java/clean/src/java/org/jivesoftware/spark/ui/ChatContainer.java |
String dotPrefix = (prefix == null) ? "" : prefix + "."; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (prefix == null) p.setProperty(key, _servletContext.getInitParameter(key)); else if (key.startsWith(dotPrefix)) p.setProperty(key, _servletContext.getInitParameter(key) | if (e != null) { String dotPrefix = (prefix == null) ? "" : prefix + "."; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (prefix == null) p.setProperty(key, _servletContext.getInitParameter(key)); else if (key.startsWith(dotPrefix)) p.setProperty(key, _servletContext.getInitParameter(key) | protected void loadServletSettings(String prefix) throws InitException { Properties p = new Properties(); Enumeration e = _servletContext.getInitParameterNames(); String dotPrefix = (prefix == null) ? "" : prefix + "."; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (prefix == null) p.setProperty(key, _servletContext.getInitParameter(key)); else if (key.startsWith(dotPrefix)) p.setProperty(key, _servletContext.getInitParameter(key) .substring(dotPrefix.length())); } _config.load(p, prefix); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/72937f7eb4308e675d718b6b57fe64548fbe003f/Servlet22Broker.java/clean/webmacro/src/org/webmacro/servlet/Servlet22Broker.java |
protected void loadServletSettings(String prefix) throws InitException { Properties p = new Properties(); Enumeration e = _servletContext.getInitParameterNames(); String dotPrefix = (prefix == null) ? "" : prefix + "."; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (prefix == null) p.setProperty(key, _servletContext.getInitParameter(key)); else if (key.startsWith(dotPrefix)) p.setProperty(key, _servletContext.getInitParameter(key) .substring(dotPrefix.length())); } _config.load(p, prefix); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/72937f7eb4308e675d718b6b57fe64548fbe003f/Servlet22Broker.java/clean/webmacro/src/org/webmacro/servlet/Servlet22Broker.java |
||
BufferedImage getZoomedLensImage() { return lens.getZoomedImage(); } | BufferedImage getZoomedLensImage() { if (lens == null) return null; return lens.getZoomedImage(); } | BufferedImage getZoomedLensImage() { return lens.getZoomedImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
void setChannelsSelection() { controlPane.setChannelsSelection(); } | void setChannelsSelection() { controlPane.setChannelsSelection(); } | void setChannelsSelection() { controlPane.setChannelsSelection(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
void setImageZoomFactor(float factor) { lens.setImageZoomFactor(factor); } | void setImageZoomFactor(float factor) { if (lens == null) return; lens.setImageZoomFactor(factor); } | void setImageZoomFactor(float factor) { lens.setImageZoomFactor(factor); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
if (lens == null) return; | void setLensPlaneImage(BufferedImage img) { lens.setPlaneImage(img); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
|
if (lens==null) lens = new LensComponent(this); if (b) { | if (lens == null) lens = new LensComponent(this); if (b) { | void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
if (firstTimeLensShown) { | if (firstTimeLensShown) { | void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
lens.setPlaneImage(model.getRenderedImage()); | lens.setPlaneImage(model.getDisplayedImage()); | void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
this.repaint(); | repaint(); | void setLensVisible(boolean b) { if (lens==null) lens = new LensComponent(this); if (b) { if (model.getMaxX() < lens.getLensUI().getWidth() || model.getMaxY() < lens.getLensUI().getHeight()) return; if (firstTimeLensShown) { firstTimeLensShown = false; int lensX = model.getMaxX()/2-lens.getLensUI().getWidth()/2; int lensY = model.getMaxY()/2-lens.getLensUI().getHeight()/2; if (lensX+lens.getLensUI().getWidth() > model.getMaxX()) lensX = model.getMaxX()-lens.getLensUI().getWidth(); if (lensY+lens.getLensUI().getHeight() > model.getMaxY()) lensY = model.getMaxY()-lens.getLensUI().getHeight(); lens.setImageZoomFactor((float)model.getZoomFactor()); lens.setLensLocation(lensX, lensY); lens.setXYPixelMicron(model.getPixelsSizeX(), model.getPixelsSizeY()); model.getBrowser().addComponent(lens.getLensUI()); lens.setZoomWindowLocation(getX()+getWidth(), getY()); } lens.setImageZoomFactor((float) model.getZoomFactor()); lens.setPlaneImage(model.getRenderedImage()); lens.setLensPreferredColour(); } lens.setVisible(b); this.repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
if (menuID !=ImViewer.COLOR_PICKER_MENU) return; | if (menuID != ImViewer.COLOR_PICKER_MENU) return; | void showMenu(int menuID, Component source, Point location) { if (menuID !=ImViewer.COLOR_PICKER_MENU) return; ChannelMetadata[] data = model.getChannelData(); ChannelMetadata d; JPopupMenu menu = new JPopupMenu(); ChannelColorMenuItem item; for (int j = 0; j < data.length; j++) { d = data[j]; item = new ChannelColorMenuItem( "Wavelength "+d.getEmissionWavelength(), model.getChannelColor(j), j); menu.add(item); item.addPropertyChangeListener(controller); } menu.show(source, location.x, location.y); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
void showMenu(int menuID, Component source, Point location) { if (menuID !=ImViewer.COLOR_PICKER_MENU) return; ChannelMetadata[] data = model.getChannelData(); ChannelMetadata d; JPopupMenu menu = new JPopupMenu(); ChannelColorMenuItem item; for (int j = 0; j < data.length; j++) { d = data[j]; item = new ChannelColorMenuItem( "Wavelength "+d.getEmissionWavelength(), model.getChannelColor(j), j); menu.add(item); item.addPropertyChangeListener(controller); } menu.show(source, location.x, location.y); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java |
||
_log.debug("Looking for template: " + tFile); | final public Template getTemplate(String fileName) { for (int i=0; i < _templateDirectory.length; i++) { Template t; String dir = _templateDirectory[i]; File tFile = new File(dir,fileName); if (tFile.canRead()) { try { t = new FileTemplate(_broker,tFile); t.parse(); return t; } catch (Exception e) { _log.warning("TemplateProvider: Could not load template: " + tFile, e); } } } return null; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/00af97f85c3f1eff849b9f47def81ab18c9841b1/TemplateProvider.java/buggy/webmacro/src/org/webmacro/resource/TemplateProvider.java |
|
_log.info("Loading template: " + name); | final public TimedReference load(String name) throws NotFoundException { Template t = getTemplate(name); if (t == null) { throw new NotFoundException( this + " could not locate " + name + " on path " + _templatePath); } return new TimedReference(t, _cacheDuration); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/00af97f85c3f1eff849b9f47def81ab18c9841b1/TemplateProvider.java/buggy/webmacro/src/org/webmacro/resource/TemplateProvider.java |
|
private void addInstrumentation(File baseDir, String filename) { logger.debug("filename: " + filename); File file; if (baseDir == null) file = new File(filename); else file = new File(baseDir, filename); addInstrumentation(file); } | private void addInstrumentation(File file) { if (isClass(file)) { addInstrumentationToSingleClass(file); } else if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); } else if (isArchive(file)) { addInstrumentationToArchive(file); } } | private void addInstrumentation(File baseDir, String filename) { logger.debug("filename: " + filename); File file; if (baseDir == null) file = new File(filename); else file = new File(baseDir, filename); addInstrumentation(file); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); | private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); | private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } | byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); | private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
try { if (destinationDirectory != null) { outputFile = new File(destinationDirectory, archive .getName()); } else { outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } | if (isClass(entry)) { ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, false); | private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } | if (cv.isInstrumented()) { logger.debug("Putting instrumeted entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } | private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } } | output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } } | private void addInstrumentationToArchive(File archive) { logger.debug("Instrumenting archive " + archive.getAbsolutePath()); File outputFile = null; ZipInputStream input = null; ZipOutputStream output = null; try { // Open archive try { input = new ZipInputStream(new FileInputStream(archive)); } catch (FileNotFoundException e) { logger.warn("Cannot open archive file: " + archive.getAbsolutePath(), e); return; } // Open output archive try { // check if destination folder is set if (destinationDirectory != null) { // if so, create output file in it outputFile = new File(destinationDirectory, archive .getName()); } else { // otherwise create output file in temporary location outputFile = File.createTempFile( "CoberturaInstrumentedArchive", "jar"); outputFile.deleteOnExit(); } output = new ZipOutputStream(new FileOutputStream(outputFile)); } catch (IOException e) { logger.warn("Cannot open file for instrumented archive: " + archive.getAbsolutePath(), e); return; } // Instrument classes in archive try { addInstrumentationToArchive(input, output); } catch (Exception e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } if (output != null) { try { output.close(); } catch (IOException e) { } } } // If destination folder was not set, overwrite orginal archive with // instrumented one if (destinationDirectory == null) { try { IOUtil.moveFile(outputFile, archive); } catch (IOException e) { logger.warn("Cannot instrument archive: " + archive.getAbsolutePath(), e); return; } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
{ logger.debug("Instrumenting class " + file.getAbsolutePath()); | { logger.debug("Instrumenting class " + file.getAbsolutePath()); | private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } | InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } | private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
OutputStream outputStream = null; try { if (cv.isInstrumented()) { File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); | OutputStream outputStream = null; try { if (cv.isInstrumented()) { File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); | private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } | File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } | private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(this.projectData, cw, this.ignoreRegexs); cr.accept(cv, false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
{ String name = file.getName(); return name.endsWith(".jar") || name.endsWith(".zip") || name.endsWith(".war") || name.endsWith(".ear") || name.endsWith(".sar"); } | { String name = file.getName(); return name.endsWith(".jar") || name.endsWith(".zip") || name.endsWith(".war") || name.endsWith(".ear") || name.endsWith(".sar"); } | private static boolean isArchive(File file) { String name = file.getName(); return name.endsWith(".jar") || name.endsWith(".zip") || name.endsWith(".war") || name.endsWith(".ear") || name.endsWith(".sar"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
{ return file.getName().endsWith(".class"); } | { return file.getName().endsWith(".class"); } | private static boolean isClass(File file) { return file.getName().endsWith(".class"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
{ long startTime = System.currentTimeMillis(); | { long startTime = System.currentTimeMillis(); | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } | Main main = new Main(); | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; | boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; | if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
while ((line = bufferedReader.readLine()) != null) arglist.add(line); | try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
} catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } | while ((line = bufferedReader.readLine()) != null) arglist.add(line); | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
args = (String[])arglist.toArray(new String[arglist.size()]); } | } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
new Main(args); | args = (String[])arglist.toArray(new String[arglist.size()]); } | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | main.parseArguments(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | public static void main(String[] args) { long startTime = System.currentTimeMillis(); boolean hasCommandsFile = false; String commandsFileName = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--commandsfile")) { hasCommandsFile = true; commandsFileName = args[++i]; } } if (hasCommandsFile) { List arglist = new ArrayList(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader( commandsFileName)); String line; while ((line = bufferedReader.readLine()) != null) arglist.add(line); } catch (IOException e) { logger.fatal("Unable to read temporary commands file " + commandsFileName + "."); logger.info(e); } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException e) { } } } args = (String[])arglist.toArray(new String[arglist.size()]); } // Instrument! new Main(args); long stopTime = System.currentTimeMillis(); System.out.println("Instrument time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.println(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); } } return ruby.getNil(); | return recv.m_to_s(); | public RubyObject execute(RubyObject recv, RubyObject args[], Ruby ruby) { for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.println(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); } } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/09d14a481cf7e28332c61c038c7d4b468854d38d/RBKernel.java/clean/org/jruby/core/RBKernel.java |
view.updateMenuItems(); | public void propertyChange(PropertyChangeEvent pce) { String name = pce.getPropertyName(); if (name == null) return; if (name.equals(TreeViewer.CANCEL_LOADING_PROPERTY)) { Browser browser = model.getSelectedBrowser(); if (browser != null) browser.cancel(); } else if (name.equals(Browser.POPUP_MENU_PROPERTY)) { Component c = (Component) pce.getNewValue(); Browser browser = model.getSelectedBrowser(); if (browser != null && c != null) view.showPopup(c, browser.getClickPoint()); } else if (name.equals(Browser.CLOSE_PROPERTY)) { Browser browser = (Browser) pce.getNewValue(); if (browser != null) view.removeBrowser(browser); } else if (name.equals(Editor.CLOSE_EDITOR_PROPERTY)) { Browser b = model.getSelectedBrowser(); TreeImageDisplay d = null; if (b != null) d = b.getLastSelectedDisplay(); int editorType = model.getEditorType(); model.removeEditor(); model.onComponentStateChange(true); if (editorType == TreeViewer.CREATE_EDITOR) resetSelectedDisplay(d); } else if (name.equals(Classifier.CLOSE_CLASSIFIER_PROPERTY)) { Browser b = model.getSelectedBrowser(); if (b != null) resetSelectedDisplay(b.getLastSelectedDisplay()); model.onComponentStateChange(true); } else if (name.equals(TreeViewer.FINDER_VISIBLE_PROPERTY)) { Boolean b = (Boolean) pce.getNewValue(); if (!b.booleanValue()) { model.clearFoundResults(); model.onComponentStateChange(true); } } else if (name.equals(TreeViewer.SELECTED_BROWSER_PROPERTY)) { Browser b = model.getSelectedBrowser(); Iterator i = model.getBrowsers().values().iterator(); Browser browser; while (i.hasNext()) { browser = (Browser) i.next(); browser.setSelected(browser.equals(b)); } } else if (name.equals(TreeViewer.THUMBNAIL_LOADING_PROPERTY)) { model.retrieveThumbnail((ImageData) pce.getNewValue()); } else if (name.equals(Browser.SELECTED_DISPLAY_PROPERTY)) { Object oldValue = pce.getOldValue(); Object newValue = pce.getNewValue(); if (oldValue != null && newValue != null) { if (!(oldValue.getClass().equals(newValue.getClass()))) model.setEditorSelectedPane(Editor.PROPERTIES_INDEX); } model.onSelectedDisplay(); } else if (name.equals(TreeViewer.HIERARCHY_ROOT_PROPERTY)) { Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } else if (name.equals( AddExistingObjectsDialog.EXISTING_ADD_PROPERTY)) { model.addExistingObjects((Set) pce.getNewValue()); } else if (name.equals(EditorSaverDialog.SAVING_DATA_EDITOR_PROPERTY)) { boolean b = ((Boolean) pce.getNewValue()).booleanValue(); model.saveInEditor(b); } else if (name.equals(DataHandler.ANNOTATED_PROPERTY) || name.equals(DataHandler.CLASSIFIED_PROPERTY)) { if (view.getDataHandler() == null) return; view.discardDataHandler(); Map browsers = model.getBrowsers(); Iterator i = browsers.values().iterator(); while (i.hasNext()) ((Browser) i.next()).refreshTree(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/TreeViewerControl.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java |
|
rootAdmin.addGroups(user, user_other_group); | rootAdmin.addGroups(user, user_other_group, common_group); | public void createUsersAndGroups() throws Exception { init(); cname = UUID.randomUUID().toString(); gname = UUID.randomUUID().toString(); // shortcut for root service factory, created in super class r = rootServices; // create the common group common_group.setName(cname); common_group = new ExperimenterGroup(rootAdmin .createGroup(common_group),false); // TODO -- this should be a task // create the new group user_other_group.setName(gname); user_other_group = new ExperimenterGroup(rootAdmin .createGroup(user_other_group), false); // create the PI for the new group Login piLogin = new Login(UUID.randomUUID().toString(),"empty",gname,"Test"); p = new ServiceFactory(piLogin); pi.setOmeName(piLogin.getName()); pi.setFirstName("read"); pi.setLastName("security -- leader of user_other_group"); pi = new Experimenter(rootAdmin.createUser(pi,gname), false); // make the PI the group leader. rootAdmin.setGroupOwner(user_other_group, pi); // ENDTODO // create a new user in that group Login userLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); u = new ServiceFactory(userLogin); user.setOmeName(userLogin.getName()); user.setFirstName("read"); user.setLastName("security"); user = new Experimenter(rootAdmin.createUser(user,gname), false); rootAdmin.addGroups(user, user_other_group); // create another user in that group Login otherLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); o = new ServiceFactory(otherLogin); other.setOmeName(otherLogin.getName()); other.setFirstName("read"); other.setLastName("security2"); other = new Experimenter(rootAdmin.createUser(other,gname), false); rootAdmin.addGroups(other, user_other_group); // create a third regular user not in that group Login worldLogin = new Login(UUID.randomUUID().toString(), "empty" /* not gname!*/); w = new ServiceFactory(worldLogin); world.setOmeName(worldLogin.getName()); world.setFirstName("read"); world.setLastName("Security -- not in their group"); world = new Experimenter(rootAdmin.createUser(world,cname), false); // not in same group } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c94acf1ed28125ea3ec367725deb6b3896e87bd4/AbstractPermissionsTest.java/buggy/components/client/test/ome/client/itests/sec/AbstractPermissionsTest.java |
rootAdmin.addGroups(other, user_other_group); | rootAdmin.addGroups(other, user_other_group, common_group); | public void createUsersAndGroups() throws Exception { init(); cname = UUID.randomUUID().toString(); gname = UUID.randomUUID().toString(); // shortcut for root service factory, created in super class r = rootServices; // create the common group common_group.setName(cname); common_group = new ExperimenterGroup(rootAdmin .createGroup(common_group),false); // TODO -- this should be a task // create the new group user_other_group.setName(gname); user_other_group = new ExperimenterGroup(rootAdmin .createGroup(user_other_group), false); // create the PI for the new group Login piLogin = new Login(UUID.randomUUID().toString(),"empty",gname,"Test"); p = new ServiceFactory(piLogin); pi.setOmeName(piLogin.getName()); pi.setFirstName("read"); pi.setLastName("security -- leader of user_other_group"); pi = new Experimenter(rootAdmin.createUser(pi,gname), false); // make the PI the group leader. rootAdmin.setGroupOwner(user_other_group, pi); // ENDTODO // create a new user in that group Login userLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); u = new ServiceFactory(userLogin); user.setOmeName(userLogin.getName()); user.setFirstName("read"); user.setLastName("security"); user = new Experimenter(rootAdmin.createUser(user,gname), false); rootAdmin.addGroups(user, user_other_group); // create another user in that group Login otherLogin = new Login(UUID.randomUUID().toString(), "empty",gname,"Test"); o = new ServiceFactory(otherLogin); other.setOmeName(otherLogin.getName()); other.setFirstName("read"); other.setLastName("security2"); other = new Experimenter(rootAdmin.createUser(other,gname), false); rootAdmin.addGroups(other, user_other_group); // create a third regular user not in that group Login worldLogin = new Login(UUID.randomUUID().toString(), "empty" /* not gname!*/); w = new ServiceFactory(worldLogin); world.setOmeName(worldLogin.getName()); world.setFirstName("read"); world.setLastName("Security -- not in their group"); world = new Experimenter(rootAdmin.createUser(world,cname), false); // not in same group } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c94acf1ed28125ea3ec367725deb6b3896e87bd4/AbstractPermissionsTest.java/buggy/components/client/test/ome/client/itests/sec/AbstractPermissionsTest.java |
list.add(name); | list.add(name.image); | final public Object[] FormalArgList() throws ParseException { ArrayList list=new ArrayList(); Token name; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOLLAR: case WS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[43] = jj_gen; ; } jj_consume_token(DOLLAR); name = jj_consume_token(WORD); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[44] = jj_gen; ; } list.add(name.image); label_5: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[45] = jj_gen; break label_5; } jj_consume_token(COMMA); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[46] = jj_gen; ; } jj_consume_token(DOLLAR); name = jj_consume_token(WORD); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case WS: jj_consume_token(WS); break; default: jj_la1[47] = jj_gen; ; } list.add(name); } break; default: jj_la1[48] = jj_gen; ; } jj_consume_token(RPAREN); break; default: jj_la1[49] = jj_gen; ; } {if (true) return list.toArray();} throw new Error("Missing return statement in function"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67f3bf2b9347218e8efc5ecece60bb5f03730152/WMParser_impl.java/buggy/webmacro/src/org/webmacro/parser/WMParser_impl.java |
BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); | public void loadDataset(int datasetID) { BrowserManager manager = env.getBrowserManager(); int index; if((index = manager.hasBrowser(datasetID)) != BrowserManager.NOT_FOUND) { manager.setActiveBrowser(index); return; } DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel); topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette); zoomPalette.setOffset(0,0); optionPalette.setOffset(0,75); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); final int browserIndex = 0; // default behavior for new browser final BrowserInternalFrame bif = new BrowserInternalFrame(controller); env.getBrowserManager().addBrowser(bif); StatusBar status = controller.getStatusView(); tf.addToDesktop(bif,TopFrame.PALETTE_LAYER); bif.setClosable(true); bif.setIconifiable(true); bif.setMaximizable(true); bif.setResizable(true); bif.show(); final int theDataset = datasetID; KillableThread retrieveThread = new KillableThread() { public void run() { addLoaderThread(bif.getController(),this); try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); if(!kill) { bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } else { System.err.println("killed OK"); } } catch(DSAccessException dsae) { UserNotifier notifier = registry.getUserNotifier(); notifier.notifyError("Data retrieval failure", "Unable to retrieve dataset (id = " + theDataset + ")", dsae); return; } catch(DSOutOfServiceException dsoe) { // pop up new login window (eventually caught) throw new RuntimeException(dsoe); } removeLoaderThread(bif.getController(),this); } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
|
zoomPalette.setOffset(0,0); optionPalette.setOffset(0,75); | optionPalette.setOffset(0,0); | public void loadDataset(int datasetID) { BrowserManager manager = env.getBrowserManager(); int index; if((index = manager.hasBrowser(datasetID)) != BrowserManager.NOT_FOUND) { manager.setActiveBrowser(index); return; } DataManagementService dms = registry.getDataManagementService(); DatasetData dataset; final BrowserModel model = new BrowserModel(); model.setLayoutMethod(new NumColsLayoutMethod(8)); BrowserTopModel topModel = new BrowserTopModel(); BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel); topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette); BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel); topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette); zoomPalette.setOffset(0,0); optionPalette.setOffset(0,75); BrowserView view = new BrowserView(model,topModel); BrowserController controller = new BrowserController(model,topModel,view); controller.setStatusView(new StatusBar()); final int browserIndex = 0; // default behavior for new browser final BrowserInternalFrame bif = new BrowserInternalFrame(controller); env.getBrowserManager().addBrowser(bif); StatusBar status = controller.getStatusView(); tf.addToDesktop(bif,TopFrame.PALETTE_LAYER); bif.setClosable(true); bif.setIconifiable(true); bif.setMaximizable(true); bif.setResizable(true); bif.show(); final int theDataset = datasetID; KillableThread retrieveThread = new KillableThread() { public void run() { addLoaderThread(bif.getController(),this); try { DataManagementService dms = registry.getDataManagementService(); DatasetData dataset = dms.retrieveDataset(theDataset); model.setDataset(dataset); if(!kill) { bif.setTitle("Image Browser: "+dataset.getName()); loadDataset(browserIndex,dataset); } else { System.err.println("killed OK"); } } catch(DSAccessException dsae) { UserNotifier notifier = registry.getUserNotifier(); notifier.notifyError("Data retrieval failure", "Unable to retrieve dataset (id = " + theDataset + ")", dsae); return; } catch(DSOutOfServiceException dsoe) { // pop up new login window (eventually caught) throw new RuntimeException(dsoe); } removeLoaderThread(bif.getController(),this); } }; retrieveThread.start(); writeStatusImmediately(status,"Loading dataset from DB..."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
{ addLoaderThread(controller,this); final List thumbnails = new ArrayList(); int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() | public void run() { addLoaderThread(controller,this); final List thumbnails = new ArrayList(); int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { // explicit break out if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
|
}; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); } | public void run() { addLoaderThread(controller,this); final List thumbnails = new ArrayList(); int count = 1; int total = refList.size(); PlateLayoutMethod lm = new PlateLayoutMethod(refInfo.getNumRows(), refInfo.getNumCols()); model.setLayoutMethod(lm); CompletePlate plate = new CompletePlate(); for(Iterator iter = refPlateList.iterator(); iter.hasNext();) { ImagePlate ip = (ImagePlate)iter.next(); plate.put(ip.getWell(),new Integer(ip.getImage().getID())); } boolean wellSized = false; for(int i=0;i<refInfo.getNumRows();i++) { for(int j=0;j<refInfo.getNumCols();j++) { // explicit break out if(kill) { j=refInfo.getNumCols(); i=refInfo.getNumRows(); break; } String row = refInfo.getRowName(i); String col = refInfo.getColumnName(j); String well = row+col; List sampleList = (List)plate.get(well); if(sampleList.size() == 1) { Integer intVal = (Integer)sampleList.get(0); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); if(!wellSized) { lm.setWellWidth(image.getWidth(null)); lm.setWellHeight(image.getHeight(null)); wellSized = true; } ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); ImageAnnotation annotation = (ImageAnnotation)refAnnotations.get(new Integer(sum.getID())); if(annotation != null) { tdm.getAttributeMap().putAttribute(annotation); } final Thumbnail t = new Thumbnail(image,tdm); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } else { Image[] images = new Image[sampleList.size()]; ThumbnailDataModel[] models = new ThumbnailDataModel[sampleList.size()]; for(int k=0;k<sampleList.size();k++) { Integer intVal = (Integer)sampleList.get(k); ImageSummary sum = (ImageSummary)imageMap.get(intVal); try { Pixels pix = sum.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(sum); tdm.setValue(UIConstants.WELL_KEY_STRING,well); tdm.getAttributeMap().putAttribute(pix); images[k] = image; models[k] = tdm; count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } final Thumbnail t = new Thumbnail(images,models); lm.setIndex(t,i,j); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } }; SwingUtilities.invokeLater(addTask); } } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } else { System.err.println("killed OK"); } removeLoaderThread(controller,this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
|
Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); | public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { | public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
}; SwingUtilities.invokeLater(finalTask); return; } removeLoaderThread(controller,this); } | public void run() { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
|
{ thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } | { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } | public void run() { thumbnails.add(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
{ String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } | { Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); model.addThumbnails(ts); status.processSucceeded("All images loaded."); } | public void run() { String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); thumbnails.add(t); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
{ addLoaderThread(controller,this); int count = 1; int total = refList.size(); for(Iterator iter = refList.iterator(); (iter.hasNext() && !kill);) { ImageSummary summary = (ImageSummary)iter.next(); try { Pixels pix = summary.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(summary); tdm.getAttributeMap().putAttribute(pix); final Thumbnail t = new Thumbnail(image,tdm); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() | public void run() { addLoaderThread(controller,this); int count = 1; int total = refList.size(); for(Iterator iter = refList.iterator(); (iter.hasNext() && !kill);) { ImageSummary summary = (ImageSummary)iter.next(); try { Pixels pix = summary.getDefaultPixels().getPixels(); Image image = ps.getThumbnail(pix); ThumbnailDataModel tdm = new ThumbnailDataModel(summary); tdm.getAttributeMap().putAttribute(pix); // TODO: figure out strategy for adding attributes. do it here? final Thumbnail t = new Thumbnail(image,tdm); final int theCount = count; final int theTotal = total; Runnable addTask = new Runnable() { public void run() { model.addThumbnail(t); String message = ProgressMessageFormatter.format("Loaded image %n of %t...", theCount,theTotal); status.processAdvanced(message); } }; SwingUtilities.invokeLater(addTask); count++; } catch(ImageServerException ise) { UserNotifier un = registry.getUserNotifier(); un.notifyError("ImageServer Error",ise.getMessage(),ise); status.processFailed("Error loading images."); return; } } if(!kill) { Runnable finalTask = new Runnable() { public void run() { status.processSucceeded("All images loaded."); } }; SwingUtilities.invokeLater(finalTask); return; } removeLoaderThread(controller,this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/913e45a73e803bf6a97dca24496a64546a51c9d5/BrowserAgent.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserAgent.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.