Superclasses for inline classes
forax at univ-mlv.fr
forax at univ-mlv.fr
Thu Feb 13 10:57:59 UTC 2020
----- Mail original -----
> De: "daniel smith" <daniel.smith at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts at openjdk.java.net>
> 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 univ-mlv.fr> 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.
Rémi
More information about the valhalla-spec-experts
mailing list