Skip to content

SONARJAVA-7236 Score AST and semantic mismatches against ECJ - #6437

Draft
rombirli wants to merge 7 commits into
rombirli/semsitter-ecj-replacement-v2from
rombirli/ast-semantic-benchmark
Draft

rombirli wants to merge 7 commits into
rombirli/semsitter-ecj-replacement-v2from
rombirli/ast-semantic-benchmark

Conversation

@rombirli

@rombirli rombirli commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a benchmark that parses the same sources with the ECJ frontend and with this SemSitter frontend, then diffs the SonarJava trees and the symbols on them.
  • Writes absolute mismatch counts, proportions, and one readable entry per mismatch (benchmark/out/mismatches.txt, plus summary.json and mismatches.jsonl).
  • Runs from this branch. The ECJ side is a separate checkout (--ecj, default ../sonar-java). Both checkouts need java-frontend already compiled.

Test plan

  • python3 benchmark/compare.py --ecj ~/Documents/sonar-java --semsitter <v2 checkout> --corpus benchmark/corpus
  • Sample corpus: 63 shared nodes, 0 missing nodes, 2 span mismatches (3.2%), 7 semantic mismatches of 35 compared nodes (20.0%).
  • Point --corpus at a larger tree (check samples) once both frontends are compiled in the checkouts you want to score.

Summary by Gitar

  • Benchmark tooling:
    • Added bucket_sample.py to sample and bucket AST and semantic mismatches per file
    • Added AstSemanticDump.java to dump SonarJava trees with symbols and types for ECJ and SemSitter
  • Corpus fixtures:
    • Added Sample.java and Use.java sample sources under benchmark/corpus/bench
  • Output handling:
    • Per-file diffs and ast-issue-buckets.csv / semantic-issue-buckets.csv outputs; out/ ignored via .gitignore

This will update automatically on new commits.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

SONARJAVA-7236

Comment on lines +161 to +175
@Override
protected void scan(@Nullable List<? extends Tree> trees) {
if (trees == null) {
return;
}
Map<Tree.Kind, Integer> seen = new HashMap<>();
for (Tree tree : trees) {
if (tree == null) {
continue;
}
int index = seen.merge(tree.kind(), 1, Integer::sum) - 1;
enter(tree, index);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: Sibling nodes reached via scan(Tree) all get index [0], so paths collide

DumpVisitor.scan(Tree) always calls enter(tree, 0). BaseTreeVisitor reaches most children through separate scan(Tree) calls: visitMemberSelectExpression scans expression() and then identifier(), and visitVariable scans type() and then simpleName(). When two of those children have the same kind, they get the same path, e.g. .../MEMBER_SELECT[0]/IDENTIFIER[0] for both values and get in the sample corpus. ListTree children like class superInterfaces/permittedTypes hit the same problem, since they go through scan((Tree) listTree), and so do separate scan(List) calls under one parent. In compare.py, load() keys records by path (nodes[name][record["path"]] = record), so the later record overwrites the earlier one. Node counts come out too low (the reported 63 shared nodes included), the descendants of colliding subtrees get merged, and mismatches on the overwritten node are never seen. Fix: keep a per-parent Map<Tree.Kind,Integer> counter on the stack and assign the index in enter, no matter which scan overload reached the child.

Index children per parent instead of per scan call:

private final java.util.ArrayDeque<Map<Tree.Kind, Integer>> counters = new java.util.ArrayDeque<>(List.of(new HashMap<>()));

@Override
protected void scan(@Nullable List<? extends Tree> trees) {
  if (trees != null) { for (Tree t : trees) { scan(t); } }
}

@Override
protected void scan(@Nullable Tree tree) {
  if (tree != null) {
    enter(tree, counters.peek().merge(tree.kind(), 1, Integer::sum) - 1);
  }
}
// in enter(): counters.push(new HashMap<>()) before accept, counters.pop() after
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment on lines +176 to +190
@Override
protected void scan(@Nullable Tree tree) {
if (tree != null) {
enter(tree, 0);
}
}

private void enter(Tree tree, int index) {
String parent = stack.isEmpty() ? "" : stack.peek();
String path = (parent.isEmpty() ? "" : parent + "/") + tree.kind().name() + "[" + index + "]";
stack.push(path);
emit(tree, path);
tree.accept(this);
stack.pop();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: Binary-expression operands are never emitted or compared

BaseTreeVisitor.visitBinaryExpression calls tree.leftOperand().accept(this) and tree.rightOperand().accept(this) directly, not scan(...). Because of that, DumpVisitor.enter never runs for the operands: they get no record, so their symbols and types are never compared. Their descendants are also given paths directly under the binary node, as if the operands weren't there. In a + b, for example, neither identifier is dumped. Any AST or semantic difference on operands, which show up all over a real corpus, is invisible to the benchmark. Fix: override visitBinaryExpression in DumpVisitor to call scan(tree.leftOperand()); scan(tree.rightOperand());. Also check BaseTreeVisitor for any other direct accept(this) calls.

Route operands through scan so they are emitted:

@Override
public void visitBinaryExpression(org.sonar.plugins.java.api.tree.BinaryExpressionTree tree) {
  scan(tree.leftOperand());
  scan(tree.rightOperand());
}
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread benchmark/src/AstSemanticDump.java Resolved
Comment thread benchmark/compare.py
Comment on lines +354 to +368
ecj = args.ecj
if ecj is None:
candidate = REPO.parent / "sonar-java"
if not candidate.exists():
raise SystemExit("pass --ecj, the ECJ checkout was not found at ../sonar-java")
ecj = candidate
corpus = args.corpus.resolve()
out = args.out.resolve()
out.mkdir(parents=True, exist_ok=True)
files = java_files(corpus)
print(f"classpath {ecj}", file=sys.stderr)
ecj_cp = tool_classpath(ecj)
print(f"classpath {args.semsitter}", file=sys.stderr)
sem_cp = tool_classpath(args.semsitter.resolve())
ecj_dump = out / "ecj.jsonl"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Bug: Relative --ecj path breaks the mvn output file location

args.semsitter is resolved before tool_classpath, but ecj is passed through unresolved. When --ecj ../sonar-java is given, output stays relative to Python's cwd. Maven, however, runs with cwd=checkout and resolves -Dmdep.outputFile relative to that directory (or to the module basedir), not Python's cwd. The classpath file ends up somewhere else, and output.read_text() then fails or reads a stale file. Fix: resolve ecj once (ecj = ecj.resolve()) before tool_classpath.

Resolve the ECJ checkout path up front:

ecj = ecj.resolve()
corpus = args.corpus.resolve()
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread benchmark/compare.py Resolved
@github-actions

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Ruling Diff Summary

Detected changes in 123 rule files: 4940 issues removed, 5151 issues added.

S104 (java) on eclipse-jetty - 22 issues removed, 22 issues added

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java)

Removed jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java (file-level)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java (line 1)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java)

Removed jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java (file-level)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java (line 1)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java (file-level)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java (line 1)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (file-level)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (line 1)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java (file-level)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java)
S109 (java) on eclipse-jetty - 0 issues removed, 17 issues added

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (line 108)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (line 109)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (line 150)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java (line 91)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/Request.java (line 1283)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/Request.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java (line 113)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java (line 108)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/MemoryUtils.java (line 33)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/MemoryUtils.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java (line 251)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java)
S112 (java) on eclipse-jetty - 2 issues removed, 52 issues added

Removed jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java (line 359)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java (line 139)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java (line 187)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java (line 328)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java (line 920)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java (line 978)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java (line 1014)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java (line 237)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java (line 335)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java (line 400)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java (line 771)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java (line 73)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java (line 357)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java (line 104)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java (line 143)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java)
S1130 (java) on eclipse-jetty - 10 issues removed, 852 issues added

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java (line 197)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java (line 89)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java (line 102)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java (line 126)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java)

Removed jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java (line 114)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java)

Removed jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java (line 33)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java)

Removed jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java (line 247)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java)

Removed jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java (line 267)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java (line 296)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/IncludeExcludeConnectionStatistics.java (line 33)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/IncludeExcludeConnectionStatistics.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/IncludeExcludeConnectionStatistics.java (line 43)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/IncludeExcludeConnectionStatistics.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/IncludeExcludeConnectionStatistics.java (line 53)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/IncludeExcludeConnectionStatistics.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java (line 149)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java (line 154)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java (line 183)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java)
S1144 (java) on eclipse-jetty - 1 issues removed, 24 issues added

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpStatus.java (line 179)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpStatus.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java (line 304)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java (line 309)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java (line 279)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java (line 284)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java (line 289)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java (line 433)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (line 991)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (line 1007)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (line 1024)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java (line 260)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java (line 273)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java (line 852)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java (line 65)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/SecureRequestCustomizer.java (line 286)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/SecureRequestCustomizer.java)
S1161 (java) on eclipse-jetty - 0 issues removed, 3 issues added

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java (line 1284)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java (line 609)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java (line 184)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java)
S1162 (java) on eclipse-jetty - 1 issues removed, 0 issues added

Removed jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java (line 150)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java)
S117 (java) on eclipse-jetty - 0 issues removed, 29 issues added

Added jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java (line 372)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/GZIPContentDecoderTest.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java (line 150)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java (line 226)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java (line 227)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java (line 647)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java (line 788)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java (line 789)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java (line 1344)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java (line 56)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/IdleTimeoutHandler.java (line 81)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/IdleTimeoutHandler.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java (line 58)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java (line 59)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java (line 60)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java (line 1578)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java (line 597)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java)
S1172 (java) on eclipse-jetty - 3 issues removed, 0 issues added

Removed jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java (line 112)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java)

Removed jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLCloseTest.java (line 93)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLCloseTest.java)

Removed jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java (line 334)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java)
S1181 (java) on eclipse-jetty - 17 issues removed, 4 issues added

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java (line 1594)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java (line 55)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java)

Removed jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java (line 221)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java)

Removed jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java (line 249)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java)

Removed jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java (line 335)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java)

Removed jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java (line 76)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java)

Removed jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java (line 168)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/AsyncRequestLogWriter.java (line 86)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/AsyncRequestLogWriter.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java (line 346)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java (line 394)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (line 414)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (line 516)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java (line 878)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java (line 596)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java (line 627)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java)
S1185 (java) on eclipse-jetty - 6 issues removed, 0 issues added

Removed jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java (line 508)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/AcceptRateLimit.java (line 269)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/AcceptRateLimit.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java (line 85)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java (line 91)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java (line 142)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java (line 148)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java)
S1226 (java) on eclipse-jetty - 0 issues removed, 194 issues added - new ruling file

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java (line 519)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java (line 156)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java (line 562)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java (line 802)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java (line 806)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java (line 812)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java (line 185)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java (line 187)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java (line 189)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java (line 94)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java (line 96)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java (line 98)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ArrayByteBufferPool.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java (line 225)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java (line 97)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java (line 277)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java)
S125 (java) on eclipse-jetty - 0 issues removed, 4 issues added

Added jetty-server/src/test/java/org/eclipse/jetty/server/AsyncRequestReadTest.java (line 136)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/AsyncRequestReadTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/ShutdownMonitorTest.java (line 219)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/ShutdownMonitorTest.java)
S131 (java) on eclipse-jetty - 0 issues removed, 1 issues added

