On Wed, 23 Nov 2022 22:48:43 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> modules/javafx.controls/src/test/java/test/javafx/scene/chart/CategoryAxisTest.java
>>  line 122:
>> 
>>> 120: 
>>> 121:     @Test public void checkCategorySpacingReadOnlyCannotBind() {
>>> 122:         assertTrue(axis.categorySpacingProperty() instanceof 
>>> ReadOnlyDoubleProperty);
>> 
>> In theory, this should be replaced with a `null` check, but if it's `null` 
>> the test will fail anyway, so it should be fine.
>
> I wonder if this change should be reverted. Since this is in a test, there is 
> value in ensuring that what is true today remains true. This will ensure that 
> the test will fail if the return type of this property ever changed to make 
> the `instanceof` check no longer pass. Now admittedly, this is unlikely, 
> since it would be a breaking change that should be caught during a code 
> review, but it does have some (small) value.

I could replace it with a class check instead.  I was also debating whether 
this really has any value when I removed it.

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

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

Reply via email to