Open
Description
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
- Install Maven (I am running version 3.8.1)
- Clone this repository: https://github.com/hopskipnfall/autovalue-bug-demo (also attached to the issue for posterity: autovalue-bug-demo-master.zip)
- From the sudirectory
demo/
runmvn compile
. Notice that it compiles successfully. - Open the project in VS Code and let it load the maven project.
- 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). - Notice that VS Code now shows a compiler error because the constructor is being called with the wrong parameter order.
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.