AttributesFlyweight (Color foreground, Color background, @JdkConstants.FontStyle int fontType, Color effectColor, EffectType effectType, @NotNull Map<@NotNull EffectType, ? extends @NotNull Color> additionalEffects, Color errorStripeColor) { FlyweightKey key = ourKey.get(); if (key == null) { ourKey.set(key = new FlyweightKey()); } key.foreground = foreground; key.background = background; key.fontType = fontType; key.effectColor = effectColor; key.effectType = effectType; key.myAdditionalEffects = additionalEffects.isEmpty() ? Collections.emptyMap() : new EnumMap<>(additionalEffects); key.errorStripeColor = errorStripeColor; AttributesFlyweight flyweight = entries.get(key); if (flyweight != null) { return flyweight; } return ConcurrencyUtil.cacheOrGet(entries, key.clone(), new AttributesFlyweight(key)); }