|
|
|
Re: How to detect initialization order of fields? [message #1794279 is a reply to message #1794277] |
Tue, 28 August 2018 12:16 |
Stephan Herrmann Messages: 1853 Registered: July 2009 |
Senior Member |
|
|
Sergey Toshin wrote on Tue, 28 August 2018 14:11Thanks, but it's description how it should work anywhere, but not how it really works in Eclipse.
What exactly is not working that way in Eclipse?
Do we generate wrong byte code?
Quote:
I'm using Eclipse JDT in my own project, and I have FieldDeclaration[] for a class, so I want to resolve order of initializations
Are you interested in the correct order according to JLS (textual source code order), or the semantically meaningful order (with no dereference before initialization)?
As mentioned, when saying "this.c2" this is not guaranteed to be the same order, but when saying "c2", differences between both orders will raise a compile error.
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06324 seconds