You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is an enclosed public static class that is annotated with @Builder, and the generated builder class is imported in the enclosing class, javac throws a compilation error. If the import statement is removed, compilation works again.
Please note, that the compile error only fails in line 10 - the first usage of @Builder in line 7 works. I only included the @Builder on Outer to show the difference - the build fails regardless of the presence of @Builder on Outer.
To Reproduce
packagetest;
importtest.Outer.Inner.InnerBuilder; //Remove this line to fix the buildimportlombok.Builder;
@BuilderpublicclassOuter {
@BuilderpublicstaticclassInner {
}
}
$ javac -cp lombok.jar Outer.java
Outer.java:10: error: cannot find symbol
@Builder
^
symbol: class Builder
location: class Outer
1 error
Expected behavior
No compilation error
Version info (please complete the following information):
test with Lombok versions 1.16.18 and 1.18.8
tested in javac 1.8.0_201
compiling in Eclipse (Neon.3 4.6.3) works flawlessly
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
The same issue (and work-around) occurs with other static inner class annotations too, e.g. @RequiredArgsConstructor @Getter - tested with javac 1.8.0_261 and Lombok versions 1.6.14, 1.6.22, 1.8.10, 1.18.32.
Describe the bug
If there is an enclosed
public static class
that is annotated with@Builder
, and the generated builder class is imported in the enclosing class, javac throws a compilation error. If the import statement is removed, compilation works again.Please note, that the compile error only fails in line 10 - the first usage of
@Builder
in line 7 works. I only included the@Builder
onOuter
to show the difference - the build fails regardless of the presence of@Builder
onOuter
.To Reproduce
Expected behavior
No compilation error
Version info (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: