Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.0, 1.8.1
-
None
-
Mac - JDK 1.6.0_22
Description
Failing to put a public accessor on the 'name' field of the attached test object causes an error in the bytecode.
The exception is:
<error message="(class: com/peersaver/model/Breaking, method: <clinit> signature: ()V) Incompatible object argument for function call" type="java.lang.VerifyError">java.lang.VerifyError: (class: com/peersaver/model/Breaking, method: <clinit> signature: ()V) Incompatible object argument for function call
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.peersaver.model.BreakingTest.class$(BreakingTest.groovy)
at com.peersaver.model.BreakingTest.$get$$class$com$peersaver$model$Breaking(BreakingTest.groovy)
at com.peersaver.model.BreakingTest.testBreaking(BreakingTest.groovy:23)
</error>
The email conversation with details is here:
http://groovy.329449.n5.nabble.com/VerifyError-when-upgrading-to-Groovy-1-8-1-clinit-problem-around-getter-generation-td4640586.html
The relevant bit, again quoting BlackDragon:
(in the <clinit> bytecode)
"> ALOAD 0
> INVOKEVIRTUAL Quiz.getName() : String
> INVOKEINTERFACE CallSite.call(Object,Object) : Object
it is a pretty bad idea to do a virtual method call from a static
context. Looks like that information is missed on "