Skip to content

Commit

Permalink
fix endless loop in RippleMethodFinder2.UnionFind.find(IType) #1192 (#…
Browse files Browse the repository at this point in the history
…1193)

#1192

Co-authored-by: Jörg Kubitz <jkubitz-eclipse@gmx.de>
  • Loading branch information
jukzi and EcljpseB0T committed Feb 14, 2024
1 parent 5b4bdb4 commit 296f188
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<>();
while (rep != null && visited.add(root)) {
root= rep;
rep= fElementToRepresentative.get(root);
}
Expand Down

0 comments on commit 296f188

Please sign in to comment.