diff --git a/src/main/java/io/ebean/config/properties/LoadContext.java b/src/main/java/io/ebean/config/properties/LoadContext.java index e8a5fc729..5c5b156c9 100644 --- a/src/main/java/io/ebean/config/properties/LoadContext.java +++ b/src/main/java/io/ebean/config/properties/LoadContext.java @@ -18,22 +18,22 @@ import java.util.Set; */ class LoadContext { - private static final Logger log = LoggerFactory.getLogger(LoadContext.class); + private static final Logger log = LoggerFactory.getLogger(LoadContext.class); /** * Map we are loading the properties into. */ - private final Map map = new LinkedHashMap<>(); + private final Map map = new LinkedHashMap<>(); /** * Names of resources/files that were loaded. */ - private final Set loadedResources = new LinkedHashSet<>(); + private final Set loadedResources = new LinkedHashSet<>(); /** * Return the input stream (maybe null) for the given source. */ - InputStream resource(String resourcePath, Loader.Source source) { + InputStream resource(String resourcePath, Loader.Source source) { InputStream is = null; if (source == Loader.Source.RESOURCE) { @@ -46,21 +46,21 @@ class LoadContext { if (file.exists()) { try { is = new FileInputStream(file); - loadedResources.add("file:"+resourcePath); + loadedResources.add("file:" + resourcePath); } catch (FileNotFoundException e) { throw new IllegalStateException(e); } } } - return is; - } + return is; + } private InputStream resourceStream(String resourcePath) { InputStream is = getClass().getResourceAsStream("/" + resourcePath); if (is == null) { // search the module path for top level resource - is = ClassLoader.getSystemResourceAsStream(resourcePath); + is = ClassLoader.getSystemResourceAsStream(resourcePath); } return is; } @@ -68,30 +68,30 @@ class LoadContext { /** * Add a property entry. */ - void put(String key, String val) { - if (val != null) { - val = val.trim(); + void put(String key, String val) { + if (val != null) { + val = val.trim(); } - map.put(key, val); - } + map.put(key, val); + } /** * Evaluate all the expressions and return as a Properties object. */ - Properties eval() { + Properties eval() { - log.info("loaded properties from {}", loadedResources); + log.info("loaded properties from {}", loadedResources); - Properties properties = new Properties(); + Properties properties = new Properties(); - for (Map.Entry entry : map.entrySet()) { - String key = entry.getKey(); - String value = PropertyEval.eval(entry.getValue()); - properties.setProperty(key, value); - } + for (Map.Entry entry : map.entrySet()) { + String key = entry.getKey(); + String value = PropertyEval.eval(entry.getValue()); + properties.setProperty(key, value); + } - return properties; - } + return properties; + } /** * Read the special properties that can point to an external properties source.