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

Reduce number of lambdas created when loading java.util.regex.Pattern

XMLWordPrintable

    • b156
    • Not verified

        Since 9-b119, when loading java.util.regex a number of lambdas are eagerly created, for example Pattern.DOT, UNIXDOT, VertWS, HorizVS.

        These seem to be statically created only to support j.u.r.PrintPattern, which seems to be a utility only used for debugging which relies on lambda identity that is currently unused (only referenced from commented out code)

        I see two alternatives here.

        1. move the statically created lambdas to an internal holder to allow them to be lazily created
        2. remove j.u.r.PrintPattern and move all the statically created lambdas in Pattern into methods

        Both options reduce number of classes loaded transitively when touching Pattern by 10

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: