diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-09-08 17:09:14 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-09-08 17:09:14 +0200 |
commit | 558f0931a7a98cbbef3933ca941af98128b59672 (patch) | |
tree | 4f722bdee9eb4c8066449362c1e9281cbbab1f23 /sonar-duplications/src/main | |
parent | 0e16e7b3c59a1feb9068d648169d50f4b6a323fb (diff) | |
download | sonarqube-558f0931a7a98cbbef3933ca941af98128b59672.tar.gz sonarqube-558f0931a7a98cbbef3933ca941af98128b59672.zip |
Fix Quality flaws
Diffstat (limited to 'sonar-duplications/src/main')
-rw-r--r-- | sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |