RFR: JDK-8298200 Clean up raw type warnings in javafx.beans.property.* and com.sun.javafx.property.* [v2]
John Hendrikx
jhendrikx at openjdk.org
Fri Dec 9 20:05:53 UTC 2022
On Fri, 9 Dec 2022 18:06:21 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
> I see that you moved the generic type declarations from the inner classes to the outer ones. I wasn't getting any raw type warnings on these. What requires these?
I checked, it's not strictly required. I tried to make all of these classes more generic, but ran into problems and reverted some of it. The change to move the type parameter was apparently not strictly needed.
It makes sense though, the descriptors are factories for non-static listeners. When the factory carries the type information then everything that is produced is of the correct type. The factory can make its `getType` method return `Class<T>` there as well then. The change makes it possible to write `DescriptorCleanerListener` with a type parameter as well, so that you can enforce that its descriptor and listener parameter are for the same type, instead of:
DescriptorListenerCleaner(ReadOnlyPropertyDescriptor pd, ReadOnlyPropertyDescriptor.ReadOnlyListener<?> l);
You get a tighter constructor:
DescriptorListenerCleaner(ReadOnlyPropertyDescriptor<T> pd, ReadOnlyPropertyDescriptor<T>.ReadOnlyListener l);
I think its still an improvement, but not strictly raw type fixing after I reverted my other changes.
-------------
PR: https://git.openjdk.org/jfx/pull/969
More information about the openjfx-dev
mailing list