RFR: JDK-8298200 Clean up raw type warnings in javafx.beans.property.* and com.sun.javafx.property.*

Kevin Rushforth kcr at openjdk.org
Wed Dec 7 13:32:13 UTC 2022


On Tue, 6 Dec 2022 18:12:39 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> - Added generics (to package private or internal classes only)
> - Minor clean-ups of code I touched (naming)
> - Fixed incorrect use of generics
> - Fixed raw type warnings
> 
> Note: some raw types have leaked into public API.  These could be fixed without incompatibilities.  For specifics see `JavaBeanObjectPropertyBuilder`.  The javadoc would have the method signatures change (`<T>` would be appended to the affected methods).  For now I've added a TODO there.

Overall this looks good to me.

> Minor clean-ups of code I touched (naming)

This seems unnecessary, so I left an inline comment.

> Note: some raw types have leaked into public API. These could be fixed without incompatibilities. For specifics see JavaBeanObjectPropertyBuilder. The javadoc would have the method signatures change (<T> would be appended to the affected methods). For now I've added a TODO there.

Will you file a new bug for this? It will need a CSR, but seems a reasonble thing to do.

modules/javafx.base/src/main/java/com/sun/javafx/property/adapter/Disposer.java line 47:

> 45: public class Disposer implements Runnable {
> 46:     private static final ReferenceQueue<Object> QUEUE = new ReferenceQueue<>();
> 47:     private static final Map<Reference<?>, Runnable> RECORDS = new ConcurrentHashMap<>();

I don't really care for the suggestion that most IDEs seem to offer of naming `static final` objects (as opposed to primitive types) using all caps. This should be left up to the developer, and in this case I think the existing names are fine and don't need to be changed. I note that this code was borrowed from Java2D where a similar fix was done to add the generics, but the names were left unchanged.

-------------

PR: https://git.openjdk.org/jfx/pull/969


More information about the openjfx-dev mailing list