From 3a778d00b309d56038997a83acd245c16243ad7e Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 6 Mar 2018 14:04:24 +0700 Subject: [PATCH] Fix subtitle source icon lookup --- source/net/filebot/ResourceManager.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/source/net/filebot/ResourceManager.java b/source/net/filebot/ResourceManager.java index c6a68788..2d17ad3f 100644 --- a/source/net/filebot/ResourceManager.java +++ b/source/net/filebot/ResourceManager.java @@ -1,6 +1,5 @@ package net.filebot; -import static java.util.Arrays.*; import static java.util.Collections.*; import static java.util.stream.Collectors.*; @@ -22,24 +21,16 @@ public final class ResourceManager { private static final Map cache = synchronizedMap(new HashMap(256)); - public static Icon getIcon(String... name) { - return getIcon(asList(name)); - } - - private static Icon getIcon(List icons) { - if (icons.isEmpty()) { - return null; - } - - return cache.computeIfAbsent(icons.get(0), i -> { + public static Icon getIcon(String name) { + return cache.computeIfAbsent(name, i -> { // load image URL[] resource = getMultiResolutionImageResource(i); if (resource.length > 0) { return new ImageIcon(getMultiResolutionImage(resource)); } - // try next image - return getIcon(icons.subList(1, icons.size())); + // default image + return null; }); }