groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C├ędric Champeau <cedric.champ...@gmail.com>
Subject Re: Regression in JDK 9?
Date Sun, 14 Jun 2015 14:54:27 GMT
2015-06-14 8:31 GMT+02:00 Jochen Theodorou <blackdrag@gmx.org>:

> Am 13.06.2015 21:41, schrieb Remi Forax:
> [...]
>
>> 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
>>
>
> I think the part we did not realize is that getSimpleName is supposed to
> return an empty string for anonymous inner classes.
>
> So frankly I see no JDK bug here and we have to fix our test.
>
>
I don't feel it is as easy as fixing a test. First of all, our closure
generated classes are *not* anonymous. ClosureWriter doesn't generate
anonymous classes, and we can verify it easily:

def cl = { -> '' }
assert cl.class.anonymousClass == false

Second, it is a problem for backwards compatibility. Any code relying today
on Class<Closure>#getSimpleName will start failing on JDK 9. Granted it
might not be a lot of code, but there's no way to prevent it from happening.


> bye blackdrag
>
> --
> Jochen "blackdrag" Theodorou
> blog: http://blackdragsview.blogspot.com/
>
>

Mime
View raw message