[jfx15] RFR: 8176270: Adding ChangeListener to TextField.selectedTextProperty causes StringOutOfBoundsException

Robert Lichtenberger rlichten at openjdk.java.net
Fri Jul 10 06:14:32 UTC 2020

On Thu, 2 Jul 2020 23:39:58 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> seeing that you are working at it (and still without too close a look, sry ;) - we need more tests about the
>> notifications of all properties involved: text, selectedText, indexRange (anything else?).  The things to test are
>> count and old/new value. F.i. something like:
>>     List<String> values = new ArrayList();
>>     textField.selectedTextProperty().addListener((src, ov, nv) -> {
>>          list.addAll(ov, nv);
>>     }
>>     // do stuff
>>     assertEquals(2, values.size());
>>     assertEquals(expectedOldValue, values.get(0));
>>     assertEquals(expectedNewValue, values.get(1));
> I need to do some more testing, but this looks like the right approach.
> This fix might be a candidate for JavaFX 15, so I recommend to _not_ merge the master branch. If I don't spot anything
> of concern during the review, then I will ask you to retarget your PR to the `jfx15` branch.

I changed the base branch of this PR by editing it in the github GUI. Is this all I need to do to retarget it for jfx15?


PR: https://git.openjdk.java.net/jfx/pull/138

More information about the openjfx-dev mailing list