Proposal on getting warning free (controls) packages

Tom Schindl tom.schindl at bestsolution.at
Thu Mar 20 19:57:54 UTC 2014


Hi,

I've just started looking into getting the controls package warning free
and/or suppress them in case not fixable.

Most of the generic warnings I've come accross in a first pass involve
StyleableProperty cast like this:

((StyleableProperty)graphicProperty()).applyStyle(origin, null);

In fact above code has 2 warnings:
a) unchecked type cast
b) usage of raw-type

the raw type in this case can be fixed with:

((StyleableProperty<Node>)graphicProperty()).applyStyle(origin, null);

leaving us with the unchecked cast so we could add:

@SuppressWarnings({ "unchecked" })

e.g. on the method but I'm uncertain this is a good idea because it
might hide unchecked warnings we have a possibility to fix.

So what are other options:
a) Create a static helper in Util to make the cast and for us (we could
   even add it as a static method in the StyleableProperty-interface)

b) provide a private/package-scoped method the public one delegates

Both of them work but have different problems where I think b) has the
bigger ones like blowing up class-file, modification of the field to be
of type StyleableObjectProperty.

I'd really like to get the source warning free.

Thoughts?

Tom


More information about the openjfx-dev mailing list