RFR [11] JDK-8179424: Remove terminally deprecated sun.reflect.Reflection.getCallerClass

Chris Hegarty chris.hegarty at oracle.com
Thu Dec 21 12:39:44 UTC 2017

> On 21 Dec 2017, at 12:33, David Holmes <david.holmes at oracle.com> wrote:
> ...
>> The test is about identifying StackWalker as the replacement
>> supported API for getCallerClass, which is continues to do.
> Won't pretend I actually understand that, but as long as the test works reliably then okay.

Jdeps prints helpful messages when it encounters usage of certain
common internal APIs, e.g. "I see your are using
sun.reflect.Reflection.getCallerClass(int). This is an internal API which
has been replaced by java.lang.StackWalker. You may wanna update
your code to use that API instead”.

For example,


More information about the core-libs-dev mailing list