Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2008-05-12 22:45:44 +0000
committerrbrooks2008-05-12 22:45:44 +0000
commit0ac397b7465ec8763f99d86048da889002e82c94 (patch)
treeff87fc7b9daa567d40317dbe24c1fc5fc5a16da2 /org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java
parent43316766f1bba076c5b4829df971a094329be386 (diff)
downloadorg.eclipse.osee-0ac397b7465ec8763f99d86048da889002e82c94.tar.gz
org.eclipse.osee-0ac397b7465ec8763f99d86048da889002e82c94.tar.xz
org.eclipse.osee-0ac397b7465ec8763f99d86048da889002e82c94.zip
Improve the performance of the search API [094QS]
Diffstat (limited to 'org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java')
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java
index f9f49276fea..aa92138a34d 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java
@@ -19,8 +19,8 @@ import java.util.LinkedList;
import java.util.Set;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeType;
+import org.eclipse.osee.framework.skynet.core.util.MultipleAttributesExist;
import org.eclipse.osee.framework.ui.skynet.Import.RoughArtifact.NameAndVal;
import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
@@ -41,8 +41,7 @@ public class RootAndAttributeBasedArtifactResolver extends NewArtifactImportReso
if (identifyingAttributeDescriptors.isEmpty()) throw new IllegalArgumentException(
"identifyingAttributeDescriptors can not be empty");
- this.identifyingAttributeDescriptors =
- new LinkedList<AttributeType>(identifyingAttributeDescriptors);
+ this.identifyingAttributeDescriptors = new LinkedList<AttributeType>(identifyingAttributeDescriptors);
this.createNewIfNotExist = createNewIfNotExist;
}
@@ -54,20 +53,20 @@ public class RootAndAttributeBasedArtifactResolver extends NewArtifactImportReso
roughAttributeMap.put(roughAttribute.getName(), roughAttribute.getValue());
}
- for (AttributeType descriptor : identifyingAttributeDescriptors) {
- Collection<Attribute<String>> attributes = artifact.getAttributeManager(descriptor).getAttributes();
- Collection<String> roughAttributes = roughAttributeMap.getValues(descriptor.getName());
+ for (AttributeType attributeType : identifyingAttributeDescriptors) {
+ Collection<String> attributeValues = artifact.getAttributesToStringList(attributeType.getName());
+ Collection<String> roughAttributes = roughAttributeMap.getValues(attributeType.getName());
if (roughAttributes == null) {
roughAttributes = EMPTY;
}
- if (attributes.size() == roughAttributes.size()) {
- for (Attribute<String> attribute : attributes) {
+ if (attributeValues.size() == roughAttributes.size()) {
+ for (String attributeValue : attributeValues) {
boolean attributeEqual = false;
Iterator<String> iter = roughAttributes.iterator();
- String normalizedAttributeValue = normalizeAttributeValue(attribute.getValue());
+ String normalizedAttributeValue = normalizeAttributeValue(attributeValue);
while (iter.hasNext()) {
String otherAttribute = iter.next();
@@ -93,7 +92,7 @@ public class RootAndAttributeBasedArtifactResolver extends NewArtifactImportReso
return value.trim().replaceAll("\\.$", "").toLowerCase();
}
- public Artifact resolve(RoughArtifact roughArtifact) throws SQLException, IllegalStateException, IOException {
+ public Artifact resolve(RoughArtifact roughArtifact) throws SQLException, IllegalStateException, IOException, MultipleAttributesExist {
Set<Artifact> siblings = roughArtifact.getRoughParent().getAssociatedArtifact().getChildren();
Collection<Artifact> candidates = new LinkedList<Artifact>();

Back to the top