Skip to content

Commit b84c73d

Browse files
committed
Add a checkstyle rule for modifier order and enforce it
1 parent 5e4176c commit b84c73d

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147

148148
<!-- Modifier Checks -->
149149
<!-- See https://checkstyle.org/config_modifiers.html -->
150-
<!-- FIXME: <module name="ModifierOrder"/> -->
150+
<module name="ModifierOrder"/>
151151
<!-- FIXME: <module name="RedundantModifier"/> -->
152152

153153
<!-- Checks for blocks. You know, those {}'s -->

src/sqlancer/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class Main {
5151
}
5252
}
5353

54-
public final static class StateLogger {
54+
public static final class StateLogger {
5555

5656
private final File loggerFile;
5757
private File curFile;
@@ -61,7 +61,7 @@ public final static class StateLogger {
6161
private boolean logEachSelect = true;
6262
private DatabaseProvider<?, ?> provider;
6363

64-
private final static class AlsoWriteToConsoleFileWriter extends FileWriter {
64+
private static final class AlsoWriteToConsoleFileWriter extends FileWriter {
6565

6666
public AlsoWriteToConsoleFileWriter(File file) throws IOException {
6767
super(file);

src/sqlancer/mysql/MySQLSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public String getIndexName() {
280280

281281
}
282282

283-
static public MySQLSchema fromConnection(Connection con, String databaseName) throws SQLException {
283+
public static MySQLSchema fromConnection(Connection con, String databaseName) throws SQLException {
284284
Exception ex = null;
285285
/* the loop is a workaround for https://bugs.mysql.com/bug.php?id=95929 */
286286
for (int i = 0; i < NR_SCHEMA_READ_TRIES; i++) {

src/sqlancer/sqlite3/SQLite3Provider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ private Query getTableQuery(StateToReproduce state, Randomly r, SQLite3Schema ne
412412
}
413413

414414
// PRAGMAS to achieve good performance
415-
private final static List<String> DEFAULT_PRAGMAS = Arrays.asList("PRAGMA cache_size = 50000;",
415+
private static final List<String> DEFAULT_PRAGMAS = Arrays.asList("PRAGMA cache_size = 50000;",
416416
"PRAGMA temp_store=MEMORY;", "PRAGMA synchronous=off;");
417417

418418
private void addSensiblePragmaDefaults(Connection con) throws SQLException {

src/sqlancer/sqlite3/ast/SQLite3Cast.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public static SQLite3Constant castToText(SQLite3Constant cons) {
279279
// throw new AssertionError();
280280
}
281281

282-
private synchronized static SQLite3Constant castRealToText(SQLite3Constant cons) throws AssertionError {
282+
private static synchronized SQLite3Constant castRealToText(SQLite3Constant cons) throws AssertionError {
283283
try (Statement s = castDatabase.createStatement()) {
284284
String castResult = s.executeQuery("SELECT CAST(" + cons.asDouble() + " AS TEXT)").getString(1);
285285
return SQLite3Constant.createTextConstant(castResult);

src/sqlancer/sqlite3/queries/SQLite3MetamorphicQuerySynthesizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class SQLite3MetamorphicQuerySynthesizer implements TestOracle {
3939
// SELECT SUM(count) FROM (SELECT <cond> IS TRUE as count FROM t0);
4040
// SELECT (SELECT COUNT(*) FROM t0 WHERE c0 IS NOT 0) = (SELECT COUNT(*) FROM
4141
// (SELECT c0 is NOT 0 FROM t0));
42-
private final static int NOT_FOUND = -1;
42+
private static final int NOT_FOUND = -1;
4343
private SQLite3ExpressionGenerator gen;
4444
private SQLite3Schema s;
4545
private Connection con;

src/sqlancer/sqlite3/queries/SQLite3MetamorphicTrueValueSynthesizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,6 @@ private SQLite3Expression getRandomWhereCondition(List<SQLite3Column> columns) {
178178
return gen.generateExpression();
179179
}
180180

181-
private final static int NOT_FOUND = -1;
181+
private static final int NOT_FOUND = -1;
182182

183183
}

0 commit comments

Comments
 (0)