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

Including sealing information Class.toGenericString()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 23
    • core-libs
    • None

      To belatedly improve support for JEP 409 (JDK-8260514), include sealing information in Class.toGenericString().

      See https://mail.openjdk.org/pipermail/core-libs-dev/2024-January/117400.html

      The strictfp modifier was retired as a meaningful modifier in JDK 17 (JEP 306), the same release that JEP 409 sealed classes as added as a normal feature. So in terms of updating the implementation of toGenericString() to included sealed information, since strictfp is a no-op in the same release sealed/non-sealed was added, a class file can be

          sealed XOR strictfp

      Therefore, Class.toGenericString() could print the modifiers from getModifiers() and then add sealing information while retaining the blessed modifier order. In other words, the "Modifier.toString(modifiers)" code in Class.toGenericString() does not have to be "interrupted" to handle presenting sealed information in the blessed order.

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: