On 17/10/2017 1:03 AM, Thomas Stüfe wrote:
Hi David,
On Mon, Oct 16, 2017 at 1:20 PM, David Holmes <david.hol...@oracle.com
<mailto:david.hol...@oracle.com>> wrote:
Hi Thomas,
On 16/10/2017 8:40 PM, Thomas Stüfe wrote:
Hi all,
just a small question.
While examining a crash in jvmti_GetClassMethods (jdk9) I
noticed that I am able to successfully add and remove methods in
a redefined class.
But JEP159 is still only in "submitted" stage. Was this feature
added for another JEP?
According to the spec, you are not allowed to add/remove methods.
How did you add/remove them?
https://docs.oracle.com/javase/9/docs/specs/jvmti.html#RedefineClasses
<https://docs.oracle.com/javase/9/docs/specs/jvmti.html#RedefineClasses>
David
-----
I used jdb (redefine). I found that add/remove method worked for private
methods, but not for public ones, so that explains it. I was examining a
bug which now turned out to be a regression of
https://bugs.openjdk.java.net/browse/JDK-8149743 - only in my case it
was not a lambda method but just an ordinary private method.
Sorry for the noise.
It isn't noise. The spec prohibits adding/removing methods - period! It
doesn't make an exception for private methods (even if it may seem
reasonable to do so).
David
Thomas
Thank you!
Kind Regards, Thomas