question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stuck with 2.4.0 and JDK 11 due to Lombok warnings

See original GitHub issue

Hi everyone,

I’m facing an issue with ErrorProne currently that is making it harder to upgrade from JDK 11 to 17.

In short, ErrorProne 2.4.0 with JDK 11 works well for me, but I cannot use 2.4.0 with JDK 17, and when I upgrade to anything newer than 2.4.0 I get crazy amounts of warnings for Lombok annotations.

Here is a minimal reproducer - just a single class with a single “@lombok.Value” annotation (use JDK 11 with this):

pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.mihalyr.test</groupId>
  <artifactId>errorprone-test</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>errorprone-test</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>11</maven.compiler.release>
    <errorprone.version>2.12.1</errorprone.version>
    <lombok.version>1.18.22</lombok.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <forceJavacCompilerUse>true</forceJavacCompilerUse>
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
          <compilerArgs>
            <arg>-XDcompilePolicy=simple</arg>
            <arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode</arg>
          </compilerArgs>
          <annotationProcessorPaths>
            <path>
              <groupId>com.google.errorprone</groupId>
              <artifactId>error_prone_core</artifactId>
              <version>${errorprone.version}</version>
            </path>
            <path>
              <groupId>org.projectlombok</groupId>
              <artifactId>lombok</artifactId>
              <version>${lombok.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

src/main/java/errorprone/App.java
package errorprone;

@lombok.Value
public class App {
    String greeting;

    public void run() {
        System.out.println(greeting);
    }

    public static void main(String[] args) {
        new App("hello!").run();
    }
}

lombok.config
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true

Case 1: ErrorProne 2.4.0 and JDK 11

Everything is working as expected.

Maven output
➜  errorprone-2.5 mvn clean compile --show-version -Derrorprone.version=2.4.0
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /home/mihalyr/.sdkman/candidates/maven/current
Java version: 11.0.14, vendor: Eclipse Adoptium, runtime: /home/mihalyr/.sdkman/candidates/java/11.0.14-tem
Default locale: en_IE, platform encoding: UTF-8
OS name: "linux", version: "5.16.18-100.fc34.x86_64", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.mihalyr.test:errorprone-2.5 >-------------------
[INFO] Building errorprone-2.5 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ errorprone-2.5 ---
[INFO] Deleting /home/mihalyr/workspace/errorprone-2.5/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ errorprone-2.5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mihalyr/workspace/errorprone-2.5/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ errorprone-2.5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/mihalyr/workspace/errorprone-2.5/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.510 s
[INFO] Finished at: 2022-04-10T20:54:04+02:00
[INFO] ------------------------------------------------------------------------

Case 2: ErrorProne 2.5.0 and JDK 11

This fails with the below error:

[ERROR]      java.lang.NoSuchMethodError: 'com.sun.tools.javac.util.List com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements()'

Case 3: ErrorProne 2.5.1 and JDK 11

The Lombok warnings start here.

Maven output
➜  errorprone-2.5 mvn clean compile --show-version -Derrorprone.version=2.5.1
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /home/mihalyr/.sdkman/candidates/maven/current
Java version: 11.0.14, vendor: Eclipse Adoptium, runtime: /home/mihalyr/.sdkman/candidates/java/11.0.14-tem
Default locale: en_IE, platform encoding: UTF-8
OS name: "linux", version: "5.16.18-100.fc34.x86_64", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.mihalyr.test:errorprone-2.5 >-------------------
[INFO] Building errorprone-2.5 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ errorprone-2.5 ---
[INFO] Deleting /home/mihalyr/workspace/errorprone-2.5/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ errorprone-2.5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mihalyr/workspace/errorprone-2.5/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ errorprone-2.5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/mihalyr/workspace/errorprone-2.5/target/classes
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[5,11] [SameNameButDifferent] The name `greeting;` refers to [java.lang.SuppressWarnings, java.lang.String] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[5,11] [SameNameButDifferent] The name `greeting;` refers to [java.lang.SuppressWarnings, java.lang.String] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.525 s
[INFO] Finished at: 2022-04-10T20:54:52+02:00
[INFO] ------------------------------------------------------------------------

Case 4: ErrorProne 2.4.0 and JDK 17

This does not work, fails with the following:

[ERROR]      java.lang.NoSuchMethodError: 'java.lang.Iterable com.sun.tools.javac.code.Scope$WriteableScope.getSymbolsByName(com.sun.tools.javac.util.Name, com.sun.tools.javac.util.Filter)'

Case 5: ErrorProne 2.12.1 (or any >= 2.5.1) and JDK 17

This throws a bunch of warnings again.

Maven output
➜  errorprone-2.5 MAVEN_OPTS="--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED" mvn clean compile -Derrorprone.version=2.12.1
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.mihalyr.test:errorprone-2.5 >-------------------
[INFO] Building errorprone-2.5 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ errorprone-2.5 ---
[INFO] Deleting /home/mihalyr/workspace/errorprone-2.5/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ errorprone-2.5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mihalyr/workspace/errorprone-2.5/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ errorprone-2.5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/mihalyr/workspace/errorprone-2.5/target/classes
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[3] [SameNameButDifferent] The name `@lombok.Value` refers to [java.lang.SuppressWarnings, java.lang.String, java.lang.Override, java.lang.Object] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[5,11] [SameNameButDifferent] The name `greeting;` refers to [java.lang.SuppressWarnings, java.lang.String] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[WARNING] /home/mihalyr/workspace/errorprone-2.5/src/main/java/errorprone/App.java:[5,11] [SameNameButDifferent] The name `greeting;` refers to [java.lang.SuppressWarnings, java.lang.String] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity.
    (see https://errorprone.info/bugpattern/SameNameButDifferent)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.502 s
[INFO] Finished at: 2022-04-10T20:59:47+02:00
[INFO] ------------------------------------------------------------------------

I’ve also tried the following Lombok configuration (added new dependency for @SuppressFBWarnings com.github.spotbugs:spotbugs-annotations:4.6.0):

lombok.config
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
lombok.extern.findbugs.addSuppressFBWarnings = true
lombok.addSuppressWarnings = true

Dumping 15 warnings for every single Lombok annotation doesn’t seem to be right. In our production code the amount of warnings is just too much, so far I kept staying with JDK 11 and 2.4.0, but I would really like to upgrade to JDK 17.

I was considering disabling all warnings temporarily, but adding -XepDisableAllWarnings didn’t change anything, the warnings remained. It works when I disable or suppress SameNameBugDifferent explicitly. I could only do that globally, because suppressing every single case on production adds a lot of unnecessary noise to the code. However, this is not the only Lombok annotation that throws warnings.

I can switch from @Value to @AllArgsConstructor for example and I get the same warnings but less of them, only 4. But If I add @Data in addition, I get 33 warnings already from this simple piece of code.

I am using the exact same Lombok version that worked with 2.4.0, it uses the @lombok.Generated annotation and I use ErrorProne with the -XepDisableWarningsInGeneratedCode as before, the only change is ErrorProne version from 2.4.0 to 2.5.1.

Did anything change in ErrorProne in 2.5.0 or 2.5.1 that could be the culprit of this?

Is there any workaround I could use other than disabling any check that is being thrown or suppressing with annotations? Something like telling ErrorProne a list of annotations to ignore (a way to pass a list of lombok annotations that it should skip)?

Or did I miss or forgot something obvious that needs to be done when upgrading from 2.4.0 to 2.5.x? Please let me know if there is anything else I can try.

Thank you in advance.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
cushoncommented, Apr 11, 2022

I’d say that Lombok links every AST node it generates with the source code position of the @lombok.Value annotation rather than no position at all

Looking at this case in a debugger seems to confirm that. I think this was the corresponding change: https://github.com/Rawi01/lombok/commit/5ec517d00d7a6d15dd6dffc4beb70ffe5eab1d77. Previously it was adding synthetic AST nodes without source position information, and now it uses the source position information as the lombok annotation associated with the generated code.

0reactions
hakanaicommented, May 10, 2022

Reading the comments here, I too tried Lombok 1.18.16 to see if that would get us out of this mess, but it ended up failing at SameNameButDifferent in the same way as the previous version.

So I tried Lombok 1.18.24, and that then seems to get us through compiling the first module in our codebase - so that’s progress. SameNameButDifferent now only emits a warning, claiming that “The name @Builder refers to [javax.annotation.Nonnull, javax.annotation.Nullable] within this file. It may be confusing…” That is indeed confusing - so confusing that I have no idea how to interpret the error message.

The new failure we get is because MissingSummary (which we upgrade to ERROR) picks up the methods @Builder generates as not having summary docs. Oddly, errorprone v2.4.0 either doesn’t have that issue, or fails to pick them up due to a different [favourable] bug.

But we turn off warnings on generated code, so why it’s even checking these is a mystery. It could be that #3108 will fix it and we’re just waiting for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lombok not working with JDK 11 modules (Jigsaw) #1723
I'm using: Java 11 Lombok 1.18.4 (also tried 1.18.5 edge) Gradle 5.0 (also tried ... IntelliJ wil show following warning (with annotation processer...
Read more >
Unable to use Lombok with Java 11 - Stack Overflow
Is there a way to use Lombok's @Data annotation which provides getter and setter without implementing them at Java 11?
Read more >
Spring Boot 2.7.0 available now
The highlights of the 2.7 release include: Auto-configuration and metrics for Spring for GraphQL; see related 1.0 release announcement; New @ ...
Read more >
dependency 'org.projectlombok:lombok:1.18.24' not found
I tried to do it on my own but failed. My java version is jdk 17 / The Plugin Minecraft version is 1.19.2....
Read more >
Custom pluggable types for ... - The Checker Framework Manual
The Checker Framework enhances Java's type system to make it more ... To suppress all warnings related to uses of unannotated_method, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found