Skip to content

Upgrade to MAT 1.17.0, Java 21, Eclipse 4.40 and Calcite 1.42.0 (1/4) - #121

Open
miguelnieto wants to merge 1 commit into
vlsi:mainfrom
miguelnieto:01_mat-1.17-java21-calcite-1.42
Open

miguelnieto wants to merge 1 commit into
vlsi:mainfrom
miguelnieto:01_mat-1.17-java21-calcite-1.42

Conversation

@miguelnieto

@miguelnieto miguelnieto commented Oct 17, 2026 •

Copy link
Copy Markdown

Summary

Moves the plugin to Eclipse MAT 1.17.0, Java 21, Eclipse 4.40 and Apache Calcite 1.42.0. It also fixes ORDER BY and joins on heap objects, which Calcite 1.37+ broke.

This is the first of three stacked PRs:

  1. This PR: platform upgrade
  2. SQL editor: schema browser, Open in SQL Editor, cancel, date functions (2/4) #122: SQL editor improvements (builds on this one)
  3. Add an MCP server for AI assistants to query heap dumps (3/4) #123: MCP server for AI assistants (builds on SQL editor: schema browser, Open in SQL Editor, cancel, date functions (2/4) #122)
  4. Update shipped libraries with known vulnerabilities (4/4) #129: updates of shipped libraries with known vulnerabilities (builds on Add an MCP server for AI assistants to query heap dumps (3/4) #123)

Each PR builds and passes its tests on its own.

Supersedes the calcite-core 1.42.0 bumps in #119 and #120. Those change only the pom; the Tycho target definition and the new Avatica runtime dependencies need changing too (see below).

⚠️ Breaking

  • MAT 1.17.0+ and Java 21 are required. org.eclipse.mat.api 1.17.0 declares Bundle-RequiredExecutionEnvironment: JavaSE-21, so the plugin can't target lower. Users on older MAT stay on 1.6.x; the README says so.
  • The build's target platform moves from Eclipse 2022-12 to Eclipse 4.40, the release MAT 1.17.0 builds against.

Changes

Platform

  • MAT bundles come from the MAT 1.17.0 update site instead of an Eclipse simultaneous release, so the MAT API version matches what users run. The target lists only the MAT units the plugin uses. The full feature group would pull in BIRT and Rhino.
  • Java 21 everywhere: execution environment, compiler level, CI matrix, README.
  • Calcite and Guava versions are aligned between MatCalcitePlugin/pom.xml and the target definition. They had drifted apart (pom 1.41.0, target 1.36.0), because Renovate updates poms but not Tycho targets. So the plugin could compile against one Calcite and run against another. Guava is 33.7.2-jre in both: Renovate has since updated it in the pom on main, but not in the target.

Calcite 1.42 runtime

  • Avatica 1.29.0 instead of the 1.28.0 Calcite asks for. Avatica before 1.29.0 has CVE-2026-70410 (unsafe reflection in plugin instantiation, CVSS 8.8), and Calcite 1.42.0 is still the newest release. avatica-core is declared before calcite-core, so Maven compiles against the Jackson 2.22.2 that Avatica 1.29.0 brings and the target platform ships. The plugin itself isn't exposed: it opens its Calcite connection with fixed properties, so no class names reach Avatica from SQL or other input.
  • The target and Import-Package gain httpclient5/httpcore5 (new in Avatica 1.28) and joou. Without them the plugin fails at runtime with NoClassDefFoundError for org/apache/hc/core5/util/Timeout and org/joou/UInteger.
  • jakarta.transaction-api is excluded from commons-dbcp2. It has an unsatisfiable Import-Package (javax.enterprise.context), and it kept geronimo-jta_1.1_spec from supplying javax.transaction.

ORDER BY and joins on heap objects

Calcite 1.37+ compares Map-typed values with Functions.compareMaps(), which walks entrySet(). HeapReference implements Map only for the this['field'] syntax, and its entrySet() threw an exception. So every ORDER BY over a heap object failed with UnsupportedOperationException.

entrySet() now returns a single entry that orders like compareTo. Two details matter:

  • Both must give the same order. Calcite sorts merge-join inputs through entrySet() but merges them with compareTo. When the two orders differed, the merge join dropped matches: java.lang.Class left join instanceof.java.lang.ClassLoader matched 469 rows instead of 985.
  • Both order by address. That is constant time, while the old label order rebuilt each label (a String's text) on every comparison. ORDER BY this over 4M objects took about 2 minutes instead of 10 s. ORDER BY toString(this) still sorts by label.

SQL functions

  • New getHexAddress(x): the address as 0x…, the form MAT shows.
  • getDominator(x) failed with "Object -1 not found" for objects dominated by the virtual root; it now returns null.

Tests

  • testStackTraces now ignores the source file MAT adds to native frames. MAT 1.17 renders (Object.java(Native Method)) where older versions rendered (Native Method). The plugin passes that text through unchanged.
  • New tests:
    • ORDER BY this, in both directions;
    • a merge join over a strict subset (a self-join can't detect an order mismatch);
    • the class / class loader join, written three ways, all giving 985.

Testing

  • ./mvnw verify with JDK 21: 51 tests pass, 1 skipped (testConcurrentHashMap, skipped as on main).
  • Installed into MAT 1.17.0 on Linux (GTK/Wayland): queries, ORDER BY this and joins on a 1.5 GB dump with 24M objects.

Notes for reviewers

  • The build log prints a few [ERROR] [verify-osgi-pom] lines. They don't fail the build, and they predate this PR: main prints 10, this branch prints 3. The 3 left can't be fixed in the poms:

    • calcite-core on Maven Central has no OSGi manifest;
    • commons-dbcp2 requires javax.transaction.xa;partial=true, which nothing provides.

    They only concern Maven consumers that run the jars in a plain OSGi framework, not the p2 site. Removing the verify-osgi-pom execution would hide them; that's your call.

🤖 Generated with Claude Code

@miguelnieto
miguelnieto force-pushed the 01_mat-1.17-java21-calcite-1.42 branch 2 times, most recently from e0ab6e5 to 9c14603 Compare October 17, 2026 01:21
@miguelnieto
miguelnieto force-pushed the 01_mat-1.17-java21-calcite-1.42 branch from 9c14603 to d460a89 Compare November 7, 2026 17:12
@miguelnieto miguelnieto changed the title Upgrade to MAT 1.17.0, Java 21, Eclipse 4.40 and Calcite 1.42.0 (1/3) Upgrade to MAT 1.17.0, Java 21, Eclipse 4.40 and Calcite 1.42.0 (1/4) Nov 7, 2026
BREAKING: requires MAT 1.17.0+ and Java 21. org.eclipse.mat.api 1.17.0
declares Bundle-RequiredExecutionEnvironment: JavaSE-21, so the execution
environment cannot go lower. Users on older MAT must stay on 1.6.x.

Platform
- Target platform moved from Eclipse 2022-12 to Eclipse 4.40, matching the
  Eclipse release MAT 1.17.0 builds against.
- MAT bundles come from the MAT 1.17.0 update site rather than an Eclipse
  simultaneous release, so the MAT API version matches the MAT users run.
  Only the units this plugin needs are listed; the full
  org.eclipse.mat.feature.feature.group would drag in mat.chart and
  therefore BIRT and Rhino, which are unused.
- Java 21: BREE, executionEnvironment, compiler source/target, CI matrix,
  README requirements.

Calcite 1.36 -> 1.42.0
- Aligned Calcite/Guava versions between MatCalcitePlugin/pom.xml and
  MatCalciteTargetPlatform.target (Guava 33.7.2-jre in both, after
  Renovate updated the pom only). They had drifted apart (1.41.0 vs 1.36.0)
  because Renovate only updates poms, not Tycho target definitions.
- Avatica 1.29.0 instead of the 1.28.0 Calcite 1.42.0 asks for: Avatica
  before 1.29.0 has CVE-2026-70410 (unsafe reflection in plugin
  instantiation, CVSS 8.8). Declared before calcite-core so Maven compiles
  against the Jackson 2.22.2 it brings, which the target ships.
- Added httpclient5/httpcore5 (new Avatica 1.28 dependencies) and
  org.jooq:joou-java-6 to the target platform and to Import-Package. Without
  them: NoClassDefFoundError for org/apache/hc/core5/util/Timeout and
  org/joou/UInteger.
- Excluded jakarta.transaction:jakarta.transaction-api from commons-dbcp2:
  it has an unsatisfiable Import-Package (javax.enterprise.context) and
  blocked geronimo-jta_1.1_spec from supplying javax.transaction.

ORDER BY and joins on heap objects
- Calcite 1.37+ sorts Map-typed values with Functions.compareMaps(), which
  calls entrySet(); HeapReference is a Map only for this['field'] and threw
  from entrySet(), so every ORDER BY over a heap object failed. entrySet()
  now returns one entry that orders like compareTo.
- Calcite sorts merge-join inputs through entrySet() but merges them with
  compareTo, so both must give the same order, or matches are dropped (the
  class/class loader join counted 469 instead of 985). Both now order by
  address, which is also constant time: ordering by label rebuilt the label
  on every comparison (ORDER BY this on 4M objects: about 2 min vs 10 s).
  ORDER BY toString(this) gives label order.

SQL functions
- getHexAddress(x): the object address as 0x..., as MAT shows it.
- getDominator(x) returned an error for objects dominated by the virtual
  root; it now returns null.

Tests
- testStackTraces tolerates MAT's own stack frame formatting, which changed
  in MAT commit 0c72944e ("Bug 581644"): "(Native Method)" became
  "(Object.java(Native Method))".
- New: ORDER BY this in both directions, a merge join over a strict subset,
  the class/class loader join phrased three ways (985 each).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miguelnieto added a commit to miguelnieto/mat-calcite-plugin that referenced this pull request Nov 7, 2026
The update site bundled versions with published CVEs, which security
scanners flag:

- httpclient5 5.5 -> 5.6.5: CVE-2026-71290 (CVSS 9.1, async client skips
  the TLS hostname check), CVE-2026-64607
- jackson-core 2.22.2 -> 2.22.4: CVE-2026-89407, CVE-2026-89425 (7.5)
- commons-lang3 3.1 -> 3.21.0 (Calcite gets 3.1 through uzaygezen-core
  0.2): CVE-2025-48924
- json-smart, accessors-smart 2.6.0 -> 2.6.1: CVE-2026-113602

Guava's CVE-2026-102554 (NVD 8.2) is already fixed by 33.7.2-jre, which main
has since Renovate's update and vlsi#121 aligns in the target.

httpcore5 in the target moves to 5.4.4 to match httpclient5 5.6.5; MAT
provides httpcore5 at runtime. Pinned in both MatCalcitePlugin/pom.xml and
the target definition; the target takes the highest version of each
library, so the old versions no longer ship. Only jackson-core is
reachable from the plugin (Calcite's JSON functions).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@miguelnieto
miguelnieto force-pushed the 01_mat-1.17-java21-calcite-1.42 branch from d460a89 to 6475d2a Compare November 7, 2026 21:51
@vlsi

vlsi commented Nov 8, 2026

Copy link
Copy Markdown
Owner

@miguelnieto , thanks for pushing this forward. Will review soon.

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.

2 participants