On Mon, 24 Apr 2023 16:33:58 GMT, Chen Liang <li...@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