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

MarkerManager Log4jMarker.hasParents() returns opposite of correct result

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.2
    • 2.1
    • API

    Description

      Log4JMarker.hasParents() will return false when the marker has parents, and true when it has none.

      The javadoc in the Marker interface indicates it should function the other way around:

      "Indicates whether this Marker has references to any other Markers. Return true if the Marker has parent Markers"

      The code for the implementation (that I could find) demonstrates that it would function in the opposite way as it is described in that javadoc:

      @Override 
      public boolean hasParents() { 
           return this.parents == null; 
      }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            erichsend David Erichsen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment