提交 b47e8b61 authored 作者: Thomas Mueller's avatar Thomas Mueller

Checkstyle.

上级 0655d670
...@@ -58,7 +58,7 @@ public class Driver implements java.sql.Driver { ...@@ -58,7 +58,7 @@ public class Driver implements java.sql.Driver {
} }
boolean noUpgrade = url.contains(";NO_UPGRADE=TRUE"); boolean noUpgrade = url.contains(";NO_UPGRADE=TRUE");
url = url.replaceAll(";NO_UPGRADE=TRUE", ""); url = url.replaceAll(";NO_UPGRADE=TRUE", "");
if (DbUpgrade.areV1_1ClassesPresent()) { if (DbUpgrade.areV1dot1ClassesPresent()) {
if (noUpgrade) { if (noUpgrade) {
Connection connection = DbUpgrade.connectWithOldVersion(url, info); Connection connection = DbUpgrade.connectWithOldVersion(url, info);
if (connection != null) { if (connection != null) {
......
...@@ -14,7 +14,6 @@ import java.util.Collections; ...@@ -14,7 +14,6 @@ import java.util.Collections;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import org.h2.jdbc.JdbcConnection;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.store.fs.FileSystem; import org.h2.store.fs.FileSystem;
import org.h2.store.fs.FileSystemDisk; import org.h2.store.fs.FileSystemDisk;
...@@ -26,18 +25,23 @@ import org.h2.util.Utils; ...@@ -26,18 +25,23 @@ import org.h2.util.Utils;
*/ */
public class DbUpgrade { public class DbUpgrade {
private static boolean v1_1ClassesPresent; private static boolean v1dot1ClassesPresent;
private static Map<String, DbUpgradeNonPageStoreToCurrent> runningConversions; private static Map<String, DbUpgradeNonPageStoreToCurrent> runningConversions;
static { static {
// static initialize block // static initialize block
v1_1ClassesPresent = Utils.isClassPresent("org.h2.upgrade.v1_1.Driver"); v1dot1ClassesPresent = Utils.isClassPresent("org.h2.upgrade.v1_1.Driver");
runningConversions = Collections.synchronizedMap(new Hashtable<String, DbUpgradeNonPageStoreToCurrent>(1)); runningConversions = Collections.synchronizedMap(new Hashtable<String, DbUpgradeNonPageStoreToCurrent>(1));
} }
public static boolean areV1_1ClassesPresent() { /**
return v1_1ClassesPresent; * Check if the H2 version 1.1 driver is in in the classpath.
*
* @return true if it is
*/
public static boolean areV1dot1ClassesPresent() {
return v1dot1ClassesPresent;
} }
/** /**
...@@ -93,7 +97,7 @@ public class DbUpgrade { ...@@ -93,7 +97,7 @@ public class DbUpgrade {
* @throws SQLException * @throws SQLException
*/ */
public static synchronized void upgrade(String url, Properties info) throws SQLException { public static synchronized void upgrade(String url, Properties info) throws SQLException {
if (v1_1ClassesPresent) { if (v1dot1ClassesPresent) {
upgradeFromNonPageStore(url, info); upgradeFromNonPageStore(url, info);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论