]> source.dussan.org Git - sonarqube.git/commitdiff
Delete deprecated PropertiesDao
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 4 Apr 2018 12:45:19 +0000 (14:45 +0200)
committerSonarTech <sonartech@sonarsource.com>
Thu, 5 Apr 2018 18:20:48 +0000 (20:20 +0200)
server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
server/sonar-ce/src/main/java/org/sonar/ce/db/ReadOnlyPropertiesDao.java
server/sonar-ce/src/test/java/org/sonar/ce/db/ReadOnlyPropertiesDaoTest.java
server/sonar-db-dao/src/main/java/org/sonar/core/permission/ProjectPermissions.java
server/sonar-db-dao/src/main/java/org/sonar/core/persistence/MyBatis.java [deleted file]
server/sonar-db-dao/src/main/java/org/sonar/core/persistence/package-info.java [deleted file]
server/sonar-db-dao/src/main/java/org/sonar/core/properties/PropertiesDao.java [deleted file]
server/sonar-db-dao/src/main/java/org/sonar/core/properties/PropertyDto.java [deleted file]
server/sonar-db-dao/src/main/java/org/sonar/core/properties/package-info.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java

index fab459bc449486d20f54b62b410a80d2332cd035..58c0c97ec50c3308555468953ae8efa99359ae02 100644 (file)
@@ -73,6 +73,7 @@ import org.sonar.db.DaoModule;
 import org.sonar.db.DatabaseChecker;
 import org.sonar.db.DbClient;
 import org.sonar.db.DefaultDatabase;
+import org.sonar.db.MyBatis;
 import org.sonar.db.purge.PurgeProfiler;
 import org.sonar.process.NetworkUtilsImpl;
 import org.sonar.process.Props;
@@ -84,6 +85,7 @@ import org.sonar.server.computation.task.projectanalysis.ProjectAnalysisTaskModu
 import org.sonar.server.config.ConfigurationProvider;
 import org.sonar.server.debt.DebtModelPluginRepository;
 import org.sonar.server.debt.DebtRulesXMLImporter;
+import org.sonar.server.es.EsModule;
 import org.sonar.server.es.ProjectIndexersImpl;
 import org.sonar.server.event.NewAlerts;
 import org.sonar.server.favorite.FavoriteUpdater;
@@ -146,7 +148,6 @@ import org.sonar.server.rule.DefaultRuleFinder;
 import org.sonar.server.rule.DeprecatedRulesDefinitionLoader;
 import org.sonar.server.rule.RuleDefinitionsLoader;
 import org.sonar.server.rule.index.RuleIndex;
-import org.sonar.server.es.EsModule;
 import org.sonar.server.setting.DatabaseSettingLoader;
 import org.sonar.server.setting.DatabaseSettingsEnabler;
 import org.sonar.server.setting.ThreadLocalSettings;
