Groovy with Jigsaw

Remi Forax forax at univ-mlv.fr
Fri Sep 11 12:50:00 UTC 2015


Jochen,
@CS == @CallerSensitive which means that setAccessible may throw an error depending where you call (from which class).

Given that in Guava, setAccessible is called inside the Guava code,
then this guava code may now fail and throw an exception.

Rémi


----- Mail original -----
> De: "Jochen Theodorou" <blackdrag at gmx.org>
> À: "Alan Bateman" <Alan.Bateman at oracle.com>, "Cédric Champeau" <cedric.champeau at gmail.com>
> Cc: jigsaw-dev at openjdk.java.net
> Envoyé: Vendredi 11 Septembre 2015 11:46:25
> Objet: Re: Groovy with Jigsaw
> 
> 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