diff --git a/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java b/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java index 4557e616..23e61f54 100644 --- a/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java +++ b/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2020-2022 Jannis Weis + * Copyright (c) 2020-2023 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, @@ -376,17 +376,16 @@ public class SmallColorChooser extends JPanel implements ChooserComponent private final DocumentFilter documentFilter = new DocumentFilter() { @Override - public void insertString(final FilterBypass fb, final int offset, final String string, - final AttributeSet attr) + public void insertString(final DocumentFilter.FilterBypass fb, final int offset, + final String string, final AttributeSet attr) throws BadLocationException { if (!isValidString(string)) return; super.insertString(fb, offset, string, attr); } @Override - public void replace(final FilterBypass fb, final int offset, final int length, - final String text, - final AttributeSet attrs) + public void replace(final DocumentFilter.FilterBypass fb, final int offset, + final int length, final String text, final AttributeSet attrs) throws BadLocationException { if (!isValidString(text)) return; super.replace(fb, offset, length, text, attrs); @@ -403,12 +402,14 @@ public class SmallColorChooser extends JPanel implements ChooserComponent private final NavigationFilter navigationFilter = new NavigationFilter() { @Override - public void setDot(final FilterBypass fb, final int dot, final Position.Bias bias) { + public void setDot(final NavigationFilter.FilterBypass fb, final int dot, + final Position.Bias bias) { super.setDot(fb, clampDot(dot, tf), bias); } @Override - public void moveDot(final FilterBypass fb, final int dot, final Position.Bias bias) { + public void moveDot(final NavigationFilter.FilterBypass fb, final int dot, + final Position.Bias bias) { super.moveDot(fb, clampDot(dot, tf), bias); } diff --git a/core/src/main/java/com/github/weisj/darklaf/components/iconeditor/IconEditorPanel.java b/core/src/main/java/com/github/weisj/darklaf/components/iconeditor/IconEditorPanel.java index 6ac85d47..38a2dd1f 100644 --- a/core/src/main/java/com/github/weisj/darklaf/components/iconeditor/IconEditorPanel.java +++ b/core/src/main/java/com/github/weisj/darklaf/components/iconeditor/IconEditorPanel.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2020-2021 Jannis Weis + * Copyright (c) 2020-2023 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, @@ -147,8 +147,8 @@ public class IconEditorPanel extends JPanel { List keys = props.entrySet().stream().sorted((e1, e2) -> { boolean color1 = e1.getValue() instanceof Color; boolean color2 = e2.getValue() instanceof Color; - if (color1 && !color2) return -1; - if (color2 && !color1) return 1; + if (!color2) return -1; + if (!color1) return 1; return e1.getKey().toString().compareTo(e2.getKey().toString()); }).map(e -> e.getKey().toString()).collect(Collectors.toList()); valuePanel.add(LayoutHelper.createTitledColumn( diff --git a/core/src/main/java/com/github/weisj/darklaf/defaults/ResourceBundleCache.java b/core/src/main/java/com/github/weisj/darklaf/defaults/ResourceBundleCache.java index 8aba9590..bd9a93e9 100644 --- a/core/src/main/java/com/github/weisj/darklaf/defaults/ResourceBundleCache.java +++ b/core/src/main/java/com/github/weisj/darklaf/defaults/ResourceBundleCache.java @@ -25,7 +25,7 @@ import java.util.*; class ResourceBundleCache { - private static class ResourceBundleEntry { + private static final class ResourceBundleEntry { private final WeakReference classLoader; private final String path; @@ -37,7 +37,7 @@ class ResourceBundleCache { @Override public boolean equals(final Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (!(o instanceof ResourceBundleEntry)) return false; ResourceBundleEntry that = (ResourceBundleEntry) o; ClassLoader loaderA = classLoader.get(); ClassLoader loaderB = that.classLoader.get(); diff --git a/core/src/main/java/com/github/weisj/darklaf/defaults/UIDefaultsWithResourceBundleCache.java b/core/src/main/java/com/github/weisj/darklaf/defaults/UIDefaultsWithResourceBundleCache.java index e0b721b4..c0ca6a81 100644 --- a/core/src/main/java/com/github/weisj/darklaf/defaults/UIDefaultsWithResourceBundleCache.java +++ b/core/src/main/java/com/github/weisj/darklaf/defaults/UIDefaultsWithResourceBundleCache.java @@ -34,6 +34,7 @@ public class UIDefaultsWithResourceBundleCache extends UIDefaults { } @Override + @SuppressWarnings("UnsynchronizedOverridesSynchronized") public Object get(final Object key) { Object value = super.get(key); return (value != null) ? value : getFromResourceBundle(key, null); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameComponentPopupMenu.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameComponentPopupMenu.java index 94e03686..2def1f9a 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameComponentPopupMenu.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameComponentPopupMenu.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2019-2021 Jannis Weis + * Copyright (c) 2019-2023 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, @@ -95,7 +95,7 @@ public class DarkTabFrameComponentPopupMenu extends JXPopupMenu implements Prope case NORTH_WEST: case SOUTH_EAST: case SOUTH_WEST: - return UIManager.getString("popup.moveTo." + a.name().toLowerCase(), l); + return UIManager.getString("popup.moveTo." + a.name().toLowerCase(Locale.ENGLISH), l); case CENTER: default: return ""; diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/properties/icons/DarkSVGIcon.java b/property-loader/src/main/java/com/github/weisj/darklaf/properties/icons/DarkSVGIcon.java index 2ee6e972..dfe0e23e 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/properties/icons/DarkSVGIcon.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/properties/icons/DarkSVGIcon.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2019-2022 Jannis Weis + * Copyright (c) 2019-2023 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/utils/src/main/java/com/github/weisj/darklaf/util/AlignmentHelper.java b/utils/src/main/java/com/github/weisj/darklaf/util/AlignmentHelper.java index 57c12eb4..722a3e7b 100644 --- a/utils/src/main/java/com/github/weisj/darklaf/util/AlignmentHelper.java +++ b/utils/src/main/java/com/github/weisj/darklaf/util/AlignmentHelper.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2019-2021 Jannis Weis + * Copyright (c) 2019-2023 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, @@ -56,6 +56,7 @@ final class AlignmentHelper { } /** Helper interface to avoid long type names. */ + @Immutable private interface Mapper extends BiFunction { }