Skip to content

Commit 1bdf5b9

Browse files
committed
checkstyle source check included. configuration done
1 parent 2711900 commit 1bdf5b9

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,7 @@
374374
<configuration>
375375
<logViolationsToConsole>true</logViolationsToConsole>
376376
<includeTestSourceDirectory>true</includeTestSourceDirectory>
377-
<sourceDirectories>
378-
<sourceDirectory>./src/java</sourceDirectory>
379-
</sourceDirectories>
377+
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
380378
<checkstyleRules>
381379
<module name="Checker">
382380
<module name="FileTabCharacter" />
@@ -387,10 +385,21 @@
387385
</module>
388386
-->
389387
<module name="TreeWalker">
388+
<module name="AvoidNestedBlocks"/>
390389
<module name="ConstantName" />
390+
<module name="EmptyCatchBlock" />
391391
<module name="EmptyStatement" />
392+
<module name="MissingOverride"/>
393+
<module name="MultipleVariableDeclarations"/>
394+
<module name="ParameterAssignment"/>
395+
<module name="StringLiteralEquality"/>
396+
<module name="RedundantImport"/>
397+
<module name="UnusedImports"/>
398+
392399
<module name="NeedBraces" />
393400
<module name="UnnecessaryParentheses" />
401+
<module name="LeftCurly"/>
402+
<module name="RightCurly"/>
394403
</module>
395404
</module>
396405
</checkstyleRules>

src/main/java/net/sf/jsqlparser/statement/select/PlainSelect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ public static String getStringList(List<?> list, boolean useComma, boolean useBr
443443
}
444444

445445
for (int i = 0; i < list.size(); i++) {
446-
ans.append(list.get(i)).append(((i < list.size() - 1) ? comma + " " : ""));
446+
ans.append(list.get(i)).append((i < list.size() - 1) ? comma + " " : "");
447447
// ans += "" + list.get(i) + ((i < list.size() - 1) ? comma + " " : "");
448448
}
449449

src/test/java/net/sf/jsqlparser/expression/LongValueTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void testLargeNumber() {
7070
value.getValue();
7171
fail("should not work");
7272
} catch (Exception e) {
73-
73+
//expected to fail
7474
}
7575
assertEquals(new BigInteger(largeNumber), value.getBigIntegerValue());
7676
}

src/test/java/net/sf/jsqlparser/test/merge/MergeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public void testMergeUpdateInsertOrderIssue401_3() throws JSQLParserException {
167167
assertSqlCanBeParsedAndDeparsed("MERGE INTO a USING dual ON (col3 = ? AND col1 = ? AND col2 = ?) WHEN MATCHED THEN UPDATE SET col4 = col4 + ? WHEN NOT MATCHED THEN INSERT (col1, col2, col3, col4) VALUES (?, ?, ?, ?) WHEN MATCHED THEN UPDATE SET col4 = col4 + ?");
168168
fail("syntaxerror parsed");
169169
} catch (JSQLParserException ex) {
170-
170+
//expected to fail
171171
}
172172
}
173173
}

src/test/java/net/sf/jsqlparser/test/select/SelectTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ public void testDistinctTop2() {
825825
parserManager.parse(new StringReader(statement));
826826
fail("sould not work");
827827
} catch (JSQLParserException ex) {
828+
//expected to fail
828829
}
829830
}
830831

@@ -2418,7 +2419,7 @@ public void testWhereIssue240_notBoolean() {
24182419
CCJSqlParserUtil.parse("SELECT count(*) FROM mytable WHERE 5");
24192420
fail("should not be parsed");
24202421
} catch (JSQLParserException ex) {
2421-
2422+
//expected to fail
24222423
}
24232424
}
24242425

0 commit comments

Comments
 (0)