java.lang.IncompatibleClassChangeError - Groovy issue with JDK 8

Rory O'Donnell Oracle, Dublin Ireland rory.odonnell at
Thu Jan 9 09:47:08 PST 2014

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 
> The issue can be reproduce by using a indy enabled version of Groovy 
> and invoking the test case in the comment here: 
> 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 
> and GString 
> 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

Rgds,Rory O'Donnell
Quality Engineering Manager
Oracle EMEA , Dublin, Ireland

More information about the lambda-dev mailing list