Added jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java (line 149)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java)
S1451 (java) on eclipse-jetty - 438 issues removed, 438 issues added

Removed jetty-http/src/main/java/module-info.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/module-info.java)

Added jetty-http/src/main/java/module-info.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/module-info.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java)
S1604 (java) on eclipse-jetty - 1 issues removed, 0 issues added

Removed jetty-util/src/main/java/org/eclipse/jetty/util/MemoryUtils.java (line 37)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/MemoryUtils.java)
S1643 (java) on eclipse-jetty - 0 issues removed, 3 issues added

Added jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java (line 176)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java (line 181)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java (line 186)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java)
S1939 (java) on eclipse-jetty - 4 issues removed, 0 issues added

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java (line 514)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/QuotedQualityCSV.java (line 41)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/QuotedQualityCSV.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessSet.java (line 33)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessSet.java)

Removed jetty-util/src/main/java/org/eclipse/jetty/util/InetAddressSet.java (line 39)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/InetAddressSet.java)
S1948 (java) on eclipse-jetty - 0 issues removed, 1 issues added

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java (line 58)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java)
S2109 (java) on eclipse-jetty - 0 issues removed, 1 issues added - new ruling file

Added jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MetaData.java (line 240)

(source file not found at this revision: jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MetaData.java)
S2142 (java) on eclipse-jetty - 6 issues removed, 0 issues added

Removed jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java (line 674)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java (line 735)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java (line 279)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java (line 305)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/Server.java (line 493)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/Server.java)

Removed jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java (line 281)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java)
S2143 (java) on eclipse-jetty - 6 issues removed, 6 issues added

Removed jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java (line 1)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java)

Removed jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java (file-level)

(source file not found at this revision: jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java)

Added jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java (line 1)

(source file not found at this revision: jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java)

Removed jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java (file-level)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java (line 1)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java)

Removed jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java (file-level)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java (line 1)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java)

Removed jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java (file-level)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java (line 1)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java)
S2160 (java) on eclipse-jetty - 0 issues removed, 3 issues added

Added jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/RegexPathSpec.java (line 24)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/RegexPathSpec.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java (line 26)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java (line 41)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java)
S2175 (java) on eclipse-jetty - 0 issues removed, 2 issues added - new ruling file

Added jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java (line 105)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java (line 157)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java)
S2184 (java) on eclipse-jetty - 0 issues removed, 2 issues added

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java (line 1166)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java (line 866)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java)
S2185 (java) on eclipse-jetty - 0 issues removed, 1 issues added - new ruling file

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java (line 1166)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java)
S2187 (java) on eclipse-jetty - 0 issues removed, 30 issues added - new ruling file

Added jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterLenientTest.java (line 37)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterLenientTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java (line 38)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorServerHTTPTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/HttpURIParseTest.java (line 35)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/HttpURIParseTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecMatchListTest.java (line 36)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecMatchListTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecOrderTest.java (line 35)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecOrderTest.java)

Added jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecBadSpecsTest.java (line 32)

(source file not found at this revision: jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecBadSpecsTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/AsyncCompletionTest.java (line 71)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/AsyncCompletionTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/DelayedServerTest.java (line 33)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/DelayedServerTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java (line 51)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToCommitTest.java (line 45)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToCommitTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/MultiPartCaptureTest.java (line 59)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/MultiPartCaptureTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/ProxyConnectionTest.java (line 40)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/ProxyConnectionTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorAsyncContextTest.java (line 26)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorAsyncContextTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorCloseTest.java (line 24)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorCloseTest.java)

Added jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorHttpServerTest.java (line 26)

(source file not found at this revision: jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorHttpServerTest.java)
S2209 (java) on eclipse-jetty - 0 issues removed, 1 issues added - new ruling file

Added jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java (line 81)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java)
S2221 (java) on eclipse-jetty - 4 issues removed, 31 issues added

Removed jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java (line 208)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java (line 252)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java (line 124)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java (line 305)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java (line 211)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java (line 362)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java (line 739)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java (line 842)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java (line 184)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java (line 228)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java (line 250)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java (line 96)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java (line 169)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java (line 306)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java (line 232)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java)
S2250 (java) on eclipse-jetty - 1 issues removed, 0 issues added

Removed jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java (line 73)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java)
S2293 (java) on eclipse-jetty - 1 issues removed, 0 issues added

Removed jetty-util/src/main/java/org/eclipse/jetty/util/thread/Sweeper.java (line 92)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/thread/Sweeper.java)
S2325 (java) on eclipse-jetty - 6 issues removed, 0 issues added

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java (line 1301)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java)

Removed jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java (line 1064)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java (line 351)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java (line 234)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java)

Removed jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionContext.java (line 111)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionContext.java)

Removed jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StdErrAppender.java (line 188)

(source file not found at this revision: jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StdErrAppender.java)
S2387 (java) on eclipse-jetty - 0 issues removed, 19 issues added - new ruling file

Added jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java (line 34)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayEndPoint.java (line 47)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayEndPoint.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java (line 32)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficSocketChannelEndPoint.java (line 35)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficSocketChannelEndPoint.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/SocketChannelEndPoint.java (line 44)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/SocketChannelEndPoint.java)

Added jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java (line 83)

(source file not found at this revision: jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelOverHttp.java (line 51)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelOverHttp.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java (line 55)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java (line 53)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/ThreadLimitHandler.java (line 74)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/ThreadLimitHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java (line 156)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java)

Added jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCache.java (line 37)

(source file not found at this revision: jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCache.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/component/StopLifeCycle.java (line 29)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/component/StopLifeCycle.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java (line 38)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java)

Added jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java (line 39)

(source file not found at this revision: jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java)

