Community
Participate
Working Groups
Open class java.lang.System in the Java Browsing perspective and see that the static initializer isn't listed in the Members tab.
Martin, can you please comment. It isn't listed in Outliner, package explorer either.
It isn't returned by the Java model. Suggest to move it to core if this is important.
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 ?
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.
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.
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.