Skip to content

Commit

Permalink
switch order in which reactor elements are added
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnrd committed Feb 15, 2022
1 parent f95e9a3 commit 3b825a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions org.lflang/src/org/lflang/ASTUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,15 @@ public static LinkedHashSet<Reactor> superClasses(Reactor reactor) {
*/
public static <T> List<T> collectElements(Reactor definition, Function<Reactor,List<T>> elements) {
List<T> result = new ArrayList<T>();
// Add elements of the current reactor.
result.addAll(elements.apply(definition));
// Add elements of elements defined in superclasses.
LinkedHashSet<Reactor> s = superClasses(definition);
if (s != null) {
for (Reactor superClass : s) {
result.addAll(elements.apply(superClass));
}
}
// Add elements of the current reactor.
result.addAll(elements.apply(definition));
return result;
}

Expand Down

0 comments on commit 3b825a0

Please sign in to comment.