Project: AspectJ
Bug 45489 Structure model is wrong when re-opened
Reported: 2003-10-24 06:34:59 | Status: resolved fixed

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());

Files changed in fix:
ajde/testsrc/org/aspectj/ajde/AjdeTests.java ajde/testsrc/org/aspectj/ajde/SavedModelConsistencyTest.java asm/src/org/aspectj/asm/IProgramElement.java