This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new f70d482c6b1 [CAMEL-19330] Dump model for Choice should have otherwise
last (#10477)
f70d482c6b1 is described below
commit f70d482c6b1371a7ac245fa94ea5297786bad988
Author: Adriano Machado <[email protected]>
AuthorDate: Tue Jun 27 03:25:27 2023 -0400
[CAMEL-19330] Dump model for Choice should have otherwise last (#10477)
Co-authored-by: Adriano Machado <[email protected]>
---
.../src/main/java/org/apache/camel/model/ChoiceDefinition.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/core/camel-core-model/src/main/java/org/apache/camel/model/ChoiceDefinition.java
b/core/camel-core-model/src/main/java/org/apache/camel/model/ChoiceDefinition.java
index 9a1a9a6d74f..fbb16e7a5b1 100644
---
a/core/camel-core-model/src/main/java/org/apache/camel/model/ChoiceDefinition.java
+++
b/core/camel-core-model/src/main/java/org/apache/camel/model/ChoiceDefinition.java
@@ -27,6 +27,7 @@ import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlType;
import org.apache.camel.ExpressionFactory;
import org.apache.camel.Predicate;
@@ -41,6 +42,7 @@ import org.apache.camel.util.ObjectHelper;
*/
@Metadata(label = "eip,routing")
@XmlRootElement(name = "choice")
+@XmlType(propOrder = { "whenClauses", "otherwise" })
@XmlAccessorType(XmlAccessType.FIELD)
public class ChoiceDefinition extends ProcessorDefinition<ChoiceDefinition>
implements OutputNode {
@@ -65,7 +67,7 @@ public class ChoiceDefinition extends
ProcessorDefinition<ChoiceDefinition> impl
// wrap the outputs into a list where we can on the inside control the
// when/otherwise
// but make it appear as a list on the outside
- return new AbstractList<ProcessorDefinition<?>>() {
+ return new AbstractList<>() {
public ProcessorDefinition<?> get(int index) {
if (index < whenClauses.size()) {
@@ -87,7 +89,7 @@ public class ChoiceDefinition extends
ProcessorDefinition<ChoiceDefinition> impl
}
throw new IllegalArgumentException(
"Expected either a WhenDefinition or
OtherwiseDefinition but was "
- +
ObjectHelper.classCanonicalName(def));
+ + ObjectHelper.classCanonicalName(def));
}
public int size() {