Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2016-11-10 18:44:27 -0500
committerAngel Avila2017-02-17 15:11:25 -0500
commitfd23531612db02a56c42ab3298eb2d718bda5f5e (patch)
treed1c1d4fdc5a0afe1520d8e5dd2e4c8260847ce85
parentcb9a11d684a9c64c8742ea72e3f00533db9483a7 (diff)
downloadorg.eclipse.osee-fd23531612db02a56c42ab3298eb2d718bda5f5e.tar.gz
org.eclipse.osee-fd23531612db02a56c42ab3298eb2d718bda5f5e.tar.xz
org.eclipse.osee-fd23531612db02a56c42ab3298eb2d718bda5f5e.zip
bug: Fix Import and Merge issues with Coverage and Dispo
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java24
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java9
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java6
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmoImporter.java6
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/CoverageAdapter.java56
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java22
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/STRSReport.java3
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java24
-rw-r--r--plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/JdbcDbType.java3
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js5
13 files changed, 111 insertions, 53 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
index 1ecf6cef96..ff08278b1a 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
@@ -61,7 +61,7 @@ public interface DispoApi {
void copyDispoSet(DispoProgram program, DispoSet destination, DispoProgram sourceProgram, DispoSet sourceSet, CopySetParams params);
- void copyDispoSetCoverage(long sourceBranch, String sourceCoverageGuid, DispoProgram destDispProgram, DispoSet destination, CopySetParams params);
+ void copyDispoSetCoverage(long sourceBranch, Long sourceCoverageUuid, DispoProgram destDispProgram, DispoSet destination, CopySetParams params);
// Deletes
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
index efd7e6e8ef..8afb26a867 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
@@ -19,6 +19,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import org.eclipse.osee.disposition.model.CopySetParams;
import org.eclipse.osee.disposition.model.Discrepancy;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
@@ -356,11 +357,13 @@ public class DispoApiImpl implements DispoApi {
}
}
- if (itemsToCreate.size() > 0) {
- createDispoItems(program, setToEdit.getGuid(), itemsToCreate);
- }
- if (itemsToEdit.size() > 0) {
- editDispoItems(program, itemsToEdit, true, "Import");
+ if (!report.getStatus().isFailed()) {
+ if (itemsToCreate.size() > 0) {
+ createDispoItems(program, setToEdit.getGuid(), itemsToCreate);
+ }
+ if (itemsToEdit.size() > 0) {
+ editDispoItems(program, itemsToEdit, true, "Import");
+ }
}
} catch (Exception ex) {
@@ -419,8 +422,8 @@ public class DispoApiImpl implements DispoApi {
}
@Override
- public void copyDispoSetCoverage(long sourceBranch, String sourceCoverageGuid, DispoProgram destDispProgram, DispoSet destination, CopySetParams params) {
- Map<String, ArtifactReadable> coverageUnits = getQuery().getCoverageUnits(sourceBranch, sourceCoverageGuid);
+ public void copyDispoSetCoverage(long sourceBranch, Long sourceCoverageUuid, DispoProgram destDispProgram, DispoSet destination, CopySetParams params) {
+ Map<String, ArtifactReadable> coverageUnits = getQuery().getCoverageUnits(sourceBranch, sourceCoverageUuid);
List<DispoItem> destItems = getDispoItems(destDispProgram, destination.getGuid());
OperationReport report = new OperationReport();
@@ -429,12 +432,11 @@ public class DispoApiImpl implements DispoApi {
List<DispoItem> copyData = coverageAdapter.copyData(coverageUnits, destItems, report);
String operation =
- String.format("Copy From Legacy Coverage - Branch [%s] and Source Set [%s]", sourceBranch, sourceCoverageGuid);
+ String.format("Copy From Legacy Coverage - Branch [%s] and Source Set [%s]", sourceBranch, sourceCoverageUuid);
if (!copyData.isEmpty()) {
editDispoItems(destDispProgram, copyData, false, operation);
+ storageProvider.get().updateOperationSummary(getQuery().findUser(), destDispProgram, destination, report);
}
-
- storageProvider.get().updateOperationSummary(null, destDispProgram, destination, report);
}
@Override
@@ -474,9 +476,9 @@ public class DispoApiImpl implements DispoApi {
String.format("Copy Set from Program [%s] and Set [%s]", sourceProgram.getUuid(), sourceSet.getGuid());
if (!namesToToEditItems.isEmpty() && !report.getStatus().isFailed()) {
editDispoItems(program, namesToToEditItems.values(), false, operation);
+ storageProvider.get().updateOperationSummary(getQuery().findUser(), program, destination, report);
}
- storageProvider.get().updateOperationSummary(getQuery().findUser(), program, destination, report);
}
@Override
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java
index 814d03d201..2261b0b136 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoQuery.java
@@ -25,7 +25,7 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
*/
public interface DispoQuery {
- Map<String, ArtifactReadable> getCoverageUnits(long branchUuid, String artifactUuid);
+ Map<String, ArtifactReadable> getCoverageUnits(long branchUuid, Long artifactUuid);
ArtifactReadable findUser();
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
index 6e2530d099..528fdfefa1 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
@@ -541,9 +541,9 @@ public class OrcsStorageImpl implements Storage {
}
@Override
- public Map<String, ArtifactReadable> getCoverageUnits(long branchUuid, String artifactUuid) {
+ public Map<String, ArtifactReadable> getCoverageUnits(long branchUuid, Long artifactUuid) {
ArtifactReadable coveragePackage =
- getQuery().fromBranch(branchUuid).andGuid(artifactUuid).getResults().getOneOrNull();
+ getQuery().fromBranch(branchUuid).andUuid(artifactUuid).getResults().getOneOrNull();
List<ArtifactReadable> descendants = coveragePackage.getDescendants();
return getChildrenRecurse(descendants);
@@ -565,13 +565,14 @@ public class OrcsStorageImpl implements Storage {
@Override
public void updateOperationSummary(ArtifactReadable author, DispoProgram program, DispoSet set, OperationReport summary) {
+ OperationReport newReport = DispoUtil.cleanOperationReport(summary);
ArtifactReadable dispoSet = findDispoArtifact(program, set.getGuid(), DispoConstants.DispoSet);
TransactionBuilder tx =
getTxFactory().createTransaction(program.getUuid(), author, "Update Dispo Operation Report");
- tx.setSoleAttributeFromString(dispoSet, DispoConstants.ImportState, summary.getStatus().getName());
+ tx.setSoleAttributeFromString(dispoSet, DispoConstants.ImportState, newReport.getStatus().getName());
tx.setSoleAttributeFromString(dispoSet, DispoConstants.OperationSummary,
- DispoUtil.operationReportToString(summary));
+ DispoUtil.operationReportToString(newReport));
tx.commit();
}
}
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 3a20b47e3a..82e6ae045e 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
@@ -182,11 +182,13 @@ public class DispoSetCopier {
int nextIndex;
if (placeHolderAnnotationLocations.containsKey(sourceLocation)) {
nextIndex = placeHolderAnnotationLocations.get(sourceLocation);
+ newAnnotation.setIndex(nextIndex);
+ newAnnotations.set(nextIndex, newAnnotation);
} else {
nextIndex = newAnnotations.size();
+ newAnnotation.setIndex(nextIndex);
+ newAnnotations.add(nextIndex, newAnnotation);
}
- newAnnotation.setIndex(nextIndex);
- newAnnotations.add(nextIndex, newAnnotation);
}
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmoImporter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmoImporter.java
index 9cfcb1ebd8..b4790d9a6a 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmoImporter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmoImporter.java
@@ -75,14 +75,14 @@ public class TmoImporter implements DispoImporterApi {
future = executor.schedule(worker);
futures.add(future);
} catch (Exception ex) {
- logger.error(ex, "Unable to schedule worker");
+ report.addEntry("FATAL", ex.getLocalizedMessage(), DispoSummarySeverity.ERROR);
}
}
for (Future<List<DispoItem>> future : futures) {
try {
toReturn.addAll(future.get());
} catch (Exception ex) {
- logger.error(ex, "Unable to get future result");
+ report.addEntry("FATAL", ex.getLocalizedMessage(), DispoSummarySeverity.ERROR);
}
}
}
@@ -148,6 +148,8 @@ public class TmoImporter implements DispoImporterApi {
}
}
+ } catch (Exception ex) {
+ operationReport.addEntry("ALL", ex.getMessage(), DispoSummarySeverity.ERROR);
} finally {
Lib.close(inputStream);
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/CoverageAdapter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/CoverageAdapter.java
index 7d05377925..8530c926d3 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/CoverageAdapter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/CoverageAdapter.java
@@ -22,11 +22,13 @@ import org.eclipse.osee.disposition.model.Discrepancy;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.model.DispoItemData;
+import org.eclipse.osee.disposition.model.DispoStrings;
import org.eclipse.osee.disposition.model.OperationReport;
import org.eclipse.osee.disposition.rest.internal.DispoConnector;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.orcs.data.ArtifactReadable;
/**
@@ -92,25 +94,42 @@ public class CoverageAdapter {
String textFromCoverage = store.get("name").trim();
String lineNumberFromCoverage = store.get("order");
String resolutionFromCoverage = store.get("methodType").trim();
+ String rationale = store.get("rationale").trim();
+ if (!Strings.isValid(rationale)) {
+ rationale = "N/A";
+ }
Discrepancy matchedDiscrepancy = textToDiscrepancyMap.get(textFromCoverage);
if (!resolutionFromCoverage.equalsIgnoreCase("Test_Unit") && !resolutionFromCoverage.equalsIgnoreCase(
"Exception_Handling") && matchedDiscrepancy != null) {
madeChange = true;
- // Add Annotation
- DispoAnnotationData newAnnotation = new DispoAnnotationData();
- newAnnotation.setId(GUID.create());
- newAnnotation.setIsDefault(false);
- newAnnotation.setResolutionType(resolutionFromCoverage);
- newAnnotation.setIsResolutionValid(true);
- newAnnotation.setIndex(annotations.size());
- newAnnotation.setLocationRefs(lineNumberFromCoverage);
- newAnnotation.setCustomerNotes(textFromCoverage);
- newAnnotation.setResolution("n/a");
- newAnnotation.setDeveloperNotes("");
- dispoConnector.connectAnnotation(newAnnotation, dest.getDiscrepanciesList());
-
- annotations.add(newAnnotation.getIndex(), newAnnotation);
+ boolean isReplace = false;
+ DispoAnnotationData annotationToUpdate = findAnnotation(matchedDiscrepancy.getText(), annotations);
+ if (annotationToUpdate == null) {
+ annotationToUpdate = new DispoAnnotationData();
+ annotationToUpdate.setId(GUID.create());
+ annotationToUpdate.setIndex(annotations.size());
+ annotationToUpdate.setLocationRefs(lineNumberFromCoverage);
+ annotationToUpdate.setCustomerNotes(textFromCoverage);
+ }
+
+ if (!annotationToUpdate.getResolutionType().equals(
+ DispoStrings.Test_Unit_Resolution) && !annotationToUpdate.getResolutionType().equals(
+ DispoStrings.Exception_Handling_Resolution)) {
+
+ annotationToUpdate.setIsDefault(false);
+ annotationToUpdate.setResolutionType(resolutionFromCoverage);
+ annotationToUpdate.setIsResolutionValid(true);
+ annotationToUpdate.setResolution(rationale);
+ annotationToUpdate.setDeveloperNotes("");
+ dispoConnector.connectAnnotation(annotationToUpdate, dest.getDiscrepanciesList());
+
+ if (isReplace) {
+ annotations.set(annotationToUpdate.getIndex(), annotationToUpdate);
+ } else {
+ annotations.add(annotationToUpdate.getIndex(), annotationToUpdate);
+ }
+ }
} else if (matchedDiscrepancy == null) {
report.addEntry(source.getName(),
String.format("Could not find matching Discrepancy for [%s]", covearageItem), WARNING);
@@ -124,6 +143,15 @@ public class CoverageAdapter {
}
}
+ private DispoAnnotationData findAnnotation(String text, List<DispoAnnotationData> annotations) {
+ for (DispoAnnotationData annotation : annotations) {
+ if (annotation.getCustomerNotes().equals(text)) {
+ return annotation;
+ }
+ }
+ return null;
+ }
+
private Map<String, Discrepancy> getTextToDiscrepancyMap(DispoItem dest) {
Map<String, Discrepancy> toReturn = new HashMap<>();
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java
index c88f446ad2..203c5c2207 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java
@@ -170,7 +170,7 @@ public class LisFileParser implements DispoImporterApi {
text = matchingDiscrepancy.getText();
Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList();
discrepancies.remove(matchingDiscrepancy.getId());
- addAnnotationForForCoveredLine(item, line, Exception_Handling_Resolution, "", text);
+ addAnnotationForForCoveredLine(item, line, Exception_Handling_Resolution, text, "");
}
}
}
@@ -335,16 +335,18 @@ public class LisFileParser implements DispoImporterApi {
if (m.find()) {
if (!alreadyUsedDatIds.contains(resultsLine)) {
DispoItemData item = datIdToItem.get(generateDatId(m.group(1), m.group(2)));
- String location = m.group(3);
- String text = "";
- Discrepancy matchingDiscrepancy = matchDiscrepancy(location, item.getDiscrepanciesList());
- if (matchingDiscrepancy != null) {
- text = matchingDiscrepancy.getText();
- Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList();
- discrepancies.remove(matchingDiscrepancy.getId());
- addAnnotationForForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text);
+ if (item != null) {
+ String location = m.group(3);
+ String text = "";
+ Discrepancy matchingDiscrepancy = matchDiscrepancy(location, item.getDiscrepanciesList());
+ if (matchingDiscrepancy != null) {
+ text = matchingDiscrepancy.getText();
+ Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList();
+ discrepancies.remove(matchingDiscrepancy.getId());
+ addAnnotationForForCoveredLine(item, location, Test_Unit_Resolution, text, resultPath);
+ }
+ alreadyUsedDatIds.add(resultsLine);
}
- alreadyUsedDatIds.add(resultsLine);
}
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/STRSReport.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/STRSReport.java
index 3ddaebe8cb..c7dcbcd9f7 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/STRSReport.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/STRSReport.java
@@ -15,6 +15,7 @@ import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
+
import org.eclipse.osee.disposition.model.DispoAnnotationData;
import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.model.DispoProgram;
@@ -166,7 +167,7 @@ public class STRSReport {
String[] locationsRefsArray = locationRefs.split(",");
int toReturn = 0;
for (int i = 0; i < locationsRefsArray.length; i++) {
- String singleRef = locationsRefsArray[i];
+ String singleRef = locationsRefsArray[i].trim();
if (singleRef.contains("-")) {
String[] split = singleRef.split("-");
int gap = Integer.valueOf(split[1]) - Integer.valueOf(split[0]);
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
index df8fba9a75..66b2a463eb 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
@@ -110,7 +110,7 @@ public class DispoAdminResource {
@RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- public Response getDispoSetCopyCoverage(@QueryParam("destinationSet") String destinationSet, @QueryParam("sourceBranch") Long sourceBranch, @QueryParam("sourcePackage") String sourcePackage, CopySetParams params) {
+ public Response getDispoSetCopyCoverage(@QueryParam("destinationSet") String destinationSet, @QueryParam("sourceBranch") Long sourceBranch, @QueryParam("sourcePackage") Long sourcePackage, CopySetParams params) {
Response.Status status;
final DispoSet destination = dispoApi.getDispoSetById(program, destinationSet);
dispoApi.copyDispoSetCoverage(sourceBranch, sourcePackage, program, destination, params);
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 9a222fbb40..7f103baa5b 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
@@ -16,6 +16,7 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+
import org.eclipse.osee.disposition.model.Discrepancy;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
import org.eclipse.osee.disposition.model.DispoConfig;
@@ -41,8 +42,7 @@ import org.json.JSONObject;
*/
public final class DispoUtil {
- private static final Pattern pattern =
- Pattern.compile("^\\s*-?\\d+\\s*(-?\\s*-?\\d+\\s*)?(,\\s*-?\\d+\\s*(-?\\s*-?\\d+\\s*)?)*$");
+ private static final Pattern pattern = Pattern.compile("^[,\\d-\\s]+$");
private DispoUtil() {
//
@@ -63,7 +63,7 @@ public final class DispoUtil {
}
public static boolean isNumericLocations(String str) {
- Matcher matcher = pattern.matcher(str);
+ Matcher matcher = pattern.matcher(str.trim());
return matcher.matches();
}
@@ -72,6 +72,21 @@ public final class DispoUtil {
return reportAsJson.toString();
}
+ public static OperationReport cleanOperationReport(OperationReport origReport) {
+ OperationReport newRerport = new OperationReport();
+ if (origReport.getStatus().isFailed()) {
+ List<OperationSummaryEntry> entries = origReport.getEntries();
+ for (OperationSummaryEntry entry : entries) {
+ if (DispoSummarySeverity.ERROR.equals(entry.getSeverity())) {
+ newRerport.addEntry(entry.getName(), entry.getMessage(), entry.getSeverity());
+ }
+ }
+ return newRerport;
+ } else {
+ return origReport;
+ }
+ }
+
public static DispoAnnotationData getById(List<DispoAnnotationData> list, String id) {
for (DispoAnnotationData annotation : list) {
if (annotation.getId().equals(id)) {
@@ -307,9 +322,8 @@ public final class DispoUtil {
List<OperationSummaryEntry> entries = new ArrayList<>();
try {
- JSONArray entriesJson = jObj.getJSONArray("entries");
-
if (jObj.has("entries")) {
+ JSONArray entriesJson = jObj.getJSONArray("entries");
for (int i = 0; i < entriesJson.length(); i++) {
JSONObject entryAsJson = entriesJson.getJSONObject(i);
OperationSummaryEntry entry = jsonObjToOperationSummaryEntry(entryAsJson);
diff --git a/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/JdbcDbType.java b/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/JdbcDbType.java
index 428549a586..ba45863165 100644
--- a/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/JdbcDbType.java
+++ b/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/JdbcDbType.java
@@ -25,6 +25,7 @@ public class JdbcDbType extends BaseId {
public static final JdbcDbType mysql = new JdbcDbType(4);
public static final JdbcDbType postgresql = new JdbcDbType(5);
public static final JdbcDbType hsql = new JdbcDbType(6);
+ public static final JdbcDbType sqlite = new JdbcDbType(7);
private final boolean hintsSupported;
@@ -58,6 +59,8 @@ public class JdbcDbType extends BaseId {
dbType = postgresql;
} else if (lowerCaseName.contains("hsql")) {
dbType = hsql;
+ } else if (lowerCaseName.contains("sqlite")) {
+ dbType = sqlite;
} else {
throw newJdbcException("Unsupported database type [%s] ", dbName);
}
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js
index 2fa862d38f..2b599cf99b 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js
@@ -553,7 +553,10 @@ app.controller('userController', [
var discrepancies = $scope.selectedItem.discrepancies;
var covered = annotation.idsOfCoveredDiscrepancies[0]
- return discrepancies[covered].text;
+ if(!discrepancies[covered] == null)
+ return discrepancies[covered].text;
+ else
+ return "";
} else {
return annotation.customerNotes;
}

Back to the top