eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 787 forks source link

Making queuedBeforeActivation in DefaultScriptScopeProvider non-nullable #6827

Closed sprehn closed 5 years ago

sprehn commented 5 years ago

Signed-off-by: sprehn sebastian.prehn@gmx.de

maggu2810 commented 5 years ago

Perhaps it is personal preference but IMHO this way we can prevent a NPE on use without check, we don't need to synchronize the reference between different threads (is the assigned new object already visible or still null in the other thread) and the code without the checks is smaller and so easier to read / understand.

sprehn commented 5 years ago

no. it reinvokes the @Reference method which will this time call add to elements and thingactions

sprehn commented 5 years ago

Hi, can this be merged? Travis is timing out...

htreu commented 5 years ago

Travis is unhappy:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.2.0:compile (default-compile) on project org.eclipse.smarthome.automation.module.script.defaultscope: Compilation failure: Compilation failure: 
[ERROR] /home/travis/build/eclipse/smarthome/bundles/automation/org.eclipse.smarthome.automation.module.script.defaultscope/src/main/java/org/eclipse/smarthome/automation/module/script/defaultscope/internal/DefaultScriptScopeProvider.java:[132] 
[ERROR]     thingActions.addThingActions(thingActions);
[ERROR]                  ^^^^^^^^^^^^^^^
[ERROR] The method addThingActions(ThingActions) is undefined for the type ThingActions
sprehn commented 5 years ago

Ah, it should be the instance variable, not the parameter, fixing it