You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "JC (JIRA)" <ji...@apache.org> on 2017/02/10 23:41:41 UTC

[jira] [Created] (SLING-6517) A condition that is always true.

JC created SLING-6517:
-------------------------

             Summary: A condition that is always true.
                 Key: SLING-6517
                 URL: https://issues.apache.org/jira/browse/SLING-6517
             Project: Sling
          Issue Type: Bug
            Reporter: JC
            Priority: Trivial


I've recently found a condition that always returns true from the current Github snapshot.

Path: contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/components/TraxErrorHandler.java

{code:java}
 86     private String getMessage(TransformerException exception) {
 87         SourceLocator locator = exception.getLocator();
 88         if (locator != null) {
 89             String id = (!locator.getPublicId().equals(locator.getPublicId()))
 90                     ? locator.getPublicId()
 91                     : (null != locator.getSystemId())
 92                     ? locator.getSystemId() : "SystemId Unknown";
 93             return "File " + id
 94                    + "; Line " + locator.getLineNumber()
 95                    + "; Column " + locator.getColumnNumber()
 96                    + "; " + exception.getMessage();
 97         }
 98         return exception.getMessage();
 99     }
100 }
{code}

In Line 89, locator.getPublicId().equals(locator.getPublicId()) compares the same Id. It looks like a minor issue and typos but wanted to report just in case.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)