Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2017-08-15 16:55:42 -0400
committerMegumi Telles2017-08-17 09:45:24 -0400
commit1d5cea86ec9addd11e3d4699af4a4602a70dfd21 (patch)
treeb50c611ed95c351061648a50d57fd516dd760792
parent205e66249bb14f751e32cb76d90222dc19400c69 (diff)
downloadorg.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
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java16
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 09d1558ca6..3dbfe39315 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) {

Back to the top