Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java] Refactored the UsernameAndPassword class to a record #15360

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

manuelsblanco
Copy link
Contributor

@manuelsblanco manuelsblanco commented Mar 2, 2025

User description

Refactored the UsernameAndPassword class to a record, simplifying the implementation and ensuring immutability. Removed the redundant of method and Supplier<Credentials> usage, as they are no longer needed with the record structure.

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement


Description

  • Refactored UsernameAndPassword class into a Java record.

  • Simplified implementation by removing redundant methods.

  • Ensured immutability and streamlined the code structure.


Changes walkthrough 📝

Relevant files
Enhancement
UsernameAndPassword.java
Refactored `UsernameAndPassword` class to a `record`         

java/src/org/openqa/selenium/UsernameAndPassword.java

  • Converted UsernameAndPassword class to a Java record.
  • Removed the of method and Supplier usage.
  • Eliminated redundant getter methods for username and password.
  • Simplified constructor with Require.nonNull checks.
  • +1/-22   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Refactored the `UsernameAndPassword` class to a `record`, simplifying the implementation and ensuring immutability. Removed the redundant `of` method and `Supplier<Credentials>` usage, as they are no longer needed with the record structure.
    Copy link
    Contributor

    qodo-merge-pro bot commented Mar 2, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    Copy link
    Contributor

    qodo-merge-pro bot commented Mar 2, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @VietND96 VietND96 requested a review from pujagani March 4, 2025 02:55
    @VietND96 VietND96 changed the title Java record [java] Refactored the UsernameAndPassword class to a record Mar 4, 2025
    @VietND96
    Copy link
    Member

    VietND96 commented Mar 4, 2025

    @manuelsblanco Can you resolve the conflict?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants