diff options
author | Angel Avila | 2017-08-15 20:55:42 +0000 |
---|---|---|
committer | Megumi Telles | 2017-08-17 13:45:24 +0000 |
commit | 1d5cea86ec9addd11e3d4699af4a4602a70dfd21 (patch) | |
tree | b50c611ed95c351061648a50d57fd516dd760792 | |
parent | 205e66249bb14f751e32cb76d90222dc19400c69 (diff) | |
download | org.eclipse.osee-1d5cea86ec9addd11e3d4699af4a4602a70dfd21.tar.gz org.eclipse.osee-1d5cea86ec9addd11e3d4699af4a4602a70dfd21.tar.xz org.eclipse.osee-1d5cea86ec9addd11e3d4699af4a4602a70dfd21.zip |
bug[ats_TW1674]: Fix Merge annotations create duplicates after inital merge
Change-Id: Id3eee4d53acc53fb3d4efae85fefc2a086387369
-rw-r--r-- | plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java index 09d1558ca64..3dbfe39315d 100644 --- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java +++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java @@ -119,7 +119,7 @@ public class DispoSetCopier { List<DispoAnnotationData> newAnnotations = newItem.getAnnotationsList(); List<DispoAnnotationData> sourceAnnotations = sourceItem.getAnnotationsList(); Set<String> destDefaultAnntationLocations = getDefaultAnnotations(newItem); - Map<String, Integer> placeHolderAnnotationLocations = getPlaceHolderAnnotations(newItem); + Map<String, Integer> nonDefaultAnnotationLocations = getNonDefaultAnnotations(newItem); List<String> destDiscrepanciesTextOnly = discrepanciesTextOnly(destItem.getDiscrepanciesList()); for (DispoAnnotationData sourceAnnotation : sourceAnnotations) { @@ -182,8 +182,8 @@ public class DispoSetCopier { isChangesMade = true; // Both the source and destination are dispositionable so copy the annotation int nextIndex; - if (placeHolderAnnotationLocations.containsKey(sourceLocation)) { - nextIndex = placeHolderAnnotationLocations.get(sourceLocation); + if (nonDefaultAnnotationLocations.containsKey(sourceLocation)) { + nextIndex = nonDefaultAnnotationLocations.get(sourceLocation); newAnnotation.setIndex(nextIndex); newAnnotations.set(nextIndex, newAnnotation); } else { @@ -248,19 +248,19 @@ public class DispoSetCopier { return newItem; } - private Map<String, Integer> getPlaceHolderAnnotations(DispoItemData item) { - Map<String, Integer> placeHolderAnnotationLocations = new HashMap<>(); + private Map<String, Integer> getNonDefaultAnnotations(DispoItemData item) { + Map<String, Integer> nonDefaultAnnotationLocations = new HashMap<>(); List<DispoAnnotationData> annotations = item.getAnnotationsList(); if (annotations == null) { annotations = new ArrayList<>(); } for (DispoAnnotationData annotation : annotations) { - if (!Strings.isValid(annotation.getResolutionType())) { - placeHolderAnnotationLocations.put(annotation.getLocationRefs(), annotation.getIndex()); + if (!annotation.getIsDefault()) { + nonDefaultAnnotationLocations.put(annotation.getLocationRefs(), annotation.getIndex()); } } - return placeHolderAnnotationLocations; + return nonDefaultAnnotationLocations; } private Set<String> getDefaultAnnotations(DispoItemData item) { |