Skip to content

AutoValue annotation processing bug when inheritance is involved #2117

Open
@hopskipnfall

Description

@hopskipnfall

I believe I found a bug related to annotation processing (AutoValue).

Specifically, when there is a parent class of the @AutoValue-annotated class, the vscode-java generated code does not match the code generated by running mvn compile.

Environment
  • Operating System: Mac and Windows tested
  • JDK version: openjdk "11.0.12" 2021-07-20
  • Visual Studio Code version: 1.60.1
  • Java extension version: Extension Pack for Java v0.18.4 (containing Language Support for Java(TM) by Red Hat
    v0.82.0)
Steps To Reproduce
  1. Install Maven (I am running version 3.8.1)
  2. Clone this repository: https://github.com/hopskipnfall/autovalue-bug-demo (also attached to the issue for posterity: autovalue-bug-demo-master.zip)
  3. From the sudirectory demo/ run mvn compile. Notice that it compiles successfully.
  4. Open the project in VS Code and let it load the maven project.
  5. Open up the class com.autovaluebug.MyAutoValueClass. Save the file (triggering a java build, assuming you don't have Java autobuild turned off in settings).
  6. Notice that VS Code now shows a compiler error because the constructor is being called with the wrong parameter order.

java_server_log.txt

Current Result

Notice that the generated class AutoValue_MyAutoValueClass is different depending on if it is built by VSCode or by Maven. Here are the two versions outlined in this README: https://github.com/hopskipnfall/autovalue-bug-demo#readme

Expected Result

The AutoValue generated class should be identical regardless of how it was built.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions