diff --git a/merlin-framework-processor/src/main/java/gov/nasa/jpl/aerie/merlin/processor/MissionModelParser.java b/merlin-framework-processor/src/main/java/gov/nasa/jpl/aerie/merlin/processor/MissionModelParser.java index 22d5ca72d6..46c3993816 100644 --- a/merlin-framework-processor/src/main/java/gov/nasa/jpl/aerie/merlin/processor/MissionModelParser.java +++ b/merlin-framework-processor/src/main/java/gov/nasa/jpl/aerie/merlin/processor/MissionModelParser.java @@ -386,6 +386,10 @@ private ActivityTypeRecord parseActivityType(final PackageElement missionModelEl final var validations = this.getExportValidations(activityTypeElement, parameters); final var effectModel = this.getActivityEffectModel(activityTypeElement); + if (!parameters.isEmpty()) { + checkForStaticParameters(name, parameters); + } + final var durationParameterName = effectModel.flatMap(EffectModelRecord::durationParameter); if (durationParameterName.isPresent()) { validateControllableDurationParameter(name, parameters, durationParameterName.get()); @@ -409,6 +413,17 @@ class (old-style) or as a record (new-style) by determining effectModel); } + private void checkForStaticParameters(String activityName, List parameters) throws InvalidMissionModelException { + for (final var parameter: parameters) { + if (parameter.element.getModifiers().contains(Modifier.STATIC)) { + throw new InvalidMissionModelException( + "In activity " + activityName + + ", parameter \"" + parameter.name +"\"" + + " is declared as static, but this is not valid for activity parameters"); + } + } + } + private void validateControllableDurationParameter( final String activityName, final List parameters,