StringConcatFactory should emit classes with the same package as the host class

XMLWordPrintable

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

      In upcoming JDK 9 Jigsaw the access control for Unsafe.defineAnonymousClass is stricter: we cannot easily reference arbitrary classes from VM anonymous classes, see e.g. JDK-8058575. The similar thing causes troubles for Jigsaw already, see e.g. JDK-8149165.

      So, we may want to follow what Lambdas are doing, and put the concatenation stubs in the same class/package, with "$$String" suffix. This should also aid debugging and dumping, because the String concat stub name would attribute to the use site.

      The caveat is caching: we would need to figure out if we can reuse the classes generated for "package1" when they are used in "package2", even though they have the same signatures. Current SCF caching code is oblivious of this.

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: