Skip to content

Commit cae3e0d

Browse files
chore: minor grammar refinement to appease the Maven plugin
- avoid wrapping the returns into NULL checks - add license headers Signed-off-by: manticore-projects <andreas@manticore-projects.com>
1 parent c5e2fdc commit cae3e0d

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*-
2+
* #%L
3+
* JSQLParser library
4+
* %%
5+
* Copyright (C) 2004 - 2026 JSQLParser
6+
* %%
7+
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8+
* #L%
9+
*/
110
package net.sf.jsqlparser.statement.select;
211

312
import net.sf.jsqlparser.expression.Alias;

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8381,9 +8381,7 @@ JsonFunction.JsonOnResponseBehavior JsonQueryOnResponseBehavior() : {
83818381
]
83828382
)
83838383
{
8384-
if (behavior != null) {
8385-
return behavior;
8386-
}
8384+
return behavior;
83878385
}
83888386
}
83898387

@@ -9683,6 +9681,13 @@ JsonTableFunction.JsonTableColumnDefinition JsonTableColumnDefinition() : {
96839681
// Very ugly: ColDataType can consume an IDENTIFIER, which is fine, but we don't want it to
96849682
// consume an ALLOW or DISALLOW because that's a keyword for Oracle in this place.
96859683
// So we make a LOOKAHEAD on ColDataType, BUT we exclude the two cases for the IDENTIFIER
9684+
9685+
/*
9686+
[ ColDataType ]
9687+
[ FORMAT JSON ]
9688+
[ (ALLOW | DISALLOW) SCALARS ]
9689+
*/
9690+
96869691
LOOKAHEAD(
96879692
ColDataType(),
96889693
{ !(getToken(1).kind == S_IDENTIFIER && (
@@ -9706,7 +9711,7 @@ JsonTableFunction.JsonTableColumnDefinition JsonTableColumnDefinition() : {
97069711
]
97079712
[ <K_EXISTS> { valueColumnDefinition.setExistsKeyword(true); } ]
97089713
// In Oracle, the wrapper clause comes before the PATH expression
9709-
[ wrapperClause = JsonTableWrapperClause(true) { valueColumnDefinition.setWrapperClause(wrapperClause); } ]
9714+
[ LOOKAHEAD(2) wrapperClause = JsonTableWrapperClause(true) { valueColumnDefinition.setWrapperClause(wrapperClause); } ]
97109715
[ <K_PATH> expression = Expression() { valueColumnDefinition.setPathExpression(expression); } ]
97119716
// In Truno the wrapper clause comes after the PATH expression
97129717
[ wrapperClause = JsonTableWrapperClause(false) { valueColumnDefinition.setWrapperClause(wrapperClause); } ]
@@ -9870,9 +9875,7 @@ JsonTableFunction.JsonTableOnErrorClause JsonTableOnErrorClause(boolean beforeCo
98709875
)
98719876
<K_ON> <K_ERROR>
98729877
{
9873-
if (onErrorClause.getType() != null) {
9874-
return onErrorClause;
9875-
}
9878+
return onErrorClause;
98769879
}
98779880
}
98789881

@@ -9895,9 +9898,7 @@ JsonTableFunction.JsonTableOnEmptyClause JsonTableOnEmptyClause() : {
98959898
)
98969899
<K_ON> <K_EMPTY>
98979900
{
9898-
if (onEmptyClause.getType() != null) {
9899-
return onEmptyClause;
9900-
}
9901+
return onEmptyClause;
99019902
}
99029903
}
99039904

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*-
2+
* #%L
3+
* JSQLParser library
4+
* %%
5+
* Copyright (C) 2004 - 2026 JSQLParser
6+
* %%
7+
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8+
* #L%
9+
*/
110
package net.sf.jsqlparser.expression;
211

312
import net.sf.jsqlparser.JSQLParserException;

0 commit comments

Comments
 (0)