diff options
Diffstat (limited to 'sonar-core/src')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/source/OpeningHtmlTag.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/source/OpeningHtmlTag.java b/sonar-core/src/main/java/org/sonar/core/source/OpeningHtmlTag.java index 5dd959681dd..54b95e7542d 100644 --- a/sonar-core/src/main/java/org/sonar/core/source/OpeningHtmlTag.java +++ b/sonar-core/src/main/java/org/sonar/core/source/OpeningHtmlTag.java @@ -45,14 +45,7 @@ class OpeningHtmlTag { if (o == null || getClass() != o.getClass()) { return false; } - OpeningHtmlTag openingHtmlTag = (OpeningHtmlTag) o; - if (startOffset != openingHtmlTag.startOffset) { - return false; - } - if (cssClass != null ? !cssClass.equals(openingHtmlTag.cssClass) : openingHtmlTag.cssClass != null) { - return false; - } - return true; + return compareTo((OpeningHtmlTag) o); } @Override @@ -61,4 +54,14 @@ class OpeningHtmlTag { result = 31 * result + (cssClass != null ? cssClass.hashCode() : 0); return result; } + + private boolean compareTo(OpeningHtmlTag otherTag) { + if (startOffset != otherTag.startOffset) { + return false; + } + if (cssClass != null ? !cssClass.equals(otherTag.cssClass) : otherTag.cssClass != null) { + return false; + } + return true; + } } |