Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangel.avila22018-08-20 01:49:50 -0400
committerangel.avila22018-08-20 01:49:50 -0400
commit9bbae056745987198bbeb6766fa890a90abf1092 (patch)
tree4e7d5a4f2ceceb827d6b6141ea4a5e32423f9326
parent07f6a3dda3a669b792ee5a857f082902052127c3 (diff)
downloadorg.eclipse.osee-dispo_analyze.tar.gz
org.eclipse.osee-dispo_analyze.tar.xz
org.eclipse.osee-dispo_analyze.zip
bug: add analyzedispo_analyze
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoAnnotationData.java9
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoConnector.java35
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java3
4 files changed, 38 insertions, 10 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoAnnotationData.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoAnnotationData.java
index 626a91d617..24074077ca 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoAnnotationData.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoAnnotationData.java
@@ -34,6 +34,7 @@ public class DispoAnnotationData implements Identifiable<String> {
private boolean isResolutionValid;
private String resolutionType;
private boolean isDefault;
+ private boolean isAnalyze;
public DispoAnnotationData() {
@@ -93,6 +94,10 @@ public class DispoAnnotationData implements Identifiable<String> {
return isDefault;
}
+ public boolean getIsAnalyze() {
+ return isAnalyze;
+ }
+
public void setLocationRefs(String locationRefs) {
this.locationRefs = locationRefs;
}
@@ -137,6 +142,10 @@ public class DispoAnnotationData implements Identifiable<String> {
this.isDefault = isDefault;
}
+ public void setIsAnalyze(boolean isAnalyzed) {
+ this.isAnalyze = isAnalyzed;
+ }
+
public boolean isValid() {
return (isConnected || isDefault) && isResolutionValid && isResolutionTypeValid();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
index 66cfa748de..bada71e3fd 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
@@ -43,6 +43,7 @@ public class DispoStrings {
public static final String Item_Pass = "PASS";
public static final String Item_Complete = "COMPLETE";
public static final String Item_InComplete = "INCOMPLETE";
+ public static final String Item_Analyzed = "ANALYZED";
public static final String Operation_Import = "Import";
public static final String Operation_MassSendStatus = "MassSendDispoItemStatus";
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoConnector.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoConnector.java
index 0091a0258c..f58df80157 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoConnector.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoConnector.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.disposition.rest.internal;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -68,24 +69,38 @@ public class DispoConnector {
if (item.getDiscrepanciesList().size() == 0) {
toReturn = DispoStrings.Item_Pass;
- } else if (allAnnotationsValid(annotations) && allUncoveredDiscprepancies.isEmpty()) {
- toReturn = DispoStrings.Item_Complete;
} else {
- toReturn = DispoStrings.Item_InComplete;
+ Collection<DispoAnnotationData> defaultAnnotations = new HashSet<>();
+ Collection<DispoAnnotationData> invalidAnotations = new HashSet<>();
+ Collection<DispoAnnotationData> analyzeAnnotations = new HashSet<>();
+ parseThroughAnnotations(annotations, defaultAnnotations, invalidAnotations, analyzeAnnotations);
+
+ if (invalidAnotations.isEmpty() && allUncoveredDiscprepancies.isEmpty()) {
+ if (analyzeAnnotations.isEmpty()) {
+ toReturn = DispoStrings.Item_Complete;
+ } else {
+ toReturn = DispoStrings.Item_Analyzed;
+ }
+ } else {
+ toReturn = DispoStrings.Item_InComplete;
+ }
}
return toReturn;
}
- private boolean allAnnotationsValid(List<DispoAnnotationData> annotations) {
- if (annotations != null) {
- for (DispoAnnotationData annotation : annotations) {
- if (!annotation.getIsDefault() && !annotation.isValid()) {
- return false;
- }
+ private void parseThroughAnnotations(Collection<DispoAnnotationData> annotations, Collection<DispoAnnotationData> defaultAnnotations, Collection<DispoAnnotationData> invalidAnnotations, Collection<DispoAnnotationData> analyzeAnnotations) {
+ for (DispoAnnotationData annotation : annotations) {
+ if (annotation.getIsDefault()) {
+ defaultAnnotations.add(annotation);
+ }
+ if (!annotation.isValid()) {
+ invalidAnnotations.add(annotation);
+ }
+ if (annotation.getIsAnalyze()) {
+ analyzeAnnotations.add(annotation);
}
}
- return true;
}
private ArrayList<String> createDiscrepanciesList(Map<String, Discrepancy> discrepancies) {
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
index 3b7d2eb690..28222225f8 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
@@ -403,6 +403,9 @@ public final class DispoUtil {
if (object.has("isValid")) {
dispoAnnotation.setIsConnected(object.getBoolean("isValid"));
}
+ if (object.has("isAnalyzed")) {
+ dispoAnnotation.setIsAnalyze(object.getBoolean("isAnalyze"));
+ }
if (object.has("developerNotes")) {
dispoAnnotation.setDeveloperNotes(object.getString("developerNotes"));
}

Back to the top