RFR: 8375480: Remove usage of AppContext from javax/swing/text
Sergey Bylokhov
serb at openjdk.org
Tue Jan 20 09:45:02 UTC 2026
On Mon, 19 Jan 2026 07:06:53 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> This PR removes usage of AppContext from classes under javax/swing/text.
>> Most of the uses were added in specific bug fixes 10-15 years ago but are now obsolete and the tests for those bugs need to be deleted too.
>
> src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java line 434:
>
>> 432: */
>> 433: public void setStyleSheet(StyleSheet s) {
>> 434: defaultStyles = s;
>
> Dont we need to add `synchronized` for setter and getter? getAppContext used to use getAppContextLock!!
Some consideration might be needed. It should be taken into account that using AppContext.get/put/remove indirectly causes synchronization points, so everything written before getAppContext becomes visible after.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29259#discussion_r2707549844
More information about the client-libs-dev
mailing list