Skip to content

Lombok false positive: MissingOverride for "@EqualsAndHashCode(callSuper = true)" when extending base class #1481

Closed

Description

@ksilz

Description of the problem / feature request:

I'm compiling my Java 11 Spring Boot program with Error Prone and get a false positive on MissingOverride in a class that has the Lombok annotation @EqualsAndHashCode(callSuper = true) and extends another class.

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

I reproduced the error in a test case repo.

[...]/src/main/java/com/betterprojectsfaster/test/errorprone/lombokErrorProne/issues/missingoverride/IssueShowCase.java:8: warning: [MissingOverride] canEqual overrides method in Base; expected @Override
@EqualsAndHashCode(callSuper = true)
^
    (see https://errorprone.info/bugpattern/MissingOverride)
    Did you mean '@Override @EqualsAndHashCode(callSuper = true)'?

What version of Error Prone are you using?

Here's my my environment:

  • macOS Catalina 10.15.2
  • Gradle 5.6.4
  • AdoptOpenJDK Eclipse OpenJ9 11.0.5
  • Lombok 1.18.10
  • Error Prone Gradle plug-in 1.1.1
  • Error Prone 2.3.4

Have you found anything relevant by searching the web?

Didn't find anything relevant in the mailing list. Here are related Lombox issues:

  • #1479: Lombok - MultiVariableDeclaration: IllegalArgumentException "Start [449] should not be after end [-1]" (Preconditions.java:300)
  • #1430:
    IllegalArgumentException from AlmostJavadoc pattern on project using lombok

Activity

  1. cushon commented on Apr 14, 2022

    @cushon
    Collaborator

    Please re-open this or file a new bug if you're still seeing issues with Lombok and Error Prone 2.13.0 when -XepDisableWarningsInGeneratedCode is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions