aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-04-27 16:52:34 +0200
committerDavid Gageot <david@gageot.net>2012-04-27 16:54:39 +0200
commit12607cffa7f6389e0bc6e921a6e48cb3c5da3c47 (patch)
tree9885b45cf8fd3726e2445da51ba1e6b4b1b2a95a
parent9e1a2abf9da026c059442381b84b45d0712b7258 (diff)
downloadsonarqube-12607cffa7f6389e0bc6e921a6e48cb3c5da3c47.tar.gz
sonarqube-12607cffa7f6389e0bc6e921a6e48cb3c5da3c47.zip
Code cleaning : Methods overriding equals() should override hashCode()
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/ModuleTest.java6
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/BadDatabaseVersion.java2
2 files changed, 7 insertions, 1 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ModuleTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ModuleTest.java
index 7aaf09d1253..ae134ec1e95 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ModuleTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ModuleTest.java
@@ -105,9 +105,15 @@ public class ModuleTest {
}
}
+ @Override
public boolean equals(Object obj) {
return false;
}
+
+ @Override
+ public int hashCode() {
+ return 42;
+ }
}
public static class FakeService {
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/BadDatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/BadDatabaseVersion.java
index fee98c3f51d..1b8af946e57 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/BadDatabaseVersion.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/BadDatabaseVersion.java
@@ -25,7 +25,7 @@ public final class BadDatabaseVersion extends RuntimeException {
}
@Override
- public Throwable fillInStackTrace() {
+ public synchronized Throwable fillInStackTrace() {
return this;
}
}