Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix endless loop in RippleMethodFinder2.UnionFind.find(IType) #1192 #1193

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Feb 14, 2024

@jukzi jukzi linked an issue Feb 14, 2024 that may be closed by this pull request
@jukzi jukzi requested a review from jjohnstn February 14, 2024 12:37
@jukzi
Copy link
Contributor Author

jukzi commented Feb 14, 2024

@jjohnstn i have no idea what that method is all about, but this seems to fix an endless loop. just don't know what that method is supposed to return in such case - if it matters at all

@@ -98,7 +98,8 @@ public void init(IType type) {
public IType find(IType element) {
IType root= element;
IType rep= fElementToRepresentative.get(root);
while (rep != null && ! rep.equals(root)) {
Set<IType> visited=new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the code. The change is fine for the meantime and much better than an infinite loop. The real error is somehow the fElementToRepresentative map is being formed incorrectly. Whether designating the first representative found as the root causes other problems or not is a future question.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is fine for the meantime and much better than an infinite loop

i like that attitude

@jjohnstn jjohnstn merged commit 296f188 into eclipse-jdt:master Feb 14, 2024
9 checks passed
@jukzi jukzi deleted the endless_loop_in_RippleMethodFinder2.UnionFin branch February 15, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor rename of method named 'copy' freezes Eclipse
3 participants