Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2016-11-17 16:56:24 +0000
committerDavid Miller2016-12-08 15:53:03 +0000
commit0a5430504fca0c27336914df276ed1b7627a761c (patch)
tree294de22f58d47725247d694287f8703091b86a3a
parent63797df1ab8f456d2134f1ebacdf1115107d431a (diff)
downloadorg.eclipse.osee-0a5430504fca0c27336914df276ed1b7627a761c.tar.gz
org.eclipse.osee-0a5430504fca0c27336914df276ed1b7627a761c.tar.xz
org.eclipse.osee-0a5430504fca0c27336914df276ed1b7627a761c.zip
bug[ats_ATS324937]: Merge report not showing synthetic artifact
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItem.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtil.java42
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/GammaId.java1
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AddSyntheticArtifactChangeData.java (renamed from plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AddArtifactChangeDataCallable.java)35
7 files changed, 72 insertions, 32 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java
index b81269c998b..a9a27c02909 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeIgnoreType.java
@@ -15,6 +15,7 @@ package org.eclipse.osee.framework.core.model.change;
*/
public enum ChangeIgnoreType {
+ SENTINEL,
CREATED_AND_DELETED,
ALREADY_ON_DESTINATION,
DELETED_AND_DNE_ON_DESTINATION,
@@ -61,4 +62,11 @@ public enum ChangeIgnoreType {
return this == NONE;
}
+ public boolean isValid() {
+ return this != SENTINEL;
+ }
+
+ public boolean isInvalid() {
+ return !isValid();
+ }
}
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 1b882e50243..a88a595c8cf 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
@@ -17,7 +17,7 @@ import org.eclipse.osee.framework.jdk.core.util.Conditions;
*/
public class ChangeItem implements Comparable<ChangeItem> {
- private ChangeIgnoreType ignoreType = ChangeIgnoreType.NONE;
+ private ChangeIgnoreType ignoreType = ChangeIgnoreType.SENTINEL;
private ChangeType changeType = ChangeType.UNKNOWN_CHANGE;
private int artId = -1;
private int itemId = -1;
@@ -164,7 +164,7 @@ public class ChangeItem implements Comparable<ChangeItem> {
return String.format(
"ChangeItem - itemId:[%s] artId:%s typeId:%s base:%s first:%s current:%s destination:%s net:%s synthetic:%s ignoreType:%s",
itemId, getArtId(), getItemTypeId(), getBaselineVersion(), getFirstNonCurrentChange(), getCurrentVersion(),
- getDestinationVersion(), getNetChange(), isSynthetic(), getItemTypeId());
+ getDestinationVersion(), getNetChange(), isSynthetic(), getIgnoreType().toString());
}
@Override
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 2dbc2ac0ea7..3da4ed5eca4 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
@@ -189,53 +189,71 @@ public final class ChangeItemUtil {
}
public static void checkAndSetIgnoreCase(ChangeItem changeItem) {
- createdAndDeleted(changeItem);
- wasAlreadyOnDestination(changeItem);
- deletedAndDoesNotExistInDestination(changeItem);
- deletedOnDestAndNotResurrected(changeItem);
- replacedWithVerAndNotRessurected(changeItem);
+ boolean changed = false;
+ changed |= createdAndDeleted(changeItem);
+ changed |= wasAlreadyOnDestination(changeItem);
+ changed |= deletedAndDoesNotExistInDestination(changeItem);
+ changed |= deletedOnDestAndNotResurrected(changeItem);
+ changed |= replacedWithVerAndNotRessurected(changeItem);
+ if (!changed) {
+ changeItem.setIgnoreType(ChangeIgnoreType.NONE);
+ }
}
- public static void wasAlreadyOnDestination(ChangeItem changeItem) {
+ public static boolean wasAlreadyOnDestination(ChangeItem changeItem) {
if (isAlreadyOnDestination(changeItem)) {
changeItem.setIgnoreType(ChangeIgnoreType.ALREADY_ON_DESTINATION);
+ return true;
}
+ return false;
}
- public static void createdAndDeleted(ChangeItem changeItem) {
+ public static boolean createdAndDeleted(ChangeItem changeItem) {
if (wasCreatedAndDeleted(changeItem)) {
changeItem.setIgnoreType(ChangeIgnoreType.CREATED_AND_DELETED);
+ return true;
}
+ return false;
}
- public static void deletedAndDoesNotExistInDestination(ChangeItem changeItem) {
+ public static boolean deletedAndDoesNotExistInDestination(ChangeItem changeItem) {
if (!changeItem.getDestinationVersion().isValid() && isDeleted(changeItem.getCurrentVersion())) {
changeItem.setIgnoreType(ChangeIgnoreType.DELETED_AND_DNE_ON_DESTINATION);
+ return true;
}
+ return false;
}
- public static void beenDeletedInDestination(ChangeItem changeItem) {
+ public static boolean beenDeletedInDestination(ChangeItem changeItem) {
if (hasBeenDeletedInDestination(changeItem)) {
changeItem.setIgnoreType(ChangeIgnoreType.DELETED_ON_DESTINATION);
+ return true;
}
+ return false;
}
- public static void deletedOnDestAndNotResurrected(ChangeItem changeItem) {
+ public static boolean deletedOnDestAndNotResurrected(ChangeItem changeItem) {
if (hasBeenDeletedInDestination(changeItem) && !isResurrected(changeItem)) {
changeItem.setIgnoreType(ChangeIgnoreType.DELETED_ON_DEST_AND_NOT_RESURRECTED);
+ return true;
}
+ return false;
}
- public static void replacedWithVerAndNotRessurected(ChangeItem changeItem) {
+ public static boolean replacedWithVerAndNotRessurected(ChangeItem changeItem) {
if (hasBeenReplacedWithVersion(changeItem) && !isResurrected(changeItem)) {
changeItem.setIgnoreType(ChangeIgnoreType.REPLACED_WITH_VERSION_AND_NOT_RESURRECTED);
+ return true;
}
+ return false;
}
- public static void resurrected(ChangeItem changeItem) {
+ public static boolean resurrected(ChangeItem changeItem) {
if (isResurrected(changeItem)) {
changeItem.setIgnoreType(ChangeIgnoreType.RESURRECTED);
+ return true;
}
+ return false;
}
public static boolean wasCreatedAndDeleted(ChangeItem changeItem) {
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/GammaId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/GammaId.java
index 554f7eddd6d..bb0217b5cdb 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/GammaId.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/GammaId.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.framework.jdk.core.type.Id;
* @author Ryan D. Brooks
*/
public interface GammaId extends Id {
+ GammaId SENTINEL = valueOf(Id.SENTINEL);
public static GammaId valueOf(String id) {
return valueOf(Long.valueOf(id));
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 3ef8b605c93..463f2c1b339 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
@@ -52,9 +52,9 @@ public final class AttributeChange extends Change {
if (obj instanceof AttributeChange) {
AttributeChange change = (AttributeChange) obj;
return super.equals(obj) && //
- change.getArtId() == getArtId() && //
- change.getArtModType() == getArtModType() && //
- change.getAttrId() == getAttrId();
+ change.getArtId() == getArtId() && //
+ change.getArtModType() == getArtModType() && //
+ change.getAttrId() == getAttrId();
}
return false;
}
@@ -108,7 +108,7 @@ public final class AttributeChange extends Change {
return attribute;
}
}
- throw new AttributeDoesNotExist("Attribute %d could not be found on artifact %d on branch %s", attrId, getArtId(),
+ throw new AttributeDoesNotExist("Attribute %d could not be found on artifact %d on branch %d", attrId, getArtId(),
getBranch().getGuid());
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java
index c431ad94db4..c3951bb213b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.TransactionTokenDelta;
-import org.eclipse.osee.orcs.db.internal.change.AddArtifactChangeDataCallable;
+import org.eclipse.osee.orcs.db.internal.change.AddSyntheticArtifactChangeData;
import org.eclipse.osee.orcs.db.internal.change.ComputeNetChangeCallable;
import org.eclipse.osee.orcs.db.internal.change.LoadDeltasBetweenBranches;
import org.eclipse.osee.orcs.db.internal.change.LoadDeltasBetweenTxsOnTheSameBranch;
@@ -76,8 +76,8 @@ public class CompareDatabaseCallable extends AbstractDatastoreCallable<List<Chan
Callable<List<ChangeItem>> computeChanges = new ComputeNetChangeCallable(changes);
changes = callAndCheckForCancel(computeChanges);
- Callable<List<ChangeItem>> addArtifactData = new AddArtifactChangeDataCallable(changes);
- return callAndCheckForCancel(addArtifactData);
+ AddSyntheticArtifactChangeData addArtifactData = new AddSyntheticArtifactChangeData(changes);
+ return addArtifactData.doWork();
}
}
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/AddSyntheticArtifactChangeData.java
index ca8d385b88b..d462708694c 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/AddSyntheticArtifactChangeData.java
@@ -14,21 +14,20 @@ import java.util.ArrayList;
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.enums.ModificationType;
+import org.eclipse.osee.framework.core.model.change.ChangeIgnoreType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItemUtil;
-public class AddArtifactChangeDataCallable extends CancellableCallable<List<ChangeItem>> {
+public class AddSyntheticArtifactChangeData {
private final List<ChangeItem> changeItems;
- public AddArtifactChangeDataCallable(List<ChangeItem> changeItems) {
+ public AddSyntheticArtifactChangeData(List<ChangeItem> changeItems) {
super();
this.changeItems = changeItems;
}
- @Override
- public List<ChangeItem> call() throws Exception {
+ public List<ChangeItem> doWork() throws Exception {
Map<Integer, ChangeItem> artifactChanges = new HashMap<>();
for (ChangeItem item : changeItems) {
if (item.getChangeType().isArtifactChange()) {
@@ -56,32 +55,46 @@ public class AddArtifactChangeDataCallable extends CancellableCallable<List<Chan
}
}
}
- changeItems.addAll(syntheticArtifactChanges.values());
+ for (ChangeItem change : syntheticArtifactChanges.values()) {
+ if (isAllowableChange(change.getIgnoreType())) {
+ changeItems.add(change);
+ }
+ }
return changeItems;
}
private void updateArtifactChangeItem(ChangeItem artifact, ChangeItem attribute) {
try {
- if (!artifact.getBaselineVersion().isValid() && attribute.getBaselineVersion().isValid()) {
+ if (attribute.getBaselineVersion().isValid()) {
ChangeItemUtil.copy(attribute.getBaselineVersion(), artifact.getBaselineVersion());
}
- if (!artifact.getCurrentVersion().isValid() && attribute.getCurrentVersion().isValid()) {
+ if (attribute.getCurrentVersion().isValid()) {
ChangeItemUtil.copy(attribute.getCurrentVersion(), artifact.getCurrentVersion());
}
- if (!artifact.getDestinationVersion().isValid() && attribute.getDestinationVersion().isValid()) {
+ if (attribute.getDestinationVersion().isValid()) {
ChangeItemUtil.copy(attribute.getDestinationVersion(), artifact.getDestinationVersion());
}
- if (!artifact.getNetChange().isValid() && attribute.getNetChange().isValid()) {
+ if (attribute.getNetChange().isValid()) {
ChangeItemUtil.copy(attribute.getNetChange(), artifact.getNetChange());
artifact.getNetChange().setModType(ModificationType.MODIFIED);
}
- ChangeItemUtil.checkAndSetIgnoreCase(artifact);
+ if (artifact.getIgnoreType().isInvalid() || !isAllowableChange(artifact.getIgnoreType())) {
+ ChangeItemUtil.checkAndSetIgnoreCase(artifact);
+ }
+
} catch (Exception ex) {
ex.printStackTrace();
}
}
+ private static boolean isAllowableChange(ChangeIgnoreType ignoreType) {
+ return //
+ ignoreType.isNone() || //
+ ignoreType.isResurrected() || //
+ ignoreType.isDeletedOnDestAndNotResurrected() || //
+ ignoreType.isDeletedOnDestination();
+ }
}

Back to the top