Skip to content

Commit eacfe0b

Browse files
Jamesclaude
authored andcommitted
One package root under src/main/java; path now equals package everywhere
src/main/java had grown four competing package roots -- demos.*, gudusoft.*, gsp.demos.dlineage, and App.java sitting loose at the top of the source tree declaring com.gudusoft.gsqlparser.demo. Java's one hard rule is that a file's directory path mirrors its package, and 263 of 273 files broke it. Two packages were split across both roots, so their halves shared package-private access from unrelated directories. There is now exactly one root, gudusoft/, and path == package for all 190 files. Done in three steps: 1. connector/dbConnect/. dbConnect was a complete Maven project nested inside src/main/java -- its own pom.xml, its own src/main/java, and 10 JDBC driver jars, all inside the compile root of the project containing it. It was never built here. It now sits beside oracleConnector / snowflakeConnector / sqlServerConnector, which have exactly the same pom.xml + src/ + lib/ shape and are likewise outside the root build. Nothing in src/ referenced it and everything it imports from demos.sqlenv is within its own tree, so no code changed and the pom exclusion is gone. This also resolved the demos.sqlenv split (16 of its files were dbConnect's, 1 was not) and removed 83 mismatches. release-notes.md in the library records someone intending this on 2025-03-04; it had never landed. 2. demos.gettablecolumns split. Its one stray file joined the other seven under gudusoft/gsqlparser/demos/gettablecolumns/. 3. The rename itself. Everything became gudusoft.gsqlparser.demos.<demo>, the naming this repo had been half-migrated toward for years. Order mattered: gsp.demos.* and com.gudusoft.gsqlparser.demo had to be resolved first, then a negative lookbehind (?<!gsqlparser\.) kept the already-correct files from being double-prefixed. Two traps were checked for first -- no variable named demos (which a blind rewrite would have destroyed at every demos.add(...)), and no qualifying prefix other than gsp. and gsqlparser. For markdown the pattern was tightened to demos\.(?=[A-Za-z_]) so prose like "unlike most other demos. Run it with:" survived; verified afterwards that no .java, .bat or .md had a mangled sentence. Also repaired the 91 .bat scripts. They had been stale twice over, compiling src\main\java\demos\<demo>\ and cd-ing up five levels, both correct only before the demos moved under gudusoft/gsqlparser/demos/. Since the rename had to rewrite their class names anyway, their paths and cd depths were corrected to each script's real location (7 levels for most, 8 for the two nested under another demo). Not run on Windows, so they are repaired-but-unverified. was now .java under src/main/java 273 190 path contradicts package 263 0 package roots 4 1 packages split across roots 2 0 JDBC driver jars in src/main/java 10 0 Maven projects in the compile root 1 0 This changes every -Dexec.mainClass value. README, CLAUDE.md, the CI workflow, every per-demo readme.md and build.xml were updated with it. The tutorial sources in gsp_java/site-docs/docs were checked and need no change: they carry no runnable demos.* command, no src/main/java/demos path and no link into this repo. Their only two demos.gettablecolumns references are in the v4 migration guide describing where TGetTableColumn lived in v3.x, which is accurate history and was left alone. connector/dbConnect keeps package demos.* deliberately -- it is a standalone project with its own pom, not part of this build. mvn clean test: 144 tests, the same 3 known analyzespTest failures, none new. checksyntax, formatsql, listGSPInfo and antiSQLInjection all run under their new class names. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qPRpoD8exYRrUmbfXXWXj
1 parent 2b7225b commit eacfe0b

445 files changed

Lines changed: 783 additions & 727 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 75 additions & 22 deletions

src/main/java/demos/dbConnect/lib/greenplum/greenplum_5.1.4.jar renamed to connector/dbConnect/lib/greenplum/greenplum_5.1.4.jar

File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main/java/demos/dbConnect/lib/hive/org.jkiss.dbeaver.ext.hive_1.0.49.202010191702.jar renamed to connector/dbConnect/lib/hive/org.jkiss.dbeaver.ext.hive_1.0.49.202010191702.jar

File renamed without changes.
File renamed without changes.

src/main/java/demos/dbConnect/lib/microsoft/mssql-jdbc-8.2.0.jre8.jar renamed to connector/dbConnect/lib/microsoft/mssql-jdbc-8.2.0.jre8.jar

File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main/java/demos/dbConnect/lib/net/snowflake-jdbc-3.12.9.jar renamed to connector/dbConnect/lib/net/snowflake-jdbc-3.12.9.jar

File renamed without changes.

0 commit comments

Comments
 (0)