From f3a505853483ad7452e9a9477d61c506a0580cf1 Mon Sep 17 00:00:00 2001 From: Brad Clement Date: Wed, 2 Oct 2024 16:44:18 -0700 Subject: [PATCH 1/2] NPE fix --- .../nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java index 916df89c95..33fb8f5bef 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java @@ -843,7 +843,7 @@ public SimulationActivityExtract computeActivitySimulationResults( .stream() .map(spanToActivityInstanceId::get) .toList(), - (activityParents.containsKey(span)) ? Optional.empty() : Optional.of(directiveId) + (activityParents.containsKey(span)) ? Optional.empty() : Optional.ofNullable(directiveId) )); } }); From 697fe9a4f2fc41234f328af896b60338c0e51727 Mon Sep 17 00:00:00 2001 From: Matthew Dailis Date: Thu, 3 Oct 2024 09:17:19 -0700 Subject: [PATCH 2/2] Use directiveId instead of activityParents to compute directive id DirectiveId used to be computed from activityParents, but as of recently it is computed separately. This commit uses it directly --- .../nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java index 33fb8f5bef..44b575f8c1 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java @@ -828,7 +828,7 @@ public SimulationActivityExtract computeActivitySimulationResults( .stream() .map(spanToActivityInstanceId::get) .toList(), - (activityParents.containsKey(span)) ? Optional.empty() : Optional.ofNullable(directiveId), + Optional.ofNullable(directiveId), outputAttributes )); } else { @@ -843,7 +843,7 @@ public SimulationActivityExtract computeActivitySimulationResults( .stream() .map(spanToActivityInstanceId::get) .toList(), - (activityParents.containsKey(span)) ? Optional.empty() : Optional.ofNullable(directiveId) + Optional.ofNullable(directiveId) )); } });