Superclasses for inline classes

forax at forax at
Thu Feb 13 10:57:59 UTC 2020

----- Mail original -----
> De: "daniel smith" <daniel.smith at>
> À: "Remi Forax" <forax at>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts at>
> Envoyé: Jeudi 13 Février 2020 00:49:34
> Objet: Re: Superclasses for inline classes

>> On Feb 12, 2020, at 11:41 AM, Remi Forax <forax at> wrote:
>> a garbage class like java.util.Collections (with an 's' at the end) validate all
>> the conditions but should not have an abstract constructor.
> Why not? If identity classes can extend it, and it has no state/initialization,
> why not inline classes too?

Sorry to not be clear, because it's not a backward compatible change,
the empty constructor becomes abstract.

There is a lot of classes like that in the wild, and given that the JLS allows to call static methods on an instance, there are existing code that are using the default constructor even if the author of the class never wanted to allow such usage.


More information about the valhalla-spec-observers mailing list