aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-squid-java-plugin
diff options
context:
space:
mode:
authorDinesh Bolkensteyn <dinesh@dinsoft.net>2011-11-04 03:07:14 +0100
committerDinesh Bolkensteyn <dinesh@dinsoft.net>2011-11-04 03:07:14 +0100
commit8c4d787e20a63ece8620eac0a7686cb16dc536a7 (patch)
treea2642dcf1203930a7368d321299dc4d88f91286f /plugins/sonar-squid-java-plugin
parent864074371dfab99295891f24871fa4655b15652f (diff)
downloadsonarqube-8c4d787e20a63ece8620eac0a7686cb16dc536a7.tar.gz
sonarqube-8c4d787e20a63ece8620eac0a7686cb16dc536a7.zip
Fix a violation
Diffstat (limited to 'plugins/sonar-squid-java-plugin')
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/visitor/LCOM4Visitor.java5
1 files changed, 4 insertions, 1 deletions
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 31059478c96..4360e1ea229 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,7 +115,10 @@ public class LCOM4Visitor extends BytecodeVisitor {
Set<AsmResource> blockA = getOrCreateResourceBlock(resourceA);
Set<AsmResource> blockB = getOrCreateResourceBlock(resourceB);
- if (blockA.equals(blockB)) {
+ // getOrCreateResourceBlock() returns the same block instance if resourceA and resourceB are identical or already in the same block
+ // TODO: Avoid this violation by using a Disjoint Union Set which is also more efficient performance-wise
+ // See: http://en.wikipedia.org/wiki/Disjoint-set_data_structure
+ if (blockA == blockB) { // NOSONAR false-positive Compare Objects With Equals
return;
}