[java] Deprecate methods to avoid internal BiDi connection surfacing on driver#17751
Conversation
PR Summary by QodoDeprecate HasBiDi accessors to keep BiDi internals off Java drivers
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used✅ Tickets:
🎫 Instance ChroneDriver Error: ConnectFailure 🎫 2.48 doesn't trigger javascript in link's href on click()✅ Compliance rules (platform):
18 rules 1. getBiDi() Javadoc missing @return
|
| /** | ||
| * @deprecated BiDi is an internal implementation detail. Direct access to the BiDi object from | ||
| * drivers will be removed in a future release. | ||
| */ | ||
| @Deprecated(since = "4.46", forRemoval = true) | ||
| default BiDi getBiDi() { | ||
| return maybeGetBiDi() | ||
| .orElseThrow(() -> new BiDiException("Unable to create a BiDi connection")); | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated BiDi is an internal implementation detail. Direct access to the BiDi object from | ||
| * drivers will be removed in a future release. | ||
| */ | ||
| @Deprecated(since = "4.46", forRemoval = true) | ||
| Optional<BiDi> maybeGetBiDi(); |
There was a problem hiding this comment.
1. getbidi() javadoc missing @return 📘 Rule violation ✧ Quality
The new Javadoc for public methods getBiDi() and maybeGetBiDi() contains only an @deprecated tag and omits required documentation, including a free-text description and @return tags. This reduces API documentation quality and violates the requirement for complete Javadoc on public methods.
Agent Prompt
## Issue description
Public methods `getBiDi()` and `maybeGetBiDi()` have new Javadoc that only includes an `@deprecated` tag, but is missing (a) at least one free-text sentence describing the method and (b) an `@return` tag.
## Issue Context
These methods are part of a `public interface` and therefore need complete Javadoc per the checklist.
## Fix Focus Areas
- java/src/org/openqa/selenium/bidi/HasBiDi.java[25-40]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| /** | ||
| * @deprecated BiDi is an internal implementation detail. Direct access to the BiDi object from | ||
| * drivers will be removed in a future release. | ||
| */ | ||
| @Deprecated(since = "4.46", forRemoval = true) | ||
| default BiDi getBiDi() { | ||
| return maybeGetBiDi() | ||
| .orElseThrow(() -> new BiDiException("Unable to create a BiDi connection")); | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated BiDi is an internal implementation detail. Direct access to the BiDi object from | ||
| * drivers will be removed in a future release. | ||
| */ | ||
| @Deprecated(since = "4.46", forRemoval = true) |
There was a problem hiding this comment.
2. Deprecated methods lack alternative guidance 📘 Rule violation ☼ Reliability
The new @deprecated Javadoc text explains removal intent but does not name a recommended alternative or explicitly state there is no replacement. This violates the requirement that deprecated public APIs include guidance before removal.
Agent Prompt
## Issue description
The `@deprecated` Javadoc for `getBiDi()` and `maybeGetBiDi()` does not provide guidance on what callers should use instead, nor does it explicitly state "no replacement".
## Issue Context
The checklist requires deprecated public APIs to include a human-readable message that names or links to the recommended alternative, or explicitly states there is no replacement.
## Fix Focus Areas
- java/src/org/openqa/selenium/bidi/HasBiDi.java[25-29]
- java/src/org/openqa/selenium/bidi/HasBiDi.java[35-39]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
🔗 Related Issues
To align the Java BiDi code with the ADR #17670
💥 What does this PR do?
It deprecates methods that allow get BiDi internals on driver object
🔧 Implementation Notes
🤖 AI assistance
💡 Additional Considerations
🔄 Types of changes