From ad86377af4e9a899701e59e281c82ecdea2bdbfc Mon Sep 17 00:00:00 2001 From: terrymanu Date: Fri, 4 May 2018 18:53:12 +0800 Subject: [PATCH] for #601: refactor getURL --- .../io/shardingjdbc/dbtest/common/DatabaseEnvironment.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseEnvironment.java b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseEnvironment.java index 9992e93086517..8ea2e8fdc8b28 100644 --- a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseEnvironment.java +++ b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseEnvironment.java @@ -103,11 +103,7 @@ public String getDriverClassName() { * @return database URL */ public String getURL(final String dbName) { - String nowDbName = dbName; - if (null == nowDbName) { - nowDbName = DATABASE_NAME.get(databaseType); - } - return String.format(URL.get(databaseType), nowDbName); + return String.format(URL.get(databaseType), null == dbName ? DATABASE_NAME.get(databaseType) : dbName); } /**