diff options
author | donald.g.dunne | 2017-12-07 17:08:41 +0000 |
---|---|---|
committer | donald.g.dunne | 2017-12-07 17:08:41 +0000 |
commit | c9d21266debdedae531d4327fb4eb3c3fcbde178 (patch) | |
tree | fc6df20f42d18cac6bf5650876f2b6953668a630 /plugins/org.eclipse.osee.framework.skynet.core | |
parent | 8eeeeb8bf216e3e5921b37c720f11cc518d1fb87 (diff) | |
download | org.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
Change-Id: I4c275a9bdbb816cbbacebbcb6bc12b9f63495db3
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.java | 11 |
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"); } } |