Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-06-27 13:27:37 -0400
committerRyan D. Brooks2017-07-26 16:55:29 -0400
commite53eaed2e8067a59671b4628616dd149fdb92676 (patch)
tree522a00237ec0508af127938ea1e3603f4424bc1f
parent00467ef9da2e86d4e0cdeb422b2bd7c916183c18 (diff)
downloadorg.eclipse.osee-e53eaed2e8067a59671b4628616dd149fdb92676.tar.gz
org.eclipse.osee-e53eaed2e8067a59671b4628616dd149fdb92676.tar.xz
org.eclipse.osee-e53eaed2e8067a59671b4628616dd149fdb92676.zip
refactor: Use ArtifactId in ArtifactQuery.getArtifactFromList
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/search/AtsArtifactQuery.java16
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionByIdAction.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionsAction.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java22
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorReloadProvider.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeTypeModifier.java7
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java9
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java18
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java12
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java4
14 files changed, 47 insertions, 95 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index e833d601ca..10f4665caa 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -508,12 +508,12 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
@Override
public Collection<ArtifactToken> getArtifacts(List<Long> ids) {
- List<Integer> intIds = new LinkedList<>();
+ List<ArtifactId> artifactIds = new ArrayList<>(ids.size());
for (Long id : ids) {
- intIds.add(id.intValue());
+ artifactIds.add(ArtifactId.valueOf(id));
}
return Collections.castAll(
- ArtifactQuery.getArtifactListFromIds(intIds, getAtsBranch(), DeletionFlag.EXCLUDE_DELETED));
+ ArtifactQuery.getArtifactListFrom(artifactIds, getAtsBranch(), DeletionFlag.EXCLUDE_DELETED));
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/search/AtsArtifactQuery.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/search/AtsArtifactQuery.java
index 94ae223360..15bba2cffa 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/search/AtsArtifactQuery.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/search/AtsArtifactQuery.java
@@ -77,18 +77,4 @@ public class AtsArtifactQuery {
public static Artifact getArtifactFromId(long uuid) {
return ArtifactQuery.getArtifactFromId(ArtifactId.valueOf(uuid), AtsClientService.get().getAtsBranch());
}
-
- public static List<Artifact> getArtifactListFromIds(List<Long> uuids) {
- List<Artifact> toReturn = new LinkedList<>();
- List<Integer> artIds = new LinkedList<>();
-
- for (Long uuid : uuids) {
- artIds.add(uuid.intValue());
- }
-
- List<Artifact> fromIds = ArtifactQuery.getArtifactListFromIds(artIds, AtsClientService.get().getAtsBranch());
- toReturn.addAll(fromIds);
- return toReturn;
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionByIdAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionByIdAction.java
index 3a02de1261..7acd746656 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionByIdAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionByIdAction.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
@@ -64,11 +65,11 @@ public class RevertDuplicateTransitionByIdAction extends Action {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
List<String> atsIds = new LinkedList<>();
- List<Integer> artIds = new LinkedList<>();
+ List<ArtifactId> artIds = new LinkedList<>();
for (String id : dialog.getEntry().split(",")) {
id = id.replaceAll(" ", "");
if (Strings.isNumeric(id)) {
- artIds.add(Integer.valueOf(id));
+ artIds.add(ArtifactId.valueOf(id));
} else {
atsIds.add(id);
}
@@ -78,7 +79,7 @@ public class RevertDuplicateTransitionByIdAction extends Action {
TransactionManager.createTransaction(AtsClientService.get().getAtsBranch(), getName());
boolean changed = false;
- for (Artifact art : ArtifactQuery.getArtifactListFromIds(artIds,
+ for (Artifact art : ArtifactQuery.getArtifactListFrom(artIds,
AtsClientService.get().getAtsBranch())) {
results.logf("\n\nReverting transition for %s\n\n", art.toStringWithId());
if (revertTransition(art, results, persist, trans)) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionsAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionsAction.java
index d604323729..529a0ccc6a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionsAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/RevertDuplicateTransitionsAction.java
@@ -21,6 +21,7 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.Operations;
@@ -60,13 +61,13 @@ public class RevertDuplicateTransitionsAction extends Action {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
- List<Integer> artIds = getArtIdsWithDuplicateTransitions();
+ List<ArtifactId> artIds = getArtIdsWithDuplicateTransitions();
XResultData results = new XResultData();
SkynetTransaction trans =
TransactionManager.createTransaction(AtsClientService.get().getAtsBranch(), getName());
boolean changed = false;
- for (Artifact art : ArtifactQuery.getArtifactListFromIds(artIds,
+ for (Artifact art : ArtifactQuery.getArtifactListFrom(artIds,
AtsClientService.get().getAtsBranch())) {
results.logf("\n\nReverting transition for %s\n\n", art.toStringWithId());
if (RevertDuplicateTransitionByIdAction.revertTransition(art, results, persist, trans)) {
@@ -92,12 +93,12 @@ public class RevertDuplicateTransitionsAction extends Action {
}
}
- protected List<Integer> getArtIdsWithDuplicateTransitions() {
- List<Integer> artIds = new LinkedList<>();
+ protected List<ArtifactId> getArtIdsWithDuplicateTransitions() {
+ List<ArtifactId> artIds = new LinkedList<>();
for (AttributeTypeId attrType : Arrays.asList(AtsAttributeTypes.CompletedDate, AtsAttributeTypes.CancelledDate)) {
for (IAtsWorkItem workItem : AtsClientService.get().getQueryService().getWorkItemsFromQuery(
DUPLICATE_TRANSITION_QUERY, AtsClientService.get().getAtsBranch().getId(), attrType.getId())) {
- artIds.add(workItem.getId().intValue());
+ artIds.add(ArtifactId.valueOf(workItem.getId()));
}
}
return artIds;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
index bd4984fc36..e1374f973b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -51,6 +51,7 @@ import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.world.WorldXNavigateItemAction;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.exception.BranchDoesNotExist;
import org.eclipse.osee.framework.core.model.type.AttributeType;
@@ -149,11 +150,10 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
int count = 0;
// Break artifacts into blocks so don't run out of memory
- List<Collection<Integer>> artIdLists = null;
// Un-comment to process whole Common branch - Normal Mode
// ElapsedTime elapsedTime = new ElapsedTime("ValidateAtsDatabase - load ArtIds");
- artIdLists = loadAtsBranchArtifactIds(xResultData, monitor);
+ List<Collection<ArtifactId>> artIdLists = loadAtsBranchArtifactIds(xResultData, monitor);
// elapsedTime.end();
// Un-comment to process specific artifact from common - Test Mode
@@ -177,14 +177,14 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
legacyPcrIdToParentId.clear();
// int artSetNum = 1;
- for (Collection<Integer> artIdList : artIdLists) {
+ for (Collection<ArtifactId> artIdList : artIdLists) {
// Don't process all lists if just trying to test this report
// elapsedTime =
// new ElapsedTime(String.format("ValidateAtsDatabase - load Artifact set %d/%d", artSetNum++,
// artIdLists.size()));
Date date = new Date();
Collection<Artifact> allArtifacts =
- ArtifactQuery.getArtifactListFromIds(artIdList, AtsClientService.get().getAtsBranch());
+ ArtifactQuery.getArtifactListFrom(artIdList, AtsClientService.get().getAtsBranch());
results.logTestTimeSpent(date, "ArtifactQuery.getArtifactListFromIds");
// elapsedTime.end();
@@ -503,8 +503,8 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
for (Artifact artifact : artifacts) {
try {
String workDefName = artifact.getSoleAttributeValue(AtsAttributeTypes.WorkflowDefinition, "");
- if (Strings.isValid(
- workDefName) && AtsClientService.get().getWorkDefinitionService().getWorkDefinition(workDefName) == null) {
+ if (Strings.isValid(workDefName) && AtsClientService.get().getWorkDefinitionService().getWorkDefinition(
+ workDefName) == null) {
results.log(artifact, "testAttributeSetWorkDefinitionsExist",
String.format(
"Error: ats.Work Definition attribute value [%s] not valid work definition for " + XResultDataUI.getHyperlink(
@@ -773,12 +773,12 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
results.logTestTimeSpent(date, "validateBranchUuid");
}
- public static List<Collection<Integer>> loadAtsBranchArtifactIds(XResultData xResultData, IProgressMonitor monitor) throws OseeCoreException {
+ public static List<Collection<ArtifactId>> loadAtsBranchArtifactIds(XResultData xResultData, IProgressMonitor monitor) throws OseeCoreException {
if (xResultData == null) {
xResultData = new XResultData();
}
xResultData.log(monitor, "testLoadAllCommonArtifactIds - Started " + DateUtil.getMMDDYYHHMM());
- List<Integer> artIds = getCommonArtifactIds(xResultData);
+ List<ArtifactId> artIds = getCommonArtifactIds(xResultData);
if (artIds.isEmpty()) {
xResultData.error("Error: Artifact load returned 0 artifacts to check");
}
@@ -786,14 +786,14 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
return Collections.subDivide(artIds, 4000);
}
- private static List<Integer> getCommonArtifactIds(XResultData xResultData) throws OseeCoreException {
- List<Integer> artIds = new ArrayList<>();
+ private static List<ArtifactId> getCommonArtifactIds(XResultData xResultData) throws OseeCoreException {
+ List<ArtifactId> artIds = new ArrayList<>();
xResultData.log(null, "getCommonArtifactIds - Started " + DateUtil.getMMDDYYHHMM());
JdbcStatement chStmt = ConnectionHandler.getStatement();
try {
chStmt.runPreparedQuery(SELECT_COMMON_ART_IDS, AtsClientService.get().getAtsBranch());
while (chStmt.next()) {
- artIds.add(chStmt.getInt(1));
+ artIds.add(ArtifactId.valueOf(chStmt.getLong(1)));
}
} finally {
chStmt.close();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
index 4eaaac027d..727ec25948 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.ats.core.util.VisitedItemCache;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -39,11 +40,11 @@ public class VisitedItems extends XNavigateItemAction {
@Override
public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
- List<Integer> artIds = new ArrayList<>();
+ List<ArtifactId> artIds = new ArrayList<>();
for (IAtsWorkItem workItem : getCache().getReverseVisited()) {
- artIds.add(new Long(workItem.getId()).intValue());
+ artIds.add(ArtifactId.valueOf(workItem.getId()));
}
- Collection<Artifact> artifacts = ArtifactQuery.getArtifactListFromIds(artIds, AtsClientService.get().getAtsBranch());
+ Collection<Artifact> artifacts = ArtifactQuery.getArtifactListFrom(artIds, AtsClientService.get().getAtsBranch());
WorldEditor.open(new WorldEditorSimpleProvider(getName(), artifacts, null, tableLoadOptions));
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorReloadProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorReloadProvider.java
index cef187f9f6..7948c0d99d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorReloadProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorReloadProvider.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ats.world;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.LinkedList;
import java.util.List;
import org.eclipse.nebula.widgets.xviewer.core.model.CustomizeData;
import org.eclipse.osee.ats.core.client.config.AtsBulkLoad;
@@ -99,11 +98,7 @@ public class WorldEditorReloadProvider extends WorldEditorProvider {
@Override
public Collection<Artifact> performSearch(SearchType searchType) {
if (searchType == SearchType.ReSearch) {
- List<Integer> ids = new LinkedList<>();
- for (Artifact art : artifacts) {
- ids.add(art.getArtId());
- }
- artifacts = ArtifactQuery.getArtifactListFromIds(ids, AtsClientService.get().getAtsBranch());
+ artifacts = ArtifactQuery.getArtifactListFrom(artifacts, AtsClientService.get().getAtsBranch());
}
return artifacts;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java
index 53989439cc..6892085c01 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java
@@ -11,8 +11,6 @@
package org.eclipse.osee.ats.world;
import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
import org.eclipse.nebula.widgets.xviewer.core.model.CustomizeData;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
@@ -65,12 +63,8 @@ public class WorldEditorSimpleProvider extends WorldEditorProvider {
@Override
public Collection<Artifact> performSearch(SearchType searchType) {
if (searchType == SearchType.ReSearch) {
- List<Integer> ids = new LinkedList<>();
- for (Artifact art : artifacts) {
- ids.add(art.getArtId());
- }
- artifacts = ArtifactQuery.getArtifactListFromIds(ids, AtsClientService.get().getAtsBranch());
+ artifacts = ArtifactQuery.getArtifactListFrom(artifacts, AtsClientService.get().getAtsBranch());
}
return artifacts;
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
index 28adece8a2..1b45325e28 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
@@ -37,10 +37,10 @@ import org.eclipse.osee.ats.util.widgets.dialog.AtsObjectNameSorter;
import org.eclipse.osee.ats.world.IWorldEditorConsumer;
import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -220,8 +220,8 @@ public class MultipleIdSearchOperation extends AbstractOperation implements IWor
// This does artId search
if (data.isIncludeArtIds() && data.getBranchForIncludeArtIds() != null) {
- for (Artifact art : ArtifactQuery.getArtifactListFromIds(Lib.stringToIntegerList(data.getEnteredIds()),
- data.getBranchForIncludeArtIds())) {
+ List<ArtifactId> artifactIds = Collections.fromString(data.getEnteredIds(), ArtifactId::valueOf);
+ for (Artifact art : ArtifactQuery.getArtifactListFrom(artifactIds, data.getBranchForIncludeArtIds())) {
artifacts.add(art);
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeTypeModifier.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeTypeModifier.java
index d960f4453e..e6f1b7987b 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeTypeModifier.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeTypeModifier.java
@@ -22,6 +22,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.osee.framework.core.client.OseeClientProperties;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.OrcsTypesConfig;
import org.eclipse.osee.framework.core.data.OrcsTypesData;
import org.eclipse.osee.framework.core.data.OrcsTypesSheet;
@@ -58,17 +59,17 @@ public class OseeTypeModifier implements AttributeModifier {
if (javax.ws.rs.core.Response.Status.OK.getStatusCode() != response.getStatus()) {
throw new OseeStateException("Error retrieving orcs types config " + response);
}
- List<Integer> artIds = new LinkedList<>();
+ List<ArtifactId> artIds = new LinkedList<>();
OrcsTypesConfig config = response.readEntity(OrcsTypesConfig.class);
for (OrcsTypesVersion version : config.getVersions()) {
if (OrcsTypesData.OSEE_TYPE_VERSION.intValue() == version.getVersionNum()) {
for (OrcsTypesSheet sheet : version.getSheets()) {
- artIds.add(new Long(sheet.getArtifactId()).intValue());
+ artIds.add(ArtifactId.valueOf(sheet.getArtifactId()));
}
}
}
- List<Artifact> artifacts = ArtifactQuery.getArtifactListFromIds(artIds, COMMON);
+ List<Artifact> artifacts = ArtifactQuery.getArtifactListFrom(artIds, COMMON);
StringBuilder combinedSheets = new StringBuilder();
for (Artifact art : artifacts) {
String sheetData;
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java
index 85761d2e37..85f92cfe5e 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java
@@ -505,15 +505,6 @@ public final class Lib {
public static final Pattern numberListPattern = Pattern.compile("\\d+");
- public static List<Integer> stringToIntegerList(String numberList) {
- ArrayList<Integer> ints = new ArrayList<>();
- Matcher transactionIdMatcher = numberListPattern.matcher(numberList);
- while (transactionIdMatcher.find()) {
- ints.add(Integer.parseInt(transactionIdMatcher.group()));
- }
- return ints;
- }
-
public static String fileToString(File file) throws IOException {
return new String(fileToChars(file, "UTF-8"));
}
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 a812ab2525..4ffdf63afe 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
@@ -263,15 +263,6 @@ public class ArtifactQuery {
*
* @return a collection of the artifacts found or an empty collection if none are found
*/
- public static List<Artifact> getArtifactListFromIds(Collection<Integer> artifactIds, BranchId branch) throws OseeCoreException {
- return ArtifactLoader.loadArtifactIds(artifactIds, branch, LoadLevel.ALL, INCLUDE_CACHE, INCLUDE_DELETED);
- }
-
- /**
- * search for un-deleted artifacts with any of the given artifact ids
- *
- * @return a collection of the artifacts found or an empty collection if none are found
- */
public static List<Artifact> getArtifactListFrom(Collection<? extends ArtifactId> artifactIds, BranchId branch) throws OseeCoreException {
return ArtifactLoader.loadArtifacts(artifactIds, branch, LoadLevel.ALL, INCLUDE_CACHE, INCLUDE_DELETED);
}
@@ -281,15 +272,6 @@ public class ArtifactQuery {
}
/**
- * search for artifacts with any of the given artifact ids
- *
- * @return a collection of the artifacts found or an empty collection if none are found
- */
- public static List<Artifact> getArtifactListFromIds(Collection<Integer> artifactIds, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException {
- return ArtifactLoader.loadArtifactIds(artifactIds, branch, LoadLevel.ALL, INCLUDE_CACHE, allowDeleted);
- }
-
- /**
* search for artifacts with any of the given artifact guids
*
* @return a collection of the artifacts found or an empty collection if none are found
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
index ff1f8d443c..600cd2777a 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
@@ -132,7 +132,7 @@ public class RelationManager {
} else {
relatedArtifacts = new ArrayList<>(selectedRelations.size());
- ArtifactQuery.getArtifactListFromIds(
+ ArtifactQuery.getArtifactListFrom(
getRelatedArtifactIds(selectedRelations, relationSide, DeletionFlag.EXCLUDE_DELETED), artifact.getBranch());
for (RelationLink relation : selectedRelations) {
@@ -154,12 +154,12 @@ public class RelationManager {
return relatedArtifacts;
}
- private static Collection<Integer> getRelatedArtifactIds(List<RelationLink> relations, RelationSide side, DeletionFlag allowDeleted) {
- Collection<Integer> ret = new HashSet<>();
+ private static Collection<ArtifactId> getRelatedArtifactIds(List<RelationLink> relations, RelationSide side, DeletionFlag allowDeleted) {
+ Collection<ArtifactId> ret = new HashSet<>();
if (relations != null) {
for (RelationLink rel : relations) {
if (allowDeleted == INCLUDE_DELETED || allowDeleted == EXCLUDE_DELETED && !rel.isDeleted()) {
- ret.add(rel.getArtifactId(side).getId().intValue());
+ ret.add(rel.getArtifactId(side));
}
}
}
@@ -176,7 +176,7 @@ public class RelationManager {
Set<Artifact> relatedArtifacts = new HashSet<>(artifacts.size() * 8);
Collection<Artifact> newArtifactsToSearch = new ArrayList<>(artifacts);
Collection<Artifact> newArtifacts = new ArrayList<>();
- Set<Integer> relatedArtIds = new HashSet<>();
+ Set<ArtifactId> relatedArtIds = new HashSet<>();
if (artifacts.isEmpty()) {
return relatedArtifacts;
}
@@ -219,7 +219,7 @@ public class RelationManager {
if (relatedArtIds.size() > 0) {
BranchId branch = artifacts.iterator().next().getBranch();
- newArtifacts = ArtifactQuery.getArtifactListFromIds(relatedArtIds, branch, allowDeleted);
+ newArtifacts = ArtifactQuery.getArtifactListFrom(relatedArtIds, branch, allowDeleted);
}
newArtifactsToSearch.clear();
newArtifactsToSearch.addAll(newArtifacts);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
index df7c25acea..b47788625a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
@@ -368,8 +368,8 @@ public class WordTemplateProcessor {
List<Artifact> artifacts = null;
if (Strings.isValid(artifactId)) {
- artifacts = ArtifactQuery.getArtifactListFromIds(Arrays.asList(Integer.valueOf(artifactId)), branch,
- EXCLUDE_DELETED);
+ List<ArtifactId> artIds = Arrays.asList(ArtifactId.valueOf(artifactId));
+ artifacts = ArtifactQuery.getArtifactListFrom(artIds, branch, EXCLUDE_DELETED);
} else if (Strings.isValid(artifactName)) {
artifacts = ArtifactQuery.getArtifactListFromName(artifactName, branch, EXCLUDE_DELETED);
} else if (Strings.isValid(orcsQuery)) {

Back to the top