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

Class.getConstructor() performance regression

    XMLWordPrintable

Details

    • b154
    • Not verified

    Backports

      Description

        Additional security checks have been added to various methods of java.lang.Class, which caused a performance regression. These checks only need to be performed when a SecurityManager is enabled, but the code is structured in a way that additional methods are called even when a SecurityManager is not enabled, such as the relatively expensive Reflection.getCallerClass method.

        The fix is to restructure the calls to checkMemberAccess and checkPackageAccess so that they are only invoked when a SecurityManager is enabled.

        Attachments

          1. webrev.zip
            268 kB
          2. ClazzWithSecurityManager.java
            3 kB
          3. Clazz.java
            3 kB

          Issue Links

            Activity

              People

                redestad Claes Redestad
                asaha Abhijit Saha
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: