diff options
author | kwilk | 2011-06-07 19:03:51 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-06-07 19:03:51 +0000 |
commit | f5477b2170393f191c27f325f1c248b839d4be31 (patch) | |
tree | 156987d80645a5ba980b6280e4560c68c0bed13c /plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core | |
parent | 61390ccbe15bcde4d4007aebdb93ac37ec44a2a7 (diff) | |
download | org.eclipse.osee-f5477b2170393f191c27f325f1c248b839d4be31.tar.gz org.eclipse.osee-f5477b2170393f191c27f325f1c248b839d4be31.tar.xz org.eclipse.osee-f5477b2170393f191c27f325f1c248b839d4be31.zip |
refactor: Artifact.getNames() quality refactor
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core')
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java index 1ec0064016f..8f4e1226896 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.logging.Level; import org.eclipse.core.runtime.IStatus; import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeExceptions; @@ -103,7 +104,7 @@ public abstract class Attribute<T> implements Comparable<Attribute<T>> { } public boolean setFromString(String value) throws OseeCoreException { - if (attributeType.getName().equals("Name") && !value.equals(getValue())) { + if (attributeType.equals(CoreAttributeTypes.Name) && !value.equals(getValue())) { // Confirm artifact is fit to rename for (IArtifactCheck check : ArtifactChecks.getArtifactChecks()) { IStatus result = check.isRenamable(Arrays.asList(getArtifact())); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java index 521d3fb37a5..201a956066f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java @@ -21,6 +21,7 @@ import java.util.Map; import java.util.Set; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; +import org.eclipse.osee.framework.core.data.Named; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.type.HashCollection; @@ -101,10 +102,10 @@ public final class Artifacts { return ""; } - public static Collection<String> artNames(Collection<? extends Artifact> arts) { + public static Collection<String> getNames(Collection<? extends Named> artifacts) { ArrayList<String> names = new ArrayList<String>(); - for (Artifact art : arts) { - names.add(art.getName()); + for (Named namedArtifact : artifacts) { + names.add(namedArtifact.getName()); } return names; } |