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 <denis.nikif@gmail.com>
  • Loading branch information
AresEkb committed Dec 21, 2024
1 parent 188afb0 commit 3934198
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 @@ -65,6 +65,7 @@ This was first fixed in 2022.3.0 but broken in 2024.3.0; it is now fixed again.
+ Contribute the Ellipse node
+ Contribute the Selection Dialog
- https://github.com/eclipse-sirius/sirius-web/issues/4305[#4305] [table] Allow the deactivation of table features that are not used in some contexts
- 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 3934198

Please sign in to comment.