I looked at the patch and it touched a lot of places (basically wherever hierarchies are walked). More have been added since the patch was made too. I felt we needed a different approach to ensure we don't patch far too many new places.
The problem here is that although groovy have now fixed their issue we (in eclipse) attempt to get all the way through compilation, we don't give up on the first problem. IDEs typically try to show as much that is wrong about a file as possible, rather than you fix one thing, it shows the next, and so on.
So, I've added bitflags to ClassNode. When groovy determines an error we mark the ClassNode as having an inconsistent hierarchy. If someone later tries to access the superclass or superinterfaces for an inconsistent classnode (by calling one of the getter methods) we don't return the 'bad' supertype, we return Object for the superclass and an empty list for the interfaces.
This could be improved a little further because it considers all supertypes bad if just one is a problem. But at least it stops the hanging.
This approach also means we only have to patch ClassNode and the error logic that determines the ClassNode is broken, we don't have to patch anything else.
Changes and testcases added.