/** * <p>Compare the properties of this config with that of the given and * copy those that are not present. This method is used by subclasses * that support configuration inheritance.</p> * * @param baseConfig The config object to copy properties from. */ protected void inheritProperties(BaseConfig baseConfig) { throwIfConfigured(); // Inherit forward properties Properties baseProperties = baseConfig.getProperties(); Enumeration keys = baseProperties.propertyNames(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); // Check if we have this property before copying it String value = this.getProperty(key); if (value == null) { value = baseProperties.getProperty(key); setProperty(key, value); } } }