diff --git a/src/main/java/eu/europa/ted/efx/model/templates/ContentBlock.java b/src/main/java/eu/europa/ted/efx/model/templates/ContentBlock.java index b019ad1..29cc3be 100644 --- a/src/main/java/eu/europa/ted/efx/model/templates/ContentBlock.java +++ b/src/main/java/eu/europa/ted/efx/model/templates/ContentBlock.java @@ -125,7 +125,7 @@ public Set getOwnVariables() { if (this.context != null && this.context.variable() != null) { variables.add(this.context.variable()); } - variables.addAll(this.variables); + variables.addAll(this.variables.declaredOrder()); return variables; } diff --git a/src/main/java/eu/europa/ted/efx/model/variables/VariableList.java b/src/main/java/eu/europa/ted/efx/model/variables/VariableList.java index 005a508..580f37f 100644 --- a/src/main/java/eu/europa/ted/efx/model/variables/VariableList.java +++ b/src/main/java/eu/europa/ted/efx/model/variables/VariableList.java @@ -1,5 +1,6 @@ package eu.europa.ted.efx.model.variables; +import java.util.Collections; import java.util.LinkedList; import eu.europa.ted.efx.model.ParsedEntity; @@ -8,4 +9,11 @@ public class VariableList extends LinkedList implements ParsedEntity { public VariableList() { } + + public VariableList declaredOrder() { + VariableList reversedList = new VariableList(); + reversedList.addAll(this); + Collections.reverse(reversedList); + return reversedList; + } }