Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.7.3
-
None
Description
the following blocks of code cause a NoSuchFieldError at runtime in the transformed class due to failure to look up a constant:
new AstBuilder.buildFromCode
{ return 1 }new AstBuilder.buildFromCode
{ return 1.0 }new AstBuilder.buildFromString("return 1")
I've attached an example and the test that shows the failure.
The current workaround is to use the String constructor of their java.lang.Number equivalents:
new AstBuilder.buildFromCode
{ return new Integer("1") }new AstBuilder.buildFromCode
{ return new Double("1.0") }My suspicion is that the compiler is optimizing the inline constants away, but that the reference to those constants are in some intermediary generated class which is thrown away later instead of the intended target classes.