RFR: 8328977 : JEditorPane.setPage not thread-safe, pageLoader not cancelled
Alexey Ivanov
aivanov at openjdk.org
Fri Apr 19 10:34:57 UTC 2024
On Fri, 19 Apr 2024 05:10:46 GMT, Tejesh R <tr at openjdk.org> wrote:
> I wasn't able to make out the changes with comparison since restructuring is also done here. Just like you are explaining here would help in understanding the changes for review.
Putting all access to `pageLoader` into a `synchronized` block solves the thread-safety problem.
At the same time, we can improve the readability of the method as a whole. Restructuring helps make the intent clearer, at least I'm aiming to do so.
I agree looking at the diffs here doesn't give you much insight, but going through the original and updated code gives a clearer picture.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18670#issuecomment-2066293003
More information about the client-libs-dev
mailing list