On 06/13/2015 06:36 PM, Cédric Champeau wrote:
I am currently investigating building Groovy on the latest JDK 9 b66. First of all, I am making the changes on master, which means that only Groovy 2.5 will officially support JDK 9, does it sound ok for you guys?

First of all, I had to change some signatures in DGM for the JDK 9 generics type checker to be happy. I think those changes make sense, and probably the checker in previous versions of the JDK wasn't strict enough: https://github.com/apache/incubator-groovy/commit/83d680877c44072c46bdf2212303398ac3b1276e

I also changed the Gradle wrapper to use a snapshot version of Gradle 2.6, which fixes JDK 9 compatibility. This is also only done on master.

Now I have only one test currently failing:

 org.codehaus.groovy.ClosureAndInnerClassNodeStructureTest#testGetSimpleName

assert simpleNames == ['_foo_closure1', '_closure2']
       |           |
       [, ]        false

This looks like a pretty serious issue. Even if the error comes from our side, which is unsure at this point, there's a breaking change in the way the JDK returns the simple name of a class, and it directly impacts our closures. If we changed the way we generate closure class names, it could potentially fix the issue (not tested), but it would be both a breaking change for Groovy, and wouldn't solve the fact that closure classes compiled with earlier versions of the Groovy compiler wouldn't return a correct simple name under JDK 9.

getSimpleName() now uses the InnerClasses attribute instead of parsing the class name which was dubious:
http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-April/032733.html

This is a follow up of a bug raised by Jochen:
  https://bugs.openjdk.java.net/browse/JDK-8057919


Cédric

Rémi

Reply via email to