Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 69648 Details for
Bug 190391
ECJ: Constructors can initialize other instance's final fields instead of their own
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
a class that can break DA/DU as implemented in ECJ
ShouldNotCompile.java (text/plain), 697 bytes, created by
Adrian Mettler
on 2007-05-31 21:57:55 EDT
(
hide
)
Description:
a class that can break DA/DU as implemented in ECJ
Filename:
MIME Type:
Creator:
Adrian Mettler
Created:
2007-05-31 21:57:55 EDT
Size:
697 bytes
patch
obsolete
>/* > * This file should not compile; Sun's compiler and GCJ both refuse to compile > * it. Eclipse's compiler (ECJ) compiles it without complaint, generating > * bytecode that violates the semantics of final fields. > */ >public class ShouldNotCompile { > final int contents; > > ShouldNotCompile() { > contents = 3; > } > ShouldNotCompile(ShouldNotCompile other) { > other.contents = 5; > } > > public static void main(String[] args) { > ShouldNotCompile one = new ShouldNotCompile(); > System.out.println("one.contents: " + one.contents); > ShouldNotCompile two = new ShouldNotCompile(one); > System.out.println("one.contents: " + one.contents); > System.out.println("two.contents: " + two.contents); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 190391
: 69648