RFR: 8248: [Accessibility] Low Contrast in High Contrast mode on Stacktrace View [v3]

Brice Dutheil bdutheil at openjdk.org
Mon Sep 16 07:52:13 UTC 2024


On Sat, 14 Sep 2024 21:41:24 GMT, Suchita Chaturvedi <schaturvedi at openjdk.org> wrote:

>> This PR is to fix the accessibility issue for High Contrast mode. Stracktrace View was not readable at all in dark mode.
>> 
>> Before the fix:
>> <img width="959" alt="image" src="https://github.com/user-attachments/assets/f12f1b7d-aa8a-4cce-8e0c-7731d5f9cc96">
>> 
>> After the fix:
>> <img width="959" alt="image" src="https://github.com/user-attachments/assets/8f7be98a-206b-4758-a1c2-8971d7ab1c55">
>
> Suchita Chaturvedi has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Merge branch 'openjdk:master' into 8248
>  - Restart not required to apply the DARK mode appearance preference
>  - 8248: [Accessibility] Low Contrast in High Contrast mode on Stacktrace View
>    
>    Co-authored By: Marcus Hirt <hirt at openjdk.org>

application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/util/ThemeUtils.java line 13:

> 11: public class ThemeUtils {
> 12: 
> 13: 	private static boolean isCurrentThemeDark = isDarkMode();

**suggestion:** 

> But seems like spotbugs is not happy with updating static variable isCurrentThemeDark from the listener

I don't know if it's alright by JMC spotbug rules to write this global state like this

Suggestion:

	private static AtomicReference<Boolean> isCurrentThemeDark = new AtomicReference<>(isDarkMode());


and then access it with `AtomicReference::get` / `AtomicReference::set`.

-------------

PR Review Comment: https://git.openjdk.org/jmc/pull/580#discussion_r1760683381


More information about the jmc-dev mailing list