Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Compilation error when importing @Builder of enclosed class #2296

Open
maherm opened this issue Nov 22, 2019 · 1 comment
Open

[BUG] Compilation error when importing @Builder of enclosed class #2296

maherm opened this issue Nov 22, 2019 · 1 comment

Comments

@maherm
Copy link

maherm commented Nov 22, 2019

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 on Outer to show the difference - the build fails regardless of the presence of @Builder on Outer.

To Reproduce

package test;

import test.Outer.Inner.InnerBuilder; //Remove this line to fix the build

import lombok.Builder;

@Builder
public class Outer {
	
	@Builder
	public static class Inner {
	}
}
$ 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.

@keith-furnell-igt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants