]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6376 fix missing package-info + some sonar issues 218/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 17 Apr 2015 14:44:03 +0000 (16:44 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 17 Apr 2015 14:46:14 +0000 (16:46 +0200)
server/sonar-server/src/main/java/org/sonar/server/plugins/ws/InstalledPluginsWsAction.java
server/sonar-server/src/main/java/org/sonar/server/plugins/ws/package-info.java [new file with mode: 0644]

index 97d6f462d65da6f757cb173f443d96a4577abc66..0a904d4463becd4acc6452820bd4e390e5065d97 100644 (file)
@@ -31,6 +31,7 @@ import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.api.utils.text.JsonWriter;
 
+import javax.annotation.Nullable;
 import java.util.Collection;
 import java.util.SortedSet;
 
@@ -147,8 +148,8 @@ public class InstalledPluginsWsAction implements PluginsWsAction {
     INSTANCE;
 
     @Override
-    public boolean apply(PluginMetadata input) {
-      return !input.isCore();
+    public boolean apply(@Nullable PluginMetadata input) {
+      return input != null && !input.isCore();
     }
   }
 
@@ -156,7 +157,10 @@ public class InstalledPluginsWsAction implements PluginsWsAction {
     INSTANCE;
 
     @Override
-    public String apply(PluginMetadata input) {
+    public String apply(@Nullable PluginMetadata input) {
+      if (input == null) {
+        return null;
+      }
       return input.getName();
     }
   }
@@ -165,7 +169,10 @@ public class InstalledPluginsWsAction implements PluginsWsAction {
     INSTANCE;
 
     @Override
-    public String apply(PluginMetadata input) {
+    public String apply(@Nullable PluginMetadata input) {
+      if (input == null) {
+        return null;
+      }
       return input.getKey();
     }
   }
diff --git a/server/sonar-server/src/main/java/org/sonar/server/plugins/ws/package-info.java b/server/sonar-server/src/main/java/org/sonar/server/plugins/ws/package-info.java
new file mode 100644 (file)
index 0000000..1267e73
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+@ParametersAreNonnullByDefault
+package org.sonar.server.plugins.ws;
+
+import javax.annotation.ParametersAreNonnullByDefault;