Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2011-07-13 18:32:43 -0400
committerRyan D. Brooks2011-07-13 18:32:43 -0400
commit4b5fea671657690dcb4fef8ebf1dba993319b4d9 (patch)
treedc92f4aa827979841b122eed5ab07fce68186ef5 /plugins/org.eclipse.osee.framework.core.message/src/org
parent5e11404d5ec635fdac5ead50ca8d30b648a09ca8 (diff)
downloadorg.eclipse.osee-4b5fea671657690dcb4fef8ebf1dba993319b4d9.tar.gz
org.eclipse.osee-4b5fea671657690dcb4fef8ebf1dba993319b4d9.tar.xz
org.eclipse.osee-4b5fea671657690dcb4fef8ebf1dba993319b4d9.zip
bug[ats_4B08V]: Fix allowed attribute types per branch
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message/src/org')
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java28
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheStoreRequest.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateResponse.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java21
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java21
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java7
9 files changed, 37 insertions, 54 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java
index 81898abffec..8ce34099218 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java
@@ -27,7 +27,7 @@ public abstract class AbstractBranchCacheMessage {
private final Map<Integer, Integer> branchToSourceTx;
private final Map<Integer, Integer> branchToAssocArt;
private final Map<Integer, String[]> branchToAliases;
- private final List<Triplet<Integer, Integer, Integer>> srcDestMerge;
+ private final List<Triplet<String, String, String>> srcDestMerge;
protected AbstractBranchCacheMessage() {
this.rows = new ArrayList<BranchRow>();
@@ -36,7 +36,7 @@ public abstract class AbstractBranchCacheMessage {
this.branchToSourceTx = new HashMap<Integer, Integer>();
this.branchToAssocArt = new HashMap<Integer, Integer>();
this.branchToAliases = new HashMap<Integer, String[]>();
- this.srcDestMerge = new ArrayList<Triplet<Integer, Integer, Integer>>();
+ this.srcDestMerge = new ArrayList<Triplet<String, String, String>>();
}
public List<BranchRow> getBranchRows() {
@@ -63,7 +63,7 @@ public abstract class AbstractBranchCacheMessage {
return branchToAliases;
}
- public List<Triplet<Integer, Integer, Integer>> getMergeBranches() {
+ public List<Triplet<String, String, String>> getMergeBranches() {
return srcDestMerge;
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java
index e24474507d2..a006fd522ac 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java
@@ -16,9 +16,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.StorageState;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.jdk.core.type.Triplet;
@@ -30,9 +30,9 @@ public class ArtifactTypeCacheUpdateResponse {
private final List<ArtifactTypeRow> rows;
private final Map<Integer, Integer[]> baseToSuper;
- private final List<Triplet<Integer, Integer, Integer>> artAttrs;
+ private final List<Triplet<String, String, String>> artAttrs;
- public ArtifactTypeCacheUpdateResponse(List<ArtifactTypeRow> rows, Map<Integer, Integer[]> baseToSuper, List<Triplet<Integer, Integer, Integer>> artAttrs) {
+ public ArtifactTypeCacheUpdateResponse(List<ArtifactTypeRow> rows, Map<Integer, Integer[]> baseToSuper, List<Triplet<String, String, String>> artAttrs) {
this.rows = rows;
this.baseToSuper = baseToSuper;
this.artAttrs = artAttrs;
@@ -46,7 +46,7 @@ public class ArtifactTypeCacheUpdateResponse {
return baseToSuper;
}
- public List<Triplet<Integer, Integer, Integer>> getAttributeTypes() {
+ public List<Triplet<String, String, String>> getAttributeTypes() {
return artAttrs;
}
@@ -58,7 +58,6 @@ public class ArtifactTypeCacheUpdateResponse {
private StorageState storageState;
protected ArtifactTypeRow(int id, String guid, String name, boolean isAbstract, StorageState storageState) {
- super();
this.id = id;
this.guid = guid;
this.name = name;
@@ -117,13 +116,14 @@ public class ArtifactTypeCacheUpdateResponse {
public static ArtifactTypeCacheUpdateResponse fromCache(Collection<ArtifactType> types) throws OseeCoreException {
List<ArtifactTypeRow> rows = new ArrayList<ArtifactTypeRow>();
Map<Integer, Integer[]> baseToSuper = new HashMap<Integer, Integer[]>();
- List<Triplet<Integer, Integer, Integer>> artAttrs = new ArrayList<Triplet<Integer, Integer, Integer>>();
- for (ArtifactType art : types) {
- rows.add(new ArtifactTypeRow(art.getId(), art.getGuid(), art.getName(), art.isAbstract(),
- art.getStorageState()));
+ List<Triplet<String, String, String>> artAttrs = new ArrayList<Triplet<String, String, String>>();
+ for (ArtifactType artType : types) {
+ rows.add(new ArtifactTypeRow(artType.getId(), artType.getGuid(), artType.getName(), artType.isAbstract(),
+ artType.getStorageState()));
- Integer artId = art.getId();
- Collection<ArtifactType> superTypes = art.getSuperArtifactTypes();
+ Integer artId = artType.getId();
+
+ Collection<ArtifactType> superTypes = artType.getSuperArtifactTypes();
if (!superTypes.isEmpty()) {
Integer[] intSuperTypes = new Integer[superTypes.size()];
int index = 0;
@@ -133,11 +133,11 @@ public class ArtifactTypeCacheUpdateResponse {
baseToSuper.put(artId, intSuperTypes);
}
- for (Entry<Branch, Collection<AttributeType>> entry : art.getLocalAttributeTypes().entrySet()) {
- Integer branchId = entry.getKey().getId();
+ for (Entry<IOseeBranch, Collection<AttributeType>> entry : artType.getLocalAttributeTypes().entrySet()) {
+ IOseeBranch branch = entry.getKey();
Collection<AttributeType> attrTypes = entry.getValue();
for (AttributeType type : attrTypes) {
- artAttrs.add(new Triplet<Integer, Integer, Integer>(artId, branchId, type.getId()));
+ artAttrs.add(new Triplet<String, String, String>(artType.getGuid(), branch.getGuid(), type.getGuid()));
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheStoreRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheStoreRequest.java
index 0af71ffc391..adfafb10e07 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheStoreRequest.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheStoreRequest.java
@@ -22,7 +22,6 @@ public class BranchCacheStoreRequest extends AbstractBranchCacheMessage {
private boolean isServerUpdateMessage;
public BranchCacheStoreRequest() {
- super();
this.isServerUpdateMessage = false;
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateResponse.java
index bcde8c8ff46..7c2a76b6be4 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateResponse.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateResponse.java
@@ -20,10 +20,6 @@ import org.eclipse.osee.framework.core.model.cache.IOseeCache;
*/
public class BranchCacheUpdateResponse extends AbstractBranchCacheMessage {
- public BranchCacheUpdateResponse() {
- super();
- }
-
public static BranchCacheUpdateResponse fromCache(IOseeCache<Branch> cache, Collection<Branch> types) throws OseeCoreException {
BranchCacheUpdateResponse response = new BranchCacheUpdateResponse();
BranchCacheUpdateUtil.loadFromCache(response, types);
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
index 22399d096f9..a00ff73e531 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
@@ -17,6 +17,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.BranchFactory;
@@ -26,6 +27,7 @@ import org.eclipse.osee.framework.core.model.cache.IOseeCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.type.Triplet;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Megumi Telles
@@ -47,7 +49,6 @@ public final class BranchCacheUpdateUtil {
private final TransactionCache txCache;
public BranchCacheUpdateUtil(BranchFactory factory, TransactionCache txCache) {
- super();
this.factory = factory;
this.txCache = txCache;
}
@@ -85,10 +86,10 @@ public final class BranchCacheUpdateUtil {
}
}
}
- for (Triplet<Integer, Integer, Integer> entry : cacheMessage.getMergeBranches()) {
- Branch sourceBranch = cache.getById(entry.getFirst());
- Branch destinationBranch = cache.getById(entry.getSecond());
- MergeBranch mergeBranch = (MergeBranch) cache.getById(entry.getThird());
+ for (Triplet<String, String, String> entry : cacheMessage.getMergeBranches()) {
+ IOseeBranch sourceBranch = Strings.isValid(entry.getFirst()) ? cache.getByGuid(entry.getFirst()) : null;
+ IOseeBranch destinationBranch = Strings.isValid(entry.getSecond()) ? cache.getByGuid(entry.getSecond()) : null;
+ MergeBranch mergeBranch = (MergeBranch) cache.getByGuid(entry.getThird());
mergeBranch.setSourceBranch(sourceBranch);
mergeBranch.setDestinationBranch(destinationBranch);
}
@@ -145,11 +146,11 @@ public final class BranchCacheUpdateUtil {
}
}
- private static void addMergeBranches(List<Triplet<Integer, Integer, Integer>> srcDestMerge, MergeBranch mergeBranch) throws OseeCoreException {
- Integer src = mergeBranch.getSourceBranch() != null ? mergeBranch.getSourceBranch().getId() : -1;
- Integer dest = mergeBranch.getDestinationBranch() != null ? mergeBranch.getDestinationBranch().getId() : -1;
- Integer merge = mergeBranch.getId();
- srcDestMerge.add(new Triplet<Integer, Integer, Integer>(src, dest, merge));
+ private static void addMergeBranches(List<Triplet<String, String, String>> srcDestMerge, MergeBranch mergeBranch) throws OseeCoreException {
+ String src = mergeBranch.getSourceBranch() != null ? mergeBranch.getSourceBranch().getGuid() : null;
+ String dest = mergeBranch.getDestinationBranch() != null ? mergeBranch.getDestinationBranch().getGuid() : null;
+ String merge = mergeBranch.getGuid();
+ srcDestMerge.add(new Triplet<String, String, String>(src, dest, merge));
}
private static void addTxRecord(Map<Integer, Integer> map, Integer branchId, TransactionRecord toAdd) {
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java
index 4385ad2f8fe..4aa7cade73e 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java
@@ -31,7 +31,6 @@ public final class BranchRow {
}
public BranchRow(int branchId, String branchGuid, String branchName, BranchType branchType, BranchState branchState, BranchArchivedState branchArchived, StorageState storageState) {
- super();
this.branchId = branchId;
this.branchGuid = branchGuid;
this.branchName = branchName;
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java
index 4c0078cd8d0..2f62fc65a5e 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java
@@ -41,11 +41,11 @@ public final class TranslationUtil {
store.put(key.name(), arrayMapToStore(map));
}
- public static void loadTripletList(List<Triplet<Integer, Integer, Integer>> data, PropertyStore store, Enum<?> key) {
+ public static void loadTripletList(List<Triplet<String, String, String>> data, PropertyStore store, Enum<?> key) {
storeToTripletList(data, store.getPropertyStore(key.name()));
}
- public static void putTripletList(PropertyStore store, Enum<?> key, List<Triplet<Integer, Integer, Integer>> list) {
+ public static void putTripletList(PropertyStore store, Enum<?> key, List<Triplet<String, String, String>> list) {
store.put(key.name(), tripletListToStore(list));
}
@@ -106,25 +106,18 @@ public final class TranslationUtil {
}
}
- private static void storeToTripletList(List<Triplet<Integer, Integer, Integer>> data, PropertyStore innerStore) {
+ private static void storeToTripletList(List<Triplet<String, String, String>> data, PropertyStore innerStore) {
for (String strKey : innerStore.arrayKeySet()) {
String[] value = innerStore.getArray(strKey);
- Integer first = Integer.valueOf(value[0]);
- Integer second = Integer.valueOf(value[1]);
- Integer third = Integer.valueOf(value[2]);
- data.add(new Triplet<Integer, Integer, Integer>(first, second, third));
+ data.add(new Triplet<String, String, String>(value[0], value[1], value[2]));
}
}
- private static PropertyStore tripletListToStore(List<Triplet<Integer, Integer, Integer>> list) {
+ private static PropertyStore tripletListToStore(List<Triplet<String, String, String>> list) {
PropertyStore innerStore = new PropertyStore();
int index = 0;
- for (Triplet<Integer, Integer, Integer> entry : list) {
- String[] data = new String[3];
- data[0] = String.valueOf(entry.getFirst());
- data[1] = String.valueOf(entry.getSecond());
- data[2] = String.valueOf(entry.getThird());
- innerStore.put(String.valueOf(index), data);
+ for (Triplet<String, String, String> entry : list) {
+ innerStore.put(String.valueOf(index), new String[] {entry.getFirst(), entry.getSecond(), entry.getThird()});
index++;
}
return innerStore;
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java
index 6bb39154ba4..64d5c0a85a8 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java
@@ -38,7 +38,7 @@ public class ArtifactTypeCacheUpdateResponseTranslator implements ITranslator<Ar
public ArtifactTypeCacheUpdateResponse convert(PropertyStore store) throws OseeCoreException {
List<ArtifactTypeRow> rows = new ArrayList<ArtifactTypeRow>();
Map<Integer, Integer[]> baseToSuper = new HashMap<Integer, Integer[]>();
- List<Triplet<Integer, Integer, Integer>> artAttrs = new ArrayList<Triplet<Integer, Integer, Integer>>();
+ List<Triplet<String, String, String>> artAttrs = new ArrayList<Triplet<String, String, String>>();
int rowCount = store.getInt(Fields.ITEM_COUNT.name());
for (int index = 0; index < rowCount; index++) {
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
index b761845dbf5..0562d9dab18 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.core.message.internal.translation;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.BranchToken;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.NamedIdentity;
@@ -100,12 +101,6 @@ public class SearchRequestTranslator implements ITranslator<SearchRequest> {
return store;
}
- private static final class BranchToken extends NamedIdentity implements IOseeBranch {
- public BranchToken(String guid, String name) {
- super(guid, name);
- }
- }
-
private static final class AttributeTypeFilter extends NamedIdentity implements IAttributeType {
public AttributeTypeFilter(String guid, String name) {
super(guid, name);

Back to the top