RFR: 8313651: Add 'final' keyword to public property methods in controls [v7]

Andy Goryachev angorya at openjdk.org
Fri Sep 8 18:26:52 UTC 2023


On Fri, 8 Sep 2023 18:13:45 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   only public
>
> modules/javafx.controls/src/test/java/test/javafx/scene/control/ControlPropertiesTest.java line 103:
> 
>> 101:     // list all current descendants of Control class.
>> 102:     private Set<Class> allControlClasses() {
>> 103:         return Set.of(
> 
> Not that it matters much since the method is called once, but why is there a need for a method that returns the same constant set? The set can just be a constant: `private final Set<Class<?>> = Set.of(...);`

will keep as a method, if we ever get to extracting classes at run time.

> modules/javafx.controls/src/test/java/test/javafx/scene/control/ControlPropertiesTest.java line 216:
> 
>> 214:             } else {
>> 215:                 System.err.println(msg);
>> 216:             }
> 
> No need for an `else` clause since `throw` will exit the scope of the method if it's reached.

personal style.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1213#discussion_r1320204615
PR Review Comment: https://git.openjdk.org/jfx/pull/1213#discussion_r1320205003


More information about the openjfx-dev mailing list