Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-12-07 17:08:41 +0000
committerdonald.g.dunne2017-12-07 17:08:41 +0000
commitc9d21266debdedae531d4327fb4eb3c3fcbde178 (patch)
treefc6df20f42d18cac6bf5650876f2b6953668a630 /plugins/org.eclipse.osee.framework.skynet.core
parent8eeeeb8bf216e3e5921b37c720f11cc518d1fb87 (diff)
downloadorg.eclipse.osee-c9d21266debdedae531d4327fb4eb3c3fcbde178.tar.gz
org.eclipse.osee-c9d21266debdedae531d4327fb4eb3c3fcbde178.tar.xz
org.eclipse.osee-c9d21266debdedae531d4327fb4eb3c3fcbde178.zip
bug[ats_TW5269]: Exception generating tasks for RPCR 22658
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
index 2337d63574a..146c8e3b42b 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
@@ -136,11 +136,20 @@ public class ArtifactQuery {
return getOrCheckArtifactFromId(artId, branch, allowDeleted, QueryType.GET);
}
+ public static Artifact getArtifactFromIdOrNull(int artId, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException {
+ return getOrCheckArtifactFromId(artId, branch, allowDeleted, QueryType.GET, false);
+ }
+
public static Artifact getArtifactFromId(Long artId, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException {
return getOrCheckArtifactFromId(artId.intValue(), branch, allowDeleted, QueryType.GET);
}
private static Artifact getOrCheckArtifactFromId(int artId, BranchId branch, DeletionFlag allowDeleted, QueryType queryType) throws OseeCoreException {
+ return getOrCheckArtifactFromId(artId, branch, allowDeleted, queryType, true);
+
+ }
+
+ private static Artifact getOrCheckArtifactFromId(int artId, BranchId branch, DeletionFlag allowDeleted, QueryType queryType, boolean exceptionIfNotFound) throws OseeCoreException {
if (artId < 1) {
throw new OseeArgumentException("Invalid Artifact Id: [%d]", artId);
}
@@ -149,7 +158,7 @@ public class ArtifactQuery {
if (artifact.isDeleted() && allowDeleted == EXCLUDE_DELETED) {
if (queryType == QueryType.CHECK) {
artifact = null;
- } else {
+ } else if (exceptionIfNotFound) {
throw new ArtifactDoesNotExist("Deleted artifact unexpectedly returned");
}
}

Back to the top