diff --git a/handler/src/main/java/org/n52/sos/ds/observation/SweAbstractDataComponentCreator.java b/handler/src/main/java/org/n52/sos/ds/observation/SweAbstractDataComponentCreator.java index bc26b599da..4f8e6956de 100644 --- a/handler/src/main/java/org/n52/sos/ds/observation/SweAbstractDataComponentCreator.java +++ b/handler/src/main/java/org/n52/sos/ds/observation/SweAbstractDataComponentCreator.java @@ -29,6 +29,7 @@ import java.net.URI; import java.net.URISyntaxException; +import java.util.TreeSet; import org.n52.janmayen.NcName; import org.n52.series.db.beans.BlobDataEntity; @@ -148,7 +149,7 @@ public SweCategory visit(CategoryDataEntity o) throws CodedException { public SweDataRecord visit(ComplexDataEntity o) throws OwsExceptionReport { SweDataRecord record = new SweDataRecord(); - for (DataEntity sub : o.getValue()) { + for (DataEntity sub : new TreeSet<>(o.getValue())) { String fieldName = getFieldName(sub); record.addField(new SweField(fieldName, this.visit(sub))); } diff --git a/handler/src/main/java/org/n52/sos/ds/utils/ResultHandlingHelper.java b/handler/src/main/java/org/n52/sos/ds/utils/ResultHandlingHelper.java index 7dba67822a..c80516855f 100644 --- a/handler/src/main/java/org/n52/sos/ds/utils/ResultHandlingHelper.java +++ b/handler/src/main/java/org/n52/sos/ds/utils/ResultHandlingHelper.java @@ -37,6 +37,7 @@ import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; +import java.util.TreeSet; import org.hibernate.Session; import org.joda.time.DateTime; @@ -166,8 +167,7 @@ private String createResultValuesFromObservations(final Collection .next() instanceof TrajectoryDataEntity) { size = 0; for (DataEntity observation : observations) { - size += ((TrajectoryDataEntity) observation).getValue() - .size(); + size += ((TrajectoryDataEntity) observation).getValue().size(); } } addElementCount(builder, size, blockSeparator); @@ -175,14 +175,16 @@ private String createResultValuesFromObservations(final Collection for (final DataEntity obs : observations) { DataEntity observation = unproxy(obs, session); if (observation instanceof ProfileDataEntity) { - builder.append(createResultValuesFromObservations(((ProfileDataEntity) observation).getValue(), + TreeSet> val = new TreeSet<>(((ProfileDataEntity) observation).getValue()); + builder.append(createResultValuesFromObservations(val, sosResultEncoding, sosResultStructure, noDataPlaceholder, valueOrder, false, ((ProfileDataEntity) observation).getDataset() .getVerticalMetadata(), session)); builder.append(blockSeparator); } else if (observation instanceof TrajectoryDataEntity) { - builder.append(createResultValuesFromObservations(((TrajectoryDataEntity) observation).getValue(), + TreeSet> val = new TreeSet<>(((TrajectoryDataEntity) observation).getValue()); + builder.append(createResultValuesFromObservations(val, sosResultEncoding, sosResultStructure, noDataPlaceholder, valueOrder, false, null, session)); builder.append(blockSeparator); diff --git a/pom.xml b/pom.xml index 80a170b80a..b57fab9ba4 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 2.7.0 10.1.1 3.5.1 - 4.0.1 + 4.0.3 4.0.5 2.0.1 5.3.24