Skip to content

Better feedback when variable does not exist in FMU's modelDescription file #73

Description

@THEvang

When validating a OspModelDescription file defining a variable that does not exist in the FMU's modelDescription, the output is a java exception. I think the output should be a message explicitly telling what is wrong. For instance: Variable: A used in Variable Group: Group A, is not defined in modelDescription.xml of FMU: FMU A

The exception is shown below:

Exception in thread "main" java.lang.NullPointerException at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.setVariables(VariableGroupOwlBuilder.java:185) at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.build(VariableGroupOwlBuilder.java:140) at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.setVariableGroups(VariableGroupOwlBuilder.java:173) at com.opensimulationplatform.core.owlbuilder.VariableGroupOwlBuilder.build(VariableGroupOwlBuilder.java:141) at com.opensimulationplatform.core.owlbuilder.SimulatorOwlBuilder.lambda$setVariableGroups$5(SimulatorOwlBuilder.java:74) at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) at com.opensimulationplatform.core.owlbuilder.SimulatorOwlBuilder.setVariableGroups(SimulatorOwlBuilder.java:68) at com.opensimulationplatform.core.owlbuilder.SimulatorOwlBuilder.build(SimulatorOwlBuilder.java:34) at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) at com.opensimulationplatform.core.owlbuilder.SystemStructureOwlBuilder.buildSimulators(SystemStructureOwlBuilder.java:49) at com.opensimulationplatform.core.owlbuilder.SystemStructureOwlBuilder.build(SystemStructureOwlBuilder.java:27) at com.opensimulationplatform.core.validation.ValidatorContextFactory.create(ValidatorContextFactory.java:26) at com.opensimulationplatform.core.validation.Validator.validate(Validator.java:75) at com.opensimulationplatform.cli.Validator.validate(Validator.java:66) at com.opensimulationplatform.cli.Main.main(Main.java:85)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions