Bug 251825 - [compiler] Misplaced static initializer is potential programming problem
Summary: [compiler] Misplaced static initializer is potential programming problem
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-23 06:45 EDT by Gémes Tamás CLA
Modified: 2008-10-24 06:24 EDT (History)
0 users

See Also:


Attachments
Code demonstrating the problem. (579 bytes, application/octet-stream)
2008-10-23 06:45 EDT, Gémes Tamás CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gémes Tamás CLA 2008-10-23 06:45:55 EDT
Created attachment 115907 [details]
Code demonstrating the problem.

The attached code outputs:

Ac
A.a
B.b
Bc

The problem is, that from a big code it is very hard to find, why B.b is output before Bc.
It is trivial, that the static initializer (SI) code makes the output, but since nobody puts SI after a method and indents it like this, it is a potential programming problem (PPP).

The search for the problem can consume really much time. Introducing a new PPP switch can eliminate this issue.