While working in a self-hosting session I attempted a method signature refactoring. This took a very long time and pausing the ModalContext thread and stepping through it I found an endless loop in the following code.
So somehow the fElementToRepresentative map contains a mapping for each other. This causes the endless loop. I don't know whether the fElementToRepresentative is invalid, i.e. it is never supposed to contain a recursive mapping, or whether the loop is incorrect, i.e. the loop is supposed to check for visited items.
Also, since this is a refactoring, I am confused by BinaryTypes are even processed.
On a side note, RippleMethodFinder2.getRelatedMethods is ignoring the IProgressMonitor. Therefore the cancellation is a not working and Eclipse appears to hang.
While working in a self-hosting session I attempted a method signature refactoring. This took a very long time and pausing the ModalContext thread and stepping through it I found an endless loop in the following code.
https://github.com/eclipse-jdt/eclipse.jdt.ui/blob/756cca59703dbd314fdc10fd79f5ec1add7978ca/org.eclipse.jdt.core.manipulation/core%20extension/org/eclipse/jdt/internal/corext/refactoring/rename/RippleMethodFinder2.java#L101-L104
What happened was that the loop changed
root
andrep
in each iteration.rep = ResolvedBinaryType (id=522)
androot = ResolvedBinaryType (id=421)
rep = ResolvedBinaryType (id=421)
androot = ResolvedBinaryType (id=522)
rep = ResolvedBinaryType (id=522)
androot = ResolvedBinaryType (id=421)
With the following types:
So somehow the
fElementToRepresentative
map contains a mapping for each other. This causes the endless loop. I don't know whether thefElementToRepresentative
is invalid, i.e. it is never supposed to contain a recursive mapping, or whether the loop is incorrect, i.e. the loop is supposed to check for visited items.Also, since this is a refactoring, I am confused by BinaryTypes are even processed.
The callstack to the
find
method is:On a side note,
RippleMethodFinder2.getRelatedMethods
is ignoring theIProgressMonitor
. Therefore the cancellation is a not working and Eclipse appears to hang.