Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2019-08-12 22:10:25 +0000
committerRyan D. Brooks2020-12-15 21:40:53 +0000
commit67b11985aca412cd9d232251bdcb62714e09ace7 (patch)
treeba5fd8ef387baae8588f0a8005d4ec894987f9cb
parentf814a3fcb359e02009aff778dfb0e31dc32eb6d0 (diff)
downloadorg.eclipse.osee-67b11985aca412cd9d232251bdcb62714e09ace7.tar.gz
org.eclipse.osee-67b11985aca412cd9d232251bdcb62714e09ace7.tar.xz
org.eclipse.osee-67b11985aca412cd9d232251bdcb62714e09ace7.zip
refactor: Improve null safety
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java
index 38f951f77e3..ffbdf6e4816 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java
@@ -595,25 +595,23 @@ public class OrcsApplicabilityOps implements OrcsApplicability {
results.errorf("Product Name is already in use.");
return results;
}
- if ((xView.isInvalid())) {
- try {
- UserId user = account;
- if (user == null) {
- user = SystemUser.OseeSystem;
- }
- TransactionBuilder tx = orcsApi.getTransactionFactory().createTransaction(branch, user,
- "Create View " + view.toStringWithId());
- createUpdateViewDefinition(view, tx);
- tx.commit();
+ try {
+ UserId user = account;
+ if (user == null) {
+ user = SystemUser.OseeSystem;
+ }
+ TransactionBuilder tx = orcsApi.getTransactionFactory().createTransaction(branch, user,
+ "Create View " + view.toStringWithId());
+ createUpdateViewDefinition(view, tx);
+ tx.commit();
ViewDefinition newView = getView(view.getName(), branch);
TransactionBuilder tx2 = orcsApi.getTransactionFactory().createTransaction(branch, user,
"Create Config and Base applicabilities on new view: " + view.getName());
tx2.createApplicabilityForView(ArtifactId.valueOf(newView.getId()), "Base");
tx2.createApplicabilityForView(ArtifactId.valueOf(newView.getId()), "Config = " + view.getName());
tx2.commit();
- } catch (Exception ex) {
- results.error(Lib.exceptionToString(ex));
- }
+ } catch (Exception ex) {
+ results.error(Lib.exceptionToString(ex));
}
//If copyFrom indicated; set applicability for each feature to match
if (view.getCopyFrom().isValid()) {

Back to the top