diff options
author | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-05-30 10:32:04 +0200 |
---|---|---|
committer | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-05-30 10:32:04 +0200 |
commit | a9882f1d1b2e0fa5f89e3e8ee7c536b4ddc94c6e (patch) | |
tree | a2b192ab3d4947ae5f4c0f87156a181751ee0156 /sonar-core | |
parent | 472b1db308672f592f984b253ac7aa245db68452 (diff) | |
download | sonarqube-a9882f1d1b2e0fa5f89e3e8ee7c536b4ddc94c6e.tar.gz sonarqube-a9882f1d1b2e0fa5f89e3e8ee7c536b4ddc94c6e.zip |
Fixed quality issues
Diffstat (limited to 'sonar-core')
-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; + } } |