diff options
12 files changed, 45 insertions, 42 deletions
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java index c4d0329e019..be318e07464 100644 --- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java +++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ViewWordChangeAndDiffTest.java @@ -165,7 +165,10 @@ public final class ViewWordChangeAndDiffTest { private static ArrayList<Artifact> asArtifacts(Collection<Change> changes) { ArrayList<Artifact> arts = new ArrayList<>(); for (Change artifactChange : changes) { - arts.add(artifactChange.getChangeArtifact()); + Artifact changeArtifact = artifactChange.getChangeArtifact(); + if (changeArtifact.isValid()) { + arts.add(changeArtifact); + } } return arts; } 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 e9fc7fc5f9d..279ddfec6e8 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 @@ -61,25 +61,23 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc @Override public boolean equals(Object obj) { - if (getChangeArtifact() != null) { - if (obj instanceof Change) { - Change change = (Change) obj; - boolean areDeltasEqual = false; - if (change.getDelta() != null && getDelta() != null) { - areDeltasEqual = change.getDelta().equals(getDelta()); - } else if (change.getDelta() == null && getDelta() == null) { - areDeltasEqual = true; - } - return areDeltasEqual && change.getArtId() == getArtId() && - // - change.getGamma() == getGamma() && - // - change.getChangeArtifact().equals(getChangeArtifact()) && - // - change.getModificationType() == getModificationType() && - // - change.getTxDelta().equals(getTxDelta()); + if (obj instanceof Change) { + Change change = (Change) obj; + boolean areDeltasEqual = false; + if (change.getDelta() != null && getDelta() != null) { + areDeltasEqual = change.getDelta().equals(getDelta()); + } else if (change.getDelta() == null && getDelta() == null) { + areDeltasEqual = true; } + return areDeltasEqual && change.getArtId().equals(getArtId()) && + // + change.getGamma() == getGamma() && + // + change.getChangeArtifact().equals(getChangeArtifact()) && + // + change.getModificationType().equals(getModificationType()) && + // + change.getTxDelta().equals(getTxDelta()); } return false; } @@ -89,7 +87,7 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc int hashCode = 7; hashCode += 13 * getArtId().hashCode(); hashCode += 13 * getGamma().hashCode(); - hashCode += getChangeArtifact() != null ? 13 * getChangeArtifact().hashCode() : 0; + hashCode += 13 * getChangeArtifact().hashCode(); hashCode += getDelta() != null ? 13 * getDelta().hashCode() : 0; hashCode += getModificationType() != null ? 13 * getModificationType().hashCode() : 0; hashCode += getTxDelta() != null ? 13 * getTxDelta().hashCode() : 0; 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 57d384483ce..703c8acab99 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 @@ -15,6 +15,7 @@ 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.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType; /** @@ -27,7 +28,7 @@ public final class ErrorChange extends Change { private final String name; public ErrorChange(BranchId branch, ArtifactId artId, String exception) { - super(branch, GammaId.valueOf(0L), artId, null, null, false, null, null); + super(branch, GammaId.valueOf(0L), artId, null, null, false, Artifact.SENTINEL, 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.getIdString(), exception); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/TupleChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/TupleChange.java index a0a9137bf1a..c1bdd983a87 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/TupleChange.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/TupleChange.java @@ -15,7 +15,9 @@ import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.GammaId; import org.eclipse.osee.framework.core.data.TupleTypeId; 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; /** @@ -28,8 +30,8 @@ public class TupleChange extends Change { private final String itemKind; private final TupleTypeId itemTypeId; - public TupleChange(BranchId branch, GammaId sourceGamma, ModificationType modType, TupleTypeId itemTypeId, String isValue, String wasValue, String itemKind, boolean isHistorical) { - super(branch, sourceGamma, ArtifactId.valueOf(0L), null, modType, isHistorical, null, null); + public TupleChange(BranchId branch, GammaId sourceGamma, TransactionDelta txDelta, ModificationType modType, TupleTypeId itemTypeId, String isValue, String wasValue, String itemKind, boolean isHistorical) { + super(branch, sourceGamma, ArtifactId.valueOf(0L), txDelta, modType, isHistorical, Artifact.SENTINEL, null); this.itemTypeId = itemTypeId; this.isValue = isValue; this.wasValue = wasValue; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchWordMlChanges.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchWordMlChanges.java index 02c0f3379ee..c7090ae655a 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchWordMlChanges.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchWordMlChanges.java @@ -74,7 +74,7 @@ public class CatchWordMlChanges implements CommitAction { } Artifact artifactChanged = change.getChangeArtifact(); - if (artifactChanged != null) { + if (artifactChanged.isValid()) { changedArtifacts.add(artifactChanged); } } @@ -82,9 +82,8 @@ public class CatchWordMlChanges implements CommitAction { String err = null; if (!trackedChanges.isEmpty()) { - err = String.format( - "Commit Branch Failed. The following artifacts contain Tracked Changes. " // - + " Please accept or reject and turn off track changes, then recommit : [%s]\n\n", + err = String.format("Commit Branch Failed. The following artifacts contain Tracked Changes. " // + + " Please accept or reject and turn off track changes, then recommit : [%s]\n\n", trackedChanges.toString()); } if (!applicabilityTags.isEmpty()) { 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 0850e424530..92756d874a5 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 @@ -173,7 +173,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation { } Artifact changedArtifact = change.getChangeArtifact(); - if (changedArtifact != null) { + if (changedArtifact.isValid()) { EventModifiedBasicGuidArtifact artEvent = artEventMap.get(artifactId.getId().intValue()); if (artEvent == null) { 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 1ab5625f18d..f5736c3ebc4 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 @@ -213,7 +213,7 @@ public class ChangeDataLoader extends AbstractOperation { // When we are comparing two different branches, the displayed artifact should be the start artifact or the artifact from the // source branch. When we are comparing items from the same branch, the displayed artifact should be the artifact in the end transaction // since that is the resulting change artifact. - Artifact changeArtifact = null; + Artifact changeArtifact = Artifact.SENTINEL; if (artifactDelta != null) { changeArtifact = artifactDelta.getEndArtifact(); } @@ -297,8 +297,8 @@ public class ChangeDataLoader extends AbstractOperation { if (tok.hasMoreElements()) { tupleIsValue = tok.nextToken(); } - change = new TupleChange(startTxBranch, itemGammaId, ModificationType.MODIFIED, tupleTypeId, tupleIsValue, - "?", itemKind, isHistorical); + change = new TupleChange(startTxBranch, itemGammaId, txDelta, netModType, tupleTypeId, tupleIsValue, "?", + itemKind, isHistorical); break; default: throw new OseeCoreException("The change item must map to either an artifact, attribute or relation change"); 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 d512365c649..65faf1401d1 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 @@ -253,7 +253,7 @@ public final class RevisionChangeLoader { } } else { toReturn = new ArtifactChange(branch, builder.getSourceGamma(), builder.getArtId(), builder.getTxDelta(), - builder.getModType(), "", "", isHistorical, null, null); + builder.getModType(), "", "", isHistorical, Artifact.SENTINEL, null); } changes.add(toReturn); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commit/CatchValidationChecks.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commit/CatchValidationChecks.java index e0e769af365..df88015d7bc 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commit/CatchValidationChecks.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commit/CatchValidationChecks.java @@ -50,7 +50,7 @@ public class CatchValidationChecks implements CommitAction { for (Change change : changes) { if (!change.getModificationType().isDeleted()) { Artifact artifactChanged = change.getChangeArtifact(); - if (artifactChanged != null) { + if (artifactChanged.isValid()) { changedArtifacts.add(artifactChanged); } } 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 320276ea7d7..6559c7dc5d6 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 @@ -74,7 +74,7 @@ public final class CompareArtifactAction extends Action { Change change = (Change) object; try { Artifact toCheck = change.getChangeArtifact(); - if (toCheck != null) { + if (toCheck.isValid()) { IRenderer renderer = RendererManager.getBestRenderer(PresentationType.DIFF, toCheck); isValidSelection = renderer.supportsCompare(); } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java index 2c8c3ea7f9d..89b1a203509 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java @@ -58,7 +58,7 @@ public class XHistoryLabelProvider extends XViewerLabelProvider { if (cCol.equals(HistoryXViewerFactory.gamma)) { toReturn = String.valueOf(data.getGamma()); } else if (cCol.equals(HistoryXViewerFactory.itemType)) { - if (data instanceof ArtifactChange && data.getChangeArtifact() == null) { + if (data instanceof ArtifactChange && data.getChangeArtifact().isInvalid()) { toReturn = "Artifact Does Exist In This Transaction"; } else { toReturn = data instanceof RelationChange ? data.getName() : data.getItemTypeName(); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ArtifactTokenColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ArtifactTokenColumn.java index 7b2b806a6f2..7a59a974d17 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ArtifactTokenColumn.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/ArtifactTokenColumn.java @@ -48,20 +48,20 @@ public class ArtifactTokenColumn extends XViewerValueColumn { @Override public String getColumnText(Object element, XViewerColumn column, int columnIndex) { + String columnText = ""; try { - Artifact artifact = null; if (element instanceof Artifact) { - artifact = (Artifact) element; + columnText = ((Artifact) element).toStringWithId(); } else if (element instanceof Change) { - artifact = ((Change) element).getChangeArtifact(); - } - if (artifact != null) { - return artifact.toStringWithId(); + Artifact artifact = ((Change) element).getChangeArtifact(); + columnText = artifact.isValid() ? artifact.toStringWithId() : ""; + } else { + columnText = ""; } + return columnText; } catch (OseeCoreException ex) { return XViewerCells.getCellExceptionString(ex); } - return ""; } } |