aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api-impl/src/main
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2021-11-18 16:45:02 -0600
committersonartech <sonartech@sonarsource.com>2021-11-20 20:03:51 +0000
commit3f9445c25962f914ccdd889c002ddd8e19b0cf89 (patch)
treeeb4f34a62b7164a71fd0bbe34d6f59621a687d8d /sonar-plugin-api-impl/src/main
parentaa640be9e2b9cfa2c027ef0768940b31ebb5536c (diff)
downloadsonarqube-3f9445c25962f914ccdd889c002ddd8e19b0cf89.tar.gz
sonarqube-3f9445c25962f914ccdd889c002ddd8e19b0cf89.zip
Improve code quality
Diffstat (limited to 'sonar-plugin-api-impl/src/main')
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java3
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/ws/SimpleGetRequest.java2
2 files changed, 1 insertions, 4 deletions
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java
index b8baf578ee8..81f0cf06059 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java
@@ -260,7 +260,6 @@ public class SensorContextTester implements SensorContext {
public Integer lineHits(String fileKey, int line) {
return sensorStorage.coverageByComponent.getOrDefault(fileKey, Collections.emptyList()).stream()
.map(c -> c.hitsByLine().get(line))
- .flatMap(Stream::of)
.filter(Objects::nonNull)
.reduce(null, SensorContextTester::sumOrNull);
}
@@ -274,7 +273,6 @@ public class SensorContextTester implements SensorContext {
public Integer conditions(String fileKey, int line) {
return sensorStorage.coverageByComponent.getOrDefault(fileKey, Collections.emptyList()).stream()
.map(c -> c.conditionsByLine().get(line))
- .flatMap(Stream::of)
.filter(Objects::nonNull)
.reduce(null, SensorContextTester::maxOrNull);
}
@@ -283,7 +281,6 @@ public class SensorContextTester implements SensorContext {
public Integer coveredConditions(String fileKey, int line) {
return sensorStorage.coverageByComponent.getOrDefault(fileKey, Collections.emptyList()).stream()
.map(c -> c.coveredConditionsByLine().get(line))
- .flatMap(Stream::of)
.filter(Objects::nonNull)
.reduce(null, SensorContextTester::maxOrNull);
}
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/ws/SimpleGetRequest.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/ws/SimpleGetRequest.java
index 153788121a3..08132cf0cf0 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/ws/SimpleGetRequest.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/ws/SimpleGetRequest.java
@@ -68,7 +68,7 @@ public class SimpleGetRequest extends Request {
@Override
public boolean hasParam(String key) {
- return params.keySet().contains(key);
+ return params.containsKey(key);
}
@Override