java.lang.IncompatibleClassChangeError - Groovy issue with JDK 8

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Fri Jan 10 08:14:43 PST 2014


FYI, filed JDK-8031502 [1].

Best regards,
Vladimir Ivanov

[1] https://bugs.openjdk.java.net/browse/JDK-8031502

On 1/9/14 10:09 PM, Vladimir Ivanov wrote:
> Jochen,
>
> Thanks for the detailed bug report.
>
> Looks like a JDK bug during LamdaForm compilation to bytecode.
> Will try to reproduce it and file a bug.
>
> Best regards,
> Vladimir Ivanov
>
> PS: mlvm-dev at openjdk.java.net or core-libs-dev at openjdk.java.net are the
> best places to report issues or ask questions about JSR292.
>
> On 1/9/14 9:47 PM, Rory O'Donnell Oracle, Dublin Ireland wrote:
>> Hi Jochen,
>>
>> CC'ing the lambda-dev mailing list , best place to discuss.
>>
>> Rgds, Rory
>>
>> On 09/01/2014 16:04, Jochen Theodorou wrote:
>>> Am 27.12.2013 14:13, schrieb Rory O'Donnell Oracle, Dublin Ireland:
>>>>
>>>
>>> Hi Rory
>>>
>>> it seems we are suffering a bug for compiled lambda forms in jdk8 for
>>> at least b116 to b121. The compiled lambda form seems to produce an
>>> incompatible class change error
>>>
>>> We came to it from the bug report
>>> http://jira.codehaus.org/browse/GROOVY-6449
>>>
>>> The issue can be reproduce by using a indy enabled version of Groovy
>>> and invoking the test case in the comment here:
>>> http://jira.codehaus.org/browse/GROOVY-6449?focusedCommentId=338313&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-338313
>>>
>>> The key point here is that "${new Date()}".toString() fails on
>>> invocation number 31. This will create a GStringImpl instance and call
>>> toString on it. GStringImpl extend GString, which defines the toString
>>> method. GString also implements CharSequence, which (untypically for
>>> an interface) defines an abstract toString method. No default method,
>>> just an ordinary interface method.
>>>
>>> For reference GStringImpl
>>> https://github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/runtime/GStringImpl.java
>>>
>>> and GString
>>> https://github.com/groovy/groovy-core/blob/master/src/main/groovy/lang/GString.java
>>>
>>>
>>> Through debugging and other thigs we found out, that after 30
>>> invocations the JVM seems to try to invoke CharSequence#toString
>>> instead of the implementation.  since the error is
>>> "java.lang.IncompatibleClassChangeError: Found interface
>>> java.lang.CharSequence, but class was expected" we can safely assume
>>> that it is about runtime generated bytecode. Now I know we don't
>>> generate code at that point anymore. I also know the lambda form
>>> compilation threshold is 30. So if it on invocation number 31, I
>>> conclude a strong hint for a bug in lambda form runtime compilation
>>>
>>> What do you suggest on how to proceed?
>>>
>>> bye Jochen
>>
>


More information about the lambda-dev mailing list