Skip to content

Commit 2b7225b

Browse files
Jamesclaude
authored andcommitted
Un-vendor org.boris.expr; the jar was already a declared dependency
demos/antiSQLInjection/ carried 365 .java files of a third-party expression evaluator under org/boris/expr/ -- 57% of every source file in this repo. They duplicated lib/expr4j.jar, which pom.xml already declares: the jar holds the same 365 top-level classes and nothing else, so the library shipped twice and javac quietly compiled the sources while the jar sat unused. Only GEval.java ever imported it. Verified rather than assumed, after a codex review pointed out that matching class NAMES proves nothing about implementation: - javap -public -s -constants over all 365 top-level classes: identical. The jar's 367 classfiles are Java 5 bytecode (major 49); compiling the sources gives 370 at major 52. The 3 extra are $1 synthetics (ExprParser$1, ExprTypeUtil$1, SimpleEvaluationContext$1). Nothing the source provides is missing from the jar. - The existing tests were not testing the jar at all: the vendored sources compiled into target/classes and masked it. Re-checked with a clean build and -verbose:class, which now shows org.boris.expr loading from file:.../lib/expr4j.jar. - Full suite still 144 tests with the same 3 known analyzespTest failures. Two consequences, both documented in the README: - The antiSQLInjection demo now requires -Dexec.classpathScope=compile. system-scope dependencies are absent from Maven's runtime classpath, so under runtime it fails with NoClassDefFoundError on org/boris/expr/IEvaluationContext. It only worked there before because the classes happened to be in target/classes. dlineageBasic already had this same constraint (issue #40); antiSQLInjection now joins it. - mvn package no longer bundles org/boris/expr/** into the project jar. Nothing consumes that jar as a library, so this is inert today. Also corrected the dependency's coordinates. It was declared as tk.pratanumandal:expr4j, which is a completely different library, and would have pointed SBOM and vulnerability tooling at the wrong project. The jar has a bare MANIFEST.MF with no version metadata, so it is now identified by content: sha256 6267d9cb7cabcb24cf02d5bff1d11fdfea8c60c9ba1840dcb45359fb0165ca1b, recorded in pom.xml alongside a placeholder version. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qPRpoD8exYRrUmbfXXWXj
1 parent 683f67b commit 2b7225b

367 files changed

Lines changed: 52 additions & 13979 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: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ arguments and it prints its own usage line.
7171
> `<scope>system</scope>`, since they have no public Maven coordinate. Maven's
7272
> `runtime` classpath scope excludes `system`-scoped dependencies by design, so
7373
> any demo that touches one of them (e.g. `dlineageBasic`, which uses
74-
> `org.simpleframework.xml`) fails with `NoClassDefFoundError` under `runtime`
74+
> `org.simpleframework.xml`, or `antiSQLInjection`, which uses
75+
> `org.boris.expr`) fails with `NoClassDefFoundError` under `runtime`
7576
> even though the jar is right there in `lib/`. `compile` scope includes them
7677
> and works for every demo.
7778
@@ -231,6 +232,32 @@ the other directories already use (`joinConvertTest` covers
231232
`demos.joinConvert`, `antiSQLInjectionTest` covers `demos.antiSQLInjection`,
232233
and so on). All 20 test files now live under one root.
233234
235+
### The vendored expression library
236+
237+
`src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/` used to carry 365
238+
`.java` files of a third-party expression evaluator under `org/boris/expr/`.
239+
That was **57% of every source file in this repository**, and it duplicated
240+
`lib/expr4j.jar`, which was already a declared dependency: the jar holds the
241+
same 365 top-level classes and nothing else, so the library shipped twice and
242+
javac quietly compiled the sources while the jar sat unused.
243+
244+
The sources are gone; the jar now supplies `org.boris.expr`. Only one file ever
245+
imported it (`GEval.java`), the `antiSQLInjection` tests cover the path, and
246+
they pass against the jar. Two consequences worth knowing:
247+
248+
- **The `antiSQLInjection` demo now needs `-Dexec.classpathScope=compile`**, for
249+
the `system`-scope reason described above. It used to work under `runtime`
250+
only because the classes happened to be compiled into `target/classes`.
251+
- **`mvn package` no longer puts `org/boris/expr/**` inside the project jar.**
252+
Nothing here consumes that jar as a library, so this only matters if you start
253+
doing so.
254+
255+
The dependency's coordinates were also wrong: it was declared as
256+
`tk.pratanumandal:expr4j`, a different library entirely, which would have
257+
pointed SBOM and vulnerability tooling at the wrong project. It now names what
258+
is actually on disk, with a checksum recorded in `pom.xml` since the jar carries
259+
no version metadata of its own.
260+
234261
## What is excluded from the build
235262
236263
Some demos read metadata straight out of a running database over JDBC, using

pom.xml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,31 @@
116116
<systemPath>${project.basedir}/lib/junrar-0.7.jar</systemPath>
117117
</dependency>
118118

119-
<!-- https://mvnrepository.com/artifact/tk.pratanumandal/expr4j -->
119+
<!-- The expression evaluator behind demos/antiSQLInjection (GEval).
120+
lib/expr4j.jar contains ONLY org/boris/expr/**, that is "Boris Expr",
121+
not tk.pratanumandal:expr4j, which this was previously declared as. That
122+
coordinate named a completely different library and would have misled
123+
SBOM and vulnerability tooling into scanning the wrong project, so it is
124+
corrected here to describe the file that is actually on disk.
125+
126+
The jar carries no version metadata at all (bare MANIFEST.MF, no
127+
pom.properties), so the version below is a placeholder, not a real
128+
upstream release number. Identify it by content instead:
129+
sha256 6267d9cb7cabcb24cf02d5bff1d11fdfea8c60c9ba1840dcb45359fb0165ca1b
130+
367 classfiles, Java 5 bytecode (major version 49)
131+
132+
Until 2026/7/27 this repository also carried all 365 of these classes as
133+
vendored .java under demos/antiSQLInjection/org/boris/expr/, so the
134+
library was shipped twice and the jar was dead weight. The sources were
135+
removed; this jar is now what actually supplies org.boris.expr. Because
136+
system scope is absent from Maven's runtime classpath, the
137+
antiSQLInjection demo requires -Dexec.classpathScope=compile. -->
120138
<dependency>
121-
<groupId>tk.pratanumandal</groupId>
122-
<artifactId>expr4j</artifactId>
123-
<version>0.0.3</version>
124-
<scope>system</scope>
125-
<systemPath>${project.basedir}/lib/expr4j.jar</systemPath>
139+
<groupId>org.boris</groupId>
140+
<artifactId>expr</artifactId>
141+
<version>0.0.0-vendored</version>
142+
<scope>system</scope>
143+
<systemPath>${project.basedir}/lib/expr4j.jar</systemPath>
126144
</dependency>
127145
<!-- https://mvnrepository.com/artifact/org.jdom/jdom -->
128146
<dependency>

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/org/boris/expr/AbstractBinaryOperator.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/org/boris/expr/AbstractComparisonOperator.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/org/boris/expr/AbstractMathematicalOperator.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/org/boris/expr/Expr.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/org/boris/expr/ExprAddition.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/main/java/gudusoft/gsqlparser/demos/antiSQLInjection/org/boris/expr/ExprArray.java

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)