Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2018-05-31 15:18:30 -0400
committerdonald.g.dunne2018-06-04 18:13:27 -0400
commitd1ee67f25e84d910a9ea32a119ca5467e443abbf (patch)
treef8f946921af2f89a82d97a9266de30160fdacaf1
parent691bcdb144e8a7ac5b8c2faec2ed0b207133075a (diff)
downloadorg.eclipse.osee-d1ee67f25e84d910a9ea32a119ca5467e443abbf.tar.gz
org.eclipse.osee-d1ee67f25e84d910a9ea32a119ca5467e443abbf.tar.xz
org.eclipse.osee-d1ee67f25e84d910a9ea32a119ca5467e443abbf.zip
refactor: Remove guid from ArtifactTypeManager
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/internal/AtsStoreService.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java24
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeProvider.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/ArtifactChangeAcquirer.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/RelationChangeAcquirer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerDragAndDrop.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchOptionComposite.java2
8 files changed, 15 insertions, 28 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/internal/AtsStoreService.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/internal/AtsStoreService.java
index 75fbea784e..742024b85e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/internal/AtsStoreService.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/internal/AtsStoreService.java
@@ -160,7 +160,7 @@ public class AtsStoreService implements IAtsStoreService {
@Override
public IArtifactType getArtifactType(Long artTypeId) {
- return ArtifactTypeManager.getTypeByGuid(artTypeId);
+ return ArtifactTypeManager.getType(artTypeId);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
index 4b2f295192..6c8c8f8ef7 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
@@ -98,28 +98,16 @@ public class ArtifactTypeManager {
return getCache().getAll();
}
- /**
- * @return Returns the artifact type matching the id
- * @param id artifact type guid to match
- */
public static ArtifactType getType(Long id) {
- return getTypeByGuid(id);
- }
-
- /**
- * @return Returns the artifact type matching the guid
- * @param guid artifact type guid to match
- */
- public static ArtifactType getTypeByGuid(Long guid) {
- if (guid == null) {
- throw new OseeArgumentException("[%s] is not a valid guid", guid);
+ if (id == null) {
+ throw new OseeArgumentException("[%s] is not a valid guid", id);
}
- ArtifactType artifactType = getCache().getByGuid(guid);
+ ArtifactType artifactType = getCache().getByGuid(id);
if (artifactType == null) {
getCacheService().reloadTypes();
- artifactType = getCache().getByGuid(guid);
+ artifactType = getCache().getByGuid(id);
if (artifactType == null) {
- throw new OseeTypeDoesNotExist("Artifact type [%s] is not available.", guid);
+ throw new OseeTypeDoesNotExist("Artifact type [%s] is not available.", id);
}
}
return artifactType;
@@ -137,7 +125,7 @@ public class ArtifactTypeManager {
if (artifactType instanceof ArtifactType) {
return (ArtifactType) artifactType;
}
- return getTypeByGuid(artifactType.getId());
+ return getType(artifactType.getId());
}
public static boolean inheritsFrom(ArtifactTypeId artifactType, ArtifactTypeId... parentTypes) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeProvider.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeProvider.java
index 906307fb57..8ebef75c6c 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeProvider.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeProvider.java
@@ -26,7 +26,7 @@ public class ArtifactTypeProvider implements IArtifactTypeProvider {
@Override
public IArtifactType getTypeByGuid(Long artTypeGuid) {
- return ArtifactTypeManager.getTypeByGuid(artTypeGuid);
+ return ArtifactTypeManager.getType(artTypeGuid);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/ArtifactChangeAcquirer.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/ArtifactChangeAcquirer.java
index 002ce53594..1e3aee8047 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/ArtifactChangeAcquirer.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/ArtifactChangeAcquirer.java
@@ -78,9 +78,9 @@ public class ArtifactChangeAcquirer extends ChangeAcquirer {
int artId = chStmt.getInt("art_id");
ModificationType modificationType = ModificationType.valueOf(chStmt.getInt("mod_type"));
- ArtifactChangeBuilder artifactChangeBuilder = new ArtifactChangeBuilder(getSourceBranch(),
- ArtifactTypeManager.getTypeByGuid(chStmt.getLong("art_type_id")),
- GammaId.valueOf(chStmt.getLong("gamma_id")), artId, txDelta, modificationType, !hasBranch);
+ ArtifactChangeBuilder artifactChangeBuilder =
+ new ArtifactChangeBuilder(getSourceBranch(), ArtifactTypeManager.getType(chStmt.getLong("art_type_id")),
+ GammaId.valueOf(chStmt.getLong("gamma_id")), artId, txDelta, modificationType, !hasBranch);
getArtIds().add(artId);
getChangeBuilders().add(artifactChangeBuilder);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/RelationChangeAcquirer.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/RelationChangeAcquirer.java
index ea0d8e228b..6d7a6f2afc 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/RelationChangeAcquirer.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/RelationChangeAcquirer.java
@@ -83,7 +83,7 @@ public class RelationChangeAcquirer extends ChangeAcquirer {
getArtIds().add(bArtId);
getChangeBuilders().add(new RelationChangeBuilder(getSourceBranch(),
- ArtifactTypeManager.getTypeByGuid(chStmt.getLong("art_type_id")),
+ ArtifactTypeManager.getType(chStmt.getLong("art_type_id")),
GammaId.valueOf(chStmt.getLong("gamma_id")), aArtId, txDelta, modificationType,
ArtifactId.valueOf(bArtId), relLinkId, rationale,
RelationTypeManager.getTypeByGuid(chStmt.getLong("rel_link_type_id")), !hasBranch));
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
index eaf2a9e887..c33529fc48 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
@@ -126,8 +126,7 @@ public class FrameworkArtifactImageProvider extends ArtifactImageProvider {
// get artifact type
IArtifactType artifactType = null;
if (Strings.isNumeric(dynamicImage.getArtifactTypeUuid())) {
- artifactType =
- ArtifactTypeManager.getTypeByGuid(Long.valueOf(dynamicImage.getArtifactTypeUuid()));
+ artifactType = ArtifactTypeManager.getType(Long.valueOf(dynamicImage.getArtifactTypeUuid()));
}
if (artifactType == null && Strings.isValid(dynamicImage.getArtifactTypeName())) {
artifactType = ArtifactTypeManager.getType(dynamicImage.getArtifactTypeName());
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerDragAndDrop.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerDragAndDrop.java
index e269245db1..bac99fc4a1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerDragAndDrop.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerDragAndDrop.java
@@ -290,7 +290,7 @@ public class ArtifactExplorerDragAndDrop extends SkynetDragAndDrop {
JsonUtil.getMapper().readValue(fromJson, new TypeReference<List<JsonArtifactRepresentation>>() { //
});
for (JsonArtifactRepresentation item : reqts) {
- Artifact art = ArtifactTypeManager.addArtifact(ArtifactTypeManager.getTypeByGuid(item.getArtifactTypeId()),
+ Artifact art = ArtifactTypeManager.addArtifact(ArtifactTypeManager.getType(item.getArtifactTypeId()),
parentArtifact.getBranch(), item.getName());
List<JsonAttributeRepresentation> attrs = item.getAttrs();
for (JsonAttributeRepresentation attr : attrs) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchOptionComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchOptionComposite.java
index 54c3b990d3..5e72595e0e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchOptionComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchOptionComposite.java
@@ -601,7 +601,7 @@ public class QuickSearchOptionComposite extends Composite {
for (String entry : items) {
try {
Long id = Long.parseLong(entry);
- ArtifactType type = ArtifactTypeManager.getTypeByGuid(id);
+ ArtifactType type = ArtifactTypeManager.getType(id);
configuration.add(type);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);

Back to the top