RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]
Adam Sotona
asotona at openjdk.org
Tue Apr 25 07:41:09 UTC 2023
On Mon, 24 Apr 2023 16:33:58 GMT, Chen Liang <liach 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.
Performing validation in constructors I see as a blocker for potential performance optimisations from trusted code within the `java.lang.constant` package.
Custom `toString()` is a good point, returning for example `ModuleDescImpl[moduleName=mymodule]` is not ideal.
I'll fix it, thanks.
Records are very well designed exactly for this purpose and I'm not aware of any reason to don't use them.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13615#issuecomment-1521300799
More information about the core-libs-dev
mailing list