Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2104

LoaderUtil getClassLoaders() method and while loops

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.1
    • Fix Version/s: 2.11.0
    • Component/s: Core
    • Labels:
      None

      Description

      For v2.9.1 inside org.apache.logging.log4j.util.LoaderUtil and getClassLoaders() method we have lines 120-123 as such:

      ClassLoader parent = tcl;
      while (parent != null && !classLoaders.contains(parent))

      { classLoaders.add(parent); }

      where it looks like some getParent() call is either missing or otherwise "while" loop is not needed.

      In line 111 tcl classloader already added into list of clasloaders:
      classLoaders.add(tcl);

      Was it an attempt to add all classloaders hierarchy or just some immediate parents?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ralph.goers@dslextreme.com Ralph Goers
                Reporter:
                andrejusc Andrejus Chaliapinas
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: