Bug 22152 - Refactoring introduces errors in outline view
Summary: Refactoring introduces errors in outline view
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-04 17:28 EDT by John Rayburn CLA
Modified: 2004-10-25 11:40 EDT (History)
0 users

See Also:


Attachments
Patched version of content outline page that detects input source changes (33.31 KB, text/plain)
2002-08-27 13:29 EDT, Adrian Colyer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Rayburn CLA 2002-08-04 17:28:55 EDT
org.aspectj.ajde 1.0.5
org.eclipse.ajdt.ui 0.5.0
Eclipse build: 200206271827

Do the following to reproduce this error in an AspectJ Project:

1. Create an aspectj project
2. Create a class, name it 'Class1'
3. Using refactor->rename, rename Class1 to be Class2
4. Create a class, name it 'Class1' (note, it no longer exists b/c of 3)
5. Build the project
6. Examine the outline view: Both Class1 and Class2 will show Class1 
information in the outline view.

If you close the files and re-open, the outline view now displays the correct 
information for each class.

This was tested in both AspectJ and Java projects, and could only be reproduced 
in aspectj projects.  

Note: No aspects were included in the project.
Comment 1 Adrian Colyer CLA 2002-08-27 13:29:56 EDT
Created attachment 1899 [details]
Patched version of content outline page that detects input source changes
Comment 2 Adrian Colyer CLA 2002-08-27 13:36:19 EDT
For Mik... The content outline page wasn't detecting changes in its input 
source over its lifetime (assumed it stayed constant, but this isn't true in 
the face of refactoring). The attachment to this bug contains a patched 
AspectJContentOutlinePage. This correctly detects the input change, but causes 
an Ajde exception when it tries to load the new structure:

Here's the stdout/err from a simple run.

Structure Reload forced
AspectJ ASM Error: could not buld structure model.
java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
	at java.util.AbstractList$Itr.next(Unknown Source)
	at org.aspectj.ajde.ui.StructureViewManager$1.modelUpdated
(StructureViewManager.java:58)
	at org.aspectj.asm.StructureModelManager.notifyListeners
(StructureModelManager.java:155)
	at org.aspectj.asm.StructureModelManager.buildStructureModel
(StructureModelManager.java:76)
	at 
org.aspectj.asm.StructureModelManager$UpdateStructurePass.transformWorld
(StructureModelManager.java:373)
	at org.aspectj.compiler.base.JavaCompiler.internalCompile
(JavaCompiler.java:368)
	at org.aspectj.compiler.base.JavaCompiler.compile(JavaCompiler.java:144)
	at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run
(AspectJBuildManager.java:225)

To reproduce this, create a class, Class1. Build. Refactor->rename to Class2. 
Build.

If you look in the source you'll see I've introduced hasInputChanged( ) and 
forceReloadOfStructureView( ) operations. Ideally I'd like a single API call to 
tell Ajde to reload its configuration... How can we get around the concurrent 
update problem.. it's nearly impossible from the outline page to detect when a 
build has fully completed. 
Comment 3 Adrian Colyer CLA 2002-09-19 07:33:48 EDT
The AJDE (AspectJ) side changes required to fix this bug are non-trivial, so we 
have agreed to wait for the AspectJ 1.1 compiler (due in next few weeks) based 
on Eclipse which will make resolution much simpler. Leaving this problem open 
in the interim. 
Comment 4 Ron Bodkin CLA 2003-01-29 00:31:33 EST
I have found that in AJDT 0.5.2, refactorings that change packages cause the 
compiler to be permanently confused and pop up an error dialog box. The work 
around is to exit Eclipse and restart it.
Comment 5 Helen Beeken CLA 2004-08-02 06:54:35 EDT
I've followed the steps as detailed when this bug was opened in the following 
two situations:

(1) Eclipse 3.0 (final) with AJDT 1.1.11 installed from update site
(2) Eclipse 3.0 (final) with AJDT in a development environment with AJDT code 
as of 20040802.

In case (1) I reproduced this problem straight away, in case (2) I have yet to 
see it. I will continue to look into this.
Comment 6 Helen Beeken CLA 2004-10-25 11:40:05 EDT
I'm closing this bug as I am no longer able to reproduce this in Eclipse 3.0 
with the following AJDT build: (AJDT 1.2.1M1)

Version: 1.2.0
Build id: 20041014111121
AspectJ version: 1.2.0

Thanks, Helen