|
11 | 11 | package org.eclipse.jdt.internal.codeassist; |
12 | 12 |
|
13 | 13 | import java.util.ArrayList; |
14 | | -import java.util.HashSet; |
| 14 | +import java.util.LinkedHashSet; |
15 | 15 | import java.util.List; |
16 | 16 | import java.util.Set; |
17 | 17 | import java.util.Stack; |
@@ -51,10 +51,10 @@ public class DOMThrownExceptionFinder extends ASTVisitor { |
51 | 51 | * thrown by the method and whose super type has been caught already. |
52 | 52 | */ |
53 | 53 | public void processThrownExceptions(TryStatement tryStatement) { |
54 | | - this.thrownExceptions = new HashSet<>(); |
| 54 | + this.thrownExceptions = new LinkedHashSet<>(); |
55 | 55 | this.exceptionsStack = new Stack<>(); |
56 | | - this.caughtExceptions = new HashSet<>(); |
57 | | - this.discouragedExceptions = new HashSet<>(); |
| 56 | + this.caughtExceptions = new LinkedHashSet<>(); |
| 57 | + this.discouragedExceptions = new LinkedHashSet<>(); |
58 | 58 | tryStatement.accept(this); |
59 | 59 | removeCaughtExceptions(tryStatement, true /* remove unchecked exceptions this time */); |
60 | 60 | } |
@@ -139,7 +139,7 @@ public boolean visit(AnonymousClassDeclaration anonymousClassDeclaration) { |
139 | 139 | @Override |
140 | 140 | public boolean visit(TryStatement tryStatement) { |
141 | 141 | this.exceptionsStack.push(this.thrownExceptions); |
142 | | - Set<ITypeBinding> exceptionSet = new HashSet<>(); |
| 142 | + Set<ITypeBinding> exceptionSet = new LinkedHashSet<>(); |
143 | 143 | this.thrownExceptions = exceptionSet; |
144 | 144 | tryStatement.getBody().accept(this); |
145 | 145 |
|
|
0 commit comments