asterics / AsTeRICS

The Assistive Technology Rapid Integration & Construction Set
http://www.asterics.eu
Other
54 stars 27 forks source link

ARE - a wrong expression in the MathEvaluator triggers a severe error in the slider #357

Open benjaminaigner opened 2 years ago

benjaminaigner commented 2 years ago

Problem: If there is a wrong expression (in this example: an additional bracket) in the MathEvaluator component triggers an error on model starting, stating that it is not possible to start the slider component (input of the MathEvaluator).

Cause:

2022-06-08 14:01:06.860 FINE [DeploymentManager runModel] Trying to start component instance: SliderInstance
2022-06-08 14:01:06.873 SEVERE [DeploymentManager runModel] java.lang.NullPointerException
    at org.cheffo.jeplite.JEP.getValue(JEP.java:176)
    at org.cheffo.jeplite.JEP.getValue(JEP.java:168)
    at eu.asterics.component.processor.mathevaluator.MathEvaluatorInstance.calculateAndProcessOutput(MathEvaluatorInstance.java:217)
    at eu.asterics.component.processor.mathevaluator.MathEvaluatorInstance$InputPort.receiveData(MathEvaluatorInstance.java:260)
    at eu.asterics.mw.model.runtime.impl.AbstractRuntimeOutputPort$1.run(AbstractRuntimeOutputPort.java:101)
    at eu.asterics.mw.services.AstericsModelExecutionThreadPool.execute(AstericsModelExecutionThreadPool.java:180)
    at eu.asterics.mw.model.runtime.impl.AbstractRuntimeOutputPort.sendData(AbstractRuntimeOutputPort.java:34)
    at eu.asterics.mw.model.runtime.impl.DefaultRuntimeOutputPort.sendData(DefaultRuntimeOutputPort.java:41)
    at eu.asterics.component.sensor.slider.SliderInstance.start(SliderInstance.java:353)
    at eu.asterics.mw.are.DeploymentManager.runModel(DeploymentManager.java:582)
    at eu.asterics.mw.services.AREServices.runModelInternal(AREServices.java:440)
    at eu.asterics.mw.services.AREServices$7.call(AREServices.java:409)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

2022-06-08 14:01:06.873 WARNING [DeploymentManager runModel] Plugin could not be started: Slider.1
2022-06-08 14:01:06.874 WARNING [AstericsErrorHandling reportError] Slider.1: Plugin could not be started: Slider.1

As it seems, the problematic expression is not handled in the MathEvaluator but propagates through to the slider.

Expected behavior:

The MathEvaluator component should display an error, like "malformed expression"

Example model: (due to file extension limitations, it is renamed to txt) abgabe1.txt