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

Add check for unused fields #53

Closed
GoogleCodeExporter opened this issue Mar 29, 2015 · 3 comments
Closed

Add check for unused fields #53

GoogleCodeExporter opened this issue Mar 29, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

It would be awesome if EqualsVerifier could check for non-transient fields that 
are not used in the definition of "equals".  Frequently I use Eclipse to 
autogenerate equals/hashCode, but I might forget to re-generate after adding a 
new field.  

A suggested implementation and unit tests:

https://gist.github.com/1640709

https://gist.github.com/1640722

Original issue reported on code.google.com by [email protected] on 19 Jan 2012 at 10:50

@GoogleCodeExporter
Copy link
Author

I will probably add this in the next version.

Original comment by [email protected] on 20 Jan 2012 at 8:10

  • Changed state: Accepted
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I've added this feature to version 1.1, which is available now!

I did deviate from your proposed solution a little bit though: I decided to 
name the method "allFieldsShouldBeUsed()" instead of "checkUnusedFields()", 
because I thing that name is a bit more expressive.

Original comment by [email protected] on 11 Feb 2012 at 11:53

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

That's great, thanks!

Original comment by [email protected] on 13 Feb 2012 at 12:50

  • Added labels: ****
  • Removed labels: ****

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

No branches or pull requests

1 participant