RFR: JDK-8322878: Including sealing information Class.toGenericString()

Joe Darcy darcy at openjdk.org
Wed Jan 3 18:38:47 UTC 2024


On Wed, 3 Jan 2024 06:43:22 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> As recently discussed on core libs, sealed-ness information could be included in the Class.toGenericString() output, analagous to how "modifiers" that also correspond to JVM access flags are handled.
> 
> This is the initial spec, implementation, and test updated needed for that change. If there is consensus this is a reasonable direction, I'll create the CSR, etc.

As the output of toGenericString does not attempt to fully capture the full declaration information of a class or interfaces, omitted any extends or implementation information for example, I think it is fine to also omit any listed of permitted subtypes for a sealed class or interface. This sidesteps design issues around which permitted subtypes should be filtered out for display purposes, etc.

CSR up for review: https://bugs.openjdk.org/browse/JDK-8322969
TIA

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17239#issuecomment-1875783748
PR Comment: https://git.openjdk.org/jdk/pull/17239#issuecomment-1875794166


More information about the core-libs-dev mailing list