Skip to content

Commit 2cd47bc

Browse files
committed
Merge pull request #224 from georgekankava/staging/multiple-code-improvements-fix-1
Multiple code improvements fix 1: squid:S1199, squid:S1066, squid:S18…
2 parents e455ce0 + af5d3cd commit 2cd47bc

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

src/main/java/net/sf/jsqlparser/expression/ExpressionVisitorAdapter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,8 @@ public void visit(PivotXml pivot) {
419419
for (Column col : pivot.getForColumns()) {
420420
col.accept(this);
421421
}
422-
if (pivot.getInSelect() != null) {
423-
if (selectVisitor != null) {
424-
pivot.getInSelect().accept(selectVisitor);
425-
}
422+
if (pivot.getInSelect() != null && selectVisitor != null) {
423+
pivot.getInSelect().accept(selectVisitor);
426424
}
427425
}
428426

src/main/java/net/sf/jsqlparser/expression/OracleHint.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,16 @@ public static boolean isHintMatch(String comment) {
4343

4444
public final void setComment(String comment) {
4545
Matcher m;
46-
{
47-
m = SINGLE_LINE.matcher(comment);
48-
if (m.find()) {
49-
this.value = m.group(1);
50-
this.singleLine = true;
51-
return;
52-
}
46+
m = SINGLE_LINE.matcher(comment);
47+
if (m.find()) {
48+
this.value = m.group(1);
49+
this.singleLine = true;
50+
return;
5351
}
54-
{
55-
m = MULTI_LINE.matcher(comment);
56-
if (m.find()) {
57-
this.value = m.group(1);
58-
this.singleLine = false;
59-
}
52+
m = MULTI_LINE.matcher(comment);
53+
if (m.find()) {
54+
this.value = m.group(1);
55+
this.singleLine = false;
6056
}
6157
}
6258

src/main/java/net/sf/jsqlparser/expression/operators/relational/RegExpMatchOperator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public String getStringExpression() {
5555
return "!~";
5656
case NOT_MATCH_CASEINSENSITIVE:
5757
return "!~*";
58+
default:
59+
break;
5860
}
5961
return null;
6062
}

src/main/java/net/sf/jsqlparser/statement/create/table/CreateTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void setIfNotExists(boolean ifNotExists) {
132132

133133
@Override
134134
public String toString() {
135-
String sql = "";
135+
String sql;
136136
String createOps = PlainSelect.getStringList(createOptionsStrings, false, false);
137137

138138
sql = "CREATE " + (unlogged ? "UNLOGGED " : "") +

0 commit comments

Comments
 (0)