Review Request for 8025799: Restore sun.reflect.Reflection.getCallerClass(int)
Mandy Chung
mandy.chung at oracle.com
Tue Oct 8 00:44:18 UTC 2013
On 10/7/2013 11:34 AM, Christian Thalinger wrote:
> Unfortunate but I understand. It might be a good idea to add a getCallerClass(-1) call to the test case.
The VM should throw an exception if JVM_GetCallerClass is called by any
method other than Reflection.getCallerClass(). It's a good idea to add
such test case.
thanks
Mandy
> On Oct 7, 2013, at 1:24 AM, Mandy Chung <mandy.chung at oracle.com> wrote:
>
>> JDK 8 was feature complete in June and there just isn't sufficient time remaining to get agreement and feedback on an API to examine the caller frames. To that end, I propose to restore the old unsupported Reflection.getCallerClass(int) and that we will look to define a standard API for JDK 9.
>>
>> Webrev at:
>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/8025799/
>>
>> It remains to be an unsupported API and JDK should not use this method and it's not annotated with @CallerSensitive. I considered detecting if this method is called by a system class (loaded by null loader) and throw an error. I decided to minimize the compatibility risk in case if there is any existing code added to the bootclasspath depending on this private API.
>>
>> Thanks
>> Mandy
More information about the core-libs-dev
mailing list