Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-06-01 Thread Joe Darcy
On 5/29/2021 12:20 AM, Jaroslav Tulach wrote: This PR exposes runtime invisible annotations via `Class.getAnnotation` when `-XX:+PreserveAllAnnotations` option is passed to the JVM. Existing `-XX:+PreserveAllAnnotations` option can be very useful for code that needs to access annotations with

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-06-01 Thread Jaroslav Tulach
On Mon, 31 May 2021 12:02:13 GMT, Peter Levart wrote: > A test could be constructed so that it would mimic the migration of an > annotation from CLASS to RUNTIME retention The test is ready for review in #4280 - I am closing this PR without integration as the change of core-libs proposed here

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 22:36:52 GMT, David Holmes wrote: > > OTOH when CLASS retention is changing to RUNTIME, such as in this case, the > > ways of looking up are widening (there is some new desire to lookup the > > annotation at runtime via reflection). To facilitate that, the annotation > > ma

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread David Holmes
On 1/06/2021 4:20 am, Peter Levart wrote: On Mon, 31 May 2021 12:37:55 GMT, David Holmes wrote: That reads backwards to me. +PreserveAllAnnotations means that CLASS retention annotations are retained by the VM not just RUNTIME ones. So in that sense it might be a migration aid if moving from R

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 12:37:55 GMT, David Holmes wrote: > That reads backwards to me. +PreserveAllAnnotations means that CLASS > retention annotations are retained by the VM not just RUNTIME ones. So > in that sense it might be a migration aid if moving from RUNTIME to > CLASS, not CLASS to RUNTIME

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 12:37:55 GMT, David Holmes wrote: > > Hi Jaroslav, > > If you change `@JavaScriptBody` retention to `RUNTIME`, you don't need to > > re-compile any code that uses this annotation. You just have to use > > `-XX:+PreserveAllAnnotations` to expose all anotations to JVM and >

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-31 Thread David Holmes
On 31/05/2021 8:29 pm, Peter Levart wrote: On Sun, 30 May 2021 20:06:49 GMT, Jaroslav Tulach wrote: My use-case relates to [@JavaScriptBody](https://bits.netbeans.org/html+java/1.7.1/net/java/html/js/package-summary.html) annotation used for Java/JavaScript interop. Originally all existing

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-31 Thread Peter Levart
On Sun, 30 May 2021 20:06:49 GMT, Jaroslav Tulach wrote: > My use-case relates to > [@JavaScriptBody](https://bits.netbeans.org/html+java/1.7.1/net/java/html/js/package-summary.html) > annotation used for Java/JavaScript interop. Originally all existing usages > (Post Processing Classes, Inst

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Doug Simon
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-31 Thread Alan Bateman
On Sun, 30 May 2021 20:06:49 GMT, Jaroslav Tulach wrote: > Obvious suggestion is to change the `@JavaScriptBody` retention to `RUNTIME` > - however there are plenty of libraries already compiled with the existing > annotation and they would have to be all recompiled to new version. I'd > rath

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-30 Thread David Holmes
On 31/05/2021 4:11 pm, Jaroslav Tulach wrote: On Sun, 30 May 2021 23:03:55 GMT, David Holmes wrote: But we should add in some tests. Right, I was surprised by missing tests as well. I've just created a _"standalone"_ commit 0f689ea that adds such test and also shows the way I am currently

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-30 Thread Jaroslav Tulach
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-30 Thread Jaroslav Tulach
On Sun, 30 May 2021 23:03:55 GMT, David Holmes wrote: > But we should add in some tests. Right, I was surprised by missing tests as well. I've just created a _"standalone"_ commit 0f689ea that adds such test and also shows the way I am currently using the `-XX:+PreserveAllAnnotations` flag. I

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-30 Thread Jaroslav Tulach
> This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to access annotations with `RetentionPolicy.CLASS` without the >

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v3]

2021-05-30 Thread Jaroslav Tulach
> This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to access annotations with `RetentionPolicy.CLASS` without the >

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-30 Thread David Holmes
On 31/05/2021 4:44 am, Alan Bateman wrote: On Fri, 28 May 2021 12:56:39 GMT, Jaroslav Tulach wrote: This PR exposes runtime invisible annotations via `Class.getAnnotation` when `-XX:+PreserveAllAnnotations` option is passed to the JVM. Existing `-XX:+PreserveAllAnnotations` option can be ve

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-30 Thread David Holmes
On Sun, 30 May 2021 19:56:52 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-30 Thread Jaroslav Tulach
On Sun, 30 May 2021 19:56:52 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-30 Thread Jaroslav Tulach
> This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to access annotations with `RetentionPolicy.CLASS` without the >

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-30 Thread Alan Bateman
On Fri, 28 May 2021 12:56:39 GMT, Jaroslav Tulach wrote: > This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to ac

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-30 Thread Alan Bateman
On Fri, 28 May 2021 12:56:39 GMT, Jaroslav Tulach wrote: > This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to ac

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-29 Thread Jaroslav Tulach
On Fri, 28 May 2021 12:56:39 GMT, Jaroslav Tulach wrote: > This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to ac

RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-29 Thread Jaroslav Tulach
This PR exposes runtime invisible annotations via `Class.getAnnotation` when `-XX:+PreserveAllAnnotations` option is passed to the JVM. Existing `-XX:+PreserveAllAnnotations` option can be very useful for code that needs to access annotations with `RetentionPolicy.CLASS` without the need to par