From 558f0931a7a98cbbef3933ca941af98128b59672 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 8 Sep 2016 17:09:14 +0200 Subject: [PATCH] Fix Quality flaws --- .../detector/original/OriginalCloneDetectionAlgorithm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.39.5