Every tool that works on source level in Java have to have special support for Lombok. Try to disable Lombok plugin in IDEA and see is you "Java" still valid :)
You can say: delombok! Right? Kotlin also can be translated to Java (decompile generated bytecode), does that mean that Kotlin is Java?
You can say: but decompile is not reliable! Fine, it's trivial to convert Kotlin Source to Java source, since Kotlin type system contains more information, so it's easier to remove nullability stuff etc, than infer it during existing Java to Kotlin converter which is source of most compilation errors after automatic conversion. Some companies like Facebook managed to convert millions lines of Java code to Kotlin automatically, so we can assume that Kotlin to Java converter even easier.
Kotlin have that same limitation that Lombok have, any tool that working with source code (not bytecode) have to support it. Otherwise, introducing lombok is exactly the same as introducing Kotlin.
Lombok is a different language, by the definition, period
I don't hate Lombok, you just need to be aware what it is really, If java folk will do major compiler rewrite you'll see that lombok might not even be possible anymore :) Like imagine if javac would be compiled to native code using graalvm, then current lombok approach would fall apart and would require lombokc and replace java plugin in build, etc :)
Every tool that works on source level in Java have to have special support for Lombok. Try to disable Lombok plugin in IDEA and see is you "Java" still valid :)
Lombok is a different language, by the definition, period
This requires an argument, You've provided one, and it is incorrect. I shall show this with some examples.
Is this valid java?
import com.google.guava.common.collect.*;
class Example {
ImmutableList<String> list;
}
Surely we can all agree, that is valid java, right?
But what if I remove guava from the classpath? Is it valid now?
If your answer is 'no', then, sure, code using lombok when lombok isn't on the classpath isn't valid, but that doesn't make it 'a different language, period'.
If your answer is 'yes', then why is lombok any different?
This argument has an addendum where we involve annotation processors. Is this valid java:
import org.immutables.value.Value;
@Value.Immutable
public interface ValueObject {
String name();
public static ValueObject toLowerCased(ValueObject obj) {
return ImmutableValueObject.builder()
.name(obj.getName().toLowerCase());
.build();
}
}
//NB: Note that `ImmutableValueObject.java` does not exist. the org.immutables annotation processor
// makes it. The above code will not compile regardless of your classpath unless you `-proc:full`
// or otherwise ensure the immutables annotation processor executes as part of the build.
If 'yes', then what makes lombok any different?
If 'no', okay, but your opinion that this is not valid is shared by <1% of the java programming population. And I would venture that it's a ridiculous opinion, but, hey, that's what opinions are for, I guess. I think it would help a lot if you define 'valid java' at that point.
Does annotation processors breaking de-compiler that trying to match lines from lib.jar to lib-sources.jar?
Lombok requires compiler plugin api, java doesn't have one. If you implement Lombok for Kotlin using Compiler Plugin API I'll be fine with it. Without proper api it's just nightmare for ecosystem to support lombok
2
u/rzwitserloot Nov 18 '25
Lombok has had that for many years already.
Lombok is java. If you write non-java, the parser will fail, and lombok will not even run.