From: Teryk Bellahsene Date: Fri, 3 Feb 2017 15:18:52 +0000 (+0100) Subject: Fix quality flaw X-Git-Tag: 6.3-RC1~218 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6e33f0e2fb843040eb8b74bd71c0db2383cc8903;p=sonarqube.git Fix quality flaw --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/metric/ws/DeleteAction.java b/server/sonar-server/src/main/java/org/sonar/server/metric/ws/DeleteAction.java index 9973cc534d3..8babd2792d0 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/metric/ws/DeleteAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/metric/ws/DeleteAction.java @@ -82,10 +82,10 @@ public class DeleteAction implements MetricsWsAction { List idsAsStrings = request.paramAsStrings(PARAM_IDS); List keys = request.paramAsStrings(PARAM_KEYS); checkArgument(idsAsStrings != null || keys != null, "Ids or keys must be provided."); - List ids = null; + List ids; if (idsAsStrings != null) { ids = Lists.transform(idsAsStrings, Integer::valueOf); - } else if (keys != null) { + } else { ids = Lists.transform(dbClient.metricDao().selectByKeys(dbSession, keys), MetricDto::getId); }