On Mon, 17 Oct 2022 01:38:00 GMT, Toshio Nakamura <[email protected]> wrote:
>> When JEditorPane shown HTML form with multi-selection, the reset operation
>> broke its drawing.
>>
>> There are two issues. The current method
>> `OptionListModel.removeIndexInterval()` disabled selections, but it didn't
>> fire the change. Then, no re-drawing. Another issue is the method works as
>> remove and shift. Then, selection values were corrupted.
>> I think the clear method `OptionListModel.clearSelection()` is suitable here.
>>
>> Test: jdk_desktop on macOS (x64, Monterey), Linux (x64, RHEL8), and Windows
>> (x64, 2012R2).
>> No regression found
>
> Toshio Nakamura has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Update testcase
Changes requested by dnguyen (Author).
test/jdk/javax/swing/text/html/TestResetSelectForm.java line 93:
> 91: if (getMaxColorDiff(baseColor, c) > LIMIT) {
> 92: throw new RuntimeException("Unexpected List selection at
> " +
> 93: (i+1) + ", " + baseColor + "," + c);
The points mentioned seem valid since I see the same things when I test it
myself. OptionListModel's clearSelection is being called without the drawing
updating. The fix seems logical and works as intended.
Just to nitpick, adding a space before and after the '+' in '(i+1)' here would
match the pattern of all the other additions.
-------------
PR: https://git.openjdk.org/jdk/pull/10685