Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-07-26 16:48:22 -0400
committerdonald.g.dunne2017-08-02 14:40:21 -0400
commitf171a53bfd51b1c42dc2cd6840a87864a3b60e65 (patch)
tree993630e04dad45bb95dfe3f3a89c645d8e8792c9
parenta244348063d25b0d27b99e86dea4ff6986c2670e (diff)
downloadorg.eclipse.osee-f171a53bfd51b1c42dc2cd6840a87864a3b60e65.tar.gz
org.eclipse.osee-f171a53bfd51b1c42dc2cd6840a87864a3b60e65.tar.xz
org.eclipse.osee-f171a53bfd51b1c42dc2cd6840a87864a3b60e65.zip
refinement: Remove un-necessary and un-used methods in AtsUtilClient
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java43
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java3
2 files changed, 1 insertions, 45 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
index 1640eb9234..d67bc49ea6 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.ats.core.client.util;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import java.util.Map.Entry;
import java.util.logging.Level;
@@ -23,14 +22,10 @@ import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
-import org.eclipse.osee.framework.core.data.ArtifactToken;
-import org.eclipse.osee.framework.core.enums.Active;
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.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactTypeEventFilter;
import org.eclipse.osee.framework.skynet.core.event.filter.BranchUuidEventFilter;
import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
@@ -80,45 +75,7 @@ public class AtsUtilClient {
return commonBranchUuidEventFilter;
}
- /**
- * TODO Remove duplicate Active flags, need to convert all ats.Active to Active in DB
- *
- * @param artifacts to iterate through
- * @param active state to validate against; Both will return all artifacts matching type
- * @param clazz type of artifacts to consider; null for all
- * @return set of Artifacts of type clazz that match the given active state of the "Active" or "ats.Active" attribute
- * value. If no attribute exists, Active == true;
- */
- @SuppressWarnings("unchecked")
- public static <A extends Artifact> List<A> getActive(Collection<A> artifacts, Active active, Class<? extends Artifact> clazz) throws OseeCoreException {
- List<A> results = new ArrayList<>();
- Collection<? extends Artifact> artsOfClass =
- clazz != null ? Collections.castMatching(clazz, artifacts) : artifacts;
- for (Artifact art : artsOfClass) {
- if (active == Active.Both) {
- results.add((A) art);
- } else {
- // assume active unless otherwise specified
- boolean attributeActive = ((A) art).getSoleAttributeValue(AtsAttributeTypes.Active, false);
- if (active == Active.Active && attributeActive) {
- results.add((A) art);
- } else if (active == Active.InActive && !attributeActive) {
- results.add((A) art);
- }
- }
- }
- return results;
- }
- public static Artifact getFromToken(ArtifactToken token) {
- Artifact toReturn = null;
- try {
- toReturn = ArtifactQuery.getArtifactFromId(token, AtsClientService.get().getAtsBranch());
- } catch (OseeCoreException ex) {
- // Do Nothing;
- }
- return toReturn;
- }
public synchronized static List<IEventFilter> getAtsObjectEventFilters() {
try {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java
index 366180c0c4..f038d29778 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java
@@ -29,7 +29,6 @@ import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.internal.Activator;
@@ -209,7 +208,7 @@ public class AtsConfigOperation extends AbstractOperation {
String workDefXml = AtsClientService.get().getWorkDefinitionService().getStorageString(workDef, resultData);
workDefArt = AtsWorkDefinitionImporter.get().importWorkDefinitionToDb(workDefXml, workDef.getName(), name,
null, resultData, changes);
- Artifact folder = AtsUtilClient.getFromToken(AtsArtifactToken.WorkDefinitionsFolder);
+ Artifact folder = AtsClientService.get().getArtifact(AtsArtifactToken.WorkDefinitionsFolder);
folder.addChild(workDefArt);
changes.add(folder);
} catch (Exception ex) {

Back to the top