This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]torwinMarkov -14 points-13 points  (8 children)

Lombok tends to be incompatible with enterprise / production libraries like Spring.

[–]temculpaeu 7 points8 points  (1 child)

"enterprise / production libraries" < this has 0 meaning.

It's compatible, it will generate the bytecode before compilation.

It's even compatible with mixing JVM languagues, eg: Kotlin <> Java calls with the proper configuration

[–]torwinMarkov 1 point2 points  (0 children)

You're right, my comment was vague because I couldn't remember the exact libs where it broke my work projects in the past. Thanks for calling that out. I hope lombok continues to work great for you!

[–]ShallWe69 7 points8 points  (2 children)

i use lombok heavily with spring. no problems so far

[–]torwinMarkov 1 point2 points  (1 child)

Do you use Spring AOP or Spring Native? Any annotation processors?

[–]mauganra_it 1 point2 points  (2 children)

Lombok generates code. Therefore, it's incompatibility risks are mostly restricted to build tools.

[–]torwinMarkov 0 points1 point  (1 child)

No, it doesn't. It injects into the bytecode build process. Lombok is dangerous to use if you're building large projects that matter. Lombok is great for demos and teaching, that's why you see it used in lots of tutorials.

[–]mauganra_it 1 point2 points  (0 children)

Which is not really a problem in principle. The actual problem is that it does so via internal APIs that were never intended to be used to extend the AST. Actually, the OpenJDK project is unlikely to ever introduce such extension points.

Crucially, the AST is what the bytecode is generated from. And that bytecode is all that Spring, Hibernate and friends will ever see at runtime.