Bug 102497 - [model] Static initializer not listed for binary class with source.
Summary: [model] Static initializer not listed for binary class with source.
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.3 RC4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-01 11:45 EDT by Brian Miller CLA
Modified: 2007-06-19 10:40 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Miller CLA 2005-07-01 11:45:22 EDT
Open class java.lang.System in the Java Browsing perspective and see that the 
static initializer isn't listed in the Members tab.
Comment 1 Dirk Baeumer CLA 2005-07-02 13:43:20 EDT
Martin, can you please comment. It isn't listed in Outliner, package explorer
either.
Comment 2 Martin Aeschlimann CLA 2005-07-04 05:58:35 EDT
It isn't returned by the Java model. Suggest to move it to core if this is
important.
Comment 3 Jerome Lanneluc CLA 2006-09-28 04:44:29 EDT
What is shown in the Outline view is not the outline of the attached source, but the outline of the .class file. However the .class file doesn't contain any information about the static initializer.

To solve this issue, one possibility would be to create a working copy on the .class file (using IClassFile#getWorkingCopy(...)) and have the Outline view show the outline of the working copy. 

Martin, what do you think ?
Comment 4 Martin Aeschlimann CLA 2006-09-28 06:47:16 EDT
Couldn't jdt.core automatically use the source if available?
Using the working copy in the editor would introduce new elements that don't exist at other places.
We will have to able to handle them everywhery else (in all actions) and even have to update all other tooling to not use classfile children but go through the working copy. That's not somthing we should start.
Comment 5 Dominik Goepel CLA 2007-04-24 07:04:26 EDT
i just experienced this bug using 3.3m6 (looking at java.io.Console).

From looking at rt.jar it seems that static initializers are defined in Foo$i.class, just like anonymous inner classes (which are also not shown in the outline of a .class with source attached).

Maybe its possible to include Foo$i.class when creating the model? That way, it would even work without source attachment.
Comment 6 Jerome Lanneluc CLA 2007-06-19 10:40:53 EDT
Foo$i.class is present in the model. It is filtered out by default in the Package Explorer. You can disable this filtering using the Package Explorer filter.

No action planned on JDT/Core side.