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] Nested enum causes "@Slf4j is not supported on non-static nested classes" in 1.18.21 and higher #3069

Closed
mricken opened this issue Dec 22, 2021 · 1 comment

Comments

@mricken
Copy link

mricken commented Dec 22, 2021

Describe the bug
When using @Slf4j on a nested enum, I get the following error:

/opt/teamcity/work/f09f56b10202e564/java-sdk/bmc-resourcesearch/src/main/java/com/oracle/bmc/resourcesearch/model/QueryableFieldDescription.java:[100,5] @Slf4j is not supported on non-static nested classes.

The code is here:
https://github.com/oracle/oci-java-sdk/blob/master/bmc-resourcesearch/src/main/java/com/oracle/bmc/resourcesearch/model/QueryableFieldDescription.java#L100

    @lombok.extern.slf4j.Slf4j
    public enum FieldType {

This works in 1.18.20 and lower, but breaks on 1.18.21 and 1.18.22.

To Reproduce
Declare a class with a nested enum in it. Annotate the nested enum with @Slf4j.

To reproduce in our codebase, update this property to 1.18.21 or higher.
https://github.com/oracle/oci-java-sdk/blob/master/pom.xml#L42

Expected behavior
Since an enum is always static, this should compile, just like it did in 1.18.20 and lower.

Version info (please complete the following information):

  • Lombok 1.18.21 or higher.
  • javac 1.8.0_121

Additional context
None.

@Rawi01
Copy link
Collaborator

Rawi01 commented Dec 23, 2021

Thanks for the report, this is a duplicate of #2990

@Rawi01 Rawi01 closed this as completed Dec 23, 2021
varkart added a commit to varkart/lombok that referenced this issue Feb 17, 2022
varkart added a commit to varkart/lombok that referenced this issue Feb 17, 2022
varkart added a commit to varkart/lombok that referenced this issue Feb 17, 2022
varkart added a commit to varkart/lombok that referenced this issue Feb 17, 2022
varkart added a commit to varkart/lombok that referenced this issue Feb 17, 2022
varkart added a commit to varkart/lombok that referenced this issue Feb 17, 2022
varkart added a commit to varkart/lombok that referenced this issue Feb 17, 2022
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