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,
 http://hg.openjdk.java.net/jdk/jdk/file/tip/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties#l16

-Chris.


More information about the hotspot-runtime-dev mailing list