RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]
Chen Liang
liach at openjdk.org
Mon Apr 24 16:36:53 UTC 2023
On Mon, 24 Apr 2023 16:27:28 GMT, ExE Boss <duke at openjdk.org> wrote:
> Note that other `*Impl` classes in `java.lang.constant` perform validation in their constructors and provide custom `toString()` formatting and they also don’t use records.
Records were only added in Java 16; the constant API was added in 12, so this is not a reason not to use records. But performing validation in constructors is better than in factory methods, to avoid code paths that potentially create invalid instances.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13615#issuecomment-1520491520
More information about the core-libs-dev
mailing list