From: Simon Brandhof Date: Thu, 8 Sep 2016 15:09:14 +0000 (+0200) Subject: Fix Quality flaws X-Git-Tag: 6.1-RC1~177 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=558f0931a7a98cbbef3933ca941af98128b59672;p=sonarqube.git Fix Quality flaws --- diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java index be93463a5e4..46e57fa9209 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java @@ -156,7 +156,7 @@ public final class OriginalCloneDetectionAlgorithm { // fixed order) is equal to f(j) and only report in this case. Block first = currentBlocksGroup.first(originResourceId); - if (first.getIndexInFile() == j - 2) { + if (first != null && first.getIndexInFile() == j - 2) { // Godin: We report clones, which start in i-1 and end in j-2, so length is j-2-(i-1)+1=j-i reportClones(sameHashBlocksGroups[i], currentBlocksGroup, j - i); }