Skip to content

fix(java): support qualified generic type arguments#4455

Open
Baltsat wants to merge 1 commit into
highlightjs:mainfrom
Baltsat:codex/fix-3677-java-qualified-generics
Open

fix(java): support qualified generic type arguments#4455
Baltsat wants to merge 1 commit into
highlightjs:mainfrom
Baltsat:codex/fix-3677-java-qualified-generics

Conversation

@Baltsat

@Baltsat Baltsat commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Changes

The Java grammar accepted only one identifier inside a generic type argument, so a declaration such as List<java.lang.String> bar() was not recognized as a method.

This change:

  • permits dot-separated qualified names inside Java generic type arguments;
  • adds the exact List<java.lang.String> regression to the existing Java generics fixture; and
  • records the fix in CHANGES.md.

The behavior introduced by #4346 remains covered: all 11 Java markup fixtures pass, and top-level qualified declarations are unchanged.

Fixes #3677

Verification

  • npm run build
  • ONLY_LANGUAGES=java npm run test-markup — 11 passing
  • Java language ESLint — passed
  • npm run lint-languages — passed
  • npm run lint — passed with one existing ignored-vendor warning
  • npm test — 1,583 passing, 3 pending
  • git diff --check — passed
  • Red→green: the added fixture failed on unpatched main with 10 passing and 1 failing, then passed after the grammar change.
  • Revert proof: reverting only src/languages/java.js reproduced the focused failure; restoring it returned all 11 Java fixtures to green.

A fresh npm ci was unavailable because registry DNS failed in the isolated Linux environment. Verification reused the exact unchanged lockfile dependency tree plus the official lock-resolved Rollup Linux package; npm ls --all reported 782 nodes and no problems.

Checklist

  • Added markup tests
  • Updated CHANGES.md

Assistance disclosure

This patch and its verification were prepared with OpenAI Codex assistance. The final diff and test outputs were reviewed before publication.

User-Request: fix Java qualified generic highlighting | codex:019f8d3f
Copilot AI review requested due to automatic review settings July 26, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +19 B

View Changes
file base pr diff
es/core.min.js 8.24 KB 8.24 KB +1 B
es/highlight.min.js 8.24 KB 8.24 KB +1 B
es/languages/java.min.js 1.33 KB 1.34 KB +8 B
highlight.min.js 8.28 KB 8.28 KB +1 B
languages/java.min.js 1.34 KB 1.35 KB +8 B

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.

(java) Highlighting breaks on Generics with fully-qualified-name

2 participants