This is an automated email from the ASF dual-hosted git repository.
stefanegli pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-impl.git
The following commit(s) were added to refs/heads/master by this push:
new 5fe7814 Strings and Boxed types should be compared using "equals()"
new e5caf14 Merge pull request #1 from HarisAdzemovic/boxedTypesEquals
5fe7814 is described below
commit 5fe781459a8ffe6afc14280e3860da49cfa6eea0
Author: Haris Adzemovic <[email protected]>
AuthorDate: Mon Nov 4 11:43:01 2019 +0100
Strings and Boxed types should be compared using "equals()"
This fixes 1 Sonarqube violation of rule S4973:
https://rules.sonarsource.com/java/RSPEC-4973
Sonarcloud violation URL:
https://sonarcloud.io/organizations/apache/issues?open=AWpM6AUjyRjJygCrlORM&resolved=false&rules=squid%3AS4973
---
.../java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
b/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
index a9e9485..eeb2211 100644
---
a/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
+++
b/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
@@ -388,7 +388,7 @@ public class VotingView extends View {
}
} else if (v instanceof Boolean) {
Boolean b = (Boolean)v;
- if (b == vote) {
+ if (b.equals(vote)) {
logger.debug("vote: already voted, with same vote
("+vote+"), not voting again");
shouldVote = false;
}