Skip to content

[java] remove deprecated methods from the HttpClient interface - #17993

Merged
diemol merged 5 commits into
trunkfrom
http-client-deprecation
Sep 11, 2026
Merged

diemol merged 5 commits into
trunkfrom
http-client-deprecation

Conversation

@joerg1985

@joerg1985 joerg1985 commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

🔗 Related Issues

Fixes #16673, there is no need for theses methods, as the JdkHttpClient does expose the client.
The basic idea behind a interface is to abstract things, so we should follow this idea.

💥 What does this PR do?

Remove the AI slop from the interface.

🔧 Implementation Notes

Only deletions, nothing added

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s):
    • What was generated:
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

🔄 Types of changes

  • Cleanup

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@selenium-ci selenium-ci added B-grid Everything grid and server related C-java Java Bindings labels Sep 7, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Native request callers break on upgrade 📘 Rule violation ≡ Correctness
Description
HttpClient removes sendAsyncNative and sendNative after their deprecation named the
nonexistent JdkHttpClient#httpClient() rather than the actual client() accessor. Existing source
no longer compiles and existing binaries fail when invoking either method, while the prior warning
gave callers no valid named migration target.
Code

java/src/org/openqa/selenium/remote/http/HttpClient.java[L49-52]

-   * @deprecated use JdkHttpClient#httpClient() instead.
-   */
-  @Deprecated(forRemoval = true)
-  <T> CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
Evidence
Compliance rule 1 permits public removal only after deprecation with guidance toward an alternative.
The removed declarations direct users to JdkHttpClient#httpClient(), but the current class exposes
the native client through client() at lines 152-155, so the required migration guidance was
invalid before removal.

AGENTS.md: Preserve Public API and ABI Compatibility and Follow Deprecation Policy
java/src/org/openqa/selenium/remote/http/jdk/JdkHttpClient.java[152-155]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The public native request methods are being removed without a valid prior migration message because their deprecation refers to a nonexistent accessor.

## Fix Focus Areas
- java/src/org/openqa/selenium/remote/http/HttpClient.java[42-69]
- java/src/org/openqa/selenium/remote/http/jdk/JdkHttpClient.java[575-586]

## Recommended Fix
Restore both methods and their implementations for another deprecation cycle, correct the deprecation guidance to reference `JdkHttpClient#client()`, and retain focused compatibility coverage until removal is permitted.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: This is a localized API cleanup, but removing public interface methods across production implementations and tests carries real compatibility and compilation risk, warranting a complete single-pass review.

Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread java/src/org/openqa/selenium/remote/http/HttpClient.java
@diemol
diemol merged commit c959fe9 into trunk Sep 11, 2026
50 checks passed
@diemol
diemol deleted the http-client-deprecation branch September 11, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-grid Everything grid and server related C-java Java Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Breaking change in #16412 to the HttpClient interface

3 participants