Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367354 - Invalid code generated in re-organize imports
Summary: Invalid code generated in re-organize imports
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 2.1.3   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 2.2.0   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-21 11:52 EST by Brian de Alwis CLA
Modified: 2011-12-22 16:55 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 Brian de Alwis CLA 2011-12-21 11:52:15 EST
Version: 2.2.0.e37x-20111215-2200
AspectJ version: 1.7.0.20111215190600

I'm attempting to include the aspect defined towards the end of this article:

   http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html

It has a wildcard import:
-----------
import javax.swing.*;
-----------
Ctrl-Shift-O produced:
-----------
import javax.swing.import javax.swing.JComponent;
import javax.swing.SwingUtilities;
-----------

Notice that the reorganize seems to have only removed the wildcard, and forgot the rest of the "import javax.swing.".
Comment 1 Andrew Eisenberg CLA 2011-12-22 16:02:48 EST
Yep.  Easily reproducible.  Thanks for the bug report.
Comment 2 Andrew Eisenberg CLA 2011-12-22 16:03:56 EST
Simpler aspect that recreates the problem:

import javax.swing.*;

aspect EdtRuleChecker {
	JFrame j;
}

It is a problem with any * imports.
Comment 3 Andrew Eisenberg CLA 2011-12-22 16:21:22 EST
This is a source location problem.
Comment 4 Andrew Eisenberg CLA 2011-12-22 16:55:09 EST
Yes, problem was that there was a small change to how the parser creates import references since upgrading to a Java 7-based parser, but this change wasn't reflected in AJDT.  Fixed now.

It's small changes like these that I am expecting to see a few more of.  Let me know if you see any more quirks.

Fixed and committed with regression tests.