]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10002 use EditionBundledPlugins#isEditionBundled in installer
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 17 Oct 2017 16:29:24 +0000 (18:29 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Mon, 23 Oct 2017 15:01:13 +0000 (08:01 -0700)
server/sonar-server/src/main/java/org/sonar/server/plugins/edition/EditionInstaller.java

index 057cbe0a8e27620a8e5361c370b7c1f6e22c53b9..bba40e79e3ca66483ea1d329a3ab0ca6024b339d 100644 (file)
@@ -59,8 +59,7 @@ public class EditionInstaller {
 
   /**
    * Refreshes the update center, and submits in a executor a task to download all the needed plugins (asynchronously).
-   * If the update center is disabled or if we are offline, the task is not submitted and false is returned.
-   * In all case
+   * If the update center is disabled or if we are offline, the task is not submitted.
    *
    * @throws IllegalStateException if an installation is already in progress
    */
@@ -134,7 +133,7 @@ public class EditionInstaller {
 
   private Set<String> pluginsToRemove(Set<String> editionPluginKeys, Collection<PluginInfo> installedPluginInfos) {
     Set<String> installedCommercialPluginKeys = installedPluginInfos.stream()
-      .filter(EditionInstaller::isSonarSourceCommercialPlugin)
+      .filter(EditionBundledPlugins::isEditionBundled)
       .map(PluginInfo::getKey)
       .collect(Collectors.toSet());
 
@@ -143,8 +142,4 @@ public class EditionInstaller {
       .collect(Collectors.toSet());
   }
 
-  private static boolean isSonarSourceCommercialPlugin(PluginInfo pluginInfo) {
-    return "Commercial".equals(pluginInfo.getLicense()) && "SonarSource".equals(pluginInfo.getOrganizationName());
-  }
-
 }