"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java" between
apache-log4j-2.11.1-src.tar.gz and apache-log4j-2.11.2-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).

PropertiesUtil.java  (apache-log4j-2.11.1-src):PropertiesUtil.java  (apache-log4j-2.11.2-src)
skipping to change at line 181 skipping to change at line 181
* @return the Charset value of the property or {@code defaultValue} if unde fined. * @return the Charset value of the property or {@code defaultValue} if unde fined.
*/ */
public Charset getCharsetProperty(final String name, final Charset defaultVa lue) { public Charset getCharsetProperty(final String name, final Charset defaultVa lue) {
final String charsetName = getStringProperty(name); final String charsetName = getStringProperty(name);
if (charsetName == null) { if (charsetName == null) {
return defaultValue; return defaultValue;
} }
if (Charset.isSupported(charsetName)) { if (Charset.isSupported(charsetName)) {
return Charset.forName(charsetName); return Charset.forName(charsetName);
} }
ResourceBundle bundle = getCharsetsResourceBundle(); final ResourceBundle bundle = getCharsetsResourceBundle();
if (bundle.containsKey(name)) { if (bundle.containsKey(name)) {
String mapped = bundle.getString(name); final String mapped = bundle.getString(name);
if (Charset.isSupported(mapped)) { if (Charset.isSupported(mapped)) {
return Charset.forName(mapped); return Charset.forName(mapped);
} }
} }
LowLevelLogUtil.log("Unable to get Charset '" + charsetName + "' for pro perty '" + name + "', using default " LowLevelLogUtil.log("Unable to get Charset '" + charsetName + "' for pro perty '" + name + "', using default "
+ defaultValue + " and continuing."); + defaultValue + " and continuing.");
return defaultValue; return defaultValue;
} }
/** /**
skipping to change at line 319 skipping to change at line 319
*/ */
private static class Environment { private static class Environment {
private final Set<PropertySource> sources = new TreeSet<>(new PropertySo urce.Comparator()); private final Set<PropertySource> sources = new TreeSet<>(new PropertySo urce.Comparator());
private final Map<CharSequence, String> literal = new ConcurrentHashMap< >(); private final Map<CharSequence, String> literal = new ConcurrentHashMap< >();
private final Map<CharSequence, String> normalized = new ConcurrentHashM ap<>(); private final Map<CharSequence, String> normalized = new ConcurrentHashM ap<>();
private final Map<List<CharSequence>, String> tokenized = new Concurrent HashMap<>(); private final Map<List<CharSequence>, String> tokenized = new Concurrent HashMap<>();
private Environment(final PropertySource propertySource) { private Environment(final PropertySource propertySource) {
sources.add(propertySource); sources.add(propertySource);
for (final PropertySource source : ServiceLoader.load(PropertySource for (final ClassLoader classLoader : LoaderUtil.getClassL
.class)) { oaders()) {
sources.add(source); try {
} for (final PropertySource source : Servic
eLoader.load(PropertySource.class, classLoader)) {
sources.add(source);
}
} catch (final Throwable ex) {
/* Don't log anything to the console. It
may not be a problem that a PropertySource
* isn't accessible.
*/
}
}
reload(); reload();
} }
private synchronized void reload() { private synchronized void reload() {
literal.clear(); literal.clear();
normalized.clear(); normalized.clear();
tokenized.clear(); tokenized.clear();
for (final PropertySource source : sources) { for (final PropertySource source : sources) {
source.forEach(new BiConsumer<String, String>() { source.forEach(new BiConsumer<String, String>() {
@Override @Override
 End of changes. 3 change blocks. 
6 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)