Skip to content

Commit 62dd4c1

Browse files
Merge branch 'master' into manticore
# Conflicts: # gradle/wrapper/gradle-wrapper.jar # gradle/wrapper/gradle-wrapper.properties # src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/analytic_query07.sql # src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/cluster_set01.sql # src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/function07.sql
2 parents 91c544f + 0cb209c commit 62dd4c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3964
-2476
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
run: sudo apt-get install -y xsltproc sphinx-common
8787

8888
- name: Install Python dependencies
89-
run: pip install furo myst_parser sphinx_substitution_extensions sphinx_issues sphinx_inline_tabs pygments
89+
run: pip install manticore_sphinx_theme myst_parser sphinx_substitution_extensions sphinx_issues sphinx_inline_tabs pygments
9090

9191
- name: Build Sphinx documentation with Gradle
9292
run: FLOATING_TOC=false ./gradlew -DFLOATING_TOC=false gitChangelogTask renderRR xslt xmldoc sphinx

build.gradle

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ tasks.register('generateBuildInfo') {
9393
def buildTime = Instant.now().toString()
9494

9595
def content = """\
96-
|package ai.starlake.jsqltranspiler;
96+
|package net.sf.jsqlparser;
9797
|
9898
|public final class BuildInfo {
9999
| public static final String NAME = "${project.name}";
@@ -373,27 +373,31 @@ spotbugsMain {
373373
spotbugs {
374374
// fail only on P1 and without the net.sf.jsqlparser.parser.*
375375
excludeFilter = file("config/spotbugs/spotBugsExcludeFilter.xml")
376+
}
376377

377-
// do not run over the test, although we should do that eventually
378-
spotbugsTest.enabled = false
378+
// do not run over the test, although we should do that eventually
379+
tasks.named('spotbugsTest').configure {
380+
enabled = false
379381
}
380382

381383
pmd {
384+
// later versions throw NPE
385+
toolVersion = '7.17.0'
386+
382387
consoleOutput = true
383388
sourceSets = [sourceSets.main]
384389

385390
// clear the ruleset in order to use configured rules only
386391
ruleSets = []
387-
388-
//rulesMinimumPriority = 1
392+
rulesMinimumPriority = 2
389393
ruleSetFiles = files("config/pmd/ruleset.xml")
394+
}
390395

391-
pmdMain {
392-
excludes = [
393-
"build/generated/*"
394-
, "**/net/sf/jsqlparser/parser/SimpleCharStream.java"
395-
]
396-
}
396+
tasks.named('pmdMain').configure {
397+
excludes = [
398+
"build/generated/*"
399+
, "**/net/sf/jsqlparser/parser/SimpleCharStream.java"
400+
]
397401
}
398402

399403
checkstyle {
@@ -456,28 +460,34 @@ tasks.register('renderRR') {
456460
}
457461

458462
// Convert JJ file to EBNF
459-
tasks.register("convertJJ", JavaExec) {
460-
standardOutput = new FileOutputStream(new File(rrDir, "JSqlParserCC.ebnf"))
461-
mainClass = "-jar"
462-
args = [
463-
new File(rrDir, "convert.war").absolutePath,
464-
layout.buildDirectory.dir("generated/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jj").get().asFile.absolutePath
465-
]
466-
}.get().exec()
463+
def ebnfFile = new File(rrDir, "JSqlParserCC.ebnf")
464+
def jjFile = layout.buildDirectory.dir("generated/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jj").get().asFile.absolutePath
465+
466+
def convertProc = new ProcessBuilder('java', '-jar',
467+
new File(rrDir, "convert.war").absolutePath,
468+
jjFile)
469+
.redirectOutput(ebnfFile)
470+
.redirectErrorStream(true)
471+
.start()
472+
if (convertProc.waitFor() != 0) {
473+
throw new GradleException("Failed to convert JJ to EBNF")
474+
}
467475

468476
// Generate RR diagrams
469-
tasks.register("generateRR", JavaExec) {
470-
mainClass = "-jar"
471-
args = [
472-
new File(rrDir, "rr.war").absolutePath,
473-
"-noepsilon",
474-
"-color:#4D88FF",
475-
"-offset:0",
476-
"-width:800",
477-
"-out:${new File(rrDir, "JSqlParserCC.xhtml")}",
478-
new File(rrDir, "JSqlParserCC.ebnf").absolutePath
479-
]
480-
}.get().exec()
477+
def rrProc = new ProcessBuilder('java', '-jar',
478+
new File(rrDir, "rr.war").absolutePath,
479+
"-noepsilon",
480+
"-color:#4D88FF",
481+
"-offset:0",
482+
"-width:800",
483+
"-out:${new File(rrDir, "JSqlParserCC.xhtml")}",
484+
new File(rrDir, "JSqlParserCC.ebnf").absolutePath)
485+
.redirectErrorStream(true)
486+
.start()
487+
rrProc.inputStream.eachLine { logger.info(it) }
488+
if (rrProc.waitFor() != 0) {
489+
throw new GradleException("Failed to generate RR diagrams")
490+
}
481491
}
482492
}
483493

@@ -523,13 +533,13 @@ Version {{name}}
523533

524534
tasks.register('updateKeywords', JavaExec) {
525535
group = "Execution"
526-
description = "Run the main class with JavaExecTask"
536+
description = "Generate the Reserved Keywords documentation"
527537
classpath = sourceSets.main.runtimeClasspath
528538
args = [
529539
file('src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt').absolutePath
530540
, file('src/site/sphinx/keywords.rst').absolutePath
531541
]
532-
main("net.sf.jsqlparser.parser.ParserKeywordsUtils")
542+
mainClass.set("net.sf.jsqlparser.parser.ParserKeywordsUtils")
533543

534544
dependsOn(compileJava)
535545
}
@@ -543,7 +553,7 @@ tasks.register('xslt', SaxonXsltTask) {
543553
stylesheet file('src/main/resources/rr/xhtml2rst.xsl')
544554

545555
parameters(
546-
"withFloatingToc": System.getProperty("FLOATING_TOC", "true"),
556+
"withFloatingToc": System.getProperty("FLOATING_TOC", "false"),
547557
"isSnapshot": Boolean.toString(version.endsWith("-SNAPSHOT"))
548558
)
549559

config/pmd/ruleset.xml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ under the License.
2020
<ruleset name="Default Maven PMD Plugin Ruleset" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
2121

2222
<description>
23-
The default ruleset used by the Maven PMD Plugin, when no other ruleset is specified.
24-
It contains the rules of the old (pre PMD 6.0.0) rulesets java-basic, java-empty, java-imports,
25-
java-unnecessary, java-unusedcode.
23+
Custom PMD ruleset, compatible with PMD 7.x.
2624

27-
This ruleset might be used as a starting point for an own customized ruleset [0].
25+
Based on the old (pre PMD 6.0.0) rulesets java-basic, java-empty, java-imports,
26+
java-unnecessary, java-unusedcode, migrated for PMD 7.
2827

29-
[0] https://pmd.github.io/latest/pmd_userdocs_making_rulesets.html
30-
</description>
28+
This ruleset might be used as a starting point for an own customized ruleset [0].
29+
30+
[0] https://pmd.github.io/latest/pmd_userdocs_making_rulesets.html
31+
</description>
3132

3233
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
3334
<rule ref="category/java/bestpractices.xml/CheckResultSet" />
@@ -46,6 +47,14 @@ under the License.
4647
<rule ref="category/java/codestyle.xml/UselessParentheses" />
4748
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />
4849

50+
<!-- PMD 7: replaces EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer,
51+
EmptyStatementBlock, EmptySwitchStatements, EmptySynchronizedBlock,
52+
EmptyTryBlock, EmptyWhileStmt (all removed in PMD 7) -->
53+
<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
54+
55+
<!-- PMD 7: replaces EmptyStatementNotInLoop (removed in PMD 7) -->
56+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
57+
4958
<rule ref="category/java/codestyle.xml/MethodNamingConventions">
5059
<properties>
5160
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*" />
@@ -63,14 +72,15 @@ under the License.
6372
<rule ref="category/java/design.xml/UselessOverridingMethod" />
6473
<rule ref="category/java/design.xml/AvoidThrowingNullPointerException" />
6574

66-
6775
<rule ref="category/java/design.xml/CyclomaticComplexity">
6876
<properties>
6977
<property name="classReportLevel" value="200" />
7078
<property name="methodReportLevel" value="120" />
7179
</properties>
7280
</rule>
73-
<rule ref="category/java/design.xml/ExcessiveMethodLength" />
81+
82+
<!-- PMD 7: ExcessiveMethodLength was removed, use NcssCount instead -->
83+
<rule ref="category/java/design.xml/NcssCount" />
7484

7585
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
7686
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" />
@@ -80,32 +90,25 @@ under the License.
8090
<rule ref="category/java/errorprone.xml/CheckSkipResult" />
8191
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
8292
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
93+
94+
<!-- EmptyCatchBlock is explicitly kept as a separate rule in PMD 7 -->
8395
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
84-
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
85-
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
86-
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
87-
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
88-
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
89-
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
90-
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
91-
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
92-
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
96+
9397
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
9498
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
9599
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
96100
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock" />
97101
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement" />
98102
<rule ref="category/java/errorprone.xml/UnnecessaryConversionTemporary" />
99103
<rule ref="category/java/errorprone.xml/UnusedNullCheckInEquals" />
100-
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable" />
101-
102-
<!-- for Codazy -->
104+
105+
<!-- for Codazy -->
103106
<rule ref="category/java/multithreading.xml/AvoidThreadGroup" />
104107
<rule ref="category/java/multithreading.xml/DontCallThreadRun" />
105108
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking" />
106109

107110
<rule ref="category/java/performance.xml/BigIntegerInstantiation" />
108111

109-
<!-- for Codazy -->
112+
<!-- for Codazy -->
110113
<!-- <rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody" /> -->
111-
</ruleset>
114+
</ruleset>

gradle/wrapper/gradle-wrapper.jar

2.73 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)