Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-18 Thread Rafael Winterhalter
As for the need to inject classes into 'new' packages, in Mockito we solve this easily by 'claiming' a package by defining a static dummy class within it which we then use as a hook for injection using a lookup. This works well for us, and I do of course not know the explicit requirements of others

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-18 Thread Alan Bateman
On 16/04/2021 21:09, Rafael Winterhalter wrote: I have never seen a need for a non-agent to define a class in a non-existing package. Injection is typically required if you want to work with package-private types or methods which is really only relevant for the Spring framework, but even there I

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes [v2]

2021-04-16 Thread Rafael Winterhalter
> To allow agents the definition of auxiliary classes, an API is needed to > allow this. Currently, this is often achieved by using `sun.misc.Unsafe` or > `jdk.internal.misc.Unsafe` ever since the `defineClass` method was removed > from `sun.misc.Unsafe`. Rafael Winterhalter has refreshed the c

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Rafael Winterhalter
I have never seen a need for a non-agent to define a class in a non-existing package. Injection is typically required if you want to work with package-private types or methods which is really only relevant for the Spring framework, but even there I do not think it's such a big area that it cannot b

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Rafael Winterhalter
On Fri, 16 Apr 2021 13:44:16 GMT, Rafael Winterhalter wrote: > To allow agents the definition of auxiliary classes, an API is needed to > allow this. Currently, this is often achieved by using `sun.misc.Unsafe` or > `jdk.internal.misc.Unsafe` ever since the `defineClass` method was removed >

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread forax
> De: "Rafael Winterhalter" > À: "Remi Forax" > Cc: "Rafael Winterhalter" , "core-libs-dev" > , "serviceability-dev" > > Envoyé: Vendredi 16 Avril 2021 18:41:26 > Objet: Re: RFR: 8200559: Java agents doing instrumentati

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Alan Bateman
On 16/04/2021 17:40, Rafael Winterhalter wrote: : I will try to make my case on the mailing list. I hoped this could get resolved within the release of Java 17 as this would make it possible to write agents without use of Unsafe API to support Java 17 and later. Since agents often are suppleme

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Rafael Winterhalter
gt; *Cc: *"Rafael Winterhalter" , > "core-libs-dev" , "serviceability-dev" < > serviceability-dev@openjdk.java.net> > *Envoyé: *Vendredi 16 Avril 2021 18:27:46 > *Objet: *Re: RFR: 8200559: Java agents doing instrumentation need a means > to defin

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Rafael Winterhalter
On Fri, 16 Apr 2021 13:44:16 GMT, Rafael Winterhalter wrote: > To allow agents the definition of auxiliary classes, an API is needed to > allow this. Currently, this is often achieved by using `sun.misc.Unsafe` or > `jdk.internal.misc.Unsafe` ever since the `defineClass` method was removed >

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread forax
> De: "Rafael Winterhalter" > À: "Remi Forax" > Cc: "Rafael Winterhalter" , "core-libs-dev" > , "serviceability-dev" > > Envoyé: Vendredi 16 Avril 2021 18:27:46 > Objet: Re: RFR: 8200559: Java agents doing instrumentation

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Rafael Winterhalter
nal - > > De: "Rafael Winterhalter" > > À: "core-libs-dev" , > "serviceability-dev" > > Envoyé: Vendredi 16 Avril 2021 15:52:07 > > Objet: RFR: 8200559: Java agents doing instrumentation need a means to > define auxilary classes > > &g

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Alan Bateman
On Fri, 16 Apr 2021 13:44:16 GMT, Rafael Winterhalter wrote: > To allow agents the definition of auxiliary classes, an API is needed to > allow this. Currently, this is often achieved by using `sun.misc.Unsafe` or > `jdk.internal.misc.Unsafe` ever since the `defineClass` method was removed >

Re: RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Remi Forax
- Mail original - > De: "Rafael Winterhalter" > À: "core-libs-dev" , "serviceability-dev" > > Envoyé: Vendredi 16 Avril 2021 15:52:07 > Objet: RFR: 8200559: Java agents doing instrumentation need a means to define > auxilary classe

RFR: 8200559: Java agents doing instrumentation need a means to define auxilary classes

2021-04-16 Thread Rafael Winterhalter
To allow agents the definition of auxiliary classes, an API is needed to allow this. Currently, this is often achieved by using `sun.misc.Unsafe` or `jdk.internal.misc.Unsafe` ever since the `defineClass` method was removed from `sun.misc.Unsafe`. - Commit messages: - 8200559: Jav