CSSTUDIO-3597 Create a new instance of macros in EmbeddedDisplayWidget.getEffectiveMacros().
#3663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a7e5d4c (part of #3475), the
@OverridemethodEmbeddedDisplayWidget.getEffectiveMacros()was removed in order to remove theLCIDmacro.A side-effect of this was that no new instance of
Macroswas created when calling the functionEmbeddedDisplayWidget.getEffectiveMacros(). This in turn leads to thefirePropertyChange()-functionality stopping to work properly, since it contains the optimization that listeners should not be updated if the new value isequal()to the old value:phoebus/app/display/model/src/main/java/org/csstudio/display/builder/model/properties/PropertyChangeHandler.java
Lines 167 to 169 in ed9fce4
A concrete example to illustrate the problem is the following: consider an OPI
A.bobthat contains (1) an embedded display Widget of the name"EmbeddedDisplay"and (2) a script of the following form:This pull request reinstates the creation of a new instance of
Macroswhen callingEmbeddedDisplayWidget.getEffectiveMacros(), which leads tofirePropertyChange()notifying the embedded display of the change.I am not sure if this is the best way to fix the issue, or not. It does seem to me, however, that calling
embeddedDisplayWidget.propMacros().setValue(macros)with a valid argument should correctly update the embedded display.I have tested the change manually.