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

Calculate hashCode with arguments that are consistent with equals #1097

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

AniketNS
Copy link
Contributor

@AniketNS AniketNS commented Jan 15, 2024

Calculate hashCode with arguments that are consistent with equals

I used String.format() function for better consistency and it is more understandable.

Instead of relying on the hashCode of the superclass I've used the Object.hash() method to generate a hashcode. I think it is easier to understand and more explicit.

Checklist

  • I have read the CONTRIBUTING doc
  • I have referenced the Jira issue related to my changes in one or more commit messages
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • I have interactively tested my changes

Types of changes

What types of changes does your code introduce?

  • Infrastructure change (non-breaking change which updates dependencies or improves infrastructure)

@AniketNS AniketNS requested a review from a team as a code owner January 15, 2024 14:05
@MarkEWaite
Copy link
Contributor

MarkEWaite commented Jan 15, 2024

@AniketNS thanks for the pull request. Please do the following:

  • Restore the pull request template. The template is placed in this repository so that every pull request submitter sees the expectations of the maintainers and clearly states which items they were able to complete and which they were not able to complete. Pull request templates are widely used in the Jenkins project so that contributors see the expectations of maintainers while creating the pull request
  • Describe the changes more clearly in the pull request summary. A Jenkins user that reads the changelog for the git client plugin will not understand the change based on the description, "Made changes in Branch.java". Why were those changes made and how do they improve things for the user or for the plugin maintainers or for someone else?

@AniketNS
Copy link
Contributor Author

Hello @MarkEWaite, could you please provide some info on the current status of this PR? I'm wondering if there are any specific improvements or additional changes I should make. I appreciate your feedback.

@MarkEWaite
Copy link
Contributor

MarkEWaite commented Jan 17, 2024

Hello @MarkEWaite, could you please provide some info on the current status of this PR? I'm wondering if there are any specific improvements or additional changes I should make. I appreciate your feedback.

Please take the actions that I listed in the checklist of the earlier comment. those actions include:

  • Restore the pull request template. The template is placed in this repository so that every pull request submitter sees the expectations of the maintainers and clearly states which items they were able to complete and which they were not able to complete. Pull request templates are widely used in the Jenkins project so that contributors see the expectations of maintainers while creating the pull request
  • Describe the changes more clearly in the pull request summary. A Jenkins user that reads the changelog for the git client plugin will not understand the change based on the description, "Made changes in Branch.java". Why were those changes made and how do they improve things for the user or for the plugin maintainers or for someone else?

An example pull request that uses the pull request template is:

@AniketNS AniketNS changed the title Made changes in Branch.java Changing hashCode() with Object.hash() to reduce dependency Jan 18, 2024
@AniketNS
Copy link
Contributor Author

AniketNS commented Jan 18, 2024

Hey @MarkEWaite, I've changed the Pull request name as you suggested but can you please tell me now how I can restore the pull request template?

Even if I copy the content from this pull req template then how can I add that checklist? Or should I close this pull request and open a new one with the default pull request template and with a clear pull request description as you told me before?

@MarkEWaite MarkEWaite added the chore Reduces maintenance effort by changes not directly visible to users label Jan 18, 2024
@MarkEWaite
Copy link
Contributor

Even if I copy the content from this pull req template then how can I add that checklist? Or should I close this pull request and open a new one with the default pull request template and with a clear pull request description as you told me before?

One way is to copy the source text of the pull request template and paste it into the description of this pull request. The source text is also on your local copy of the repository if you prefer to copy it from a local text file.

@AniketNS
Copy link
Contributor Author

Thank you so much @MarkEWaite. I've made the changes as requested. Please check and let me know if I've missed anything.

@MarkEWaite MarkEWaite changed the title Changing hashCode() with Object.hash() to reduce dependency Use similar Jan 19, 2024
@MarkEWaite MarkEWaite changed the title Use similar Calculate hashCode with arguments that are consistent with equals Jan 19, 2024
@MarkEWaite MarkEWaite self-requested a review January 19, 2024 11:57
@MarkEWaite MarkEWaite merged commit 829a0fb into jenkinsci:master Jan 19, 2024
15 checks passed
@AniketNS AniketNS deleted the git-client branch January 19, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Reduces maintenance effort by changes not directly visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants