|
1 | 1 | /**
|
2 | 2 | * *****************************************************************************
|
3 |
| - * Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the |
4 |
| - * accompanying materials are made available under the terms of the Eclipse |
5 |
| - * Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0. |
6 |
| - * |
7 |
| - * <p>SPDX-License-Identifier: EPL-2.0 |
8 |
| - * |
9 |
| - * <p>Contributors: Johannes Spaeth - initial API and implementation |
| 3 | + * Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany |
| 4 | + * <p> |
| 5 | + * This program and the accompanying materials are made available under the |
| 6 | + * terms of the Eclipse Public License 2.0 which is available at |
| 7 | + * http://www.eclipse.org/legal/epl-2.0. |
| 8 | + * <p> |
| 9 | + * SPDX-License-Identifier: EPL-2.0 |
| 10 | + * <p> |
| 11 | + * Contributors: |
| 12 | + * Johannes Spaeth - initial API and implementation |
10 | 13 | * *****************************************************************************
|
11 | 14 | */
|
12 | 15 | package sync.pds.solver;
|
|
16 | 19 | import com.google.common.collect.Lists;
|
17 | 20 | import com.google.common.collect.Maps;
|
18 | 21 | import com.google.common.collect.Multimap;
|
19 |
| -import com.google.common.collect.Sets; |
20 | 22 | import de.fraunhofer.iem.Location;
|
21 | 23 | import java.util.AbstractMap;
|
22 | 24 | import java.util.Collection;
|
23 | 25 | import java.util.HashSet;
|
| 26 | +import java.util.LinkedHashSet; |
24 | 27 | import java.util.Map;
|
25 | 28 | import java.util.Map.Entry;
|
26 | 29 | import java.util.Set;
|
@@ -70,10 +73,10 @@ public String toString() {
|
70 | 73 | return "Field " + SyncPDSSolver.this;
|
71 | 74 | }
|
72 | 75 | };
|
73 |
| - private final Set<Node<Stmt, Fact>> reachedStates = Sets.newHashSet(); |
74 |
| - private final Set<Node<Stmt, Fact>> callingContextReachable = Sets.newHashSet(); |
75 |
| - private final Set<Node<Stmt, Fact>> fieldContextReachable = Sets.newHashSet(); |
76 |
| - private final Set<SyncPDSUpdateListener<Stmt, Fact>> updateListeners = Sets.newHashSet(); |
| 76 | + private final Set<Node<Stmt, Fact>> reachedStates = new LinkedHashSet<>(); |
| 77 | + private final Set<Node<Stmt, Fact>> callingContextReachable = new LinkedHashSet<>(); |
| 78 | + private final Set<Node<Stmt, Fact>> fieldContextReachable = new LinkedHashSet<>(); |
| 79 | + private final Set<SyncPDSUpdateListener<Stmt, Fact>> updateListeners = new LinkedHashSet<>(); |
77 | 80 | private final Multimap<Node<Stmt, Fact>, SyncStatePDSUpdateListener<Stmt, Fact>>
|
78 | 81 | reachedStateUpdateListeners = HashMultimap.create();
|
79 | 82 | protected final WeightedPAutomaton<Field, INode<Node<Stmt, Fact>>, W> fieldAutomaton;
|
@@ -594,8 +597,8 @@ private void applyCallSummary(Stmt callSite, Fact factInCallee, Stmt spInCallee)
|
594 | 597 | });
|
595 | 598 | }
|
596 | 599 |
|
597 |
| - Set<Summary> summaries = Sets.newHashSet(); |
598 |
| - Set<OnAddedSummaryListener> summaryListeners = Sets.newHashSet(); |
| 600 | + Set<Summary> summaries = new LinkedHashSet<>(); |
| 601 | + Set<OnAddedSummaryListener> summaryListeners = new LinkedHashSet<>(); |
599 | 602 |
|
600 | 603 | public void addApplySummaryListener(OnAddedSummaryListener l) {
|
601 | 604 | if (summaryListeners.add(l)) {
|
@@ -794,17 +797,17 @@ public void addGeneratedFieldState(GeneratedState<Node<Stmt, Fact>, Field> state
|
794 | 797 | public abstract Field fieldWildCard();
|
795 | 798 |
|
796 | 799 | public Set<Node<Stmt, Fact>> getReachedStates() {
|
797 |
| - return Sets.newHashSet(reachedStates); |
| 800 | + return new LinkedHashSet(reachedStates); |
798 | 801 | }
|
799 | 802 |
|
800 | 803 | public void debugOutput() {
|
801 | 804 | logger.debug(this.getClass().toString());
|
802 | 805 | logger.debug("All reachable states");
|
803 | 806 | prettyPrintSet(getReachedStates());
|
804 | 807 |
|
805 |
| - HashSet<Node<Stmt, Fact>> notFieldReachable = Sets.newHashSet(callingContextReachable); |
| 808 | + HashSet<Node<Stmt, Fact>> notFieldReachable = new LinkedHashSet(callingContextReachable); |
806 | 809 | notFieldReachable.removeAll(getReachedStates());
|
807 |
| - HashSet<Node<Stmt, Fact>> notCallingContextReachable = Sets.newHashSet(fieldContextReachable); |
| 810 | + HashSet<Node<Stmt, Fact>> notCallingContextReachable = new LinkedHashSet(fieldContextReachable); |
808 | 811 | notCallingContextReachable.removeAll(getReachedStates());
|
809 | 812 | if (!notFieldReachable.isEmpty()) {
|
810 | 813 | logger.debug("Calling context reachable");
|
|
0 commit comments