Re: RFR: JDK-8328137: PreserveAllAnnotations can cause failure of class retransformation

2024-04-02 Thread Alex Menkov
On Tue, 2 Apr 2024 19:13:15 GMT, Coleen Phillimore wrote: > At one point long ago, I was trying to understand why we have > PreserveAllAnnotations and couldn't come up with a reason. For a class file > reconstitutor, restoring the invisible annotations to the classfile and then > feeding it ba

Re: RFR: JDK-8328137: PreserveAllAnnotations can cause failure of class retransformation

2024-04-02 Thread Serguei Spitsyn
On Thu, 28 Mar 2024 22:12:49 GMT, Alex Menkov wrote: > PreserveAllAnnotations option causes class file parser to preserve > RuntimeInvisibleAnnotations so VM considers them as RuntimeVisibleAnnotations. > For class retransformation JvmtiClassFileReconstituter restores all > annotations as Runti

Re: RFR: JDK-8328137: PreserveAllAnnotations can cause failure of class retransformation

2024-04-02 Thread Coleen Phillimore
On Thu, 28 Mar 2024 22:12:49 GMT, Alex Menkov wrote: > PreserveAllAnnotations option causes class file parser to preserve > RuntimeInvisibleAnnotations so VM considers them as RuntimeVisibleAnnotations. > For class retransformation JvmtiClassFileReconstituter restores all > annotations as Runti

Re: RFR: JDK-8328137: PreserveAllAnnotations can cause failure of class retransformation

2024-03-29 Thread Serguei Spitsyn
On Thu, 28 Mar 2024 22:12:49 GMT, Alex Menkov wrote: > PreserveAllAnnotations option causes class file parser to preserve > RuntimeInvisibleAnnotations so VM considers them as RuntimeVisibleAnnotations. > For class retransformation JvmtiClassFileReconstituter restores all > annotations as Runti

Re: RFR: JDK-8328137: PreserveAllAnnotations can cause failure of class retransformation

2024-03-29 Thread Alex Menkov
On Fri, 29 Mar 2024 07:08:58 GMT, Serguei Spitsyn wrote: > > Correct solution would be to store additional information about > > RuntimeInvisibleAnnotations and restore them exactly as they were in the > > original class (this should be done for all annotations: > > RuntimeInvisibleAnnotations

Re: RFR: JDK-8328137: PreserveAllAnnotations can cause failure of class retransformation

2024-03-29 Thread Serguei Spitsyn
On Thu, 28 Mar 2024 22:12:49 GMT, Alex Menkov wrote: > Correct solution would be to store additional information about > RuntimeInvisibleAnnotations and restore them exactly as they were in the > original class (this should be done for all annotations: > RuntimeInvisibleAnnotations/RuntimeInvi

RFR: JDK-8328137: PreserveAllAnnotations can cause failure of class retransformation

2024-03-28 Thread Alex Menkov
PreserveAllAnnotations option causes class file parser to preserve RuntimeInvisibleAnnotations so VM considers them as RuntimeVisibleAnnotations. For class retransformation JvmtiClassFileReconstituter restores all annotations as RuntimeVisibleAnnotations attributes. This can cause problem is the