From 22e105c25fe865767d13e8db67931b1f300b081c Mon Sep 17 00:00:00 2001 From: Ryan D. Brooks Date: Mon, 3 Sep 2018 15:59:13 -0700 Subject: refactor: Use ArtifactId in AttributeData Change-Id: I1e3c8b95c7d2aa2df861daf16d391d73e75c1ded --- .../internal/graph/impl/GraphBuilderImplTest.java | 2 +- .../eclipse/osee/orcs/core/ds/AttributeData.java | 5 +- .../internal/attribute/AttributeManagerImpl.java | 5 +- .../core/internal/graph/impl/GraphBuilderImpl.java | 2 +- .../internal/search/ArtifactMatchDataHandler.java | 7 +-- .../change/MissingChangeItemFactoryTest.java | 4 +- .../db/internal/loader/DataFactoryImplTest.java | 62 +++++++++++----------- .../db/internal/transaction/TxSqlBuilderTest.java | 2 +- .../change/MissingChangeItemFactoryImpl.java | 9 ++-- .../orcs/db/internal/loader/DataFactoryImpl.java | 4 +- .../db/internal/loader/data/AttributeDataImpl.java | 10 ++-- .../loader/data/AttributeObjectFactory.java | 5 +- .../loader/data/OrcsObjectFactoryImpl.java | 6 +-- .../loader/processor/AttributeLoadProcessor.java | 11 ++-- .../search/engines/QueryFilterFactoryImpl.java | 7 +-- .../db/internal/search/util/LoadDataBuffer.java | 2 +- 16 files changed, 72 insertions(+), 71 deletions(-) diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java index b6b9dad0727..7cc22033824 100644 --- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java +++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java @@ -96,7 +96,7 @@ public class GraphBuilderImplTest { when(relationFactory.createRelation(relationData)).thenReturn(relation); when(relation.getRelationType()).thenReturn(TYPE_1); - when(attributeData.getArtifactId()).thenReturn(artifactId60.getIdIntValue()); + when(attributeData.getArtifactId()).thenReturn(artifactId60); } @Test diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java index 37128de1437..dec528c7c5c 100644 --- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java +++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/AttributeData.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.orcs.core.ds; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.AttributeId; /** @@ -17,9 +18,9 @@ import org.eclipse.osee.framework.core.data.AttributeId; */ public interface AttributeData extends OrcsData, AttributeId { - int getArtifactId(); + ArtifactId getArtifactId(); - void setArtifactId(int artifactId); + void setArtifactId(ArtifactId artifactId); DataProxy getDataProxy(); diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java index bd24aeb7bc9..789468a7767 100644 --- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java +++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java @@ -24,6 +24,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.AttributeId; import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.AttributeTypeToken; @@ -84,13 +85,13 @@ public abstract class AttributeManagerImpl extends BaseId implements HasOrcsData @Override public synchronized void add(AttributeTypeId attributeType, Attribute attribute) { attributes.put(attributeType, (Attribute) attribute); - attribute.getOrcsData().setArtifactId(getId().intValue()); + attribute.getOrcsData().setArtifactId(this); } @Override public synchronized void remove(AttributeTypeId type, Attribute attribute) { attributes.removeValue(type, (Attribute) attribute); - attribute.getOrcsData().setArtifactId(-1); + attribute.getOrcsData().setArtifactId(ArtifactId.SENTINEL); } @Override 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 3cac52a0494..0c333ad8825 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 @@ -89,7 +89,7 @@ public class GraphBuilderImpl extends LoadDataHandlerAdapter implements GraphBui @Override public void onData(AttributeData data) { GraphData graph = getGraph(); - AttributeManager container = graph.getNode(ArtifactId.valueOf(data.getArtifactId())); + AttributeManager container = graph.getNode(data.getArtifactId()); if (container == null) { logger.warn("Orphaned attribute detected - data[%s]", data); } else { diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java index 6861476fc8a..048dccf279b 100644 --- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java +++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ArtifactMatchDataHandler.java @@ -20,6 +20,7 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.AttributeId; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.jdk.core.type.MatchLocation; @@ -41,7 +42,7 @@ public class ArtifactMatchDataHandler extends LoadDataHandlerDecorator { private final OrcsSession session; private final ExternalArtifactManager proxyManager; - private Map matches; + private Map matches; private List>> results; public ArtifactMatchDataHandler(OrcsSession session, GraphBuilder handler, ExternalArtifactManager proxyManager) { @@ -65,7 +66,7 @@ public class ArtifactMatchDataHandler extends LoadDataHandlerDecorator { @Override public void onData(AttributeData data, MatchLocation match) { super.onData(data, match); - Integer artId = data.getArtifactId(); + ArtifactId artId = data.getArtifactId(); synchronized (matches) { ArtifactMatch artifactMatch = matches.get(artId); if (artifactMatch == null) { @@ -86,7 +87,7 @@ public class ArtifactMatchDataHandler extends LoadDataHandlerDecorator { Iterable loaded = getHandler().getArtifacts(); for (Artifact item : loaded) { - ArtifactMatch artifactMatch = matches.get(new Long(item.getUuid()).intValue()); + ArtifactMatch artifactMatch = matches.get(item); if (artifactMatch != null) { ArtifactReadable readable = proxyManager.asExternalArtifact(session, item); artifactMatch.setArtifactReadable(readable); diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java index 6dbb60dcfd2..c20b2c94723 100644 --- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java +++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java @@ -332,7 +332,7 @@ public class MissingChangeItemFactoryTest { } private static ChangeItem createExpected(AttributeData data) { - return ChangeItemUtil.newAttributeChange(data, AttributeTypeId.SENTINEL, ArtifactId.valueOf(data.getArtifactId()), + return ChangeItemUtil.newAttributeChange(data, AttributeTypeId.SENTINEL, data.getArtifactId(), data.getVersion().getGammaId(), determineModType(data), "", ApplicabilityToken.BASE); } @@ -358,7 +358,7 @@ public class MissingChangeItemFactoryTest { DataProxy proxy = mock(DataProxy.class); AttributeData data = new AttributeDataImpl(version); - data.setArtifactId(artId.getId().intValue()); + data.setArtifactId(artId); data.setModType(modType); data.setLocalId(attrId); data.setDataProxy(proxy); diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java index 5a8c5deb2a6..97e60c03345 100644 --- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java +++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java @@ -31,6 +31,7 @@ import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException; import org.eclipse.osee.framework.jdk.core.util.GUID; import org.eclipse.osee.orcs.core.ds.ArtifactData; +import org.eclipse.osee.orcs.core.ds.ArtifactDataImpl; import org.eclipse.osee.orcs.core.ds.AttributeData; import org.eclipse.osee.orcs.core.ds.DataFactory; import org.eclipse.osee.orcs.core.ds.DataProxy; @@ -62,6 +63,10 @@ public class DataFactoryImplTest { private static final TransactionId tx333 = TransactionId.valueOf(333); private static final TransactionId tx444 = TransactionId.valueOf(444); private static final GammaId gamma222 = GammaId.valueOf(222); + private static final Long ART_ID = 987L; + private static final Long SHARED_ID = 555L; + private static final ArtifactId artifactId555 = ArtifactId.valueOf(SHARED_ID); + private static final IArtifactType artifactType = CoreArtifactTypes.SoftwareRequirement; @Rule public ExpectedException thrown = ExpectedException.none(); @@ -72,19 +77,15 @@ public class DataFactoryImplTest { @Mock private IdentityLocator identityService; @Mock private ArtifactTypes artifactCache; @Mock private RelationTypes relationTypes; - - @Mock private ArtifactData artData; @Mock private AttributeData attrData; @Mock private VersionData verData; @Mock private DataProxy dataProxy; @Mock private DataProxy otherDataProxy; - //@formatter:on - private final IArtifactType artifactType = CoreArtifactTypes.SoftwareRequirement; + private ArtifactData artData; private final ArtifactId art88 = ArtifactId.valueOf(88); private final ArtifactId art99 = ArtifactId.valueOf(99); - private DataFactory dataFactory; private final Integer expectedProxyValue = 45; private final String expectedProxyUri = "hello"; @@ -99,6 +100,7 @@ public class DataFactoryImplTest { OrcsObjectFactory objectFactory = new OrcsObjectFactoryImpl(proxyFactory, relationTypes); dataFactory = new DataFactoryImpl(idFactory, objectFactory, artifactCache); + when(idFactory.getNextArtifactId()).thenReturn(ART_ID.intValue()); // VERSION when(verData.getBranch()).thenReturn(BRANCH); @@ -108,22 +110,22 @@ public class DataFactoryImplTest { when(verData.isHistorical()).thenReturn(true); // ARTIFACT - when(artData.getVersion()).thenReturn(verData); - when(artData.getLocalId()).thenReturn(555); - when(artData.getModType()).thenReturn(ModificationType.MODIFIED); - when(artData.getTypeUuid()).thenReturn(666L); - when(artData.getBaseModType()).thenReturn(ModificationType.NEW); - when(artData.getBaseTypeUuid()).thenReturn(777L); - when(artData.getGuid()).thenReturn("abcdefg"); + artData = new ArtifactDataImpl(verData); + artData.setLocalId(SHARED_ID.intValue()); + artData.setModType(ModificationType.MODIFIED); + artData.setTypeUuid(666L); + artData.setBaseModType(ModificationType.NEW); + artData.setBaseTypeUuid(777L); // ATTRIBUTE when(attrData.getVersion()).thenReturn(verData); - when(attrData.getLocalId()).thenReturn(555); + when(attrData.getLocalId()).thenReturn(SHARED_ID.intValue()); + when(attrData.getId()).thenReturn(SHARED_ID); when(attrData.getModType()).thenReturn(ModificationType.MODIFIED); when(attrData.getTypeUuid()).thenReturn(666L); when(attrData.getBaseModType()).thenReturn(ModificationType.NEW); when(attrData.getBaseTypeUuid()).thenReturn(777L); - when(attrData.getArtifactId()).thenReturn(art88.getId().intValue()); + when(attrData.getArtifactId()).thenReturn(art88); when(attrData.getDataProxy()).thenReturn(dataProxy); when(dataProxy.getRawValue()).thenReturn(expectedProxyValue); @@ -134,7 +136,7 @@ public class DataFactoryImplTest { // RELATION relData = new RelationDataImpl(verData); - relData.setLocalId(555); + relData.setLocalId(SHARED_ID.intValue()); relData.setModType(ModificationType.MODIFIED); relData.setTypeUuid(666); relData.setBaseModType(ModificationType.NEW); @@ -170,7 +172,6 @@ public class DataFactoryImplTest { public void testCreateArtifactData() { when(artifactCache.isAbstract(artifactType)).thenReturn(false); when(idFactory.getUniqueGuid(guid)).thenReturn(guid); - when(idFactory.getNextArtifactId()).thenReturn(987); ArtifactData actual = dataFactory.create(COMMON, artifactType, guid); verify(idFactory).getUniqueGuid(guid); @@ -185,7 +186,7 @@ public class DataFactoryImplTest { assertEquals(false, actualVer.isHistorical()); assertEquals(false, actualVer.isInStorage()); - assertEquals(987, actual.getLocalId().intValue()); + assertEquals(ART_ID, actual.getId()); assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType()); assertEquals(artifactType, actual.getTypeUuid()); assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType()); @@ -198,7 +199,6 @@ public class DataFactoryImplTest { when(artifactCache.get(artifactType)).thenReturn(artifactType); when(artifactCache.isAbstract(artifactType)).thenReturn(false); when(idFactory.getUniqueGuid(guid)).thenReturn(guid); - when(idFactory.getNextArtifactId()).thenReturn(987); ArtifactData actual = dataFactory.create(COMMON, artifactType, guid); verify(idFactory).getUniqueGuid(guid); @@ -212,7 +212,7 @@ public class DataFactoryImplTest { assertEquals(false, actualVer.isHistorical()); assertEquals(false, actualVer.isInStorage()); - assertEquals(987, actual.getLocalId().intValue()); + assertEquals(ART_ID, actual.getId()); assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getModType()); assertEquals(artifactType, actual.getTypeUuid()); assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType()); @@ -246,7 +246,7 @@ public class DataFactoryImplTest { assertEquals(RelationalConstants.DEFAULT_MODIFICATION_TYPE, actual.getBaseModType()); assertEquals(attributeType.getId().longValue(), actual.getBaseTypeUuid()); - assertEquals(555, actual.getArtifactId()); + assertEquals(artifactId555, actual.getArtifactId()); assertNotSame(dataProxy, actual.getDataProxy()); } @@ -292,12 +292,11 @@ public class DataFactoryImplTest { assertEquals(false, actualVer.isHistorical()); assertEquals(false, actualVer.isInStorage()); - assertEquals(555, actual.getLocalId().intValue()); + assertEquals(artifactId555, actual); assertEquals(artData.getModType(), actual.getModType()); assertEquals(666L, actual.getTypeUuid()); assertEquals(ModificationType.NEW, actual.getBaseModType()); assertEquals(777L, actual.getBaseTypeUuid()); - assertEquals("abcdefg", actual.getGuid()); } @Test @@ -313,13 +312,13 @@ public class DataFactoryImplTest { assertEquals(false, actualVer.isHistorical()); assertEquals(false, actualVer.isInStorage()); - assertEquals(555, actual.getLocalId().intValue()); + assertEquals(SHARED_ID, actual.getId()); assertEquals(attrData.getModType(), actual.getModType()); assertEquals(666L, actual.getTypeUuid()); assertEquals(ModificationType.NEW, actual.getBaseModType()); assertEquals(777L, actual.getBaseTypeUuid()); - assertEquals(art88, Long.valueOf(actual.getArtifactId())); + assertEquals(art88, actual.getArtifactId()); assertNotSame(dataProxy, actual.getDataProxy()); assertEquals(expectedProxyValue, actual.getDataProxy().getRawValue()); @@ -329,7 +328,7 @@ public class DataFactoryImplTest { @Test public void testCopyArtifactData() { String newGuid = GUID.create(); - when(idFactory.getNextArtifactId()).thenReturn(987); + when(idFactory.getUniqueGuid(null)).thenReturn(newGuid); ArtifactData actual = dataFactory.copy(COMMON, artData); @@ -344,7 +343,7 @@ public class DataFactoryImplTest { assertEquals(false, actualVer.isHistorical()); assertEquals(false, actualVer.isInStorage()); - assertEquals(987, actual.getLocalId().intValue()); + assertEquals(ART_ID, actual.getId()); assertEquals(ModificationType.NEW, actual.getModType()); assertEquals(666L, actual.getTypeUuid()); assertEquals(ModificationType.NEW, actual.getBaseModType()); @@ -371,7 +370,7 @@ public class DataFactoryImplTest { assertEquals(ModificationType.NEW, actual.getBaseModType()); assertEquals(777L, actual.getBaseTypeUuid()); - assertEquals(art88, Long.valueOf(actual.getArtifactId())); + assertEquals(art88, actual.getArtifactId()); assertNotSame(dataProxy, actual.getDataProxy()); assertEquals(expectedProxyValue, actual.getDataProxy().getRawValue()); @@ -393,12 +392,11 @@ public class DataFactoryImplTest { assertEquals(true, actualVer.isHistorical()); assertEquals(true, actualVer.isInStorage()); - assertEquals(555, actual.getLocalId().intValue()); + assertEquals(artifactId555, actual); assertEquals(ModificationType.MODIFIED, actual.getModType()); assertEquals(666L, actual.getTypeUuid()); assertEquals(ModificationType.NEW, actual.getBaseModType()); assertEquals(777L, actual.getBaseTypeUuid()); - assertEquals("abcdefg", actual.getGuid()); } @Test @@ -418,13 +416,13 @@ public class DataFactoryImplTest { assertEquals(true, actualVer.isHistorical()); assertEquals(true, actualVer.isInStorage()); - assertEquals(555, actual.getLocalId().intValue()); + assertEquals(SHARED_ID, actual.getId()); assertEquals(ModificationType.MODIFIED, actual.getModType()); assertEquals(666L, actual.getTypeUuid()); assertEquals(ModificationType.NEW, actual.getBaseModType()); assertEquals(777L, actual.getBaseTypeUuid()); - assertEquals(art88, Long.valueOf(actual.getArtifactId())); + assertEquals(art88, actual.getArtifactId()); assertNotSame(dataProxy, actual.getDataProxy()); assertEquals(expectedProxyValue, actual.getDataProxy().getRawValue()); @@ -446,7 +444,7 @@ public class DataFactoryImplTest { assertEquals(true, actualVer.isHistorical()); assertEquals(true, actualVer.isInStorage()); - assertEquals(555, actual.getLocalId().intValue()); + assertEquals(SHARED_ID, actual.getId()); assertEquals(ModificationType.MODIFIED, actual.getModType()); assertEquals(666L, actual.getTypeUuid()); assertEquals(ModificationType.NEW, actual.getBaseModType()); diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java index beb7c8846f7..9cda0dceab0 100644 --- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java +++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java @@ -91,7 +91,7 @@ public class TxSqlBuilderTest { private static final ArtifactId B_ART_ID = ArtifactId.valueOf(1231); private static final String RATIONALE = "a rationale"; - private static final int ATTR_ARTIFACT_ID = 12341242; + private static final ArtifactId ATTR_ARTIFACT_ID = ArtifactId.valueOf(12341242); private static final String ATTR_URI = "attr://123/123/123/14/some.zip"; private static final String ATTR_VALUE = "ksahfkashfdlakshfashfaer"; diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java index 1bb30a47a43..f2620a3c2b6 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java @@ -163,7 +163,7 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory { @Override public void onData(AttributeData data) { - if (!modifiedAttrIds.get(ArtifactId.valueOf(data.getArtifactId())).contains(data)) { + if (!modifiedAttrIds.get(data.getArtifactId()).contains(data)) { toReturn.add(createAttributeChangeItem(data)); } } @@ -226,10 +226,10 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory { return artChange; } - private ChangeItem createAttributeChangeItem(AttributeData data) { + private ChangeItem createAttributeChangeItem(AttributeData data) { ApplicabilityId appId = data.getApplicabilityId(); ChangeItem attrChange = ChangeItemUtil.newAttributeChange(data, AttributeTypeId.valueOf(data.getTypeUuid()), - ArtifactId.valueOf(data.getArtifactId()), data.getVersion().getGammaId(), determineModType(data), + data.getArtifactId(), data.getVersion().getGammaId(), determineModType(data), data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId)); attrChange.getNetChange().copy(attrChange.getCurrentVersion()); return attrChange; @@ -241,5 +241,4 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory { RelationTypeId.valueOf(data.getTypeUuid()), data.getVersion().getGammaId(), determineModType(data), data.getArtifactIdA(), data.getArtifactIdB(), data.getRationale(), getApplicabilityToken(appId)); } - -} +} \ No newline at end of file diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java index f72062880c9..fa170b813db 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java @@ -105,8 +105,8 @@ public class DataFactoryImpl implements DataFactory { VersionData version = objectFactory.createDefaultVersionData(); version.setBranch(parent.getVersion().getBranch()); ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE; - return objectFactory.createAttributeData(version, idFactory.getNextAttributeId(), attributeType, modType, - parent.getLocalId(), ApplicabilityId.BASE); + return objectFactory.createAttributeData(version, idFactory.getNextAttributeId(), attributeType, modType, parent, + ApplicabilityId.BASE); } @Override diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java index 7f85b6bba11..c86f9e12d06 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.orcs.db.internal.loader.data; -import org.eclipse.osee.framework.core.data.RelationalConstants; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.orcs.core.ds.AttributeData; import org.eclipse.osee.orcs.core.ds.DataProxy; import org.eclipse.osee.orcs.core.ds.OrcsVersionedObjectImpl; @@ -21,7 +21,7 @@ import org.eclipse.osee.orcs.core.ds.VersionData; */ public class AttributeDataImpl extends OrcsVersionedObjectImpl implements AttributeData { - private int artifactId = RelationalConstants.ART_ID_SENTINEL; + private ArtifactId artifactId = ArtifactId.SENTINEL; private boolean useBackingData = false; private DataProxy proxy; @@ -31,7 +31,7 @@ public class AttributeDataImpl extends OrcsVersionedObjectImpl implements Att } @Override - public int getArtifactId() { + public ArtifactId getArtifactId() { return artifactId; } @@ -41,7 +41,7 @@ public class AttributeDataImpl extends OrcsVersionedObjectImpl implements Att } @Override - public void setArtifactId(int artifactId) { + public void setArtifactId(ArtifactId artifactId) { this.artifactId = artifactId; } @@ -57,7 +57,7 @@ public class AttributeDataImpl extends OrcsVersionedObjectImpl implements Att } if (obj instanceof AttributeDataImpl) { AttributeDataImpl other = (AttributeDataImpl) obj; - return Integer.valueOf(other.artifactId).equals(artifactId) && proxy.equals(other.proxy); + return other.artifactId.equals(artifactId) && proxy.equals(other.proxy); } return true; } diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java index f1715a13a46..27db897e563 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java @@ -11,6 +11,7 @@ package org.eclipse.osee.orcs.db.internal.loader.data; import org.eclipse.osee.framework.core.data.ApplicabilityId; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.AttributeTypeToken; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.orcs.core.ds.AttributeData; @@ -21,9 +22,9 @@ import org.eclipse.osee.orcs.core.ds.VersionData; */ public interface AttributeObjectFactory extends VersionObjectFactory { - AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artId, T value, String uri, ApplicabilityId applicId); + AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artId, T value, String uri, ApplicabilityId applicId); - AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artId, ApplicabilityId applicId); + AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artId, ApplicabilityId applicId); AttributeData createCopy(AttributeData source); } \ No newline at end of file diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java index 3b9beeb512d..472854f87b0 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java @@ -108,7 +108,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory { } @Override - public AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artifactId, T value, String uri, ApplicabilityId applicId) { + public AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artifactId, T value, String uri, ApplicabilityId applicId) { Long typeId = attributeType.getId(); DataProxy proxy = proxyFactory.createProxy(typeId, value, uri); return createAttributeFromRow(version, id, typeId, modType, typeId, modType, artifactId, proxy, applicId); @@ -126,7 +126,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory { } @Override - public AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, int artId, ApplicabilityId applicId) { + public AttributeData createAttributeData(VersionData version, Integer id, AttributeTypeToken attributeType, ModificationType modType, ArtifactId artId, ApplicabilityId applicId) { long typeId = attributeType.getId(); DataProxy proxy = proxyFactory.createProxy(typeId, "", ""); return createAttributeFromRow(version, id, typeId, modType, typeId, modType, artId, proxy, applicId); @@ -156,7 +156,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory { return data; } - private AttributeData createAttributeFromRow(VersionData version, int id, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, int artifactId, DataProxy proxy, ApplicabilityId applicId) { + private AttributeData createAttributeFromRow(VersionData version, int id, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, ArtifactId artifactId, DataProxy proxy, ApplicabilityId applicId) { AttributeData data = new AttributeDataImpl<>(version); data.setLocalId(id); data.setTypeUuid(localTypeID); diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java index d8762167cb1..b20f291c413 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java @@ -47,7 +47,7 @@ public class AttributeLoadProcessor extends LoadProcessor matches = process(this, item, handler, tracker.remainingCriteriaToMatch); @@ -252,8 +252,9 @@ public class QueryFilterFactoryImpl implements QueryFilterFactory { @Override public void onData(AttributeData data, MatchLocation match) { - acceptedArtIds.add(data.getArtifactId()); - forwardArtifacts(data.getArtifactId()); + Integer artId = data.getArtifactId().getIdIntValue(); + acceptedArtIds.add(artId); + forwardArtifacts(artId); super.onData(data, match); } diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java index 045d89624d9..611e7f5c623 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/LoadDataBuffer.java @@ -52,7 +52,7 @@ public class LoadDataBuffer { public void addData(AttributeData data) { synchronized (attributes) { - attributes.put(data.getArtifactId(), data); + attributes.put(data.getArtifactId().getIdIntValue(), data); } } -- cgit v1.2.3