Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2018-10-18 14:04:47 -0400
committerDonald Dunne2018-10-18 15:44:48 -0400
commit23ef9f49d260c1b2c4342a5eae75638c5d11529e (patch)
tree239007897af6a365799507d57ad8aec2dfc06914
parentf98e5d0eb2e387f424ca551d41a070f79ec46d05 (diff)
downloadorg.eclipse.osee-23ef9f49d260c1b2c4342a5eae75638c5d11529e.tar.gz
org.eclipse.osee-23ef9f49d260c1b2c4342a5eae75638c5d11529e.tar.xz
org.eclipse.osee-23ef9f49d260c1b2c4342a5eae75638c5d11529e.zip
bug[ats_TW11475]: Fix OseeSystemArtifacts.getGlobalPreferenceArtifact performance
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreArtifactTokens.java1
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java13
2 files changed, 10 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreArtifactTokens.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreArtifactTokens.java
index 83e3293e10..3cd2f29642 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreArtifactTokens.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreArtifactTokens.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.framework.core.data.TokenFactory;
public final class CoreArtifactTokens {
// @formatter:off
+ public static ArtifactToken GlobalPreferences = TokenFactory.createArtifactToken(18026, "AAABE8T1j3AA8O7WNsu89A", CoreArtifactTypes.GlobalPreferences.getName(), CoreArtifactTypes.GlobalPreferences);
public static ArtifactToken XViewerGlobalCustomization = TokenFactory.createArtifactToken(78293, "AAABER+3rLwA8O7WMgtX1g", CoreArtifactTypes.XViewerGlobalCustomization.getName(), CoreArtifactTypes.XViewerGlobalCustomization);
public static ArtifactToken DefaultHierarchyRoot = TokenFactory.createArtifactToken(197818, "AEslkN+d4hWXjQvnZ1gA", "Default Hierarchy Root", CoreArtifactTypes.RootArtifact);
public static ArtifactToken UniversalGroupRoot = TokenFactory.createArtifactToken(60807, "AExdLMeOTGhhPY4CyvQA", "Root Artifact", CoreArtifactTypes.UniversalGroup);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java
index 0a86f9d73e..bf265a32c8 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.framework.core.data.ArtifactTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -31,8 +32,13 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
public final class OseeSystemArtifacts {
public static Artifact getGlobalPreferenceArtifact() throws OseeCoreException {
- return getCachedArtifact(CoreArtifactTypes.GlobalPreferences, CoreArtifactTypes.GlobalPreferences.getName(),
- COMMON);
+ Artifact artifact =
+ ArtifactQuery.getArtifactFromToken(CoreArtifactTokens.GlobalPreferences, COMMON, DeletionFlag.EXCLUDE_DELETED);
+ if (artifact == null) {
+ artifact = getCachedArtifact(CoreArtifactTypes.GlobalPreferences,
+ CoreArtifactTypes.GlobalPreferences.getName(), COMMON);
+ }
+ return artifact;
}
public static Artifact getDefaultHierarchyRootArtifact(BranchId branch) throws OseeCoreException {
@@ -40,8 +46,7 @@ public final class OseeSystemArtifacts {
}
public static Artifact createGlobalPreferenceArtifact() throws OseeCoreException {
- return ArtifactTypeManager.addArtifact(CoreArtifactTypes.GlobalPreferences, COMMON,
- CoreArtifactTypes.GlobalPreferences.getName());
+ return ArtifactTypeManager.addArtifact(CoreArtifactTokens.GlobalPreferences, COMMON);
}
/**

Back to the top