projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.83k stars 2.37k forks source link

Discrepancy for 'val' between javac and ecj. #489

Open lombokissues opened 9 years ago

lombokissues commented 9 years ago

Migrated from Google Code (issue 416)

lombokissues commented 9 years ago

:bust_in_silhouette: reinierz   :clock8: Sep 17, 2012 at 14:10 UTC

Map<String, Number> m = Collections.emptyMap();

val foo = randomBoolean ? m : Collections.<String, Number>emptyMap();

The above works in ecj, but not in javac.

lombokissues commented 9 years ago

:bust_in_silhouette: reinierz   :clock8: Oct 29, 2012 at 22:17 UTC

Crud - we can't reproduce this at all. I guess it takes more than just the above sample code to trigger this bug because I can pretty specifically recall it happened.

At any rate, the above snippet has been introduced as testcase 'ValLub.java'. We'll have to keep an eye out and, next time, put more effort into double-checking the smallest snippet that is (supposed to!) be the minimum code for reproducing it.

lombokissues commented 9 years ago

End of migration

btiernay commented 8 years ago

Question, for such issues do we know if there is a difference with javac and javax.tools.JavaCompiler? The later is what maven-compiler-plugin uses when fork is set to the default of false.