← All tasks
javajavaparser/javaparser #5111Not a task: already works

Build with `<release>` instead of `<source>/<target>` so the CI matrix can cover JDK 19+

envgap__javaparser__javaparser-5111

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
990d1aae57cab69dc350a49d825635ae305ad2d2
Manifest
pom.xml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

javaparser/javaparser #5111 · read the original issue
The CI matrix stops at JDK 18 (`.github/workflows/maven_tests.yml`, `jdk: [8..18]`),
so nothing guards the JDK 19–21 behaviour that #5109 is about. The reason usually
given is that `javaparser-core` does not compile on JDK 21:

    NodeList.java:[189,24] addFirst(N) in NodeList cannot implement addFirst(E) in java.util.List
    NodeList.java:[197,24] addLast(N) ...
    NodeList.java:[233,24] getFirst() ... return type java.util.Optional<N> is not compatible with N
    NodeList.java:[243,24] getLast() ...

This is a build-configuration issue, not a source issue. The root pom sets

    <source>${java.version}</source>
    <target>${java.version}</target>

with `java.version = 1.8`. With `-source/-target`, javac still compiles against the
*host* JDK's `java.util.List`, which since JDK 21 declares `addFirst`/`addLast`/
`getFirst`/`getLast` (JEP 431, SequencedCollection). It also emits the
"bootstrap class path not set in conjunction with -source 8" warning, meaning the
JDK 8 target is not actually verified today.

Switching to `<release>8</release>` makes javac use the JDK 8 API signatures (ct.sym),
which both removes the clash and makes the Java 8 baseline real.


Proposed:

1. Replace `<source>/<target>` with `<release>` in the root pom
   (`maven-compiler-plugin` config, and the javadoc/plugin block using `${java.version}`).
2. Validate the full reactor on the existing matrix — `javaparser-core-testing` and
   `javaparser-core-testing-bdd` were not covered by the run above and may surface
   non-JDK-8 API usage that `-source 8` was silently allowing.
3. Add 19, 20, 21 to `jdk:` in `maven_tests.yml`, then LTS versions as they land.

Without this, the JDK 21 fixes in #5110 are unverified by CI and will regress.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]