Bug 132370 - [jdt-weaving] Internal duplication: Java and AspectJ modes
Summary: [jdt-weaving] Internal duplication: Java and AspectJ modes
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: 1.4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andrew Eisenberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 244790 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-17 12:45 EST by Ron Bodkin CLA
Modified: 2008-12-16 18:37 EST (History)
2 users (show)

See Also:


Attachments
screen shot (16.65 KB, image/x-png)
2006-03-17 12:46 EST, Ron Bodkin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2006-03-17 12:45:55 EST
I tried to synchronize this AspectJ file (with an .aj extension), and when I selected update, I get the following weird prompt, asking me to pick between the Java and AspectJ version of the file.

I've also had it happen before that AspectJ files appeared in the package explorer with a Java item icon next to the AspectJ icon.

This is in Eclipse 3.2 M5a (presumably coming from java-like language support).

See screen shot.
Comment 1 Ron Bodkin CLA 2006-03-17 12:46:56 EST
Created attachment 36505 [details]
screen shot
Comment 2 Andrew Clement CLA 2008-05-09 16:15:14 EDT
still occurs?
Comment 3 Andrew Eisenberg CLA 2008-05-30 14:26:56 EDT
I can't reproduce this.  Doesn't mean that it's fixed, but maybe just that Ron's set-up is slightly different.

What's happening here is that the filter is not being applied appropriately.  In the package explorer, aj files appear twice.  The first is associated with the AJCompilationUnit and the second is associated with the (Java) CompilationUnit.  Typically, a filter is applied to the package explorer so that the (Java) CompilationUnit is hidden.  Seems like that the filter is not working for you for some reason.
Comment 4 Andrew Eisenberg CLA 2008-06-01 11:35:40 EDT
I've been able to reproduce the problem and I've located where its cause is, but at this point we don't have easy access to change it.

The dialog uses JavaElementResourceMapping objects to map how elements have changed in the two versions being compared.  The elements are displayed by walking the Java structure and looking for similarities between the two trees.

IPackageFragment objects that contain aspects have 2 ICompilationUnits for the aspect (one that is Java and one that is AspectJ).  They both need to exist because different parts of the Eclipse infrastructure requires one or the other.  Most of the time, the unused ICompilationUnit is filtered from view, but that's not possible in this situation.

See also, AdditionalMappingsDialog and TreeViewer.
Comment 5 Andrew Clement CLA 2008-08-21 12:48:56 EDT
*** Bug 244790 has been marked as a duplicate of this bug. ***
Comment 6 Andrew Eisenberg CLA 2008-12-16 18:37:45 EST
With JDT Weaving enabled, this is no longer a problem.  The duplicate CompilationUnit is not created and so it will never appear twice.