Groovy with Jigsaw

Jochen Theodorou blackdrag at gmx.org
Fri Sep 11 09:46:25 UTC 2015


Am 11.09.2015 11:33, schrieb Alan Bateman:
>
> On 11/09/2015 10:21, Jochen Theodorou wrote:
>>
>> the error in Guava is not a failed attempt, it is a VerifyError,
>> because AccessibleObject#setAccessible is now final and
>> com.google.common.reflect.Element overrides the method.
>>
>> As far as I have seen Guava makes a parallel reflective structure of a
>> class to be able to better handle them. A the same time they proxy to
>> their counter parts, but do also implement interfaces like Member.
>> That requires for example to override setAccessible, which will just
>> make the same call on the delegate. I don't see how they can easily
>> fix that without giving up their mirror structure and have it
>> exchangeable with the java reflective classes at the same time. But I
>> am not on the guava team, so they know hopefully better
> Okay, I mis-read one of the mails and assumed that setAccessible was
> failing and leading to other errors.

It does fail for any Groovy script, that invokes any method on an 
Object, that has a declaring class, which is made inaccessible through 
the module system, due to the new exception being thrown. Example:

ClassLoader.getSystemClassLoader().toString()

> In the current builds then setAccessible is final, and yes, this is an
> incompatible change. The reason for this is that the method is now @CS.
> I think we need to consider changing this so that setAccessible is
> overridden in the final Field, Constructor, and Method classes instead.

Does @CS then mean guava will then possibly interfere with the security 
manager logic, since it introduces a new layer of calling code in between?

bye Jochen

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



More information about the jigsaw-dev mailing list