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] Annotation @UtilityClass don't working when using static import #3767

Open
KovalevNikolay opened this issue Oct 24, 2024 · 1 comment

Comments

@KovalevNikolay
Copy link

Annotation @UtilityClass don't working when using static import
Screenshots
default
with using static import

To Reproduce
Let's create a test class with a single VALUE field, specifying public final access modifiers for it. We will put the @UtilityClass annotation above the class, which will add the final access modifier to the class, the static access modifier to the field, and also create a private constructor.

Let's create a class with the Main method, where we will output the VALUE field from the previously created class to the console. When accessing it via ClassName.VALUE, the program runs without errors. Next, we will execute maven clean and instead of accessing the field by the name of the class, we will use static import.
We launch the application and get an error:

java: cannot find symbol
symbol: static VALUE
location: class test.util.TestUtil

Version info (please complete the following information):

  • Lombok version: 1.18.34
  • Platform: javac 22.0.1
@janrieke
Copy link
Contributor

The documentation mentions this. Use a star import instead.

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