8243115: Spurious invalidations due to bug in IntegerBinding and other classes #198
Conversation
This fixes a bug where the first call to unbind would clear the internal invalidation listener used, resulting in subsequent unbind calls to be no-ops, unless bind was called again first.
|
/reviewers 2 |
@kevinrushforth |
The title of this PR should match exactly the title of the JBS bug. So:
|
@arapte can you also review this? |
I will review this too anyway. |
Thank you. That will be helpful. |
As I started my review I noticed that |
The fix looks correct and the tests pass. I just wonder why the change to reflection-based construction with |
The Parameterized test constructs some standard Binding objects to run multiple tests with. This works fine if those objects are immutable (or aren't modified during the tests). My new test however does modify them, and other tests would fail with such modified objects (as |
I'm fine with doing a fix, but I need to know which one. Avoiding NPE's and silently doing nothing is IMHO not very desirable as this will give the user of the API no feedback that something went wrong. So I would prefer to fix this by documenting that these cases will result in a NPE. The |
I think that checking the array elements doesn't help much because by the time you can check them they will already be used, and that will throw an NPE implicitly.
|
This fixes a bug where the first call to unbind would clear the internal invalidation listener used, resulting in subsequent unbind calls to be no-ops, unless bind was called again first.
I had to rewrite the parameterized test slightly as Parameterized will only call the parameters method once, and my new test modifies the internal state of the bindings used as parameters (by doing some unbind calls) which was making other tests fail.
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/jfx pull/198/head:pull/198
$ git checkout pull/198