]> source.dussan.org Git - sonarqube.git/commitdiff
Add classes for backward compatibility of plugins/libs (like sonar-license) that...
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 6 Jul 2015 14:35:41 +0000 (16:35 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 6 Jul 2015 14:35:41 +0000 (16:35 +0200)
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java
sonar-db/src/main/java/org/sonar/core/persistence/DatabaseUtils.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/core/persistence/MyBatis.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/core/properties/PropertiesDao.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/core/properties/PropertyDto.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/DatabaseUtils.java
sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java

index 621fa7848ecdfdfb2abd9f9e15052cedc17c7ede..4ed0965d145207a5955a9fdcf8e57411b960b02a 100644 (file)
@@ -123,7 +123,12 @@ public class PlatformLevel1 extends PlatformLevel {
       ActiveRuleIndex.class,
 
       // issues
-      IssueIndex.class);
+      IssueIndex.class,
+
+      // 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,
+      org.sonar.core.persistence.MyBatis.class
+    );
     addAll(CorePropertyDefinitions.all());
     add(MigrationStepModule.class);
     addAll(DaoUtils.getDaoClasses());
diff --git a/sonar-db/src/main/java/org/sonar/core/persistence/DatabaseUtils.java b/sonar-db/src/main/java/org/sonar/core/persistence/DatabaseUtils.java
new file mode 100644 (file)
index 0000000..1a153cc
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+package org.sonar.core.persistence;
+
+/**
+ * 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.DatabaseUtils}
+ */
+@Deprecated
+public class DatabaseUtils extends org.sonar.db.DatabaseUtils {
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-db/src/main/java/org/sonar/core/persistence/MyBatis.java
new file mode 100644 (file)
index 0000000..2e6d35e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+package org.sonar.core.persistence;
+
+import org.sonar.db.Database;
+import org.sonar.db.deprecated.WorkQueue;
+
+/**
+ * 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, WorkQueue<?> queue) {
+    super(database, queue);
+  }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/core/properties/PropertiesDao.java b/sonar-db/src/main/java/org/sonar/core/properties/PropertiesDao.java
new file mode 100644 (file)
index 0000000..5843728
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+package org.sonar.core.properties;
+
+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) {
+    super(mybatis);
+  }
+
+  public void setProperty(PropertyDto property) {
+    super.setProperty(property);
+  }
+}
diff --git a/sonar-db/src/main/java/org/sonar/core/properties/PropertyDto.java b/sonar-db/src/main/java/org/sonar/core/properties/PropertyDto.java
new file mode 100644 (file)
index 0000000..57b2da5
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+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 {
+
+  public PropertyDto setKey(String key) {
+    super.setKey(key);
+    return this;
+  }
+
+  public PropertyDto setValue(String value) {
+    super.setValue(value);
+    return this;
+  }
+}
index 6d74d2474cca356c567deae93d7a2e40f57dc2f1..71eb3596d658a345cc40c28a11e291256358e760 100644 (file)
@@ -33,14 +33,10 @@ import org.slf4j.LoggerFactory;
 
 import static com.google.common.collect.Lists.newArrayList;
 
-public final class DatabaseUtils {
+public class DatabaseUtils {
 
   private static final int PARTITION_SIZE_FOR_ORACLE = 1000;
 
-  private DatabaseUtils() {
-    // only static methods
-  }
-
   public static void closeQuietly(@Nullable Connection connection) {
     if (connection != null) {
       try {
index 10456ace24c6ec91e6a8cf922db09f7123e275ab..91e68f8d24bfaff2c2b98799dc11c8b025a9f098 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.property;
 
 import com.google.common.base.Objects;
 
-public final class PropertyDto {
+public class PropertyDto {
   private Long id;
   private String key;
   private String value;