Bug 187329 - compilation error constants created with static methods
Summary: compilation error constants created with static methods
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 RC1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL: http://rapidshare.com/files/31660356/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-16 13:37 EDT by Nihal Sinha CLA
Modified: 2007-05-17 10:30 EDT (History)
1 user (show)

See Also:
Olivier_Thomann: review+


Attachments
Eclipse project to reproduce the bug (1.76 KB, application/x-zip-compressed)
2007-05-16 13:45 EDT, Nihal Sinha CLA
no flags Details
Proposed patch (3.26 KB, patch)
2007-05-16 15:29 EDT, Kent Johnson CLA
no flags Details | Diff
Update patch (3.65 KB, patch)
2007-05-16 15:47 EDT, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nihal Sinha CLA 2007-05-16 13:37:57 EDT
Take a look at the Eclipse project I've zipped and uploaded to the URL given (File > Import > Existing Projects Into Workspace > Archive file).  I receive a compilation error for a constant (public static final class variable) that is (1) referred to in another class, and (2) is initialized to its value using a static method (imported using a static import).

I believe this has something to do with the order in which classes are built (see attached code).  I've been getting around this bug by changing the source file, and re-saving it.  That appears to fix it temporarily.  Doing a clean build causes the error to reappear.

I'm using Eclipse 3.3 M7 (Version: 3.3.0, Build id: I20070418-1012) with a Sun 1.5.0 compiler.
Comment 1 Nihal Sinha CLA 2007-05-16 13:45:47 EDT
Created attachment 67466 [details]
Eclipse project to reproduce the bug
Comment 2 Olivier Thomann CLA 2007-05-16 14:17:24 EDT
Kent,

Could you please have a look? This is an ordering issue in the full build.
Recompiling only Foo fixes the compile error, but it is back on a new full build.
Comment 3 Kent Johnson CLA 2007-05-16 15:29:16 EDT
Created attachment 67495 [details]
Proposed patch
Comment 4 Kent Johnson CLA 2007-05-16 15:47:34 EDT
Created attachment 67500 [details]
Update patch

Found another place where we access static imports possibly before they're resolved
Comment 5 Olivier Thomann CLA 2007-05-16 15:50:16 EDT
+1.
Comment 6 Kent Johnson CLA 2007-05-16 16:50:40 EDT
Released into HEAD for 3.3RC1
Comment 7 Olivier Thomann CLA 2007-05-17 10:30:23 EDT
Verified for 3.3RC1 with I20070516-1800.