Skip to content

Commit 60abb07

Browse files
committed
Avoid redundant field initializers
1 parent c1440ce commit 60abb07

File tree

8 files changed

+12
-13
lines changed

8 files changed

+12
-13
lines changed

configs/pmd-rules.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
<exclude name="AvoidInstantiatingObjectsInLoops" />
8181
<exclude name="InefficientStringBuffering" />
8282
<exclude name="InsufficientStringBufferDeclaration" />
83-
<exclude name="RedundantFieldInitializer" />
8483
<exclude name="ConsecutiveAppendsShouldReuse" />
8584
<exclude name="UseStringBufferForStringAppends" />
8685
<exclude name="SimplifyStartsWith" />

src/sqlancer/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ private static void startProgressMonitor() {
482482
scheduler.scheduleAtFixedRate(new Runnable() {
483483

484484
private long timeMillis = System.currentTimeMillis();
485-
private long lastNrQueries = 0;
485+
private long lastNrQueries;
486486
private long lastNrDbs;
487487

488488
{

src/sqlancer/mysql/MySQLExpectedValueVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
public class MySQLExpectedValueVisitor implements MySQLVisitor {
2323

2424
private final StringBuilder sb = new StringBuilder();
25-
private int nrTabs = 0;
25+
private int nrTabs;
2626

2727
private void print(MySQLExpression expr) {
2828
MySQLToStringVisitor v = new MySQLToStringVisitor();

src/sqlancer/postgres/PostgresOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class PostgresOptions {
2222

2323
@Parameter(names = "--bulk-insert")
24-
public boolean allowBulkInsert = false;
24+
public boolean allowBulkInsert;
2525

2626
@Parameter(names = "--oracle", converter = DBMSConverter.class)
2727
public List<PostgresOracle> oracle = Arrays.asList(PostgresOracle.QUERY_PARTITIONING);

src/sqlancer/postgres/PostgresProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
// IN
5757
public final class PostgresProvider extends ProviderAdapter<PostgresGlobalState, PostgresOptions> {
5858

59-
public static boolean generateOnlyKnown = false;
59+
public static boolean generateOnlyKnown;
6060

6161
private PostgresGlobalState globalState;
6262

src/sqlancer/sqlite3/SQLite3ExpectedValueVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
public class SQLite3ExpectedValueVisitor implements SQLite3Visitor {
3939

4040
private final StringBuilder sb = new StringBuilder();
41-
private int nrTabs = 0;
41+
private int nrTabs;
4242

4343
private void print(SQLite3Expression expr) {
4444
SQLite3ToStringVisitor v = new SQLite3ToStringVisitor();

src/sqlancer/sqlite3/SQLite3Options.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class SQLite3Options {
3131

3232
@Parameter(names = {
3333
"--test-dbstats" }, description = "Test the DBSTAT Virtual Table (see https://www.sqlite.org/dbstat.html)", arity = 1)
34-
public boolean testDBStats = false;
34+
public boolean testDBStats;
3535

3636
@Parameter(names = { "--test-generated-columns" }, description = "Test generated columns", arity = 1)
3737
public boolean testGeneratedColumns = true;
@@ -61,14 +61,14 @@ public class SQLite3Options {
6161

6262
@Parameter(names = {
6363
"--test-soundex" }, description = "Test the soundex function, which can be enabled using a compile-time option.", arity = 1)
64-
public boolean testSoundex = false;
64+
public boolean testSoundex;
6565

6666
@Parameter(names = { "--test-match" }, description = "Allow the generation of the MATCH operator", arity = 1)
6767
public boolean testMatch = true;
6868

6969
@Parameter(names = {
7070
"--test-distinct-in-view" }, description = "DISTINCT in views might cause occasional false positives in NoREC and TLP", arity = 1)
71-
public boolean testDistinctInView = false;
71+
public boolean testDistinctInView;
7272

7373
@Parameter(names = "--oracle", converter = DBMSConverter.class)
7474
public SQLite3Oracle oracle = SQLite3Oracle.NoREC;
@@ -83,19 +83,19 @@ public class SQLite3Options {
8383

8484
@Parameter(names = {
8585
"--print-statements" }, description = "Specifies whether to print SQL statements to stdout", arity = 1)
86-
public boolean printStatements = false;
86+
public boolean printStatements;
8787

8888
@Parameter(names = {
8989
"--execute-queries" }, description = "Specifies whether the query in the fuzzer should be executed", arity = 1)
9090
public boolean executeQuery = true;
9191

9292
@Parameter(names = {
9393
"--print-successful-statements" }, description = "Specifies whether to print SQL statements to stdout", arity = 1)
94-
public boolean executeStatementsAndPrintSuccessfulOnes = false;
94+
public boolean executeStatementsAndPrintSuccessfulOnes;
9595

9696
@Parameter(names = {
9797
"--exit-after-first-database" }, description = "Specifies whether to stop SQLancer after creating and executing the test oracle on the first database", arity = 1)
98-
public boolean exitAfterFirstDatabase = false;
98+
public boolean exitAfterFirstDatabase;
9999

100100
public enum SQLite3Oracle {
101101
PQS {

src/sqlancer/sqlite3/SQLite3Provider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
public class SQLite3Provider extends ProviderAdapter<SQLite3GlobalState, SQLite3Options> {
5555

5656
public static boolean allowFloatingPointFp = true;
57-
public static boolean mustKnowResult = false;
57+
public static boolean mustKnowResult;
5858

5959
private SQLite3StateToReproduce state;
6060
private String databaseName;

0 commit comments

Comments
 (0)