Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-08-25 22:39:46 -0400
committerRyan D. Brooks2018-09-05 12:26:14 -0400
commit789cd8a6d6c3601dda4b5ea790a77a82e6b2b053 (patch)
tree35299c5fc9f7f267cb7a09736fb1334fef3e81b0
parentc784dc3f933299dfd38c4fb97c591e93899e73b8 (diff)
downloadorg.eclipse.osee-789cd8a6d6c3601dda4b5ea790a77a82e6b2b053.tar.gz
org.eclipse.osee-789cd8a6d6c3601dda4b5ea790a77a82e6b2b053.tar.xz
org.eclipse.osee-789cd8a6d6c3601dda4b5ea790a77a82e6b2b053.zip
refactor: Use ArtifactId in RelationData
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java27
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverTest.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacencies.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java4
15 files changed, 71 insertions, 51 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
index 261d62a341..d1331f3371 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
@@ -31,6 +31,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -142,31 +143,37 @@ public class RelationManagerTest {
mockDb.put(55, node5);
mockDb.put(66, node6);
- when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(11);
- when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(22);
+ ArtifactId artifactId11 = ArtifactId.valueOf(11);
+ ArtifactId artifactId22 = ArtifactId.valueOf(22);
+ ArtifactId artifactId33 = ArtifactId.valueOf(33);
+ ArtifactId artifactId44 = ArtifactId.valueOf(44);
+ ArtifactId artifactId55 = ArtifactId.valueOf(55);
+
+ when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId11);
+ when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId22);
when(relation1.getRelationType()).thenReturn(DEFAULT_HIERARCHY);
when(relation1.getRationale()).thenReturn("rationale on relation1");
when(relation1.getOrcsData()).thenReturn(data1);
when(relation1.getOrcsData().getLocalId()).thenReturn(10);
when(relation1.getModificationType()).thenReturn(ModificationType.NEW);
- when(relation2.getIdForSide(RelationSide.SIDE_A)).thenReturn(11);
- when(relation2.getIdForSide(RelationSide.SIDE_B)).thenReturn(33);
+ when(relation2.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId11);
+ when(relation2.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId33);
when(relation2.getRelationType()).thenReturn(DEFAULT_HIERARCHY);
when(relation2.getRationale()).thenReturn("rationale on relation2");
when(relation2.getOrcsData()).thenReturn(data2);
when(relation2.getOrcsData().getLocalId()).thenReturn(11);
- when(relation3.getIdForSide(RelationSide.SIDE_A)).thenReturn(44);
- when(relation3.getIdForSide(RelationSide.SIDE_B)).thenReturn(11);
+ when(relation3.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId44);
+ when(relation3.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId11);
when(relation3.getRelationType()).thenReturn(DEFAULT_HIERARCHY);
when(relation3.getRationale()).thenReturn("rationale on relation3");
when(relation3.getOrcsData()).thenReturn(data3);
when(relation3.getOrcsData().getLocalId()).thenReturn(12);
when(relation3.getModificationType()).thenReturn(ModificationType.NEW);
- when(relation4.getIdForSide(RelationSide.SIDE_A)).thenReturn(11);
- when(relation4.getIdForSide(RelationSide.SIDE_B)).thenReturn(55);
+ when(relation4.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId11);
+ when(relation4.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId55);
when(relation4.getRelationType()).thenReturn(DEFAULT_HIERARCHY);
when(relation4.getRationale()).thenReturn("rationale on relation4");
when(relation4.getOrcsData()).thenReturn(data4);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
index d7402b0c40..17e30cf34c 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
@@ -17,6 +17,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.DirtyState;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -117,11 +118,14 @@ public class RelationTest {
@Test
public void testGetLocalIdForSide() {
- when(data.getArtIdOn(RelationSide.SIDE_A)).thenReturn(45);
- when(data.getArtIdOn(RelationSide.SIDE_B)).thenReturn(33);
+ ArtifactId artifactId33 = ArtifactId.valueOf(33);
+ ArtifactId artifactId45 = ArtifactId.valueOf(45);
- assertEquals(45, relation.getIdForSide(RelationSide.SIDE_A).intValue());
- assertEquals(33, relation.getIdForSide(RelationSide.SIDE_B).intValue());
+ when(data.getArtIdOn(RelationSide.SIDE_A)).thenReturn(artifactId45);
+ when(data.getArtIdOn(RelationSide.SIDE_B)).thenReturn(artifactId33);
+
+ assertEquals(artifactId45, relation.getIdForSide(RelationSide.SIDE_A));
+ assertEquals(artifactId33, relation.getIdForSide(RelationSide.SIDE_B));
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
index a5e842cb56..9619fa96a0 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
@@ -40,6 +40,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IRelationType;
@@ -89,6 +90,12 @@ import org.mockito.stubbing.Answer;
* @author Roberto E. Escobar
*/
public class RelationManagerImplTest {
+ private static final ArtifactId artifactId11 = ArtifactId.valueOf(11);
+ private static final ArtifactId artifactId22 = ArtifactId.valueOf(22);
+ private static final ArtifactId artifactId33 = ArtifactId.valueOf(33);
+ private static final ArtifactId artifactId44 = ArtifactId.valueOf(44);
+ private static final ArtifactId artifactId55 = ArtifactId.valueOf(55);
+ private static final ArtifactId artifactId66 = ArtifactId.valueOf(66);
private static final RelationTypeToken TYPE_1 = RelationTypeToken.create(123456789, "TYPE_1");
@@ -160,17 +167,17 @@ public class RelationManagerImplTest {
when(graph.getAdjacencies(node1)).thenReturn(container1);
when(graph.getAdjacencies(node2)).thenReturn(container2);
- when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(11);
- when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(22);
+ when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId11);
+ when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId22);
- when(relation2.getIdForSide(RelationSide.SIDE_A)).thenReturn(33);
- when(relation2.getIdForSide(RelationSide.SIDE_B)).thenReturn(44);
+ when(relation2.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId33);
+ when(relation2.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId44);
- when(relation3.getIdForSide(RelationSide.SIDE_A)).thenReturn(55);
- when(relation3.getIdForSide(RelationSide.SIDE_B)).thenReturn(66);
+ when(relation3.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId55);
+ when(relation3.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId66);
- when(relation4.getIdForSide(RelationSide.SIDE_A)).thenReturn(11);
- when(relation4.getIdForSide(RelationSide.SIDE_B)).thenReturn(66);
+ when(relation4.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId11);
+ when(relation4.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId66);
}
@Test
@@ -692,7 +699,7 @@ public class RelationManagerImplTest {
when(container1.getList(DEFAULT_HIERARCHY, EXCLUDE_DELETED, node1, IS_PARENT)).thenReturn(relations1);
- when(relation1.getIdForSide(SIDE_B)).thenReturn(22);
+ when(relation1.getIdForSide(SIDE_B)).thenReturn(artifactId22);
when(graph.getNode(22)).thenReturn(node2);
when(orderFactory.createOrderManager(node1)).thenReturn(orderManager1);
@@ -721,7 +728,7 @@ public class RelationManagerImplTest {
when(container1.getList(DEFAULT_HIERARCHY, EXCLUDE_DELETED, node1, IS_PARENT)).thenReturn(asAParent);
when(container1.getList(DEFAULT_HIERARCHY, EXCLUDE_DELETED, node1, IS_CHILD)).thenReturn(asAChild);
- when(relation1.getIdForSide(SIDE_A)).thenReturn(11);
+ when(relation1.getIdForSide(SIDE_A)).thenReturn(artifactId11);
when(orderFactory.createOrderManager(node1)).thenReturn(orderManager1);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java
index ff1b682da6..8e29617d4c 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java
@@ -202,8 +202,8 @@ public class RelationNodeAdjacenciesTest {
ArtifactId id1 = ArtifactId.valueOf(1);
ArtifactId id2 = ArtifactId.valueOf(2);
when(relation.isDeleted()).thenReturn(false);
- when(relation.getIdForSide(RelationSide.SIDE_A)).thenReturn(id1.getIdIntValue());
- when(relation.getIdForSide(RelationSide.SIDE_B)).thenReturn(id2.getIdIntValue());
+ when(relation.getIdForSide(RelationSide.SIDE_A)).thenReturn(id1);
+ when(relation.getIdForSide(RelationSide.SIDE_B)).thenReturn(id2);
collection.add(TYPE_1, relation);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverTest.java
index 89432904b7..22e2c9b877 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverTest.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.LoadLevel;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -43,6 +44,12 @@ import org.mockito.MockitoAnnotations;
* @author Roberto E. Escobar
*/
public class RelationResolverTest {
+ private static final ArtifactId artifactId11 = ArtifactId.valueOf(11);
+ private static final ArtifactId artifactId22 = ArtifactId.valueOf(22);
+ private static final ArtifactId artifactId33 = ArtifactId.valueOf(33);
+ private static final ArtifactId artifactId44 = ArtifactId.valueOf(44);
+ private static final ArtifactId artifactId55 = ArtifactId.valueOf(55);
+ private static final ArtifactId artifactId66 = ArtifactId.valueOf(66);
// @formatter:off
@Mock private RelationNodeLoader loader;
@@ -86,17 +93,17 @@ public class RelationResolverTest {
when(node5.getLocalId()).thenReturn(55);
when(node6.getLocalId()).thenReturn(66);
- when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(11);
- when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(22);
+ when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId11);
+ when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId22);
- when(relation2.getIdForSide(RelationSide.SIDE_A)).thenReturn(33);
- when(relation2.getIdForSide(RelationSide.SIDE_B)).thenReturn(44);
+ when(relation2.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId33);
+ when(relation2.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId44);
- when(relation3.getIdForSide(RelationSide.SIDE_A)).thenReturn(55);
- when(relation3.getIdForSide(RelationSide.SIDE_B)).thenReturn(66);
+ when(relation3.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId55);
+ when(relation3.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId66);
- when(relation4.getIdForSide(RelationSide.SIDE_A)).thenReturn(11);
- when(relation4.getIdForSide(RelationSide.SIDE_B)).thenReturn(66);
+ when(relation4.getIdForSide(RelationSide.SIDE_A)).thenReturn(artifactId11);
+ when(relation4.getIdForSide(RelationSide.SIDE_B)).thenReturn(artifactId66);
when(loader.loadNodes(eq(session), eq(graphData), anyCollectionOf(Integer.class), eq(LoadLevel.ALL))).thenReturn(
resultSet);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java
index 60fa05f464..939ce317c1 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java
@@ -92,8 +92,8 @@ public class OrcsPredicatesTest {
when(attribute4.getValue()).thenReturn("Hello");
when(attribute5.getValue()).thenReturn(true);
- when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(id1.getIdIntValue());
- when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(id2.getIdIntValue());
+ when(relation1.getIdForSide(RelationSide.SIDE_A)).thenReturn(id1);
+ when(relation1.getIdForSide(RelationSide.SIDE_B)).thenReturn(id2);
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java
index de6b31bc54..ab8c2b7e2b 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationData.java
@@ -31,7 +31,7 @@ public interface RelationData extends OrcsData, RelationId {
void setArtIdB(ArtifactId artIdB);
- int getArtIdOn(RelationSide side);
+ ArtifactId getArtIdOn(RelationSide side);
String getRationale();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
index fa88858ad7..7ac398a87f 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
@@ -116,7 +116,7 @@ public class GraphBuilderImpl extends LoadDataHandlerAdapter implements GraphBui
private Relation findRelation(RelationNodeAdjacencies adjacencies, RelationData data) {
RelationTypeId relationType = RelationTypeId.valueOf(data.getTypeUuid());
- return adjacencies.getRelation(data.getArtIdA(), relationType, data.getArtIdB());
+ return adjacencies.getRelation(data.getArtifactIdA(), relationType, data.getArtifactIdB());
}
private RelationNodeAdjacencies getAdjacencies(GraphData graph, int id) {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
index b8fc5243dc..0699191ed5 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.core.internal.relation;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -146,7 +147,7 @@ public class Relation implements RelationReadable, HasOrcsData<RelationData>, Or
return true;
}
- public Integer getIdForSide(RelationSide side) {
+ public ArtifactId getIdForSide(RelationSide side) {
return getOrcsData().getArtIdOn(side);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
index 922a16027d..9f8e86f451 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
@@ -300,8 +300,7 @@ public class RelationManagerImpl implements RelationManager {
Set<Artifact> otherNodes = new LinkedHashSet<>();
for (Relation relation : relations) {
relation.delete();
- Integer artId = relation.getIdForSide(otherSide);
- Artifact otherNode = graph.getNode(artId);
+ Artifact otherNode = graph.getNode(relation.getIdForSide(otherSide).getIdIntValue());
otherNodes.add(otherNode);
modified = true;
}
@@ -336,7 +335,7 @@ public class RelationManagerImpl implements RelationManager {
for (Relation relation : relations) {
relation.delete();
RelationTypeId type = relation.getRelationType();
- RelationSide otherSide = relation.getIdForSide(SIDE_A) == node.getLocalId() ? SIDE_B : SIDE_A;
+ RelationSide otherSide = relation.getIdForSide(SIDE_A).equals(node) ? SIDE_B : SIDE_A;
typesToRemove.put(type, otherSide);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacencies.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacencies.java
index 4886c18251..20a71b7f04 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacencies.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacencies.java
@@ -92,7 +92,7 @@ public class RelationNodeAdjacencies extends AbstractTypeCollection<RelationType
return listByFilter.isEmpty() ? null : listByFilter.get(0);
}
- public Relation getRelation(int artIdA, RelationTypeId relationType, int artIdB) {
+ public Relation getRelation(ArtifactId artIdA, RelationTypeId relationType, ArtifactId artIdB) {
Predicate<Relation> nodeMatcher = OrcsPredicates.nodeIdsEquals(artIdA, artIdB);
List<Relation> listByFilter = getListByFilter(relationType, nodeMatcher);
return listByFilter.isEmpty() ? null : listByFilter.get(0);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverImpl.java
index 3645c3fef8..6e13a4ec6e 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationResolverImpl.java
@@ -49,7 +49,7 @@ public class RelationResolverImpl implements RelationResolver {
LinkedHashMap<Integer, T> items = new LinkedHashMap<>();
for (Relation relation : links) {
for (RelationSide side : sides) {
- int id = relation.getIdForSide(side);
+ int id = relation.getIdForSide(side).getIdIntValue();
Artifact node = graph.getNode(id);
if (node == null) {
if (toLoad == null) {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
index 8847ee884d..67db4b2d15 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
@@ -318,7 +318,7 @@ public class TxDataManager {
GraphData graph = txData.getGraph();
if (adjacencies != null) {
for (Relation rel : adjacencies.getAll()) {
- graph.addAdjacencies(rel.getIdForSide(RelationSide.SIDE_A), adjacencies);
+ graph.addAdjacencies(rel.getIdForSide(RelationSide.SIDE_A).getIdIntValue(), adjacencies);
}
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
index 682bf133ab..d0ba01b59a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
@@ -167,12 +167,7 @@ public final class OrcsPredicates {
}
public static Predicate<Relation> nodeIdsEquals(final ArtifactId aId, final ArtifactId bId) {
- return nodeIdsEquals(aId.getId().intValue(), bId.getId().intValue());
- }
-
- public static Predicate<Relation> nodeIdsEquals(final Integer aId, final Integer bId) {
return new Predicate<Relation>() {
-
@Override
public boolean apply(Relation relation) {
return aId.equals(relation.getIdForSide(RelationSide.SIDE_A)) && //
@@ -180,4 +175,4 @@ public final class OrcsPredicates {
}
};
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
index 3f1e7dc053..47ad2f0ef3 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
@@ -69,8 +69,8 @@ public class RelationDataImpl extends OrcsVersionedObjectImpl implements Relatio
}
@Override
- public int getArtIdOn(RelationSide side) {
- return RelationSide.SIDE_A == side ? getArtIdA() : getArtIdB();
+ public ArtifactId getArtIdOn(RelationSide side) {
+ return RelationSide.SIDE_A == side ? getArtifactIdA() : getArtifactIdB();
}
@Override

Back to the top