|
1 | 1 | /*
|
2 |
| - * Copyright 2016-2023 Red Hat, Inc. and/or its affiliates |
| 2 | + * Copyright 2016-2025 Red Hat, Inc. and/or its affiliates |
3 | 3 | * and other contributors as indicated by the @author tags.
|
4 | 4 | *
|
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
|
17 | 17 | package org.jboss.galleon.xml;
|
18 | 18 |
|
19 | 19 | import java.util.Map;
|
| 20 | +import java.util.TreeMap; |
| 21 | +import java.util.TreeSet; |
20 | 22 |
|
21 | 23 | import javax.xml.stream.XMLStreamException;
|
22 | 24 |
|
@@ -66,7 +68,7 @@ public void nextFeature(ProvisionedFeature feature) throws ProvisioningException
|
66 | 68 | addAttribute(featureE, Attribute.ID, feature.getId().toString());
|
67 | 69 | }
|
68 | 70 | if(feature.hasParams()) {
|
69 |
| - for(String param : feature.getParamNames()) { |
| 71 | + for(String param : new TreeSet<>(feature.getParamNames())) { |
70 | 72 | final ElementNode paramE = addElement(featureE, Element.PARAM.getLocalName(), parent.getNamespace());
|
71 | 73 | addAttribute(paramE, Attribute.NAME, param);
|
72 | 74 | addAttribute(paramE, Attribute.VALUE, feature.getConfigParam(param));
|
@@ -100,7 +102,7 @@ protected ElementNode toElement(ProvisionedConfig config, String ns) throws XMLS
|
100 | 102 |
|
101 | 103 | if(config.hasProperties()) {
|
102 | 104 | final ElementNode propsE = addElement(configE, Element.PROPS.getLocalName(), ns);
|
103 |
| - for(Map.Entry<String, String> entry : config.getProperties().entrySet()) { |
| 105 | + for(Map.Entry<String, String> entry : new TreeMap<>(config.getProperties()).entrySet()) { |
104 | 106 | final ElementNode propE = addElement(propsE, Element.PROP.getLocalName(), ns);
|
105 | 107 | addAttribute(propE, Attribute.NAME, entry.getKey());
|
106 | 108 | addAttribute(propE, Attribute.VALUE, entry.getValue());
|
|
0 commit comments