Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] History of/rationale for type closure rules for producer method return types?

I don't think there would be a problem in including Cloneable and Serializable. It just doesn't feel particularly useful.

When it comes to arrays of superclasses, remember that arrays are both mutable and covariant. Meaning that if someone produced Integer[] and someone else consumed it as Number[], they could set some element of the array to a Double, violating the original expectation that only Integers are present. I wasn't doing CDI at that time, but this feels like a good enough reason to exclude arrays of superclasses.

LT

On Sat, 3 Aug 2024 at 20:31, Ondro Mihályi via cdi-dev <cdi-dev@xxxxxxxxxxx> wrote:
OK, you both proved me wrong, thanks :)

Now I really don’t know why the spec has this restriction on arrays.

Ondro

On Sat, 3 Aug 2024 at 18:36, Laird Nelson via cdi-dev <cdi-dev@xxxxxxxxxxx> wrote:
On Sat, Aug 3, 2024 at 12:35 AM Ondro Mihályi <mihalyi@xxxxxxxxxxx> wrote:
It's probably because at that time, when this rule was added into CDI 1.0, Java 6 was the latest version.


L
_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev
_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev

Back to the top