@Override public synchronized Object merge(Object key, Object value, BiFunction remappingFunction) { if (interned != null) copyFromInternedToThis(); return super.merge(key, value, remappingFunction); }
/** * Loads the {@link RunnerModuleUtils#EXCLUDED_PROPERTIES_FILE} resources files, merges the entries so only one * {@link Properties} is returned with all values. * * @return a {@link Properties} loaded with the content of the file. * @throws IOException if the properties couldn't load the file. * @throws IllegalStateException if the file couldn't be found. */ public static final Properties getExcludedProperties() throws IllegalStateException, IOException { Properties excludedProperties = new Properties(); discoverProperties(EXCLUDED_PROPERTIES_FILE).stream() .forEach(properties -> properties.forEach((k, v) -> excludedProperties.merge(k, v, (v1, v2) -> v1 + "," + v2))); return excludedProperties; } }
@Override public synchronized Object merge(Object key, Object value, BiFunction remappingFunction) { if (interned != null) copyFromInternedToThis(); return super.merge(key, value, remappingFunction); }
/** * Loads the {@link RunnerModuleUtils#EXCLUDED_PROPERTIES_FILE} resources files, merges the entries so only one * {@link Properties} is returned with all values. * * @return a {@link Properties} loaded with the content of the file. * @throws IOException if the properties couldn't load the file. * @throws IllegalStateException if the file couldn't be found. */ public static final Properties getExcludedProperties() throws IllegalStateException, IOException { Properties excludedProperties = new Properties(); discoverProperties(EXCLUDED_PROPERTIES_FILE).stream() .forEach(properties -> properties.forEach((k, v) -> excludedProperties.merge(k, v, (v1, v2) -> v1 + "," + v2))); return excludedProperties; } }
@Override public synchronized Object merge(Object key, Object value, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction) { Objects.requireNonNull(remappingFunction); // If the specified key is not already associated with a value or is associated with null, associates it with // the given non-null value. if (get(key) == null) { putIfAbsent(key, value); return value; } if (CRYPTO_PROPS.contains(key)) { // Crypto properties are not themselves encrypted Object newValue = super.merge(key, value, remappingFunction); resetCrypto(); return newValue; } String sKey = (String) key; String sValue = (String) value; if (Crypto.isEncrypted(sValue)) { encrypted.put(sKey, sValue); sValue = new String(crypto.decrypt(sValue)); } return super.merge(sKey, sValue, remappingFunction); }