1

When I open and decompile a class from spring-data-mongo@2.1.3 in IntelliJ, I see import lombok.NonNull, but I do not see any lombok transient dependency in my project. Now, this makes sense because lombok is set as optional dependency in spring-data-parent. As I understand, lombok is not a runtime dependency, but why do I see it there then? It is IntelliJ magic supporting Lombok on decompiling the class?

lqbweb
  • 1,684
  • 3
  • 19
  • 33

2 Answers2

0

Import statements in Java are just syntactic sugar. They help writing code, because you do not have to write the fully-qualified classnames all the time. But they do not make it into the bytecode. You can see them as a kind of compiler directive.

Thus, if you see import statements in your decompiled code, but there is no actual usage of that import in the code, it is very likely that this is caused by the decompiler.

Jan Rieke
  • 7,027
  • 2
  • 20
  • 30
0

This is because spring-data-mongo use the lombok, but they didn't upload the delombok source zip.

Carl
  • 26
  • 3