You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "David Erichsen (JIRA)" <ji...@apache.org> on 2014/09/04 22:00:23 UTC
[jira] [Updated] (LOG4J2-813) MarkerManager
Log4jMarker.hasParents() returns opposite of correct result
[ https://issues.apache.org/jira/browse/LOG4J2-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Erichsen updated LOG4J2-813:
----------------------------------
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:
{quote}
"Indicates whether this Marker has references to any other Markers. Return true if the Marker has parent Markers"
{quote}
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:
{code}
@Override
public boolean hasParents() {
return this.parents == null;
}
{code}
was:
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 {@code 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:
229 @Override
230 public boolean hasParents() {
231 return this.parents == null;
232 }
> MarkerManager Log4jMarker.hasParents() returns opposite of correct result
> -------------------------------------------------------------------------
>
> Key: LOG4J2-813
> URL: https://issues.apache.org/jira/browse/LOG4J2-813
> Project: Log4j 2
> Issue Type: Bug
> Components: API
> Affects Versions: 2.0.2
> Reporter: David Erichsen
> Priority: Minor
> Labels: newbie
>
> 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:
> {quote}
> "Indicates whether this Marker has references to any other Markers. Return true if the Marker has parent Markers"
> {quote}
> 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:
> {code}
> @Override
> public boolean hasParents() {
> return this.parents == null;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org