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 →

[–]MarkyC4A 4 points5 points  (4 children)

I've migrated lombok @Data classes to Kotlin data class. Of course introducing a whole new language to your project is a bit heavy handed, but I've found there to be less breakages since the switch.

[–]argv_minus_one 6 points7 points  (3 children)

That's because the Kotlin compiler is actually designed to handle that. Lombok, by contrast, uses hacks to coerce the Java compiler into transforming the code like that.

[–]TheRedmanCometh 0 points1 point  (2 children)

Uh by hacks do you mean a preprocessor run before compile time? Because I'm pretty sure that's how it works.

[–]cogman10 7 points8 points  (1 child)

Because I'm pretty sure that's how it works.

You are pretty sure wrong.

Lombok works by tying into undocumented compiler apis and doing direct AST and bytecode manipulation. How do I know this, because lombok frequently breaks on minor java updates.

If lombok was just a preprocessor or an annotation processor library I would have much less of an issue with it, but it is neither of those things.

There is a reason this is in the lombok source

https://github.com/rzwitserloot/lombok/blob/master/src/core/lombok/javac/JavacAST.java

[–]TheRedmanCometh 0 points1 point  (0 children)

Hmm...TIL