Non-atomicity field questions

- liangchenblue at gmail.com
Wed May 24 17:52:53 UTC 2023


Hello, quick question:
If there's a nullable reference field in a null-restricted non-atomic value
class, is this possible:
1. Declare a reference field, like a String, without heap pollution
concerns;
2. Limit the values of fields (of course, permit zero-default values) for
all instances of this class, such as nonnegative long field, null or String
reference containing no tabs, etc.
This requires constructors to be executed for non-default instance
creation, but individual field validation is independent, and valid object
state is still the cartesian product of valid individual field states.

If these two features are present in null-restricted non-atomic value
classes, it will make those classes very useful. If not, it's a good lesson
against misuse of such classes.

Chen Liang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-dev/attachments/20230524/6108a960/attachment.htm>


More information about the valhalla-dev mailing list