Skip to content

Commit

Permalink
Move else-if up to better match the code flow
Browse files Browse the repository at this point in the history
Move else-if up to better match the code flow

Change-Id: I3323bc9619f1d38be10637fd67bff19cf9641c52
  • Loading branch information
mletenay committed Nov 29, 2023
1 parent 355c1df commit 2f9b683
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit 2f9b683

Please sign in to comment.