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

LoaderUtil getClassLoaders() method and while loops

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.9.1
    • 2.11.0
    • Core
    • 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

        Activity

          People

            rgoers Ralph Goers
            andrejusc Andrejus Chaliapinas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: