aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-10-17 11:40:07 +0200
committerSonarTech <sonartech@sonarsource.com>2018-10-17 20:20:51 +0200
commit2ac8cc7079636cdedeee391d406676979b02d125 (patch)
treea41c66c02d50694e87ebc043c5faf3904c868264
parentb6c9fddb67fbac50ba4c8b22772044621d239ae7 (diff)
downloadsonarqube-2ac8cc7079636cdedeee391d406676979b02d125.tar.gz
sonarqube-2ac8cc7079636cdedeee391d406676979b02d125.zip
fix quality flaws
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java b/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
index e56b873797e..8482626bb25 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
@@ -90,9 +90,9 @@ public class DuplicationsParser {
if (component == null) {
Optional<ComponentDto> componentDtoOptional;
if (branch != null) {
- componentDtoOptional = Optional.ofNullable(componentDao.selectByKeyAndBranch(session, componentKey, branch).orElseGet(null));
+ componentDtoOptional = componentDao.selectByKeyAndBranch(session, componentKey, branch);
} else if (pullRequest != null) {
- componentDtoOptional = Optional.ofNullable(componentDao.selectByKeyAndPullRequest(session, componentKey, pullRequest).orElseGet(null));
+ componentDtoOptional = componentDao.selectByKeyAndPullRequest(session, componentKey, pullRequest);
} else {
componentDtoOptional = componentDao.selectByKey(session, componentKey);
}