← Back to Pull requests

Replace javaparser 1.0.8 with javaparser-core 3.28.2 #535

Closed
unknown closed this pull request without merging on Oct 31, 2026 10:32 UTC
View on GitHub
unknown unknown commented on Oct 29, 2026 16:37 UTC
Author

Fixes #533
Fixes #327
Part of #472 (the "Replace javaparser-1.0.8" item)

Problem

The Administrator builds its code reference list (Reference tab, CTRL+space) by parsing the userutil sources with javaparser 1.0.8. That version only knows the Java 5 grammar, so any newer syntax in a userutil source (pattern matching, switch expressions, lambdas, diamond, try-with-resources, ...) makes it throw a ParseException. ReferenceListFactory logs the error and drops that class from code assist. #533 is this happening to our own DestinationSet after it started using instanceof Set<?> set, and #327 is the same thing for extension CLIENT source jars.

Change

  • Swap the vendored client/lib/javaparser-1.0.8.jar for com.github.javaparser:javaparser-core:3.28.2 from Maven Central. It goes in the client-main bundle like the other client libs, with a vendored-layout.json placement entry and checksums regenerated on a cold cache. It has no transitive dependencies.

  • Parse at LanguageLevel.CURRENT, the newest grammar the library supports (JAVA_26 in 3.28.2). Extension userutil sources may target a newer Java than our baseline, and we only read signatures and javadoc. A failed parse throws ParseProblemException, so it's still logged per file as before.

  • Port ClassVisitor to the 3.x API (Modifier.Keyword, Optional javadoc, NodeList, and the package name taken from getPackageDeclaration()).

  • Update the javaparser entry in THIRD-PARTY-README.txt. javaparser-core is dual-licensed LGPL-3.0-or-later / Apache-2.0.
  • Verification

  • I dumped every reference ClassVisitor produces for all userutil sources (core, server and httpauth) with the old and new parser. The output is identical except for one entry: MirthCachedRowSet.updateBytes(String columnName, byte x[]) now shows the parameter type as byte[]. The old parser dropped the C-style array brackets and showed byte.

  • DestinationSet with instanceof Set<?> set, as it is on main, parses cleanly and produces the expected entries. So #534's rewrite is no longer needed, though it doesn't conflict with this change.

  • ./gradlew --write-verification-metadata sha256 build dist -PdisableSigning=true -Pcoverage=true passes on a cold Gradle home.

  • After switching to CURRENT, the dump of all userutil sources is unchanged. A test record produces no entries, and a class using a Java 21 pattern switch (case String t ->, case R(int x) ->) parses and produces its entries.

  • Not tested yet: starting the GUI client against a live server.
  • Not in scope

    ClassVisitor still only creates references for classes and interfaces, as before. Records now parse, and a no-op visit(RecordDeclaration) keeps their methods from showing up as stray entries under the package name. Enums keep their existing behavior: their public methods appear under the package name, which is where the current toString entries for DeployedState and ContentType come from. Giving records and enums proper class entries would be a separate change.

    🤖 Generated with Claude Code

    Diff: 389 lines (+291 / -98) across 4 files Reviewer: tonygermano Review duration: 2515m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 389 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.357
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #535"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17% · Safe to merge
    17%