diff options
author | ddunne | 2008-06-30 16:59:15 +0000 |
---|---|---|
committer | ddunne | 2008-06-30 16:59:15 +0000 |
commit | 7d14e09053939656fce947e15d4c2aad43186064 (patch) | |
tree | 6653418b0cffb9a1f8a1f8336517386ee4649629 | |
parent | fcda2d4d9dc40409e93beaadd40b920a65e7fe6b (diff) | |
download | org.eclipse.osee-7d14e09053939656fce947e15d4c2aad43186064.tar.gz org.eclipse.osee-7d14e09053939656fce947e15d4c2aad43186064.tar.xz org.eclipse.osee-7d14e09053939656fce947e15d4c2aad43186064.zip |
"Team Workflow" - B3HZR - "If two branches exist for same workflow, error is not obvious and another branch can be created"
6 files changed, 38 insertions, 12 deletions
diff --git a/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java b/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java index 0da6d9a5d82..ce5346e3b45 100644 --- a/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java +++ b/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java @@ -36,6 +36,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager; import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact; import org.eclipse.osee.framework.skynet.core.artifact.search.Active; import org.eclipse.osee.framework.skynet.core.exception.ArtifactDoesNotExist; +import org.eclipse.osee.framework.skynet.core.exception.MultipleBranchesExist; import org.eclipse.osee.framework.skynet.core.exception.MultipleAttributesExist; import org.eclipse.osee.framework.skynet.core.exception.OseeCoreException; import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate; @@ -572,7 +573,7 @@ public class TeamWorkFlowArtifact extends TaskableStateMachineArtifact implement /* (non-Javadoc) * @see org.eclipse.osee.framework.ui.skynet.widgets.IBranchArtifact#getCommitManagerBranch() */ - public Branch getWorkingBranch() throws SQLException { + public Branch getWorkingBranch() throws SQLException, MultipleBranchesExist { if (getSmaMgr().getBranchMgr().getWorkingBranch() != null) { return getSmaMgr().getBranchMgr().getWorkingBranch(); } diff --git a/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java b/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java index 32ce10d72d1..19c0ec522fe 100644 --- a/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java +++ b/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java @@ -160,7 +160,7 @@ public class ServicesArea { } } } catch (Exception ex) { - OSEELog.logException(AtsPlugin.class, ex, false); + OSEELog.logException(AtsPlugin.class, ex, true); } } diff --git a/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java b/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java index 08fe3cf6dc0..465581493d4 100644 --- a/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java +++ b/MS_0.2.0_20080619/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java @@ -41,6 +41,7 @@ import org.eclipse.osee.framework.skynet.core.change.ModificationType; import org.eclipse.osee.framework.skynet.core.conflict.ConflictManager;
import org.eclipse.osee.framework.skynet.core.exception.BranchDoesNotExist;
import org.eclipse.osee.framework.skynet.core.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.skynet.core.exception.MultipleBranchesExist;
import org.eclipse.osee.framework.skynet.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.exception.TransactionDoesNotExist;
import org.eclipse.osee.framework.skynet.core.revision.ArtifactChange;
@@ -129,7 +130,7 @@ public class AtsBranchManager { }
}
- public Integer getBranchId() throws SQLException {
+ public Integer getBranchId() throws SQLException, MultipleBranchesExist {
if (getWorkingBranch() == null) return null;
return getWorkingBranch().getBranchId();
}
@@ -225,7 +226,7 @@ public class AtsBranchManager { AWorkbench.popup("ERROR", "Not IBranchArtifact");
} else
CommitManagerView.openViewUpon((IBranchArtifact) smaMgr.getSma());
- } catch (SQLException ex) {
+ } catch (Exception ex) {
OSEELog.logException(AtsPlugin.class, ex, true);
}
}
@@ -237,24 +238,23 @@ public class AtsBranchManager { * @return
* @throws SQLException
*/
- public Branch getWorkingBranch() throws SQLException {
+ public Branch getWorkingBranch() throws SQLException, MultipleBranchesExist {
Set<Branch> branches = BranchPersistenceManager.getInstance().getAssociatedArtifactBranches(smaMgr.getSma());
if (branches.size() == 0) {
return null;
} else if (branches.size() > 1) {
- OSEELog.logWarning(AtsPlugin.class,
- "Unexpected multiple working branches per workflow" + smaMgr.getSma().getHumanReadableId(), false);
+ throw new MultipleBranchesExist(
+ "Unexpected multiple associated working branches found for workflow " + smaMgr.getSma().getHumanReadableId());
} else {
return branches.iterator().next();
}
- return null;
}
/**
* @return true if there is a current working branch
* @throws SQLException
*/
- public boolean isWorkingBranch() throws SQLException {
+ public boolean isWorkingBranch() throws SQLException, MultipleBranchesExist {
return getWorkingBranch() != null;
}
@@ -622,7 +622,7 @@ public class AtsBranchManager { * @throws TransactionDoesNotExist
* @throws BranchDoesNotExist
*/
- public Boolean isChangesOnWorkingBranch() throws SQLException, BranchDoesNotExist, TransactionDoesNotExist {
+ public Boolean isChangesOnWorkingBranch() throws SQLException, MultipleBranchesExist, BranchDoesNotExist, TransactionDoesNotExist {
if (isWorkingBranch()) {
Pair<TransactionId, TransactionId> transactionToFrom =
TransactionIdManager.getInstance().getStartEndPoint(getWorkingBranch());
diff --git a/MS_0.2.0_20080619/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/exception/MultipleBranchesExist.java b/MS_0.2.0_20080619/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/exception/MultipleBranchesExist.java new file mode 100644 index 00000000000..caf5093ed59 --- /dev/null +++ b/MS_0.2.0_20080619/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/exception/MultipleBranchesExist.java @@ -0,0 +1,23 @@ +/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.skynet.core.exception;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MultipleBranchesExist extends OseeCoreException {
+
+ private static final long serialVersionUID = 1L;
+
+ public MultipleBranchesExist(String message) {
+ super(message);
+ }
+}
diff --git a/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java b/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java index a8ba11a6652..f6853f2d0cd 100644 --- a/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java +++ b/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchView.java @@ -72,6 +72,7 @@ import org.eclipse.osee.framework.skynet.core.event.LocalBranchEvent; import org.eclipse.osee.framework.skynet.core.event.RemoteBranchEvent;
import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
import org.eclipse.osee.framework.skynet.core.exception.ConflictDetectionException;
+import org.eclipse.osee.framework.skynet.core.exception.MultipleBranchesExist;
import org.eclipse.osee.framework.skynet.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.revision.ArtifactChange;
import org.eclipse.osee.framework.skynet.core.revision.ChangeReportInput;
@@ -438,7 +439,7 @@ public class BranchView extends ViewPart implements IActionable, IEventReceiver /* (non-Javadoc)
* @see org.eclipse.osee.framework.ui.skynet.widgets.IBranchArtifact#getWorkingBranch()
*/
- public Branch getWorkingBranch() throws IllegalStateException, SQLException {
+ public Branch getWorkingBranch() throws IllegalStateException, SQLException, MultipleBranchesExist {
return branch;
}
diff --git a/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IBranchArtifact.java b/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IBranchArtifact.java index 1219225bb21..5af25fcbc27 100644 --- a/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IBranchArtifact.java +++ b/MS_0.2.0_20080619/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IBranchArtifact.java @@ -14,13 +14,14 @@ import java.sql.SQLException; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.Branch; import org.eclipse.osee.framework.skynet.core.exception.ArtifactDoesNotExist; +import org.eclipse.osee.framework.skynet.core.exception.MultipleBranchesExist; import org.eclipse.osee.framework.skynet.core.exception.MultipleArtifactsExist; /** * @author Donald G. Dunne */ public interface IBranchArtifact { - public Branch getWorkingBranch() throws IllegalStateException, SQLException, ArtifactDoesNotExist, MultipleArtifactsExist; + public Branch getWorkingBranch() throws IllegalStateException, SQLException, ArtifactDoesNotExist, MultipleArtifactsExist, MultipleBranchesExist; public Artifact getArtifact(); } |