diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/src/com/chylex/intellij/coloredicons/BuildHelpers.java b/src/com/chylex/intellij/coloredicons/BuildHelpers.java index 0d0bccf..63aca59 100644 --- a/src/com/chylex/intellij/coloredicons/BuildHelpers.java +++ b/src/com/chylex/intellij/coloredicons/BuildHelpers.java @@ -11,20 +11,20 @@ import java.util.Set; final class BuildHelpers{ static final class FixSVG{ - public static void main(String[] args) throws IOException{ - Charset charset = StandardCharsets.UTF_8; - String encoding = charset.name(); + public static void main(final String[] args) throws IOException{ + final Charset charset = StandardCharsets.UTF_8; + final String encoding = charset.name(); - String svg12Tag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\">"; - String svg13Tag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"13\" height=\"13\" viewBox=\"0 0 13 13\">"; - String svg16Tag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">"; + final String svg12Tag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\">"; + final String svg13Tag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"13\" height=\"13\" viewBox=\"0 0 13 13\">"; + final String svg16Tag = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">"; - Set<String> svgTags = new HashSet<>(Arrays.asList( + final Set<String> svgTags = new HashSet<>(Arrays.asList( svg12Tag, svg13Tag, svg16Tag )); - for(File file : FileUtils.listFiles(new File("./resources/icons"), new String[]{ "svg" }, true)){ - List<String> lines = FileUtils.readLines(file, charset); + for(final File file : FileUtils.listFiles(new File("./resources/icons"), new String[]{ "svg" }, true)){ + final List<String> lines = FileUtils.readLines(file, charset); if (lines.get(0).startsWith("<?xml")){ lines.remove(0); @@ -34,7 +34,7 @@ final class BuildHelpers{ lines.remove(0); } - String svg = lines.get(0); + final String svg = lines.get(0); if (svg.startsWith("<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 13 13\"")){ lines.set(0, svg13Tag); diff --git a/src/com/chylex/intellij/coloredicons/IconPatcher.java b/src/com/chylex/intellij/coloredicons/IconPatcher.java index 1351782..3b0fe1e 100644 --- a/src/com/chylex/intellij/coloredicons/IconPatcher.java +++ b/src/com/chylex/intellij/coloredicons/IconPatcher.java @@ -114,20 +114,20 @@ public class IconPatcher extends IconPathPatcher{ IconLoader.installPathPatcher(this); } - private void addPathWithDark(String path){ - iconPaths.put("/" + path + ".svg", "/icons/" + path + ".svg"); - iconPaths.put("/" + path + "_dark.svg", "/icons/" + path + "_dark.svg"); + private void addPathWithDark(final String path){ + iconPaths.put('/' + path + ".svg", "/icons/" + path + ".svg"); + iconPaths.put('/' + path + "_dark.svg", "/icons/" + path + "_dark.svg"); } @Nullable @Override - public String patchPath(@NotNull String path, ClassLoader classLoader){ + public String patchPath(@NotNull final String path, final ClassLoader classLoaderIgnore){ return iconPaths.get(path); } @Nullable @Override - public ClassLoader getContextClassLoader(@NotNull String path, ClassLoader originalClassLoader){ + public ClassLoader getContextClassLoader(@NotNull final String path, final ClassLoader originalClassLoader){ return classLoader; } }