diff options
author | Dinesh Bolkensteyn <dinesh@dinsoft.net> | 2011-11-04 03:07:14 +0100 |
---|---|---|
committer | Dinesh Bolkensteyn <dinesh@dinsoft.net> | 2011-11-04 03:07:14 +0100 |
commit | 8c4d787e20a63ece8620eac0a7686cb16dc536a7 (patch) | |
tree | a2642dcf1203930a7368d321299dc4d88f91286f /plugins/sonar-squid-java-plugin | |
parent | 864074371dfab99295891f24871fa4655b15652f (diff) | |
download | sonarqube-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.java | 5 |
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; } |