@SuppressWarnings("unchecked") public AbstractConfig(ConfigDef definition, Map<?, ?> originals, boolean doLog) { /* check that all the keys are really strings */ for (Map.Entry<?, ?> entry : originals.entrySet()) if (!(entry.getKey() instanceof String)) throw new ConfigException(entry.getKey().toString(), entry.getValue(), "Key must be a string."); this.originals = (Map<String, ?>) originals; this.values = definition.parse(this.originals); Map<String, Object> configUpdates = postProcessParsedConfig(Collections.unmodifiableMap(this.values)); for (Map.Entry<String, Object> update : configUpdates.entrySet()) { this.values.put(update.getKey(), update.getValue()); } definition.parse(this.values); this.used = Collections.synchronizedSet(new HashSet<>()); this.definition = definition; if (doLog) logAll(); }