From d98986bdb04a4b9ce2960da69172f47c9eeee30d Mon Sep 17 00:00:00 2001 From: Konstantin Hudyakov Date: Tue, 21 Feb 2023 15:31:36 +0200 Subject: [PATCH] Fix LaF Defaults internal action This action obtain all keys using `UIManager.getDefaults().keys()`, that creates HashSet from entries, so hashcode value of JBColor is required. But there are also stored `JBColor.CACHED_NULL` values, that throw an exception when hashcode method is invoked. So, it is required to specify hashcode function for such marker objects. GitOrigin-RevId: bc66322a58625bacc1f961581569decaf605bf2f --- platform/util/ui/src/com/intellij/ui/JBColor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/util/ui/src/com/intellij/ui/JBColor.java b/platform/util/ui/src/com/intellij/ui/JBColor.java index a11bc680b877..937eae242b28 100644 --- a/platform/util/ui/src/com/intellij/ui/JBColor.java +++ b/platform/util/ui/src/com/intellij/ui/JBColor.java @@ -93,6 +93,11 @@ public class JBColor extends Color { return this == obj; } + @Override + public int hashCode() { + return name.hashCode(); + } + @Override public String toString() { return name;