From 6e33f0e2fb843040eb8b74bd71c0db2383cc8903 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Fri, 3 Feb 2017 16:18:52 +0100 Subject: [PATCH] Fix quality flaw --- .../main/java/org/sonar/server/metric/ws/DeleteAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.39.5