Skip to content

Commit 05639de

Browse files
committed
Stabilize some tests where ordering is important
Using LinkedHashSet instead of HashSet.
1 parent 8bea617 commit 05639de

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/codeassist/DOMThrownExceptionFinder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
package org.eclipse.jdt.internal.codeassist;
1212

1313
import java.util.ArrayList;
14-
import java.util.HashSet;
14+
import java.util.LinkedHashSet;
1515
import java.util.List;
1616
import java.util.Set;
1717
import java.util.Stack;
@@ -51,10 +51,10 @@ public class DOMThrownExceptionFinder extends ASTVisitor {
5151
* thrown by the method and whose super type has been caught already.
5252
*/
5353
public void processThrownExceptions(TryStatement tryStatement) {
54-
this.thrownExceptions = new HashSet<>();
54+
this.thrownExceptions = new LinkedHashSet<>();
5555
this.exceptionsStack = new Stack<>();
56-
this.caughtExceptions = new HashSet<>();
57-
this.discouragedExceptions = new HashSet<>();
56+
this.caughtExceptions = new LinkedHashSet<>();
57+
this.discouragedExceptions = new LinkedHashSet<>();
5858
tryStatement.accept(this);
5959
removeCaughtExceptions(tryStatement, true /* remove unchecked exceptions this time */);
6060
}
@@ -139,7 +139,7 @@ public boolean visit(AnonymousClassDeclaration anonymousClassDeclaration) {
139139
@Override
140140
public boolean visit(TryStatement tryStatement) {
141141
this.exceptionsStack.push(this.thrownExceptions);
142-
Set<ITypeBinding> exceptionSet = new HashSet<>();
142+
Set<ITypeBinding> exceptionSet = new LinkedHashSet<>();
143143
this.thrownExceptions = exceptionSet;
144144
tryStatement.getBody().accept(this);
145145

0 commit comments

Comments
 (0)