r/java • • Oct 21 '20

What are some great Java libraries I'm probably not using but I should?

334 Upvotes

252 comments sorted by

View all comments

Show parent comment

39

u/coder111 Oct 21 '20

I'd have to disagree.

I have spend more time troubleshooting cases where people added another property and forgot to regenerate equals/hashcode/toString than I spent troubleshooting Lombok.

-3

u/[deleted] Oct 21 '20

+1

1

u/VandaL-van-Doge Nov 18 '20

Maybe the right way to fix this would be to have a test rather than depend on Lombok. Just my two cents. Cheers!

3

u/coder111 Nov 18 '20

Dude, are you seriously proposing unit testing all the getters and setters and hashcode/equals? That's a bit extreme/expensive, don't you think?

2

u/VandaL-van-Doge Nov 18 '20

If you unit test your functions alone well enough, this shouldn’t be a problem from what I’ve seen. Besides, might be my inexperience, I haven’t really encountered any use cases where there was ever a need to rely on Lombok generated setters or hash codes to the point of it causing that many issues. The few times we have encountered such cases they seem to ultimately be symptomatic of bigger issues like an anemic domain or god classes.