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

Simplify JarFile.isInitializing

    Details

      Backports

        Description

        JDK-8234466 regress startup and footprint of very small applications noticeably.

        Cause appears to be the addition of a lambda to JarFile.<clinit>. Since the value is only read rarely and only in one place, it could be simplified to use the default ThreadLocal initial value (null):

        - static final ThreadLocal<Boolean> isInitializing =
        - ThreadLocal.withInitial(() -> Boolean.FALSE);
        + static final ThreadLocal<Boolean> isInitializing = new ThreadLocal<>();
         
        .. with adjustments in the places that read. This recuperates the startup regression.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  redestad Claes Redestad
                  Reporter:
                  redestad Claes Redestad
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: