Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style: Execute :spotlessApply
  • Loading branch information
Stefan Steinhauser committed Sep 16, 2024
commit 3ef53c91a64df117f1a58dce32d29d60b5b659e6
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public PreferringClause(Expression preferring) {
}

public void setPartitionExpressionList(ExpressionList expressionList,
boolean brackets) {
boolean brackets) {
if (this.partitionBy == null) {
this.partitionBy = new PartitionByClause();
}
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/net/sf/jsqlparser/parser/ParserKeywordsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,15 @@ public static TreeSet<String> getAllKeywordsUsingRegex(File file) throws IOExcep
// remove single and multiline comments
tokenBlock = tokenBlock.replaceAll("(?sm)((\\/\\*.*?\\*\\/)|(\\/\\/.*?$))", "");
for (String tokenDefinition : getTokenDefinitions(tokenBlock)) {
// check if token definition is private
if (tokenDefinition.matches("(?sm)^<\\s*[^#].*")) {
Matcher tokenStringValueMatcher = tokenStringValuePattern.matcher(tokenDefinition);
// check if token definition is private
if (tokenDefinition.matches("(?sm)^<\\s*[^#].*")) {
Matcher tokenStringValueMatcher =
tokenStringValuePattern.matcher(tokenDefinition);
while (tokenStringValueMatcher.find()) {
String tokenValue = tokenStringValueMatcher.group(1);
// test if pure US-ASCII
if (CHARSET_ENCODER.canEncode(tokenValue) && tokenValue.matches("\\w+")) {
allKeywords.add(tokenValue);
allKeywords.add(tokenValue);
}
}
}
Expand All @@ -265,7 +266,7 @@ private static List<String> getTokenDefinitions(String tokenBlock) {
if (isQuotationMark(i, tokenBlockChars)) {
// skip everything inside quotation marks
while (!isQuotationMark(++i, tokenBlockChars)) {
// skip until quotation ends
// skip until quotation ends
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/test/java/net/sf/jsqlparser/statement/delete/DeleteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ void testSelectAndInsertWithin2Ctes() throws JSQLParserException {

@ParameterizedTest
@ValueSource(strings = {
"DELETE FROM mytable PREFERRING HIGH mycolumn",
"DELETE FROM mytable PREFERRING LOW mycolumn",
"DELETE FROM mytable PREFERRING 1 = 1",
"DELETE FROM mytable PREFERRING (HIGH mycolumn)",
"DELETE FROM mytable PREFERRING INVERSE (HIGH mycolumn)",
"DELETE FROM mytable PREFERRING HIGH mycolumn1 PRIOR TO LOW mycolumn2",
"DELETE FROM mytable PREFERRING HIGH mycolumn1 PLUS LOW mycolumn2"
"DELETE FROM mytable PREFERRING HIGH mycolumn",
"DELETE FROM mytable PREFERRING LOW mycolumn",
"DELETE FROM mytable PREFERRING 1 = 1",
"DELETE FROM mytable PREFERRING (HIGH mycolumn)",
"DELETE FROM mytable PREFERRING INVERSE (HIGH mycolumn)",
"DELETE FROM mytable PREFERRING HIGH mycolumn1 PRIOR TO LOW mycolumn2",
"DELETE FROM mytable PREFERRING HIGH mycolumn1 PLUS LOW mycolumn2"
})
public void testPreferringClause(String sqlStr) throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(sqlStr);
Expand Down
16 changes: 8 additions & 8 deletions src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5985,14 +5985,14 @@ public void execute() throws Throwable {

@ParameterizedTest
@ValueSource(strings = {
"SELECT * FROM mytable PREFERRING HIGH mycolumn",
"SELECT * FROM mytable PREFERRING LOW mycolumn",
"SELECT * FROM mytable PREFERRING 1 = 1",
"SELECT * FROM mytable PREFERRING (HIGH mycolumn)",
"SELECT * FROM mytable PREFERRING INVERSE (HIGH mycolumn)",
"SELECT * FROM mytable PREFERRING HIGH mycolumn1 PRIOR TO LOW mycolumn2",
"SELECT * FROM mytable PREFERRING HIGH mycolumn1 PLUS LOW mycolumn2",
"SELECT * FROM mytable PREFERRING HIGH mycolumn PARTITION BY mycolumn"
"SELECT * FROM mytable PREFERRING HIGH mycolumn",
"SELECT * FROM mytable PREFERRING LOW mycolumn",
"SELECT * FROM mytable PREFERRING 1 = 1",
"SELECT * FROM mytable PREFERRING (HIGH mycolumn)",
"SELECT * FROM mytable PREFERRING INVERSE (HIGH mycolumn)",
"SELECT * FROM mytable PREFERRING HIGH mycolumn1 PRIOR TO LOW mycolumn2",
"SELECT * FROM mytable PREFERRING HIGH mycolumn1 PLUS LOW mycolumn2",
"SELECT * FROM mytable PREFERRING HIGH mycolumn PARTITION BY mycolumn"
})
public void testPreferringClause(String sqlStr) throws JSQLParserException {
TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr);
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/net/sf/jsqlparser/statement/update/UpdateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,13 @@ void testSelectAndInsertWithin2Ctes() throws JSQLParserException {

@ParameterizedTest
@ValueSource(strings = {
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING HIGH mycolumn",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING LOW mycolumn",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING 1 = 1",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING (HIGH mycolumn)",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING INVERSE (HIGH mycolumn)",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING HIGH mycolumn1 PRIOR TO LOW mycolumn2",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING HIGH mycolumn1 PLUS LOW mycolumn2"
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING HIGH mycolumn",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING LOW mycolumn",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING 1 = 1",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING (HIGH mycolumn)",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING INVERSE (HIGH mycolumn)",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING HIGH mycolumn1 PRIOR TO LOW mycolumn2",
"UPDATE mytable SET mycolumn1 = mycolumn2 PREFERRING HIGH mycolumn1 PLUS LOW mycolumn2"
})
public void testPreferringClause(String sqlStr) throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(sqlStr);
Expand Down