@@ -177,10 +177,35 @@ Established Java static call graph tools all require compiled bytecode:
177177| [ Soot] ( https://github.com/soot-oss/soot ) | CHA / RTA / VTA / Spark | Needs compiled ` .class ` files |
178178| [ javacg-static] ( https://github.com/gousiosg/java-callgraph ) | CHA | Lightweight, reads JARs |
179179
180- The fixture contains raw ` .java ` source with no build system. Running these
181- tools requires a ` javac ` compilation step (tracked in # 1307 ).
180+ The fixture now includes a ` Makefile ` that compiles all ` .java ` sources into
181+ ` fixture.jar ` :
182182
183- ** Current codegraph Java metrics** (` scripts/resolution-benchmark.ts ` ):
183+ ``` bash
184+ cd tests/benchmarks/resolution/fixtures/java && make
185+ ```
186+
187+ ` scripts/compare-javacg.mjs ` then runs
188+ [ javacg-static] ( https://github.com/gousiosg/java-callgraph ) on the compiled JAR.
189+ javacg-static uses CHA to enumerate all possible call targets at virtual,
190+ interface, and static call sites.
191+
192+ ``` bash
193+ node scripts/compare-javacg.mjs --jar /path/to/javacg-0.1-SNAPSHOT.jar
194+ # or: JAVACG_JAR=... node scripts/compare-javacg.mjs
195+ ```
196+
197+ Download javacg-static from
198+ [ github.com/gousiosg/java-callgraph/releases] ( https://github.com/gousiosg/java-callgraph/releases )
199+ or build with ` mvn package -DskipTests ` .
200+
201+ ** Name mapping:** javacg-static uses ` pkg.ClassName:method(JVM-descriptors) ` form.
202+ ` compare-javacg.mjs ` maps this to ` ClassName.method ` and matches
203+ ` ClassName.ClassName ` (source constructor) / ` ClassName ` (target constructor)
204+ against the expected-edges.json convention. Only edges where both class names
205+ appear in the fixture source files are counted; JDK calls (` String ` , ` HashMap ` ,
206+ ` System.out ` , …) are filtered out.
207+
208+ ** Codegraph Java metrics** (` scripts/resolution-benchmark.ts ` ):
184209
185210| Mode | Codegraph |
186211| ------| :---------:|
@@ -192,6 +217,19 @@ tools requires a `javac` compilation step (tracked in #1307).
192217| ` class-inheritance ` (3 edges) | 0/3 (0%) |
193218| ** Total** | ** 9/17 (53%)** · precision=100% |
194219
220+ ** javacg-static comparison** — run ` node scripts/compare-javacg.mjs ` to populate:
221+
222+ | Tool | Precision | Recall | TP | FP | FN |
223+ | ------| :---------:| :------:| ---:| ---:| ---:|
224+ | Codegraph | 100% | 53% | 9 | 0 | 8 |
225+ | javacg-static (CHA) | — | — | — | — | — |
226+
227+ javacg-static uses CHA and reads compiled bytecode, so it should resolve
228+ ` class-inheritance ` (inherited ` log() ` calls) and ` interface-dispatched `
229+ (virtual dispatch via ` UserRepository ` interface) edges that codegraph
230+ currently misses at the source-level. ` static ` and ` same-file ` calls
231+ (` invokestatic ` in bytecode) should also be fully captured.
232+
195233---
196234
197235## Conclusions
@@ -231,8 +269,9 @@ tools requires a `javac` compilation step (tracked in #1307).
231269 2 ` class-inheritance ` edges (+7 recall on TS fixture).
2322702 . ** Property-assignment type tracking** (#1306 ) — Track ` this.prop = new Foo() `
233271 writes. Recovers 3 JS ` receiver-typed ` FN.
234- 3 . ** Java comparison with javacg-static** (#1307 ) — Add ` javac ` compilation to
235- the Java fixture so a bytecode-level tool can validate Java recall claims.
272+ 3 . ** Java recall gaps** — ` same-file ` (0/2) and ` static ` (0/2) are ` invokestatic `
273+ patterns that javacg-static will expose; ` class-inheritance ` (0/3) requires
274+ tracking inherited method calls from superclass to subclass invocation site.
236275
237276---
238277
@@ -300,6 +339,10 @@ npx tsx scripts/resolution-benchmark.ts | jq '{javascript, typescript, java}'
300339npm install @cs-au-dk/jelly @persper/js-callgraph
301340node scripts/compare-tools.mjs --all
302341
342+ # javacg-static comparison (Java)
343+ cd tests/benchmarks/resolution/fixtures/java && make && cd -
344+ node scripts/compare-javacg.mjs --jar /path/to/javacg-0.1-SNAPSHOT.jar
345+
303346# Full resolution test suite
304347npx vitest run tests/benchmarks/resolution/resolution-benchmark.test.ts
305348```
0 commit comments