diff --git a/config/src/main/java/org/xbib/config/ConfigLoader.java b/config/src/main/java/org/xbib/config/ConfigLoader.java index 6089082..24882e1 100644 --- a/config/src/main/java/org/xbib/config/ConfigLoader.java +++ b/config/src/main/java/org/xbib/config/ConfigLoader.java @@ -29,12 +29,11 @@ import java.util.stream.Collectors; */ public class ConfigLoader { - private final Map map; + private static final Map map = new HashMap<>(); private ConfigLogger logger; private ConfigLoader() { - this.map = new HashMap<>(); } private static class Holder { diff --git a/config/src/main/java/org/xbib/config/ConfigParams.java b/config/src/main/java/org/xbib/config/ConfigParams.java index 9e810b8..07e5d3c 100644 --- a/config/src/main/java/org/xbib/config/ConfigParams.java +++ b/config/src/main/java/org/xbib/config/ConfigParams.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.Objects; public class ConfigParams implements Comparable { @@ -129,6 +130,36 @@ public class ConfigParams implements Comparable { return this; } + @Override + public int hashCode() { + return toString().hashCode(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConfigParams that = (ConfigParams) o; + return withSystemEnvironment == that.withSystemEnvironment && + withSystemProperties == that.withSystemProperties && + failIfEmpty == that.failIfEmpty && + includeAll == that.includeAll && + withStdin == that.withStdin && + withSystemPropertiesOverride == that.withSystemPropertiesOverride && + Objects.equals(classLoaders, that.classLoaders) && + Objects.equals(reader, that.reader) && + Objects.equals(jdbcLookups, that.jdbcLookups) && + Objects.equals(settings, that.settings) && + Objects.equals(args, that.args) && + Objects.equals(directoryName, that.directoryName) && + Objects.equals(fileNamesWithoutSuffix, that.fileNamesWithoutSuffix) && + Objects.equals(fileLocations, that.fileLocations); + } + @Override public int compareTo(ConfigParams o) { return COMPARATOR.compare(this, o);