@@ -250,9 +251,7 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer {
       LogbackHelper.class,
       DefaultDatabase.class,
       DatabaseChecker.class,
-      // must instantiate deprecated class in 5.2 and only this one (and not its replacement)
-      // to avoid having two SqlSessionFactory instances
-      org.sonar.core.persistence.MyBatis.class,
+      MyBatis.class,
       PurgeProfiler.class,
       ServerFileSystemImpl.class,
       new TempFolderProvider(),
index d4e2c26b95cf3c1fed32c594fbd6c1aa0a51773b..d7b6f8c18cb3ff6951a5f716b9c75ea6fd440cae 100644 (file)
@@ -21,9 +21,9 @@ package org.sonar.ce.db;
 
 import java.util.Map;
 import org.sonar.api.utils.System2;
-import org.sonar.core.properties.PropertiesDao;
 import org.sonar.db.DbSession;
 import org.sonar.db.MyBatis;
+import org.sonar.db.property.PropertiesDao;
 import org.sonar.db.property.PropertyDto;
 
 /**
@@ -90,9 +90,4 @@ public class ReadOnlyPropertiesDao extends PropertiesDao {
     // do nothing
   }
 
-  @Override
-  public void setProperty(org.sonar.core.properties.PropertyDto property) {
-    // do nothing
-  }
-
 }
index d8e7e342cca00c9f61a86b3ef4345449e7228895..c986d009d8d95c4778f2d0e880d90e910a796459 100644 (file)
@@ -32,7 +32,7 @@ public class ReadOnlyPropertiesDaoTest {
   private MyBatis myBatis = mock(MyBatis.class);
   private DbSession dbSession = mock(DbSession.class);
   private PropertyDto propertyDto = mock(PropertyDto.class);
-  private org.sonar.core.properties.PropertyDto oldPropertyDto = mock(org.sonar.core.properties.PropertyDto.class);
+  private PropertyDto oldPropertyDto = mock(PropertyDto.class);
   private ReadOnlyPropertiesDao underTest = new ReadOnlyPropertiesDao(myBatis, System2.INSTANCE);
 
   @Test
@@ -78,7 +78,6 @@ public class ReadOnlyPropertiesDaoTest {
     underTest.deleteProjectProperties(null, null, dbSession);
 
     assertNoInteraction();
-
   }
 
   @Test
@@ -86,7 +85,6 @@ public class ReadOnlyPropertiesDaoTest {
     underTest.deleteGlobalProperty(null);
 
     assertNoInteraction();
-
   }
 
   @Test
@@ -94,7 +92,6 @@ public class ReadOnlyPropertiesDaoTest {
     underTest.deleteGlobalProperty(null, dbSession);
 
     assertNoInteraction();
-
   }
 
   @Test
@@ -102,7 +99,6 @@ public class ReadOnlyPropertiesDaoTest {
     underTest.saveGlobalProperties(null);
 
     assertNoInteraction();
-
   }
 
   @Test
@@ -110,7 +106,6 @@ public class ReadOnlyPropertiesDaoTest {
     underTest.renamePropertyKey(null, null);
 
     assertNoInteraction();
-
   }
 
   @Test
@@ -120,13 +115,6 @@ public class ReadOnlyPropertiesDaoTest {
     assertNoInteraction();
   }
 
-  @Test
-  public void setProperty() {
-    underTest.setProperty(oldPropertyDto);
-
-    assertNoInteraction();
-  }
-
   private void assertNoInteraction() {
     verifyNoMoreInteractions(myBatis, dbSession, propertyDto);
   }
index 0ed57827147951db4377c0aa1c43e65e26374930..04b47d1c1d33775577cc785112183903d6ea8ec7 100644 (file)
@@ -28,7 +28,6 @@ import org.sonar.api.web.UserRole;
 
 /**
  * Holds the constants representing the various component permissions that can be assigned to users & groups
- *
  */
 public final class ProjectPermissions {
   /**
@@ -39,7 +38,7 @@ public final class ProjectPermissions {
   /**
    * All the component permissions values, ordered from {@link UserRole#USER} to {@link GlobalPermissions#SCAN_EXECUTION}.
    */
-  public static final List<String> ALL = ImmutableList.of(UserRole.ADMIN,  UserRole.CODEVIEWER, UserRole.ISSUE_ADMIN, GlobalPermissions.SCAN_EXECUTION, UserRole.USER);
+  public static final List<String> ALL = ImmutableList.of(UserRole.ADMIN, UserRole.CODEVIEWER, UserRole.ISSUE_ADMIN, GlobalPermissions.SCAN_EXECUTION, UserRole.USER);
 
   public static final String ALL_ON_ONE_LINE = Joiner.on(", ").join(ProjectPermissions.ALL);
 
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/core/persistence/MyBatis.java b/server/sonar-db-dao/src/main/java/org/sonar/core/persistence/MyBatis.java
deleted file mode 100644 (file)
index f4e331c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.
- */
-package org.sonar.core.persistence;
-
-import org.sonar.db.Database;
-
-/**
- * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
- *
- * @deprecated since 5.2, should be replaced by {@link org.sonar.db.MyBatis}
- */
-@Deprecated
-public class MyBatis extends org.sonar.db.MyBatis {
-
-  public MyBatis(Database database) {
-    super(database);
-  }
-
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/core/persistence/package-info.java b/server/sonar-db-dao/src/main/java/org/sonar/core/persistence/package-info.java
deleted file mode 100644 (file)
index 8de723f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.core.persistence;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/core/properties/PropertiesDao.java b/server/sonar-db-dao/src/main/java/org/sonar/core/properties/PropertiesDao.java
deleted file mode 100644 (file)
index d8a42d0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.
- */
-package org.sonar.core.properties;
-
-import org.sonar.api.utils.System2;
-import org.sonar.db.MyBatis;
-
-/**
- * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
- *
- * @deprecated since 5.2, should be replaced by {@link org.sonar.db.property.PropertiesDao}
- */
-@Deprecated
-public class PropertiesDao extends org.sonar.db.property.PropertiesDao {
-
-  public PropertiesDao(MyBatis mybatis, System2 system2) {
-    super(mybatis, system2);
-  }
-
-  public void setProperty(PropertyDto property) {
-    super.saveProperty(property);
-  }
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/core/properties/PropertyDto.java b/server/sonar-db-dao/src/main/java/org/sonar/core/properties/PropertyDto.java
deleted file mode 100644 (file)
index d4c1ac5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.
- */
-package org.sonar.core.properties;
-
-/**
- * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
- *
- * @deprecated since 5.2, should be replaced by {@link org.sonar.db.property.PropertyDto}
- */
-@Deprecated
-public class PropertyDto extends org.sonar.db.property.PropertyDto {
-
-  @Override
-  public PropertyDto setKey(String key) {
-    super.setKey(key);
-    return this;
-  }
-
-  @Override
-  public PropertyDto setValue(String value) {
-    super.setValue(value);
-    return this;
-  }
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/core/properties/package-info.java b/server/sonar-db-dao/src/main/java/org/sonar/core/properties/package-info.java
deleted file mode 100644 (file)
index b55f8ec..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.core.properties;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
index 5dc9e5b92f7f186d40f9953523d4df3232a13810..6fed7e8b24529ac28ae2ca8dbdebbb736335634c 100644 (file)
@@ -29,7 +29,6 @@ import org.sonar.api.internal.SonarRuntimeImpl;
 import org.sonar.api.utils.System2;
 import org.sonar.api.utils.Version;
 import org.sonar.api.utils.internal.TempFolderCleaner;
-import org.sonar.server.config.ConfigurationProvider;
 import org.sonar.core.config.CorePropertyDefinitions;
 import org.sonar.core.util.UuidFactoryImpl;
 import org.sonar.db.DBSessionsImpl;
@@ -37,12 +36,14 @@ import org.sonar.db.DaoModule;
 import org.sonar.db.DatabaseChecker;
 import org.sonar.db.DbClient;
 import org.sonar.db.DefaultDatabase;
+import org.sonar.db.MyBatis;
 import org.sonar.db.purge.PurgeProfiler;
 import org.sonar.process.NetworkUtilsImpl;
 import org.sonar.process.logging.LogbackHelper;
 import org.sonar.server.app.ProcessCommandWrapperImpl;
 import org.sonar.server.app.RestartFlagHolderImpl;
 import org.sonar.server.app.WebServerProcessLogging;
+import org.sonar.server.config.ConfigurationProvider;
 import org.sonar.server.es.EsModule;
 import org.sonar.server.issue.index.IssueIndex;
 import org.sonar.server.platform.LogServerVersion;
@@ -92,9 +93,7 @@ public class PlatformLevel1 extends PlatformLevel {
       WebServerProcessLogging.class,
       DefaultDatabase.class,
       DatabaseChecker.class,
-      // must instantiate deprecated class in 5.2 and only this one (and not its replacement)
-      // to avoid having two SqlSessionFactory instances
-      org.sonar.core.persistence.MyBatis.class,
+      MyBatis.class,
       PurgeProfiler.class,
       ServerFileSystemImpl.class,
       TempFolderCleaner.class,
@@ -120,9 +119,7 @@ public class PlatformLevel1 extends PlatformLevel {
       // issues
       IssueIndex.class,
 
-      new OkHttpClientProvider(),
-      // Classes kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
-      org.sonar.core.properties.PropertiesDao.class);
+      new OkHttpClientProvider());
     addAll(CorePropertyDefinitions.all());
 
     // cluster