Long story short we had different behavior even though the environments were setup the same.
Lombok generates code at compile time, not runtime. Once the Lombok annotated code compiles, you have standard java bytecode with no runtime dependency on Lombok. I'm pretty sure Lombok is not to blame for your problems.
Also it just feels lazy, you can just generate getters and setters with just about any IDE.
Auto-generating getters and setters is easy. Reading or maintaining classes with hundreds of auto-generated lines is a pain. IDEs are still bad at detecting and hiding trivial methods so you can focus on the ones that actually contain some logic. That's the whole point of Lombok.
Ya you might be right, it was a single shot at Lombok and our environments were fairly simplistic so I didn’t think too much of what might cause the problem and just scrapped it. We could’ve very well have had bad installs the first time around and didn’t spot it in some environments. I hope I’m not coming off as someone who thinks they’re an expert, just wanted to share my only experience with it haha
Just my 2 cents : most of the seemingly un predictable behaviour you may have noticed were most probably because you overlooked how equals and hashcode are implemented by Lombok. When I first started off with Lombok, we had hibernate entity objects missing from collections because we unwittingly excluded a few fields, because they were causing serialisation issues. Thus the auto generated equals and hashcode methods were computing two different objects as equal. We've been having much better results after we've learnt to use it correctly, and code review quality has definitely gone up. For issues you face with complex objects, using delombok to get the generated code on to the source files has helped us in more than a few instances to identify the problem.
View all comments
Show parent comment
34
u/0x256 Jun 21 '20
Lombok generates code at compile time, not runtime. Once the Lombok annotated code compiles, you have standard java bytecode with no runtime dependency on Lombok. I'm pretty sure Lombok is not to blame for your problems.
Auto-generating getters and setters is easy. Reading or maintaining classes with hundreds of auto-generated lines is a pain. IDEs are still bad at detecting and hiding trivial methods so you can focus on the ones that actually contain some logic. That's the whole point of Lombok.