Thought on multiplicity of properties in Java
Martin Desruisseaux
martin.desruisseaux at geomatys.com
Mon Sep 17 08:21:50 UTC 2018
Hello Rémi
Thanks for your reply.
Le 17/09/2018 à 00:54, Remi Forax a écrit :
> The Java spec limit covariance to subtyping relationship only (there
> is no covariance between primitive types, or between a primitive type
> and it's corresponding wrapper), so you can not use Java to implement
> overriding of UML properties with different multiplicity. But if you
> generate the bytecode instead of generating Java code to generate the
> interfaces, you are not limited by the Java spec, so you can generate
> the bridge methods you want.
>
Yes I know. My question was if "multiplicity covariance" was something
that may be worth considering at the Java language level for some future
version of the specification. This is not a request to do so, only an idea.
Regards,
Martin
More information about the core-libs-dev
mailing list