Basic refactoring operations still broken in large projects in 2021.2



I have already written about massive problems that I am seeing in 2021.1 here

I am still refactoring our large code base and I am still seeing a massive amount if issues with basic refactoring operations. This has always been a core strength of IntelliJ but unfortunately it is not anymore.

I still have no clue how to reproduce these issues so that they can finally be fixed. They simply do not reproduce for the stripped down minimal examples that I try to create whenever I encounter a bug. On the other hand, I simply hand over a 500.000 line project that I have no right to share with third parties.

Things I am seeing:

  • Moving a bunch of classes and their tests from package a.b.c to package a.d.e. does not update all import statements properly. In addition to that, some of the classes do not show up in the project structure dialog but they do show up in the Git changelog. Sometimes IntelliJ seems to detect that something is wrong and reindexes the whole project.
  • I have moved classes around that contain static imports for constants from other classes. Those references have not been updated.
  • Sometimes references of moved classes are updated in Groovy code. Sometimes they are not. There is no pattern visible when it does work and when it does not work. In some cases, IDEA shows the generated Java stub instead of the then incorrect Groovy class
  • IDEA seems to loose track of move operations and a Build project does not work properly anymore. It does not report any errors. A full project rebuild will then report classes that reference classes that have been moved. 
  • I move classes to another module. However, IDEA fails to detect (static) references in the same module. Days later, when I touch that class that contains the now invalid references, the project stops compiling (symbol not found). The fun fact is there have been multiple "Rebuild project" operations in between. Right now, I am looking at a Groovy source file in IntelliJ that says symbol XYZ is missing but this does not show up as error in a full rebuild. It seems like IDEA does not honour module boundaries properly when recompiling classes.
  • Build project fails because the Groovy compiler can't find some classes. The reason is that it is told to look for a Groovy file that has been moved to another package. 
  • Changes have been made to <some source file> in memory and on disk. The file system content shows the old imports, memory content are the new (correct) imports. This is a fun dialog for one file but not for 557...

There is plenty more, that is just from the top of my head what I have seen last week.

This behaviour is not limited to my machine as my pair programming partners are running into the same issues. Please let me know how to address this. "Please file an issue" doesn't really help because I simply don't manage to create samples to reproduce the issues. I have tried. Many times now. 


Please report separate issues at with the logs attached via Help | Collect Logs and Diagnostic Data.

This forum is not the best place for bug reports.

Thank you.