java.lang.reflect.Method.copyOf (original) (raw)
Kasper Nielsen kasperni at gmail.com
Wed Oct 14 10:02:01 UTC 2015
- Previous message: RFR:8134928:java.time.Instant.truncatedTo(TemporalUnit unit) is truncating up if the year < 1970
- Next message: java.lang.reflect.Method.copyOf
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.getDeclaringClass(); try { return declaringClass.getDeclaredMethod(method.getName(), method.getParameterTypes()); } catch (NoSuchMethodException e) { throw new RuntimeException("This should never happen", e); }
I would to like to avoid the performance penalty if possible.
- Kasper
- Previous message: RFR:8134928:java.time.Instant.truncatedTo(TemporalUnit unit) is truncating up if the year < 1970
- Next message: java.lang.reflect.Method.copyOf
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]