From a00b76dd1b57d56fd06797b79b6b62bd1b5fcf9d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 25 May 2012 15:51:44 +0200 Subject: Fix some quality flaws --- .../src/main/java/org/sonar/duplications/DuplicationPredicates.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sonar-duplications/src/main') diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/DuplicationPredicates.java b/sonar-duplications/src/main/java/org/sonar/duplications/DuplicationPredicates.java index a6e05179fae..ce38086485a 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/DuplicationPredicates.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/DuplicationPredicates.java @@ -23,6 +23,8 @@ import com.google.common.annotations.Beta; import com.google.common.base.Predicate; import org.sonar.duplications.index.CloneGroup; +import javax.annotation.Nullable; + @Beta public final class DuplicationPredicates { @@ -40,8 +42,8 @@ public final class DuplicationPredicates { this.min = min; } - public boolean apply(CloneGroup input) { - return input.getLengthInUnits() >= min; + public boolean apply(@Nullable CloneGroup input) { + return input != null && input.getLengthInUnits() >= min; } } -- cgit v1.2.3