RFR: 8322784: JFXPanel calls InputMethodRequests on wrong thread [v2]
Kevin Rushforth
kcr at openjdk.org
Sat Jan 20 14:13:44 UTC 2024
On Sat, 20 Jan 2024 01:08:23 GMT, Martin Fox <mfox at openjdk.org> wrote:
>> modules/javafx.swing/src/main/java/javafx/embed/swing/InputMethodSupport.java line 132:
>>
>>> 130: }
>>> 131: if (selected[0] == null) selected[0] = "";
>>> 132: return new AttributedString(selected[0]).getIterator();
>>
>> AtomicReference<String> ref = ...
>> ...
>> String s = ref.get();
>> return new AttributedString(s == null ? "" : s).getIterator();
>>
>>
>> here and L102?
>
> I'm not familiar enough with AtomicReference to have an opinion on this. Someone else will have to weigh in on this.
Either an array or an AtomicReference is OK in this case. AtomicReference is thread-safe, but that's not a concern here, since using `runAndWait` ensures that writing to the array happens before reading it.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1337#discussion_r1460459091
More information about the openjfx-dev
mailing list