On Oct 14, 2015, at 3:38 AM, Remi Forax wrote:
>
> Given that j.l.r.Method is mutable, the best way to have performance is too
> encapsulate it in a non mutable class, if possible.
OK, I'll bite. Here's a way to make Method its own non-mutable encapsulation,
a la List::set or (future feature)
bs-dev [mailto:core-libs-dev-boun...@openjdk.java.net] On
> Behalf Of Kasper Nielsen
> Sent: Wednesday, October 14, 2015 12:02 PM
> To: core-libs-dev
> Subject: java.lang.reflect.Method.copyOf
>
> Hi,
>
> I was wondering if there is any reason for Method.copyOf (and fr
Thanks Paul and Chris,
very interesting indeed.
regards,
Rémi
- Mail original -
> De: "Chris Hegarty"
> À: "Remi Forax"
> Cc: "Paul Sandoz" , "core-libs-dev"
>
> Envoyé: Mercredi 14 Octobre 2015 16:29:15
> Objet: Re: java.lang
On 14 Oct 2015, at 15:15, Remi Forax wrote:
> - Mail original -
>> De: "Paul Sandoz"
>> Cc: "core-libs-dev"
>> Envoyé: Mercredi 14 Octobre 2015 13:46:38
>> Objet: Re: java.lang.reflect.Method.copyOf
>>
>>
>>&
> On 14 Oct 2015, at 16:15, Remi Forax wrote:
>
> - Mail original -
>> De: "Paul Sandoz"
>> Cc: "core-libs-dev"
>> Envoyé: Mercredi 14 Octobre 2015 13:46:38
>> Objet: Re: java.lang.reflect.Method.copyOf
>>
>>
>
- Mail original -
> De: "Paul Sandoz"
> Cc: "core-libs-dev"
> Envoyé: Mercredi 14 Octobre 2015 13:46:38
> Objet: Re: java.lang.reflect.Method.copyOf
>
>
> > On 14 Oct 2015, at 12:38, Remi Forax wrote:
> >
> > Given that j.l.r.Me
> On 14 Oct 2015, at 12:38, Remi Forax wrote:
>
> Given that j.l.r.Method is mutable, the best way to have performance is too
> encapsulate it in a non mutable class, if possible.
>
> As far as i know j.l.r.Method was introduced in Java 1.1 as non mutable and
> become mutable with Java 1.2, (
were introduced to do defensive copies (the sharing
mechanism was later introduced, in 1.4, i believe).
cheers,
Rémi
- Mail original -
> De: "Kasper Nielsen"
> À: "core-libs-dev"
> Envoyé: Mercredi 14 Octobre 2015 12:02:01
> Objet: java.lang.reflect.M
Hi,
I was wondering if there is any reason for Method.copyOf (and friends)
being package private.
I'm trying to make a copy of a large number of Method objects in some
performance sensitive code to avoid sharing the isAccessible flag.
And while this is fairly fast.
Class declaringClass = method