Community
Participate
Working Groups
ecj compiler raises a warning when trying to generate java file from annotation processor and fails to generate any class file. This looks similar to 542090 but the warning message is different. How to reproduce ================== Clone the following github project: https://github.com/sarod/bugs-repro/tree/master/ecj-bugs/ecj-filer-exception Using Maven ----------- Run the following commands Compile the project ```sh mvn clean compile ``` Modify MyDataClass.java ```sh touch src/main/java/bugs/repro/MyDataClass.java ``` Compile the project again WITHOUT clean ```sh mvn -X compile ``` The compilation ends with "BUILD SUCCESS" but it's wrong. However it did not generate the class files and it issued the warning ``` 1. WARNING in /home/sarod/dev/git/bugs-repro/ecj-bugs/ecj-filer-exception/src/main/java/bugs/repro/MyDataClass.java (at line 6) public abstract class MyDataClass { ^^^^^^^^^^^ Could not write generated class bugs.repro.AutoValue_MyDataClass: javax.annotation.processing.FilerException: Source file already exists : bugs.repro.AutoValue_MyDataClass ``` Using intellij ----------- 1. Open the project using intellij community edition. 2. Build the whole project using "Build">"Rebuild Project". 3. Open the file src/main/java/bugs/repro/MyDataClass.java 4. Re-compile this file only using "Build">"Recompile '...MyDataClass.java'". The "Messages" view displays the same warning.
I have the same issue with ECJ-4.13 (the version embedded with IntelliJ 2020.2) and with the last ECJ version (ECJ-4.16). Any hope to get a fix or a workaround for this issue?
I don't have access to IntelliJ. Is there a way to reproduce this with just Eclipse/ECJ?
There are steps using maven, aren't those enough to reproduce?
I'm able to reproduce this issue as well. See github project https://github.com/mbauhardt/ecj-filer-exception which is similar to https://github.com/sarod/bugs-repro/tree/master/ecj-bugs/ecj-filer-exception It looks like, compiling via commandline is working fine. See readme / compile.sh of the project from above. But with IntelliJ the compilation fails. Is it an pure IntelliJ issue??
(In reply to Marko Bauhardt from comment #4) > I'm able to reproduce this issue as well. > See github project https://github.com/mbauhardt/ecj-filer-exception > which is similar to > https://github.com/sarod/bugs-repro/tree/master/ecj-bugs/ecj-filer-exception > > It looks like, compiling via commandline is working fine. See readme / > compile.sh > of the project from above. But with IntelliJ the compilation fails. > Is it an pure IntelliJ issue?? I commented on https://youtrack.jetbrains.com/issue/IDEA-211545#focus=Comments-27-5694078.0-0 as well.
This issue seems to be fixed with IntelliJ 2021.3.2. see https://intellij-support.jetbrains.com/hc/en-us/community/posts/4417393355666-Eclipse-Compiler-including-annotation-processing
(In reply to Marko Bauhardt from comment #6) > This issue seems to be fixed with IntelliJ 2021.3.2. > see > https://intellij-support.jetbrains.com/hc/en-us/community/posts/4417393355666-Eclipse-Compiler-including-annotation-processing > Thanks for following up and update. Does this mean this bug can be closed?
(In reply to Jay Arthanareeswaran from comment #7) > Thanks for following up and update. Does this mean this bug can be closed? From my perspective yes. I don't get the error with IntelliJ 2021.3.2 Maybe @Sebastien Arod can confirm...
(In reply to Marko Bauhardt from comment #8) > (In reply to Jay Arthanareeswaran from comment #7) > > > Thanks for following up and update. Does this mean this bug can be closed? > > From my perspective yes. I don't get the error with IntelliJ 2021.3.2 > Maybe @Sebastien Arod can confirm... New update from my side. when a class contains an inner class the generation doesn't work anymore again. so this issue is not 100% resolved. see https://github.com/mbauhardt/ecj-filer-exception to reproduce.