[7u40] Review request for CR 8014925: Disable sun.reflect.Reflection.getCallerClass(int) with a temporary switch to re-enable it

Mandy Chung mandy.chung at oracle.com
Tue Jun 18 22:58:25 PDT 2013


Alan, Chris,

Can you review the fix for
[1] 8014925: Disable sun.reflect.Reflection.getCallerClass(int) with a 
temporary switch to re-enable it
[2] 8016814: sun.reflect.Reflection.getCallerClass returns the wrong 
stack frame

Webrev at:
    http://cr.openjdk.java.net/~mchung/jdk7u/8014925/webrev.00/

This will disable sun.reflect.Reflection.getCallerClass(int) by default 
and throw an UnsupportedOperationException.   This method is in the 
sun.* namespace.  Such methods are not a supported, public interface 
[3].  This method has been removed in JDK8 and will be removed in a 
future 7 update release.  Existing code depending on this private API 
will need to updated properly to work on future 7 update releases.  As a 
temporary measure, a system property "jdk.reflect.allowGetCallerClass" 
is provided to reenable the previous behavior.

This also fixes a regression introduced in 7u25 in which 
getCallerClass(int) is now a Java method that adds an additional frame 
that wasn't taken into account.

Once the code review is approved, I'll proceed with the Phase2 Push 
Approval Request.

Thanks
Mandy
[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925
[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8016814
[3] http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html



More information about the jdk7u-dev mailing list