Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2016-08-24 20:44:24 +0000
committerAngel Avila2016-08-24 20:44:24 +0000
commitafa0b016cca6bd991e9c538045a347f9ede09ae7 (patch)
tree89980a36626579cfe94f04dea21b24c217691fab
parent5a58ce727c8205ce914fe33efcca6541bf4feb83 (diff)
downloadorg.eclipse.osee-afa0b016cca6bd991e9c538045a347f9ede09ae7.tar.gz
org.eclipse.osee-afa0b016cca6bd991e9c538045a347f9ede09ae7.tar.xz
org.eclipse.osee-afa0b016cca6bd991e9c538045a347f9ede09ae7.zip
refacttor: Update ids in Change Report area to use Id types
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java10
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeDataTest.java36
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeManagerTest.java2
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactRendererTest.java10
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java20
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemTest.java19
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtilTest.java101
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeVersionTest.java25
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/ChangeTestUtility.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItem.java36
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtil.java19
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeVersion.java11
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeId.java43
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationId.java43
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationTypeId.java43
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java11
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java11
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeWorker.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java20
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeWorker.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java39
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java16
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java32
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeWorker.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java19
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java69
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java30
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReplaceAttributeWithBaselineOperation.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/CompareArtifactAction.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemConflictTest.java26
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeTestUtility.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ComputeNetChangeTest.java54
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java62
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AddArtifactChangeDataCallable.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java91
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java65
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java35
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/Conflict.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java4
47 files changed, 684 insertions, 436 deletions
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java
index b3d105ac69..2b8f6a2220 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/ReportResource.java
@@ -72,7 +72,6 @@ public class ReportResource {
final TypeCountWriter writer = new TypeCountWriter(orcsApi);
final String fileName = String.format("Type_Count_Report_%s", System.currentTimeMillis());
-
StreamingOutput streamingOutput = new StreamingOutput() {
@Override
@@ -89,7 +88,7 @@ public class ReportResource {
private void buildArtIdToChangeMap(List<ChangeItem> changes, Map<Integer, Pair<ChangeItem, Set<ChangeItem>>> artToChanges) {
for (ChangeItem change : changes) {
- int artId = change.getArtId();
+ int artId = change.getArtId().getId().intValue();
ChangeType changeType = change.getChangeType();
if (changeType.isArtifactChange()) {
if (!artToChanges.containsKey(artId)) {
@@ -140,7 +139,7 @@ public class ReportResource {
// Was a synthetic artifact change added by AddArtifactChangeDataCallable
for (ChangeItem change : attrChanges) {
- IAttributeType attrType = attributeTypes.getByUuid(change.getItemTypeId());
+ IAttributeType attrType = attributeTypes.getByUuid(change.getItemTypeId().getId());
if (attrType.matches(WordTemplateContent)) {
toReturn = true;
break;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
index 4cb27fdd30..a490b40e64 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
@@ -11,8 +11,8 @@
package org.eclipse.osee.ats.operation;
import static org.eclipse.osee.framework.ui.skynet.render.IRenderer.NO_DISPLAY;
-import static org.eclipse.osee.framework.ui.skynet.render.IRenderer.SKIP_DIALOGS;
import static org.eclipse.osee.framework.ui.skynet.render.IRenderer.OVERRIDE_DATA_RIGHTS_OPTION;
+import static org.eclipse.osee.framework.ui.skynet.render.IRenderer.SKIP_DIALOGS;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -29,10 +29,11 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.data.TransactionToken;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
@@ -49,7 +50,6 @@ import org.eclipse.osee.framework.skynet.core.change.Change;
import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.skynet.core.types.IArtifact;
-import org.eclipse.osee.framework.ui.skynet.render.IRenderer.DataRightsClassification;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.skynet.render.compare.CompareData;
import org.eclipse.osee.framework.ui.skynet.render.compare.CompareDataCollector;
@@ -102,7 +102,7 @@ public final class ExportChangeReportOperation extends AbstractOperation {
};
for (TeamWorkFlowArtifact workflow : workflows) {
- Set<Integer> artIds = new HashSet<>();
+ Set<ArtifactId> artIds = new HashSet<>();
Collection<Change> changes = computeChanges(workflow, monitor, artIds);
if (!changes.isEmpty() && changes.size() < 4000) {
logf("Exporting: %s -- %s", workflow.toString(), workflow.getAtsId());
@@ -172,7 +172,7 @@ public final class ExportChangeReportOperation extends AbstractOperation {
});
}
- private Collection<Change> computeChanges(Artifact workflow, IProgressMonitor monitor, Set<Integer> artIds) throws OseeCoreException {
+ private Collection<Change> computeChanges(Artifact workflow, IProgressMonitor monitor, Set<ArtifactId> artIds) throws OseeCoreException {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) workflow;
List<Change> changes = new ArrayList<>();
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeDataTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeDataTest.java
index 7e214bc478..7056ebe526 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeDataTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeDataTest.java
@@ -18,7 +18,10 @@ import java.util.Collection;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.client.test.framework.TestInfo;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -71,14 +74,15 @@ public class ChangeDataTest {
ArtifactDelta artDelta = new ArtifactDelta(null, artifactEnd, artifactStart);
ModificationType modType = ModificationType.MODIFIED;
- Change change = new ArtifactChange(workingBranch, artifactStart.getGammaId(), artifactStart.getArtId(), null,
- modType, "", "", false, artifactStart, artDelta);
+ Change change = new ArtifactChange(workingBranch, GammaId.valueOf(artifactStart.getGammaId()),
+ ArtifactId.valueOf(artifactStart.getArtId()), null, modType, "", "", false, artifactStart, artDelta);
theChanges.add(change);
AttributeType paragraphAttributeType = AttributeTypeManager.getType(CoreAttributeTypes.ParagraphNumber);
- int typeID = paragraphAttributeType.getId().intValue();
- change = new AttributeChange(workingBranch, artifactStart.getGammaId(), artifactStart.getArtId(), null,
- ModificationType.NEW, "1.2", "", typeID, paragraphAttributeType, modType, false, artifactStart, artDelta);
+ AttributeId typeID = AttributeId.valueOf(paragraphAttributeType.getId());
+ change = new AttributeChange(workingBranch, GammaId.valueOf(artifactStart.getGammaId()),
+ ArtifactId.valueOf(artifactStart.getArtId()), null, ModificationType.NEW, "1.2", "", typeID,
+ paragraphAttributeType, modType, false, artifactStart, artDelta);
theChanges.add(change);
artifactStart = ArtifactTypeManager.addArtifact(CoreArtifactTypes.SoftwareRequirement, workingBranch);
@@ -90,25 +94,27 @@ public class ChangeDataTest {
artDelta = new ArtifactDelta(null, artifactEnd, artifactStart);
modType = ModificationType.MODIFIED;
- change = new ArtifactChange(workingBranch, artifactStart.getGammaId(), artifactStart.getArtId(), null, modType,
- "", "", false, artifactStart, artDelta);
+ change = new ArtifactChange(workingBranch, GammaId.valueOf(artifactStart.getGammaId()),
+ ArtifactId.valueOf(artifactStart.getArtId()), null, modType, "", "", false, artifactStart, artDelta);
theChanges.add(change);
- typeID = paragraphAttributeType.getId().intValue();
- change = new AttributeChange(workingBranch, artifactStart.getGammaId(), artifactStart.getArtId(), null,
- ModificationType.NEW, "1.2", "", typeID, paragraphAttributeType, modType, false, artifactStart, artDelta);
+ typeID = AttributeId.valueOf(paragraphAttributeType.getId());
+ change = new AttributeChange(workingBranch, GammaId.valueOf(artifactStart.getGammaId()),
+ ArtifactId.valueOf(artifactStart.getArtId()), null, ModificationType.NEW, "1.2", "", typeID,
+ paragraphAttributeType, modType, false, artifactStart, artDelta);
theChanges.add(change);
AttributeType nameAttributeType = AttributeTypeManager.getType(CoreAttributeTypes.Name);
- typeID = nameAttributeType.getId().intValue();
- change = new AttributeChange(workingBranch, artifactStart.getGammaId(), artifactStart.getArtId(), null, modType,
- "test artifact 2A", "test artifact 2", typeID, nameAttributeType, modType, false, artifactStart, artDelta);
+ typeID = AttributeId.valueOf(nameAttributeType.getId());
+ change = new AttributeChange(workingBranch, GammaId.valueOf(artifactStart.getGammaId()),
+ ArtifactId.valueOf(artifactStart.getArtId()), null, modType, "test artifact 2A", "test artifact 2", typeID,
+ nameAttributeType, modType, false, artifactStart, artDelta);
theChanges.add(change);
artifactStart = ArtifactTypeManager.addArtifact(CoreArtifactTypes.SoftwareRequirement, workingBranch);
artifactEnd.setSoleAttributeFromString(CoreAttributeTypes.ParagraphNumber, "1.2");
artDelta = new ArtifactDelta(null, null, artifactStart);
- change = new ArtifactChange(null, 1, artifactStart.getArtId(), null, ModificationType.NEW, "", "", false,
- artifactStart, artDelta);
+ change = new ArtifactChange(null, GammaId.valueOf(1L), ArtifactId.valueOf(artifactStart.getArtId()), null,
+ ModificationType.NEW, "", "", false, artifactStart, artDelta);
theChanges.add(change);
theData = new ChangeData(theChanges);
}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeManagerTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeManagerTest.java
index e6932f8da8..4b76583dea 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeManagerTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ChangeManagerTest.java
@@ -111,7 +111,7 @@ public class ChangeManagerTest {
Operations.executeWorkAndCheckStatus(operation);
for (Change change : changes) {
- if (change.getArtId() == artifact.getArtId()) {
+ if (change.getArtId().getId().intValue() == artifact.getArtId()) {
pass = change.getModificationType() == modificationType;
break;
}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactRendererTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactRendererTest.java
index f31cfc2eec..49781dd22b 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactRendererTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactRendererTest.java
@@ -16,6 +16,8 @@ import java.util.Arrays;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.client.test.framework.TestInfo;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -79,8 +81,8 @@ public class ArtifactRendererTest {
TransactionDelta deltaTx = new TransactionDelta(startTx, endTx1);
ArtifactDelta delta = new ArtifactDelta(null, artifact2, artifact1);
- Change change = new ArtifactChange(COMMON, artifact1.getGammaId(), artifact1.getArtId(), deltaTx,
- ModificationType.MODIFIED, "", "", false, artifact1, delta);
+ Change change = new ArtifactChange(COMMON, GammaId.valueOf(artifact1.getGammaId()),
+ ArtifactId.valueOf(artifact1.getArtId()), deltaTx, ModificationType.MODIFIED, "", "", false, artifact1, delta);
String name = RenderingUtil.getAssociatedArtifactName(Arrays.asList(change));
Assert.assertEquals(EXPECTED_NAME, name);
@@ -90,8 +92,8 @@ public class ArtifactRendererTest {
public void testAssociatedArtifact_notAllowedSingleQuotes() throws Exception {
TransactionDelta deltaTx = new TransactionDelta(startTx, endTx2);
ArtifactDelta delta = new ArtifactDelta(null, artifact1, artifact2);
- Change change = new ArtifactChange(COMMON, artifact2.getGammaId(), artifact2.getArtId(), deltaTx,
- ModificationType.MODIFIED, "", "", false, artifact2, delta);
+ Change change = new ArtifactChange(COMMON, GammaId.valueOf(artifact2.getGammaId()),
+ ArtifactId.valueOf(artifact2.getArtId()), deltaTx, ModificationType.MODIFIED, "", "", false, artifact2, delta);
String name = RenderingUtil.getAssociatedArtifactName(Arrays.asList(change));
Assert.assertEquals(EXPECTED_NAME, name);
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java
index d34b68d573..a82cb34424 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java
@@ -22,8 +22,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
-import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IRelationSorterId;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
@@ -68,26 +68,26 @@ import org.junit.runners.Parameterized.Parameters;
* Attribute | 4 5 6
* Relation | 7 8 9* **
* -------------------------------------------------------------------------
- *
- *
+ *
+ *
* Legend:
* * - artifact will be left with a DELETED attribute change and a SYNTHETIC
* modified artifact change. CASE_10_EXPECTED. i.e.:
- *
+ *
* A C-
* `- B -> `- B B is moved to C
* C gets a new user defined order attribute
- *
+ *
* Revert on B causes A to have a new relation order attribute because
* B was the only child of A and when the link was deleted the relation order
* attribute was also deleted. (link.deleteEmptyRelationOrder()) After the B
* link is added back from the revert of B. A will get a new relation order attribute.
- *
+ *
* ** - creates a parent artifact A on the baseline branch and adds 5 children. On the working branch
* the same artifact A gets additional 5 children. The revert is called A.
* Which will set the parent (A) back to the baseline state but leaves
* the new artifacts orphaned on the working branch.
- *
+ *
* Case 10 is a collection of 1-9, all cases.
* </pre>
*/
@@ -308,8 +308,8 @@ public final class ReplaceWithBaselineTest {
testData.setArtifactId(createNewArtifact(workingBranch, GUID.create()).getArtId());
break;
case INTRODUCED:
- BranchId anotherBranch = BranchManager.createWorkingBranch(workingBranch,
- "another working branch", UserManager.getUser(SystemUser.OseeSystem));
+ BranchId anotherBranch = BranchManager.createWorkingBranch(workingBranch, "another working branch",
+ UserManager.getUser(SystemUser.OseeSystem));
Artifact artifactToIntroduce = createNewArtifact(anotherBranch, "introduce artifact");
@@ -452,7 +452,7 @@ public final class ReplaceWithBaselineTest {
List<Change> attrChanges = new ArrayList<>(1);
for (Change change : changes) {
- if (change.getChangeType() == LoadChangeType.attribute && change.getItemId() == attributeToRevert.getId()) {
+ if (change.getChangeType() == LoadChangeType.attribute && change.getItemId().getId().intValue() == attributeToRevert.getId()) {
attrChanges.add(change);
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemTest.java
index daf8cd8343..e2e9e2ba24 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemTest.java
@@ -22,7 +22,7 @@ import org.junit.runners.Parameterized.Parameters;
/**
* Test Case for {@link ChangeItem}
- *
+ *
* @author Roberto E. Escobar
*/
@RunWith(Parameterized.class)
@@ -33,9 +33,9 @@ public class ChangeItemTest {
private final ChangeVersion current;
private final ChangeVersion destination;
private final ChangeVersion net;
- private final int itemId;
+ private final Long itemId;
- public ChangeItemTest(int itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net) {
+ public ChangeItemTest(Long itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net) {
this.itemId = itemId;
this.base = base;
this.first = first;
@@ -47,7 +47,8 @@ public class ChangeItemTest {
@Test
public void testGetItemId() {
- assertEquals(itemId, item.getItemId());
+ Long actual = item.getItemId().getId();
+ assertEquals(itemId, actual);
}
@Test
@@ -77,12 +78,16 @@ public class ChangeItemTest {
@Test
public void testGetItemTypeId() {
- assertEquals(item.getItemId() * 10, item.getItemTypeId());
+ Long expected = item.getItemId().getId() * 10;
+ Long actual = item.getItemTypeId().getId();
+ assertEquals(expected, actual);
}
@Test
public void testGetArtId() {
- assertEquals(item.getItemId() * 100, item.getArtId());
+ Long expected = item.getItemId().getId() * 100;
+ Long actual = item.getArtId().getId();
+ assertEquals(expected, actual);
}
@Parameters
@@ -95,7 +100,7 @@ public class ChangeItemTest {
ChangeVersion destination = ChangeTestUtility.createChange(4444L, ModificationType.MERGED);
ChangeVersion net = ChangeTestUtility.createChange(5555L, ModificationType.DELETED);
- data.add(new Object[] {200, base, first, current, destination, net});
+ data.add(new Object[] {200L, base, first, current, destination, net});
return data;
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtilTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtilTest.java
index 32c4e04284..21a2b76ad0 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtilTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtilTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
+ * Copyright (c) 200L4, 200L7 Boeing.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,9 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.mocks.ChangeTestUtility;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
@@ -41,10 +44,10 @@ public class ChangeItemUtilTest {
ChangeVersion destination = ChangeTestUtility.createChange(4444L, ModificationType.MERGED);
ChangeVersion net = ChangeTestUtility.createChange(5555L, ModificationType.DELETED);
- ChangeItem item = ChangeTestUtility.createItem(200, base, first, current, destination, net);
- assertEquals(200, item.getItemId());
- assertEquals(2000, item.getItemTypeId());
- assertEquals(20000, item.getArtId());
+ ChangeItem item = ChangeTestUtility.createItem(200L, base, first, current, destination, net);
+ assertEquals(ArtifactId.valueOf(200L), item.getItemId());
+ assertEquals(ArtifactTypeId.valueOf(2000L), item.getItemTypeId());
+ assertEquals(ArtifactId.valueOf(20000L), item.getArtId());
ChangeTestUtility.checkChange(base, item.getBaselineVersion());
ChangeTestUtility.checkChange(first, item.getFirstNonCurrentChange());
ChangeTestUtility.checkChange(current, item.getCurrentVersion());
@@ -57,10 +60,10 @@ public class ChangeItemUtilTest {
ChangeVersion current = ChangeTestUtility.createChange(3333L, ModificationType.INTRODUCED);
ChangeVersion destination = ChangeTestUtility.createChange(4444L, ModificationType.DELETED);
- ChangeItem item = ChangeTestUtility.createItem(200, null, null, current, destination, null);
+ ChangeItem item = ChangeTestUtility.createItem(200L, null, null, current, destination, null);
assertTrue(ChangeItemUtil.hasBeenDeletedInDestination(item));
- item = ChangeTestUtility.createItem(200, null, null, current, null, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, null, null);
assertFalse(ChangeItemUtil.hasBeenDeletedInDestination(item));
}
@@ -68,19 +71,19 @@ public class ChangeItemUtilTest {
public void testAlreadyOnDestination() {
ChangeVersion current = ChangeTestUtility.createChange(3333L, ModificationType.INTRODUCED);
ChangeVersion destination = ChangeTestUtility.createChange(3333L, ModificationType.INTRODUCED);
- ChangeItem item = ChangeTestUtility.createItem(200, null, null, current, destination, null);
+ ChangeItem item = ChangeTestUtility.createItem(200L, null, null, current, destination, null);
assertTrue(ChangeItemUtil.isAlreadyOnDestination(item));
destination = ChangeTestUtility.createChange(4444L, ModificationType.INTRODUCED);
- item = ChangeTestUtility.createItem(200, null, null, current, destination, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, destination, null);
assertFalse(ChangeItemUtil.isAlreadyOnDestination(item));
destination = ChangeTestUtility.createChange(3333L, ModificationType.DELETED);
- item = ChangeTestUtility.createItem(200, null, null, current, destination, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, destination, null);
assertFalse(ChangeItemUtil.isAlreadyOnDestination(item));
current = ChangeTestUtility.createChange(3333L, ModificationType.DELETED);
- item = ChangeTestUtility.createItem(200, null, null, current, destination, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, destination, null);
assertTrue(ChangeItemUtil.isAlreadyOnDestination(item));
}
@@ -92,15 +95,15 @@ public class ChangeItemUtilTest {
current = ChangeTestUtility.createChange(2222L, ModificationType.DELETED);
dest = null;
- item = ChangeTestUtility.createItem(200, null, null, current, dest, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, dest, null);
assertTrue(ChangeItemUtil.isDeletedAndDoesNotExistInDestination(item));
dest = ChangeTestUtility.createChange(3333L, ModificationType.NEW);
- item = ChangeTestUtility.createItem(200, null, null, current, dest, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, dest, null);
assertFalse(ChangeItemUtil.isDeletedAndDoesNotExistInDestination(item));
dest = ChangeTestUtility.createChange(3333L, null);
- item = ChangeTestUtility.createItem(200, null, null, current, dest, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, dest, null);
assertTrue(ChangeItemUtil.isDeletedAndDoesNotExistInDestination(item));
}
@@ -109,13 +112,13 @@ public class ChangeItemUtilTest {
ChangeVersion isNew = ChangeTestUtility.createChange(2222L, ModificationType.NEW);
ChangeVersion deletedCurrent = ChangeTestUtility.createChange(3333L, ModificationType.DELETED);
- ChangeItem item = ChangeTestUtility.createItem(200, null, isNew, deletedCurrent, null, null);
+ ChangeItem item = ChangeTestUtility.createItem(200L, null, isNew, deletedCurrent, null, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertFalse(item.getIgnoreType().isNone());
ChangeVersion current = ChangeTestUtility.createChange(3333L, ModificationType.INTRODUCED);
ChangeVersion destination = ChangeTestUtility.createChange(3333L, ModificationType.INTRODUCED);
- item = ChangeTestUtility.createItem(200, null, null, current, destination, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, destination, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertFalse(item.getIgnoreType().isNone());
@@ -123,7 +126,7 @@ public class ChangeItemUtilTest {
current = ChangeTestUtility.createChange(2222L, ModificationType.DELETED);
dest = null;
- item = ChangeTestUtility.createItem(200, null, null, current, dest, null);
+ item = ChangeTestUtility.createItem(200L, null, null, current, dest, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertFalse(item.getIgnoreType().isNone());
@@ -133,13 +136,13 @@ public class ChangeItemUtilTest {
current = ChangeTestUtility.createChange(3333L, ModificationType.INTRODUCED);
destination = ChangeTestUtility.createChange(4444L, ModificationType.DELETED);
- item = ChangeTestUtility.createItem(200, baseline, null, current, destination, null);
+ item = ChangeTestUtility.createItem(200L, baseline, null, current, destination, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertTrue(item.getIgnoreType().isNone());
current = ChangeTestUtility.createChange(3333L, ModificationType.NEW);
- item = ChangeTestUtility.createItem(200, baseline, null, current, destination, null);
+ item = ChangeTestUtility.createItem(200L, baseline, null, current, destination, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertTrue(item.getIgnoreType().isNone());
@@ -147,13 +150,13 @@ public class ChangeItemUtilTest {
current = ChangeTestUtility.createChange(3333L, ModificationType.MODIFIED);
baseline = ChangeTestUtility.createChange(6234L, ModificationType.MODIFIED);
- item = ChangeTestUtility.createItem(200, baseline, null, current, destination, null);
+ item = ChangeTestUtility.createItem(200L, baseline, null, current, destination, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertFalse(item.getIgnoreType().isNone());
isNew = ChangeTestUtility.createChange(2222L, ModificationType.NEW);
destination = ChangeTestUtility.createChange(3333L, ModificationType.NEW);
- item = ChangeTestUtility.createItem(200, null, null, isNew, destination, null);
+ item = ChangeTestUtility.createItem(200L, null, null, isNew, destination, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertTrue(item.getIgnoreType().isNone());
@@ -161,16 +164,16 @@ public class ChangeItemUtilTest {
isNew = ChangeTestUtility.createChange(2222L, ModificationType.NEW);
ChangeVersion isIntroduced = ChangeTestUtility.createChange(2222L, ModificationType.NEW);
dest = ChangeTestUtility.createChange(1111L, ModificationType.NEW);
- item = ChangeTestUtility.createItem(200, null, null, isNew, dest, null);
+ item = ChangeTestUtility.createItem(200L, null, null, isNew, dest, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertTrue(item.getIgnoreType().isNone());
- item = ChangeTestUtility.createItem(200, null, null, isIntroduced, dest, null);
+ item = ChangeTestUtility.createItem(200L, null, null, isIntroduced, dest, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertTrue(item.getIgnoreType().isNone());
ChangeVersion isNotNew = ChangeTestUtility.createChange(2222L, ModificationType.MODIFIED);
- item = ChangeTestUtility.createItem(200, null, null, isNotNew, dest, null);
+ item = ChangeTestUtility.createItem(200L, null, null, isNotNew, dest, null);
ChangeItemUtil.checkAndSetIgnoreCase(item);
assertTrue(item.getIgnoreType().isNone());
}
@@ -180,11 +183,11 @@ public class ChangeItemUtilTest {
ChangeVersion isNew = ChangeTestUtility.createChange(2222L, ModificationType.NEW);
ChangeVersion deletedCurrent = ChangeTestUtility.createChange(3333L, ModificationType.DELETED);
- ChangeItem item = ChangeTestUtility.createItem(200, null, isNew, deletedCurrent, null, null);
+ ChangeItem item = ChangeTestUtility.createItem(200L, null, isNew, deletedCurrent, null, null);
assertTrue(ChangeItemUtil.wasCreatedAndDeleted(item));
ChangeVersion notDeletedCurrent = ChangeTestUtility.createChange(3333L, ModificationType.INTRODUCED);
- item = ChangeTestUtility.createItem(200, null, isNew, notDeletedCurrent, null, null);
+ item = ChangeTestUtility.createItem(200L, null, isNew, notDeletedCurrent, null, null);
assertFalse(ChangeItemUtil.wasCreatedAndDeleted(item));
}
@@ -193,13 +196,13 @@ public class ChangeItemUtilTest {
ChangeVersion newType = ChangeTestUtility.createChange(2222L, ModificationType.NEW);
ChangeVersion modified = ChangeTestUtility.createChange(2223L, ModificationType.MODIFIED);
- ChangeItem item = ChangeTestUtility.createItem(200, null, newType, modified, null, null);
+ ChangeItem item = ChangeTestUtility.createItem(200L, null, newType, modified, null, null);
assertTrue(ChangeItemUtil.wasNewOnSource(item));
- item = ChangeTestUtility.createItem(200, null, null, newType, null, null);
+ item = ChangeTestUtility.createItem(200L, null, null, newType, null, null);
assertTrue(ChangeItemUtil.wasNewOnSource(item));
- item = ChangeTestUtility.createItem(200, null, modified, modified, null, null);
+ item = ChangeTestUtility.createItem(200L, null, modified, modified, null, null);
assertFalse(ChangeItemUtil.wasNewOnSource(item));
}
@@ -209,13 +212,13 @@ public class ChangeItemUtilTest {
ChangeVersion modified = ChangeTestUtility.createChange(1234L, ModificationType.MODIFIED);
ChangeItem item;
- item = ChangeTestUtility.createItem(200, null, introduced, modified, null, null);
+ item = ChangeTestUtility.createItem(200L, null, introduced, modified, null, null);
assertTrue(ChangeItemUtil.wasIntroducedOnSource(item));
- item = ChangeTestUtility.createItem(200, null, null, introduced, null, null);
+ item = ChangeTestUtility.createItem(200L, null, null, introduced, null, null);
assertTrue(ChangeItemUtil.wasIntroducedOnSource(item));
- item = ChangeTestUtility.createItem(200, null, null, modified, null, null);
+ item = ChangeTestUtility.createItem(200L, null, null, modified, null, null);
assertFalse(ChangeItemUtil.wasIntroducedOnSource(item));
}
@@ -267,11 +270,11 @@ public class ChangeItemUtilTest {
new ArrayList<Triplet<ChangeVersion, ChangeVersion, Boolean>>();
cases.add(createTriplet(3000L, ModificationType.MODIFIED, 3000L, ModificationType.NEW, true));
- cases.add(createTriplet(null, ModificationType.MODIFIED, 3000L, ModificationType.NEW, false));
+ cases.add(createTriplet(0L, ModificationType.MODIFIED, 3000L, ModificationType.NEW, false));
cases.add(createTriplet(3000L, null, 3000L, ModificationType.NEW, true));
- cases.add(createTriplet(3000L, ModificationType.MODIFIED, null, ModificationType.NEW, false));
+ cases.add(createTriplet(3000L, ModificationType.MODIFIED, 0L, ModificationType.NEW, false));
cases.add(createTriplet(3000L, ModificationType.MODIFIED, 3000L, null, true));
- cases.add(createTriplet(null, null, null, null, true));
+ cases.add(createTriplet(0L, null, 0L, null, true));
cases.add(createTriplet(3000L, null, 3001L, null, false));
int index = 0;
@@ -296,17 +299,17 @@ public class ChangeItemUtilTest {
Assert.assertTrue(ex instanceof OseeArgumentException);
}
- ChangeItem item = ChangeTestUtility.createItem(1, ver1, ver2, ver3, null, null);
+ ChangeItem item = ChangeTestUtility.createItem(1L, ver1, ver2, ver3, null, null);
Assert.assertEquals(ver1, ChangeItemUtil.getStartingVersion(item));
- item = ChangeTestUtility.createItem(2, invalid, ver2, ver3, null, null);
+ item = ChangeTestUtility.createItem(2L, invalid, ver2, ver3, null, null);
Assert.assertEquals(ver2, ChangeItemUtil.getStartingVersion(item));
- item = ChangeTestUtility.createItem(3, invalid, invalid, ver3, null, null);
+ item = ChangeTestUtility.createItem(3L, invalid, invalid, ver3, null, null);
Assert.assertEquals(ver3, ChangeItemUtil.getStartingVersion(item));
try {
- item = ChangeTestUtility.createItem(3, invalid, invalid, invalid, null, null);
+ item = ChangeTestUtility.createItem(3L, invalid, invalid, invalid, null, null);
ChangeItemUtil.getStartingVersion(item);
Assert.fail("This line should not be executed");
} catch (OseeCoreException ex) {
@@ -316,7 +319,8 @@ public class ChangeItemUtilTest {
@Test
public void testCopy() throws OseeCoreException {
- ChangeVersion expected = new ChangeVersion(5679L, ModificationType.MERGED, ApplicabilityToken.BASE);
+ ChangeVersion expected =
+ new ChangeVersion(GammaId.valueOf(5679L), ModificationType.MERGED, ApplicabilityToken.BASE);
ChangeVersion actual = new ChangeVersion();
ChangeItemUtil.copy(expected, actual);
@@ -341,25 +345,26 @@ public class ChangeItemUtilTest {
@Test
public void testIsRessurectedOnNewItem() throws OseeCoreException {
- ChangeVersion base = ChangeTestUtility.createChange(null, null);
- ChangeVersion first = ChangeTestUtility.createChange(null, null);
+ ChangeVersion base = ChangeTestUtility.createChange(0L, null);
+ ChangeVersion first = ChangeTestUtility.createChange(0L, null);
ChangeVersion current = ChangeTestUtility.createChange(3333L, ModificationType.NEW);
ChangeVersion destination = ChangeTestUtility.createChange(3333L, ModificationType.DELETED);
- ChangeVersion net = ChangeTestUtility.createChange(null, null);
+ ChangeVersion net = ChangeTestUtility.createChange(0L, null);
- ChangeItem item = ChangeTestUtility.createItem(500, base, first, current, destination, net);
+ ChangeItem item = ChangeTestUtility.createItem(500L, base, first, current, destination, net);
Assert.assertFalse(ChangeItemUtil.isResurrected(item));
}
@Test
public void testAreApplicabilitiesEqual() {
- ChangeVersion one = new ChangeVersion(100L, ModificationType.NEW, ApplicabilityToken.BASE);
+ ChangeVersion one = new ChangeVersion(GammaId.valueOf(100L), ModificationType.NEW, ApplicabilityToken.BASE);
Assert.assertFalse(ChangeItemUtil.areApplicabilitiesEqual(null, one));
Assert.assertFalse(ChangeItemUtil.areApplicabilitiesEqual(one, null));
Assert.assertTrue(ChangeItemUtil.areApplicabilitiesEqual(one, one));
Assert.assertTrue(ChangeItemUtil.areApplicabilitiesEqual(null, null));
- ChangeVersion two = new ChangeVersion(100L, ModificationType.NEW, new ApplicabilityToken(2L, "dummy"));
+ ChangeVersion two =
+ new ChangeVersion(GammaId.valueOf(100L), ModificationType.NEW, new ApplicabilityToken(2L, "dummy"));
Assert.assertFalse(ChangeItemUtil.areApplicabilitiesEqual(one, two));
}
@@ -374,7 +379,7 @@ public class ChangeItemUtilTest {
current.setApplicabilityToken(new ApplicabilityToken(789L, "TestAppl"));
destination.setApplicabilityToken(ApplicabilityToken.BASE);
- ChangeItem item = ChangeTestUtility.createItem(200, base, first, current, destination, net);
+ ChangeItem item = ChangeTestUtility.createItem(200L, base, first, current, destination, net);
Assert.assertTrue(ChangeItemUtil.hasApplicabilityChange(item));
item.getDestinationVersion().setApplicabilityToken(new ApplicabilityToken(789L, "TestAppl"));
@@ -391,7 +396,7 @@ public class ChangeItemUtilTest {
current.setApplicabilityToken(new ApplicabilityToken(789L, "TestAppl"));
destination.setApplicabilityToken(ApplicabilityToken.BASE);
- ChangeItem item = ChangeTestUtility.createItem(200, base, first, current, destination, net);
+ ChangeItem item = ChangeTestUtility.createItem(200L, base, first, current, destination, net);
ChangeItem split = ChangeItemUtil.splitForApplicability(item);
Assert.assertTrue(split.isApplicabilityCopy());
split.setApplicabilityCopy(false);
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeVersionTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeVersionTest.java
index 2ba0f0141a..dd6eb41f8f 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeVersionTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeVersionTest.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.core.model.change;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.mocks.ChangeTestUtility;
import org.junit.Assert;
@@ -29,16 +30,16 @@ public class ChangeVersionTest {
ChangeVersion expected = new ChangeVersion();
ChangeTestUtility.checkChange(expected, actual);
- actual = new ChangeVersion(45L, ModificationType.NEW, ApplicabilityToken.BASE);
+ actual = new ChangeVersion(GammaId.valueOf(45L), ModificationType.NEW, ApplicabilityToken.BASE);
expected.setValue(null);
- expected.setGammaId(45L);
+ expected.setGammaId(GammaId.valueOf(45L));
expected.setModType(ModificationType.NEW);
expected.setApplicabilityToken(ApplicabilityToken.BASE);
ChangeTestUtility.checkChange(expected, actual);
- actual = new ChangeVersion("hello", 47L, ModificationType.MERGED, ApplicabilityToken.BASE);
+ actual = new ChangeVersion("hello", GammaId.valueOf(47L), ModificationType.MERGED, ApplicabilityToken.BASE);
expected.setValue("hello");
- expected.setGammaId(47L);
+ expected.setGammaId(GammaId.valueOf(47L));
expected.setModType(ModificationType.MERGED);
expected.setApplicabilityToken(ApplicabilityToken.BASE);
ChangeTestUtility.checkChange(expected, actual);
@@ -46,12 +47,13 @@ public class ChangeVersionTest {
@Test
public void testCopy() {
- ChangeVersion expected = new ChangeVersion("hello", 47L, ModificationType.MERGED, ApplicabilityToken.BASE);
+ ChangeVersion expected =
+ new ChangeVersion("hello", GammaId.valueOf(47L), ModificationType.MERGED, ApplicabilityToken.BASE);
ChangeVersion actual = new ChangeVersion();
actual.copy(expected);
ChangeTestUtility.checkChange(expected, actual);
- expected = new ChangeVersion(null, 47L, ModificationType.MERGED, ApplicabilityToken.BASE);
+ expected = new ChangeVersion(null, GammaId.valueOf(47L), ModificationType.MERGED, ApplicabilityToken.BASE);
actual.copy(expected);
ChangeTestUtility.checkChange(expected, actual);
}
@@ -61,7 +63,7 @@ public class ChangeVersionTest {
ChangeVersion actual = new ChangeVersion();
Assert.assertFalse(actual.isValid());
- actual.setGammaId(45L);
+ actual.setGammaId(GammaId.valueOf(45L));
Assert.assertFalse(actual.isValid());
actual.setModType(ModificationType.MODIFIED);
@@ -70,8 +72,10 @@ public class ChangeVersionTest {
@Test
public void testEquals() {
- ChangeVersion actual1 = new ChangeVersion("hello", 47L, ModificationType.MERGED, ApplicabilityToken.BASE);
- ChangeVersion actual2 = new ChangeVersion("hello", 47L, ModificationType.MERGED, ApplicabilityToken.BASE);
+ ChangeVersion actual1 =
+ new ChangeVersion("hello", GammaId.valueOf(47L), ModificationType.MERGED, ApplicabilityToken.BASE);
+ ChangeVersion actual2 =
+ new ChangeVersion("hello", GammaId.valueOf(47L), ModificationType.MERGED, ApplicabilityToken.BASE);
ChangeVersion expected = new ChangeVersion();
Assert.assertEquals(actual2, actual1);
@@ -91,7 +95,8 @@ public class ChangeVersionTest {
@Test
public void testToString() {
- ChangeVersion actual1 = new ChangeVersion("hello", 47L, ModificationType.MERGED, ApplicabilityToken.BASE);
+ ChangeVersion actual1 =
+ new ChangeVersion("hello", GammaId.valueOf(47L), ModificationType.MERGED, ApplicabilityToken.BASE);
Assert.assertEquals("[47,MERGED,Base]", actual1.toString());
ChangeVersion expected = new ChangeVersion();
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/ChangeTestUtility.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/ChangeTestUtility.java
index d06881936f..1fb3554584 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/ChangeTestUtility.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/ChangeTestUtility.java
@@ -11,6 +11,9 @@
package org.eclipse.osee.framework.core.model.mocks;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeVersion;
@@ -26,7 +29,7 @@ public final class ChangeTestUtility {
}
public static ChangeVersion createChange(Long long1, ModificationType mod1) {
- return new ChangeVersion(long1, mod1, ApplicabilityToken.BASE);
+ return new ChangeVersion(GammaId.valueOf(long1), mod1, ApplicabilityToken.BASE);
}
public static void checkChange(String message, ChangeVersion expected, ChangeVersion actual) {
@@ -40,11 +43,11 @@ public final class ChangeTestUtility {
checkChange(null, expected, actual);
}
- public static ChangeItem createItem(int itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net) {
+ public static ChangeItem createItem(Long itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net) {
ChangeItem change = new ChangeItem();
- change.setItemId(itemId);
- change.setItemTypeId(itemId * 10);
- change.setArtId(itemId * 100);
+ change.setItemId(ArtifactId.valueOf(itemId));
+ change.setItemTypeId(ArtifactTypeId.valueOf(itemId * 10));
+ change.setArtId(ArtifactId.valueOf(itemId * 100));
ChangeVersion currentVersion = change.getCurrentVersion();
currentVersion.setGammaId(current.getGammaId());
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItem.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItem.java
index 1b882e5024..099a0bf859 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItem.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItem.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.change;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
/**
@@ -19,9 +21,9 @@ public class ChangeItem implements Comparable<ChangeItem> {
private ChangeIgnoreType ignoreType = ChangeIgnoreType.NONE;
private ChangeType changeType = ChangeType.UNKNOWN_CHANGE;
- private int artId = -1;
- private int itemId = -1;
- private long itemTypeId = -1;
+ private ArtifactId artId = ArtifactId.SENTINEL;
+ private Id itemId = Id.valueOf(Id.SENTINEL);
+ private Id itemTypeId = Id.valueOf(Id.SENTINEL);
private ChangeVersion baselineVersion = new ChangeVersion();
private ChangeVersion firstNonCurrentChange = new ChangeVersion();
@@ -32,7 +34,7 @@ public class ChangeItem implements Comparable<ChangeItem> {
private boolean synthetic = false;
private boolean isApplicabilityCopy = false;
- private int artIdB = -1;
+ private ArtifactId artIdB = ArtifactId.valueOf(-1L);
public ChangeItem() {
super();
@@ -83,15 +85,15 @@ public class ChangeItem implements Comparable<ChangeItem> {
this.changeType = changeType;
}
- public void setArtId(int artId) {
+ public void setArtId(ArtifactId artId) {
this.artId = artId;
}
- public void setItemId(int itemId) {
+ public void setItemId(Id itemId) {
this.itemId = itemId;
}
- public void setItemTypeId(long itemTypeId) {
+ public void setItemTypeId(Id itemTypeId) {
this.itemTypeId = itemTypeId;
}
@@ -99,15 +101,15 @@ public class ChangeItem implements Comparable<ChangeItem> {
return synthetic;
}
- public int getArtId() {
+ public ArtifactId getArtId() {
return artId;
}
- public int getItemId() {
+ public Id getItemId() {
return itemId;
}
- public long getItemTypeId() {
+ public Id getItemTypeId() {
return itemTypeId;
}
@@ -151,11 +153,11 @@ public class ChangeItem implements Comparable<ChangeItem> {
this.netChange = netChange;
}
- public int getArtIdB() {
+ public ArtifactId getArtIdB() {
return artIdB;
}
- public void setArtIdB(int artIdB) {
+ public void setArtIdB(ArtifactId artIdB) {
this.artIdB = artIdB;
}
@@ -178,10 +180,10 @@ public class ChangeItem implements Comparable<ChangeItem> {
ChangeItem other = (ChangeItem) obj;
- if (itemId != other.itemId) {
+ if (!itemId.equals(other.itemId)) {
return false;
}
- if (artId != other.artId) {
+ if (!artId.equals(other.artId)) {
return false;
}
if (currentVersion == null) {
@@ -192,7 +194,7 @@ public class ChangeItem implements Comparable<ChangeItem> {
if (!currentVersion.equals(other.currentVersion)) {
return false;
}
- if (itemTypeId != other.itemTypeId) {
+ if (!itemTypeId.equals(other.itemTypeId)) {
return false;
}
return true;
@@ -254,11 +256,11 @@ public class ChangeItem implements Comparable<ChangeItem> {
@Override
public int compareTo(ChangeItem obj) {
- return itemId - obj.itemId;
+ return itemId.getId().compareTo(obj.itemId.getId());
}
@Override
public int hashCode() {
- return itemId;
+ return itemId.getId().hashCode();
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtil.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtil.java
index 2dbc2ac0ea..ada498f570 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtil.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtil.java
@@ -11,6 +11,13 @@
package org.eclipse.osee.framework.core.model.change;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
+import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -26,7 +33,7 @@ public final class ChangeItemUtil {
// Utility Class
}
- public static ChangeItem newArtifactChange(int artId, long artTypeId, long currentSourceGammaId, ModificationType currentSourceModType, ApplicabilityToken appToken) {
+ public static ChangeItem newArtifactChange(ArtifactId artId, ArtifactTypeId artTypeId, GammaId currentSourceGammaId, ModificationType currentSourceModType, ApplicabilityToken appToken) {
ChangeItem item = new ChangeItem();
item.setChangeType(ChangeType.ARTIFACT_CHANGE);
@@ -43,7 +50,7 @@ public final class ChangeItemUtil {
return item;
}
- public static ChangeItem newAttributeChange(int attrId, long attrTypeId, int artId, long currentSourceGammaId, ModificationType currentSourceModType, String value, ApplicabilityToken appToken) {
+ public static ChangeItem newAttributeChange(AttributeId attrId, AttributeTypeId attrTypeId, ArtifactId artId, GammaId currentSourceGammaId, ModificationType currentSourceModType, String value, ApplicabilityToken appToken) {
ChangeItem item = new ChangeItem();
item.setChangeType(ChangeType.ATTRIBUTE_CHANGE);
@@ -61,7 +68,7 @@ public final class ChangeItemUtil {
return item;
}
- public static ChangeItem newRelationChange(int relLinkId, long relTypeId, long currentSourceGammaId, ModificationType currentSourceModType, int aArtId, int bArtId, String rationale, ApplicabilityToken appToken) {
+ public static ChangeItem newRelationChange(RelationId relLinkId, RelationTypeId relTypeId, GammaId currentSourceGammaId, ModificationType currentSourceModType, ArtifactId aArtId, ArtifactId bArtId, String rationale, ApplicabilityToken appToken) {
ChangeItem item = new ChangeItem();
item.setChangeType(ChangeType.RELATION_CHANGE);
@@ -129,14 +136,14 @@ public final class ChangeItemUtil {
public static boolean hasBeenReplacedWithVersion(ChangeItem changeItem) {
boolean results = areGammasEqual(changeItem.getCurrentVersion(), changeItem.getBaselineVersion()) && //
- isModType(changeItem.getCurrentVersion(), ModificationType.MODIFIED);
+ isModType(changeItem.getCurrentVersion(), ModificationType.MODIFIED);
return results;
}
public static boolean isAlreadyOnDestination(ChangeItem changeItem) {
return areGammasEqual(changeItem.getCurrentVersion(), changeItem.getDestinationVersion()) && //
- areModTypesEqual(changeItem.getCurrentVersion(), changeItem.getDestinationVersion()) && //
- areApplicabilitiesEqual(changeItem.getCurrentVersion(), changeItem.getDestinationVersion());
+ areModTypesEqual(changeItem.getCurrentVersion(), changeItem.getDestinationVersion()) && //
+ areApplicabilitiesEqual(changeItem.getCurrentVersion(), changeItem.getDestinationVersion());
}
public static boolean areModTypesEqual(ChangeVersion object1, ChangeVersion object2) {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeVersion.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeVersion.java
index 9032c7acb2..3083983ed5 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeVersion.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeVersion.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.core.model.change;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -18,7 +19,7 @@ import org.eclipse.osee.framework.jdk.core.util.Conditions;
* @author Roberto E. Escobar
*/
public final class ChangeVersion {
- private Long gammaId;
+ private GammaId gammaId;
private ModificationType modType;
private ApplicabilityToken appId;
private String value;
@@ -27,18 +28,18 @@ public final class ChangeVersion {
this(null, null, null, null);
}
- public ChangeVersion(Long gammaId, ModificationType modType, ApplicabilityToken appId) {
+ public ChangeVersion(GammaId gammaId, ModificationType modType, ApplicabilityToken appId) {
this(null, gammaId, modType, appId);
}
- public ChangeVersion(String value, Long gammaId, ModificationType modType, ApplicabilityToken appId) {
+ public ChangeVersion(String value, GammaId gammaId, ModificationType modType, ApplicabilityToken appId) {
this.value = value;
this.gammaId = gammaId;
this.modType = modType;
this.appId = appId;
}
- public Long getGammaId() {
+ public GammaId getGammaId() {
return gammaId;
}
@@ -58,7 +59,7 @@ public final class ChangeVersion {
this.value = value;
}
- public void setGammaId(Long gammaId) {
+ public void setGammaId(GammaId gammaId) {
this.gammaId = gammaId;
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeId.java
new file mode 100644
index 0000000000..eabedd9b22
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/AttributeTypeId.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.core.data;
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.eclipse.osee.framework.jdk.core.type.BaseId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
+import org.eclipse.osee.framework.jdk.core.type.IdSerializer;
+
+/**
+ * @author Ryan D. Brooks
+ */
+@JsonSerialize(using = IdSerializer.class)
+public interface AttributeTypeId extends Id {
+ AttributeTypeId SENTINEL = valueOf(Id.SENTINEL);
+
+ public static AttributeTypeId valueOf(String id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ @JsonCreator
+ public static AttributeTypeId valueOf(long id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ public static AttributeTypeId valueOf(Long id) {
+ final class AttributeTypeIdImpl extends BaseId implements AttributeTypeId {
+ public AttributeTypeIdImpl(Long txId) {
+ super(txId);
+ }
+ }
+ return new AttributeTypeIdImpl(id);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationId.java
new file mode 100644
index 0000000000..2d6cc3493b
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationId.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.core.data;
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.eclipse.osee.framework.jdk.core.type.BaseId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
+import org.eclipse.osee.framework.jdk.core.type.IdSerializer;
+
+/**
+ * @author Ryan D. Brooks
+ */
+@JsonSerialize(using = IdSerializer.class)
+public interface RelationId extends Id {
+ RelationId SENTINEL = valueOf(Id.SENTINEL);
+
+ public static RelationId valueOf(String id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ @JsonCreator
+ public static RelationId valueOf(long id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ public static RelationId valueOf(Long id) {
+ final class RelationIdImpl extends BaseId implements RelationId {
+ public RelationIdImpl(Long txId) {
+ super(txId);
+ }
+ }
+ return new RelationIdImpl(id);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationTypeId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationTypeId.java
new file mode 100644
index 0000000000..b44bf3abb1
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/RelationTypeId.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.core.data;
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.eclipse.osee.framework.jdk.core.type.BaseId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
+import org.eclipse.osee.framework.jdk.core.type.IdSerializer;
+
+/**
+ * @author Ryan D. Brooks
+ */
+@JsonSerialize(using = IdSerializer.class)
+public interface RelationTypeId extends Id {
+ RelationTypeId SENTINEL = valueOf(Id.SENTINEL);
+
+ public static RelationTypeId valueOf(String id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ @JsonCreator
+ public static RelationTypeId valueOf(long id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ public static RelationTypeId valueOf(Long id) {
+ final class RelationTypeIdImpl extends BaseId implements RelationTypeId {
+ public RelationTypeIdImpl(Long txId) {
+ super(txId);
+ }
+ }
+ return new RelationTypeIdImpl(id);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF
index a2c058c6e6..126eca4b7a 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF
@@ -30,8 +30,8 @@ Export-Package: org.eclipse.osee.framework.jdk.core.collection.tree,
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.apache.commons.codec.binary,
org.codehaus.jackson,
+ org.codehaus.jackson.annotate,
org.codehaus.jackson.map,
org.codehaus.jackson.map.annotate,
org.codehaus.jackson.map.ser.std
Require-Bundle: org.codehaus.jackson.mapper;bundle-version="1.9.13"
-
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java
index 9abcf341e2..6626fa5a9b 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java
@@ -11,12 +11,23 @@
package org.eclipse.osee.framework.jdk.core.type;
+import org.codehaus.jackson.annotate.JsonCreator;
+
/**
* @author Ryan D. Brooks
*/
public interface Id {
public static final Long SENTINEL = -1L;
+ public static Id valueOf(String id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ @JsonCreator
+ public static Id valueOf(long id) {
+ return new BaseId(id);
+ }
+
Long getId();
default boolean matches(Id... identities) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java
index 32a43d2ad2..d5a2d804fe 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java
@@ -10,9 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.change;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.TransactionDelta;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType;
@@ -25,7 +28,7 @@ public final class ArtifactChange extends Change {
private final String isValue;
private final String wasValue;
- public ArtifactChange(BranchId branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
+ public ArtifactChange(BranchId branch, GammaId sourceGamma, ArtifactId artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
super(branch, sourceGamma, artId, txDelta, modType, isHistorical, changeArtifact, artifactDelta);
this.isValue = isValue;
this.wasValue = wasValue;
@@ -57,12 +60,12 @@ public final class ArtifactChange extends Change {
}
@Override
- public long getItemTypeId() {
- return getArtifactType().getId();
+ public Id getItemTypeId() {
+ return getArtifactType();
}
@Override
- public int getItemId() {
+ public ArtifactId getItemId() {
return getArtId();
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeWorker.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeWorker.java
index 8e0b8e9e6f..5d666b0c14 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeWorker.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChangeWorker.java
@@ -30,7 +30,7 @@ public class ArtifactChangeWorker implements IChangeWorker {
@Override
public void revert() throws OseeCoreException {
if (change.isBaseline()) {
- artifact.replaceWithVersion((int) change.getBaselineGamma());
+ artifact.replaceWithVersion(change.getBaselineGamma().getId().intValue());
} else {
artifact.delete();
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
index 3ef8b605c9..bd24aca22b 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java
@@ -13,11 +13,15 @@ package org.eclipse.osee.framework.skynet.core.change;
import java.util.List;
import java.util.logging.Level;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist;
import org.eclipse.osee.framework.core.model.TransactionDelta;
import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -34,11 +38,11 @@ public final class AttributeChange extends Change {
private final String isValue;
private final String wasValue;
- private final int attrId;
+ private final AttributeId attrId;
private final AttributeType attributeType;
private final ModificationType artModType;
- public AttributeChange(BranchId branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, int attrId, AttributeType attributeType, ModificationType artModType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
+ public AttributeChange(BranchId branch, GammaId sourceGamma, ArtifactId artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, AttributeId attrId, AttributeType attributeType, ModificationType artModType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
super(branch, sourceGamma, artId, txDelta, modType, isHistorical, changeArtifact, artifactDelta);
this.isValue = isValue;
this.wasValue = wasValue;
@@ -64,11 +68,11 @@ public final class AttributeChange extends Change {
int hashCode = 7 * super.hashCode();
hashCode += getAttributeType() != null ? 7 * getAttributeType().hashCode() : 0;
hashCode += getArtModType() != null ? 7 * getArtModType().hashCode() : 0;
- hashCode += 7 * getAttrId();
+ hashCode += 7 * getAttrId().hashCode();
return hashCode;
}
- public int getAttrId() {
+ public AttributeId getAttrId() {
return attrId;
}
@@ -104,7 +108,7 @@ public final class AttributeChange extends Change {
public Attribute<?> getAttribute() throws OseeCoreException {
List<Attribute<?>> attributes = getChangeArtifact().getAttributes(true);
for (Attribute<?> attribute : attributes) {
- if (attribute.getId() == attrId) {
+ if (attribute.getId() == attrId.getId().intValue()) {
return attribute;
}
}
@@ -134,12 +138,12 @@ public final class AttributeChange extends Change {
}
@Override
- public long getItemTypeId() {
- return getAttributeType().getId();
+ public Id getItemTypeId() {
+ return getAttributeType();
}
@Override
- public int getItemId() {
+ public AttributeId getItemId() {
return attrId;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeWorker.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeWorker.java
index 3886de8a4b..cca4d4ff21 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeWorker.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChangeWorker.java
@@ -30,9 +30,10 @@ public class AttributeChangeWorker implements IChangeWorker {
@Override
public void revert() throws OseeCoreException {
if (change.isBaseline()) {
- artifact.getAttributeById(change.getItemId(), true).replaceWithVersion((int) change.getBaselineGamma());
+ artifact.getAttributeById(change.getItemId().getId(), true).replaceWithVersion(
+ change.getBaselineGamma().getId().intValue());
} else {
- artifact.getAttributeById(change.getItemId(), true).delete();
+ artifact.getAttributeById(change.getItemId().getId(), true).delete();
}
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
index 557faa9815..099865e257 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
@@ -12,12 +12,15 @@
package org.eclipse.osee.framework.skynet.core.change;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.osee.framework.core.data.HasBranch;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.HasBranch;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.TransactionDelta;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType;
@@ -26,8 +29,8 @@ import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType;
* @author Jeff C. Phillips
*/
public abstract class Change implements IAdaptable, Comparable<Change>, HasBranch {
- private final long sourceGamma;
- private final int artId;
+ private final GammaId sourceGamma;
+ private final ArtifactId artId;
private final TransactionDelta txDelta;
private final ArtifactDelta artifactDelta;
private final ModificationType modType;
@@ -36,7 +39,7 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
private final Artifact changeArtifact;
private ChangeItem changeItem;
- public Change(BranchId branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
+ public Change(BranchId branch, GammaId sourceGamma, ArtifactId artId, TransactionDelta txDelta, ModificationType modType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) {
this.branch = branch;
this.sourceGamma = sourceGamma;
this.artId = artId;
@@ -68,13 +71,13 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
}
return areDeltasEqual && change.getArtId() == getArtId() &&
//
- change.getGamma() == getGamma() &&
- //
- change.getChangeArtifact().equals(getChangeArtifact()) &&
- //
- change.getModificationType() == getModificationType() &&
- //
- change.getTxDelta().equals(getTxDelta());
+ change.getGamma() == getGamma() &&
+ //
+ change.getChangeArtifact().equals(getChangeArtifact()) &&
+ //
+ change.getModificationType() == getModificationType() &&
+ //
+ change.getTxDelta().equals(getTxDelta());
}
}
return false;
@@ -83,8 +86,8 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
@Override
public int hashCode() {
int hashCode = 7;
- hashCode += 13 * getArtId();
- hashCode += 13 * getGamma();
+ hashCode += 13 * getArtId().hashCode();
+ hashCode += 13 * getGamma().hashCode();
hashCode += getChangeArtifact() != null ? 13 * getChangeArtifact().hashCode() : 0;
hashCode += getDelta() != null ? 13 * getDelta().hashCode() : 0;
hashCode += getModificationType() != null ? 13 * getModificationType().hashCode() : 0;
@@ -92,7 +95,7 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
return hashCode;
}
- public long getBaselineGamma() {
+ public GammaId getBaselineGamma() {
return changeItem.getBaselineVersion().getGammaId();
}
@@ -120,11 +123,11 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
return getChangeArtifact().getName();
}
- public long getGamma() {
+ public GammaId getGamma() {
return sourceGamma;
}
- public int getArtId() {
+ public ArtifactId getArtId() {
return artId;
}
@@ -132,7 +135,7 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
return txDelta;
}
- public abstract long getItemTypeId();
+ public abstract Id getItemTypeId();
public ArtifactType getArtifactType() {
return getChangeArtifact().getArtifactType();
@@ -159,7 +162,7 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc
public abstract String getItemKind();
- public abstract int getItemId();
+ public abstract Id getItemId();
public abstract LoadChangeType getChangeType();
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java
index 5bde6c9f76..854cca706b 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java
@@ -10,7 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.change;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType;
/**
@@ -22,8 +26,8 @@ public final class ErrorChange extends Change {
private final String errorMessage;
private final String name;
- public ErrorChange(BranchId branch, int artId, String exception) {
- super(branch, 0, artId, null, null, false, null, null);
+ public ErrorChange(BranchId branch, ArtifactId artId, String exception) {
+ super(branch, GammaId.valueOf(0L), artId, null, null, false, null, null);
this.errorMessage = String.format("%s %s", ERROR_STRING, exception);
this.name = String.format("%s ArtID: %s BranchUuid: %s - %s", ERROR_STRING, getArtId(),
branch == null ? null : branch.getUuid(), exception);
@@ -35,8 +39,8 @@ public final class ErrorChange extends Change {
}
@Override
- public int getItemId() {
- return 0;
+ public ArtifactId getItemId() {
+ return ArtifactId.valueOf(0L);
}
@Override
@@ -45,8 +49,8 @@ public final class ErrorChange extends Change {
}
@Override
- public long getItemTypeId() {
- return 0;
+ public Id getItemTypeId() {
+ return ArtifactTypeId.valueOf(0L);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
index 32fb453e82..05d12f47fa 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java
@@ -11,10 +11,14 @@
package org.eclipse.osee.framework.skynet.core.change;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.TransactionDelta;
import org.eclipse.osee.framework.core.model.type.RelationType;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType;
@@ -25,14 +29,14 @@ public final class RelationChange extends Change {
private final static LoadChangeType changeType = LoadChangeType.relation;
private final static Class<RelationChangeWorker> worker = RelationChangeWorker.class;
- private final int bArtId;
+ private final ArtifactId bArtId;
private final Artifact endTxBArtifact;
- private final int relLinkId;
+ private final RelationId relLinkId;
private final String rationale;
private final String wasValue;
private final RelationType relationType;
- public RelationChange(BranchId branch, long sourceGamma, int aArtId, TransactionDelta txDelta, ModificationType modType, int bArtId, int relLinkId, String rationale, String wasValue, RelationType relationType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta, Artifact endTxBArtifact) {
+ public RelationChange(BranchId branch, GammaId sourceGamma, ArtifactId aArtId, TransactionDelta txDelta, ModificationType modType, ArtifactId bArtId, RelationId relLinkId, String rationale, String wasValue, RelationType relationType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta, Artifact endTxBArtifact) {
super(branch, sourceGamma, aArtId, txDelta, modType, isHistorical, changeArtifact, artifactDelta);
this.bArtId = bArtId;
this.relLinkId = relLinkId;
@@ -42,10 +46,7 @@ public final class RelationChange extends Change {
this.wasValue = wasValue;
}
- /**
- * @return the bArtId
- */
- public int getBArtId() {
+ public ArtifactId getBArtId() {
return bArtId;
}
@@ -53,23 +54,14 @@ public final class RelationChange extends Change {
return endTxBArtifact;
}
- /**
- * @return the relLinkId
- */
- public int getRelLinkId() {
+ public RelationId getRelLinkId() {
return relLinkId;
}
- /**
- * @return the rationale
- */
public String getRationale() {
return rationale;
}
- /**
- * @return the relationType
- */
public RelationType getRelationType() {
return relationType;
}
@@ -105,12 +97,12 @@ public final class RelationChange extends Change {
}
@Override
- public long getItemTypeId() {
- return relationType.getId();
+ public Id getItemTypeId() {
+ return relationType;
}
@Override
- public int getItemId() {
+ public Id getItemId() {
return relLinkId;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeWorker.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeWorker.java
index 4f186b868c..659e463405 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeWorker.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChangeWorker.java
@@ -45,9 +45,9 @@ public class RelationChangeWorker implements IChangeWorker {
private RelationLink setRelationLink() throws OseeCoreException {
if (link == null) {
- link = RelationManager.getOrCreate(change.getArtId(), change.getBArtId(), artifact.getBranch(),
- change.getRelationType(), change.getRelLinkId(), (int) change.getGamma(), change.getRationale(),
- change.getModificationType());
+ link = RelationManager.getOrCreate(change.getArtId().getId().intValue(), change.getBArtId().getId().intValue(),
+ artifact.getBranch(), change.getRelationType(), change.getRelLinkId().getId().intValue(),
+ change.getGamma().getId().intValue(), change.getRationale(), change.getModificationType());
}
return link;
}
@@ -58,7 +58,7 @@ public class RelationChangeWorker implements IChangeWorker {
setRelationLink();
if (change.isBaseline()) {
- link.replaceWithVersion((int) change.getBaselineGamma());
+ link.replaceWithVersion(change.getBaselineGamma().getId().intValue());
Artifact otherSideCurrent =
ArtifactQuery.getArtifactFromId(link.getArtifactOnOtherSide(artifact).getArtId(), artifact.getBranch());
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
index fbcc451c8f..ff01144f99 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
@@ -170,18 +170,19 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
change.getModificationType().isDeleted() ? RelationEventType.Deleted : change.getModificationType().isUnDeleted() ? RelationEventType.Undeleted : RelationEventType.Added;
DefaultBasicUuidRelation defaultBasicGuidRelation = new DefaultBasicUuidRelation(relChange.getBranchId(),
- relChange.getRelationType().getGuid(), relChange.getItemId(), (int) relChange.getGamma(),
- relChange.getChangeArtifact().getBasicGuidArtifact(),
+ relChange.getRelationType().getGuid(), relChange.getItemId().getId().intValue(),
+ relChange.getGamma().getId().intValue(), relChange.getChangeArtifact().getBasicGuidArtifact(),
relChange.getEndTxBArtifact().getBasicGuidArtifact());
- EventBasicGuidRelation event = new EventBasicGuidRelation(relationEventType, relChange.getArtId(),
- relChange.getBArtId(), defaultBasicGuidRelation);
+ EventBasicGuidRelation event =
+ new EventBasicGuidRelation(relationEventType, relChange.getArtId().getId().intValue(),
+ relChange.getBArtId().getId().intValue(), defaultBasicGuidRelation);
event.setRationale(relChange.getRationale());
artifactEvent.getRelations().add(event);
break;
case attribute:
// Only reload items that were already in the active cache
- int artifactId = change.getArtId();
- Artifact artifact = ArtifactCache.getActive(change.getArtId(), newTransaction.getBranch());
+ int artifactId = change.getArtId().getId().intValue();
+ Artifact artifact = ArtifactCache.getActive(artifactId, newTransaction.getBranch());
if (artifact != null) {
artifacts.add(artifact);
}
@@ -201,12 +202,12 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
org.eclipse.osee.framework.skynet.core.event.model.AttributeChange attrChangeEvent =
new org.eclipse.osee.framework.skynet.core.event.model.AttributeChange();
attrChangeEvent.setAttrTypeGuid(attributeChange.getAttributeType().getGuid());
- attrChangeEvent.setGammaId((int) attributeChange.getGamma());
- attrChangeEvent.setAttributeId(attributeChange.getAttrId());
+ attrChangeEvent.setGammaId(attributeChange.getGamma().getId().intValue());
+ attrChangeEvent.setAttributeId(attributeChange.getAttrId().getId().intValue());
attrChangeEvent.setModTypeGuid(
AttributeEventModificationType.getType(attributeChange.getModificationType()).getGuid());
- Attribute<?> attribute = changedArtifact.getAttributeById(attributeChange.getAttrId(), true);
+ Attribute<?> attribute = changedArtifact.getAttributeById(attributeChange.getAttrId().getId(), true);
if (attribute != null) {
for (Object obj : attribute.getAttributeDataProvider().getData()) {
if (obj == null) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java
index ce39c3c30d..7d38b0db09 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java
@@ -31,7 +31,7 @@ import org.eclipse.osee.framework.skynet.core.change.RelationChange;
/**
* Collection of changes from working branch or transactionId from committed branch.
- *
+ *
* @author Donald G. Dunne
*/
public class ChangeData {
@@ -103,7 +103,7 @@ public class ChangeData {
try {
if (change instanceof AttributeChange) {
Integer id = artifact.getArtId();
- long typeId = change.getItemTypeId();
+ long typeId = change.getItemTypeId().getId();
AttributeType attributeType = AttributeTypeManager.getTypeByGuid(typeId);
if (excludeArtifact.containsKey(id)) {
if (!artifactTypesToIgnore.contains(attributeType)) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
index 09d401eac9..b49eb58e17 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java
@@ -18,7 +18,11 @@ import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -77,7 +81,7 @@ public class ChangeDataLoader extends AbstractOperation {
monitor.setTaskName("Bulk load changed artifacts");
checkForCancelledStatus(monitor);
- CompositeKeyHashMap<TransactionId, Integer, Artifact> bulkLoaded = new CompositeKeyHashMap<>();
+ CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded = new CompositeKeyHashMap<>();
bulkLoadArtifactDeltas(bulkLoaded, changeItems);
monitor.worked(calculateWork(0.20));
@@ -100,7 +104,7 @@ public class ChangeDataLoader extends AbstractOperation {
checkForCancelledStatus(monitor);
monitor.setTaskName("Bulk load changed artifacts");
- CompositeKeyHashMap<TransactionId, Integer, Artifact> bulkLoaded = new CompositeKeyHashMap<>();
+ CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded = new CompositeKeyHashMap<>();
bulkLoadArtifactDeltas(bulkLoaded, changeItems);
@@ -120,12 +124,12 @@ public class ChangeDataLoader extends AbstractOperation {
}
}
- private Change computeChangeFromGamma(CompositeKeyHashMap<TransactionId, Integer, Artifact> bulkLoaded, BranchId startTxBranch, ChangeItem item) {
+ private Change computeChangeFromGamma(CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded, BranchId startTxBranch, ChangeItem item) {
Change change = null;
try {
- int artId = item.getArtId();
- Long destGamma = item.getDestinationVersion().getGammaId();
- Long baseGamma = item.getBaselineVersion().getGammaId();
+ ArtifactId artId = item.getArtId();
+ GammaId destGamma = item.getDestinationVersion().getGammaId();
+ GammaId baseGamma = item.getBaselineVersion().getGammaId();
Artifact startTxArtifact;
Artifact endTxArtifact;
// When start and end transactions are on same branch set them to start and end respectfully
@@ -160,10 +164,10 @@ public class ChangeDataLoader extends AbstractOperation {
return change;
}
- private Change computeChange(CompositeKeyHashMap<TransactionId, Integer, Artifact> bulkLoaded, BranchId startTxBranch, ChangeItem item) {
+ private Change computeChange(CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded, BranchId startTxBranch, ChangeItem item) {
Change change = null;
try {
- int artId = item.getArtId();
+ ArtifactId artId = item.getArtId();
Artifact startTxArtifact;
Artifact endTxArtifact;
if (txDelta.areOnTheSameBranch()) {
@@ -185,13 +189,13 @@ public class ChangeDataLoader extends AbstractOperation {
return change;
}
- private Change createChangeObject(CompositeKeyHashMap<TransactionId, Integer, Artifact> bulkLoaded, ChangeItem item, TransactionDelta txDelta, BranchId startTxBranch, ArtifactDelta artifactDelta) throws OseeCoreException {
+ private Change createChangeObject(CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded, ChangeItem item, TransactionDelta txDelta, BranchId startTxBranch, ArtifactDelta artifactDelta) throws OseeCoreException {
Change change = null;
- int itemId = item.getItemId();
- long itemGammaId = item.getNetChange().getGammaId();
+ Long itemId = item.getItemId().getId();
+ GammaId itemGammaId = item.getNetChange().getGammaId();
ModificationType netModType = item.getNetChange().getModType();
- int artId = item.getArtId();
+ ArtifactId artId = item.getArtId();
// The change artifact is the artifact that is displayed by the GUI.
// When we are comparing two different branches, the displayed artifact should be the start artifact or the artifact from the
@@ -206,23 +210,23 @@ public class ChangeDataLoader extends AbstractOperation {
if (ChangeItemUtil.hasApplicabilityChange(item)) {
netModType = ModificationType.APPLICABILITY;
- change = new ArtifactChange(startTxBranch, itemGammaId, itemId, txDelta, netModType,
+ change = new ArtifactChange(startTxBranch, itemGammaId, ArtifactId.valueOf(itemId), txDelta, netModType,
item.getCurrentVersion().getApplicabilityToken().getName(),
item.getDestinationVersion().getApplicabilityToken().getName(), isHistorical, changeArtifact,
artifactDelta);
} else {
- change = new ArtifactChange(startTxBranch, itemGammaId, itemId, txDelta, netModType, "", "",
- isHistorical, changeArtifact, artifactDelta);
+ change = new ArtifactChange(startTxBranch, itemGammaId, ArtifactId.valueOf(itemId), txDelta, netModType,
+ "", "", isHistorical, changeArtifact, artifactDelta);
}
break;
case ATTRIBUTE_CHANGE:
- AttributeType attributeType = AttributeTypeManager.getTypeByGuid(item.getItemTypeId());
+ AttributeType attributeType = AttributeTypeManager.getTypeByGuid(item.getItemTypeId().getId());
if (ChangeItemUtil.hasApplicabilityChange(item)) {
netModType = ModificationType.APPLICABILITY;
change = new AttributeChange(startTxBranch, itemGammaId, artId, txDelta, netModType,
item.getCurrentVersion().getApplicabilityToken().getName(),
- item.getDestinationVersion().getApplicabilityToken().getName(), itemId, attributeType, netModType,
- isHistorical, changeArtifact, artifactDelta);
+ item.getDestinationVersion().getApplicabilityToken().getName(), AttributeId.valueOf(itemId),
+ attributeType, netModType, isHistorical, changeArtifact, artifactDelta);
} else {
String isValue = item.getCurrentVersion().getValue();
@@ -247,11 +251,11 @@ public class ChangeDataLoader extends AbstractOperation {
}
change = new AttributeChange(startTxBranch, itemGammaId, artId, txDelta, netModType, isValue, wasValue,
- itemId, attributeType, netModType, isHistorical, changeArtifact, artifactDelta);
+ AttributeId.valueOf(itemId), attributeType, netModType, isHistorical, changeArtifact, artifactDelta);
}
break;
case RELATION_CHANGE:
- RelationType relationType = RelationTypeManager.getTypeByGuid(item.getItemTypeId());
+ RelationType relationType = RelationTypeManager.getTypeByGuid(item.getItemTypeId().getId());
TransactionId transaction = txDelta.getStartTx();
if (txDelta.areOnTheSameBranch()) {
@@ -264,13 +268,14 @@ public class ChangeDataLoader extends AbstractOperation {
if (ChangeItemUtil.hasApplicabilityChange(item)) {
netModType = ModificationType.APPLICABILITY;
change = new RelationChange(startTxBranch, itemGammaId, artId, txDelta, netModType,
- endTxBArtifact.getArtId(), itemId, item.getCurrentVersion().getApplicabilityToken().getName(),
+ ArtifactId.valueOf(endTxBArtifact.getArtId()), RelationId.valueOf(itemId),
+ item.getCurrentVersion().getApplicabilityToken().getName(),
item.getDestinationVersion().getApplicabilityToken().getName(), relationType, isHistorical,
changeArtifact, artifactDelta, endTxBArtifact);
} else {
- change =
- new RelationChange(startTxBranch, itemGammaId, artId, txDelta, netModType, endTxBArtifact.getArtId(),
- itemId, rationale, "", relationType, isHistorical, changeArtifact, artifactDelta, endTxBArtifact);
+ change = new RelationChange(startTxBranch, itemGammaId, artId, txDelta, netModType,
+ ArtifactId.valueOf(endTxBArtifact.getArtId()), RelationId.valueOf(itemId), rationale, "",
+ relationType, isHistorical, changeArtifact, artifactDelta, endTxBArtifact);
}
break;
default:
@@ -279,7 +284,7 @@ public class ChangeDataLoader extends AbstractOperation {
return change;
}
- private void bulkLoadArtifactDeltas(CompositeKeyHashMap<TransactionId, Integer, Artifact> bulkLoaded, Collection<ChangeItem> changeItems) throws OseeCoreException {
+ private void bulkLoadArtifactDeltas(CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded, Collection<ChangeItem> changeItems) throws OseeCoreException {
Set<Integer> artIds = asArtIds(changeItems);
preloadArtifacts(bulkLoaded, artIds, txDelta.getStartTx(), txDelta.areOnTheSameBranch());
@@ -292,7 +297,7 @@ public class ChangeDataLoader extends AbstractOperation {
}
}
- private static void preloadArtifacts(CompositeKeyHashMap<TransactionId, Integer, Artifact> bulkLoaded, Collection<Integer> artIds, TransactionToken tx, boolean isHistorical) throws OseeCoreException {
+ private static void preloadArtifacts(CompositeKeyHashMap<TransactionId, ArtifactId, Artifact> bulkLoaded, Collection<Integer> artIds, TransactionToken tx, boolean isHistorical) throws OseeCoreException {
List<Artifact> artifacts;
if (isHistorical) {
@@ -301,16 +306,16 @@ public class ChangeDataLoader extends AbstractOperation {
artifacts = ArtifactQuery.getArtifactListFromIds(artIds, tx.getBranch(), INCLUDE_DELETED);
}
for (Artifact artifact : artifacts) {
- bulkLoaded.put(tx, artifact.getArtId(), artifact);
+ bulkLoaded.put(tx, ArtifactId.valueOf(artifact.getId()), artifact);
}
}
private static Set<Integer> asArtIds(Collection<ChangeItem> changeItems) {
Set<Integer> artIds = new HashSet<>();
for (ChangeItem item : changeItems) {
- artIds.add(item.getArtId());
+ artIds.add(item.getArtId().getId().intValue());
if (item.getChangeType().isRelationChange()) {
- artIds.add(item.getArtIdB());
+ artIds.add(item.getArtIdB().getId().intValue());
}
}
return artIds;
@@ -338,8 +343,8 @@ public class ChangeDataLoader extends AbstractOperation {
private static boolean isAllowableChange(ChangeIgnoreType ignoreType) {
return //
ignoreType.isNone() || //
- ignoreType.isResurrected() || //
- ignoreType.isDeletedOnDestAndNotResurrected() || //
- ignoreType.isDeletedOnDestination();
+ ignoreType.isResurrected() || //
+ ignoreType.isDeletedOnDestAndNotResurrected() || //
+ ignoreType.isDeletedOnDestination();
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java
index 4b02053715..882273eaab 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java
@@ -19,7 +19,11 @@ import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -206,24 +210,28 @@ public final class RevisionChangeLoader {
if (changeArtifact != null) {
ArtifactDelta delta = new ArtifactDelta(builder.getTxDelta(), changeArtifact, null);
if (builder instanceof ArtifactChangeBuilder) {
- toReturn = new ArtifactChange(branch, builder.getSourceGamma(), builder.getArtId(), builder.getTxDelta(),
- builder.getModType(), "", "", isHistorical, changeArtifact, delta);
+ toReturn = new ArtifactChange(branch, GammaId.valueOf(builder.getSourceGamma()),
+ ArtifactId.valueOf(builder.getArtId()), builder.getTxDelta(), builder.getModType(), "", "",
+ isHistorical, changeArtifact, delta);
} else if (builder instanceof AttributeChangeBuilder) {
AttributeChangeBuilder attrBuilder = (AttributeChangeBuilder) builder;
- toReturn = new AttributeChange(branch, attrBuilder.getSourceGamma(), attrBuilder.getArtId(),
- attrBuilder.getTxDelta(), attrBuilder.getModType(), attrBuilder.getIsValue(),
- attrBuilder.getWasValue(), attrBuilder.getAttrId(), attrBuilder.getAttributeType(),
- attrBuilder.getArtModType(), isHistorical, changeArtifact, delta);
+ toReturn = new AttributeChange(branch, GammaId.valueOf(attrBuilder.getSourceGamma()),
+ ArtifactId.valueOf(attrBuilder.getArtId()), attrBuilder.getTxDelta(), attrBuilder.getModType(),
+ attrBuilder.getIsValue(), attrBuilder.getWasValue(), AttributeId.valueOf(attrBuilder.getAttrId()),
+ attrBuilder.getAttributeType(), attrBuilder.getArtModType(), isHistorical, changeArtifact, delta);
} else if (builder instanceof RelationChangeBuilder) {
RelationChangeBuilder relBuilder = (RelationChangeBuilder) builder;
Artifact bArtifact = loadedMap.get(builder.getTxDelta().getEndTx(), relBuilder.getbArtId());
- toReturn = new RelationChange(branch, builder.getSourceGamma(), builder.getArtId(), builder.getTxDelta(),
- builder.getModType(), relBuilder.getbArtId(), relBuilder.getRelLinkId(), relBuilder.getRationale(),
- "", relBuilder.getRelationType(), isHistorical, changeArtifact, delta, bArtifact);
+ toReturn = new RelationChange(branch, GammaId.valueOf(builder.getSourceGamma()),
+ ArtifactId.valueOf(builder.getArtId()), builder.getTxDelta(), builder.getModType(),
+ ArtifactId.valueOf(relBuilder.getbArtId()), RelationId.valueOf(relBuilder.getRelLinkId()),
+ relBuilder.getRationale(), "", relBuilder.getRelationType(), isHistorical, changeArtifact, delta,
+ bArtifact);
}
} else {
- toReturn = new ArtifactChange(branch, builder.getSourceGamma(), builder.getArtId(), builder.getTxDelta(),
- builder.getModType(), "", "", isHistorical, null, null);
+ toReturn = new ArtifactChange(branch, GammaId.valueOf(builder.getSourceGamma()),
+ ArtifactId.valueOf(builder.getArtId()), builder.getTxDelta(), builder.getModType(), "", "", isHistorical,
+ null, null);
}
changes.add(toReturn);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java
index 02d427a05d..e78dac079e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java
@@ -83,7 +83,7 @@ public class WasIsCompareEditorAction extends Action {
Artifact artifact = artifactsFromStructuredSelection.iterator().next();
String was = change.getWasValue();
- int attrId = ((AttributeChange) change).getAttrId();
+ int attrId = ((AttributeChange) change).getAttrId().getId().intValue();
TransactionId previousTransaction = getPreviousTransaction(artifact.getBranchId(), attrId, transactionId);
if (!Strings.isValid(was) && change instanceof AttributeChange) {
if (previousTransaction.isValid()) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReplaceAttributeWithBaselineOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReplaceAttributeWithBaselineOperation.java
index 7e7c967870..cc803ba430 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReplaceAttributeWithBaselineOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReplaceAttributeWithBaselineOperation.java
@@ -55,7 +55,8 @@ public class ReplaceAttributeWithBaselineOperation extends AbstractOperation {
for (Change change : changes) {
monitor.subTask("Reverting: " + changes.toString());
monitor.worked(1);
- Artifact artifact = ArtifactQuery.getArtifactFromId(change.getArtId(), change.getBranch());
+ Artifact artifact =
+ ArtifactQuery.getArtifactFromId(change.getArtId().getId().intValue(), change.getBranch());
revertAttribute(artifact, change);
artifactHistory.add(artifact);
artifact.persist(transaction);
@@ -75,8 +76,8 @@ public class ReplaceAttributeWithBaselineOperation extends AbstractOperation {
}
private void revertAttribute(Artifact artifact, Change change) throws OseeStateException, OseeCoreException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
- Attribute<?> attribute = artifact.getAttributeById(change.getItemId(), true);
- if (attribute != null && change.getItemId() == attribute.getId()) {
+ Attribute<?> attribute = artifact.getAttributeById(change.getItemId().getId(), true);
+ if (attribute != null && change.getItemId().getId().intValue() == attribute.getId()) {
Class<? extends IChangeWorker> workerClass = change.getWorker();
Constructor<?> ctor = workerClass.getConstructor(Change.class, Artifact.class);
IChangeWorker worker = (IChangeWorker) ctor.newInstance(change, artifact);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/CompareArtifactAction.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/CompareArtifactAction.java
index 67d789b903..45d98aa80d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/CompareArtifactAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/CompareArtifactAction.java
@@ -106,7 +106,7 @@ public final class CompareArtifactAction extends Action {
Conditions.checkExpressionFailOnTrue(changeA.getArtId() != changeB.getArtId(),
"Change art ids don't match [%s:%s]", changeA.getArtId(), changeB.getArtId());
- int artId = changeA.getArtId();
+ int artId = changeA.getArtId().getId().intValue();
TransactionDelta txDelta = asTxDelta(changeA, changeB);
Artifact startArtifact =
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java
index a671ba45d1..6eb4c88c42 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateFileDiffer.java
@@ -124,7 +124,7 @@ public final class WordTemplateFileDiffer {
Set<Integer> addedIds = new HashSet<>();
Set<Integer> changeIds = new HashSet<>(changes.size());
for (Change change : changes) {
- changeIds.add(change.getArtId());
+ changeIds.add(change.getArtId().getId().intValue());
}
BranchId endBranch = txDelta.getEndTx().getBranch();
// loop through all artifacts that are on the IS branch
@@ -160,7 +160,7 @@ public final class WordTemplateFileDiffer {
private Change findChange(Integer artId, List<Change> changes) {
Change toReturn = null;
for (Change change : changes) {
- if (change.getArtId() == artId) {
+ if (change.getArtId().getId().intValue() == artId.intValue()) {
toReturn = change;
break;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
index 0f4103e2b5..a97ddaf263 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
@@ -250,12 +250,12 @@ public class HistoryView extends GenericViewPart implements IBranchEventListener
if (selectedObject instanceof AttributeChange) {
try {
AttributeChange attributeChange = (AttributeChange) selectedObject;
- Artifact artifact =
- ArtifactQuery.getArtifactFromId(attributeChange.getArtId(), attributeChange.getBranch());
+ Artifact artifact = ArtifactQuery.getArtifactFromId(attributeChange.getArtId().getId().intValue(),
+ attributeChange.getBranch());
for (Attribute<?> attribute : artifact.getAttributes(attributeChange.getAttributeType())) {
- if (attribute.getId() == attributeChange.getAttrId()) {
- attribute.replaceWithVersion((int) attributeChange.getGamma());
+ if (attribute.getId() == attributeChange.getAttrId().getId().intValue()) {
+ attribute.replaceWithVersion(attributeChange.getGamma().getId().intValue());
break;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemConflictTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemConflictTest.java
index e0c5588c0e..71f2e5a195 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemConflictTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemConflictTest.java
@@ -14,6 +14,11 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItemUtil;
@@ -53,7 +58,7 @@ import org.junit.runners.Parameterized.Parameters;
*/
@RunWith(Parameterized.class)
public class ChangeItemConflictTest {
- private static final long GAMMA = 100L;
+ private static final GammaId GAMMA = GammaId.valueOf(100L);
private final ChangeItemCase srcCase;
private final ItemType itemType;
@@ -89,10 +94,11 @@ public class ChangeItemConflictTest {
// but since we don't seem to handle the mixed case of say artifact on src and attribute on destination
ChangeItem item;
if (itemType == ItemType.artifact) {
- item = ChangeItemUtil.newArtifactChange(0, 0, GAMMA, ModificationType.MODIFIED, ApplicabilityToken.BASE);
+ item = ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(0), ArtifactTypeId.valueOf(0), GAMMA,
+ ModificationType.MODIFIED, ApplicabilityToken.BASE);
} else {
- item = ChangeItemUtil.newAttributeChange(0, 0, 0, GAMMA, ModificationType.MODIFIED, "change",
- ApplicabilityToken.BASE);
+ item = ChangeItemUtil.newAttributeChange(AttributeId.valueOf(0), AttributeTypeId.valueOf(0),
+ ArtifactId.valueOf(0), GAMMA, ModificationType.MODIFIED, "change", ApplicabilityToken.BASE);
}
buildTestCase(GAMMA, item);
@@ -150,7 +156,7 @@ public class ChangeItemConflictTest {
data.add(new Object[] {testMessage, itemType, srcCase, dstCase});
}
- private void buildTestCase(long gamma, ChangeItem item) {
+ private void buildTestCase(GammaId gamma, ChangeItem item) {
changeVersion(item.getBaselineVersion(), gamma, ModificationType.MODIFIED);
switch (srcCase) {
@@ -158,10 +164,10 @@ public class ChangeItemConflictTest {
changeVersion(item.getCurrentVersion(), gamma, ModificationType.DELETED);
break;
case SRC_MOD:
- changeVersion(item.getCurrentVersion(), gamma + 1, ModificationType.MODIFIED);
+ changeVersion(item.getCurrentVersion(), GammaId.valueOf(gamma.getId() + 1), ModificationType.MODIFIED);
break;
case SRC_MRG:
- changeVersion(item.getCurrentVersion(), gamma + 2, ModificationType.MERGED);
+ changeVersion(item.getCurrentVersion(), GammaId.valueOf(gamma.getId() + 2), ModificationType.MERGED);
break;
case SRC_INT:
changeVersion(item.getCurrentVersion(), gamma, ModificationType.INTRODUCED);
@@ -175,10 +181,10 @@ public class ChangeItemConflictTest {
changeVersion(item.getDestinationVersion(), gamma, ModificationType.DELETED);
break;
case DST_MOD:
- changeVersion(item.getDestinationVersion(), gamma + 3, ModificationType.MODIFIED);
+ changeVersion(item.getDestinationVersion(), GammaId.valueOf(gamma.getId() + 3), ModificationType.MODIFIED);
break;
case DST_MRG:
- changeVersion(item.getCurrentVersion(), gamma + 4, ModificationType.MERGED);
+ changeVersion(item.getCurrentVersion(), GammaId.valueOf(gamma.getId() + 4), ModificationType.MERGED);
break;
case DST_INT:
changeVersion(item.getCurrentVersion(), gamma, ModificationType.INTRODUCED);
@@ -188,7 +194,7 @@ public class ChangeItemConflictTest {
}
}
- private void changeVersion(ChangeVersion version, Long gammaId, ModificationType modType) {
+ private void changeVersion(ChangeVersion version, GammaId gammaId, ModificationType modType) {
version.setGammaId(gammaId);
version.setModType(modType);
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeTestUtility.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeTestUtility.java
index e7c2df8622..cee429bb94 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeTestUtility.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ChangeTestUtility.java
@@ -11,6 +11,9 @@
package org.eclipse.osee.orcs.db.internal.change;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeVersion;
@@ -26,7 +29,7 @@ public final class ChangeTestUtility {
}
public static ChangeVersion createChange(Long long1, ModificationType mod1) {
- return new ChangeVersion(long1, mod1, ApplicabilityToken.BASE);
+ return new ChangeVersion(GammaId.valueOf(long1), mod1, ApplicabilityToken.BASE);
}
public static void checkChange(String message, ChangeVersion expected, ChangeVersion actual) {
@@ -40,12 +43,12 @@ public final class ChangeTestUtility {
checkChange(null, expected, actual);
}
- public static ChangeItem createItem(int itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net) {
+ public static ChangeItem createItem(Long itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net) {
ChangeItem change = new ChangeItem();
- change.setItemId(itemId);
- change.setItemTypeId(itemId * 10);
- change.setArtId(itemId * 100);
+ change.setItemId(ArtifactId.valueOf(itemId));
+ change.setItemTypeId(ArtifactTypeId.valueOf(itemId * 10));
+ change.setArtId(ArtifactId.valueOf(itemId * 100));
ChangeVersion currentVersion = change.getCurrentVersion();
currentVersion.setGammaId(current.getGammaId());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ComputeNetChangeTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ComputeNetChangeTest.java
index 1e764ae574..65dddace8f 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ComputeNetChangeTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/ComputeNetChangeTest.java
@@ -39,56 +39,56 @@ public class ComputeNetChangeTest {
List<TestData> data = new ArrayList<>();
// New Or Introduced
- data.add(createTest(1, entry(3L, NEW), entry(4L, NEW), entry(5L, MODIFIED), null, entry(5L, NEW), false));
- data.add(
- createTest(2, entry(3L, NEW), entry(6L, INTRODUCED), entry(7L, MODIFIED), null, entry(7L, INTRODUCED), false));
- data.add(createTest(3, entry(3L, NEW), null, entry(7693330L, INTRODUCED), entry(7693330L, NEW),
+ data.add(createTest(1L, entry(3L, NEW), entry(4L, NEW), entry(5L, MODIFIED), null, entry(5L, NEW), false));
+ data.add(createTest(2L, entry(3L, NEW), entry(6L, INTRODUCED), entry(7L, MODIFIED), null, entry(7L, INTRODUCED),
+ false));
+ data.add(createTest(3L, entry(3L, NEW), null, entry(7693330L, INTRODUCED), entry(7693330L, NEW),
entry(7693330L, INTRODUCED), false));
// Modified Once
- data.add(createTest(4, entry(10L, MODIFIED), null, entry(11L, MODIFIED), entry(10L, MODIFIED),
+ data.add(createTest(4L, entry(10L, MODIFIED), null, entry(11L, MODIFIED), entry(10L, MODIFIED),
entry(11L, MODIFIED), false));
// Modified Twice
- data.add(createTest(5, entry(10L, NEW), entry(11L, MODIFIED), entry(12L, MODIFIED), entry(10L, NEW),
+ data.add(createTest(5L, entry(10L, NEW), entry(11L, MODIFIED), entry(12L, MODIFIED), entry(10L, NEW),
entry(12L, MODIFIED), false));
// Removal - new/intro and deleted
- data.add(createTest(6, entry(3L, NEW), entry(1L, NEW), entry(2L, DELETED), null, null, true));
- data.add(createTest(7, entry(3L, NEW), entry(2L, INTRODUCED), entry(3L, DELETED), null, null, true));
- data.add(createTest(8, entry(3L, NEW), entry(4L, NEW), entry(5L, ARTIFACT_DELETED), null, null, true));
- data.add(createTest(9, entry(3L, NEW), entry(6L, INTRODUCED), entry(7L, ARTIFACT_DELETED), null, null, true));
- data.add(createTest(10, entry(3L, NEW), null, entry(21345L, NEW), entry(21345L, NEW), null, true));
- data.add(createTest(11, entry(3L, NEW), null, entry(1L, NEW), entry(2L, MODIFIED), null, entry(1L, NEW), false));
- data.add(createTest(12, entry(3L, NEW), null, entry(1L, INTRODUCED), entry(2L, DELETED), null, null, true));
+ data.add(createTest(6L, entry(3L, NEW), entry(1L, NEW), entry(2L, DELETED), null, null, true));
+ data.add(createTest(7L, entry(3L, NEW), entry(2L, INTRODUCED), entry(3L, DELETED), null, null, true));
+ data.add(createTest(8L, entry(3L, NEW), entry(4L, NEW), entry(5L, ARTIFACT_DELETED), null, null, true));
+ data.add(createTest(9L, entry(3L, NEW), entry(6L, INTRODUCED), entry(7L, ARTIFACT_DELETED), null, null, true));
+ data.add(createTest(10L, entry(3L, NEW), null, entry(21345L, NEW), entry(21345L, NEW), null, true));
+ data.add(createTest(11L, entry(3L, NEW), null, entry(1L, NEW), entry(2L, MODIFIED), null, entry(1L, NEW), false));
+ data.add(createTest(12L, entry(3L, NEW), null, entry(1L, INTRODUCED), entry(2L, DELETED), null, null, true));
// Undelete then delete again (Resurrected) not ignored
- data.add(createTest(13, entry(2L, DELETED), entry(3L, MODIFIED), entry(4L, DELETED), entry(5L, DELETED),
+ data.add(createTest(13L, entry(2L, DELETED), entry(3L, MODIFIED), entry(4L, DELETED), entry(5L, DELETED),
entry(4L, DELETED), false));
- data.add(createTest(14, entry(2L, ARTIFACT_DELETED), null, entry(4L, ARTIFACT_DELETED),
+ data.add(createTest(14L, entry(2L, ARTIFACT_DELETED), null, entry(4L, ARTIFACT_DELETED),
entry(5L, ARTIFACT_DELETED), entry(4L, ARTIFACT_DELETED), false));
// Delete Cases -
- data.add(createTest(15, entry(10L, MODIFIED), null, entry(10L, DELETED), entry(10L, MODIFIED),
+ data.add(createTest(15L, entry(10L, MODIFIED), null, entry(10L, DELETED), entry(10L, MODIFIED),
entry(10L, DELETED), false));
- data.add(createTest(16, entry(330L, NEW), null, entry(331L, ARTIFACT_DELETED), entry(330L, NEW),
+ data.add(createTest(16L, entry(330L, NEW), null, entry(331L, ARTIFACT_DELETED), entry(330L, NEW),
entry(331L, ARTIFACT_DELETED), false));
- data.add(createTest(17, entry(330L, NEW), entry(331L, ARTIFACT_DELETED), entry(331L, ARTIFACT_DELETED),
+ data.add(createTest(17L, entry(330L, NEW), entry(331L, ARTIFACT_DELETED), entry(331L, ARTIFACT_DELETED),
entry(330L, NEW), entry(331L, ARTIFACT_DELETED), false));
// Parent to Child Intro
- data.add(createTest(18, null, entry(10L, INTRODUCED), entry(11L, MODIFIED), entry(10L, MODIFIED),
+ data.add(createTest(18L, null, entry(10L, INTRODUCED), entry(11L, MODIFIED), entry(10L, MODIFIED),
entry(11L, MODIFIED), false));
// Attribute Modified/New
- data.add(createTest(19, null, null, entry(11L, MODIFIED), null, entry(11L, NEW), false));
+ data.add(createTest(19L, null, null, entry(11L, MODIFIED), null, entry(11L, NEW), false));
// Test Merge Items
- data.add(createTest(20, null, null, entry(12L, MODIFIED), null, entry(13L, MERGED), entry(13L, MERGED), false));
- data.add(createTest(21, null, null, entry(12L, NEW), null, entry(14L, MERGED), entry(14L, MERGED), false));
- data.add(createTest(22, entry(96915L, MODIFIED), entry(7290448L, MODIFIED), entry(7865315L, DELETED),
+ data.add(createTest(20L, null, null, entry(12L, MODIFIED), null, entry(13L, MERGED), entry(13L, MERGED), false));
+ data.add(createTest(21L, null, null, entry(12L, NEW), null, entry(14L, MERGED), entry(14L, MERGED), false));
+ data.add(createTest(22L, entry(96915L, MODIFIED), entry(7290448L, MODIFIED), entry(7865315L, DELETED),
entry(7432082L, MODIFIED), entry(7865315L, MERGED), entry(7865315L, DELETED), false));
- data.add(createTest(21, entry(96915L, MODIFIED), entry(7290448L, MODIFIED), entry(7865315L, ARTIFACT_DELETED),
+ data.add(createTest(21L, entry(96915L, MODIFIED), entry(7290448L, MODIFIED), entry(7865315L, ARTIFACT_DELETED),
entry(7432082L, MODIFIED), entry(7865315L, MERGED), entry(7865315L, ARTIFACT_DELETED), false));
return data;
@@ -127,18 +127,18 @@ public class ComputeNetChangeTest {
List<ChangeItem> items = new ArrayList<>();
// Source to Non-Parent commit
- items.add(ChangeTestUtility.createItem(3, entry(10L, MODIFIED), null, entry(11L, MODIFIED), null, null));
+ items.add(ChangeTestUtility.createItem(3L, entry(10L, MODIFIED), null, entry(11L, MODIFIED), null, null));
Callable<List<ChangeItem>> callable = new ComputeNetChangeCallable(items);
callable.call();
}
- private static TestData createTest(int itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion expected, boolean isRemoved) {
+ private static TestData createTest(Long itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion expected, boolean isRemoved) {
return new TestData(ChangeTestUtility.createItem(itemId, base, first, current, destination, null), expected,
isRemoved);
}
- private static TestData createTest(int itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net, ChangeVersion expected, boolean isRemoved) {
+ private static TestData createTest(Long itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion net, ChangeVersion expected, boolean isRemoved) {
return new TestData(ChangeTestUtility.createItem(itemId, base, first, current, destination, net), expected,
isRemoved);
}
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 d12b75b4de..bfa5ef51ea 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
@@ -17,14 +17,19 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Collection;
import java.util.HashMap;
-import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
-import java.util.Set;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
+import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.DemoBranches;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -125,7 +130,6 @@ public class MissingChangeItemFactoryTest {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
LoadDataHandler handler = (LoadDataHandler) invocation.getArguments()[1];
- Set<Integer> missingArtIds = new LinkedHashSet<>();
if (artifactData != null) {
for (ArtifactData data : artifactData) {
handler.onData(data);
@@ -192,8 +196,9 @@ public class MissingChangeItemFactoryTest {
HashMap<Long, ApplicabilityToken> applicMap = new HashMap<>();
applicMap.put(1L, ApplicabilityToken.BASE);
- ChangeItem ci1 = ChangeItemUtil.newAttributeChange(ci1AttrId, 2, artId, 4L, ModificationType.MODIFIED,
- Strings.EMPTY_STRING, ApplicabilityToken.BASE);
+ ChangeItem ci1 = ChangeItemUtil.newAttributeChange(AttributeId.valueOf(ci1AttrId), AttributeTypeId.valueOf(2),
+ ArtifactId.valueOf(artId), GammaId.valueOf(4L), ModificationType.MODIFIED, Strings.EMPTY_STRING,
+ ApplicabilityToken.BASE);
changes.add(ci1);
List<AttributeData> attrDatas = new LinkedList<>();
@@ -222,14 +227,14 @@ public class MissingChangeItemFactoryTest {
final long missingGamma = 9L;
long artGamma = 7L;
- int relId = 6;
+ RelationId relId = RelationId.valueOf(6);
int artA = 65;
int artB = 2;
- long srcGamma = 7L;
+ GammaId srcGamma = GammaId.valueOf(7L);
HashMap<Long, ApplicabilityToken> applicMap = new HashMap<>();
applicMap.put(1L, ApplicabilityToken.BASE);
- ChangeItem ci1 = ChangeItemUtil.newRelationChange(relId, 0, srcGamma, ModificationType.NEW, artA, artB, "",
- ApplicabilityToken.BASE);
+ ChangeItem ci1 = ChangeItemUtil.newRelationChange(relId, RelationTypeId.valueOf(0), srcGamma,
+ ModificationType.NEW, ArtifactId.valueOf(artA), ArtifactId.valueOf(artB), "", ApplicabilityToken.BASE);
changes.add(ci1);
List<AttributeData> attrDatas = new LinkedList<>();
@@ -267,8 +272,9 @@ public class MissingChangeItemFactoryTest {
final int artId = 3;
HashMap<Long, ApplicabilityToken> applicMap = new HashMap<>();
applicMap.put(1L, ApplicabilityToken.BASE);
- ChangeItem ci1 = ChangeItemUtil.newAttributeChange(22, 2, artId, 4L, ModificationType.DELETED,
- Strings.EMPTY_STRING, ApplicabilityToken.BASE);
+ ChangeItem ci1 = ChangeItemUtil.newAttributeChange(AttributeId.valueOf(22), AttributeTypeId.valueOf(2),
+ ArtifactId.valueOf(artId), GammaId.valueOf(4L), ModificationType.DELETED, Strings.EMPTY_STRING,
+ ApplicabilityToken.BASE);
changes.add(ci1);
List<AttributeData> attrDatas = new LinkedList<>();
@@ -294,21 +300,23 @@ public class MissingChangeItemFactoryTest {
*/
private static Object[] testCase_artifactDeletedAttribute() {
List<ChangeItem> changes = new LinkedList<>();
- final int artId = 3;
+ final ArtifactId artId = ArtifactId.valueOf(3);
HashMap<Long, ApplicabilityToken> applicMap = new HashMap<>();
applicMap.put(1L, ApplicabilityToken.BASE);
- ChangeItem ci1 = ChangeItemUtil.newAttributeChange(22, 2, artId, 4L, ModificationType.ARTIFACT_DELETED,
- Strings.EMPTY_STRING, ApplicabilityToken.BASE);
+ ChangeItem ci1 = ChangeItemUtil.newAttributeChange(AttributeId.valueOf(22), AttributeTypeId.valueOf(2), artId,
+ GammaId.valueOf(4L), ModificationType.ARTIFACT_DELETED, Strings.EMPTY_STRING, ApplicabilityToken.BASE);
changes.add(ci1);
List<AttributeData> attrDatas = new LinkedList<>();
- AttributeData attrData1 = createAttributeData(artId, 33, 1L, ModificationType.ARTIFACT_DELETED);
- AttributeData attrData2 = createAttributeData(artId, 44 + 1, 67L, ModificationType.ARTIFACT_DELETED);
+ AttributeData attrData1 =
+ createAttributeData(artId.getId().intValue(), 33, 1L, ModificationType.ARTIFACT_DELETED);
+ AttributeData attrData2 =
+ createAttributeData(artId.getId().intValue(), 44 + 1, 67L, ModificationType.ARTIFACT_DELETED);
attrDatas.add(attrData1);
attrDatas.add(attrData2);
List<ArtifactData> artData = new LinkedList<>();
- ArtifactData artData1 = createArtifactData(artId, 89L, ModificationType.DELETED);
+ ArtifactData artData1 = createArtifactData(artId.getId().intValue(), 89L, ModificationType.DELETED);
artData.add(artData1);
List<ChangeItem> expected = new LinkedList<>();
@@ -328,25 +336,27 @@ public class MissingChangeItemFactoryTest {
}
private static ChangeItem createExpected(RelationData data) {
- return ChangeItemUtil.newRelationChange(data.getLocalId(), 0, data.getVersion().getGammaId(),
- determineModType(data), data.getArtIdA(), data.getArtIdB(), "", ApplicabilityToken.BASE);
+ return ChangeItemUtil.newRelationChange(RelationId.valueOf(data.getLocalId()), RelationTypeId.valueOf(0),
+ GammaId.valueOf(data.getVersion().getGammaId()), determineModType(data), ArtifactId.valueOf(data.getArtIdA()),
+ ArtifactId.valueOf(data.getArtIdB()), "", ApplicabilityToken.BASE);
}
private static ChangeItem createExpected(AttributeData data) {
- return ChangeItemUtil.newAttributeChange(data.getLocalId(), 0, data.getArtifactId(),
- data.getVersion().getGammaId(), determineModType(data), "", ApplicabilityToken.BASE);
+ return ChangeItemUtil.newAttributeChange(data, AttributeTypeId.valueOf(0),
+ ArtifactId.valueOf(data.getArtifactId()), GammaId.valueOf(data.getVersion().getGammaId()),
+ determineModType(data), "", ApplicabilityToken.BASE);
}
private static ChangeItem createExpected(ArtifactData data) {
- return ChangeItemUtil.newArtifactChange(data.getLocalId(), 0, data.getVersion().getGammaId(),
- determineModType(data), ApplicabilityToken.BASE);
+ return ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(data.getLocalId()), ArtifactTypeId.valueOf(0),
+ GammaId.valueOf(data.getVersion().getGammaId()), determineModType(data), ApplicabilityToken.BASE);
}
private ChangeItem getMatchingChangeItem(ChangeItem item) {
for (ChangeItem change : expectedMissingChanges) {
- if (change.getItemId() == item.getItemId() && //
- change.getArtId() == item.getArtId() && //
- change.getClass().getSimpleName().equals(item.getClass().getSimpleName())) {
+ if (change.getItemId().equals(item.getItemId()) && //
+ change.getArtId().equals(item.getArtId()) && //
+ change.getClass().getSimpleName().equals(item.getClass().getSimpleName())) {
return change;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java
index da55134acc..0db4c40fae 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java
@@ -15,10 +15,13 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ConflictStatus;
import org.eclipse.osee.framework.core.enums.ConflictType;
import org.eclipse.osee.framework.core.enums.StorageState;
import org.eclipse.osee.framework.core.model.MergeBranch;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.jdbc.JdbcStatement;
@@ -50,9 +53,9 @@ public class DatabaseConflictAccessor {
public void load(Collection<Conflict> conflicts, MergeBranch mergeBranch) throws OseeCoreException {
Consumer<JdbcStatement> consumer = stmt -> {
- int uniqueId = stmt.getInt("conflict_id");
- Long sourceGammaId = stmt.getLong("source_gamma_id");
- Long destGammaId = stmt.getLong("dest_gamma_id");
+ Id uniqueId = ArtifactId.valueOf(stmt.getLong("conflict_id"));
+ GammaId sourceGammaId = GammaId.valueOf(stmt.getLong("source_gamma_id"));
+ GammaId destGammaId = GammaId.valueOf(stmt.getLong("dest_gamma_id"));
ConflictType conflictType = ConflictType.valueOf(stmt.getInt("conflict_type"));
ConflictStatus status = ConflictStatus.valueOf(stmt.getInt("status"));
conflicts.add(
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
index 682d2404d7..6f82b33c21 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
@@ -129,13 +129,13 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
for (ChangeItem change : changes) {
switch (change.getChangeType()) {
case ARTIFACT_CHANGE:
- updater.addArtifact(change.getItemId());
+ updater.addArtifact(change.getItemId().getId().intValue());
break;
case ATTRIBUTE_CHANGE:
- updater.addAttribute(change.getItemId());
+ updater.addAttribute(change.getItemId().getId().intValue());
break;
case RELATION_CHANGE:
- updater.addRelation(change.getItemId());
+ updater.addRelation(change.getItemId().getId().intValue());
break;
default:
throw new OseeStateException("Unexpected change type");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AddArtifactChangeDataCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AddArtifactChangeDataCallable.java
index ca8d385b88..d3d8e273b8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AddArtifactChangeDataCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AddArtifactChangeDataCallable.java
@@ -15,6 +15,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.osee.executor.admin.CancellableCallable;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItemUtil;
@@ -29,7 +32,7 @@ public class AddArtifactChangeDataCallable extends CancellableCallable<List<Chan
@Override
public List<ChangeItem> call() throws Exception {
- Map<Integer, ChangeItem> artifactChanges = new HashMap<>();
+ Map<ArtifactId, ChangeItem> artifactChanges = new HashMap<>();
for (ChangeItem item : changeItems) {
if (item.getChangeType().isArtifactChange()) {
artifactChanges.put(item.getArtId(), item);
@@ -37,17 +40,18 @@ public class AddArtifactChangeDataCallable extends CancellableCallable<List<Chan
}
List<ChangeItem> attrItems = new ArrayList<>();
- Map<Integer, ChangeItem> syntheticArtifactChanges = new HashMap<>();
+ Map<ArtifactId, ChangeItem> syntheticArtifactChanges = new HashMap<>();
for (ChangeItem item : changeItems) {
if (item.getChangeType().isAttributeChange()) {
ChangeItem attributeChange = item;
- Integer artIdToCheck = attributeChange.getArtId();
+ ArtifactId artIdToCheck = attributeChange.getArtId();
ChangeItem artifactChange = artifactChanges.get(artIdToCheck);
if (artifactChange == null) {
artifactChange = syntheticArtifactChanges.get(artIdToCheck);
if (artifactChange == null) {
- artifactChange = ChangeItemUtil.newArtifactChange(artIdToCheck, -1, -1, null, null);
+ artifactChange = ChangeItemUtil.newArtifactChange(artIdToCheck, ArtifactTypeId.valueOf(-1),
+ GammaId.valueOf(-1), null, null);
syntheticArtifactChanges.put(artIdToCheck, artifactChange);
artifactChange.setSynthetic(true);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java
index a645c29ef7..d7aa013414 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java
@@ -16,7 +16,14 @@ import java.util.List;
import java.util.function.Consumer;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
+import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
@@ -96,16 +103,16 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
"Unable to compute deltas between transactions on the same branch [%s]", sourceBranch);
TransactionId sourceBaselineTxId = getJdbcClient().fetch(TransactionId.SENTINEL, SELECT_BASE_TX, sourceBranch);
- DoubleKeyHashMap<Integer, Integer, ChangeItem> newChangeData = this.loadSourceBranchChanges(sourceBaselineTxId);
+ DoubleKeyHashMap<Integer, Long, ChangeItem> newChangeData = this.loadSourceBranchChanges(sourceBaselineTxId);
return loadItemsbyId(newChangeData, sourceBaselineTxId);
}
- private List<ChangeItem> loadItemsbyId(DoubleKeyHashMap<Integer, Integer, ChangeItem> changeData, TransactionId sourceBaselineTxId) {
+ private List<ChangeItem> loadItemsbyId(DoubleKeyHashMap<Integer, Long, ChangeItem> changeData, TransactionId sourceBaselineTxId) {
ExportImportJoinQuery idJoin = joinFactory.createExportImportJoinQuery();
try {
for (Integer i : changeData.getKeySetOne()) {
for (ChangeItem item : changeData.allValues(i)) {
- idJoin.add(Long.valueOf(i), Long.valueOf(item.getItemId()));
+ idJoin.add(Long.valueOf(i), item.getItemId().getId());
}
}
idJoin.store();
@@ -124,37 +131,37 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
return list;
}
- private DoubleKeyHashMap<Integer, Integer, ChangeItem> loadSourceBranchChanges(TransactionId sourceBaselineTxId) throws OseeCoreException {
- DoubleKeyHashMap<Integer, Integer, ChangeItem> hashChangeData =
- new DoubleKeyHashMap<Integer, Integer, ChangeItem>();
+ private DoubleKeyHashMap<Integer, Long, ChangeItem> loadSourceBranchChanges(TransactionId sourceBaselineTxId) throws OseeCoreException {
+ DoubleKeyHashMap<Integer, Long, ChangeItem> hashChangeData = new DoubleKeyHashMap<>();
Consumer<JdbcStatement> consumer = stmt -> {
checkForCancelled();
- Long gammaId = stmt.getLong("gamma_id");
+ GammaId gammaId = GammaId.valueOf(stmt.getLong("gamma_id"));
ModificationType modType = ModificationType.getMod(stmt.getInt("mod_type"));
ApplicabilityId appId = ApplicabilityId.valueOf(stmt.getLong("app_id"));
int tableType = stmt.getInt("table_type");
- int itemId = stmt.getInt("item_id");
+ Long itemId = stmt.getLong("item_id");
Long itemTypeId = stmt.getLong("item_type_id");
switch (tableType) {
case 1:
- int artId = stmt.getInt("item_first");
+ ArtifactId artId = ArtifactId.valueOf(stmt.getLong("item_first"));
String value = stmt.getString("item_value");
- hashChangeData.put(1, itemId, ChangeItemUtil.newAttributeChange(itemId, itemTypeId, artId, gammaId,
- modType, value, getApplicabilityToken(appId)));
+ hashChangeData.put(1, itemId, ChangeItemUtil.newAttributeChange(AttributeId.valueOf(itemId),
+ AttributeTypeId.valueOf(itemTypeId), artId, gammaId, modType, value, getApplicabilityToken(appId)));
break;
case 2: {
- hashChangeData.put(2, itemId,
- ChangeItemUtil.newArtifactChange(itemId, itemTypeId, gammaId, modType, getApplicabilityToken(appId)));
+ hashChangeData.put(2, itemId, ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(itemId),
+ ArtifactTypeId.valueOf(itemTypeId), gammaId, modType, getApplicabilityToken(appId)));
break;
}
case 3: {
- int aArtId = stmt.getInt("item_first");
- int bArtId = stmt.getInt("item_second");
+ ArtifactId aArtId = ArtifactId.valueOf(stmt.getLong("item_first"));
+ ArtifactId bArtId = ArtifactId.valueOf(stmt.getLong("item_second"));
String rationale = stmt.getString("item_value");
- hashChangeData.put(3, itemId, ChangeItemUtil.newRelationChange(itemId, itemTypeId, gammaId, modType,
- aArtId, bArtId, rationale, getApplicabilityToken(appId)));
+ hashChangeData.put(3, itemId,
+ ChangeItemUtil.newRelationChange(RelationId.valueOf(itemId), RelationTypeId.valueOf(itemTypeId),
+ gammaId, modType, aArtId, bArtId, rationale, getApplicabilityToken(appId)));
break;
}
}
@@ -165,14 +172,14 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
return hashChangeData;
}
- private void loadCurrentVersionData(ExportImportJoinQuery idJoin, DoubleKeyHashMap<Integer, Integer, ChangeItem> changesByItemId, BranchId txBranchId, TransactionId txId, boolean isMergeBranch) throws OseeCoreException {
+ private void loadCurrentVersionData(ExportImportJoinQuery idJoin, DoubleKeyHashMap<Integer, Long, ChangeItem> changesByItemId, BranchId txBranchId, TransactionId txId, boolean isMergeBranch) throws OseeCoreException {
Consumer<JdbcStatement> consumer = stmt -> {
checkForCancelled();
- Integer itemId = stmt.getInt("item_id");
+ Long itemId = stmt.getLong("item_id");
Integer tableType = stmt.getInt("table_type");
ApplicabilityId appId = ApplicabilityId.valueOf(stmt.getLong("app_id"));
- Long gammaId = stmt.getLong("gamma_id");
+ GammaId gammaId = GammaId.valueOf(stmt.getLong("gamma_id"));
ChangeItem change = changesByItemId.get(tableType, itemId);
if (isMergeBranch) {
@@ -188,14 +195,14 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
String query =
"select txs.gamma_id, txs.mod_type, txs.app_id, item.art_id as item_id, 2 as table_type from osee_join_export_import idj," + //
- " osee_artifact item, osee_txs txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2" + //
- " and item.gamma_id = txs.gamma_id and txs.tx_current <> ? and txs.branch_id = ? and txs.transaction_id <= ?" + //
- " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.attr_id as item_id, 1 as table_type from osee_join_export_import idj," + //
- " osee_attribute item, osee_txs txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1" + //
- " and item.gamma_id = txs.gamma_id and txs.tx_current <> ? and txs.branch_id = ? and txs.transaction_id <= ?" + //
- " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.rel_link_id as item_id, 3 as table_type from osee_join_export_import idj," + //
- " osee_relation_link item, osee_txs txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3" + //
- " and item.gamma_id = txs.gamma_id and txs.tx_current <> ? and txs.branch_id = ? and txs.transaction_id <= ?";
+ " osee_artifact item, osee_txs txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2" + //
+ " and item.gamma_id = txs.gamma_id and txs.tx_current <> ? and txs.branch_id = ? and txs.transaction_id <= ?" + //
+ " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.attr_id as item_id, 1 as table_type from osee_join_export_import idj," + //
+ " osee_attribute item, osee_txs txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1" + //
+ " and item.gamma_id = txs.gamma_id and txs.tx_current <> ? and txs.branch_id = ? and txs.transaction_id <= ?" + //
+ " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.rel_link_id as item_id, 3 as table_type from osee_join_export_import idj," + //
+ " osee_relation_link item, osee_txs txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3" + //
+ " and item.gamma_id = txs.gamma_id and txs.tx_current <> ? and txs.branch_id = ? and txs.transaction_id <= ?";
getJdbcClient().runQuery(consumer, JdbcConstants.JDBC__MAX_FETCH_SIZE, query, idJoin.getQueryId(),
TxChange.NOT_CURRENT.getValue(), txBranchId, txId, idJoin.getQueryId(), TxChange.NOT_CURRENT.getValue(),
@@ -203,33 +210,33 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
}
- private void loadNonCurrentSourceVersionData(ExportImportJoinQuery idJoin, DoubleKeyHashMap<Integer, Integer, ChangeItem> changesByItemId, TransactionId sourceBaselineTxId) throws OseeCoreException {
+ private void loadNonCurrentSourceVersionData(ExportImportJoinQuery idJoin, DoubleKeyHashMap<Integer, Long, ChangeItem> changesByItemId, TransactionId sourceBaselineTxId) throws OseeCoreException {
try (JdbcStatement chStmt = getJdbcClient().getStatement()) {
String query =
"select * from (select null as value, item.art_id as item_id, txs.gamma_id, txs.mod_type, txs.app_id, txs.transaction_id, idj.id2, 2 as table_type from osee_join_export_import idj, " + //
- "osee_artifact item, osee_txs txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2 " + //
- "and item.gamma_id = txs.gamma_id and txs.tx_current = ? and txs.branch_id = ? " + //
- "union all select item.value as value, item.attr_id as item_id, txs.gamma_id, txs.mod_type, txs.app_id, txs.transaction_id, idj.id2, 1 as table_type from osee_join_export_import idj, " + //
- "osee_attribute item, osee_txs txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1 " + //
- "and item.gamma_id = txs.gamma_id and txs.tx_current = ? and txs.branch_id = ? " + //
- "union all select null as value, item.rel_link_id as item_id, txs.gamma_id, txs.mod_type, txs.app_id, txs.transaction_id, idj.id2, 3 as table_type from osee_join_export_import idj, " + //
- "osee_relation_link item, osee_txs txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3 " + //
- "and item.gamma_id = txs.gamma_id and txs.tx_current = ? and txs.branch_id = ?) t order by t.id2, t.transaction_id asc";
+ "osee_artifact item, osee_txs txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2 " + //
+ "and item.gamma_id = txs.gamma_id and txs.tx_current = ? and txs.branch_id = ? " + //
+ "union all select item.value as value, item.attr_id as item_id, txs.gamma_id, txs.mod_type, txs.app_id, txs.transaction_id, idj.id2, 1 as table_type from osee_join_export_import idj, " + //
+ "osee_attribute item, osee_txs txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1 " + //
+ "and item.gamma_id = txs.gamma_id and txs.tx_current = ? and txs.branch_id = ? " + //
+ "union all select null as value, item.rel_link_id as item_id, txs.gamma_id, txs.mod_type, txs.app_id, txs.transaction_id, idj.id2, 3 as table_type from osee_join_export_import idj, " + //
+ "osee_relation_link item, osee_txs txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3 " + //
+ "and item.gamma_id = txs.gamma_id and txs.tx_current = ? and txs.branch_id = ?) t order by t.id2, t.transaction_id asc";
chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, idJoin.getQueryId(),
TxChange.NOT_CURRENT.getValue(), sourceBranch, idJoin.getQueryId(), TxChange.NOT_CURRENT.getValue(),
sourceBranch, idJoin.getQueryId(), TxChange.NOT_CURRENT.getValue(), sourceBranch);
- int previousItemId = -1;
+ Long previousItemId = -1L;
boolean isFirstSet = false;
while (chStmt.next()) {
checkForCancelled();
- Integer itemId = chStmt.getInt("item_id");
+ Long itemId = chStmt.getLong("item_id");
Integer tableType = chStmt.getInt("table_type");
Long transactionId = chStmt.getLong("transaction_id");
ApplicabilityId appId = ApplicabilityId.valueOf(chStmt.getLong("app_id"));
ModificationType modType = ModificationType.getMod(chStmt.getInt("mod_type"));
- Long gammaId = chStmt.getLong("gamma_id");
+ GammaId gammaId = GammaId.valueOf(chStmt.getLong("gamma_id"));
String value = chStmt.getString("value");
@@ -248,10 +255,10 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
}
}
- private void setVersionData(ChangeVersion versionedChange, Long gammaId, ModificationType modType, String value, ApplicabilityId appId) {
+ private void setVersionData(ChangeVersion versionedChange, GammaId gammaId, ModificationType modType, String value, ApplicabilityId appId) {
// Tolerates the case of having more than one version of an item on a
// baseline transaction by picking the most recent one
- if (versionedChange.getGammaId() == null || versionedChange.getGammaId().compareTo(gammaId) < 0) {
+ if (versionedChange.getGammaId() == null || versionedChange.getGammaId().getId().compareTo(gammaId.getId()) < 0) {
versionedChange.setValue(value);
versionedChange.setModType(modType);
versionedChange.setGammaId(gammaId);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
index f4a63e6a17..12dd5e3eea 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
@@ -16,6 +16,13 @@ import java.util.List;
import java.util.function.Consumer;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
+import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -100,40 +107,40 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
Integer archived = result.intValue();
boolean isArchived = archived.equals(BranchArchivedState.ARCHIVED.getValue());
- DoubleKeyHashMap<Integer, Integer, ChangeItem> hashChangeData = loadChangesAtEndTx(isArchived);
+ DoubleKeyHashMap<Integer, Long, ChangeItem> hashChangeData = loadChangesAtEndTx(isArchived);
return loadItemsByItemId(hashChangeData, isArchived);
}
- private DoubleKeyHashMap<Integer, Integer, ChangeItem> loadChangesAtEndTx(boolean isArchived) throws OseeCoreException {
- DoubleKeyHashMap<Integer, Integer, ChangeItem> hashChangeData =
- new DoubleKeyHashMap<Integer, Integer, ChangeItem>();
+ private DoubleKeyHashMap<Integer, Long, ChangeItem> loadChangesAtEndTx(boolean isArchived) throws OseeCoreException {
+ DoubleKeyHashMap<Integer, Long, ChangeItem> hashChangeData = new DoubleKeyHashMap<>();
Consumer<JdbcStatement> consumer = stmt -> {
checkForCancelled();
- Long gammaId = stmt.getLong("gamma_id");
+ GammaId gammaId = GammaId.valueOf(stmt.getLong("gamma_id"));
ModificationType modType = ModificationType.getMod(stmt.getInt("mod_type"));
ApplicabilityId appId = ApplicabilityId.valueOf(stmt.getLong("app_id"));
int tableType = stmt.getInt("table_type");
- int itemId = stmt.getInt("item_id");
+ Long itemId = stmt.getLong("item_id");
Long itemTypeId = stmt.getLong("item_type_id");
switch (tableType) {
case 1: {
- int artId = stmt.getInt("item_first");
+ ArtifactId artId = ArtifactId.valueOf(stmt.getLong("item_first"));
String value = stmt.getString("item_value");
- hashChangeData.put(1, itemId, ChangeItemUtil.newAttributeChange(itemId, itemTypeId, artId, gammaId,
- modType, value, getApplicabilityToken(appId)));
+ hashChangeData.put(1, itemId, ChangeItemUtil.newAttributeChange(AttributeId.valueOf(itemId),
+ AttributeTypeId.valueOf(itemTypeId), artId, gammaId, modType, value, getApplicabilityToken(appId)));
break;
}
case 2: {
- hashChangeData.put(2, itemId,
- ChangeItemUtil.newArtifactChange(itemId, itemTypeId, gammaId, modType, getApplicabilityToken(appId)));
+ hashChangeData.put(2, itemId, ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(itemId),
+ ArtifactTypeId.valueOf(itemTypeId), gammaId, modType, getApplicabilityToken(appId)));
break;
}
case 3: {
- int aArtId = stmt.getInt("item_first");
- int bArtId = stmt.getInt("item_second");
+ ArtifactId aArtId = ArtifactId.valueOf(stmt.getLong("item_first"));
+ ArtifactId bArtId = ArtifactId.valueOf(stmt.getLong("item_second"));
String rationale = stmt.getString("item_value");
- hashChangeData.put(3, itemId, ChangeItemUtil.newRelationChange(itemId, itemTypeId, gammaId, modType,
- aArtId, bArtId, rationale, getApplicabilityToken(appId)));
+ hashChangeData.put(3, itemId,
+ ChangeItemUtil.newRelationChange(RelationId.valueOf(itemId), RelationTypeId.valueOf(itemTypeId),
+ gammaId, modType, aArtId, bArtId, rationale, getApplicabilityToken(appId)));
break;
}
}
@@ -145,12 +152,12 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
return hashChangeData;
}
- private List<ChangeItem> loadItemsByItemId(DoubleKeyHashMap<Integer, Integer, ChangeItem> changeData, boolean isArchived) throws OseeCoreException {
+ private List<ChangeItem> loadItemsByItemId(DoubleKeyHashMap<Integer, Long, ChangeItem> changeData, boolean isArchived) throws OseeCoreException {
ExportImportJoinQuery idJoin = joinFactory.createExportImportJoinQuery();
try {
for (Integer i : changeData.getKeySetOne()) {
for (ChangeItem item : changeData.get(i)) {
- idJoin.add(Long.valueOf(i), Long.valueOf(item.getItemId()));
+ idJoin.add(Long.valueOf(i), item.getItemId().getId());
}
}
idJoin.store();
@@ -162,13 +169,13 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
return list;
}
- private void loadCurrentVersionData(int queryId, DoubleKeyHashMap<Integer, Integer, ChangeItem> changesByItemId, TransactionToken transactionLimit, boolean isArchived) throws OseeCoreException {
+ private void loadCurrentVersionData(int queryId, DoubleKeyHashMap<Integer, Long, ChangeItem> changesByItemId, TransactionToken transactionLimit, boolean isArchived) throws OseeCoreException {
Consumer<JdbcStatement> consumer = stmt -> {
checkForCancelled();
- Integer itemId = stmt.getInt("item_id");
+ Long itemId = stmt.getLong("item_id");
Integer tableType = stmt.getInt("table_type");
- Long gammaId = stmt.getLong("gamma_id");
+ GammaId gammaId = GammaId.valueOf(stmt.getLong("gamma_id"));
ApplicabilityId appId = ApplicabilityId.valueOf(stmt.getLong("app_id"));
ModificationType modType = ModificationType.getMod(stmt.getInt("mod_type"));
ChangeItem change = changesByItemId.get(tableType, itemId);
@@ -181,15 +188,15 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
String archiveTable = isArchived ? "osee_txs_archived" : "osee_txs";
String query = String.format(
"select txs.gamma_id, txs.mod_type, txs.app_id, item.art_id as item_id, 2 as table_type from osee_join_export_import idj," + //
- " osee_artifact item, %s txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2" + //
- " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + //
- " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.attr_id as item_id, 1 as table_type from osee_join_export_import idj," + //
- " osee_attribute item, %s txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1" + //
- " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + //
- " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.rel_link_id as item_id, 3 as table_type from osee_join_export_import idj," + //
- " osee_relation_link item, %s txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3" + //
- " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?",
- archiveTable, archiveTable, archiveTable);
+ " osee_artifact item, %s txs where idj.query_id = ? and idj.id2 = item.art_id and idj.id1 = 2" + //
+ " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + //
+ " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.attr_id as item_id, 1 as table_type from osee_join_export_import idj," + //
+ " osee_attribute item, %s txs where idj.query_id = ? and idj.id2 = item.attr_id and idj.id1 = 1" + //
+ " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?" + //
+ " union all select txs.gamma_id, txs.mod_type, txs.app_id, item.rel_link_id as item_id, 3 as table_type from osee_join_export_import idj," + //
+ " osee_relation_link item, %s txs where idj.query_id = ? and idj.id2 = item.rel_link_id and idj.id1 = 3" + //
+ " and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?", archiveTable,
+ archiveTable, archiveTable);
getJdbcClient().runQuery(consumer, JdbcConstants.JDBC__MAX_FETCH_SIZE, query, queryId,
transactionLimit.getBranchId(), transactionLimit, queryId, transactionLimit.getBranchId(), transactionLimit,
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 3aadad9a0c..56ca3528ed 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
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.change;
-import com.google.common.collect.LinkedListMultimap;
-import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -22,6 +20,12 @@ import java.util.Set;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
+import org.eclipse.osee.framework.core.data.GammaId;
+import org.eclipse.osee.framework.core.data.RelationId;
+import org.eclipse.osee.framework.core.data.RelationTypeId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.LoadLevel;
import org.eclipse.osee.framework.core.enums.ModificationType;
@@ -39,6 +43,8 @@ import org.eclipse.osee.orcs.core.ds.LoadDataHandlerAdapter;
import org.eclipse.osee.orcs.core.ds.OrcsData;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.search.ApplicabilityQuery;
+import com.google.common.collect.LinkedListMultimap;
+import com.google.common.collect.Multimap;
/**
* @author John Misinco
@@ -64,15 +70,15 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
switch (change.getChangeType()) {
case ARTIFACT_CHANGE:
if (!change.isSynthetic()) {
- modifiedArtIds.add(change.getArtId());
+ modifiedArtIds.add(change.getArtId().getId().intValue());
}
break;
case ATTRIBUTE_CHANGE:
- modifiedAttrIds.put(change.getArtId(), change.getItemId());
+ modifiedAttrIds.put(change.getArtId().getId().intValue(), change.getItemId().getId().intValue());
break;
case RELATION_CHANGE:
- modifiedRels.put(change.getArtId(), change.getItemId());
- modifiedRels.put(change.getArtIdB(), change.getItemId());
+ modifiedRels.put(change.getArtId().getId().intValue(), change.getItemId().getId().intValue());
+ modifiedRels.put(change.getArtIdB().getId().intValue(), change.getItemId().getId().intValue());
break;
default:
throw new OseeStateException("Unknonw change type detected [%s]", change);
@@ -209,24 +215,27 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
private ChangeItem createArtifactChangeItem(ArtifactData data) throws OseeCoreException {
ApplicabilityId appId = data.getApplicabilityId();
- ChangeItem artChange = ChangeItemUtil.newArtifactChange(data.getLocalId(), data.getTypeUuid(),
- data.getVersion().getGammaId(), determineModType(data), getApplicabilityToken(appId));
+ ChangeItem artChange = ChangeItemUtil.newArtifactChange(ArtifactId.valueOf(data.getLocalId()),
+ ArtifactTypeId.valueOf(data.getTypeUuid()), GammaId.valueOf(data.getVersion().getGammaId()),
+ determineModType(data), getApplicabilityToken(appId));
return artChange;
}
private ChangeItem createAttributeChangeItem(AttributeData data) throws OseeCoreException {
ApplicabilityId appId = data.getApplicabilityId();
- ChangeItem attrChange = ChangeItemUtil.newAttributeChange(data.getLocalId(), data.getTypeUuid(),
- data.getArtifactId(), data.getVersion().getGammaId(), determineModType(data),
- data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId));
+ ChangeItem attrChange = ChangeItemUtil.newAttributeChange(data, AttributeTypeId.valueOf(data.getTypeUuid()),
+ ArtifactId.valueOf(data.getArtifactId()), GammaId.valueOf(data.getVersion().getGammaId()),
+ determineModType(data), data.getDataProxy().getDisplayableString(), getApplicabilityToken(appId));
attrChange.getNetChange().copy(attrChange.getCurrentVersion());
return attrChange;
}
private ChangeItem createRelationChangeItem(RelationData data) throws OseeCoreException {
ApplicabilityId appId = data.getApplicabilityId();
- return ChangeItemUtil.newRelationChange(data.getLocalId(), data.getTypeUuid(), data.getVersion().getGammaId(),
- determineModType(data), data.getArtIdA(), data.getArtIdB(), data.getRationale(), getApplicabilityToken(appId));
+ return ChangeItemUtil.newRelationChange(RelationId.valueOf(data.getLocalId()),
+ RelationTypeId.valueOf(data.getTypeUuid()), GammaId.valueOf(data.getVersion().getGammaId()),
+ determineModType(data), ArtifactId.valueOf(data.getArtIdA()), ArtifactId.valueOf(data.getArtIdB()),
+ data.getRationale(), getApplicabilityToken(appId));
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/Conflict.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/Conflict.java
index f682071038..9c21c2d980 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/Conflict.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/Conflict.java
@@ -10,24 +10,26 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.conflict;
+import org.eclipse.osee.framework.core.data.GammaId;
import org.eclipse.osee.framework.core.enums.ConflictStatus;
import org.eclipse.osee.framework.core.enums.ConflictType;
import org.eclipse.osee.framework.core.enums.StorageState;
import org.eclipse.osee.framework.core.model.IOseeStorable;
import org.eclipse.osee.framework.core.model.MergeBranch;
+import org.eclipse.osee.framework.jdk.core.type.Id;
public final class Conflict implements IOseeStorable {
private final MergeBranch mergeBranch;
private final ConflictStatus conflictStatus;
- private final long itemId;
- private final Long sourceGammaId;
- private final Long destinationGammaId;
+ private final Id itemId;
+ private final GammaId sourceGammaId;
+ private final GammaId destinationGammaId;
private final ConflictType conflictType;
private StorageState storageState;
private boolean isDirty;
- public Conflict(StorageState storageState, long itemId, ConflictType conflictType, MergeBranch mergeBranch, ConflictStatus conflictStatus, long sourceGammaId, long destinationGammaId) {
+ public Conflict(StorageState storageState, Id itemId, ConflictType conflictType, MergeBranch mergeBranch, ConflictStatus conflictStatus, GammaId sourceGammaId, GammaId destinationGammaId) {
this.mergeBranch = mergeBranch;
this.storageState = storageState;
this.conflictStatus = conflictStatus;
@@ -42,15 +44,15 @@ public final class Conflict implements IOseeStorable {
return conflictType;
}
- public Long getSourceGammaId() {
+ public GammaId getSourceGammaId() {
return sourceGammaId;
}
- public Long getDestinationGammaId() {
+ public GammaId getDestinationGammaId() {
return destinationGammaId;
}
- public long getId() {
+ public Id getId() {
return itemId;
}
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java
index c2e1a91b13..badccd4f25 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java
@@ -254,8 +254,8 @@ public class OrcsBranchTest {
boolean contains = actual.contains(expect);
if (!contains) {
for (ChangeItem act : actual) {
- if (act.getItemId() == expect.getItemId() && act.getArtId() == expect.getArtId() && act.getCurrentVersion().getModType().matches(
- ModificationType.INTRODUCED)) {
+ if (act.getItemId().equals(expect.getItemId()) && act.getArtId().equals(
+ expect.getArtId()) && act.getCurrentVersion().getModType().matches(ModificationType.INTRODUCED)) {
contains = true;
break;
}

Back to the top