Skip to content

Commit

Permalink
Merge pull request #814 from andrewL-avlq/ACF-11547
Browse files Browse the repository at this point in the history
Only perform detailed diff when both old and new resource descriptions exist.
  • Loading branch information
andrewL-avlq authored Oct 25, 2023
2 parents a6c308c + e8cd035 commit a1f117f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.Constants;
Expand Down Expand Up @@ -243,14 +243,14 @@ protected Set<URI> getAffectedResources(final Collection<Delta> deltas, final Pr

for (Delta delta : deltas) {
if (delta.haveEObjectDescriptionsChanged()) {
if (delta instanceof ResourceDescriptionDelta && ((ResourceDescriptionDelta) delta).hasObjectFingerprints()) {
IResourceDescription oldDesc = delta.getOld();
IResourceDescription newDesc = delta.getNew();
if (oldDesc != null && newDesc != null && delta instanceof ResourceDescriptionDelta && ((ResourceDescriptionDelta) delta).hasObjectFingerprints()) {
ResourceDescriptionDelta detailedDelta = (ResourceDescriptionDelta) delta;
changedOrDeletedObjects.addAll(detailedDelta.getChangedObjects());
changedOrDeletedObjects.addAll(detailedDelta.getDeletedObjects());
addedObjects.putAll(containersState.getContainerHandle(delta.getUri()), detailedDelta.getAddedObjects());
} else {
IResourceDescription oldDesc = delta.getOld();
IResourceDescription newDesc = delta.getNew();
if (oldDesc != null) {
changedOrDeletedResources.add(newDesc != null ? newDesc : oldDesc);
} else {
Expand Down

0 comments on commit a1f117f

Please sign in to comment.