aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDinesh Bolkensteyn <dinesh@dinsoft.net>2011-11-03 09:59:01 +0100
committerDinesh Bolkensteyn <dinesh@dinsoft.net>2011-11-03 09:59:01 +0100
commitd234f0fbdb75112af3f39a9b4fb85ac9fe0552ed (patch)
tree7fcaa5058bd25a806fe8d996a5e35d47277d144f /plugins
parent93e0c16896e6583a52adc77e7407336b623f9759 (diff)
downloadsonarqube-d234f0fbdb75112af3f39a9b4fb85ac9fe0552ed.tar.gz
sonarqube-d234f0fbdb75112af3f39a9b4fb85ac9fe0552ed.zip
Fixed some violations
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java2
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/visitor/LCOM4Visitor.java3
2 files changed, 2 insertions, 3 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java
index daf10992298..fe777498e1a 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java
@@ -190,7 +190,7 @@ public class AsmMethod extends AsmResource {
}
private boolean isMethodNotAccessorOrAccessingDifferentField(AsmMethod method) {
- return !method.isAccessor() || (accessedField != null && accessedField != method.getAccessedField());
+ return !method.isAccessor() || (accessedField != null && !accessedField.equals(method.getAccessedField()));
}
private boolean isFieldAccesingDifferentField(AsmField field) {
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/visitor/LCOM4Visitor.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/visitor/LCOM4Visitor.java
index 2bfd6d1cde6..31059478c96 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/visitor/LCOM4Visitor.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/visitor/LCOM4Visitor.java
@@ -115,8 +115,7 @@ public class LCOM4Visitor extends BytecodeVisitor {
Set<AsmResource> blockA = getOrCreateResourceBlock(resourceA);
Set<AsmResource> blockB = getOrCreateResourceBlock(resourceB);
- // getOrCreateResourceBlock() returns the same block instance if resourceA and resourceB are identical or already in the same block
- if (blockA == blockB) { // NOSONAR false-positive Compare Objects With Equals
+ if (blockA.equals(blockB)) {
return;
}