rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
add(new JSeparator()); | add(new JSeparator(SwingConstants.HORIZONTAL)); | private void buildGUI() { setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); add(properties); add(annotate); add(classify); add(new JSeparator()); add(view); add(zoomIn); add(zoomOut); add(zoomFit); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/95a81c4515a3d8dfe34a789aed7b4aa6557ccc17/PopupMenu.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/PopupMenu.java |
if (model.getState() != LOADING_ANNOTATION) throw new IllegalStateException("This method can only be invoked" + " in the LOADING_ANNOTATION state."); if (map == null) throw new IllegalArgumentException("No annotations."); model.setAnnotations(map); view.showAnnotations(); if (model.hasThumbnail()) firePropertyChange(TreeViewer.THUMBNAIL_LOADING_PROPERTY, null, model.getHierarchyObject()); model.setState(READY); fireStateChange(); | if (model.getState() == LOADING_ANNOTATION) { if (map == null) throw new IllegalArgumentException("No annotations."); model.setAnnotations(map); view.showAnnotations(); if (model.hasThumbnail()) firePropertyChange(TreeViewer.THUMBNAIL_LOADING_PROPERTY, null, model.getHierarchyObject()); model.setState(READY); fireStateChange(); } | public void setAnnotations(Map map) { if (model.getState() != LOADING_ANNOTATION) throw new IllegalStateException("This method can only be invoked" + " in the LOADING_ANNOTATION state."); if (map == null) throw new IllegalArgumentException("No annotations."); model.setAnnotations(map); view.showAnnotations(); if (model.hasThumbnail()) firePropertyChange(TreeViewer.THUMBNAIL_LOADING_PROPERTY, null, model.getHierarchyObject()); model.setState(READY); fireStateChange(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2cd74b8419df7bd94c53b65634636b9d0775f228/EditorComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/editors/EditorComponent.java |
setLayout(new BorderLayout()); | private void buildUI() { setLayout(new BorderLayout()); tabPane.add(searchView, SEARCH_TAB); tabPane.setTitleAt(SEARCH_TAB, SEARCH); tabPane.add(annotationView, ANNOTATE_TAB); tabPane.setTitleAt(ANNOTATE_TAB, ANNOTATIONS); add(tabPane, BorderLayout.CENTER); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f8f7dcdd74bccad5e7a9d969c7ab47c1cfee6015/ClipBoardUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardUI.java |
|
add(tabPane, BorderLayout.CENTER); | setViewportView(tabPane); | private void buildUI() { setLayout(new BorderLayout()); tabPane.add(searchView, SEARCH_TAB); tabPane.setTitleAt(SEARCH_TAB, SEARCH); tabPane.add(annotationView, ANNOTATE_TAB); tabPane.setTitleAt(ANNOTATE_TAB, ANNOTATIONS); add(tabPane, BorderLayout.CENTER); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f8f7dcdd74bccad5e7a9d969c7ab47c1cfee6015/ClipBoardUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardUI.java |
TreePopupMenu(ClipBoardUI clipBoard) | TreePopupMenu(ClipBoardUI clipBoard, ClipBoardModel model) | TreePopupMenu(ClipBoardUI clipBoard) { if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); initComponents(); buildUI(); new TreePopupMenuMng(this, clipBoard); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/TreePopupMenu.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/TreePopupMenu.java |
new TreePopupMenuMng(this, clipBoard); | new TreePopupMenuMng(this, clipBoard, model); | TreePopupMenu(ClipBoardUI clipBoard) { if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); initComponents(); buildUI(); new TreePopupMenuMng(this, clipBoard); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/TreePopupMenu.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/TreePopupMenu.java |
pane.addPropertyChangeListener(SearchResultsPane.LOCALIZE_IMAGE_DISPLAY, | pane.addPropertyChangeListener(ClipBoard.LOCALIZE_IMAGE_DISPLAY, | void setSearchResults(Set foundNodes) { pane = new SearchResultsPane(this, foundNodes); pane.addPropertyChangeListener(SearchResultsPane.LOCALIZE_IMAGE_DISPLAY, controller); treeHolder.removeAll(); treeHolder.add(new JScrollPane(pane), BorderLayout.CENTER); treeHolder.revalidate(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/CBSearchTabView.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/CBSearchTabView.java |
treePanel.addListener(new HeatMapTreeListener() { public void nodeSelected(SemanticTypeTree.TreeNode node) { if(!(node instanceof SemanticTypeTree.ElementNode)) { gradPanel.setEnabled(false); } else gradPanel.setEnabled(true); } }); | private void buildUI() { Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); JScrollPane scrollPane = new JScrollPane(treePanel); scrollPane.setPreferredSize(new Dimension(250,200)); scrollPane.setSize(new Dimension(250,200)); mainPanel.add(scrollPane,BorderLayout.CENTER); JPanel controlPanel = new JPanel(); gradPanel.setPreferredSize(new Dimension(250,90)); gradPanel.setSize(new Dimension(250,90)); gradPanel.setEnabled(false); controlPanel.setLayout(new BorderLayout()); controlPanel.add(gradPanel,BorderLayout.CENTER); JPanel barPanel = new JPanel(); barPanel.add(modeBar,BorderLayout.CENTER); JPanel scalePanel = new JPanel(); scalePanel.add(scaleBar,BorderLayout.CENTER); controlPanel.add(barPanel,BorderLayout.NORTH); controlPanel.add(scalePanel,BorderLayout.SOUTH); mainPanel.add(controlPanel,BorderLayout.SOUTH); contentPane.add(mainPanel,BorderLayout.CENTER); contentPane.add(statusPanel,BorderLayout.SOUTH); if(model != null) { setTitle("HeatMap: " + model.getInfoSource().getDataset().getName()); } else { setTitle("HeatMap: [no data]"); } statusPanel.showMessage("Dataset attributes loaded."); pack(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f2f98380b72e70d51f9ff90f92bae55bf7224fee/HeatMapUI.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
|
public HeatMapDispatcher(HeatMapModel model, HeatMapStatus status, HeatMapGradient gradient) | public HeatMapDispatcher(HeatMapModel model) | public HeatMapDispatcher(HeatMapModel model, HeatMapStatus status, HeatMapGradient gradient) { this.model = model; this.status = status; this.gradient = gradient; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/28e98417641b00a2e12a791f10f204dc4562dec1/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
this.model = model; this.status = status; this.gradient = gradient; | this.model = model; | public HeatMapDispatcher(HeatMapModel model, HeatMapStatus status, HeatMapGradient gradient) { this.model = model; this.status = status; this.gradient = gradient; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/28e98417641b00a2e12a791f10f204dc4562dec1/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
if (id == 0) { id = getRuntime().getObjectSpace().createId(this); } return getRuntime().newFixnum(id); | return getRuntime().newFixnum(getRuntime().getObjectSpace().idOf(this)); | public synchronized RubyFixnum id() { if (id == 0) { id = getRuntime().getObjectSpace().createId(this); } return getRuntime().newFixnum(id); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/250878be8c9efe07e17604ffe3f6f53c3d98a3e1/RubyObject.java/buggy/src/org/jruby/RubyObject.java |
public long createId(IRubyObject object) { synchronized (identities) { cleanIdentities(); maxId += 2; identities.put(Long.valueOf(maxId), new IdReference(object, maxId, deadIdentityReferences)); return maxId; } | private Long createId(IRubyObject object) { cleanIdentities(); maxId += 2; Long longMaxId = new Long(maxId); identities.put(longMaxId, new IdReference(object, maxId, deadIdentityReferences)); identitiesByObject.put(object, longMaxId); return longMaxId; | public long createId(IRubyObject object) { synchronized (identities) { cleanIdentities(); maxId += 2; // id must always be even identities.put(Long.valueOf(maxId), new IdReference(object, maxId, deadIdentityReferences)); return maxId; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/250878be8c9efe07e17604ffe3f6f53c3d98a3e1/ObjectSpace.java/buggy/src/org/jruby/runtime/ObjectSpace.java |
public final int hashCode() { | public int hashCode() { | public final int hashCode() { return (int) RubyNumeric.fix2long(callMethod(getRuntime().getCurrentContext(), "hash")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/accd69543aeec606dd2490c5f67964fb52c543a5/RubyObject.java/buggy/src/org/jruby/RubyObject.java |
c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); | PixelsMapper.fieldsForPixels(c, "images.default_pixels"); | public static Criteria buildDatasetCriteria(int id) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); //Specify which fields we want for the owner. c.addWantedField("owner", "FirstName"); c.addWantedField("owner", "LastName"); c.addWantedField("owner", "Email"); c.addWantedField("owner", "Institution"); c.addWantedField("owner", "Group"); //Specify which fields we want for the owner's group. c.addWantedField("owner.Group", "Name"); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Filter by ID. c.addFilter("id", new Integer(id)); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); | PixelsMapper.fieldsForPixels(c, "images.default_pixels"); | public static Criteria buildDatasetsTree(List datasetIDs) { Criteria c = new Criteria(); c.addWantedField("name"); c.addWantedField("images"); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); if (datasetIDs != null) c.addFilter("id", "IN", datasetIDs); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
public static Criteria buildFullUserDatasetsCriteria(int userID) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); UserMapper.objectOwnerCriteria(c); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Add filter c.addFilter("owner_id", new Integer(userID)); c.addFilter("name", "NOT LIKE", "ImportSet"); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
||
c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); | PixelsMapper.fieldsForPixels(c, "images.default_pixels"); | public static Criteria buildFullUserDatasetsCriteria(int userID) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); UserMapper.objectOwnerCriteria(c); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Add filter c.addFilter("owner_id", new Integer(userID)); c.addFilter("name", "NOT LIKE", "ImportSet"); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); | PixelsMapper.fieldsForPixels(c, "images.default_pixels"); | public static Criteria buildImagesCriteria(List datasetIDs, Map filters, Map complexFilters) { Criteria c = new Criteria(); //Specify which fields we want for the images. c.addWantedField("images"); c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); if (datasetIDs != null) c.addFilter("id", "IN", datasetIDs); UserMapper.setFilters(c, filters, complexFilters); return c; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
images.add(fillImageSummary((Image) i.next())); | images.add(ImageMapper.buildImageSummary((Image) i.next(), null)); | public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill up the DataObject with the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill up the DataObject with data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill up the DataObject with data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); while (i.hasNext()) images.add(fillImageSummary((Image) i.next())); empty.setImages(images); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
is = fillImageSummary(img); | is = ImageMapper.buildImageSummary(img, null); | public static void fillDatasetsTree(List datasets, List results, List datasetIDs) { Iterator i = datasets.iterator(), k; Map imagesMap = new HashMap(); DatasetSummaryLinked ds; Dataset d; Image img; ImageSummary is; List images; Integer id; while (i.hasNext()) { d = (Dataset) i.next(); if (datasetIDs.contains(new Integer(d.getID()))) { ds = new DatasetSummaryLinked(); ds.setID((d.getID())); ds.setName(d.getName()); k = d.getImages().iterator(); //Add images to the dataset. images = new ArrayList(); k = d.getImages().iterator(); while (k.hasNext()) { img = (Image) k.next(); id = new Integer(img.getID()); is = (ImageSummary) imagesMap.get(id); if (is == null) { is = fillImageSummary(img); imagesMap.put(id, is); } images.add(is); } ds.setImages(images); results.add(ds); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
fillImageSummary(image, is); | ImageMapper.buildImageSummary(image, is); | public static List fillImagesInUserDatasets(List datasets, ImageSummary iProto, List datasetIDs) { List images = new ArrayList(); HashMap map = new HashMap(); Iterator d = datasets.iterator(); Iterator i; Image image; ImageSummary is; Integer imageID; Dataset dDTO; while (d.hasNext()) { dDTO = (Dataset) d.next(); if (datasetIDs.contains(new Integer(dDTO.getID()))) { i = dDTO.getImages().iterator(); while (i.hasNext()) { image = (Image) i.next(); imageID = new Integer(image.getID()); is = (ImageSummary) map.get(imageID); if (is == null) { //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); fillImageSummary(image, is); //Add the image summary object to the list. images.add(is); map.put(imageID, is); } } } } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
fillImageSummary(image, is); | ImageMapper.buildImageSummary(image, is); | public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); fillImageSummary(image, is); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); //Add the image summary object to the list. images.add(is); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/73d218b1f03225366903abf43d50c4be713e767b/DatasetMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/DatasetMapper.java |
public static Map reverseListImageAnnotations(List annotations, int userID) | public static Map reverseListImageAnnotations(List annotations) | public static Map reverseListImageAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); ImageAnnotation annotation; while (i.hasNext()) { annotation = (ImageAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getImage().getID()), annotation); } return map; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java |
if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getImage().getID()), annotation); | map.put(new Integer(annotation.getImage().getID()), annotation); | public static Map reverseListImageAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); ImageAnnotation annotation; while (i.hasNext()) { annotation = (ImageAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getImage().getID()), annotation); } return map; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java |
public static Map reverseListDatasetAnnotations(List annotations, int userID) | public static Map reverseListDatasetAnnotations(List annotations) | public static Map reverseListDatasetAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); DatasetAnnotation annotation; while (i.hasNext()) { annotation = (DatasetAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getDataset().getID()), annotation); } return map; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java |
if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getDataset().getID()), | map.put(new Integer(annotation.getDataset().getID()), | public static Map reverseListDatasetAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); DatasetAnnotation annotation; while (i.hasNext()) { annotation = (DatasetAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getDataset().getID()), annotation); } return map; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java |
re.setRubyClass((RubyClass) recv); | re.setInternalClass((RubyClass) recv); | public static RubyRegexp newInstance(IRubyObject recv, IRubyObject[] args) { RubyRegexp re = new RubyRegexp(recv.getRuntime()); re.setRubyClass((RubyClass) recv); re.initialize(args); return re; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/RubyRegexp.java/buggy/org/jruby/RubyRegexp.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public Collection getChainExecutions() { long start; // if we're done, go for it. if (chainExecutions != null) { return chainExecutions.getExecutions(); } if (gettingExecutions == false) { if (ChainBuilderAgent.DEBUG) { start = System.currentTimeMillis(); } gettingExecutions = true; retrieveChainExecutions(); gettingExecutions = false; // notifyAll(); if (ChainBuilderAgent.DEBUG) { long getTime = System.currentTimeMillis()-start; System.err.println("time for executions is "+getTime); } return chainExecutions.getExecutions(); } /*else {// in progress try{ wait(); return chainExecutions.getExecutions(); } catch (InterruptedException e) { return null; } }*/ return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public Collection getChainExecutions() { long start; // if we're done, go for it. if (chainExecutions != null) { return chainExecutions.getExecutions(); } if (gettingExecutions == false) { if (ChainBuilderAgent.DEBUG) { start = System.currentTimeMillis(); } gettingExecutions = true; retrieveChainExecutions(); gettingExecutions = false; // notifyAll(); if (ChainBuilderAgent.DEBUG) { long getTime = System.currentTimeMillis()-start; System.err.println("time for executions is "+getTime); } return chainExecutions.getExecutions(); } /*else {// in progress try{ wait(); return chainExecutions.getExecutions(); } catch (InterruptedException e) { return null; } }*/ return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
public Collection getChainExecutionsByChainID(int id) { | public ChainExecutionsByModuleID getChainExecutionsByChainID(int id) { | public Collection getChainExecutionsByChainID(int id) { if (chainExecutions != null) return chainExecutions.getChainExecutionsByChainID(id); return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public Collection getChains() { Collection res = null; long start; // if we're done, go for it. if (chainHash != null && chainHash.size() > 0) { res = chainHash.values(); } else { if (gettingChains == false) { if (ChainBuilderAgent.DEBUG) { start = System.currentTimeMillis(); } gettingChains = true; retrieveChains(); gettingChains = false; if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time for retrieving chains.. "+end); } res = chainHash.values(); } } return res; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public Collection getChains() { Collection res = null; long start; // if we're done, go for it. if (chainHash != null && chainHash.size() > 0) { res = chainHash.values(); } else { if (gettingChains == false) { if (ChainBuilderAgent.DEBUG) { start = System.currentTimeMillis(); } gettingChains = true; retrieveChains(); gettingChains = false; if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time for retrieving chains.. "+end); } res = chainHash.values(); } } return res; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public Collection getModuleCategories() { // if we're done, go for it. if (moduleCategoryHash != null && moduleCategoryHash.size() > 0) return moduleCategoryHash.values(); if (loadingModuleCategories == false) { long start = System.currentTimeMillis(); loadingModuleCategories = true; retrieveModuleCategories(); loadingModuleCategories = false; if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time spent in getModuleCategories.."+end); } return moduleCategoryHash.values(); } /* shouldn't get here */ return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
if (ChainBuilderAgent.DEBUG) { | if (ChainBuilderAgent.DEBUG_TIMING) { | public Collection getModules() { // if we're done, go for it. if (moduleHash != null && moduleHash.size() > 0) return moduleHash.values(); if (loadingModules == false) { long start = System.currentTimeMillis(); loadingModules = true; retrieveModules(); // retrieveCategories(); loadingModules = false; if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time spent in getModules is "+end); } return moduleHash.values(); } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
if (name.compareTo(chain.getName()) == 0) | if (name.compareToIgnoreCase(chain.getName()) == 0) | public boolean hasChainWithName(String name) { Collection chains = getChains(); Iterator iter = chains.iterator(); LayoutChainData chain; while (iter.hasNext()) { chain = (LayoutChainData) iter.next(); if (name.compareTo(chain.getName()) == 0) return true; } return false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f076b57bded6ef818272bceb94e18d5f7ab5e321/ChainDataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ChainDataManager.java |
defineMethod("crypt", Arity.singleArgument()); | protected void initializeClass() { includeModule(getRuntime().getModule("Comparable")); includeModule(getRuntime().getModule("Enumerable")); addMethod("<=>", op_cmp); addMethod("==", equal); addMethod("===", veryEqual); addMethod("+", op_plus); addMethod("*", op_mul); addMethod("%", format); addMethod("hash", hash); addMethod("to_s", to_s); defineMethod("[]", Arity.optional(), "aref"); defineMethod("[]=", Arity.optional(), "aset"); defineMethod("=~", Arity.singleArgument(), "match"); defineMethod("~", Arity.noArguments(), "match2"); defineMethod("capitalize", Arity.noArguments()); defineMethod("capitalize!", Arity.noArguments(), "capitalize_bang"); defineMethod("casecmp", Arity.singleArgument()); defineMethod("center", Arity.optional()); defineMethod("chop", Arity.noArguments()); defineMethod("chop!", Arity.noArguments(), "chop_bang"); defineMethod("chomp", Arity.optional()); defineMethod("chomp!", Arity.optional(), "chomp_bang"); defineMethod("clone", Arity.noArguments(), "rbClone"); defineMethod("concat", Arity.singleArgument()); defineMethod("count", Arity.optional()); defineMethod("delete", Arity.optional()); defineMethod("delete!", Arity.optional(), "delete_bang"); defineMethod("downcase", Arity.noArguments()); defineMethod("downcase!", Arity.noArguments(), "downcase_bang"); defineMethod("dump", Arity.noArguments()); defineMethod("dup", Arity.noArguments()); defineMethod("each_line", Arity.optional()); defineMethod("each_byte", Arity.noArguments()); defineMethod("empty?", Arity.noArguments(), "empty"); defineMethod("gsub", Arity.optional()); defineMethod("gsub!", Arity.optional(), "gsub_bang"); defineMethod("hex", Arity.noArguments()); defineMethod("include?", Arity.singleArgument(), "include"); defineMethod("index", Arity.optional()); defineMethod("initialize", Arity.optional(), "initialize"); defineMethod("initialize_copy", Arity.singleArgument(), "replace"); defineMethod("insert", Arity.twoArguments()); defineMethod("inspect", Arity.noArguments()); defineMethod("length", Arity.noArguments()); defineMethod("ljust", Arity.optional()); defineMethod("lstrip", Arity.noArguments()); defineMethod("lstrip!", Arity.noArguments(), "lstrip_bang"); defineMethod("match", Arity.singleArgument(), "match3"); defineMethod("oct", Arity.noArguments()); defineMethod("replace", Arity.singleArgument()); defineMethod("reverse", Arity.noArguments()); defineMethod("reverse!", Arity.noArguments(), "reverse_bang"); defineMethod("rindex", Arity.optional()); defineMethod("rjust", Arity.optional()); defineMethod("rstrip", Arity.noArguments()); defineMethod("rstrip!", Arity.noArguments(), "rstrip_bang"); defineMethod("scan", Arity.singleArgument()); defineMethod("slice!", Arity.optional(), "slice_bang"); defineMethod("split", Arity.optional()); defineMethod("strip", Arity.noArguments()); defineMethod("strip!", Arity.noArguments(), "strip_bang"); defineMethod("succ", Arity.noArguments()); defineMethod("succ!", Arity.noArguments(), "succ_bang"); defineMethod("squeeze", Arity.optional()); defineMethod("squeeze!", Arity.optional(), "squeeze_bang"); defineMethod("sub", Arity.optional()); defineMethod("sub!", Arity.optional(), "sub_bang"); defineMethod("sum", Arity.optional()); defineMethod("swapcase", Arity.noArguments()); defineMethod("swapcase!", Arity.noArguments(), "swapcase_bang"); defineMethod("to_f", Arity.noArguments()); defineMethod("to_i", Arity.optional()); defineMethod("to_str", Arity.noArguments()); defineMethod("to_sym", Arity.noArguments()); defineMethod("tr", Arity.twoArguments()); defineMethod("tr!", Arity.twoArguments(), "tr_bang"); defineMethod("tr_s", Arity.twoArguments()); defineMethod("tr_s!", Arity.twoArguments(), "tr_s_bang"); defineMethod("unpack", Arity.singleArgument()); defineMethod("upcase", Arity.noArguments()); defineMethod("upcase!", Arity.noArguments(), "upcase_bang"); defineMethod("upto", Arity.singleArgument()); defineAlias("<<", "concat"); defineAlias("each", "each_line"); defineAlias("eql?", "=="); defineAlias("intern", "to_sym"); defineAlias("next", "succ"); defineAlias("next!", "succ!"); defineAlias("size", "length"); defineAlias("slice", "[]"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9be47462f004ba9a9f729a46448fde9e304fe848/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java |
|
ruby.defineGlobalFunction("open", CallbackFactory.getSingletonMethod(RubyGlobal.class, "open", RubyString.class)); | ruby.defineGlobalFunction("open", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "open")); | public static void createGlobals(Ruby ruby) { StringSetter stringSetter = new StringSetter(); LastlineAccessor lastlineAccessor = new LastlineAccessor(); SafeAccessor safeAccessor = new SafeAccessor(); ruby.defineHookedVariable("$/", RubyString.newString(ruby, "\n"), null, stringSetter); ruby.defineHookedVariable("$\\", ruby.getNil(), null, stringSetter); ruby.defineHookedVariable("$,", ruby.getNil(), null, stringSetter); ruby.defineHookedVariable("$.", RubyFixnum.one(ruby), null, new LineNumberSetter()); ruby.defineVirtualVariable("$_", lastlineAccessor, lastlineAccessor); ruby.defineHookedVariable("$!", ruby.getNil(), null, new ErrorInfoSetter()); ruby.defineVirtualVariable("$SAFE", safeAccessor, safeAccessor); RubyObject stdin = RubyIO.stdin(ruby, ruby.getClasses().getIoClass()); RubyObject stdout = RubyIO.stdout(ruby, ruby.getClasses().getIoClass()); RubyObject stderr = RubyIO.stderr(ruby, ruby.getClasses().getIoClass()); ruby.defineHookedVariable("$stdin", stdin, null, new StdInSetter()); ruby.defineHookedVariable("$stdout", stdout, null, new StdOutSetter()); ruby.defineHookedVariable("$stderr", stderr, null, new StdErrSetter()); ruby.defineHookedVariable("$>", stdout, null, new DefSetter()); ruby.defineHookedVariable("$defout", stdout, null, new DefSetter()); ruby.defineGlobalConstant("STDIN", stdin); ruby.defineGlobalConstant("STDOUT", stdout); ruby.defineGlobalConstant("STDERR", stderr); // ARGF, $< object RubyArgsFile argsFile = new RubyArgsFile(ruby); argsFile.initArgsFile(); // Global functions // IO, $_ String ruby.defineGlobalFunction("open", CallbackFactory.getSingletonMethod(RubyGlobal.class, "open", RubyString.class)); ruby.defineGlobalFunction("format", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "sprintf")); ruby.defineGlobalFunction("gets", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "gets")); ruby.defineGlobalFunction("p", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "p")); ruby.defineGlobalFunction("print", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "print")); ruby.defineGlobalFunction("printf", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "printf")); ruby.defineGlobalFunction("puts", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "puts")); ruby.defineGlobalFunction("readline", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "readline")); ruby.defineGlobalFunction("readlines", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "readlines")); ruby.defineGlobalFunction("sprintf", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "sprintf")); ruby.defineGlobalFunction("gsub!", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "gsub_bang")); ruby.defineGlobalFunction("gsub", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "gsub")); ruby.defineGlobalFunction("sub!", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "sub_bang")); ruby.defineGlobalFunction("sub", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "sub")); ruby.defineGlobalFunction("chop!", CallbackFactory.getSingletonMethod(RubyGlobal.class, "chop_bang")); ruby.defineGlobalFunction("chop", CallbackFactory.getSingletonMethod(RubyGlobal.class, "chop")); ruby.defineGlobalFunction("chomp!", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "chomp_bang")); ruby.defineGlobalFunction("chomp", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "chomp")); ruby.defineGlobalFunction("split", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "split")); ruby.defineGlobalFunction("scan", CallbackFactory.getSingletonMethod(RubyGlobal.class, "scan", RubyObject.class)); ruby.defineGlobalFunction("load", CallbackFactory.getSingletonMethod(RubyGlobal.class, "load", RubyString.class)); //FIXME autoload method needs to be implemented //ruby.defineGlobalFunction("autoload", CallbackFactory.getSingletonMethod(RubyGlobal.class, "autoload", RubyString.class)); ruby.defineGlobalFunction("raise", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "raise")); ruby.defineGlobalFunction("require", CallbackFactory.getSingletonMethod(RubyGlobal.class, "require", RubyString.class)); ruby.defineGlobalFunction("global_variables", CallbackFactory.getSingletonMethod(RubyGlobal.class, "global_variables")); ruby.defineGlobalFunction("local_variables", CallbackFactory.getSingletonMethod(RubyGlobal.class, "local_variables")); ruby.defineGlobalFunction("block_given?", CallbackFactory.getSingletonMethod(RubyGlobal.class, "block_given")); ruby.defineGlobalFunction("lambda", CallbackFactory.getSingletonMethod(RubyGlobal.class, "lambda")); ruby.defineGlobalFunction("proc", CallbackFactory.getSingletonMethod(RubyGlobal.class, "proc")); ruby.defineGlobalFunction("loop", CallbackFactory.getSingletonMethod(RubyGlobal.class, "loop")); ruby.defineGlobalFunction("eval", CallbackFactory.getOptSingletonMethod(RubyGlobal.class, "eval", RubyString.class)); ruby.defineGlobalFunction("singleton_method_added", CallbackFactory.getNilMethod()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0711e7cbb2b441d095c8d8c0838be2b630638c/RubyGlobal.java/clean/org/jruby/RubyGlobal.java |
public static RubyObject open(Ruby ruby, RubyObject recv, RubyString filename) { if (filename.toString().startsWith("|")) { | public static RubyObject open(Ruby ruby, RubyObject recv, RubyObject[] args) { if (args[0].toString().startsWith("|")) { | public static RubyObject open(Ruby ruby, RubyObject recv, RubyString filename) { if (filename.toString().startsWith("|")) { // +++ return ruby.getNil(); // --- } return RubyFile.open(ruby, ruby.getClasses().getFileClass(), new RubyObject[] { filename }); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0711e7cbb2b441d095c8d8c0838be2b630638c/RubyGlobal.java/clean/org/jruby/RubyGlobal.java |
return RubyFile.open(ruby, ruby.getClasses().getFileClass(), new RubyObject[] { filename }); | return RubyFile.open(ruby, ruby.getClasses().getFileClass(), args); | public static RubyObject open(Ruby ruby, RubyObject recv, RubyString filename) { if (filename.toString().startsWith("|")) { // +++ return ruby.getNil(); // --- } return RubyFile.open(ruby, ruby.getClasses().getFileClass(), new RubyObject[] { filename }); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0711e7cbb2b441d095c8d8c0838be2b630638c/RubyGlobal.java/clean/org/jruby/RubyGlobal.java |
context.put ("OWNM", new ObjectWithNullMethod()); | public void stuffContext (Context context) throws Exception { context.setEvaluationExceptionHandler ( new CrankyEvaluationExceptionHandler(_wm.getBroker())); context.put ("TestObject", new TestObject()); context.put ("NullTestObject", new NullTestObject()); context.put("enum",new ThrowingEnumeration()); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/ff709ec8523aa5b42a000462169b11be88cd46de/TestCrankyEEH.java/buggy/webmacro/test/unit/org/webmacro/template/TestCrankyEEH.java |
|
Collection packages; | SortedSet packages; | private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages // TODO TODO TODO: This needs to only look at classes in root package packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of source files in this package Collection sourceFiles; if (packageData == null) { sourceFiles = projectData.getSourceFiles(); } else { sourceFiles = packageData.getSourceFiles(); } // Output a line for each class if (sourceFiles.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = sourceFiles.iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter .next(); out .println(generateTableRowForSourceFile(sourceFileData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
packages = projectData.getChildren(); | packages = projectData.getPackages(); | private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages // TODO TODO TODO: This needs to only look at classes in root package packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of source files in this package Collection sourceFiles; if (packageData == null) { sourceFiles = projectData.getSourceFiles(); } else { sourceFiles = packageData.getSourceFiles(); } // Output a line for each class if (sourceFiles.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = sourceFiles.iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter .next(); out .println(generateTableRowForSourceFile(sourceFileData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
sourceFiles = projectData.getSourceFiles(); | PackageData defaultPackage = (PackageData)projectData .getChild(""); if (defaultPackage != null) { sourceFiles = defaultPackage.getSourceFiles(); } else { sourceFiles = new TreeSet(); } | private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages // TODO TODO TODO: This needs to only look at classes in root package packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of source files in this package Collection sourceFiles; if (packageData == null) { sourceFiles = projectData.getSourceFiles(); } else { sourceFiles = packageData.getSourceFiles(); } // Output a line for each class if (sourceFiles.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = sourceFiles.iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter .next(); out .println(generateTableRowForSourceFile(sourceFileData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
Iterator iter = projectData.getChildren().iterator(); | Iterator iter = projectData.getPackages().iterator(); | private void generateOverviews() throws IOException { generateOverview(null); Iterator iter = projectData.getChildren().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); generateOverview(packageData); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
SortedSet sortedPackages = new TreeSet(); sortedPackages.addAll(projectData.getChildren()); Iterator iter = sortedPackages.iterator(); | Iterator iter = projectData.getPackages().iterator(); | private void generatePackageList() throws IOException { File file = new File(destinationDir, "frame-packages.html"); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>Packages</h5>"); out.println("<table width=\"100%\">"); out.println("<tr>"); out .println("<td nowrap=\"nowrap\"><a href=\"frame-summary.html\" onClick='parent.sourceFileList.location.href=\"frame-sourcefiles.html\"' target=\"summary\">All</a></td>"); out.println("</tr>"); SortedSet sortedPackages = new TreeSet(); sortedPackages.addAll(projectData.getChildren()); Iterator iter = sortedPackages.iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; out.println("<tr>"); out .println("<td nowrap=\"nowrap\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"' target=\"summary\">" + generatePackageName(packageData) + "</a></td>"); out.println("</tr>"); } out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
Collection sourceFiles; | SortedSet sourceFiles; | private void generateSourceFileList(PackageData packageData) throws IOException { String filename; Collection sourceFiles; if (packageData == null) { filename = "frame-sourcefiles.html"; sourceFiles = projectData.getSourceFiles(); } else { filename = "frame-sourcefiles-" + packageData.getName() + ".html"; sourceFiles = packageData.getSourceFiles(); } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report Classes</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>"); out.println(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<h5>Classes</h5>"); out.println("<table width=\"100%\">"); Map sortedSourceFileList = new TreeMap(); for (Iterator iter = sourceFiles.iterator(); iter.hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); out.println("<tr>"); String percentCovered; if (sourceFileData.getNumberOfValidLines() > 0) percentCovered = getPercentValue(sourceFileData .getLineCoverageRate()); else percentCovered = "N/A"; out .println("<td nowrap=\"nowrap\"><a target=\"summary\" href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a> <i>(" + percentCovered + ")</i></td>"); out.println("</tr>"); } out.println("</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
Map sortedSourceFileList = new TreeMap(); | private void generateSourceFileList(PackageData packageData) throws IOException { String filename; Collection sourceFiles; if (packageData == null) { filename = "frame-sourcefiles.html"; sourceFiles = projectData.getSourceFiles(); } else { filename = "frame-sourcefiles-" + packageData.getName() + ".html"; sourceFiles = packageData.getSourceFiles(); } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report Classes</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>"); out.println(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<h5>Classes</h5>"); out.println("<table width=\"100%\">"); Map sortedSourceFileList = new TreeMap(); for (Iterator iter = sourceFiles.iterator(); iter.hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); out.println("<tr>"); String percentCovered; if (sourceFileData.getNumberOfValidLines() > 0) percentCovered = getPercentValue(sourceFileData .getLineCoverageRate()); else percentCovered = "N/A"; out .println("<td nowrap=\"nowrap\"><a target=\"summary\" href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a> <i>(" + percentCovered + ")</i></td>"); out.println("</tr>"); } out.println("</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
|
{ SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();) | private void generateSourceFileList(PackageData packageData) throws IOException { String filename; Collection sourceFiles; if (packageData == null) { filename = "frame-sourcefiles.html"; sourceFiles = projectData.getSourceFiles(); } else { filename = "frame-sourcefiles-" + packageData.getName() + ".html"; sourceFiles = packageData.getSourceFiles(); } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report Classes</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>"); out.println(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<h5>Classes</h5>"); out.println("<table width=\"100%\">"); Map sortedSourceFileList = new TreeMap(); for (Iterator iter = sourceFiles.iterator(); iter.hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); out.println("<tr>"); String percentCovered; if (sourceFileData.getNumberOfValidLines() > 0) percentCovered = getPercentValue(sourceFileData .getLineCoverageRate()); else percentCovered = "N/A"; out .println("<td nowrap=\"nowrap\"><a target=\"summary\" href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a> <i>(" + percentCovered + ")</i></td>"); out.println("</tr>"); } out.println("</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
|
Iterator iter = projectData.getChildren().iterator(); | Iterator iter = projectData.getPackages().iterator(); | private void generateSourceFileLists() throws IOException { generateSourceFileList(null); Iterator iter = projectData.getChildren().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); generateSourceFileList(packageData); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
ret.append("<td class=\"value\">" + packageData.getChildren().size() | ret.append("<td class=\"value\">" + packageData.getNumberOfChildren() | private String generateTableRowForPackage(PackageData packageData) { StringBuffer ret = new StringBuffer(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; double lineCoverage = -1; double branchCoverage = -1; double ccn = Util.getCCN(new File(sourceDir, packageData .getSourceFileName()), false); if (packageData.getNumberOfValidLines() > 0) lineCoverage = packageData.getLineCoverageRate(); if (packageData.getNumberOfValidBranches() > 0) branchCoverage = packageData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"'>" + generatePackageName(packageData) + "</a></td>"); ret.append("<td class=\"value\">" + packageData.getChildren().size() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
return getClasses().size(); | return this.classes.size(); | public int getNumberOfClasses() { return getClasses().size(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/2d04adc2554406c41824d5b965907076ecdceb80/ProjectData.java/buggy/cobertura/src/net/sourceforge/cobertura/coveragedata/ProjectData.java |
super(parameters); | super( defs, parameters ); | public PojosFindHierarchiesQueryDefinition(QueryParameter... parameters) { super(parameters); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f990a7d35ce265e182121d562725175896db41f4/PojosFindHierarchiesQueryDefinition.java/clean/components/server/src/ome/services/query/PojosFindHierarchiesQueryDefinition.java |
SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
|
Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
|
List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) | for(int i=0;i<hierarchyList.size();i++) | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); | SemanticTypeTree.TypeNode ancestor = (SemanticTypeTree.TypeNode)hierarchyList.get(i); SemanticType parentType = ancestor.getType(); String attributeName = parentType.getName(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); List attributeList = sts.retrieveImageAttributes(attributeName, ancestor.getDBName(), imageIDList); if(status != null) { status.showMessage("Loading "+attributeName+" attributes..."); } for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); if(i > 0) { SemanticTypeTree.TypeNode prev = (SemanticTypeTree.TypeNode)hierarchyList.get(i-1); SemanticType prevType = prev.getType(); String prevName = prevType.getName(); Attribute parentAtt = attrMap.getAttribute(prevName); parentAtt.setAttributeElement(attributeName,attribute); } else { attrMap.putAttribute(attribute); } } if(status != null) { status.showMessage("Loaded "+attributeName+" attributes."); } | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
if(status != null) { status.showMessage("Loaded "+name+" attributes."); } | SemanticTypeTree.TypeNode topNode = (SemanticTypeTree.TypeNode)hierarchyList.get(0); attributeName = topNode.getName(); elementName = selectedNode.getFQName(); | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
status.showMessage("could not retrieve "+name+" data."); | status.showMessage("could not retrieve data."); | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
status.showMessage("could not retrieve "+name+" data."); | status.showMessage("could not retrieve data."); | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
notifyLoadFinished(); loadInProgress = false; | public void run() { if(model == null) return; if(selectedNode == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode) || selectedNode.getFQName() == null) { fireModeCancel(); currentMethod = null; currentValueMethod = null; return; } DataElementType dataType = ((SemanticTypeTree.ElementNode)selectedNode).getType(); if(dataType == DataElementType.BOOLEAN) { gradient.setDiscrete(true); } else { gradient.setDiscrete(false); } if(selectedNode.isLazilyInitialized()) { // get attribute elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { List attributeList = sts.retrieveImageAttributes(name,selectedNode.getDBName(), imageIDList); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); attrMap.putAttribute(attribute); } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } if(dataType == DataElementType.BOOLEAN) { displayBooleanInformation(attributeName,elementName); } else { analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
|
System.err.println("analyze: ["+attribute+","+elementName+"]"); | private void analyzeInformation(String attribute, String elementName) { BrowserModel browserModel = model.getInfoSource(); List thumbnails = browserModel.getThumbnails(); Thumbnail[] ts = new Thumbnail[thumbnails.size()]; thumbnails.toArray(ts); double[] stats = RangeChecker.getGlobalMinMax(ts,attribute,elementName); gradient.setMin(stats[0]); gradient.setMax(stats[1]); recalibrateScale(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
|
LoaderThread thread = new LoaderThread(node); thread.start(); | if(!loadInProgress) { LoaderThread thread = new LoaderThread(node); thread.start(); } | public void nodeSelected(SemanticTypeTree.TreeNode node) { if(model == null || node == null) { return; } LoaderThread thread = new LoaderThread(node); thread.start(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapDispatcher.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java |
Paint p = (Paint)thumbnailColorMap.get(t); | Paint p = (Paint)thumbnailColorMap.get(t.getModel()); | public static PaintMethod getPaintMethod(final HeatMapMode mode, final String attributeName, final String elementName, final Scale scale, final Color coldColor, final Color warmColor) { PaintMethod pm = new PaintMethod() { private Map thumbnailColorMap = new IdentityHashMap(); private Color alpha = new Color(0,0,0,0); public void paint(Graphics2D g, Thumbnail t) { Rectangle2D region = t.getBounds().getBounds2D(); if(thumbnailColorMap.containsKey(t.getModel())) { Paint p = (Paint)thumbnailColorMap.get(t); if(p != null) { g.setPaint(p); g.fill(region); } } else { setupMethod(t.getModel()); // TODO: change to t, show variance Paint p = (Paint)thumbnailColorMap.get(t.getModel()); if(p != null) { g.setPaint(p); g.fill(region); } } } /** * Sets up the paint method so the data doesn't have to be * reassessed with each paint() call. That would suck. * TODO: probably include an update() method if the underlying * value changes. */ public void setupMethod(ThumbnailDataModel tdm) { AttributeMap attrMap = tdm.getAttributeMap(); List attributes = attrMap.getAttributes(attributeName); if(attributes == null || attributes.size() == 0) { thumbnailColorMap.put(tdm,null); return; } Attribute[] attrs = new Attribute[attributes.size()]; attributes.toArray(attrs); double val = mode.computeValue(attrs,elementName); Color color = scale.getColor(val,coldColor,warmColor); thumbnailColorMap.put(tdm,color); } }; return pm; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f2f98380b72e70d51f9ff90f92bae55bf7224fee/HeatMapPMFactory.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapPMFactory.java |
thumbnailColorMap.put(tdm,color); | Color alphaColor = new Color(color.getRed(),color.getGreen(), color.getBlue(),128); thumbnailColorMap.put(tdm,alphaColor); | public static PaintMethod getPaintMethod(final HeatMapMode mode, final String attributeName, final String elementName, final Scale scale, final Color coldColor, final Color warmColor) { PaintMethod pm = new PaintMethod() { private Map thumbnailColorMap = new IdentityHashMap(); private Color alpha = new Color(0,0,0,0); public void paint(Graphics2D g, Thumbnail t) { Rectangle2D region = t.getBounds().getBounds2D(); if(thumbnailColorMap.containsKey(t.getModel())) { Paint p = (Paint)thumbnailColorMap.get(t); if(p != null) { g.setPaint(p); g.fill(region); } } else { setupMethod(t.getModel()); // TODO: change to t, show variance Paint p = (Paint)thumbnailColorMap.get(t.getModel()); if(p != null) { g.setPaint(p); g.fill(region); } } } /** * Sets up the paint method so the data doesn't have to be * reassessed with each paint() call. That would suck. * TODO: probably include an update() method if the underlying * value changes. */ public void setupMethod(ThumbnailDataModel tdm) { AttributeMap attrMap = tdm.getAttributeMap(); List attributes = attrMap.getAttributes(attributeName); if(attributes == null || attributes.size() == 0) { thumbnailColorMap.put(tdm,null); return; } Attribute[] attrs = new Attribute[attributes.size()]; attributes.toArray(attrs); double val = mode.computeValue(attrs,elementName); Color color = scale.getColor(val,coldColor,warmColor); thumbnailColorMap.put(tdm,color); } }; return pm; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f2f98380b72e70d51f9ff90f92bae55bf7224fee/HeatMapPMFactory.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapPMFactory.java |
if(min > max || min == max) | if(min > max) | public LogarithmicScale(double min, double max) { if(min > max || min == max) { throw new IllegalArgumentException("max cannot <= min"); } this.min = min; this.max = max; logMin = Math.log(min); logMax = Math.log(max); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bb13c9484826e4d7b149c8ce9e1aa9a3fc55a6d2/LogarithmicScale.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/LogarithmicScale.java |
else if(min == max) { max = min + 0.0001; } | public LogarithmicScale(double min, double max) { if(min > max || min == max) { throw new IllegalArgumentException("max cannot <= min"); } this.min = min; this.max = max; logMin = Math.log(min); logMax = Math.log(max); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bb13c9484826e4d7b149c8ce9e1aa9a3fc55a6d2/LogarithmicScale.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/LogarithmicScale.java |
|
if (ChainBuilderAgent.DEBUG) { long end; end = System.currentTimeMillis()-start; System.err.println("time to layout chains is "+end); } | public void buildGUI() { Container content = getContentPane(); content.setLayout(new BorderLayout()); chainCanvas = new ChainPaletteCanvas(dataManager); chainCanvas.setContents(dataManager.getChains()); chainCanvas.layoutContents(); chainCanvas.completeInitialization(); setSize(new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); content.add(chainCanvas); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { if (chainCanvas != null) chainCanvas.scaleToResize(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/ChainPaletteWindow.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ChainPaletteWindow.java |
|
classLoader = new MultiParentClassLoader(applicationContext.getDisplayName(), urls, getClass().getClassLoader()); | ClassLoader parentLoader = getClassLoader(applicationContext); classLoader = new MultiParentClassLoader(applicationContext.getDisplayName(), urls, parentLoader); | public void preprocess(SpringApplicationContext applicationContext, XmlBeanDefinitionReader reader, Document document) { // determine the classLoader ClassLoader classLoader; NodeList classpathElements = document.getDocumentElement().getElementsByTagName("classpath"); if (classpathElements.getLength() < 1) { classLoader = getClass().getClassLoader(); } else if (classpathElements.getLength() > 1) { throw new FatalBeanException("Expected only classpath element but found " + classpathElements.getLength()); } else { Element classpathElement = (Element) classpathElements.item(0); // build the classpath List classpath = new ArrayList(); NodeList locations = classpathElement.getElementsByTagName("location"); for (int i = 0; i < locations.getLength(); i++) { Element locationElement = (Element) locations.item(i); String location = ((Text) locationElement.getFirstChild()).getData().trim(); classpath.add(location); } // convert the paths to URLS URL[] urls = new URL[classpath.size()]; for (ListIterator iterator = classpath.listIterator(); iterator.hasNext();) { String location = (String) iterator.next(); urls[iterator.previousIndex()] = repository.getResource(location); } // create the classloader classLoader = new MultiParentClassLoader(applicationContext.getDisplayName(), urls, getClass().getClassLoader()); // remove the classpath element so Spring doesn't get confused document.getDocumentElement().removeChild(classpathElement); } // assign the class loader to the xml reader and the application context reader.setBeanClassLoader(classLoader); applicationContext.setClassLoader(classLoader); Thread.currentThread().setContextClassLoader(classLoader); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/73f22ff65e8765766e6281be7318b55aa3917704/ClassLoaderXmlPreprocessor.java/buggy/xbean-server/src/main/java/org/apache/xbean/server/spring/configuration/ClassLoaderXmlPreprocessor.java |
bean.setAutoCreateResource(isAutoCreateResource()); | public ContentItem loadContentItem(String itemResourcePath) { try { ArticleItemBean bean = new ArticleItemBean(); bean.load(itemResourcePath); return bean; } catch (Exception e) { e.printStackTrace(); } return null; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/44c7553551d463f44b7cb7cf5d0a43b62412701b/ArticleItemViewer.java/buggy/src/java/com/idega/block/article/component/ArticleItemViewer.java |
|
case M_HASH: return hash(); | case M_HASH: return hash(); case M_ID2NAME: return id2name(); | public RubyObject callIndexed(int index, RubyObject[] args) { switch (index) { case M_TO_F: return to_f(); case M_TO_S: return to_s(); case M_OP_LSHIFT: return op_lshift(args[0]); case M_OP_RSHIFT: return op_rshift(args[0]); case M_OP_PLUS: return op_plus(args[0]); case M_OP_MINUS: return op_minus(args[0]); case M_OP_MUL: return op_mul(args[0]); case M_OP_DIV: return op_div(args[0]); case M_OP_MOD: return op_mod(args[0]); case M_OP_POW: return op_pow(args[0]); case M_EQUAL: return equal(args[0]); case M_OP_CMP: return op_cmp(args[0]); case M_OP_GT: return op_gt(args[0]); case M_OP_GE: return op_ge(args[0]); case M_OP_LT: return op_lt(args[0]); case M_OP_LE: return op_le(args[0]); case M_OP_AND: return op_and(args[0]); case M_SIZE: return size(); case M_HASH: return hash(); } Asserts.assertNotReached(); return null; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a387d516d26e5f7ff453c52c2282ee687da0a99b/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); | fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); fixnumClass.defineMethod("id2name", IndexedCallback.create(M_ID2NAME, 0)); | public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.includeModule(ruby.getClasses().getPrecisionModule()); fixnumClass.defineSingletonMethod("induced_from", CallbackFactory.getSingletonMethod(RubyFixnum.class, "induced_from", RubyObject.class)); fixnumClass.defineMethod("to_f", IndexedCallback.create(M_TO_F, 0)); fixnumClass.defineMethod("to_s", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("to_str", IndexedCallback.create(M_TO_S, 0)); fixnumClass.defineMethod("taint", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("freeze", CallbackFactory.getSelfMethod(0)); fixnumClass.defineMethod("<<", IndexedCallback.create(M_OP_LSHIFT, 1)); fixnumClass.defineMethod(">>", IndexedCallback.create(M_OP_RSHIFT, 1)); fixnumClass.defineMethod("+", IndexedCallback.create(M_OP_PLUS, 1)); fixnumClass.defineMethod("-", IndexedCallback.create(M_OP_MINUS, 1)); fixnumClass.defineMethod("*", IndexedCallback.create(M_OP_MUL, 1)); fixnumClass.defineMethod("/", IndexedCallback.create(M_OP_DIV, 1)); fixnumClass.defineMethod("%", IndexedCallback.create(M_OP_MOD, 1)); fixnumClass.defineMethod("**", IndexedCallback.create(M_OP_POW, 1)); fixnumClass.defineMethod("==", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("eql?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("equal?", IndexedCallback.create(M_EQUAL, 1)); fixnumClass.defineMethod("<=>", IndexedCallback.create(M_OP_CMP, 1)); fixnumClass.defineMethod(">", IndexedCallback.create(M_OP_GT, 1)); fixnumClass.defineMethod(">=", IndexedCallback.create(M_OP_GE, 1)); fixnumClass.defineMethod("<", IndexedCallback.create(M_OP_LT, 1)); fixnumClass.defineMethod("<=", IndexedCallback.create(M_OP_LE, 1)); fixnumClass.defineMethod("&", IndexedCallback.create(M_OP_AND, 1)); fixnumClass.defineMethod("|", CallbackFactory.getMethod(RubyFixnum.class, "op_or", RubyInteger.class)); fixnumClass.defineMethod("^", CallbackFactory.getMethod(RubyFixnum.class, "op_xor", RubyInteger.class)); fixnumClass.defineMethod("size", IndexedCallback.create(M_SIZE, 0)); fixnumClass.defineMethod("[]", CallbackFactory.getMethod(RubyFixnum.class, "aref", RubyInteger.class)); fixnumClass.defineMethod("hash", IndexedCallback.create(M_HASH, 0)); return fixnumClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a387d516d26e5f7ff453c52c2282ee687da0a99b/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
RubyClass nameError = defineClass("NameError", standardError); | RubyClass nameError = RubyNameError.createNameErrorClass(this, standardError); | private void initCoreClasses() { ObjectMetaClass objectMetaClass = new ObjectMetaClass(this); objectMetaClass.initializeClass(); objectClass = objectMetaClass; objectClass.setConstant("Object", objectClass); RubyClass moduleClass = new ModuleMetaClass(this, objectClass); objectClass.setConstant("Module", moduleClass); RubyClass classClass = new RubyClass(this, null /* Would be Class if it could */, moduleClass, null, "Class"); objectClass.setConstant("Class", classClass); // I don't think the containment is correct here (parent cref) RubyClass metaClass = objectClass.makeMetaClass(classClass, objectMetaClass.getCRef()); metaClass = moduleClass.makeMetaClass(metaClass, objectMetaClass.getCRef()); metaClass = classClass.makeMetaClass(metaClass, objectMetaClass.getCRef()); ((ObjectMetaClass) moduleClass).initializeBootstrapClass(); kernelModule = RubyKernel.createKernelModule(this); objectClass.includeModule(kernelModule); RubyClass.createClassClass(classClass); nilClass = RubyNil.createNilClass(this); // We cannot define this constant until nil itself was made objectClass.defineConstant("NIL", getNil()); // Pre-create the core classes we know we will get referenced by starting up the runtime. RubyBoolean.createFalseClass(this); RubyBoolean.createTrueClass(this); RubyComparable.createComparable(this); RubyEnumerable.createEnumerableModule(this); stringClass = new StringMetaClass(this); stringClass.initializeClass(); new SymbolMetaClass(this).initializeClass(); RubyThreadGroup.createThreadGroupClass(this); RubyThread.createThreadClass(this); RubyException.createExceptionClass(this); RubyPrecision.createPrecisionModule(this); new NumericMetaClass(this).initializeClass(); new IntegerMetaClass(this).initializeClass(); fixnumClass = new FixnumMetaClass(this); fixnumClass.initializeClass(); new HashMetaClass(this).initializeClass(); new IOMetaClass(this).initializeClass(); new ArrayMetaClass(this).initializeClass(); Java.createJavaModule(this); RubyClass structClass = RubyStruct.createStructClass(this); tmsStruct = RubyStruct.newInstance(structClass, new IRubyObject[] { newString("Tms"), newSymbol("utime"), newSymbol("stime"), newSymbol("cutime"), newSymbol("cstime")}); RubyFloat.createFloatClass(this); new BignumMetaClass(this).initializeClass(); new BindingMetaClass(this).initializeClass(); RubyMath.createMathModule(this); // depends on all numeric types RubyRegexp.createRegexpClass(this); RubyRange.createRangeClass(this); RubyObjectSpace.createObjectSpaceModule(this); RubyGC.createGCModule(this); new ProcMetaClass(this).initializeClass(); RubyMethod.createMethodClass(this); RubyMatchData.createMatchDataClass(this); RubyMarshal.createMarshalModule(this); RubyDir.createDirClass(this); RubyFileTest.createFileTestModule(this); new FileMetaClass(this).initializeClass(); // depends on IO, FileTest RubyProcess.createProcessModule(this); new TimeMetaClass(this).initializeClass(); RubyUnboundMethod.defineUnboundMethodClass(this); RubyClass exceptionClass = getClass("Exception"); RubyClass standardError = defineClass("StandardError", exceptionClass); RubyClass runtimeError = defineClass("RuntimeError", standardError); RubyClass ioError = defineClass("IOError", standardError); RubyClass scriptError = defineClass("ScriptError", exceptionClass); RubyClass nameError = defineClass("NameError", standardError); RubyClass rangeError = defineClass("RangeError", standardError); defineClass("SystemExit", exceptionClass); defineClass("Fatal", exceptionClass); defineClass("Interrupt", exceptionClass); defineClass("SignalException", exceptionClass); defineClass("TypeError", standardError); defineClass("ArgumentError", standardError); defineClass("IndexError", standardError); defineClass("SyntaxError", scriptError); defineClass("LoadError", scriptError); defineClass("NotImplementedError", scriptError); defineClass("NoMethodError", nameError); defineClass("SecurityError", standardError); defineClass("NoMemoryError", exceptionClass); defineClass("RegexpError", standardError); defineClass("EOFError", ioError); defineClass("LocalJumpError", standardError); defineClass("ThreadError", standardError); defineClass("SystemStackError", exceptionClass); defineClass("ZeroDivisionError", standardError); // FIXME: Actually this somewhere defineClass("FloatDomainError", rangeError); NativeException.createClass(this, runtimeError); systemCallError = defineClass("SystemCallError", standardError); errnoModule = defineModule("Errno"); initErrnoErrors(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/Ruby.java/clean/src/org/jruby/Ruby.java |
public RaiseException newNameError(String message) { return newRaiseException(getClass("NameError"), message); | public RaiseException newNameError(String message, String name) { return new RaiseException(new RubyNameError(this, this.getClass("NameError"), message, name), true); | public RaiseException newNameError(String message) { return newRaiseException(getClass("NameError"), message); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/Ruby.java/clean/src/org/jruby/Ruby.java |
public RaiseException newNoMethodError(String message) { return newRaiseException(getClass("NoMethodError"), message); | public RaiseException newNoMethodError(String message, String name) { return new RaiseException(new RubyNameError(this, this.getClass("NoMethodError"), message, name), true); | public RaiseException newNoMethodError(String message) { return newRaiseException(getClass("NoMethodError"), message); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/Ruby.java/clean/src/org/jruby/Ruby.java |
if (classname.startsWith("-e")) { classname = classname.replaceAll("-e", "DashE"); } | public String[] compile(String classname, String sourceName, Node node) { cv = new ClassWriter(true); classWriters.put(classname, cv); this.classname = classname; this.sourceName = sourceName; cv.visit(Opcodes.V1_2, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, classname, null, "java/lang/Object", new String[] {"org/jruby/ast/executable/Script"}); cv.visitSource(sourceName, null); mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V"); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(1, 1); mv.visitEnd(); // create method for toplevel of script mv = createNewMethod(); String className = classname + "$MultiStub" + multiStubCount; String methodName = "method" + multiStubIndex; mv.visitCode(); try { node.accept(this); } catch (NotCompilableException nce) { // TODO: recover somehow? build a pure eval method? throw nce; } mv.visitInsn(Opcodes.ARETURN); mv.visitMaxs(1, 1); // automatically calculated by ASM mv.visitEnd(); runtimeLoaded = false; closeOutMultiStub(); // add Script#run impl mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "run", "(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;", null, null); mv.visitTypeInsn(Opcodes.NEW, className); mv.visitInsn(Opcodes.DUP); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, className, "<init>", "()V"); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitInsn(Opcodes.ACONST_NULL); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, className, methodName, "(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;"); mv.visitInsn(Opcodes.ARETURN); mv.visitMaxs(1, 1); mv.visitEnd(); return new String[] {className, methodName}; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1a9bdcaf49f77f5c15fe4d5f69d5815c92686aca/InstructionCompiler2.java/buggy/src/org/jruby/ast/executable/InstructionCompiler2.java |
|
return "CategoryGroup"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); | return "CategoryGroup"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); | public String toString(){ return "CategoryGroup"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/CategoryGroup.java/clean/components/common/src/ome/model/CategoryGroup.java |
Criteria c = session.createCriteria(target); | Criteria ann = session.createCriteria(target); ann.createAlias("details.creationEvent", "ann_create"); ann.createAlias("details.updateEvent", "ann_update"); ann.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); ann.add(Restrictions.in(path+".id",(Collection) value(IDS))); | protected void buildQuery(Session session) throws HibernateException, SQLException { PojoOptions po = new PojoOptions((Map) value(OPTIONS)); Class k = (Class) value(CLASS); if ( ! typeToAnnotationType.containsKey( k )) { throw new IllegalArgumentException( "Class "+k+" is not accepted by "+ PojosFindAnnotationsQueryDefinition.class.getName() ); } Class target = typeToAnnotationType.get((Class) value(CLASS)); String path = annotationTypeToPath.get(target); Criteria c = session.createCriteria(target); c.createCriteria(path,LEFT_JOIN); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.add(Restrictions.in(path+".id",(Collection) value(IDS))); if (check("annotatorIds")) { Collection annotatorIds = (Collection) value("annotatorIds"); if (annotatorIds != null && annotatorIds.size() > 0) c.add(Restrictions.in("details.id", annotatorIds )); } setCriteria( c ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e7211bef67998900c29cd33507ee459182f5fe34/PojosFindAnnotationsQueryDefinition.java/buggy/components/server/src/ome/services/query/PojosFindAnnotationsQueryDefinition.java |
c.createCriteria(path,LEFT_JOIN); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.add(Restrictions.in(path+".id",(Collection) value(IDS))); | Criteria obj = ann.createCriteria(path,LEFT_JOIN); obj.createAlias("details.creationEvent", "obj_create"); obj.createAlias("details.updateEvent", "obj_update"); | protected void buildQuery(Session session) throws HibernateException, SQLException { PojoOptions po = new PojoOptions((Map) value(OPTIONS)); Class k = (Class) value(CLASS); if ( ! typeToAnnotationType.containsKey( k )) { throw new IllegalArgumentException( "Class "+k+" is not accepted by "+ PojosFindAnnotationsQueryDefinition.class.getName() ); } Class target = typeToAnnotationType.get((Class) value(CLASS)); String path = annotationTypeToPath.get(target); Criteria c = session.createCriteria(target); c.createCriteria(path,LEFT_JOIN); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.add(Restrictions.in(path+".id",(Collection) value(IDS))); if (check("annotatorIds")) { Collection annotatorIds = (Collection) value("annotatorIds"); if (annotatorIds != null && annotatorIds.size() > 0) c.add(Restrictions.in("details.id", annotatorIds )); } setCriteria( c ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e7211bef67998900c29cd33507ee459182f5fe34/PojosFindAnnotationsQueryDefinition.java/buggy/components/server/src/ome/services/query/PojosFindAnnotationsQueryDefinition.java |
c.add(Restrictions.in("details.id", annotatorIds )); | ann.add(Restrictions.in("details.id", annotatorIds )); | protected void buildQuery(Session session) throws HibernateException, SQLException { PojoOptions po = new PojoOptions((Map) value(OPTIONS)); Class k = (Class) value(CLASS); if ( ! typeToAnnotationType.containsKey( k )) { throw new IllegalArgumentException( "Class "+k+" is not accepted by "+ PojosFindAnnotationsQueryDefinition.class.getName() ); } Class target = typeToAnnotationType.get((Class) value(CLASS)); String path = annotationTypeToPath.get(target); Criteria c = session.createCriteria(target); c.createCriteria(path,LEFT_JOIN); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.add(Restrictions.in(path+".id",(Collection) value(IDS))); if (check("annotatorIds")) { Collection annotatorIds = (Collection) value("annotatorIds"); if (annotatorIds != null && annotatorIds.size() > 0) c.add(Restrictions.in("details.id", annotatorIds )); } setCriteria( c ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e7211bef67998900c29cd33507ee459182f5fe34/PojosFindAnnotationsQueryDefinition.java/buggy/components/server/src/ome/services/query/PojosFindAnnotationsQueryDefinition.java |
setCriteria( c ); | setCriteria( ann ); | protected void buildQuery(Session session) throws HibernateException, SQLException { PojoOptions po = new PojoOptions((Map) value(OPTIONS)); Class k = (Class) value(CLASS); if ( ! typeToAnnotationType.containsKey( k )) { throw new IllegalArgumentException( "Class "+k+" is not accepted by "+ PojosFindAnnotationsQueryDefinition.class.getName() ); } Class target = typeToAnnotationType.get((Class) value(CLASS)); String path = annotationTypeToPath.get(target); Criteria c = session.createCriteria(target); c.createCriteria(path,LEFT_JOIN); c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.add(Restrictions.in(path+".id",(Collection) value(IDS))); if (check("annotatorIds")) { Collection annotatorIds = (Collection) value("annotatorIds"); if (annotatorIds != null && annotatorIds.size() > 0) c.add(Restrictions.in("details.id", annotatorIds )); } setCriteria( c ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e7211bef67998900c29cd33507ee459182f5fe34/PojosFindAnnotationsQueryDefinition.java/buggy/components/server/src/ome/services/query/PojosFindAnnotationsQueryDefinition.java |
view.clearTree(); return; | public void refreshTree() { switch (model.getState()) { case LOADING_DATA: case LOADING_LEAVES: case DISCARDED: throw new IllegalStateException( "This method cannot be invoked in the LOADING_DATA, "+ " LOADING_LEAVES or DISCARDED state."); } TreeImageDisplay root = view.getTreeRoot(); if (!root.isChildrenLoaded()) return; if (!model.isSelected()) { view.clearTree(); return; } if (model.getBrowserType() == IMAGES_EXPLORER) { root.removeAllChildrenDisplay(); model.setSelectedDisplay(root); loadFilteredImagesForHierarchy(); } else { RefreshVisitor visitor = new RefreshVisitor(this); accept(visitor, TreeImageDisplayVisitor.TREEIMAGE_SET_ONLY); root.removeAllChildrenDisplay(); model.setSelectedDisplay(root); if (visitor.getFoundNodes().size() == 0) loadData(); else model.loadRefreshedData(visitor.getFoundNodes()); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/44eb56c2a9d55ab644f5ffcf1a859c1d041e3e4d/BrowserComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java |
|
state.setResult(receiver.callMethod(iVisited.getName(), args, callType)); if (iVisited.getName().equals("blah")) ; | state.setResult(receiver.callMethod(iVisited.getName(), args, callType)); | public void execute(EvaluationState state, InstructionContext ctx) { CallNode iVisited = (CallNode)ctx; state.getThreadContext().beginCallArgs(); IRubyObject receiver = null; IRubyObject[] args = null; try { receiver = state.begin(iVisited.getReceiverNode()); args = setupArgs(state, state.runtime, state.getThreadContext(), iVisited.getArgsNode()); } finally { state.getThreadContext().endCallArgs(); } assert receiver.getMetaClass() != null : receiver.getClass().getName(); // If reciever is self then we do the call the same way as vcall CallType callType = (receiver == state.getSelf() ? CallType.VARIABLE : CallType.NORMAL); state.setResult(receiver.callMethod(iVisited.getName(), args, callType)); if (iVisited.getName().equals("blah")) ; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/16914196e47e6cb8b99f2a309bb95bbc7a48f10d/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java |
state.getThreadContext().getRubyClass().setClassVar(iVisited.getName(), state.getResult()); | ((RubyModule) state.getThreadContext().peekCRef().getValue()).setClassVar(iVisited.getName(), state.getResult()); | public void execute(EvaluationState state, InstructionContext ctx) { ClassVarAsgnNode iVisited = (ClassVarAsgnNode)ctx; state.getThreadContext().getRubyClass().setClassVar(iVisited.getName(), state.getResult()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/16914196e47e6cb8b99f2a309bb95bbc7a48f10d/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java |
FindRegExTitleAndAnnotationVisitor(HiViewer viewer, String regEx) | FindRegExTitleAndAnnotationVisitor(HiViewer viewer, Pattern pattern) | FindRegExTitleAndAnnotationVisitor(HiViewer viewer, String regEx) { super(viewer, regEx); colors = Colors.getInstance(); inAnno = false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c7517f5d0ece413452f58f3f0a071be2ccbee2e/FindRegExTitleAndAnnotationVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/FindRegExTitleAndAnnotationVisitor.java |
super(viewer, regEx); | super(viewer, pattern); | FindRegExTitleAndAnnotationVisitor(HiViewer viewer, String regEx) { super(viewer, regEx); colors = Colors.getInstance(); inAnno = false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c7517f5d0ece413452f58f3f0a071be2ccbee2e/FindRegExTitleAndAnnotationVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/FindRegExTitleAndAnnotationVisitor.java |
FindRegExVisitor(HiViewer viewer, String regEx) | FindRegExVisitor(HiViewer viewer, Pattern pattern) | FindRegExVisitor(HiViewer viewer, String regEx) { super(viewer); if (regEx == null) throw new IllegalArgumentException("No regular expression."); pattern = RegExFactory.createCaseInsensitivePattern(regEx); foundNodes = new HashSet(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c7517f5d0ece413452f58f3f0a071be2ccbee2e/FindRegExVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/FindRegExVisitor.java |
if (regEx == null) throw new IllegalArgumentException("No regular expression."); pattern = RegExFactory.createCaseInsensitivePattern(regEx); | if (pattern == null) throw new IllegalArgumentException("No pattern."); this.pattern = pattern; | FindRegExVisitor(HiViewer viewer, String regEx) { super(viewer); if (regEx == null) throw new IllegalArgumentException("No regular expression."); pattern = RegExFactory.createCaseInsensitivePattern(regEx); foundNodes = new HashSet(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c7517f5d0ece413452f58f3f0a071be2ccbee2e/FindRegExVisitor.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/cmd/FindRegExVisitor.java |
return Collections.EMPTY_LIST; | return EMPTY_LIST; | public List childNodes() { return Collections.EMPTY_LIST; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/BackRefNode.java/clean/src/org/jruby/ast/BackRefNode.java |
iconWidth = menuIconImage.getWidth(null); iconHeight = menuIconImage.getHeight(null); menuIconShape = new Rectangle2D.Double(8,36,iconWidth,iconHeight); | private void initOverlayShapes() { int width = getImage().getWidth(null); int height = getImage().getHeight(null); PaintShapeGenerator generator = PaintShapeGenerator.getInstance(); if(multipleModeOn) { Shape prevShape = generator.getPrevImageShape(); Shape nextShape = generator.getNextImageShape(); AffineTransform prevXForm = AffineTransform.getTranslateInstance(5,height-prevShape.getBounds2D().getHeight()-5); AffineTransform nextXForm = AffineTransform.getTranslateInstance(width-nextShape.getBounds2D().getWidth()-5, height-nextShape.getBounds2D().getHeight()-5); this.prevImageShape = prevXForm.createTransformedShape(prevShape); this.nextImageShape = nextXForm.createTransformedShape(nextShape); } BrowserEnvironment env = BrowserEnvironment.getInstance(); IconManager manager = env.getIconManager(); openIconImage = manager.getLargeImage(IconManager.ZOOM_BAR); closeIconImage = manager.getLargeImage(IconManager.CLOSE_IMAGE); annotateIconImage = manager.getLargeImage(IconManager.ANNOTATE); int iconWidth = openIconImage.getWidth(null); int iconHeight = openIconImage.getHeight(null); openIconShape = new Rectangle2D.Double(width-iconWidth-8,64, iconWidth,iconHeight); iconWidth = closeIconImage.getWidth(null); iconHeight = closeIconImage.getHeight(null); closeIconShape = new Rectangle2D.Double(width-iconWidth-8,8, iconWidth,iconHeight); iconWidth = annotateIconImage.getWidth(null); iconHeight = annotateIconImage.getHeight(null); annotateIconShape = new Rectangle2D.Double(width-iconWidth-8,36, iconWidth,iconHeight); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0e4e3c4b5f21d2217fc02b1e6846dac6de60570f/SemanticZoomNode.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/SemanticZoomNode.java |
|
g2.fill(menuIconShape); g2.drawImage(menuIconImage, (int)Math.round(menuIconShape.getX()), (int)Math.round(menuIconShape.getY()),null); | public void paint(PPaintContext context) { Graphics2D g2 = context.getGraphics(); Paint oldPaint = g2.getPaint(); Font oldFont = g2.getFont(); Color oldColor = g2.getColor(); g2.setPaint(Color.yellow); g2.fill(border); g2.setPaint(new Color(153,153,153,128)); g2.drawImage(getImage(),0,0,null); g2.fill(openIconShape); g2.drawImage(openIconImage, (int)Math.round(openIconShape.getX()), (int)Math.round(openIconShape.getY()),null); g2.fill(closeIconShape); g2.drawImage(closeIconImage, (int)Math.round(closeIconShape.getX()), (int)Math.round(closeIconShape.getY()),null); g2.fill(annotateIconShape); g2.drawImage(annotateIconImage, (int)Math.round(annotateIconShape.getX()), (int)Math.round(annotateIconShape.getY()),null); g2.setFont(nameFont); g2.setColor(Color.yellow); String wellName = (String)parentThumbnail.getModel().getValue(UIConstants.WELL_KEY_STRING); StringPainter.drawString(g2,wellName,4,26); g2.setFont(oldFont); g2.setColor(oldColor); if(multipleModeOn) { g2.setPaint(Color.yellow); g2.setColor(Color.yellow); String whichSelected = (parentThumbnail.getMultipleImageIndex()+1) + "/" + (String.valueOf(parentThumbnail.getMultipleImageSize())); Rectangle2D selectedBounds = g2.getFontMetrics(multiFont).getStringBounds(whichSelected,g2); Rectangle2D totalBounds = getBounds().getBounds2D(); g2.setFont(multiFont); StringPainter.drawString(g2,whichSelected, (float)((totalBounds.getWidth()-selectedBounds.getWidth())/2), (float)(totalBounds.getHeight()-selectedBounds.getHeight()-5)); g2.fill(prevImageShape); g2.fill(nextImageShape); g2.setFont(oldFont); g2.setPaint(oldPaint); g2.setColor(oldColor); } Rectangle2D bounds = getBounds().getBounds2D(); /* double width = bounds.getWidth(); double height = bounds.getHeight(); DrawStyle noteStyle = DrawStyles.ANNOTATION_NODE_STYLE; DrawStyle oldStyle = noteStyle.applyStyle(g2); PaintShapeGenerator generator = PaintShapeGenerator.getInstance(); Shape note = generator.getAnnotationNoteShape(width-32,height-38); Shape glass = generator.getOuterMagnifierShape(width-32,height-68); g2.fill(note); g2.draw(note); g2.fill(glass); g2.draw(glass); oldStyle.applyStyle(g2); */ } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0e4e3c4b5f21d2217fc02b1e6846dac6de60570f/SemanticZoomNode.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/SemanticZoomNode.java |
|
if(menuIconShape != null) { if(menuIconShape.contains(pos)) { backingModel.selectThumbnail(parentThumbnail); JPopupMenu popup = PopupMenuFactory.getThumbnailMenu(backingModel); Component component = (PCanvas)event.getComponent(); int x = (int)Math.round(getOffset().getX())+8; int y = (int)Math.round(getOffset().getY())+36; popup.show(component,x,y); } } | public void respondMouseClick(PInputEvent event) { Point2D pos = event.getPositionRelativeTo(this); if(prevImageShape != null) { if(prevImageShape.contains(pos)) { parentThumbnail.showPreviousImage(); setImage(thumbnailImages[parentThumbnail.getMultipleImageIndex()]); setBounds(border); repaint(); return; } } if(nextImageShape != null) { if(nextImageShape.contains(pos)) { parentThumbnail.showNextImage(); setImage(thumbnailImages[parentThumbnail.getMultipleImageIndex()]); setBounds(border); repaint(); return; } } if(openIconShape != null) { if(openIconShape.contains(pos)) { BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); agent.loadImage(parentThumbnail); return; } } if(closeIconShape != null) { if(closeIconShape.contains(pos)) { getParent().removeChild(this); } } if(annotateIconShape != null) { if(annotateIconShape.contains(pos)) { PiccoloAction action = PiccoloActionFactory.getAnnotateImageAction(parentThumbnail, absoluteLocation); action.execute(); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0e4e3c4b5f21d2217fc02b1e6846dac6de60570f/SemanticZoomNode.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/SemanticZoomNode.java |
|
public static PiccoloAction getAnnotateImageAction(final Thumbnail t, final Point point) | public static PiccoloAction getAnnotateImageAction(final Thumbnail t) | public static PiccoloAction getAnnotateImageAction(final Thumbnail t, final Point point) { PiccoloAction action = new PiccoloAction() { public void execute() { BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); agent.annotateImage(t,point); } public void execute(PInputEvent e) { execute(); } }; return action; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0e4e3c4b5f21d2217fc02b1e6846dac6de60570f/PiccoloActionFactory.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/events/PiccoloActionFactory.java |
agent.annotateImage(t,point); | agent.annotateImage(t); | public static PiccoloAction getAnnotateImageAction(final Thumbnail t, final Point point) { PiccoloAction action = new PiccoloAction() { public void execute() { BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); agent.annotateImage(t,point); } public void execute(PInputEvent e) { execute(); } }; return action; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0e4e3c4b5f21d2217fc02b1e6846dac6de60570f/PiccoloActionFactory.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/events/PiccoloActionFactory.java |
public static JPopupMenu getThumbnailMenu(final Thumbnail t) { final JMenuItem annotateItem = new JMenuItem("Annotate"); final JPopupMenu menu = new JPopupMenu() { public void show(Component arg0, int arg1, int arg2) { super.show(arg0, arg1, arg2); Point p = arg0.getLocationOnScreen(); final Point displayPoint = new Point(p.x+arg1,p.y+arg2); System.err.println("display="+displayPoint); annotateItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PiccoloAction action = PiccoloActionFactory.getAnnotateImageAction(t,displayPoint); action.execute(); } }); } }; JMenuItem openItem = new JMenuItem("Open"); openItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { PiccoloAction action = PiccoloActionFactory.getOpenInViewerAction(t); action.execute(); } }); menu.add(openItem); menu.addSeparator(); JMenuItem infoItem = new JMenuItem("View Info"); infoItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PiccoloAction action = PiccoloActionFactory.getInfoFromDMAction(t); action.execute(); } }); menu.add(infoItem); menu.add(annotateItem); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/28e98417641b00a2e12a791f10f204dc4562dec1/PopupMenuFactory.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/PopupMenuFactory.java |
||
System.err.println("display="+displayPoint); | public static JPopupMenu getThumbnailMenu(final Thumbnail t) { final JMenuItem annotateItem = new JMenuItem("Annotate"); final JPopupMenu menu = new JPopupMenu() { public void show(Component arg0, int arg1, int arg2) { super.show(arg0, arg1, arg2); Point p = arg0.getLocationOnScreen(); final Point displayPoint = new Point(p.x+arg1,p.y+arg2); System.err.println("display="+displayPoint); annotateItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PiccoloAction action = PiccoloActionFactory.getAnnotateImageAction(t,displayPoint); action.execute(); } }); } }; JMenuItem openItem = new JMenuItem("Open"); openItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { PiccoloAction action = PiccoloActionFactory.getOpenInViewerAction(t); action.execute(); } }); menu.add(openItem); menu.addSeparator(); JMenuItem infoItem = new JMenuItem("View Info"); infoItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PiccoloAction action = PiccoloActionFactory.getInfoFromDMAction(t); action.execute(); } }); menu.add(infoItem); menu.add(annotateItem); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/28e98417641b00a2e12a791f10f204dc4562dec1/PopupMenuFactory.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/PopupMenuFactory.java |
|
if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure; can't define singleton method."); } if (receiver.isFrozen()) { throw runtime.newFrozenError("object"); } if (!receiver.singletonMethodsAllowed()) { throw runtime.newTypeError("can't define singleton method \"" + iVisited.getName() + "\" for " + receiver.getType()); } RubyClass rubyClass = receiver.getSingletonClass(); | RubyClass rubyClass; if (receiver.isNil()) { rubyClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { rubyClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { rubyClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure; can't define singleton method."); } if (receiver.isFrozen()) { throw runtime.newFrozenError("object"); } if (!receiver.singletonMethodsAllowed()) { throw runtime.newTypeError("can't define singleton method \"" + iVisited.getName() + "\" for " + receiver.getType()); } rubyClass = receiver.getSingletonClass(); } | private static IRubyObject evalInternal(ThreadContext context, Node node, IRubyObject self) { IRuby runtime = context.getRuntime(); bigloop: do { if (node == null) return runtime.getNil(); switch (node.nodeId) { case NodeTypes.ALIASNODE: { AliasNode iVisited = (AliasNode) node; if (context.getRubyClass() == null) { throw runtime.newTypeError("no class to make alias"); } context.getRubyClass().defineAlias(iVisited.getNewName(), iVisited.getOldName()); context.getRubyClass().callMethod(context, "method_added", runtime.newSymbol(iVisited.getNewName())); return runtime.getNil(); } case NodeTypes.ANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.ARGSCATNODE: { ArgsCatNode iVisited = (ArgsCatNode) node; IRubyObject args = evalInternal(context, iVisited.getFirstNode(), self); IRubyObject secondArgs = splatValue(evalInternal(context, iVisited.getSecondNode(), self)); RubyArray list = args instanceof RubyArray ? (RubyArray) args : runtime.newArray(args); return list.concat(secondArgs); } // case NodeTypes.ARGSNODE: // EvaluateVisitor.argsNodeVisitor.execute(this, node); // break; // case NodeTypes.ARGUMENTNODE: // EvaluateVisitor.argumentNodeVisitor.execute(this, node); // break; case NodeTypes.ARRAYNODE: { ArrayNode iVisited = (ArrayNode) node; IRubyObject[] array = new IRubyObject[iVisited.size()]; int i = 0; for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node next = (Node) iterator.next(); array[i++] = evalInternal(context, next, self); } return runtime.newArray(array); } // case NodeTypes.ASSIGNABLENODE: // EvaluateVisitor.assignableNodeVisitor.execute(this, node); // break; case NodeTypes.BACKREFNODE: { BackRefNode iVisited = (BackRefNode) node; IRubyObject backref = context.getBackref(); switch (iVisited.getType()) { case '~': return backref; case '&': return RubyRegexp.last_match(backref); case '`': return RubyRegexp.match_pre(backref); case '\'': return RubyRegexp.match_post(backref); case '+': return RubyRegexp.match_last(backref); } break; } case NodeTypes.BEGINNODE: { BeginNode iVisited = (BeginNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.BIGNUMNODE: { BignumNode iVisited = (BignumNode) node; return RubyBignum.newBignum(runtime, iVisited.getValue()); } // case NodeTypes.BINARYOPERATORNODE: // EvaluateVisitor.binaryOperatorNodeVisitor.execute(this, node); // break; // case NodeTypes.BLOCKARGNODE: // EvaluateVisitor.blockArgNodeVisitor.execute(this, node); // break; case NodeTypes.BLOCKNODE: { BlockNode iVisited = (BlockNode) node; IRubyObject result = runtime.getNil(); for (Iterator iter = iVisited.iterator(); iter.hasNext();) { result = evalInternal(context, (Node) iter.next(), self); } return result; } case NodeTypes.BLOCKPASSNODE: { BlockPassNode iVisited = (BlockPassNode) node; IRubyObject proc = evalInternal(context, iVisited.getBodyNode(), self); if (proc.isNil()) { context.setNoBlock(); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearNoBlock(); } } // If not already a proc then we should try and make it one. if (!(proc instanceof RubyProc)) { proc = proc.convertToType("Proc", "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError("wrong argument type " + proc.getMetaClass().getName() + " (expected Proc)"); } } // TODO: Add safety check for taintedness Block block = (Block) context.getCurrentBlock(); if (block != null) { IRubyObject blockObject = block.getBlockObject(); // The current block is already associated with the proc. No need to create new // block for it. Just eval! if (blockObject != null && blockObject == proc) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearBlockAvailable(); } } } context.preBlockPassEval(((RubyProc) proc).getBlock()); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.postBlockPassEval(); } } case NodeTypes.BREAKNODE: { BreakNode iVisited = (BreakNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.BreakJump); je.setPrimaryData(result); je.setSecondaryData(node); throw je; } case NodeTypes.CALLNODE: { CallNode iVisited = (CallNode) node; context.beginCallArgs(); IRubyObject receiver = null; IRubyObject[] args = null; try { receiver = evalInternal(context, iVisited.getReceiverNode(), self); args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } assert receiver.getMetaClass() != null : receiver.getClass().getName(); // If reciever is self then we do the call the same way as vcall CallType callType = (receiver == self ? CallType.VARIABLE : CallType.NORMAL); return receiver.callMethod(context, iVisited.getName(), args, callType); } case NodeTypes.CASENODE: { CaseNode iVisited = (CaseNode) node; IRubyObject expression = null; if (iVisited.getCaseNode() != null) { expression = evalInternal(context, iVisited.getCaseNode(), self); } context.pollThreadEvents(); IRubyObject result = runtime.getNil(); Node firstWhenNode = iVisited.getFirstWhenNode(); while (firstWhenNode != null) { if (!(firstWhenNode instanceof WhenNode)) { node = firstWhenNode; continue bigloop; } WhenNode whenNode = (WhenNode) firstWhenNode; if (whenNode.getExpressionNodes() instanceof ArrayNode) { for (Iterator iter = ((ArrayNode) whenNode.getExpressionNodes()).iterator(); iter .hasNext();) { Node tag = (Node) iter.next(); context.setPosition(tag.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // Ruby grammar has nested whens in a case body because of // productions case_body and when_args. if (tag instanceof WhenNode) { RubyArray expressions = (RubyArray) evalInternal(context, ((WhenNode) tag) .getExpressionNodes(), self); for (int j = 0; j < expressions.getLength(); j++) { IRubyObject condition = expressions.entry(j); if ((expression != null && condition.callMethod(context, "===", expression) .isTrue()) || (expression == null && condition.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } continue; } result = evalInternal(context, tag, self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = whenNode.getBodyNode(); continue bigloop; } } } else { result = evalInternal(context, whenNode.getExpressionNodes(), self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } context.pollThreadEvents(); firstWhenNode = whenNode.getNextCase(); } return runtime.getNil(); } case NodeTypes.CLASSNODE: { ClassNode iVisited = (ClassNode) node; Node superNode = iVisited.getSuperNode(); RubyClass superClass = superNode == null ? null : (RubyClass) evalInternal(context, superNode, self); Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingClass = getEnclosingModule(context, classNameNode, self); RubyClass rubyClass = enclosingClass.defineOrGetClassUnder(name, superClass); if (context.getWrapper() != null) { rubyClass.extendObject(context.getWrapper()); rubyClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), rubyClass, self); } case NodeTypes.CLASSVARASGNNODE: { ClassVarAsgnNode iVisited = (ClassVarAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule) rubyClass.getInstanceVariable("__attached__"); } rubyClass.setClassVar(iVisited.getName(), result); return result; } case NodeTypes.CLASSVARDECLNODE: { ClassVarDeclNode iVisited = (ClassVarDeclNode) node; // FIXME: shouldn't we use cref here? if (context.getRubyClass() == null) { throw runtime.newTypeError("no class/module to define class variable"); } IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); ((RubyModule) context.peekCRef().getValue()).setClassVar(iVisited.getName(), result); return runtime.getNil(); } case NodeTypes.CLASSVARNODE: { ClassVarNode iVisited = (ClassVarNode) node; RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule)rubyClass.getInstanceVariable("__attached__"); } return rubyClass.getClassVar(iVisited.getName()); } case NodeTypes.COLON2NODE: { Colon2Node iVisited = (Colon2Node) node; Node leftNode = iVisited.getLeftNode(); // TODO: Made this more colon3 friendly because of cpath production // rule in grammar (it is convenient to think of them as the same thing // at a grammar level even though evaluation is). if (leftNode == null) { return runtime.getObject().getConstantFrom(iVisited.getName()); } else { IRubyObject result = evalInternal(context, iVisited.getLeftNode(), self); if (result instanceof RubyModule) { return ((RubyModule) result).getConstantFrom(iVisited.getName()); } else { return result.callMethod(context, iVisited.getName()); } } } case NodeTypes.COLON3NODE: { Colon3Node iVisited = (Colon3Node) node; return runtime.getObject().getConstantFrom(iVisited.getName()); } case NodeTypes.CONSTDECLNODE: { ConstDeclNode iVisited = (ConstDeclNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); IRubyObject module; if (iVisited.getPathNode() != null) { module = evalInternal(context, iVisited.getPathNode(), self); } else { // FIXME: why do we check RubyClass and then use CRef? if (context.getRubyClass() == null) { // TODO: wire into new exception handling mechanism throw runtime.newTypeError("no class/module to define constant"); } module = (RubyModule) context.peekCRef().getValue(); } // FIXME: shouldn't we use the result of this set in setResult? ((RubyModule) module).setConstant(iVisited.getName(), result); return result; } case NodeTypes.CONSTNODE: { ConstNode iVisited = (ConstNode) node; return context.getConstant(iVisited.getName()); } case NodeTypes.DASGNNODE: { DAsgnNode iVisited = (DAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("DSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.DEFINEDNODE: { DefinedNode iVisited = (DefinedNode) node; String definition = getDefinition(context, iVisited.getExpressionNode(), self); if (definition != null) { return runtime.newString(definition); } else { return runtime.getNil(); } } case NodeTypes.DEFNNODE: { DefnNode iVisited = (DefnNode) node; RubyModule containingClass = context.getRubyClass(); if (containingClass == null) { throw runtime.newTypeError("No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getObject() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = context.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } DefaultMethod newMethod = new DefaultMethod(containingClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } containingClass.addMethod(name, newMethod); if (context.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod( name, new WrapperCallable(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC)); containingClass.callMethod(context, "singleton_method_added", runtime.newSymbol(name)); } // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { ((MetaClass) containingClass).getAttachedObject().callMethod( context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); } else { containingClass.callMethod(context, "method_added", runtime.newSymbol(name)); } return runtime.getNil(); } case NodeTypes.DEFSNODE: { DefsNode iVisited = (DefsNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure; can't define singleton method."); } if (receiver.isFrozen()) { throw runtime.newFrozenError("object"); } if (!receiver.singletonMethodsAllowed()) { throw runtime.newTypeError("can't define singleton method \"" + iVisited.getName() + "\" for " + receiver.getType()); } RubyClass rubyClass = receiver.getSingletonClass(); if (runtime.getSafeLevel() >= 4) { ICallable method = (ICallable) rubyClass.getMethods().get(iVisited.getName()); if (method != null) { throw runtime.newSecurityError("Redefining method prohibited."); } } DefaultMethod newMethod = new DefaultMethod(rubyClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), Visibility.PUBLIC, context.peekCRef()); if (iVisited.getBodyNode() != null) { iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); } rubyClass.addMethod(iVisited.getName(), newMethod); receiver.callMethod(context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); return runtime.getNil(); } case NodeTypes.DOTNODE: { DotNode iVisited = (DotNode) node; return RubyRange.newRange(runtime, evalInternal(context, iVisited.getBeginNode(), self), evalInternal(context, iVisited .getEndNode(), self), iVisited.isExclusive()); } case NodeTypes.DREGEXPNODE: { DRegexpNode iVisited = (DRegexpNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } return RubyRegexp.newRegexp(runtime, sb.toString(), iVisited.getOptions(), lang); } case NodeTypes.DSTRNODE: { DStrNode iVisited = (DStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newString(sb.toString()); } case NodeTypes.DSYMBOLNODE: { DSymbolNode iVisited = (DSymbolNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.getNode().iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newSymbol(sb.toString()); } case NodeTypes.DVARNODE: { DVarNode iVisited = (DVarNode) node; // System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject obj = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); // FIXME: null check is removable once we figure out how to assign to unset named block args return obj == null ? runtime.getNil() : obj; } case NodeTypes.DXSTRNODE: { DXStrNode iVisited = (DXStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return self.callMethod(context, "`", runtime.newString(sb.toString())); } case NodeTypes.ENSURENODE: { EnsureNode iVisited = (EnsureNode) node; // save entering the try if there's nothing to ensure if (iVisited.getEnsureNode() != null) { IRubyObject result = runtime.getNil(); try { result = evalInternal(context, iVisited.getBodyNode(), self); } finally { evalInternal(context, iVisited.getEnsureNode(), self); } return result; } node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.EVSTRNODE: { EvStrNode iVisited = (EvStrNode) node; node = iVisited.getBody(); continue bigloop; } case NodeTypes.FALSENODE: { context.pollThreadEvents(); return runtime.getFalse(); } case NodeTypes.FCALLNODE: { FCallNode iVisited = (FCallNode) node; context.beginCallArgs(); IRubyObject[] args; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return self.callMethod(context, iVisited.getName(), args, CallType.FUNCTIONAL); } case NodeTypes.FIXNUMNODE: { FixnumNode iVisited = (FixnumNode) node; return runtime.newFixnum(iVisited.getValue()); } case NodeTypes.FLIPNODE: { FlipNode iVisited = (FlipNode) node; IRubyObject result = runtime.getNil(); if (iVisited.isExclusive()) { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { result = evalInternal(context, iVisited.getBeginNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } else { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { if (evalInternal(context, iVisited.getBeginNode(), self).isTrue()) { context.getCurrentScope().setValue( iVisited.getIndex(), evalInternal(context, iVisited.getEndNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(), iVisited.getDepth()); return runtime.getTrue(); } else { return runtime.getFalse(); } } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } } case NodeTypes.FLOATNODE: { FloatNode iVisited = (FloatNode) node; return RubyFloat.newFloat(runtime, iVisited.getValue()); } case NodeTypes.FORNODE: { ForNode iVisited = (ForNode) node; // For nodes do not have to create an addition scope so we just pass null context.preForLoopEval(Block.createBlock(iVisited.getVarNode(), null, iVisited.getCallable(), self)); try { while (true) { try { ISourcePosition position = context.getPosition(); context.beginCallArgs(); IRubyObject recv = null; try { recv = evalInternal(context, iVisited.getIterNode(), self); } finally { context.setPosition(position); context.endCallArgs(); } return recv.callMethod(context, "each", IRubyObject.NULL_ARRAY, CallType.NORMAL); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // do nothing, allow loop to retry break; default: throw je; } } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postForLoopEval(); } } case NodeTypes.GLOBALASGNNODE: { GlobalAsgnNode iVisited = (GlobalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); runtime.getGlobalVariables().set(iVisited.getName(), result); return result; } case NodeTypes.GLOBALVARNODE: { GlobalVarNode iVisited = (GlobalVarNode) node; return runtime.getGlobalVariables().get(iVisited.getName()); } case NodeTypes.HASHNODE: { HashNode iVisited = (HashNode) node; Map hash = null; if (iVisited.getListNode() != null) { hash = new HashMap(iVisited.getListNode().size() / 2); for (Iterator iterator = iVisited.getListNode().iterator(); iterator.hasNext();) { // insert all nodes in sequence, hash them in the final instruction // KEY IRubyObject key = evalInternal(context, (Node) iterator.next(), self); IRubyObject value = evalInternal(context, (Node) iterator.next(), self); hash.put(key, value); } } if (hash == null) { return RubyHash.newHash(runtime); } return RubyHash.newHash(runtime, hash, runtime.getNil()); } case NodeTypes.IFNODE: { IfNode iVisited = (IfNode) node; IRubyObject result = evalInternal(context, iVisited.getCondition(), self); if (result.isTrue()) { node = iVisited.getThenBody(); continue bigloop; } else { node = iVisited.getElseBody(); continue bigloop; } } case NodeTypes.INSTASGNNODE: { InstAsgnNode iVisited = (InstAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); self.setInstanceVariable(iVisited.getName(), result); return result; } case NodeTypes.INSTVARNODE: { InstVarNode iVisited = (InstVarNode) node; IRubyObject variable = self.getInstanceVariable(iVisited.getName()); return variable == null ? runtime.getNil() : variable; } // case NodeTypes.ISCOPINGNODE: // EvaluateVisitor.iScopingNodeVisitor.execute(this, node); // break; case NodeTypes.ITERNODE: { IterNode iVisited = (IterNode) node; context.preIterEval(Block.createBlock(iVisited.getVarNode(), new DynamicScope(iVisited.getScope(), context.getCurrentScope()), iVisited.getCallable(), self)); try { while (true) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // allow loop to retry break; default: throw je; } } finally { context.clearBlockAvailable(); } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postIterEval(); } } case NodeTypes.LOCALASGNNODE: { LocalAsgnNode iVisited = (LocalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("LSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.LOCALVARNODE: { LocalVarNode iVisited = (LocalVarNode) node; //System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject result = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); return result == null ? runtime.getNil() : result; } case NodeTypes.MATCH2NODE: { Match2Node iVisited = (Match2Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); return ((RubyRegexp) recv).match(value); } case NodeTypes.MATCH3NODE: { Match3Node iVisited = (Match3Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); if (value instanceof RubyString) { return ((RubyRegexp) recv).match(value); } else { return value.callMethod(context, "=~", recv); } } case NodeTypes.MATCHNODE: { MatchNode iVisited = (MatchNode) node; return ((RubyRegexp) evalInternal(context, iVisited.getRegexpNode(), self)).match2(); } case NodeTypes.MODULENODE: { ModuleNode iVisited = (ModuleNode) node; Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingModule = getEnclosingModule(context, classNameNode, self); if (enclosingModule == null) { throw runtime.newTypeError("no outer class/module"); } RubyModule module; if (enclosingModule == runtime.getObject()) { module = runtime.getOrCreateModule(name); } else { module = enclosingModule.defineModuleUnder(name); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), module, self); } case NodeTypes.MULTIPLEASGNNODE: { MultipleAsgnNode iVisited = (MultipleAsgnNode) node; return AssignmentVisitor.assign(context, self, iVisited, evalInternal(context, iVisited.getValueNode(), self), false); } case NodeTypes.NEWLINENODE: { NewlineNode iVisited = (NewlineNode) node; // something in here is used to build up ruby stack trace... context.setPosition(iVisited.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // TODO: do above but not below for additional newline nodes node = iVisited.getNextNode(); continue bigloop; } case NodeTypes.NEXTNODE: { NextNode iVisited = (NextNode) node; context.pollThreadEvents(); IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.NextJump); je.setPrimaryData(result); je.setSecondaryData(iVisited); //state.setCurrentException(je); throw je; } case NodeTypes.NILNODE: return runtime.getNil(); case NodeTypes.NOTNODE: { NotNode iVisited = (NotNode) node; IRubyObject result = evalInternal(context, iVisited.getConditionNode(), self); return result.isTrue() ? runtime.getFalse() : runtime.getTrue(); } case NodeTypes.NTHREFNODE: { NthRefNode iVisited = (NthRefNode) node; return RubyRegexp.nth_match(iVisited.getMatchNumber(), context.getBackref()); } case NodeTypes.OPASGNANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; // add in reverse order IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.OPASGNNODE: { OpAsgnNode iVisited = (OpAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = receiver.callMethod(context, iVisited.getVariableName()); if (iVisited.getOperatorName().equals("||")) { if (value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else { value = value.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited.getValueNode(), self)); } receiver.callMethod(context, iVisited.getVariableName() + "=", value); context.pollThreadEvents(); return value; } case NodeTypes.OPASGNORNODE: { OpAsgnOrNode iVisited = (OpAsgnOrNode) node; String def = getDefinition(context, iVisited.getFirstNode(), self); IRubyObject result = runtime.getNil(); if (def != null) { result = evalInternal(context, iVisited.getFirstNode(), self); } if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } case NodeTypes.OPELEMENTASGNNODE: { OpElementAsgnNode iVisited = (OpElementAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject[] args = setupArgs(context, iVisited.getArgsNode(), self); IRubyObject firstValue = receiver.callMethod(context, "[]", args); if (iVisited.getOperatorName().equals("||")) { if (firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else { firstValue = firstValue.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited .getValueNode(), self)); } IRubyObject[] expandedArgs = new IRubyObject[args.length + 1]; System.arraycopy(args, 0, expandedArgs, 0, args.length); expandedArgs[expandedArgs.length - 1] = firstValue; return receiver.callMethod(context, "[]=", expandedArgs); } case NodeTypes.OPTNNODE: { OptNNode iVisited = (OptNNode) node; IRubyObject result = runtime.getNil(); while (RubyKernel.gets(runtime.getTopSelf(), IRubyObject.NULL_ARRAY).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: // do nothing, this iteration restarts break; case JumpType.NEXT: // recheck condition break loop; case JumpType.BREAK: // end loop return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.ORNODE: { OrNode iVisited = (OrNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } // case NodeTypes.POSTEXENODE: // EvaluateVisitor.postExeNodeVisitor.execute(this, node); // break; case NodeTypes.REDONODE: { context.pollThreadEvents(); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.RedoJump); je.setSecondaryData(node); throw je; } case NodeTypes.REGEXPNODE: { RegexpNode iVisited = (RegexpNode) node; String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } try { return RubyRegexp.newRegexp(runtime, iVisited.getPattern(), lang); } catch(java.util.regex.PatternSyntaxException e) { throw runtime.newSyntaxError(e.getMessage()); } } case NodeTypes.RESCUEBODYNODE: { RescueBodyNode iVisited = (RescueBodyNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.RESCUENODE: { RescueNode iVisited = (RescueNode)node; RescuedBlock : while (true) { try { // Execute rescue block IRubyObject result = evalInternal(context, iVisited.getBodyNode(), self); // If no exception is thrown execute else block if (iVisited.getElseNode() != null) { if (iVisited.getRescueNode() == null) { runtime.getWarnings().warn(iVisited.getElseNode().getPosition(), "else without rescue is useless"); } result = evalInternal(context, iVisited.getElseNode(), self); } return result; } catch (RaiseException raiseJump) { RubyException raisedException = raiseJump.getException(); // TODO: Rubicon TestKernel dies without this line. A cursory glance implies we // falsely set $! to nil and this sets it back to something valid. This should // get fixed at the same time we address bug #1296484. runtime.getGlobalVariables().set("$!", raisedException); RescueBodyNode rescueNode = iVisited.getRescueNode(); while (rescueNode != null) { Node exceptionNodes = rescueNode.getExceptionNodes(); ListNode exceptionNodesList; if (exceptionNodes instanceof SplatNode) { exceptionNodesList = (ListNode) evalInternal(context, exceptionNodes, self); } else { exceptionNodesList = (ListNode) exceptionNodes; } if (isRescueHandled(context, raisedException, exceptionNodesList, self)) { try { return evalInternal(context, rescueNode, self); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.RetryJump) { // should be handled in the finally block below //state.runtime.getGlobalVariables().set("$!", state.runtime.getNil()); //state.threadContext.setRaisedException(null); continue RescuedBlock; } else { throw je; } } } rescueNode = rescueNode.getOptRescueNode(); } // no takers; bubble up throw raiseJump; } finally { // clear exception when handled or retried runtime.getGlobalVariables().set("$!", runtime.getNil()); } } } case NodeTypes.RETRYNODE: { context.pollThreadEvents(); JumpException je = new JumpException(JumpException.JumpType.RetryJump); throw je; } case NodeTypes.RETURNNODE: { ReturnNode iVisited = (ReturnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.ReturnJump); je.setPrimaryData(iVisited.getTarget()); je.setSecondaryData(result); je.setTertiaryData(iVisited); throw je; } case NodeTypes.ROOTNODE: { RootNode iVisited = (RootNode) node; DynamicScope scope = iVisited.getScope(); // Serialization killed our dynamic scope. We can just create an empty one // since serialization cannot serialize an eval (which is the only thing // which is capable of having a non-empty dynamic scope). if (scope == null) { scope = new DynamicScope(iVisited.getStaticScope(), null); } // Each root node has a top-level scope that we need to push context.preRootNode(scope); // FIXME: Wire up BEGIN and END nodes try { return eval(context, iVisited.getBodyNode(), self); } finally { context.postRootNode(); } } case NodeTypes.SCLASSNODE: { SClassNode iVisited = (SClassNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass singletonClass; if (receiver.isNil()) { singletonClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { singletonClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { singletonClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure: can't extend object."); } singletonClass = receiver.getSingletonClass(); } if (context.getWrapper() != null) { singletonClass.extendObject(context.getWrapper()); singletonClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), singletonClass, self); } case NodeTypes.SELFNODE: return self; case NodeTypes.SPLATNODE: { SplatNode iVisited = (SplatNode) node; return splatValue(evalInternal(context, iVisited.getValue(), self)); } //// case NodeTypes.STARNODE: //// EvaluateVisitor.starNodeVisitor.execute(this, node); //// break; case NodeTypes.STRNODE: { StrNode iVisited = (StrNode) node; return runtime.newString(iVisited.getValue()); } case NodeTypes.SUPERNODE: { SuperNode iVisited = (SuperNode) node; if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("Superclass method '" + name + "' disabled.", name); } context.beginCallArgs(); IRubyObject[] args = null; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return context.callSuper(args); } case NodeTypes.SVALUENODE: { SValueNode iVisited = (SValueNode) node; return aValueSplat(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.SYMBOLNODE: { SymbolNode iVisited = (SymbolNode) node; return runtime.newSymbol(iVisited.getName()); } case NodeTypes.TOARYNODE: { ToAryNode iVisited = (ToAryNode) node; return aryToAry(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.TRUENODE: { context.pollThreadEvents(); return runtime.getTrue(); } case NodeTypes.UNDEFNODE: { UndefNode iVisited = (UndefNode) node; if (context.getRubyClass() == null) { throw runtime .newTypeError("No class to undef method '" + iVisited.getName() + "'."); } context.getRubyClass().undef(iVisited.getName()); return runtime.getNil(); } case NodeTypes.UNTILNODE: { UntilNode iVisited = (UntilNode) node; IRubyObject result = runtime.getNil(); while (!(result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.VALIASNODE: { VAliasNode iVisited = (VAliasNode) node; runtime.getGlobalVariables().alias(iVisited.getNewName(), iVisited.getOldName()); return runtime.getNil(); } case NodeTypes.VCALLNODE: { VCallNode iVisited = (VCallNode) node; return self.callMethod(context, iVisited.getName(), IRubyObject.NULL_ARRAY, CallType.VARIABLE); } case NodeTypes.WHENNODE: assert false; return null; case NodeTypes.WHILENODE: { WhileNode iVisited = (WhileNode) node; IRubyObject result = runtime.getNil(); boolean firstTest = iVisited.evaluateAtStart(); while (!firstTest || (result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { firstTest = true; loop: while (true) { // Used for the 'redo' command try { evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return result; default: throw je; } } } } return result; } case NodeTypes.XSTRNODE: { XStrNode iVisited = (XStrNode) node; return self.callMethod(context, "`", runtime.newString(iVisited.getValue())); } case NodeTypes.YIELDNODE: { YieldNode iVisited = (YieldNode) node; IRubyObject result = evalInternal(context, iVisited.getArgsNode(), self); if (iVisited.getArgsNode() == null) { result = null; } return context.yieldCurrentBlock(result, null, null, iVisited.getCheckState()); } case NodeTypes.ZARRAYNODE: { return runtime.newArray(); } case NodeTypes.ZSUPERNODE: { if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("superclass method '" + name + "' disabled", name); } return context.callSuper(context.getFrameArgs(), true); } } } while (true); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b520257f51e4960a6f954cc9e72cf4601cfd900e/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java |
public SessionHandler(DataSource dataSource, SessionFactory factory) { this.dataSource = dataSource; this.delegate = new HibernateInterceptor(); this.factory = factory; this.delegate.setSessionFactory(factory); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f7d8facc0df80871004c721c1920ba34361d4e05/SessionHandler.java/buggy/components/server/src/ome/tools/hibernate/SessionHandler.java |
||
catch (Throwable e) { e.printStackTrace(); throw e; } | private Object doStateful(MethodInvocation invocation) throws Throwable { Object result = null; try { newOrRestoredSession(invocation); result = invocation.proceed(); return result; } finally { if (isCloseSession(invocation)) { closeSession(); } else { disconnectSession(); } resetThreadSession(); // Everything successfully turned off. Decrement. if (sessions.containsKey(invocation.getThis())) { sessions.get(invocation.getThis()).calls--; } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f7d8facc0df80871004c721c1920ba34361d4e05/SessionHandler.java/buggy/components/server/src/ome/tools/hibernate/SessionHandler.java |
|
if (isCloseSession(invocation)) { closeSession(); } else { disconnectSession(); } resetThreadSession(); | try { if (isCloseSession(invocation)) { closeSession(); } else { disconnectSession(); } } catch (Exception e) { debug("Error while closing/disconnecting session."); } finally { resetThreadSession(); | private Object doStateful(MethodInvocation invocation) throws Throwable { Object result = null; try { newOrRestoredSession(invocation); result = invocation.proceed(); return result; } finally { if (isCloseSession(invocation)) { closeSession(); } else { disconnectSession(); } resetThreadSession(); // Everything successfully turned off. Decrement. if (sessions.containsKey(invocation.getThis())) { sessions.get(invocation.getThis()).calls--; } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f7d8facc0df80871004c721c1920ba34361d4e05/SessionHandler.java/buggy/components/server/src/ome/tools/hibernate/SessionHandler.java |
if (sessions.containsKey(invocation.getThis())) { sessions.get(invocation.getThis()).calls--; | if (sessions.containsKey(invocation.getThis())) { sessions.get(invocation.getThis()).calls--; } | private Object doStateful(MethodInvocation invocation) throws Throwable { Object result = null; try { newOrRestoredSession(invocation); result = invocation.proceed(); return result; } finally { if (isCloseSession(invocation)) { closeSession(); } else { disconnectSession(); } resetThreadSession(); // Everything successfully turned off. Decrement. if (sessions.containsKey(invocation.getThis())) { sessions.get(invocation.getThis()).calls--; } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f7d8facc0df80871004c721c1920ba34361d4e05/SessionHandler.java/buggy/components/server/src/ome/tools/hibernate/SessionHandler.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.