carterkozak commented on a change in pull request #328: LOG4J2-2754:
LoaderUtil.getClassLoaders may discover additional loaders
URL: https://github.com/apache/logging-log4j2/pull/328#discussion_r362274678
##########
File path:
log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
##########
@@ -106,30 +104,31 @@ public ClassLoader run() {
}
public static ClassLoader[] getClassLoaders() {
- final List<ClassLoader> classLoaders = new ArrayList<>();
+ final Collection<ClassLoader> classLoaders = new LinkedHashSet<>();
Review comment:
LinkedHashSet is more expensive in environments with few values, but
performs better in the worst case without sacrificing order.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services