[
https://issues.apache.org/jira/browse/LOG4J2-2389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
LIU WEN updated LOG4J2-2389:
----------------------------
Description:
* fix the CacheEntry map in ThrowableProxy#toExtendedStackTrace to be put and
gotten with same key
* stackTraceElement.toString() returns a string representation of this stack
trace element, just as MyClass.mash(MyClass.java)
* stackTraceElement.getClassName() returns the fully qualified name of the
Class, just as org.apache.logging.log4j.MyClass
{code:java}
final String className = stackTraceElement.getClassName();
……
final CacheEntry cacheEntry = map.get(className);
if (cacheEntry != null) {
final CacheEntry entry = cacheEntry;
extClassInfo = entry.element;
if (entry.loader != null) {
lastLoader = entry.loader;
}
} else {
final CacheEntry entry = this.toCacheEntry(stackTraceElement,
this.loadClass(lastLoader, className), false);
extClassInfo = entry.element;
map.put(stackTraceElement.toString(), entry);
if (entry.loader != null) {
lastLoader = entry.loader;
}
}
{code}
- The main impact of the problem
was:
* fix the CacheEntry map in ThrowableProxy#toExtendedStackTrace to be put and
gotten with same key
* stackTraceElement.toString() returns a string representation of this stack
trace element, just as MyClass.mash(MyClass.java)
* stackTraceElement.getClassName() returns the fully qualified name of the
Class, just as org.apache.logging.log4j.MyClass
{code:java}
final String className = stackTraceElement.getClassName();
……
final CacheEntry cacheEntry = map.get(className);
if (cacheEntry != null) {
final CacheEntry entry = cacheEntry;
extClassInfo = entry.element;
if (entry.loader != null) {
lastLoader = entry.loader;
}
} else {
final CacheEntry entry = this.toCacheEntry(stackTraceElement,
this.loadClass(lastLoader, className), false);
extClassInfo = entry.element;
map.put(stackTraceElement.toString(), entry);
if (entry.loader != null) {
lastLoader = entry.loader;
}
}
{code}
> fix the CacheEntry map in ThrowableProxy#toExtendedStackTrace to be put and
> gotten with same key
> ------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-2389
> URL: https://issues.apache.org/jira/browse/LOG4J2-2389
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.6.2, 2.7, 2.8, 2.8.1, 2.8.2, 2.9.0, 2.9.1, 2.10.0,
> 2.11.0
> Reporter: LIU WEN
> Priority: Major
>
> * fix the CacheEntry map in ThrowableProxy#toExtendedStackTrace to be put and
> gotten with same key
> * stackTraceElement.toString() returns a string representation of this stack
> trace element, just as MyClass.mash(MyClass.java)
> * stackTraceElement.getClassName() returns the fully qualified name of the
> Class, just as org.apache.logging.log4j.MyClass
> {code:java}
> final String className = stackTraceElement.getClassName();
> ……
> final CacheEntry cacheEntry = map.get(className);
> if (cacheEntry != null) {
> final CacheEntry entry = cacheEntry;
> extClassInfo = entry.element;
> if (entry.loader != null) {
> lastLoader = entry.loader;
> }
> } else {
> final CacheEntry entry = this.toCacheEntry(stackTraceElement,
> this.loadClass(lastLoader, className), false);
> extClassInfo = entry.element;
> map.put(stackTraceElement.toString(), entry);
> if (entry.loader != null) {
> lastLoader = entry.loader;
> }
> }
> {code}
> - The main impact of the problem
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)