Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2016-09-09 19:28:59 -0400
committerAngel Avila2016-10-04 21:34:39 -0400
commit22a384a83786cc3039bad3fc94e4b1c9222e9765 (patch)
tree92368a1ca243c88dc1d28d9173bb799ea8db693d
parentd7fee2f9e41e3add56e2872834ed5f1fbe5f440f (diff)
downloadorg.eclipse.osee-22a384a83786cc3039bad3fc94e4b1c9222e9765.tar.gz
org.eclipse.osee-22a384a83786cc3039bad3fc94e4b1c9222e9765.tar.xz
org.eclipse.osee-22a384a83786cc3039bad3fc94e4b1c9222e9765.zip
refactor: Fix potential null pointer access
Change-Id: I5f0fbd11df022a3146aaeb57936340fdb78d68ba Signed-off-by: Morgan E. Cook <Morgan.e.cook@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInputFactory.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInputFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInputFactory.java
index 520b828f308..0b08d1c22cc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInputFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInputFactory.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.ui.skynet.artifact.editor;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.ui.IElementFactory;
import org.eclipse.ui.IMemento;
@@ -42,7 +43,7 @@ public class ArtifactEditorInputFactory implements IElementFactory {
if (Strings.isValid(artUuidStr)) {
artUuid = Integer.valueOf(artUuidStr);
}
- return new ArtifactEditorInput(branchUuid, Long.valueOf(artUuid), title);
+ return new ArtifactEditorInput(branchUuid, (artUuid == null ? null : Long.valueOf(artUuid)), title);
}
public static void saveState(IMemento memento, ArtifactEditorInput input) {
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
index ebfe7377319..6e59f1fa21c 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
@@ -58,7 +58,7 @@ public class PurgeAttributeTest {
TransactionBuilder tx = null;
for (ArtifactReadable art : orcsApi.getQueryFactory().fromBranch(CoreBranches.COMMON_ID).and(
CoreAttributeTypes.Annotation, UNIQUE_ATTR_VALUE).getResults()) {
- if (tx != null) {
+ if (tx == null) {
tx = orcsApi.getTransactionFactory().createTransaction(CoreBranches.COMMON_ID, Joe_Smith,
getClass().getSimpleName());
}

Back to the top