Re: ClassFileTransformer does not apply to anonymous classes

2016-01-27 Thread Rafael Winterhalter
Hi John, thank you for your answer. As I said before, I do understand the concept behind resolving lambda expressions at runtime to not represent "real classes". I do however still disagree with your assertion. On the opposite, I argue that the fact that nobody can expect a certain form of impleme

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread John Rose
VM anonymous classes are an implementation detail that is opaque to system components except for the lowest layers of the JDK runtime and the JVM itself. Transformers and other instrumentation should not look inside them expecting to interpose on their behavior. Ideally we should not make them vi

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread Rafael Winterhalter
>> Slightly off-topic, about ASM, when you create a ClassWriter [1], you >>> can pass a ClassReader of an existing class, in that case ASM copy the >>> constant pool from the class reader to the class writer so the constant >>> pool is preserved. >>> >&

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread Rafael Winterhalter
ot;Rafael Winterhalter" >> À: "Rémi Forax" >> Cc: "Vladimir Ivanov" , "Coleen Phillimore" >> , >> core-libs-dev@openjdk.java.net, "serguei.spit...@oracle.com Spitsyn" >> , "Daniel >> Daugherty" >>

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread Vladimir Ivanov
t%29 - Mail original - De: "Vladimir Ivanov" À: "Rafael Winterhalter" Cc: "Coleen Phillimore" , core-libs-dev@openjdk.java.net, "serguei.spit...@oracle.com Spitsyn" , "Daniel Daugherty" Envoyé: Vendredi 22 Janvier 2016 18:47:31 Objet: Re:

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread forax
t; > Cc: "Vladimir Ivanov" , "Coleen Phillimore" > , > core-libs-dev@openjdk.java.net, "serguei.spit...@oracle.com Spitsyn" > , "Daniel > Daugherty" > Envoyé: Mardi 26 Janvier 2016 10:30:54 > Objet: Re: ClassFileTransformer does not apply to

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread Rafael Winterhalter
Winterhalter" >> À: "Remi Forax" >> Cc: "Vladimir Ivanov" , "Coleen Phillimore" >> , >> core-libs-dev@openjdk.java.net, "serguei.spit...@oracle.com Spitsyn" >> , "Daniel >> Daugherty" >> Envoyé: L

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread forax
Daniel > Daugherty" > Envoyé: Lundi 25 Janvier 2016 20:24:01 > Objet: Re: ClassFileTransformer does not apply to anonymous classes > > Hi Vladmir, hello Remi, > > what bothers me about instrumenting a lambda expression's target > method is the difficulty of locating the me

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread Andrew Dinn
On 26/01/16 08:39, Rafael Winterhalter wrote: > Another note on this subject: I found that applying a > reretransformation on a lambda expression's class does not provide the > original class file to the retransformer but the class file that > resulted from a previous retransformation. (If a lambda

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-26 Thread Rafael Winterhalter
sm.ClassReader,%20int%29 >> >> - Mail original ----- >>> De: "Vladimir Ivanov" >>> À: "Rafael Winterhalter" >>> Cc: "Coleen Phillimore" , >>> core-libs-dev@openjdk.java.net, "serguei.spit...@oracle.com >&g

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-25 Thread Rafael Winterhalter
er" >> Cc: "Coleen Phillimore" , >> core-libs-dev@openjdk.java.net, "serguei.spit...@oracle.com >> Spitsyn" , "Daniel Daugherty" >> >> Envoyé: Vendredi 22 Janvier 2016 18:47:31 >> Objet: Re: ClassFileTransformer does not apply to anon

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-23 Thread Remi Forax
De: "Vladimir Ivanov" > À: "Rafael Winterhalter" > Cc: "Coleen Phillimore" , > core-libs-dev@openjdk.java.net, "serguei.spit...@oracle.com > Spitsyn" , "Daniel Daugherty" > > Envoyé: Vendredi 22 Janvier 2016 18:47:31 > Objet

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Vladimir Ivanov
Rafael, First of all, I'd like to agree on the terminology. There's some confusion there. Anonymous term is ambiguous in Java. There are anonymous classes on language level and there's Unsafe.defineAnonymousClass() which produce anonymous-in-VM-sense classes. I prefer to call them VM anonymou

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Rafael Winterhalter
Hi Vladimir, thank you for your response. While I completely understand your view from a VM implementor's point of view, as a practicioner I would recommend against it. Not being able to instrument lambda expressions puts a severe limitation onto using the instrumentation API alltogether. For exam

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Vladimir Ivanov
Rafael, What you are seeing are just consequences. My impression is that VM anonymous class redefinition/retransformation works mostly by accident. The real problem is that current API (both JVMTI and java.lang.instrument) doesn't serve for them well. When VM anonymous class is defined, a u

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Rafael Winterhalter
You are right. It is observed for all JDK8u releases and persists in the current builds of JDK9. Best regards, Rafael 2016-01-22 16:15 GMT+01:00 Daniel D. Daugherty : > On 1/22/16 7:29 AM, Alan Bateman wrote: >> >> >> On 22/01/2016 14:00, Coleen Phillimore wrote: >>> >>> Can you send the question

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Daniel D. Daugherty
On 1/22/16 7:29 AM, Alan Bateman wrote: On 22/01/2016 14:00, Coleen Phillimore wrote: Can you send the question again? I didn't see it. I also mostly look at JVM code and rarely deal with the Java side. The question was asked about ClassFileTransformer which is implemented by the JPLIS age

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Alan Bateman
On 22/01/2016 14:00, Coleen Phillimore wrote: Can you send the question again? I didn't see it. I also mostly look at JVM code and rarely deal with the Java side. The question was asked about ClassFileTransformer which is implemented by the JPLIS agent via the JVM TI CFLH event. So I think

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Rafael Winterhalter
Hi Coleen, thanks for looking into this. My original mail was the following: Hello everybody, classes that are loaded via Unsafe::defineAnonymousClass are not transformed by a registered ClassFileTransformer. At the same time, it is possible to retransform / redefine such an anonymous classes usi

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Coleen Phillimore
On 1/22/16 4:11 AM, Andrew Dinn wrote: On 21/01/16 22:14, Rafael Winterhalter wrote: Hi Andrew, if there is any update on the matter, I would of course love to hear about it. Unfortunately, I never received an answer to my question, but maybe I picked the wrong list. Thank you for your support

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-22 Thread Andrew Dinn
On 21/01/16 22:14, Rafael Winterhalter wrote: > Hi Andrew, > if there is any update on the matter, I would of course love to hear about it. > Unfortunately, I never received an answer to my question, but maybe I > picked the wrong list. > Thank you for your support on this issue! I'm pretty sure t

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-21 Thread Rafael Winterhalter
Hi Andrew, if there is any update on the matter, I would of course love to hear about it. Unfortunately, I never received an answer to my question, but maybe I picked the wrong list. Thank you for your support on this issue! Regards, Rafael 2016-01-21 10:07 GMT+01:00 Andrew Dinn : > Hi Rafael, > >

Re: ClassFileTransformer does not apply to anonymous classes

2016-01-21 Thread Andrew Dinn
Hi Rafael, On 01/12/15 12:45, Rafael Winterhalter wrote: > I can tell that this behavior has not only affected me as I had this > question comming up by multiple users of my open-source code generation > library. > > What is your view on this? > > Thank you for your feedback! I have an interest

ClassFileTransformer does not apply to anonymous classes

2015-12-01 Thread Rafael Winterhalter
Hello everybody, classes that are loaded via Unsafe::defineAnonymousClass are not transformed by a registered ClassFileTransformer. At the same time, it is possible to retransform / redefine such an anonymous classes using the instrumentation API. Here is a rather confusing bug that I encountered