Community
Participate
Working Groups
Some elements have the wrong kinds when a saved structure model is loaded. E.g. if I close then re-open the eclipse workbench classes are shown as interface in the outline view. Also if I traverse the tree with the code below I get the wrong kinds assigned to classed, interfaces, aspects and import declarations. List list = StructureModelUtil.getPackagesInModel(); for(Iterator i = list.iterator(); i.hasNext();){ Object[] o = (Object[])i.next(); IProgramElement node = (IProgramElement)o[0]; List files = StructureModelUtil.getFilesInPackage(node); for(Iterator i2 = files.iterator(); i2.hasNext();){ IProgramElement file = (IProgramElement)i2.next (); System.out.println("file " + file.getKind ().toString() + ", " + file.getName()); boolean added2 = false; List file_children = file.getChildren(); // file children can be classes, aspects or other things for(Iterator i3 = file_children.iterator(); i3.hasNext();){ IProgramElement file_child = (IProgramElement)i3.next(); System.out.println("kind: " + file_child.getKind().toString() +", " + file_child.getName());
*** Bug 45488 has been marked as a duplicate of this bug. ***
curious... without looking at the source I'd guess there might be some type-safe enum patterns used that haven't been extended properly to allow for serialization?
I have committed a fix for this. The problem was indeed with the type-safe enum patterns. I added a test case that compares all of the nodes in a test model before and after the build: ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest
updating target flag to indicate inclusion in 1.2 release.