-
Bug
-
Resolution: Fixed
-
P2
-
7u25
-
b31
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8019735 | 7u60 | Mandy Chung | P2 | Resolved | Fixed | b01 |
JDK-8019455 | 7u45 | Mandy Chung | P2 | Closed | Fixed | b01 |
Problem Description
-------------------
sun.reflect.Reflection.getCallerClass(int) has changed its behaviour such
that a different Class is now returned for a given integer. It looks like
getCallerClass is now calling another method on Reflection, which has changed
the call stack. Attached is a test class that exhibits the problem.
For jdk7u21, its output is:
sun.reflect.Reflection
sunreflect.ReflectionCaller$Inner2
sunreflect.ReflectionCaller$Inner1
sunreflect.ReflectionCaller
But for 7u25, its output is:
sun.reflect.Reflection
sun.reflect.Reflection
sunreflect.ReflectionCaller$Inner2
sunreflect.ReflectionCaller$Inner1
-------------------
sun.reflect.Reflection.getCallerClass(int) has changed its behaviour such
that a different Class is now returned for a given integer. It looks like
getCallerClass is now calling another method on Reflection, which has changed
the call stack. Attached is a test class that exhibits the problem.
For jdk7u21, its output is:
sun.reflect.Reflection
sunreflect.ReflectionCaller$Inner2
sunreflect.ReflectionCaller$Inner1
sunreflect.ReflectionCaller
But for 7u25, its output is:
sun.reflect.Reflection
sun.reflect.Reflection
sunreflect.ReflectionCaller$Inner2
sunreflect.ReflectionCaller$Inner1
- backported by
-
JDK-8019735 sun.reflect.Reflection.getCallerClass returns the wrong stack frame
- Resolved
-
JDK-8019455 sun.reflect.Reflection.getCallerClass returns the wrong stack frame
- Closed
- relates to
-
JDK-8014925 Disable sun.reflect.Reflection.getCallerClass(int) with a temporary switch to re-enable it
- Closed