Skip to content

Commit 81ebdeb

Browse files
authored
Checkstyle 2509 (#6525)
* fix test checkstyle * fix testcase * fix testcase * fix checkstyle
1 parent 8917bb7 commit 81ebdeb

File tree

3,176 files changed

+7768
-16580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,176 files changed

+7768
-16580
lines changed

core/src/main/java/com/alibaba/druid/mock/handler/MySqlMockExecuteHandlerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class MySqlMockExecuteHandlerImpl implements MockExecuteHandler {
3838
@Override
3939
public ResultSet executeQuery(MockStatementBase statement, String sql) throws SQLException {
4040
SQLStatementParser parser = new MySqlStatementParser(sql);
41-
List<SQLStatement> stmtList = parser.parseStatementList(); //
41+
List<SQLStatement> stmtList = parser.parseStatementList();
4242

4343
if (stmtList.size() > 1) {
4444
throw new SQLException("not support multi-statment. " + sql);

core/src/main/java/com/alibaba/druid/pool/DruidDataSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2868,7 +2868,7 @@ public void run() {
28682868
if (timeBetweenEvictionRunsMillis > 0) {
28692869
Thread.sleep(timeBetweenEvictionRunsMillis);
28702870
} else {
2871-
Thread.sleep(1000); //
2871+
Thread.sleep(1000);
28722872
}
28732873

28742874
if (Thread.interrupted()) {

core/src/main/java/com/alibaba/druid/stat/TableStat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public static class Column {
444444
private boolean having;
445445
private boolean join;
446446
private boolean primaryKey; // for ddl
447-
private boolean unique; //
447+
private boolean unique;
448448
private boolean update;
449449
private Map<String, Object> attributes = new HashMap<String, Object>();
450450
private transient String fullName;
@@ -631,7 +631,7 @@ public static enum Mode {
631631
DropIndex(256), //
632632
CreateIndex(512), //
633633
Replace(1024),
634-
DESC(2048); //
634+
DESC(2048);
635635

636636
public final int mark;
637637

core/src/main/java/com/alibaba/druid/support/monitor/dao/MonitorDaoJdbcImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ public void insertAppIfNotExits(String domain, String app) throws SQLException {
813813
public List<MonitorApp> listApp(String domain) throws SQLException {
814814
List<MonitorApp> list = new ArrayList<MonitorApp>();
815815

816-
String sql = "select id, domain, app from druid_app " //
816+
String sql = "select id, domain, app from druid_app "
817817
+ " where domain = ?";
818818
Connection conn = null;
819819
PreparedStatement stmt = null;
@@ -838,7 +838,7 @@ public List<MonitorApp> listApp(String domain) throws SQLException {
838838
}
839839

840840
public MonitorApp findApp(String domain, String app) throws SQLException {
841-
String sql = "select id, domain, app from druid_app " //
841+
String sql = "select id, domain, app from druid_app "
842842
+ " where domain = ? and app = ?";
843843
Connection conn = null;
844844
PreparedStatement stmt = null;
@@ -876,7 +876,7 @@ private MonitorApp readApp(ResultSet rs) throws SQLException {
876876
public List<MonitorCluster> listCluster(String domain, String app) throws SQLException {
877877
List<MonitorCluster> list = new ArrayList<MonitorCluster>();
878878

879-
String sql = "select id, domain, app, cluster from druid_cluster " //
879+
String sql = "select id, domain, app, cluster from druid_cluster "
880880
+ " where domain = ?";
881881

882882
if (app != null) {
@@ -919,7 +919,7 @@ public void insertClusterIfNotExits(String domain, String app, String cluster) t
919919
}
920920

921921
public MonitorCluster findCluster(String domain, String app, String cluster) throws SQLException {
922-
String sql = "select id, domain, app, cluster from druid_cluster " //
922+
String sql = "select id, domain, app, cluster from druid_cluster "
923923
+ " where domain = ? and app = ? and cluster = ?";
924924
Connection conn = null;
925925
PreparedStatement stmt = null;
@@ -960,19 +960,19 @@ public void insertOrUpdateInstance(String domain, String app, String cluster, St
960960
Date startTime, long pid) throws SQLException {
961961
MonitorInstance monitorInst = findInst(domain, app, cluster, host);
962962
if (monitorInst == null) {
963-
String sql = "insert into druid_inst (domain, app, cluster, host, ip, lastActiveTime, lastPID) " //
963+
String sql = "insert into druid_inst (domain, app, cluster, host, ip, lastActiveTime, lastPID) "
964964
+ " values (?, ?, ?, ?, ?, ?, ?)";
965965
JdbcUtils.execute(dataSource, sql, domain, app, cluster, host, ip, startTime, pid);
966966
} else {
967-
String sql = "update druid_inst set ip = ?, lastActiveTime = ?, lastPID = ? " //
967+
String sql = "update druid_inst set ip = ?, lastActiveTime = ?, lastPID = ? "
968968
+ " where domain = ? and app = ? and cluster = ? and host = ? ";
969969
JdbcUtils.execute(dataSource, sql, ip, startTime, pid, domain, app, cluster, host);
970970
}
971971
}
972972

973973
public MonitorInstance findInst(String domain, String app, String cluster, String host) throws SQLException {
974-
String sql = "select id, domain, app, cluster, host, ip, lastActiveTime, lastPID from druid_inst " //
975-
+ " where domain = ? and app = ? and cluster = ? and host = ? " //
974+
String sql = "select id, domain, app, cluster, host, ip, lastActiveTime, lastPID from druid_inst "
975+
+ " where domain = ? and app = ? and cluster = ? and host = ? "
976976
+ " limit 1";
977977
Connection conn = null;
978978
PreparedStatement stmt = null;
@@ -1002,7 +1002,7 @@ public MonitorInstance findInst(String domain, String app, String cluster, Strin
10021002
public List<MonitorInstance> listInst(String domain, String app, String cluster) throws SQLException {
10031003
List<MonitorInstance> list = new ArrayList<MonitorInstance>();
10041004

1005-
String sql = "select id, domain, app, cluster, host, ip, lastActiveTime, lastPID from druid_inst " //
1005+
String sql = "select id, domain, app, cluster, host, ip, lastActiveTime, lastPID from druid_inst "
10061006
+ "where domain = ?";
10071007

10081008
if (app != null) {

core/src/main/java/com/alibaba/druid/util/JdbcUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ public static String makeInsertToTableSql(String tableName, Collection<String> n
880880
StringBuilder sql = new StringBuilder() //
881881
.append("insert into ") //
882882
.append(tableName) //
883-
.append("("); //
883+
.append("(");
884884

885885
int nameCount = 0;
886886
for (String name : names) {

core/src/test/java/com/alibaba/druid/Bug_for_alibank.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
*/
1616
package com.alibaba.druid;
1717

18-
import junit.framework.TestCase;
19-
2018
import com.alibaba.druid.support.json.JSONUtils;
21-
19+
import junit.framework.TestCase;
2220

2321
public class Bug_for_alibank extends TestCase {
2422
public void test_bug() throws Exception {

core/src/test/java/com/alibaba/druid/DBCPTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
*/
1616
package com.alibaba.druid;
1717

18-
import java.sql.Connection;
19-
import java.util.concurrent.CountDownLatch;
20-
18+
import com.alibaba.druid.mock.MockDriver;
2119
import junit.framework.TestCase;
22-
2320
import org.apache.commons.dbcp.BasicDataSource;
2421

25-
import com.alibaba.druid.mock.MockDriver;
22+
import java.sql.Connection;
23+
import java.util.concurrent.CountDownLatch;
2624

2725
public class DBCPTest extends TestCase {
2826
public void test_max() throws Exception {

core/src/test/java/com/alibaba/druid/DragoonMetaInfTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package com.alibaba.druid;
1717

18+
import junit.framework.TestCase;
19+
1820
import java.io.IOException;
1921
import java.io.InputStream;
2022
import java.io.Reader;
@@ -23,8 +25,6 @@
2325
import java.util.Enumeration;
2426
import java.util.Properties;
2527

26-
import junit.framework.TestCase;
27-
2828
public class DragoonMetaInfTest extends TestCase {
2929
public void test_0() throws Exception {
3030
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

core/src/test/java/com/alibaba/druid/LockTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616
package com.alibaba.druid;
1717

18+
import junit.framework.TestCase;
19+
1820
import java.util.concurrent.locks.Lock;
1921
import java.util.concurrent.locks.ReentrantLock;
2022

21-
import junit.framework.TestCase;
22-
2323
public class LockTest extends TestCase {
2424
public void test_0() throws Exception {
2525
Lock lock = new ReentrantLock();

core/src/test/java/com/alibaba/druid/TestForZY.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import java.util.HashMap;
1919
import java.util.Map;
2020

21-
2221
public class TestForZY {
2322
public void foo() throws Exception {
2423
Map<String, Map.Entry<String, Boolean>> m = new HashMap<String, Map.Entry<String, Boolean>>();

0 commit comments

Comments
 (0)