]> source.dussan.org Git - sonarqube.git/commitdiff
Fix Quality flaws around NPE
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 11 Nov 2016 11:34:11 +0000 (12:34 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 11 Nov 2016 11:34:11 +0000 (12:34 +0100)
server/sonar-server/src/main/java/org/sonar/server/plugins/ws/PluginWSCommons.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/DeselectAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/SelectAction.java

index 2bace2346549d48e0b06dc6df9dff91ff9e79424..63012719a7c02be95e687e2eb772ea46fc5b577b 100644 (file)
@@ -29,6 +29,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
+import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import org.sonar.api.utils.text.JsonWriter;
@@ -269,7 +270,8 @@ public class PluginWSCommons {
     }
   }
 
-  static String categoryOrNull(Plugin plugin) {
+  @CheckForNull
+  static String categoryOrNull(@Nullable Plugin plugin) {
     return plugin != null ? plugin.getCategory() : null;
   }
 
index 29c947d5afa12dcf4ca1f146ff5e13676ec519e4..b90315ff2281fe33fd9b09d8a51af3347e1c63ad 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.qualitygate.ws;
 
 import com.google.common.base.Optional;
-import org.elasticsearch.common.Nullable;
+import javax.annotation.Nullable;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
index c4ea2e424e7610aed966daea7b28d9b508e0d723..318c11ee04e41afd7b9bb22c3ed14db479e5c472 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.qualitygate.ws;
 
 import com.google.common.base.Optional;
-import org.elasticsearch.common.Nullable;
+import javax.annotation.Nullable;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;