-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adding support to AutoValue.Id. #212
base: main
Are you sure you want to change the base?
Conversation
…en an autoValue does not want to use all its fields in the equals() and hashcode() method.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
I used another email account to submit this pull request. How can I associate this other account to my CLA account ? |
CLAs look good, thanks! |
@@ -494,7 +504,7 @@ private void fixReservedIdentifiers(Map<ExecutableElement, String> methodToIdent | |||
} | |||
|
|||
private String disambiguate(String name, Collection<String> existingNames) { | |||
for (int i = 0; ; i++) { |
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.
This change has nothing to do with the commit. But I fixed it because checkstyle was complaining about it.
We explicitly say in the documentation that we don't support fields that don't participate in equals and hashCode. If we did want to do so, this would certainly be one way of going about it. In that case I think we would also want the ability to say, independently, whether a field appears in toString. |
I've read the documentation and I know that auto-value does not support it. Let me know what do you guys think. On Tue, Mar 31, 2015 at 2:03 PM, Éamonn McManus notifications@github.com
|
This new annotation should be used when an autoValue does not want to use all its fields in the equals() and hashcode() method. So, the autovalue bean can simple annotate all fields that should be used to unique identify that bean.
Let me know if you like it, so I can add more JUnit tests to cover edge cases.