Skip to content

Commit 195b300

Browse files
committed
[Core] Don't use immutable lists as they cannot be deserialized from H2
DB using the generic collection serializer provided with Kryo
1 parent 675a779 commit 195b300

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

sensorhub-core/src/main/java/org/sensorhub/api/command/CommandResult.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
import java.util.ArrayList;
1818
import java.util.Collection;
1919
import java.util.Collections;
20+
import java.util.List;
2021
import org.sensorhub.api.common.BigId;
2122
import org.sensorhub.utils.ObjectUtils;
2223
import org.vast.ogc.xlink.IXlinkReference;
2324
import org.vast.util.Asserts;
24-
import com.google.common.collect.ImmutableList;
2525
import net.opengis.swe.v20.DataBlock;
2626

2727

@@ -54,11 +54,7 @@ protected CommandResult()
5454
*/
5555
public static ICommandResult withDatastream(BigId dataStreamID)
5656
{
57-
Asserts.checkNotNull(dataStreamID, BigId.class);
58-
59-
var res = new CommandResult();
60-
res.dsIDs = ImmutableList.of(dataStreamID);
61-
return res;
57+
return withDatastreams(List.of(dataStreamID));
6258
}
6359

6460

@@ -85,11 +81,7 @@ public static ICommandResult withDatastreams(Collection<BigId> dataStreamIDs)
8581
*/
8682
public static ICommandResult withObservation(BigId obsID)
8783
{
88-
Asserts.checkNotNull(obsID, BigId.class);
89-
90-
var res = new CommandResult();
91-
res.obsIDs = ImmutableList.of(obsID);
92-
return res;
84+
return withObservations(List.of(obsID));
9385
}
9486

9587

@@ -116,11 +108,7 @@ public static ICommandResult withObservations(Collection<BigId> obsIDs)
116108
*/
117109
public static ICommandResult withData(DataBlock data)
118110
{
119-
Asserts.checkNotNull(data, DataBlock.class);
120-
121-
var res = new CommandResult();
122-
res.inlineRecords = ImmutableList.of(data);
123-
return res;
111+
return withData(List.of(data));
124112
}
125113

126114

0 commit comments

Comments
 (0)