"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.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).

DefaultThreadContextMap.java  (apache-log4j-2.11.1-src):DefaultThreadContextMap.java  (apache-log4j-2.11.2-src)
skipping to change at line 157 skipping to change at line 157
@Override @Override
public <V> void forEach(final BiConsumer<String, ? super V> action) { public <V> void forEach(final BiConsumer<String, ? super V> action) {
final Map<String, String> map = localMap.get(); final Map<String, String> map = localMap.get();
if (map == null) { if (map == null) {
return; return;
} }
for (final Map.Entry<String, String> entry : map.entrySet()) { for (final Map.Entry<String, String> entry : map.entrySet()) {
//BiConsumer should be able to handle values of any type V. In our c ase the values are of type String. //BiConsumer should be able to handle values of any type V. In our c ase the values are of type String.
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
final
V value = (V) entry.getValue(); V value = (V) entry.getValue();
action.accept(entry.getKey(), value); action.accept(entry.getKey(), value);
} }
} }
@Override @Override
public <V, S> void forEach(final TriConsumer<String, ? super V, S> action, f inal S state) { public <V, S> void forEach(final TriConsumer<String, ? super V, S> action, f inal S state) {
final Map<String, String> map = localMap.get(); final Map<String, String> map = localMap.get();
if (map == null) { if (map == null) {
return; return;
} }
for (final Map.Entry<String, String> entry : map.entrySet()) { for (final Map.Entry<String, String> entry : map.entrySet()) {
//TriConsumer should be able to handle values of any type V. In our case the values are of type String. //TriConsumer should be able to handle values of any type V. In our case the values are of type String.
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
final
V value = (V) entry.getValue(); V value = (V) entry.getValue();
action.accept(entry.getKey(), value, state); action.accept(entry.getKey(), value, state);
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public <V> V getValue(final String key) { public <V> V getValue(final String key) {
final Map<String, String> map = localMap.get(); final Map<String, String> map = localMap.get();
return (V) (map == null ? null : map.get(key)); return (V) (map == null ? null : map.get(key));
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added

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