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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • 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.

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

              Created:
              Updated:
              Resolved: