Simplify and eagerly initialize StringConcatFactory

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 15
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      JDK-8155090 added some measures to StringConcatFactory to prevent issues with a security manager that does string concatenation. As an alternative approach, we should consider eagerly initializing the StringConcatFactory base class during bootstrap.

      Doing so will add minute overhead to bootstrap - which will be amortized on first use of SCF. This would also be a good opportunity to clean up and improve the initialization.

      For example, the CACHE and CACHE_ENABLE fields can be moved to BytecodeStringBuilderStrategy, since it's the only place where we actually have implemented caching (the MethodHandle based strategies rely on LF sharing to de-duplicate shared). This reduces the initialization overhead of SCF for the default case.

            Assignee:
            Claes Redestad
            Reporter:
            Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: