diff --git a/jcache/src/main/java/com/github/benmanes/caffeine/jcache/configuration/TypesafeConfigurator.java b/jcache/src/main/java/com/github/benmanes/caffeine/jcache/configuration/TypesafeConfigurator.java index ce04edd45f..584b407de2 100644 --- a/jcache/src/main/java/com/github/benmanes/caffeine/jcache/configuration/TypesafeConfigurator.java +++ b/jcache/src/main/java/com/github/benmanes/caffeine/jcache/configuration/TypesafeConfigurator.java @@ -170,10 +170,6 @@ private static Config resolveConfig(URI uri, ClassLoader classloader) { return ConfigFactory.defaultOverrides(classloader) .withFallback(ConfigFactory.parseFile(new File(uri), options)) .withFallback(ConfigFactory.defaultReferenceUnresolved(classloader)); - } else if (isResource(uri)) { - return ConfigFactory.defaultOverrides(classloader) - .withFallback(ConfigFactory.parseResources(uri.getSchemeSpecificPart(), options)) - .withFallback(ConfigFactory.defaultReferenceUnresolved(classloader)); } else if ((uri.getScheme() != null) && uri.getScheme().equalsIgnoreCase("jar")) { try (Reader reader = new InputStreamReader(uri.toURL().openStream())) { return ConfigFactory.defaultOverrides(classloader) @@ -182,6 +178,10 @@ private static Config resolveConfig(URI uri, ClassLoader classloader) { } catch (IOException e) { throw new ConfigException.BadPath(uri.toString(), e.getMessage()); } + } else if (isResource(uri)) { + return ConfigFactory.defaultOverrides(classloader) + .withFallback(ConfigFactory.parseResources(uri.getSchemeSpecificPart(), options)) + .withFallback(ConfigFactory.defaultReferenceUnresolved(classloader)); } return ConfigFactory.load(classloader); }