Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8016814

sun.reflect.Reflection.getCallerClass returns the wrong stack frame

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      b31
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        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

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mchung Mandy Chung
                Reporter:
                tyao Ting-Yun Ingrid Yao (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: