aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-18 11:10:08 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-18 13:15:50 +0200
commit7cdbfc9e015093f8f2c58b43a106e6b347728bcf (patch)
tree1166f01640b49d9d142f7575fb1e27f60173401b /sonar-core
parent0dff22bda049bcb3f5fa8cb0bcb5d9ea8a80fe8c (diff)
downloadsonarqube-7cdbfc9e015093f8f2c58b43a106e6b347728bcf.tar.gz
sonarqube-7cdbfc9e015093f8f2c58b43a106e6b347728bcf.zip
Fix Quality flaws
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java15
-rw-r--r--sonar-core/src/main/java/org/sonar/core/util/stream/package-info.java24
2 files changed, 26 insertions, 13 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java b/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java
index d39c9349bf4..ee93e3cd55a 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java
@@ -26,7 +26,6 @@ import java.util.Collection;
import java.util.IdentityHashMap;
import java.util.Map;
import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
public class Tracking<RAW extends Trackable, BASE extends Trackable> {
@@ -39,19 +38,9 @@ public class Tracking<RAW extends Trackable, BASE extends Trackable> {
private final Collection<RAW> raws;
private final Collection<BASE> bases;
- private final Predicate<RAW> unmatchedRawPredicate = new Predicate<RAW>() {
- @Override
- public boolean apply(@Nonnull RAW raw) {
- return !rawToBase.containsKey(raw);
- }
- };
+ private final Predicate<RAW> unmatchedRawPredicate = raw -> !rawToBase.containsKey(raw);
- private final Predicate<BASE> unmatchedBasePredicate = new Predicate<BASE>() {
- @Override
- public boolean apply(@Nonnull BASE raw) {
- return !baseToRaw.containsKey(raw);
- }
- };
+ private final Predicate<BASE> unmatchedBasePredicate = raw -> !baseToRaw.containsKey(raw);
public Tracking(Input<RAW> rawInput, Input<BASE> baseInput) {
this.raws = rawInput.getIssues();
diff --git a/sonar-core/src/main/java/org/sonar/core/util/stream/package-info.java b/sonar-core/src/main/java/org/sonar/core/util/stream/package-info.java
new file mode 100644
index 00000000000..31da2808440
--- /dev/null
+++ b/sonar-core/src/main/java/org/sonar/core/util/stream/package-info.java
@@ -0,0 +1,24 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+@ParametersAreNonnullByDefault
+package org.sonar.core.util.stream;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+