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

Disabling sun.reflect.Reflection.getCallerCaller(int) by default breaks several frameworks and libraries

    Details

    • Subcomponent:
    • Resolved In Build:
      b37
    • Verification:
      Verified

      Backports

        Description


        See JDK-8014925 (and CCR http://oracleplan.oracle.com/gotoEntity?entityType=FEATURE&entityId=1080598) for background.

        In 7u40 we have disabled the JDK private method sun.reflect.Reflection.getCallerCaller(int). It turns out that there are several frameworks and libraries that have ignored the warning not to use JDK private methods and now broken by the change in 7u40. This includes Groovy, Log4J and others. The solution in 7u40 includes a system property to re-enable this method but it turns out that this is too awkward to use (the Groovy folks are saying that they cannot ask their users to set this property).

        This bug is submitted to re-examine this issue for 7u40 only. Separate enhancement issues have been submitted for 8 to explore API solutions to cover some of the use-cases where the caller class is required. For 7u40 then we need to explore whether it would make sense to re-enable it to allow existing code to continue to work even through they are making use of a JDK private method.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alanb Alan Bateman
                  Reporter:
                  alanb Alan Bateman
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: