Bug 45489 - Structure model is wrong when re-opened
Summary: Structure model is wrong when re-opened
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 1.2   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 45488 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-24 06:34 EDT by Sian Whiting CLA
Modified: 2004-03-19 09:42 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sian Whiting CLA 2003-10-24 06:34:59 EDT
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());
Comment 1 Sian Whiting CLA 2003-10-24 07:05:07 EDT
*** Bug 45488 has been marked as a duplicate of this bug. ***
Comment 2 Adrian Colyer CLA 2003-11-27 10:51:36 EST
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?
Comment 3 Mik Kersten CLA 2004-02-19 11:11:24 EST
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

Comment 4 Adrian Colyer CLA 2004-03-19 09:42:41 EST
updating target flag to indicate inclusion in 1.2 release.