"Fossies" - the Fresh Open Source Software Archive  

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

CopyOnWriteSortedArrayThreadContextMap.java  (apache-log4j-2.11.1-src):CopyOnWriteSortedArrayThreadContextMap.java  (apache-log4j-2.11.2-src)
skipping to change at line 91 skipping to change at line 91
// LOG4J2-479: by default, use a plain ThreadLocal, only use InheritableThre adLocal if configured. // LOG4J2-479: by default, use a plain ThreadLocal, only use InheritableThre adLocal if configured.
// (This method is package protected for JUnit tests.) // (This method is package protected for JUnit tests.)
private ThreadLocal<StringMap> createThreadLocalMap() { private ThreadLocal<StringMap> createThreadLocalMap() {
if (inheritableMap) { if (inheritableMap) {
return new InheritableThreadLocal<StringMap>() { return new InheritableThreadLocal<StringMap>() {
@Override @Override
protected StringMap childValue(final StringMap parentValue) { protected StringMap childValue(final StringMap parentValue) {
if (parentValue == null) { if (parentValue == null) {
return null; return null;
} }
StringMap stringMap = createStringMap(parentValue); final StringMap stringMap = createStringMap(parentValue);
stringMap.freeze(); stringMap.freeze();
return stringMap; return stringMap;
} }
}; };
} }
// if not inheritable, return plain ThreadLocal with null as initial val ue // if not inheritable, return plain ThreadLocal with null as initial val ue
return new ThreadLocal<>(); return new ThreadLocal<>();
} }
/** /**
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

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