GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix reporting of HTTP/3 in JdkTransporter by kwin · Pull Request #1967 · apache/maven-resolver

Conversation

@kwin

@kwin kwin commented Jul 16, 2026

Copy link
Copy Markdown
Member

Use enum name, as HttpVersion.HTTP_3 was only added in Java26+

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
  • In any other case, please file an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kwin
Fix reporting of HTTP/3 in JdkTransporter
6c62d02
Use enum name, as HttpVersion.HTTP_3 was only added in Java26+
cstamas
cstamas approved these changes Jul 16, 2026
View reviewed changes
gnodet
gnodet reviewed Jul 16, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Review of PR #1967 — Fix reporting of HTTP/3 in JdkTransporter

Clean, minimal fix for an oversight in the recently merged PR #1949. Looks correct.

Analysis:

  • ✅ Correctness: toHttpVersion() converts java.net.http.HttpClient.Version → resolver's HttpTransportProperty.HttpVersion. On Java 26+, HTTP_3 exists in HttpClient.Version but can't appear in a switch compiled against Java 11. The version.name() comparison is the standard approach for this cross-compilation scenario, and already used by resolveHttpVersion() elsewhere in this same file.

  • ✅ Root cause: PR #1949 added getHttpVersion, resolveHttpVersion, and getMaximumSupportedHttpVersion to handle HTTP/3 on the request side but didn't update toHttpVersion on the response side. If a JDK 26+ runtime negotiated HTTP/3, toHttpVersion would crash with IllegalArgumentException when reporting the protocol version in transport properties.

  • ✅ Backward compatibility: On Java 11-25, HttpClient.Version has no HTTP_3 value, so the name check simply never matches. Any truly unknown future value still throws IllegalArgumentException.

  • ✅ No test included: Understandable — testing requires a Java 26+ runtime where HttpClient.Version.HTTP_3 exists.

One very minor style observation: the else wrapping the throw is technically unnecessary since the if branch returns, but the code is clear as-is.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of @gnodet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kwin
kwin merged commit 654935f into master Jul 16, 2026
22 of 24 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kwin
kwin deleted the bugfix/fix-missing-enum-value-for-http3 branch July 16, 2026 15:57
@github-actions github-actions Bot assigned kwin Jul 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

@kwin Please assign appropriate label to PR according to the type of change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added this to the 2.0.21 milestone Jul 16, 2026
@gnodet gnodet mentioned this pull request Jul 16, 2026
Feat: new (limited) transport #1966
Merged
gnodet added a commit to gnodet/maven-resolver that referenced this pull request Jul 16, 2026
@gnodet
Update state: run 38 — re-reviewed apache#1966 commits 18-19, apache#…
d9ab9e4
…1967 merged
@cstamas cstamas added the bug Something isn't working label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnodet gnodet gnodet left review comments
@cstamas cstamas cstamas approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@kwin kwin

Labels

bug Something isn't working

Projects

None yet

Milestone

2.0.21

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@kwin @cstamas @gnodet
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.