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

Using Lombok's @Data Annotation Doesn't Work With Error Prone #1754

Closed
nishantc1527 opened this issue Jul 27, 2020 · 2 comments
Closed

Using Lombok's @Data Annotation Doesn't Work With Error Prone #1754

nishantc1527 opened this issue Jul 27, 2020 · 2 comments

Comments

@nishantc1527
Copy link

ATTENTION! Please read and follow:

Description of the problem / feature request:

I have the following code:

@Data
@AllArgsConstructor
public static class TableEntry {
    public String lexme;
    public TokenType type;
    public int line;
    public int col;
}

The @Data and @AllArgsConstructor annotations are part of the lombok library. This code builds fine. However, using error prone it gives me this stack trace:

  @Data
  ^
     Please report this at https://github.com/google/error-prone/issues/new and include the following:
  
     error-prone version: 2.1.3
     Stack Trace:
     java.lang.IndexOutOfBoundsException
        at java.nio.HeapCharBuffer.subSequence(HeapCharBuffer.java:596)
        ... (Many More Exceptions Omitted)

Feature requests: what underlying problem are you trying to solve with this feature?

A way to suppress this error.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Download the lombok jar file, add it to your classpath, create a class with at least 1 field, then give the class the @Data annotation.

@Data
class MyClass {
    public static int myVar;
}

What version of Error Prone are you using?

Version 2.1.3

Have you found anything relevant by searching the web?

#1185
#1214
The solution they are suggesting is add the annotationProcessor option with lombok. I did that. Here is the section in my build.gradle file:

compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'

Places to look:

@tbroyer
Copy link
Contributor

tbroyer commented Jul 28, 2020

Your ErrorProne version is too old. Many issues with Lombok have been fixed in 2.3.4 and 2.4.0 IIRC.

@nishantc1527
Copy link
Author

Thanks for that, I updated it.

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