This issue was initially reported as this Eclipse bug:
bug 299746: java.lang.ClassCastException in secondary types removal
There is already some analysis on this bug which I do not want to repeat here.
At the moment it is not clear whether this issue is caused by Eclipse or the Groovy plugin so any help
from the Groovy team would be much appreciated.
It seems that there are issues which secondary types in Groovy files. At the moment, there is no small test case, just a scenario I run on my computer locally:
1. With Groovy files and Groovy plugin installed --> rename --> error
2. Un-install Groovy plugin --> rename --> error
3. New workspace, import existing projects --> rename --> WORKS!!
4. Back to previous workspace (which is rebuilt) --> rename --> ERROR!!!
On the other hand, if I delete the folder containing the Groovy code without de-installing the Groovy plugin, rename refactoring starts working again.