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

@UtilicyClass performs differently in java8 and java11 (and above) #1037

Open
taes-k opened this issue May 1, 2021 · 1 comment
Open

@UtilicyClass performs differently in java8 and java11 (and above) #1037

taes-k opened this issue May 1, 2021 · 1 comment

Comments

@taes-k
Copy link

taes-k commented May 1, 2021

Short description

@UtilicyClass makes methods and inner class modifiers to static.
but Inner class modification function does not work properly in java 11 and above.

example case)

@UtilityClass
public class UtilClazz
{
  public static void method()
  {
     InnerClazz obj = new InnerClazz(); 
  }
  private class InnerClazz
  {
  }
}

it's works well in Java8 but when we use project sdk as java11 it occurs error

non-static variable this cannot be referenced from a static context

But when I delombok or open in the class file, it modified well as a static class.
so I think it's not a lombobk dependency's bug but plugin's bug

Expected behavior

it could be works well in java11 likes java8

Version information

  • IDEA Version: 2020.3.2
  • JDK Version: 1.8.0_282 / 11.0.11
  • OS Type & Version: mac / catalina
  • Lombok Plugin Version: 203.7148.57
  • **Lombok Dependency Version:**1.18.20
@liblit
Copy link

liblit commented Jan 26, 2022

See also projectlombok/lombok#3097, which finds the same problem using direct javac compilation: no IDE, no plugin, just the Java compiler.

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