Re: Defining anonymous classes

2014-09-05 Thread Remi Forax
On 08/14/2014 12:52 PM, Florian Weimer wrote: Is there an end-user accessible way of defining anonymous classes (by which I mean classes which are kept alive only by explicit references or their instances, and not their class loader)? Searching for the term anonymous classes isn't

Re: Defining anonymous classes

2014-08-25 Thread Charles Oliver Nutter
On Fri, Aug 15, 2014 at 5:39 PM, John Rose john.r.r...@oracle.com wrote: If the host-class token were changed to a MethodHandles.Lookup object, we could restrict the host-class to be one which the user already had appropriate access to. Seems simple, but of course the rest of the project

Re: Defining anonymous classes

2014-08-17 Thread Florian Weimer
On 08/16/2014 12:39 AM, John Rose wrote: Do you have a use case in mind that could be expressed as a more tightly focused API? My use-case is run-time class generation and avoiding unnecessary retention of classes which are referred to by the generated class. I do not need constant pool

Re: Defining anonymous classes

2014-08-17 Thread Remi Forax
On 08/17/2014 12:55 PM, Florian Weimer wrote: On 08/16/2014 12:39 AM, John Rose wrote: Do you have a use case in mind that could be expressed as a more tightly focused API? My use-case is run-time class generation and avoiding unnecessary retention of classes which are referred to by the

Re: Defining anonymous classes

2014-08-16 Thread Remi Forax
On 08/16/2014 12:39 AM, John Rose wrote: On Aug 15, 2014, at 5:03 AM, Florian Weimer fwei...@redhat.com wrote: On 08/14/2014 10:15 PM, Mark Roos wrote: Look into sun.Misc.Unsafe [and at defineAnonymousClass(Class, byte[], Object[])] Thanks. Could we turn this into a supported API, with a

Re: Defining anonymous classes

2014-08-15 Thread Florian Weimer
On 08/14/2014 10:15 PM, Mark Roos wrote: Look into sun.Misc.Unsafe [and at defineAnonymousClass(Class, byte[], Object[])] Thanks. Could we turn this into a supported API, with a suitable security manager check? I'm surprised there aren't any callers of this method in Fedora. Anonymous

Re: Defining anonymous classes

2014-08-15 Thread Mark Roos
The Java folks will have to answer this, but I have heard that there are thoughts on how to make unsafe safe and portable. You might ask on the jigsaw list. -Mark On Aug 15, 2014, at 5:03 AM, Florian Weimer fwei...@redhat.com wrote: On 08/14/2014 10:15 PM, Mark Roos wrote: Look into

Re: Defining anonymous classes

2014-08-15 Thread John Rose
On Aug 15, 2014, at 5:03 AM, Florian Weimer fwei...@redhat.com wrote: On 08/14/2014 10:15 PM, Mark Roos wrote: Look into sun.Misc.Unsafe [and at defineAnonymousClass(Class, byte[], Object[])] Thanks. Could we turn this into a supported API, with a suitable security manager check? Hi

Defining anonymous classes

2014-08-14 Thread Florian Weimer
Is there an end-user accessible way of defining anonymous classes (by which I mean classes which are kept alive only by explicit references or their instances, and not their class loader)? Searching for the term anonymous classes isn't particularly revealing due to the Java-level language

Re: Defining anonymous classes

2014-08-14 Thread Mark Roos
Is there an end-user accessible way of defining anonymous classes (by which I mean classes which are kept alive only by explicit references or their instances, and not their class loader)? Searching for the term anonymous classes isn't particularly revealing