On Tue, 20 Jan 2026 17:00:29 GMT, Sergey Bylokhov <[email protected]> wrote:
>> 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. > > It would probably be better to use LazyConstants for all of this instead of > moving everything into a static block and loading everything eagerly. I looked at the change that introduced AppContext here and I simply reverted it. https://hg.openjdk.org/jdk7/jdk7/jdk/rev/9ed7ae1e911c So as far as I can tell, thread safety was never a guarantee here. And the containing package doc https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/javax/swing/text/html/package-summary.html Says "Most of the Swing API is not thread safe...." I don't understaand the comment about LazyConstants. The Stylesheet is not being eagerly created. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29259#discussion_r2709997875
