Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2014-09-12 12:00:34 -0400
committermegumi.telles2014-09-12 12:03:39 -0400
commit5170228162f28d3d67d81e4132831af400107057 (patch)
treed592b2bd21338fb383cc84527539e3c1b08c5916
parent860a6342cf8088e23f5e3917bd652c01c536b8d8 (diff)
downloadorg.eclipse.osee-5170228162f28d3d67d81e4132831af400107057.tar.gz
org.eclipse.osee-5170228162f28d3d67d81e4132831af400107057.tar.xz
org.eclipse.osee-5170228162f28d3d67d81e4132831af400107057.zip
bug[ats_ATS106447]: Fix NullPointerException from ChangeItemUtil.isResurrected
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtilTest.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/change/ChangeItemUtil.java2
2 files changed, 14 insertions, 1 deletions
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 efae56e5d1..21956ec021 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
@@ -328,6 +328,19 @@ public class ChangeItemUtilTest {
}
+ @Test
+ public void testIsRessurectedOnNewItem() throws OseeCoreException {
+ ChangeVersion base = ChangeTestUtility.createChange(null, null);
+ ChangeVersion first = ChangeTestUtility.createChange(null, null);
+ ChangeVersion current = ChangeTestUtility.createChange(3333L, ModificationType.NEW);
+ ChangeVersion destination = ChangeTestUtility.createChange(3333L, ModificationType.DELETED);
+ ChangeVersion net = ChangeTestUtility.createChange(null, null);
+
+ ChangeItem item = ChangeTestUtility.createItem(500, base, first, current, destination, net);
+
+ Assert.assertFalse(ChangeItemUtil.isResurrected(item));
+ }
+
private Triplet<ChangeVersion, ChangeVersion, Boolean> createTriplet(Long long1, ModificationType mod1, Long long2, ModificationType mod2, boolean expected) {
return new Triplet<ChangeVersion, ChangeVersion, Boolean>(//
ChangeTestUtility.createChange(long1, mod1), //
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 74d090087b..dc3b938e61 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
@@ -137,7 +137,7 @@ public final class ChangeItemUtil {
public static boolean isResurrected(ChangeItem changeItem) {
// There's a change corresponding to a Deleted Item, item MUST have been resurrected
- return changeItem.getBaselineVersion().getModType().isDeleted();
+ return changeItem.getBaselineVersion().isValid() && isDeleted(changeItem.getBaselineVersion());
}
}

Back to the top