... and 90 more rules with changes (diff too large to display fully)

@rombirli
rombirli force-pushed the rombirli/ast-semantic-benchmark branch from cc21c23 to 33bf97f Compare October 30, 2026 11:06
Comment on lines +191 to +205
def issue_name(item: dict) -> str:
category = item["category"]
if category == "parse":
if item.get("ecj_error") and item.get("sem_error"):
return "parse failure on both sides"
if item.get("sem_error"):
return "parse failure on SemSitter"
return "parse failure on ECJ"
if category == "symbol":
return symbol_issue(item["ecj"], item["sem"])
if category == "type":
return type_issue(item["ecj"], item["sem"])
if category == "span":
return span_issue(item["ecj"], item["sem"])
node = item.get("ecj") or item.get("sem") or {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: type_arguments mismatches get bucketed as 'node only on SemSitter'

bucket_sample.py samples the semantic categories {"symbol", "type", "type_arguments"} (line 345), and collect adds type_arguments items from semantic_kind. But issue_name only handles parse, symbol, type and span. Every other category falls through to ast_issue(category, node), and that returns f"node only on SemSitter: {kind}" for anything that isn't ast_only_ecj. So each type-argument mismatch shows up in semantic-issue-buckets.csv as an AST gap such as node only on SemSitter: IDENTIFIER, and fix_for then labels it semsitter. The semantic buckets give the wrong root cause and fix target for this whole category. Fix: add a type_arguments branch to issue_name (for example, one that compares symbolFull/typeFull), and send only the ast_only_* categories to ast_issue.

Handle type_arguments explicitly in issue_name:

if category == "type_arguments":
    return "type arguments differ"
if category in {"ast_only_ecj", "ast_only_semsitter"}:
    node = item.get("ecj") or item.get("sem") or {}
    return ast_issue(category, node)
return category
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment on lines +95 to +109
Map<String, Tree> trees = new HashMap<>();
Map<String, String> errors = new HashMap<>();
config.parse(inputFiles, () -> false, new AnalysisProgress(inputFiles.size()), (input, result) -> {
String name = names.get(input);
try {
trees.put(name, result.get());
} catch (Exception failure) {
errors.put(name, describe(failure));
}
});
StringBuilder body = new StringBuilder();
List<String> order = new ArrayList<>(names.values());
order.sort(Comparator.naturalOrder());
for (String name : order) {
if (errors.containsKey(name)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance: Every parsed tree is held in memory until all files are parsed

In this delta, AstSemanticDump parses through JParserConfig.parse and stores every result.get() in the trees map (lines 95-104). Nothing is dumped until the whole corpus has been parsed. Each retained CompilationUnitTree keeps its full semantic model alive (with ECJ in FILE_BY_FILE mode, that includes per-file binding environments). Memory therefore grows with corpus size instead of staying at one file at a time, as it does in the rule tests and the scanner. The PR's next step is running against a larger corpus, and that run may hit OOM or slow down badly. Fix: run DumpVisitor (or write the error record) inside the callback, appending to a per-file buffer, so each tree can be released straight away. The output order is already fixed by sorting names.

Was this helpful? React with 👍 / 👎

Comment thread benchmark/compare.py
Comment on lines +391 to +405
for name in files:
left = ecj_nodes.get(name, {})
right = sem_nodes.get(name, {})
ecj_count += len(left)
sem_count += len(right)
left_only = set(left) - set(right)
right_only = set(right) - set(left)
for path in sorted(left_only):
only_ecj_all.append((name, path))
for path in sorted(right_only):
only_sem_all.append((name, path))
for path in collapsed(left_only):
only_ecj_roots.append((name, path))
for path in collapsed(right_only):
only_sem_roots.append((name, path))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Global AST counts include whole-file parse failures; per-file diffs don't

load stores a file either as an error or as nodes, never both. So when one side fails to parse a file, compare() puts every node from the other side into only_ecj_all/only_sem_all and counts them in ast.mismatches, only_ecj and mismatch_proportion. mismatches.txt also lists COMPILATION_UNIT[0] as "AST only in ECJ/SemSitter". For the same file, file_diff sets whole_file and reports zero AST mismatches ("one side did not parse this file"), and bucket_sample.collect skips the file's AST rows. A single parse failure can therefore inflate the headline AST mismatch rate, while the per-file diffs and the buckets disagree with that number. Fix: skip whole-file parse failures in compare() the same way file_diff and collect do, and keep reporting them under parse_failures.

Was this helpful? React with 👍 / 👎

@github-actions

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

@datadog-sonarsource

This comment has been minimized.

@rombirli
rombirli force-pushed the rombirli/ast-semantic-benchmark branch from 33bf97f to 050e0d6 Compare October 30, 2026 12:05
@github-actions

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

@rombirli
rombirli force-pushed the rombirli/ast-semantic-benchmark branch from 050e0d6 to 13fe6f2 Compare November 2, 2026 08:52
Comment on lines +350 to +364
private static String withArguments(Type type, int depth) {
if (type.isUnknown()) {
return "unknown";
}
String name = erase(type.fullyQualifiedName());
if (depth > 3 || !type.isParameterized()) {
return name;
}
StringBuilder out = new StringBuilder(name).append('<');
List<Type> arguments = type.typeArguments();
for (int i = 0; i < arguments.size(); i++) {
out.append(i == 0 ? "" : ",").append(withArguments(arguments.get(i), depth + 1));
}
return out.append('>').toString();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: Type arguments of array element types are dropped from typeFull

withArguments erases fullyQualifiedName() and only adds arguments when type.isParameterized() is true. Array types are never parameterized (JType.isParameterized only returns true for Kind.NAMED with args), and their name is built from the element's FQN plus []. So List<String>[], and varargs such as List<T>... in method signatures, both come out as java.util.List[] in typeFull/symbolFull. A type-argument mismatch inside an array element type is never counted, which falls short of what this commit says it does ("Compare type arguments"). Fix: when the type is an ArrayType, recurse into elementType() and append [].

Recurse into the element type for arrays before checking parameterization:

if (type.isArray()) {
  return withArguments(((Type.ArrayType) type).elementType(), depth) + "[]";
}
String name = erase(type.fullyQualifiedName());
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

1 similar comment
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

@rombirli
rombirli force-pushed the rombirli/ast-semantic-benchmark branch from 13fe6f2 to 1df8a88 Compare November 2, 2026 10:25
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

@rombirli
rombirli marked this pull request as draft November 2, 2026 13:14
@rombirli
rombirli force-pushed the rombirli/ast-semantic-benchmark branch from 1df8a88 to 045c9a3 Compare November 2, 2026 14:14
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

The benchmark runs the ECJ frontend and this frontend on the same sources and writes absolute counts, proportions, and each mismatch.
Input files were keyed by base name, so files with the same name in different directories overwrote each other and 196 samples were never compared.
…ples

compare.py also splits the dumps on line feeds only, so a string literal holding a Unicode next-line character no longer breaks a record. bucket_sample.py samples 1000 AST and 1000 semantic mismatches evenly across files, groups them by underlying issue, and says whether the fix belongs to the bridge or to SemSitter.
@rombirli
rombirli force-pushed the rombirli/ast-semantic-benchmark branch from 045c9a3 to 3fe5877 Compare November 2, 2026 14:40
@gitar-bot

gitar-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
CI failed: Two unrelated CI test failures in the Plugin QA and Sanity Test jobs: six integration-test assertion failures (JSP, modular-JDK classpath, tutorial telemetry, SonarLint parse-error) and a Surefire forked-JVM OutOfMemoryError in SanityTest. Neither is attributed to this PR's benchmark-only changes.

Overview

Two unique error templates were analyzed from 2 of the 60 logs in the run (commit 3fe5877). Both failures are in the test stage. The analyzers found no evidence linking either to this PR, which only adds standalone benchmark tooling and corpus files under benchmark/.

Failures

Plugin QA integration-test assertion failures (confidence: high)

  • Type: test
  • Affected jobs: 125342191667
  • Related to change: no
  • Root cause: Six independent ITs failed: JspTest.should_transpile_jsp (expected JSP-generated classes missing), two JavaClasspathTest modular-JDK cases (expected S4551 issues not found), JavaTutorialTest (8 main-source type errors where 0 are expected), JavaTutorialTest.test_as_batch_mode, and SonarLintIntegrationTest.parse_error_should_report_analysis_error (actual value not shown in the log). The log does not show a shared cause.
  • Suggested fix: Inspect the Surefire reports and reproduce each of the six tests individually. Check JSP transpilation output, modular-JDK classpath setup and S4551 analysis, tutorial type-error counts, and the SonarLint parse-error result.

Sanity Test OutOfMemoryError in Surefire fork (confidence: high)

  • Type: test
  • Affected jobs: 125342191752
  • Related to change: no
  • Root cause: Maven compilation succeeded, then the forked test JVM ran out of heap (java.lang.OutOfMemoryError: Java heap space) during org.sonar.plugins.java.SanityTest, so 0 tests completed. The log does not identify the allocation responsible.
  • Suggested fix: Inspect the Surefire dump files and SanityTest memory use to find the allocation. If the workload is expected, raise the forked test JVM heap or reduce its memory demand, then rerun.

Summary

  • Change-related failures: None. Both findings are marked related_to_pr: no.
  • Infrastructure/flaky failures: None identified. The OOM may be resource-related, but it was not classified as infrastructure or flaky.
  • Recommended action: Treat both as pre-existing or unrelated test failures in the plugin ITs and SanityTest. Triage them separately from this benchmark-only PR. Start with the Surefire reports and the SanityTest heap dump.
Code Review ⚠️ Changes requested 2 closed / 9 findings

🟡 Medium risk · The benchmark harness deletes its output diffs tree before rewriting it, so choosing an existing --out path could erase user files.

Adds a benchmark comparing SonarJava AST and semantic output between the ECJ and SemSitter frontends, with per-file diffs, bucketed samples, and mismatch reports. Changes are requested because the dump misses or miscounts mismatches: sibling nodes with the same kind collide on path, binary-expression operands are never dumped, type-argument mismatches are bucketed as AST gaps, and whole-file parse failures inflate the global AST mismatch rate. Also open: all parsed trees are retained in memory until the end, array element type arguments are dropped from typeFull, and a relative --ecj path resolves the Maven classpath output against the wrong directory.

⚠️ Bug: Sibling nodes reached via scan(Tree) all get index [0], so paths collide

📄 benchmark/src/AstSemanticDump.java:161-175 📄 benchmark/compare.py:132-144

DumpVisitor.scan(Tree) always calls enter(tree, 0). BaseTreeVisitor reaches most children through separate scan(Tree) calls: visitMemberSelectExpression scans expression() and then identifier(), and visitVariable scans type() and then simpleName(). When two of those children have the same kind, they get the same path, e.g. .../MEMBER_SELECT[0]/IDENTIFIER[0] for both values and get in the sample corpus. ListTree children like class superInterfaces/permittedTypes hit the same problem, since they go through scan((Tree) listTree), and so do separate scan(List) calls under one parent. In compare.py, load() keys records by path (nodes[name][record["path"]] = record), so the later record overwrites the earlier one. Node counts come out too low (the reported 63 shared nodes included), the descendants of colliding subtrees get merged, and mismatches on the overwritten node are never seen. Fix: keep a per-parent Map<Tree.Kind,Integer> counter on the stack and assign the index in enter, no matter which scan overload reached the child.

Index children per parent instead of per scan call
private final java.util.ArrayDeque<Map<Tree.Kind, Integer>> counters = new java.util.ArrayDeque<>(List.of(new HashMap<>()));

@Override
protected void scan(@Nullable List<? extends Tree> trees) {
  if (trees != null) { for (Tree t : trees) { scan(t); } }
}

@Override
protected void scan(@Nullable Tree tree) {
  if (tree != null) {
    enter(tree, counters.peek().merge(tree.kind(), 1, Integer::sum) - 1);
  }
}
// in enter(): counters.push(new HashMap<>()) before accept, counters.pop() after
⚠️ Bug: Binary-expression operands are never emitted or compared

📄 benchmark/src/AstSemanticDump.java:176-190

BaseTreeVisitor.visitBinaryExpression calls tree.leftOperand().accept(this) and tree.rightOperand().accept(this) directly, not scan(...). Because of that, DumpVisitor.enter never runs for the operands: they get no record, so their symbols and types are never compared. Their descendants are also given paths directly under the binary node, as if the operands weren't there. In a + b, for example, neither identifier is dumped. Any AST or semantic difference on operands, which show up all over a real corpus, is invisible to the benchmark. Fix: override visitBinaryExpression in DumpVisitor to call scan(tree.leftOperand()); scan(tree.rightOperand());. Also check BaseTreeVisitor for any other direct accept(this) calls.

Route operands through scan so they are emitted
@Override
public void visitBinaryExpression(org.sonar.plugins.java.api.tree.BinaryExpressionTree tree) {
  scan(tree.leftOperand());
  scan(tree.rightOperand());
}
⚠️ Bug: type_arguments mismatches get bucketed as 'node only on SemSitter'

📄 benchmark/bucket_sample.py:191-205 📄 benchmark/bucket_sample.py:184-188 📄 benchmark/bucket_sample.py:345

bucket_sample.py samples the semantic categories {"symbol", "type", "type_arguments"} (line 345), and collect adds type_arguments items from semantic_kind. But issue_name only handles parse, symbol, type and span. Every other category falls through to ast_issue(category, node), and that returns f"node only on SemSitter: {kind}" for anything that isn't ast_only_ecj. So each type-argument mismatch shows up in semantic-issue-buckets.csv as an AST gap such as node only on SemSitter: IDENTIFIER, and fix_for then labels it semsitter. The semantic buckets give the wrong root cause and fix target for this whole category. Fix: add a type_arguments branch to issue_name (for example, one that compares symbolFull/typeFull), and send only the ast_only_* categories to ast_issue.

Handle type_arguments explicitly in issue_name
if category == "type_arguments":
    return "type arguments differ"
if category in {"ast_only_ecj", "ast_only_semsitter"}:
    node = item.get("ecj") or item.get("sem") or {}
    return ast_issue(category, node)
return category
⚠️ Performance: Every parsed tree is held in memory until all files are parsed

📄 benchmark/src/AstSemanticDump.java:95-109

In this delta, AstSemanticDump parses through JParserConfig.parse and stores every result.get() in the trees map (lines 95-104). Nothing is dumped until the whole corpus has been parsed. Each retained CompilationUnitTree keeps its full semantic model alive (with ECJ in FILE_BY_FILE mode, that includes per-file binding environments). Memory therefore grows with corpus size instead of staying at one file at a time, as it does in the rule tests and the scanner. The PR's next step is running against a larger corpus, and that run may hit OOM or slow down badly. Fix: run DumpVisitor (or write the error record) inside the callback, appending to a per-file buffer, so each tree can be released straight away. The output order is already fixed by sorting names.

💡 Bug: Relative --ecj path breaks the mvn output file location

📄 benchmark/compare.py:354-368 📄 benchmark/compare.py:43-57

args.semsitter is resolved before tool_classpath, but ecj is passed through unresolved. When --ecj ../sonar-java is given, output stays relative to Python's cwd. Maven, however, runs with cwd=checkout and resolves -Dmdep.outputFile relative to that directory (or to the module basedir), not Python's cwd. The classpath file ends up somewhere else, and output.read_text() then fails or reads a stale file. Fix: resolve ecj once (ecj = ecj.resolve()) before tool_classpath.

Resolve the ECJ checkout path up front
ecj = ecj.resolve()
corpus = args.corpus.resolve()
💡 Quality: Global AST counts include whole-file parse failures; per-file diffs don't

📄 benchmark/compare.py:391-405 📄 benchmark/compare.py:419-420 📄 benchmark/compare.py:309 📄 benchmark/compare.py:347-350 📄 benchmark/bucket_sample.py:224-225

load stores a file either as an error or as nodes, never both. So when one side fails to parse a file, compare() puts every node from the other side into only_ecj_all/only_sem_all and counts them in ast.mismatches, only_ecj and mismatch_proportion. mismatches.txt also lists COMPILATION_UNIT[0] as "AST only in ECJ/SemSitter". For the same file, file_diff sets whole_file and reports zero AST mismatches ("one side did not parse this file"), and bucket_sample.collect skips the file's AST rows. A single parse failure can therefore inflate the headline AST mismatch rate, while the per-file diffs and the buckets disagree with that number. Fix: skip whole-file parse failures in compare() the same way file_diff and collect do, and keep reporting them under parse_failures.

💡 Edge Case: Type arguments of array element types are dropped from typeFull

📄 benchmark/src/AstSemanticDump.java:350-364

withArguments erases fullyQualifiedName() and only adds arguments when type.isParameterized() is true. Array types are never parameterized (JType.isParameterized only returns true for Kind.NAMED with args), and their name is built from the element's FQN plus []. So List<String>[], and varargs such as List<T>... in method signatures, both come out as java.util.List[] in typeFull/symbolFull. A type-argument mismatch inside an array element type is never counted, which falls short of what this commit says it does ("Compare type arguments"). Fix: when the type is an ArrayType, recurse into elementType() and append [].

Recurse into the element type for arrays before checking parameterization
if (type.isArray()) {
  return withArguments(((Type.ArrayType) type).elementType(), depth) + "[]";
}
String name = erase(type.fullyQualifiedName());
✅ 2 closed
✅ Bug: Files with the same name in different dirs collapse into one InputFile

📄 benchmark/src/AstSemanticDump.java:81-92 📄 benchmark/src/AstSemanticDump.java:96-103
Each InputFile is built with new TestInputFileBuilder("bench", file.getParent().toFile(), file.toFile()), which makes the file's own directory its module base dir. Every input's relative path is therefore just the file name. DefaultInputFile equality and hash are based on that relative path, so a/Foo.java and b/Foo.java count as equal keys in the names HashMap. The second put overwrites the first, the parse callback maps both inputs to the same name, and trees.put keeps only one tree. One file disappears from both dumps without any warning. This is likely to happen on the larger corpora the test plan mentions (package-info.java, Test.java, ...). Fix: build every input with the corpus root as base dir, e.g. new TestInputFileBuilder("bench", root.toFile(), file.toFile()), or key names by identity or path.

✅ Edge Case: No analysis classpath passed; library types are unknown on both sides

📄 benchmark/compare.py:118-129 📄 benchmark/src/AstSemanticDump.java:69-79 📄 benchmark/src/AstSemanticDump.java:93
AstSemanticDump takes a --classpath option for the analysis classpath, but compare.py never passes it and offers no flag for it. Both frontends therefore run JParserConfig with an empty classpath. Any non-JDK type in the corpus resolves to unknown on both sides, and semantic_kind counts unknown == unknown as a match. On a real-project corpus, which the test plan calls for, the semantic mismatch rate will come out lower than it really is. Fix: add a --corpus-classpath argument to compare.py and forward it as --classpath in dump().

🤖 Prompt for agents
Code Review: Adds a benchmark comparing SonarJava AST and semantic output between the ECJ and SemSitter frontends, with per-file diffs, bucketed samples, and mismatch reports. Changes are requested because the dump misses or miscounts mismatches: sibling nodes with the same kind collide on path, binary-expression operands are never dumped, type-argument mismatches are bucketed as AST gaps, and whole-file parse failures inflate the global AST mismatch rate. Also open: all parsed trees are retained in memory until the end, array element type arguments are dropped from typeFull, and a relative --ecj path resolves the Maven classpath output against the wrong directory.

1. ⚠️ Bug: Sibling nodes reached via scan(Tree) all get index [0], so paths collide
   Files: benchmark/src/AstSemanticDump.java:161-175, benchmark/compare.py:132-144

   `DumpVisitor.scan(Tree)` always calls `enter(tree, 0)`. `BaseTreeVisitor` reaches most children through separate `scan(Tree)` calls: `visitMemberSelectExpression` scans `expression()` and then `identifier()`, and `visitVariable` scans `type()` and then `simpleName()`. When two of those children have the same kind, they get the same path, e.g. `.../MEMBER_SELECT[0]/IDENTIFIER[0]` for both `values` and `get` in the sample corpus. `ListTree` children like class `superInterfaces`/`permittedTypes` hit the same problem, since they go through `scan((Tree) listTree)`, and so do separate `scan(List)` calls under one parent. In `compare.py`, `load()` keys records by path (`nodes[name][record["path"]] = record`), so the later record overwrites the earlier one. Node counts come out too low (the reported 63 shared nodes included), the descendants of colliding subtrees get merged, and mismatches on the overwritten node are never seen. Fix: keep a per-parent `Map<Tree.Kind,Integer>` counter on the stack and assign the index in `enter`, no matter which `scan` overload reached the child.

   Fix (Index children per parent instead of per scan call):
   private final java.util.ArrayDeque<Map<Tree.Kind, Integer>> counters = new java.util.ArrayDeque<>(List.of(new HashMap<>()));
   
   @Override
   protected void scan(@Nullable List<? extends Tree> trees) {
     if (trees != null) { for (Tree t : trees) { scan(t); } }
   }
   
   @Override
   protected void scan(@Nullable Tree tree) {
     if (tree != null) {
       enter(tree, counters.peek().merge(tree.kind(), 1, Integer::sum) - 1);
     }
   }
   // in enter(): counters.push(new HashMap<>()) before accept, counters.pop() after

2. ⚠️ Bug: Binary-expression operands are never emitted or compared
   Files: benchmark/src/AstSemanticDump.java:176-190

   `BaseTreeVisitor.visitBinaryExpression` calls `tree.leftOperand().accept(this)` and `tree.rightOperand().accept(this)` directly, not `scan(...)`. Because of that, `DumpVisitor.enter` never runs for the operands: they get no record, so their symbols and types are never compared. Their descendants are also given paths directly under the binary node, as if the operands weren't there. In `a + b`, for example, neither identifier is dumped. Any AST or semantic difference on operands, which show up all over a real corpus, is invisible to the benchmark. Fix: override `visitBinaryExpression` in `DumpVisitor` to call `scan(tree.leftOperand()); scan(tree.rightOperand());`. Also check `BaseTreeVisitor` for any other direct `accept(this)` calls.

   Fix (Route operands through scan so they are emitted):
   @Override
   public void visitBinaryExpression(org.sonar.plugins.java.api.tree.BinaryExpressionTree tree) {
     scan(tree.leftOperand());
     scan(tree.rightOperand());
   }

3. 💡 Bug: Relative --ecj path breaks the mvn output file location
   Files: benchmark/compare.py:354-368, benchmark/compare.py:43-57

   `args.semsitter` is resolved before `tool_classpath`, but `ecj` is passed through unresolved. When `--ecj ../sonar-java` is given, `output` stays relative to Python's cwd. Maven, however, runs with `cwd=checkout` and resolves `-Dmdep.outputFile` relative to that directory (or to the module basedir), not Python's cwd. The classpath file ends up somewhere else, and `output.read_text()` then fails or reads a stale file. Fix: resolve `ecj` once (`ecj = ecj.resolve()`) before `tool_classpath`.

   Fix (Resolve the ECJ checkout path up front):
   ecj = ecj.resolve()
   corpus = args.corpus.resolve()

4. ⚠️ Bug: type_arguments mismatches get bucketed as 'node only on SemSitter'
   Files: benchmark/bucket_sample.py:191-205, benchmark/bucket_sample.py:184-188, benchmark/bucket_sample.py:345

   `bucket_sample.py` samples the semantic categories `{"symbol", "type", "type_arguments"}` (line 345), and `collect` adds `type_arguments` items from `semantic_kind`. But `issue_name` only handles `parse`, `symbol`, `type` and `span`. Every other category falls through to `ast_issue(category, node)`, and that returns `f"node only on SemSitter: {kind}"` for anything that isn't `ast_only_ecj`. So each type-argument mismatch shows up in `semantic-issue-buckets.csv` as an AST gap such as `node only on SemSitter: IDENTIFIER`, and `fix_for` then labels it `semsitter`. The semantic buckets give the wrong root cause and fix target for this whole category. Fix: add a `type_arguments` branch to `issue_name` (for example, one that compares `symbolFull`/`typeFull`), and send only the `ast_only_*` categories to `ast_issue`.

   Fix (Handle type_arguments explicitly in issue_name):
   if category == "type_arguments":
       return "type arguments differ"
   if category in {"ast_only_ecj", "ast_only_semsitter"}:
       node = item.get("ecj") or item.get("sem") or {}
       return ast_issue(category, node)
   return category

5. ⚠️ Performance: Every parsed tree is held in memory until all files are parsed
   Files: benchmark/src/AstSemanticDump.java:95-109

   In this delta, `AstSemanticDump` parses through `JParserConfig.parse` and stores every `result.get()` in the `trees` map (lines 95-104). Nothing is dumped until the whole corpus has been parsed. Each retained `CompilationUnitTree` keeps its full semantic model alive (with ECJ in FILE_BY_FILE mode, that includes per-file binding environments). Memory therefore grows with corpus size instead of staying at one file at a time, as it does in the rule tests and the scanner. The PR's next step is running against a larger corpus, and that run may hit OOM or slow down badly. Fix: run `DumpVisitor` (or write the error record) inside the callback, appending to a per-file buffer, so each tree can be released straight away. The output order is already fixed by sorting `names`.

6. 💡 Quality: Global AST counts include whole-file parse failures; per-file diffs don't
   Files: benchmark/compare.py:391-405, benchmark/compare.py:419-420, benchmark/compare.py:309, benchmark/compare.py:347-350, benchmark/bucket_sample.py:224-225

   `load` stores a file either as an error or as nodes, never both. So when one side fails to parse a file, `compare()` puts every node from the other side into `only_ecj_all`/`only_sem_all` and counts them in `ast.mismatches`, `only_ecj` and `mismatch_proportion`. `mismatches.txt` also lists `COMPILATION_UNIT[0]` as "AST only in ECJ/SemSitter". For the same file, `file_diff` sets `whole_file` and reports zero AST mismatches ("one side did not parse this file"), and `bucket_sample.collect` skips the file's AST rows. A single parse failure can therefore inflate the headline AST mismatch rate, while the per-file diffs and the buckets disagree with that number. Fix: skip whole-file parse failures in `compare()` the same way `file_diff` and `collect` do, and keep reporting them under `parse_failures`.

7. 💡 Edge Case: Type arguments of array element types are dropped from typeFull
   Files: benchmark/src/AstSemanticDump.java:350-364

   `withArguments` erases `fullyQualifiedName()` and only adds arguments when `type.isParameterized()` is true. Array types are never parameterized (`JType.isParameterized` only returns true for `Kind.NAMED` with args), and their name is built from the element's FQN plus `[]`. So `List<String>[]`, and varargs such as `List<T>...` in method signatures, both come out as `java.util.List[]` in `typeFull`/`symbolFull`. A type-argument mismatch inside an array element type is never counted, which falls short of what this commit says it does ("Compare type arguments"). Fix: when the type is an `ArrayType`, recurse into `elementType()` and append `[]`.

   Fix (Recurse into the element type for arrays before checking parameterization):
   if (type.isArray()) {
     return withArguments(((Type.ArrayType) type).elementType(), depth) + "[]";
   }
   String name = erase(type.fullyQualifiedName());

Verification Rules 1/1 met PRs 2 inspected

Functional validation No results

Rules 1 passed 2 not applicable

✅ Repository license compliance

Broader impact PRs 2 inspected
Cross-PR 2 PRs inspected 0 open impacts

PR 6432: SONARJAVA-7259 Introduce a compiler-neutral frontend backend with scoped resource management Inspected
PR 6416: SONARJAVA-7252 Decouple the Java frontend from Eclipse JDT core Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.
Unblock → Override a blocking verdict and allow merging.

Comment with these commands to change the behavior for this request:

Auto-apply Compact Unblock
gitar auto-apply:on         
gitar display:verbose         
gitar unblock         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6438

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant