On 6/18/2013 11:12 PM, Jeroen Frijters wrote:
Hi Mandy,
Part of the exception message is a bit confusing:
"Update code properly using this method to allow the code"
Thanks Jeroen. I should strike out "using this method". What about:
"Update code properly to allow the code to work on future 7 update
releases."
Mandy
Otherwise the change looks good (I'm not an official reviewer).
Regards,
Jeroen
-----Original Message-----
From: jdk7u-dev-boun...@openjdk.java.net [mailto:jdk7u-dev-
boun...@openjdk.java.net] On Behalf Of Mandy Chung
Sent: Wednesday, June 19, 2013 7:58
To: jdk7u-dev@openjdk.java.net; Alan Bateman; Christian Thalinger
Subject: [7u40] Review request for CR 8014925: Disable
sun.reflect.Reflection.getCallerClass(int) with a temporary switch to
re-enable it
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