Skip to content

Commit

Permalink
[4204] Prevent the changeDescriptionSink from crashing because of the…
Browse files Browse the repository at this point in the history
… related representation refresh

Bug: #4204
Signed-off-by: Denis Nikiforov <[email protected]>
  • Loading branch information
AresEkb committed Dec 14, 2024
1 parent cdcdfa2 commit 740b7be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ This provider is in charge of getting the icon list of the representation.
This was first fixed in 2022.3.0 but broken in 2024.3.0; it is now fixed again.
- https://github.com/eclipse-sirius/sirius-web/issues/4280[#4280] [diagram] Fix direct edit with F2 when the palette is opened
- https://github.com/eclipse-sirius/sirius-web/issues/4302[#4302] [diagram] Fix edges label flashing
- https://github.com/eclipse-sirius/sirius-web/issues/4204[#4204] [core] Prevent the changeDescriptionSink from crashing because of the related representation refresh

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,18 @@ private Disposable setupChangeDescriptionSinkConsumer() {

var refreshRepresentationSample = Timer.start(this.meterRegistry);

RepresentationEventProcessorEntry representationEventProcessorEntry = this.representationEventProcessors.get(changeDescription.getSourceId());
if (representationEventProcessorEntry != null) {
try {
try {
RepresentationEventProcessorEntry representationEventProcessorEntry = this.representationEventProcessors.get(changeDescription.getSourceId());
if (representationEventProcessorEntry != null) {
IRepresentationEventProcessor representationEventProcessor = representationEventProcessorEntry.getRepresentationEventProcessor();
representationEventProcessor.refresh(changeDescription);
IRepresentation representation = representationEventProcessor.getRepresentation();
this.applicationEventPublisher.publishEvent(new RepresentationRefreshedEvent(this.editingContext.getId(), representation));
} catch (Exception exception) {
this.logger.warn(exception.getMessage(), exception);
}
this.refreshOtherRepresentations(changeDescription);
} catch (Exception exception) {
this.logger.warn(exception.getMessage(), exception);
}
this.refreshOtherRepresentations(changeDescription);

var timer = this.meterRegistry.timer(Monitoring.TIMER_REFRESH_REPRESENTATION, "changeDescription", changeDescription.getSourceId());
refreshRepresentationSample.stop(timer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ public Optional<Boolean> asBoolean() {

@Override
public String toString() {
return MessageFormat.format("Result { status: {0}, rawValue: {1}}", this.status, this.rawValue);
return MessageFormat.format("Result '{' status: {0}, rawValue: {1} '}'", this.status, this.rawValue);
}
}

0 comments on commit 740b7be

Please sign in to comment.