On Wed, Apr 27, 2022 at 11:03 AM Dan Smith <daniel.sm...@oracle.com> wrote:
> On Apr 26, 2022, at 5:22 PM, Kevin Bourrillion <kev...@google.com> wrote: > > (Thought experiment: if we had an annotation meaning "using the .val type > is not a great idea for this class and you should get a compile-time > warning if you do" .... would we really and I mean *really* even need > bucket 2 at all?) > > Yes, because some (many?) class authors want strong guarantees that the > initial (all-zeros) instance is never available in the wild. This is the > most prominent encapsulation-breaking compromise that an author makes when > moving from B2 to B3. > Yeah, I'm somewhere on that end of the spectrum too, about types like `Instant` (in fact I started calling this the 1970 problem). I only even say the above because in such cases there *is* the fallback of gritting teeth and getting comfortable in bucket 1. Sad, but my thought was that three kinds of concrete classes (times three kinds of concrete classes) is sad too. -- Kevin Bourrillion | Java Librarian | Google, Inc. | kev...@google.com