Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-09-27 14:35:15 -0400
committerRyan D. Brooks2010-09-27 14:35:15 -0400
commit58b03899095f288609101deee081389557072a16 (patch)
treef64debf94c79ab9da605f86a0f308790c28504ac /plugins
parentfb7a676589923d3993f010d4c7446ad5f81a2825 (diff)
downloadorg.eclipse.osee-58b03899095f288609101deee081389557072a16.tar.gz
org.eclipse.osee-58b03899095f288609101deee081389557072a16.tar.xz
org.eclipse.osee-58b03899095f288609101deee081389557072a16.zip
refactor: Resolve FindBugs findings
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java2
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DoesNotWorkItemDemo.java85
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddNoteAction.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/OpenVersionArtifactAction.java1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java15
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java12
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAOperationsSection.java37
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AtsHealthCheck.java52
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/ArtifactChangeReportComparer.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/AttributeChangeReportComparer.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/RelationChangeReportComparer.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java22
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotification.java1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationNavigateItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskTabXWidgetActionPage.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsFolderUtil.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelationTypes.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ChangePointDialog.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItemAts.java605
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java14
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchData.java8
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java1
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java16
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java10
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java11
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java11
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java10
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java10
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java10
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/DoesNotWorkItemCoverage.java202
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java11
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbTestUnitProvider.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/TestUnitStore.java2
62 files changed, 299 insertions, 1070 deletions
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java
index c84c982305..883014d60a 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java
@@ -138,8 +138,6 @@ public class DemoNavigateViewItems implements IAtsNavigateItem {
XNavigateItem demoItems = new XNavigateItem(adminItems, "Demo Data", PluginUiImage.ADMIN);
new PopulateDemoActions(demoItems);
- new DoesNotWorkItemDemo(adminItems);
-
return items;
}
}
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DoesNotWorkItemDemo.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DoesNotWorkItemDemo.java
deleted file mode 100644
index 7d29b4ba64..0000000000
--- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DoesNotWorkItemDemo.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * 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.ats.config.demo.navigate;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.ats.AtsOpenOption;
-import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
-import org.eclipse.osee.ats.artifact.PeerToPeerReviewWorkflowManager;
-import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.config.demo.config.DemoDbUtil;
-import org.eclipse.osee.ats.util.AtsUtil;
-import org.eclipse.osee.ats.util.widgets.ReviewManager;
-import org.eclipse.osee.ats.util.widgets.role.UserRole;
-import org.eclipse.osee.ats.util.widgets.role.UserRole.Role;
-import org.eclipse.osee.ats.world.WorldXNavigateItemAction;
-import org.eclipse.osee.framework.skynet.core.UserManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.osee.support.test.util.DemoUsers;
-
-/**
- * @author Donald G. Dunne
- */
-public class DoesNotWorkItemDemo extends WorldXNavigateItemAction {
-
- public DoesNotWorkItemDemo(XNavigateItem parent) {
- super(parent, "Does Not Work - Demo - Create peer review", PluginUiImage.ADMIN);
- }
-
- @Override
- public void run(TableLoadOption... tableLoadOptions) throws Exception {
- if (!MessageDialog.openConfirm(Displays.getActiveShell(), getName(), getName())) {
- return;
- }
-
- createAndPersistPeerReview();
- AWorkbench.popup("Completed", "Complete");
- }
-
- private void createAndPersistPeerReview() throws Exception {
-
- TeamWorkFlowArtifact firstCodeArt = DemoDbUtil.getSampleCodeWorkflows().get(0);
- SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Demo - Create and Persist Review");
- // Create a PeerToPeer review and leave in Prepare state
- PeerToPeerReviewArtifact reviewArt =
- ReviewManager.createNewPeerToPeerReview(firstCodeArt, "Peer Review first set of code changes",
- firstCodeArt.getStateMgr().getCurrentStateName(), transaction);
- reviewArt.persist(transaction);
-
- // Create a PeerToPeer review and transition to Review state
- reviewArt =
- ReviewManager.createNewPeerToPeerReview(firstCodeArt,
- "Does Not Work " + AtsUtil.getAtsDeveloperIncrementingNum(),
- firstCodeArt.getStateMgr().getCurrentStateName(), transaction);
- List<UserRole> roles = new ArrayList<UserRole>();
- roles.add(new UserRole(Role.Author, DemoDbUtil.getDemoUser(DemoUsers.Joe_Smith)));
- roles.add(new UserRole(Role.Reviewer, DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones)));
- roles.add(new UserRole(Role.Reviewer, DemoDbUtil.getDemoUser(DemoUsers.Alex_Kay), 2.0, true));
- Result result =
- PeerToPeerReviewWorkflowManager.transitionTo(reviewArt, PeerToPeerReviewArtifact.PeerToPeerReviewState.Review,
- roles, null, UserManager.getUser(), false, transaction);
- if (result.isFalse()) {
- throw new IllegalStateException("Failed transitioning review to Review: " + result.getText());
- }
- reviewArt.persist(transaction);
- transaction.execute();
-
- AtsUtil.openATSAction(reviewArt, AtsOpenOption.OpenAll);
- }
-}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddNoteAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddNoteAction.java
index 73fdadc706..f917e76676 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddNoteAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddNoteAction.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.NoteType;
import org.eclipse.osee.ats.actions.wizard.NewNoteWizard;
import org.eclipse.osee.ats.artifact.StateMachineArtifact;
import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.UserManager;
@@ -34,7 +35,6 @@ import org.eclipse.ui.PlatformUI;
*/
public class AddNoteAction extends Action {
- Action action;
private final StateMachineArtifact sma;
public AddNoteAction(StateMachineArtifact sma) {
@@ -73,7 +73,7 @@ public class AddNoteAction extends Action {
noteWizard.mainPage.noteText.get(), UserManager.getUser());
sma.getEditor().onDirtied();
}
- } catch (Exception ex) {
+ } catch (OseeCoreException ex) {
OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
index f80c6371dc..89e30f6ab1 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
@@ -52,9 +52,10 @@ import org.eclipse.osee.framework.ui.swt.ImageManager;
*/
public class ExportChangeReportsAction extends Action {
private final WorldEditor worldEditor;
- private final boolean reverse = false;
+ private final boolean reverse;
- public ExportChangeReportsAction(WorldEditor worldEditor) {
+ public ExportChangeReportsAction(WorldEditor worldEditor, boolean reverse) {
+ this.reverse = reverse;
setText("Export Change Report(s)");
setImageDescriptor(getImageDescriptor());
this.worldEditor = worldEditor;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/OpenVersionArtifactAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/OpenVersionArtifactAction.java
index ed1e998e01..15aa0f6280 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/OpenVersionArtifactAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/OpenVersionArtifactAction.java
@@ -27,7 +27,6 @@ import org.eclipse.osee.framework.ui.swt.ImageManager;
*/
public class OpenVersionArtifactAction extends Action {
- Action action;
private final StateMachineArtifact sma;
public OpenVersionArtifactAction(StateMachineArtifact sma) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
index 924779284a..9b1524b7fb 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
@@ -58,7 +58,7 @@ public class NewActionPage1 extends WizardPage {
private WorkPage page;
private OSEECheckedFilteredTree treeViewer;
private static PatternFilter patternFilter = new PatternFilter();
- private static Text descriptionLabel;
+ private Text descriptionLabel;
protected NewActionPage1(NewActionWizard actionWizard) {
super("Create new ATS Action", "Create ATS Action", null);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java
index f7c62d2f6a..3f04067ac1 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java
@@ -306,17 +306,18 @@ public class ATSLog {
addLog(item.getType(), item.getState(), item.getMsg(), item.getDate(), item.getUser());
}
- /**
- * @param state name of state or null
- */
public void addLog(LogType type, String state, String msg, Date date, User user) throws OseeCoreException {
if (!enabled) {
return;
}
- LogItem logItem = new LogItem(type, date, user, state, msg, artifactRef.get().getHumanReadableId());
- List<LogItem> logItems = getLogItems();
- logItems.add(logItem);
- putLogItems(logItems);
+ if (artifactRef.get() == null) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Artifact unexpectedly garbage collected");
+ } else {
+ LogItem logItem = new LogItem(type, date, user, state, msg, getArtifact().getHumanReadableId());
+ List<LogItem> logItems = getLogItems();
+ logItems.add(logItem);
+ putLogItems(logItems);
+ }
}
public void clearLog() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java
index 6b20c9b1ba..e8d8d067ec 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java
@@ -227,16 +227,15 @@ public class GoalArtifact extends StateMachineArtifact {
* change goal order for artifacts within given goal
*/
public static GoalArtifact promptChangeGoalOrder(GoalArtifact goalArtifact, List<Artifact> artifacts) throws OseeCoreException {
- String currentOrder = "Current Order: ";
+ StringBuilder currentOrder = new StringBuilder("Current Order: ");
for (Artifact artifact : artifacts) {
if (artifacts.size() == 1 && !isHasGoal(artifact) || goalArtifact == null) {
AWorkbench.popup(String.format("No Goal set for artifact [%s]", artifact));
return null;
}
String currIndexStr = getGoalOrder(goalArtifact, artifact);
- currentOrder += currIndexStr + ", ";
+ currentOrder.append(currIndexStr + ", ");
}
- currentOrder = currentOrder.replaceFirst(", $", "");
List<Artifact> members = goalArtifact.getMembers();
EntryDialog ed =
@@ -244,7 +243,7 @@ public class GoalArtifact extends StateMachineArtifact {
"Change Goal Order",
String.format(
"Goal: %s\n\n%s\n\nEnter New Order Number from 1..%d or %d for last\n\nNote: Goal will be placed before number entered.",
- goalArtifact, currentOrder, members.size(), members.size() + 1));
+ goalArtifact, currentOrder.toString().replaceFirst(", $", ""), members.size(), members.size() + 1));
ed.setNumberFormat(NumberFormat.getIntegerInstance());
int result = ed.open();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java
index eaa749c3cc..c79a78e601 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java
@@ -34,7 +34,7 @@ public class TeamWorkflowExtensions {
private static Set<IAtsTeamWorkflow> teamWorkflowExtensionItems;
private TeamWorkflowExtensions() {
- instance = this;
+ // private contructor
}
public static TeamWorkflowExtensions getInstance() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
index 37c733dd0b..bc410d9391 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
@@ -89,8 +89,8 @@ import org.eclipse.ui.part.MultiPageEditorPart;
public class SMAEditor extends AbstractArtifactEditor implements ISMAEditorEventHandler, ISelectedAtsArtifacts, IActionable, IAtsMetricsProvider, IXTaskViewer {
public static final String EDITOR_ID = "org.eclipse.osee.ats.editor.SMAEditor";
private StateMachineArtifact sma;
- private int workFlowPageIndex, metricsPageIndex, attributesPageIndex;
private SMAWorkFlowTab workFlowTab;
+ int attributesPageIndex;
private AttributesComposite attributesComposite;
private boolean priviledgedEditModeEnabled = false;
private Action printAction;
@@ -140,7 +140,7 @@ public class SMAEditor extends AbstractArtifactEditor implements ISMAEditorEvent
createAttributesTab();
createMetricsTab();
- setActivePage(workFlowPageIndex);
+ setActivePage(SMAWorkFlowTab.ID);
} catch (Exception ex) {
OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
}
@@ -154,7 +154,7 @@ public class SMAEditor extends AbstractArtifactEditor implements ISMAEditorEvent
private void createWorkflowTab() {
try {
workFlowTab = new SMAWorkFlowTab(sma);
- workFlowPageIndex = addPage(workFlowTab);
+ addPage(workFlowTab);
} catch (Exception ex) {
OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
}
@@ -301,7 +301,7 @@ public class SMAEditor extends AbstractArtifactEditor implements ISMAEditorEvent
Composite composite = AtsUtil.createCommonPageComposite(getContainer());
createToolBar(composite);
new AtsMetricsComposite(this, composite, SWT.NONE);
- metricsPageIndex = addPage(composite);
+ int metricsPageIndex = addPage(composite);
setPageText(metricsPageIndex, "Metrics");
} catch (Exception ex) {
OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
@@ -375,7 +375,7 @@ public class SMAEditor extends AbstractArtifactEditor implements ISMAEditorEvent
sma.getEditor().onDirtied();
updatePartName();
} catch (Exception ex) {
- // do nothing
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java
index 487a38a9ec..b456696bcd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java
@@ -42,13 +42,13 @@ import org.eclipse.osee.framework.ui.swt.Displays;
public class SMAEditorArtifactEventManager implements IArtifactEventListener {
List<ISMAEditorEventHandler> handlers = new ArrayList<ISMAEditorEventHandler>();
- static SMAEditorArtifactEventManager instance;
+ static SMAEditorArtifactEventManager instance = new SMAEditorArtifactEventManager();
+
+ public SMAEditorArtifactEventManager() {
+ OseeEventManager.addListener(instance);
+ }
public static void add(ISMAEditorEventHandler iWorldEventHandler) {
- if (instance == null) {
- instance = new SMAEditorArtifactEventManager();
- OseeEventManager.addListener(instance);
- }
instance.handlers.add(iWorldEventHandler);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
index fc41c43ae1..07505c3c5a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
@@ -37,14 +37,14 @@ import org.eclipse.osee.framework.ui.swt.Displays;
public class SMAEditorBranchEventManager implements IBranchEventListener {
List<ISMAEditorEventHandler> handlers = new ArrayList<ISMAEditorEventHandler>();
- static SMAEditorBranchEventManager instance;
+ static SMAEditorBranchEventManager instance = new SMAEditorBranchEventManager();
+
+ public SMAEditorBranchEventManager() {
+ OseeEventManager.addListener(instance);
+ }
public static void add(ISMAEditorEventHandler iWorldEventHandler) {
- if (instance == null) {
- instance = new SMAEditorBranchEventManager();
- OseeEventManager.addListener(instance);
- }
- instance.handlers.add(iWorldEventHandler);
+ OseeEventManager.addListener(instance);
}
public static void remove(ISMAEditorEventHandler iWorldEventHandler) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAOperationsSection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAOperationsSection.java
index c971d24559..594e21ad4e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAOperationsSection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAOperationsSection.java
@@ -10,8 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.ats.editor;
+import java.util.ArrayList;
import java.util.Collections;
-import java.util.logging.Level;
+import java.util.List;
import org.eclipse.osee.ats.actions.AccessControlAction;
import org.eclipse.osee.ats.actions.ConvertActionableItemsAction;
import org.eclipse.osee.ats.actions.DeletePurgeAtsArtifactsAction;
@@ -56,7 +57,7 @@ import org.eclipse.ui.forms.widgets.Section;
public class SMAOperationsSection extends SectionPart {
protected final SMAEditor editor;
- private ISMAOperationsSection advOperation = null;
+ private static List<ISMAOperationsSection> advOperations;
private boolean sectionCreated = false;
public SMAOperationsSection(SMAEditor editor, Composite parent, FormToolkit toolkit, int style) {
@@ -65,16 +66,14 @@ public class SMAOperationsSection extends SectionPart {
registerAdvancedSectionsFromExtensionPoints();
}
- private void registerAdvancedSectionsFromExtensionPoints() {
-
- ExtensionDefinedObjects<ISMAOperationsSection> extensions =
- new ExtensionDefinedObjects<ISMAOperationsSection>(AtsPlugin.PLUGIN_ID + ".AtsAdvancedOperationAction",
- "AtsAdvancedOperationAction", "classname");
- for (ISMAOperationsSection item : extensions.getObjects()) {
- try {
- advOperation = item;
- } catch (Exception ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ private synchronized void registerAdvancedSectionsFromExtensionPoints() {
+ if (advOperations == null) {
+ advOperations = new ArrayList<ISMAOperationsSection>();
+ ExtensionDefinedObjects<ISMAOperationsSection> extensions =
+ new ExtensionDefinedObjects<ISMAOperationsSection>(AtsPlugin.PLUGIN_ID + ".AtsAdvancedOperationAction",
+ "AtsAdvancedOperationAction", "classname");
+ for (ISMAOperationsSection item : extensions.getObjects()) {
+ advOperations.add(item);
}
}
}
@@ -113,12 +112,7 @@ public class SMAOperationsSection extends SectionPart {
createViewsEditorsSection(sectionBody, toolkit);
createNotificationsSection(sectionBody, toolkit);
- if (advOperation != null && advOperation.isValid(editor)) {
- advOperation.createAdvancedSection(editor, sectionBody, toolkit);
- } else {
- createAdvancedSection(sectionBody, toolkit);
- }
-
+ createAdvancedSection(sectionBody, toolkit);
createAdminSection(sectionBody, toolkit);
section.setClient(sectionBody);
@@ -172,6 +166,13 @@ public class SMAOperationsSection extends SectionPart {
new XButtonViaAction(new ReloadAction(editor.getSma())).createWidgets(sectionBody, 2);
new XButtonViaAction(new ConvertActionableItemsAction(editor)).createWidgets(sectionBody, 2);
}
+
+ for (ISMAOperationsSection operation : advOperations) {
+ if (operation.isValid(editor)) {
+ operation.createAdvancedSection(editor, sectionBody, toolkit);
+ }
+ }
+
section.setClient(sectionBody);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
index 2b9ac843ee..3e3b19c863 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
@@ -111,9 +111,10 @@ public class SMAWorkFlowTab extends FormPage implements IActionable {
private SMAHistorySection smaHistorySection;
private LoadingComposite loadingComposite;
private static String PRIVILEGED_EDIT = "(Priviledged Edit Enabled)";
+ public static String ID = "ats.workflow.tab";
public SMAWorkFlowTab(StateMachineArtifact sma) {
- super(sma.getEditor(), "overview", "Workflow");
+ super(sma.getEditor(), ID, "Workflow");
this.sma = sma;
toolkit = sma.getEditor().getToolkit();
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AtsHealthCheck.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AtsHealthCheck.java
index cfc72b4e82..a4b2f81071 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AtsHealthCheck.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AtsHealthCheck.java
@@ -26,37 +26,31 @@ import org.osgi.framework.Bundle;
*/
public class AtsHealthCheck {
- private static Set<IAtsHealthCheck> healthCheckItems = null;
-
public static Set<IAtsHealthCheck> getAtsHealthCheckItems() {
- if (healthCheckItems == null) {
- healthCheckItems = new HashSet<IAtsHealthCheck>();
+ Set<IAtsHealthCheck> healthCheckItems = new HashSet<IAtsHealthCheck>();
- IExtensionPoint point =
- Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsHealthCheck");
- if (point == null) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, "Can't access AtsHealthCheck extension point");
- return healthCheckItems;
- }
- IExtension[] extensions = point.getExtensions();
- for (IExtension extension : extensions) {
- IConfigurationElement[] elements = extension.getConfigurationElements();
- String classname = null;
- String bundleName = null;
- for (IConfigurationElement el : elements) {
- if (el.getName().equals("AtsHealthCheck")) {
- classname = el.getAttribute("classname");
- bundleName = el.getContributor().getName();
- if (classname != null && bundleName != null) {
- Bundle bundle = Platform.getBundle(bundleName);
- try {
- Class<?> taskClass = bundle.loadClass(classname);
- Object obj = taskClass.newInstance();
- healthCheckItems.add((IAtsHealthCheck) obj);
- } catch (Exception ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, "Error loading AtsHealthCheck extension",
- ex);
- }
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsHealthCheck");
+ if (point == null) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, "Can't access AtsHealthCheck extension point");
+ return healthCheckItems;
+ }
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String classname = null;
+ String bundleName = null;
+ for (IConfigurationElement el : elements) {
+ if (el.getName().equals("AtsHealthCheck")) {
+ classname = el.getAttribute("classname");
+ bundleName = el.getContributor().getName();
+ if (classname != null && bundleName != null) {
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ Class<?> taskClass = bundle.loadClass(classname);
+ Object obj = taskClass.newInstance();
+ healthCheckItems.add((IAtsHealthCheck) obj);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, "Error loading AtsHealthCheck extension", ex);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
index 645d5927cb..035167ad68 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -528,16 +528,16 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
artifact.getAttributesToString(attrType));
Map<String, Attribute<?>> valuesAttrMap = new HashMap<String, Attribute<?>>();
int latestGamma = 0;
- String fixInfo = " - FIX AVAILABLE";
+ StringBuffer fixInfo = new StringBuffer(" - FIX AVAILABLE");
for (Attribute<?> attr : artifact.getAttributes(attrType)) {
if (attr.getGammaId() > latestGamma) {
latestGamma = attr.getGammaId();
}
String info = String.format("[Gamma [%s] Value [%s]]", attr.getGammaId(), attr.getValue());
valuesAttrMap.put(info, attr);
- fixInfo += info;
+ fixInfo.append(info);
}
- fixInfo += " - KEEP Gamma" + latestGamma;
+ fixInfo.append(" - KEEP Gamma" + latestGamma);
if (latestGamma != 0) {
result += fixInfo;
if (fixAttributeValues) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/ArtifactChangeReportComparer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/ArtifactChangeReportComparer.java
index 252aea809e..c8f84c67fe 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/ArtifactChangeReportComparer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/ArtifactChangeReportComparer.java
@@ -42,4 +42,15 @@ public class ArtifactChangeReportComparer extends DataChangeReportComparer {
}
return compareResult;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/AttributeChangeReportComparer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/AttributeChangeReportComparer.java
index 7706d2525d..51bdadb2f2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/AttributeChangeReportComparer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/AttributeChangeReportComparer.java
@@ -54,4 +54,15 @@ public class AttributeChangeReportComparer extends DataChangeReportComparer {
}
return compareResults;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/RelationChangeReportComparer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/RelationChangeReportComparer.java
index 9ed395d028..0b36a89f05 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/RelationChangeReportComparer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/change/RelationChangeReportComparer.java
@@ -44,4 +44,14 @@ public class RelationChangeReportComparer extends DataChangeReportComparer {
return compareResults;
}
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
index 196db5e8e0..24e36667a4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
@@ -62,8 +62,8 @@ public class ActionHyperView extends HyperView implements IActionable, IArtifact
public static String VIEW_ID = "org.eclipse.osee.ats.hyper.ActionHyperView";
private static String HELP_CONTEXT_ID = "atsActionView";
- private static ActionHyperItem topAHI;
- private static ATSArtifact currentArtifact;
+ private ActionHyperItem topAHI;
+ private ATSArtifact currentArtifact;
private Cursor cursor;
public ActionHyperView() {
@@ -117,15 +117,17 @@ public class ActionHyperView extends HyperView implements IActionable, IArtifact
@Override
public void handleItemDoubleClick(HyperViewItem hvi) {
- Artifact art = ((ActionHyperItem) hvi).getArtifact();
- if (art == null) {
- ((ActionHyperItem) hvi).handleDoubleClick(hvi);
+ if (hvi instanceof ActionHyperItem) {
+ Artifact art = ((ActionHyperItem) hvi).getArtifact();
+ if (art == null) {
+ ((ActionHyperItem) hvi).handleDoubleClick(hvi);
- } else if (art.isDeleted()) {
- AWorkbench.popup("ERROR", "Artifact has been deleted");
- return;
- } else {
- AtsUtil.openATSAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ } else if (art.isDeleted()) {
+ AWorkbench.popup("ERROR", "Artifact has been deleted");
+ return;
+ } else {
+ AtsUtil.openATSAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ }
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
index 3f749bb63d..687231c853 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
@@ -59,9 +59,8 @@ import org.eclipse.ui.PlatformUI;
public class ArtifactHyperView extends HyperView implements IArtifactEventListener, IActionable, IPerspectiveListener2 {
public static String VIEW_ID = "org.eclipse.osee.ats.hyper.ArtifactHyperView";
- public static ArtifactHyperItem topAHI;
- public static Artifact currentArtifact;
- private Action pinAction;
+ public ArtifactHyperItem topAHI;
+ public Artifact currentArtifact;
public ArtifactHyperView() {
super();
@@ -103,7 +102,9 @@ public class ArtifactHyperView extends HyperView implements IArtifactEventListen
@Override
public void handleItemDoubleClick(HyperViewItem hvi) {
- currentArtifact = ((ArtifactHyperItem) hvi).getArtifact();
+ if (hvi instanceof ArtifactHyperItem) {
+ currentArtifact = ((ArtifactHyperItem) hvi).getArtifact();
+ }
display();
}
@@ -193,9 +194,6 @@ public class ArtifactHyperView extends HyperView implements IArtifactEventListen
}
public void handleWindowChange() {
- if (pinAction.isChecked()) {
- return;
- }
if (!this.getSite().getPage().isPartVisible(this)) {
return;
}
@@ -282,7 +280,6 @@ public class ArtifactHyperView extends HyperView implements IArtifactEventListen
tbm.add(new Separator());
tbm.add(openByIdAction);
tbm.add(openArtAction);
- tbm.add(pinAction);
}
public void handleOpenArtifact() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java
index 20d25518a8..0dcc266e23 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsPlugin.java
@@ -31,7 +31,7 @@ import org.osgi.framework.ServiceRegistration;
public class AtsPlugin implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.osee.ats";
- private static AtsPlugin pluginInstance;
+ private static AtsPlugin pluginInstance = new AtsPlugin();
private ServiceRegistration service1;
private ServiceRegistration service2;
private ServiceDependencyTracker tracker;
@@ -39,7 +39,6 @@ public class AtsPlugin implements BundleActivator {
public AtsPlugin() {
super();
- AtsPlugin.pluginInstance = this;
AtsPreSaveCacheRemoteEventHandler.start();
AtsCacheManager.start();
AtsNotifyUsers.start();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
index 7652c448a6..4534b4cc45 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
@@ -84,7 +84,9 @@ public class OseeAtsServiceImpl implements IOseeCmService {
public boolean isCompleted(Artifact artifact) {
if (isPcrArtifact(artifact)) {
try {
- return ((StateMachineArtifact) artifact).isCancelledOrCompleted();
+ if (artifact instanceof StateMachineArtifact) {
+ return ((StateMachineArtifact) artifact).isCancelledOrCompleted();
+ }
} catch (OseeCoreException ex) {
OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
index 51200032b3..901726280c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
@@ -79,7 +79,6 @@ public class NavigateView extends ViewPart implements IActionable {
public static final String VIEW_ID = "org.eclipse.osee.ats.navigate.NavigateView";
public static final String HELP_CONTEXT_ID = "atsNavigator";
private AtsNavigateComposite xNavComp;
- private final boolean includeCompleteCancelled = false;
private Composite parent;
private LoadingComposite loadingComposite;
@@ -211,10 +210,6 @@ public class NavigateView extends ViewPart implements IActionable {
}, "org.eclipse.osee.framework.ui.skynet.BlamOperation");
}
- public boolean isIncludeCompleteCancelled() {
- return includeCompleteCancelled;
- }
-
private String getWhoAmI() {
try {
String userName = UserManager.getUser().getName();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
index cd0bbd85a4..7edd9bb5d5 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
@@ -12,7 +12,9 @@ package org.eclipse.osee.ats.navigate;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.world.WorldEditor;
@@ -33,11 +35,13 @@ public class VisitedItems extends XNavigateItemAction {
public static List<Artifact> getReverseVisited() throws OseeCoreException {
// Search artifacts and hold on to references so don't get garbage collected
- @SuppressWarnings("unused")
- Collection<Artifact> artifacts = ArtifactQuery.getArtifactListFromIds(visitedGuids, AtsUtil.getAtsBranch());
+ Map<String, Artifact> artifacts = new HashMap<String, Artifact>();
+ for (Artifact art : ArtifactQuery.getArtifactListFromIds(visitedGuids, AtsUtil.getAtsBranch())) {
+ artifacts.put(art.getGuid(), art);
+ }
List<Artifact> revArts = new ArrayList<Artifact>();
for (int x = visitedGuids.size(); x <= 0; x--) {
- Artifact art = ArtifactQuery.getArtifactFromId(visitedGuids.get(x), AtsUtil.getAtsBranch());
+ Artifact art = artifacts.get(visitedGuids.get(x));
if (art != null) {
revArts.add(art);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotification.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotification.java
index d91dfa69e3..278a5f1d38 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotification.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotification.java
@@ -30,7 +30,6 @@ public class AtsNotification {
private static AtsNotification instance = new AtsNotification();
private AtsNotification() {
- instance = this;
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsNotification");
if (point == null) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationNavigateItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationNavigateItem.java
index b08155b291..a3898e5238 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationNavigateItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationNavigateItem.java
@@ -58,7 +58,7 @@ public class AtsNotificationNavigateItem extends XNavigateItemAction {
}
}
- public class NotificationJob extends AbstractOperation {
+ private static class NotificationJob extends AbstractOperation {
private final boolean sendNotifications;
private final Collection<IAtsNotification> notifications;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskTabXWidgetActionPage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskTabXWidgetActionPage.java
index fc50000c74..f816bfc311 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskTabXWidgetActionPage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskTabXWidgetActionPage.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.ats.task;
import java.util.logging.Level;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
@@ -56,7 +55,6 @@ import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.Section;
-import org.osgi.framework.Bundle;
/**
* @author Donald G. Dunne
@@ -155,7 +153,6 @@ public class TaskTabXWidgetActionPage extends AtsXWidgetActionFormPage implement
toolBarManager.add(new RefreshAction(taskComposite));
toolBarManager.add(new Separator());
toolBarManager.add(new NewAction());
- Bundle bundle = Platform.getBundle(AtsPlugin.PLUGIN_ID);
OseeUiActions.addButtonToEditorToolBar(smaEditor, smaEditor, AtsPlugin.PLUGIN_ID, toolBarManager,
TaskEditor.EDITOR_ID, "ATS Task Tab");
toolBarManager.add(new Separator());
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
index 47a70fef85..d8716f2186 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
@@ -122,7 +122,6 @@ public class TaskXViewer extends WorldXViewer {
Action editTaskTitleAction, editTaskAssigneesAction, editTaskStatusAction, editTaskHoursSpentAction,
editTaskResolutionAction, editTaskEstimateAction, editTaskRelatedStateAction, editTaskNotesAction;
Action addNewTaskAction, deleteTasksAction;
- Action showRelatedAction;
@Override
public void createMenuActions() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsFolderUtil.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsFolderUtil.java
index 31d4dd329a..6326f36b2d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsFolderUtil.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsFolderUtil.java
@@ -35,9 +35,9 @@ public class AtsFolderUtil {
WorkRules("Work Rules", "Work Rules", CoreArtifactTypes.Folder),
WorkWidgets("Work Widgets", "Work Widgets", CoreArtifactTypes.Folder),
WorkPages("Work Pages", "Work Pages", CoreArtifactTypes.Folder);
- protected final String displayName;
- protected final String staticId;
- protected final IArtifactType artifactType;
+ final String displayName;
+ final String staticId;
+ final IArtifactType artifactType;
private AtsFolder(String displayName, String staticId, IArtifactType artifactType) {
this.displayName = displayName;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelationTypes.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelationTypes.java
index 09ce47f614..141045b5cb 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelationTypes.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelationTypes.java
@@ -100,4 +100,15 @@ public class AtsRelationTypes extends NamedIdentity implements IRelationEnumerat
public RelationSide getSide() {
return relationSide;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
index 7ad0a64d2d..1d1a42e74a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
@@ -95,7 +95,7 @@ public final class AtsUtil {
public final static String activeColor = "#EEEEEE";
private static ArtifactTypeEventFilter atsObjectArtifactTypesFilter, reviewArtifactTypesFilter,
teamWorkflowArtifactTypesFilter, workItemArtifactTypesFilter;
- private static List<IEventFilter> atsObjectEventFilter;
+ private static List<IEventFilter> atsObjectEventFilter = new ArrayList<IEventFilter>(2);
private AtsUtil() {
super();
@@ -434,10 +434,9 @@ public final class AtsUtil {
return results;
}
- public static List<IEventFilter> getAtsObjectEventFilters() {
+ public synchronized static List<IEventFilter> getAtsObjectEventFilters() {
try {
- if (atsObjectEventFilter == null) {
- atsObjectEventFilter = new ArrayList<IEventFilter>(2);
+ if (atsObjectEventFilter.size() == 0) {
atsObjectEventFilter.add(OseeEventManager.getCommonBranchFilter());
atsObjectEventFilter.add(getAtsObjectArtifactTypeEventFilter());
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ChangePointDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ChangePointDialog.java
index 389e5217b2..53ee0b9e43 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ChangePointDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ChangePointDialog.java
@@ -102,7 +102,7 @@ public class ChangePointDialog extends ListDialog {
super.okPressed();
}
- public class PointLabelProvider implements ILabelProvider {
+ private static class PointLabelProvider implements ILabelProvider {
@Override
public Image getImage(Object arg0) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItemAts.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItemAts.java
index 7a0afbe522..dc8c220615 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItemAts.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItemAts.java
@@ -10,54 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.ats.util;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.nebula.widgets.xviewer.customize.CustomizeData;
-import org.eclipse.osee.ats.artifact.ATSNote;
-import org.eclipse.osee.ats.artifact.ActionArtifact;
-import org.eclipse.osee.ats.artifact.AtsAttributeTypes;
-import org.eclipse.osee.ats.artifact.NoteItem;
-import org.eclipse.osee.ats.artifact.TaskArtifact;
-import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.config.AtsBulkLoad;
-import org.eclipse.osee.ats.health.ValidateAtsDatabase;
-import org.eclipse.osee.ats.internal.AtsPlugin;
-import org.eclipse.osee.framework.core.enums.BranchArchivedState;
-import org.eclipse.osee.framework.core.enums.BranchType;
-import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
-import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.jdk.core.util.AFile;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.utility.ElapsedTime;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
-import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.swt.Displays;
/**
@@ -70,13 +28,10 @@ public class DoesNotWorkItemAts extends XNavigateItemAction {
}
@Override
- public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ public void run(TableLoadOption... tableLoadOptions) {
if (!MessageDialog.openConfirm(Displays.getActiveShell(), getName(), getName())) {
return;
}
- convertAtsStateNotesAndDefectItemsUserIds();
- // fixNotesStateNames();
- // renameTransactionComments();
// SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Admin Cleanup");
// Artifact verArt =
// ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Version, "0.9.0", AtsUtil.getAtsBranch());
@@ -99,565 +54,7 @@ public class DoesNotWorkItemAts extends XNavigateItemAction {
// verArt.persist(transaction);
// transaction.execute();
- // deleteDuplicateCommonBranchDuplicateRelations();
- // convertAtsLogUserIds(transaction);
- // deleteUnAssignedUserRelations();
- // relateDonDunne();
-
- // testDeleteAttribute();
- // deleteNullUserAttributes();
- // XNavigateItem item = AtsNavigateViewItems.getInstance().getSearchNavigateItems().get(1);
- // System.out.println("Item " + item.getName());
- // NavigateView.getNavigateView().handleDoubleClick(item);
-
- // XResultData.runExample();
-
- // fixOseePeerReviews();
-
AWorkbench.popup("Completed", "Complete");
}
- @SuppressWarnings("unused")
- private void myWorldTimeTest() throws OseeCoreException {
- AtsBulkLoad.loadConfig(true);
- // ElapsedTime time = new ElapsedTime("My World via Relations");
- // Set<Artifact> assigned =
- // RelationManager.getRelatedArtifacts(Arrays.asList(UserManager.getUser()), 1,
- // CoreRelationTypes.Users_Artifact);
- // System.out.println("Returned " + assigned.size() + " objects");
- // time.end();
-
- ElapsedTime time = new ElapsedTime("My World via Attribute Search");
- List<Artifact> assignedList =
- ArtifactQuery.getArtifactListFromAttribute(AtsAttributeTypes.CurrentState, "%727536%", AtsUtil.getAtsBranch());
- System.out.println("Returned " + assignedList.size() + " objects");
- time.end();
-
- }
-
- @SuppressWarnings("unused")
- private void fixNotesStateNames() throws OseeCoreException {
- Map<String, Integer> valueToGammaId = new HashMap<String, Integer>();
- String SELECT_QUERY = "select * from osee_attribute where value like '%quot; State%'";
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SELECT_QUERY);
- while (chStmt.next()) {
- int gammaId = chStmt.getInt("gamma_id");
- String value = chStmt.getString("value");
- valueToGammaId.put(value, gammaId);
- }
- } finally {
- chStmt.close();
- }
-
- for (Entry<String, Integer> entry : valueToGammaId.entrySet()) {
- String value = entry.getKey();
- int gammaId = entry.getValue();
- System.out.println("Old GammaId " + gammaId + " Value = " + value);
- List<NoteItem> items = ATSNote.getNoteItems(value, "GammaId:" + gammaId);
- for (NoteItem item : items) {
- System.out.println(String.format("Pre State [%s]", item.getState()));
- }
-
- // Make changes
- value = value.replaceAll("\\&quot; State", "");
- value = value.replaceAll("state=\"\\&quot;", "state=\"");
- System.out.println("New GammaId " + gammaId + " Value = " + value);
- items = ATSNote.getNoteItems(value, "GammaId:" + gammaId);
- for (NoteItem item : items) {
- System.out.println(String.format("Post State [%s]", item.getState()));
- }
- // ConnectionHandler.runPreparedUpdate(UPDATE_QUERY, value, gammaId);
- }
- }
-
- private void convertAtsStateNotesAndDefectItemsUserIds() throws OseeCoreException {
- String SELECT_QUERY = "select * from osee_attribute where value like ? and attr_type_id in (84,92,72,73)";
- Map<String, String> oldIdToNewId = new HashMap<String, String>();
- oldIdToNewId.put("<va053c>", "<1588621>");
- oldIdToNewId.put("<fw314c>", "<1631765>");
-
- for (Entry<String, String> entry : oldIdToNewId.entrySet()) {
-
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SELECT_QUERY, "%" + entry.getKey() + "%");
- while (chStmt.next()) {
- int gammaId = chStmt.getInt("gamma_id");
- String value = chStmt.getString("value");
- System.out.println("Old " + gammaId + " Value = " + value);
- value = value.replaceAll(entry.getKey(), entry.getValue());
- System.out.println("New " + gammaId + " Value = " + value);
- // ConnectionHandler.runPreparedUpdate(UPDATE_QUERY, value, gammaId);
- }
- } finally {
- chStmt.close();
- }
-
- }
- }
-
- @SuppressWarnings("unused")
- private void renameTransactionComments() throws OseeCoreException {
- List<String> notRenamed = new ArrayList<String>();
- Map<String, Integer> commentToTransId = new HashMap<String, Integer>();
- String SEARCH_TRANSACTION_COMMENTS =
- "select transaction_id, osee_comment from osee_tx_details where osee_comment like '%Commit%'";
-
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SEARCH_TRANSACTION_COMMENTS);
- while (chStmt.next()) {
- int transId = chStmt.getInt("transaction_id");
- String comment = chStmt.getString("osee_comment");
- commentToTransId.put(comment, transId);
- }
- } finally {
- chStmt.close();
- }
-
- for (Entry<String, Integer> entry : commentToTransId.entrySet()) {
- String comment = entry.getKey();
- Pattern traxPattern = Pattern.compile("^(.*? - TRAX RPCR .*)( - TRAX RPCR .*)$");
- Pattern shortPattern = Pattern.compile("^(.*? -) +(.*?) - +(.*?)$");
- System.out.println("TransId " + entry.getValue() + " Comment = " + comment);
-
- boolean renamed = false;
- Matcher m = traxPattern.matcher(comment);
- if (m.find()) {
- String first = m.group(1);
- m.group(2);
- String newComment = first;
- if (!comment.equals(newComment)) {
- renamed = true;
- System.out.println("TransId " + entry.getValue() + " Rename1 = " + newComment);
- // TransactionManager.setTransactionComment(TransactionManager.getTransactionId(entry.getValue()),
- // newComment);
- }
- }
- if (!renamed) {
- m = shortPattern.matcher(comment);
- if (m.find()) {
- String prefix = m.group(1);
- String first = m.group(2);
- String second = m.group(3);
- second = second.replaceFirst("...$", "");
- String newComment = prefix + " " + first;
- if (first.equals(second) || first.startsWith(second)) {
- renamed = true;
- System.out.println("TransId " + entry.getValue() + " Rename2 = " + newComment);
- // TransactionManager.setTransactionComment(TransactionManager.getTransactionId(entry.getValue()),
- // newComment);
- }
- }
- }
- if (!renamed) {
- notRenamed.add(comment);
- }
-
- }
- for (String branchName : notRenamed) {
- System.out.println("Not Renamed " + branchName);
- }
-
- }
-
- @SuppressWarnings("unused")
- private void renameBranches() throws OseeCoreException {
- List<String> notRenamed = new ArrayList<String>();
- Pattern traxPattern = Pattern.compile("^(..... - TRAX RPCR .*)( - TRAX RPCR .*)$");
- Pattern shortPattern = Pattern.compile("^(..... -) +(.*?) - +(.*?)$");
- Collection<Branch> branches = BranchManager.getBranches(BranchArchivedState.ALL, BranchType.WORKING);
- int x = 0;
- for (Branch branch : branches) {
- System.out.println(String.format("\n%d/%d - Branch = [%s]", x++, branches.size(), branch));
- String branchName = branch.getName();
- boolean renamed = false;
- Matcher m = traxPattern.matcher(branch.getName());
- if (m.find()) {
- String first = m.group(1);
- m.group(2);
- String newBranchName = first;
- if (!branchName.equals(newBranchName)) {
- renamed = true;
- System.out.println("Rename = " + newBranchName);
- branch.setName(newBranchName);
- BranchManager.persist(branch);
- }
- }
- if (branchName.contains("BGJ6A")) {
- System.out.println("here");
- }
- if (!renamed) {
- m = shortPattern.matcher(branch.getName());
- if (m.find()) {
- String prefix = m.group(1);
- String first = m.group(2);
- String second = m.group(3);
- second = second.replaceFirst("...$", "");
- String newBranchName = prefix + " " + first;
- if (first.equals(second) || first.startsWith(second)) {
- renamed = true;
- System.out.println("Rename = " + newBranchName);
- branch.setName(newBranchName);
- BranchManager.persist(branch);
- }
- }
- }
- if (!renamed) {
- notRenamed.add(branchName);
- }
-
- }
- for (String branchName : notRenamed) {
- System.out.println("Not Renamed " + branchName);
- }
-
- }
-
- @SuppressWarnings("unused")
- private void deleteDuplicateCommonBranchDuplicateRelations() throws OseeCoreException {
- XResultData rd = new XResultData();
- rd.log(getName());
- int listsCount = 0;
- int artifactsCount = 0;
- boolean fix = true;
- SkynetTransaction transaction =
- new SkynetTransaction(AtsUtil.getAtsBranch(), "Delete duplicate common branch relations");
-
- // Break artifacts into blocks so don't run out of memory
- List<Collection<Integer>> artIdLists = ValidateAtsDatabase.loadAtsBranchArtifactIds(rd, null);
- for (Collection<Integer> artIdList : artIdLists) {
- System.out.println(String.format("Processing artifacts from list %d/%d", listsCount++, artIdLists.size()));
- Collection<Artifact> artifacts = ArtifactQuery.getArtifactListFromIds(artIdList, AtsUtil.getAtsBranch());
- artifactsCount += artifacts.size();
-
- for (Artifact artifact : artifacts) {
- List<RelationLink> relLinks = artifact.getRelationsAll(false);
- for (RelationLink relLink : relLinks) {
- // Only handle relations where this artifact is SIDEA (so don't handle same relation twice)
- if (!relLink.getArtifactA().equals(artifact)) {
- continue;
- }
- // Find all duplicates
- List<RelationLink> duplicates = new ArrayList<RelationLink>();
- duplicates.add(relLink);
- for (RelationLink otherRelLink : relLinks) {
- if (relLink == otherRelLink) {
- continue;
- }
- if (relLink.equalsConceptually(otherRelLink)) {
- duplicates.add(otherRelLink);
- }
- }
- // If more than one, there are duplicates
- if (duplicates.size() > 1) {
- handleDuplicates(rd, artifact, duplicates, fix, transaction);
- }
- }
- }
- }
- transaction.execute();
- rd.report(getName());
- }
-
- /**
- * For set of duplicate relations, keep first one and delete rest
- */
- private void handleDuplicates(XResultData rd, Artifact artifact, List<RelationLink> relLinks, boolean fix, SkynetTransaction transaction) throws OseeCoreException {
- Integer firstId = null;
- String firstName = null;
- String str = relLinks.size() + " duplicate relations found for [" + artifact.getHumanReadableId() + "] ";
- for (RelationLink relLink : relLinks) {
- if (firstId == null) {
- firstId = relLink.getId();
- firstName = relLink.getArtifactB().getName();
- } else if (relLink.getId() != firstId && relLink.getArtifactB().getName().equals(firstName)) {
- str += " Deleteable";
- if (fix) {
- relLink.delete(false);
- artifact.persist(transaction);
- }
- }
- str += "[" + relLink.getArtifactB().getName() + "(" + relLink.getId() + ")]";
- }
- System.out.println(str);
- if (fix) {
- rd.log("fixed");
- }
- rd.log(str);
- }
-
- @SuppressWarnings("unused")
- private void purgeHrids() throws OseeCoreException {
- String[] hrids = AFile.readFile("O:\\hrids_to_delete.txt").split("\r\n");
- int x = 0;
- for (String hrid : hrids) {
- hrid = hrid.replaceAll(" ", "");
- System.out.println("Processing " + x++ + " of " + hrids.length);
- try {
- Artifact art = null;
- // Handle case where duplicate hrids
- try {
- art = ArtifactQuery.getArtifactFromId(hrid, AtsUtil.getAtsBranch());
- } catch (MultipleArtifactsExist ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- continue;
- }
- Set<Artifact> artsToDelete = new HashSet<Artifact>();
- if (art instanceof TeamWorkFlowArtifact) {
- art = ((TeamWorkFlowArtifact) art).getParentActionArtifact();
- }
- if (art instanceof ActionArtifact) {
- artsToDelete.add(art);
- artsToDelete.addAll(((ActionArtifact) art).getTeamWorkFlowArtifacts());
- }
- if (artsToDelete.size() > 0) {
- System.out.println("Sleeping 5 sec...");
- Thread.sleep(5000);
- System.out.println("Purging " + artsToDelete.size() + " artifacts...");
- new PurgeArtifacts(artsToDelete).execute();
- }
- } catch (ArtifactDoesNotExist ex) {
- System.out.println("Artifact with hrid does not exist: " + hrid);
- } catch (Exception ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
-
- }
-
- }
-
- @SuppressWarnings("unused")
- private void convertAtsLogUserIds(SkynetTransaction transaction) throws OseeCoreException {
- List<String> hrids =
- Arrays.asList("NKYBF", "J1Z48", "ZY4W5", "U9H58", "9713S", "83XVW", "59B9X", "TQD1J", "UVM7U", "HZT73",
- "C49Q5", "RHCPY", "MBCXV", "YJFKC", "2F461", "AGW15", "K6ZGD", "9W45V", "GG43L", "G2VTQ", "CVWFC", "EXMT0",
- "W1TS8", "JM3RD", "7Q0W3", "P9DKR", "BR2RN", "Z6B0Z", "6KT6U", "HPQJX", "QN2K3", "W0VTD", "LDJMH", "6PWYH",
- "T8B4K", "YTNLC", "9557A", "SQQ6T", "D82X9", "2P5GC", "YK58N", "LWVT1", "KCGSQ", "5X2WL", "C8HWW");
- for (Artifact art : ArtifactQuery.getArtifactListFromIds(hrids, AtsUtil.getAtsBranch())) {
- String str = art.getSoleAttributeValue(AtsAttributeTypes.Log, null);
- str = str.replaceAll("rj236c", "1779483");
- art.setSoleAttributeFromString(AtsAttributeTypes.Log, str);
- art.persist(transaction);
- }
- }
-
- @SuppressWarnings("unused")
- private void fixTestTaskResolutions() throws OseeCoreException {
- System.out.println("Started fixTestTaskResolutions...");
- for (Artifact artifact : ArtifactQuery.getArtifactListFromAttributeType(AtsAttributeTypes.Resolution,
- AtsUtil.getAtsBranch())) {
- if (artifact instanceof TaskArtifact) {
- TaskArtifact taskArt = (TaskArtifact) artifact;
- String resolution = ((TaskArtifact) artifact).getSoleAttributeValue(AtsAttributeTypes.Resolution, null);
- if (resolution == null) {
- System.err.println("Unexpected null resolution." + taskArt.getHumanReadableId());
- // taskArt.deleteSoleAttribute(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
- // taskArt.persistAttributes();
- } else {
- String newResolution = null;
- if (resolution.equals("Need_DTE_Test")) {
- System.out.println("Rename Need_DTE_Test to In_DTE_Test " + taskArt.getHumanReadableId());
- newResolution = "In_DTE_Test";
- } else if (resolution.equals("Awaiting_Code_Fix")) {
- System.out.println("Rename Awaiting_Code_Fix to Awaiting_Code " + taskArt.getHumanReadableId());
- newResolution = "Awaiting_Code";
- } else if (resolution.equals("Awaiting_Review")) {
- System.out.println("Rename Awaiting_Review to In_DTE_Test " + taskArt.getHumanReadableId());
- newResolution = "In_DTE_Test";
- } else if (resolution.equals("Unit_Tested")) {
- System.out.println("Rename Unit_Tested to In_DTE_Test " + taskArt.getHumanReadableId());
- newResolution = "In_DTE_Test";
- }
- if (newResolution != null) {
- taskArt.setSoleAttributeFromString(AtsAttributeTypes.Resolution, newResolution);
- taskArt.persist();
- }
- }
- }
- }
- System.out.println("Completed fixTestTaskResolutions...");
- }
-
- // private void deleteUnAssignedUserRelations() throws OseeCoreException {
- // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsUtil.getAtsBranch()) {
- //
- // @Override
- // protected void handleTxWork() throws OseeCoreException {
- // User unassignedUser = SkynetAuthentication.getUser(UserEnum.UnAssigned);
- // for (Artifact art : unassignedUser.getRelatedArtifacts(CoreRelationEnumeration.Users_Artifact)) {
- // if (art instanceof StateMachineArtifact) {
- // unassignedUser.deleteRelation(CoreRelationEnumeration.Users_Artifact, art);
- // }
- // }
- // unassignedUser.persistRelations();
- // }
- // };
- // newActionTx.execute();
- // }
-
- // private static final boolean fixIt = false;
-
- // public void cleanXViewerCustomizations() throws OseeCoreException {
- // for (User user : SkynetAuthentication.getUsers()) {
- // System.out.println("User: " + user);
- //
- // SkynetUserArtifactCustomizeDefaults custDefaults = new SkynetUserArtifactCustomizeDefaults(user);
- //
- // // Get all customizations
- // List<String> customizations = user.getAttributesToStringList("XViewer Customization");
- // if (customizations.isEmpty() && custDefaults.isEmpty()) continue;
- // Set<String> validGuids = new HashSet<String>();
- // int currNumDefaults = custDefaults.getGuids().size();
- // for (String custStr : new CopyOnWriteArrayList<String>(customizations)) {
- // CustomizeData custData = new CustomizeData(custStr);
- // validGuids.add(custData.getGuid());
- //
- // // check for old customizations to remove
- // boolean orderFound = custStr.contains("<order>");
- // boolean namespaceNullFound = custStr.contains("namespace=\"null\"");
- // if (orderFound || namespaceNullFound) {
- // System.err.println("Removing " + (orderFound ? "<order>" : "namespace==null") + " customizations " + custData.getGuid());
- // validGuids.remove(custData.getGuid());
- // custDefaults.removeDefaultCustomization(custData);
- // customizations.remove(custStr);
- // } else {
- // // Check for sort columns that are hidden
- // for (String columnName : custData.getSortingData().getSortingNames()) {
- // XViewerColumn xCol = custData.getColumnData().getXColumn(columnName);
- // if (xCol == null) {
- // System.err.println("sort column not found \"" + columnName + "\" - " + custData.getGuid());
- // } else if (xCol.isShow() == false) {
- // System.err.println("sort col is hidden \"" + columnName + "\" - " + custData.getGuid());
- // }
- // }
- // }
- // }
- // if (validGuids.size() != custDefaults.getGuids().size()) {
- // System.err.println("Update default customizations : " + user + " - " + currNumDefaults + " valid: " + validGuids.size());
- // custDefaults.setGuids(validGuids);
- // }
- // if (fixIt) {
- // custDefaults.save();
- // user.setAttributeValues("XViewer Customization", customizations);
- // user.persistAttributes();
- // }
- // }
- // }
-
- public Result isCustomizationSortErrored(String custDataStr, CustomizeData custData) {
-
- return Result.TrueResult;
- }
-
- // String xViewerDefaults = user.getSoleAttributeValueAsString("XViewer Defaults", null);
- // // Get all current default guids
- // Set<String> currentDefaultGuids = new HashSet<String>();
- // if (xViewerDefaults != null) {
- // for (String guid : AXml.getTagDataArray(xViewerDefaults, XVIEWER_DEFAULTS_TAG)) {
- // if (Strings.isValid(guid)) {
- // currentDefaultGuids.add(guid);
- // }
- // }
- // }
- // private void relateDonDunne()throws OseeCoreException{
- // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsUtil.getAtsBranch()) {
- //
- // @Override
- // protected void handleTxWork()throws OseeCoreException{
- // for (Artifact art : ArtifactQuery.getArtifactsFromAttribute(
- // ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
- // "%<" + SkynetAuthentication.getUser().getUserId() + ">%", AtsUtil.getAtsBranch())) {
- // if ((art instanceof StateMachineArtifact) && ((StateMachineArtifact) art).getStateMgr().getAssignees().contains(
- // SkynetAuthentication.getUser())) {
- // art.addRelation(CoreRelationEnumeration.Users_User, SkynetAuthentication.getUser());
- // }
- // }
- // SkynetAuthentication.getUser().persistRelations();
- // }
- // };
- // newActionTx.execute();
- //
- // }
-
- // private void testDeleteAttribute() throws OseeCoreException {
- // Artifact art =
- // ArtifactQuery.getArtifactsFromIds(Arrays.asList("76589"), AtsUtil.getAtsBranch()).iterator().next();
- // for (Attribute<?> attr : art.getAttributes()) {
- // if (attr.getValue() == null) {
- // System.out.println(art.getHumanReadableId() + " - " + attr.getNameValueDescription());
- // attr.delete();
- // }
- // }
- // art.persistAttributes();
- // }
-
- // private void deleteNullAttributes() throws OseeCoreException {
- //
- // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsUtil.getAtsBranch()) {
- //
- // @Override
- // protected void handleTxWork() throws OseeCoreException {
- // int x = 0;
- // for (String artTypeName : Arrays.asList(TeamWorkFlowArtifact.ARTIFACT_NAME, TaskArtifact.ARTIFACT_NAME,
- // DecisionReviewArtifact.ARTIFACT_NAME, PeerToPeerReviewArtifact.ARTIFACT_NAME,
- // "Lba V13 Code Team Workflow", "Lba V13 Test Team Workflow", "Lba V13 Req Team Workflow",
- // "Lba V13 SW Design Team Workflow", "Lba V13 Tech Approach Team Workflow",
- // "Lba V11 REU Code Team Workflow", "Lba V11 REU Test Team Workflow", "Lba V11 REU Req Team Workflow",
- // "Lba B3 Code Team Workflow", "Lba B3 Test Team Workflow", "Lba B3 Req Team Workflow",
- // "Lba B3 SW Design Team Workflow", "Lba B3 Tech Approach Team Workflow")) {
- // for (Artifact team : ArtifactQuery.getArtifactsFromType(artTypeName, AtsUtil.getAtsBranch())) {
- // for (Attribute<?> attr : team.getAttributes(false)) {
- // if (attr.getValue() == null) {
- // System.out.println(team.getHumanReadableId() + " - " + attr.getNameValueDescription());
- // attr.delete();
- // x++;
- // }
- // }
- // if (team.isDirty()) team.persistAttributes();
- // }
- // }
- // System.out.println("Deleted " + x);
- // }
- // };
- // newActionTx.execute();
- //
- // }
- //
- // private void deleteNullUserAttributes() throws OseeCoreException {
- //
- // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsUtil.getAtsBranch()) {
- //
- // @Override
- // protected void handleTxWork() throws OseeCoreException {
- // int x = 0;
- // for (String artTypeName : Arrays.asList(User.ARTIFACT_NAME)) {
- // for (Artifact team : ArtifactQuery.getArtifactsFromType(artTypeName, AtsUtil.getAtsBranch())) {
- // for (Attribute<?> attr : team.getAttributes(false)) {
- // if (attr.getValue() == null) {
- // System.out.println(team.getHumanReadableId() + " - " + attr.getNameValueDescription());
- // attr.delete();
- // x++;
- // }
- // }
- // if (team.isDirty()) team.persistAttributes();
- // }
- // }
- // System.out.println("Deleted " + x);
- // }
- // };
- // newActionTx.execute();
- //
- // }
-
- // for (String artTypeName : Arrays.asList(TeamWorkFlowArtifact.ARTIFACT_NAME, TaskArtifact.ARTIFACT_NAME,
- // DecisionReviewArtifact.ARTIFACT_NAME, PeerToPeerReviewArtifact.ARTIFACT_NAME,
- // "Lba V13 Code Team Workflow", "Lba V13 Test Team Workflow", "Lba V13 Req Team Workflow",
- // "Lba V13 SW Design Team Workflow", "Lba V13 Tech Approach Team Workflow",
- // "Lba V11 REU Code Team Workflow", "Lba V11 REU Test Team Workflow", "Lba V11 REU Req Team Workflow",
- // "Lba B3 Code Team Workflow", "Lba B3 Test Team Workflow", "Lba B3 Req Team Workflow",
- // "Lba B3 SW Design Team Workflow", "Lba B3 Tech Approach Team Workflow")) {
-
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java
index f4aaee8bd6..415d87c476 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java
@@ -10,13 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.ats.util.Import;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osee.ats.internal.AtsPlugin;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
-import org.osgi.framework.Bundle;
/**
* @author Donald G. Dunne
@@ -27,7 +24,6 @@ public class ActionImportWizard extends Wizard implements IImportWizard {
public ActionImportWizard() {
super();
- Bundle bundle = Platform.getBundle(AtsPlugin.PLUGIN_ID);
setWindowTitle("Action Import Wizard");
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
index 67435c88ea..42e70677ad 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
@@ -238,17 +238,17 @@ public class Overview {
public void addTeams(Collection<TeamWorkFlowArtifact> teams) throws OseeCoreException {
startBorderTable(TABLE_WIDTH, false, "Team Workflows");
- String s = AHTML.beginMultiColumnTable(100, 1);
- s += AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "State"}, new Integer[] {70, 150});
+ StringBuffer sb = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
+ sb.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "State"}, new Integer[] {70, 150}));
ArrayList<CellItem> cells = new ArrayList<CellItem>();
for (TeamWorkFlowArtifact team : teams) {
cells.add(new AHTML.CellItem(team.getHyperlinkHtml()));
cells.add(new AHTML.CellItem(team.getStateMgr().getCurrentStateName()));
- s += AHTML.addRowMultiColumnTable(cells);
+ sb.append(AHTML.addRowMultiColumnTable(cells));
cells.clear();
}
- s += AHTML.endMultiColumnTable();
- html.append(s);
+ sb.append(AHTML.endMultiColumnTable());
+ html.append(sb.toString());
endBorderTable();
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
index 3daaa03886..2343b4370b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
@@ -315,7 +315,9 @@ public class XWorkingBranch extends XWidget implements IArtifactWidget, IArtifac
@Override
public void setArtifact(Artifact artifact) {
- this.teamArt = (TeamWorkFlowArtifact) artifact;
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ this.teamArt = (TeamWorkFlowArtifact) artifact;
+ }
enablement = new XWorkingBranchEnablement(teamArt);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java
index 24719e9714..28e6f3dc6d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java
@@ -80,7 +80,7 @@ public class XWorkingBranchEnablement {
return false;
}
- public void refresh() {
+ public synchronized void refresh() {
populated = false;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index e5768c78a1..c22d06b97c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -276,7 +276,9 @@ public class XCommitManager extends XWidget implements IArtifactWidget, IBranchE
public void run() {
if (Widgets.isAccessible(extraInfoLabel)) {
String currentString = extraInfoLabel.getText();
- if (infoStr == null && currentString != null || infoStr != null && currentString == null || !infoStr.equals(currentString)) {
+ if ((infoStr == null && currentString != null) || //
+ (infoStr != null && currentString == null) || //
+ (infoStr != null && currentString != null && !infoStr.equals(currentString))) {
extraInfoLabel.setText("Double-click item to perform Action");
}
extraInfoLabel.setForeground(Displays.getSystemColor(color));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
index 0b9b12e180..f000f9c83b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
@@ -83,7 +83,7 @@ public class XDefectViewer extends XWidget implements IArtifactWidget, IArtifact
private IDirtiableEditor editor;
private IReviewArtifact reviewArt;
public final static String normalColor = "#EEEEEE";
- private static ToolItem newDefectItem, deleteDefectItem;
+ private ToolItem newDefectItem, deleteDefectItem;
private Label extraInfoLabel;
private Composite parentComposite;
private ToolBar toolBar;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
index c8ddf10d07..c53bb6b017 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
@@ -76,7 +76,7 @@ public class XUserRoleViewer extends XWidget implements IArtifactWidget, IArtifa
private IDirtiableEditor editor;
private IReviewArtifact reviewArt;
public final static String normalColor = "#EEEEEE";
- private static ToolItem newUserRoleItem, deleteUserRoleItem;
+ private ToolItem newUserRoleItem, deleteUserRoleItem;
private Label extraInfoLabel;
private ToolBar toolBar;
private static Map<IReviewArtifact, Integer> tableHeight = new HashMap<IReviewArtifact, Integer>();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java
index d29be2b7ef..aa958758bb 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java
@@ -59,4 +59,15 @@ public class XViewerAtsAttributeColumn extends XViewerColumn {
public IAttributeType getAttributeType() {
return attributeType;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java
index 8a7ae9c932..1ff4287df2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java
@@ -74,4 +74,14 @@ public class XViewerReviewRoleColumn extends XViewerValueColumn {
return user;
}
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java
index c23ad7f1d8..18898a4717 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java
@@ -27,7 +27,7 @@ public class ATSXWidgetOptionResolver extends DefaultXWidgetOptionResolver {
public static String OPTIONS_FROM_ATTRIBUTE_VALIDITY = "OPTIONS_FROM_ATTRIBUTE_VALIDITY";
private ATSXWidgetOptionResolver() {
- instance = this;
+ // private constructor
}
@Override
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java
index 93499e4a69..0f3098e13c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java
@@ -184,4 +184,14 @@ public class AtsWorkPage extends WorkPage {
return AtsWorkDefinitions.isAllowCommitBranch(workPageDefinition);
}
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorItem.java
index 001f627551..207727a90b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorItem.java
@@ -27,7 +27,7 @@ public class AtsWorldEditorItem extends AtsWorldEditorItemBase {
@Override
public List<? extends Action> getWorldEditorMenuActions(IWorldEditorProvider worldEditorProvider, WorldEditor worldEditor) {
- return Arrays.asList(new AtsExportManager(worldEditor), new ExportChangeReportsAction(worldEditor),
+ return Arrays.asList(new AtsExportManager(worldEditor), new ExportChangeReportsAction(worldEditor, false),
new DuplicateWorkflowViaWorldEditorAction(worldEditor), new CompleteMultipleWorkflows(worldEditor),
new CancelMultipleWorkflows(worldEditor));
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
index a7f313e082..ca6bb1cde2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
@@ -40,20 +40,18 @@ import org.eclipse.osee.framework.ui.swt.Displays;
public class WorldXViewerEventManager implements IArtifactEventListener {
List<IWorldViewerEventHandler> handlers = new ArrayList<IWorldViewerEventHandler>();
- static WorldXViewerEventManager instance;
+ static WorldXViewerEventManager instance = new WorldXViewerEventManager();
+
+ public WorldXViewerEventManager() {
+ OseeEventManager.addListener(instance);
+ }
public static void add(IWorldViewerEventHandler iWorldEventHandler) {
- if (instance == null) {
- instance = new WorldXViewerEventManager();
- OseeEventManager.addListener(instance);
- }
instance.handlers.add(iWorldEventHandler);
}
public static void remove(IWorldViewerEventHandler iWorldEventHandler) {
- if (instance != null) {
- instance.handlers.remove(iWorldEventHandler);
- }
+ instance.handlers.remove(iWorldEventHandler);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java
index b3a0e8b329..e7455c6215 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java
@@ -113,8 +113,10 @@ public class GoalSearchItem extends WorldUISearchItem {
public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
getTeamDefs();
Set<String> teamDefinitionGuids = new HashSet<String>(teamDefs != null ? teamDefs.size() : 0);
- for (TeamDefinitionArtifact teamDef : teamDefs) {
- teamDefinitionGuids.add(teamDef.getGuid());
+ if (teamDefs != null) {
+ for (TeamDefinitionArtifact teamDef : teamDefs) {
+ teamDefinitionGuids.add(teamDef.getGuid());
+ }
}
List<AbstractArtifactSearchCriteria> criteria = new ArrayList<AbstractArtifactSearchCriteria>();
if (!teamDefinitionGuids.isEmpty()) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchData.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchData.java
index f326fe46a0..f8615d1c22 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchData.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchData.java
@@ -35,14 +35,6 @@ public class MultipleHridSearchData implements IWorldEditorConsumer {
this.atsEditor = atsEditor;
}
- public MultipleHridSearchData(String name, AtsEditor atsEditor, String enteredIds, List<String> ids, boolean includeArtIds, Branch branch) {
- this(name, atsEditor);
- this.ids = ids;
- this.includeArtIds = includeArtIds;
- this.branch = branch;
- name = enteredIds;
- }
-
public boolean hasValidInput() {
return Strings.isValid(enteredIds);
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
index 2ec5390764..3fbac46d4e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
@@ -116,7 +116,6 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable
@Override
public void performArtifactDrop(Artifact[] dropArtifacts) {
super.performArtifactDrop(dropArtifacts);
- System.out.println("Dropped " + dropArtifacts);
for (Artifact artifact : dropArtifacts) {
if (!artifact.isOfType(SkynetGuiPlugin.getInstance().getOseeCmService().getPcrArtifactType())) {
AWorkbench.popup("Related artifact must be a Team Workflow");
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java
index c8d1c90c2d..2728b2c57e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageLabelProvider.java
@@ -146,7 +146,7 @@ public class CoverageLabelProvider extends XViewerLabelProvider {
CoverageUnit coverageUnit = null;
if (coverage instanceof CoverageUnit) {
coverageUnit = (CoverageUnit) coverage;
- } else {
+ } else if (coverage instanceof MergeItem) {
coverageUnit = (CoverageUnit) ((MergeItem) coverage).getImportItem();
}
if (xCol.equals(CoverageXViewerFactory.Parent_Coverage_Unit)) {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java
index c9ae6b9731..55361be5bc 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageEventManager.java
@@ -55,27 +55,21 @@ import org.eclipse.ui.PlatformUI;
*/
public class CoverageEventManager implements IArtifactEventListener, OseeMessagingStatusCallback {
- private static CoverageEventManager instance;
+ private static CoverageEventManager instance = new CoverageEventManager();
private final List<CoverageEditor> editors = new ArrayList<CoverageEditor>();
private ArtifactTypeEventFilter artifactTypeEventFilter;
private ConnectionNode connectionNode;
private OseeMessagingTracker oseeMessagingTracker;
public static CoverageEventManager getInstance() {
- if (instance == null) {
- instance = new CoverageEventManager();
- }
return instance;
}
public static void dispose() {
- if (instance != null) {
- instance.stopListeneingForFrameworkEvents();
- instance.stopListeningForRemoteCoverageEvents();
- instance.editors.clear();
- instance.oseeMessagingTracker.close();
- instance = null;
- }
+ instance.stopListeneingForFrameworkEvents();
+ instance.stopListeningForRemoteCoverageEvents();
+ instance.editors.clear();
+ instance.oseeMessagingTracker.close();
}
private void stopListeneingForFrameworkEvents() {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java
index 792524198a..c17485e2c0 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItem.java
@@ -190,4 +190,14 @@ public class MergeItem extends MergeItemBase {
return "";
}
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java
index f9848e6060..03f3a0dafe 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/merge/MergeItemGroup.java
@@ -157,4 +157,15 @@ public class MergeItemGroup extends MergeItemBase {
public String getWorkProductTaskStr() {
return "";
}
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java
index 589502ad15..381e5064a6 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageImport.java
@@ -127,4 +127,15 @@ public class CoverageImport extends CoveragePackageBase {
public String getWorkProductTaskStr() {
return "";
}
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
index 6ca1ad389a..2ad36aa894 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
@@ -346,4 +346,14 @@ public class CoverageItem extends NamedIdentity implements ICoverage, IWorkProdu
this.workProductTask = workProductTask;
}
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
index ed6a87cda4..e5ce200625 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
@@ -92,4 +92,14 @@ public class CoveragePackage extends CoveragePackageBase {
return workProductTaskProvider;
}
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
index 4fecfbadce..44f20926a3 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
@@ -388,4 +388,14 @@ public class CoverageUnit extends NamedIdentity implements IWorkProductRelatable
this.workProductTask = workProductTask;
}
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/DoesNotWorkItemCoverage.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/DoesNotWorkItemCoverage.java
index 3dceb14929..962faef9bd 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/DoesNotWorkItemCoverage.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/DoesNotWorkItemCoverage.java
@@ -10,43 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.coverage.navigate;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.coverage.internal.Activator;
-import org.eclipse.osee.coverage.model.CoverageItem;
-import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
-import org.eclipse.osee.coverage.model.SimpleTestUnitProvider;
-import org.eclipse.osee.coverage.store.CoverageArtifactTypes;
-import org.eclipse.osee.coverage.store.CoverageAttributeTypes;
-import org.eclipse.osee.coverage.store.DbTestUnitProvider;
-import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
-import org.eclipse.osee.framework.jdk.core.util.Collections;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.attribute.StringAttribute;
-import org.eclipse.osee.framework.skynet.core.attribute.providers.DefaultAttributeDataProvider;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
-import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.swt.Displays;
/**
@@ -64,177 +32,7 @@ public class DoesNotWorkItemCoverage extends XNavigateItemAction {
return;
}
- // Artifact artifact = ArtifactQuery.getArtifactFromId("AFLY_zvqoHPNSwfetyQA", BranchManager.getBranch(3308));
- // System.out.println("print got it " + artifact);
- try {
- zipVcastFiles();
- // fixCoverageItemNames();
- // fixCoverageInformation();
- // importTestUnitNamesToDbTables();
- } catch (Exception ex) {
- OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
- }
-
AWorkbench.popup("Completed", "Complete");
}
- private void zipVcastFiles() throws IOException {
- String base = "I:\\links\\lba_mp\\us\\code\\v01_\\msm.ss\\user\\jmckinne\\msm_FTB4\\msm.ftb4_2.wrk\\";
- String vcastBase = base + "vcast\\";
- String resultsBase = base + "vcast\\results\\";
- List<File> files = new ArrayList<File>();
- files.add(new File(base + "vcast.vcp"));
- files.add(new File(base + "CCAST_.CFG"));
- files.add(new File(vcastBase + "build_info.xml"));
- files.add(new File(resultsBase + "lba.test.script.qual.msm.asm.MSM_ASM_ac_bus_tie_indication_MSM_1_01052010.DAT"));
-
- Lib.compressFiles(base, files, "C://UserData//try.zip");
- }
-
- @SuppressWarnings("unused")
- private void importTestUnitNamesToDbTables() throws Exception {
- // BlkII Code Coverage Branch
- Branch branch = BranchManager.getBranchByGuid("QyUb5GYLbDS3AmXKZWgA");
- Set<String> allTestUnitNames = new HashSet<String>();
- int fixCount = 0, binaryMoveCount = 0, totalCoverageUnits = 0, totalCoverageItems = 0;
- XResultData rd = new XResultData();
- SkynetTransaction transaction = new SkynetTransaction(branch, "Coverage Item to name_id");
- for (Artifact artifact : ArtifactQuery.getArtifactListFromType(CoverageArtifactTypes.CoverageUnit, branch)) {
- System.out.println("Processing Item " + artifact);
- totalCoverageUnits++;
- for (Attribute<?> attr : artifact.getAttributes(CoverageAttributeTypes.Item)) {
- totalCoverageItems++;
- String xml = (String) attr.getValue();
- CoverageItem coverageItem =
- CoverageItem.createCoverageItem(null, xml, CoverageOptionManagerDefault.instance(),
- new SimpleTestUnitProvider());
- allTestUnitNames.addAll(coverageItem.getTestUnits());
- if (coverageItem.getTestUnits().size() > 0) {
- fixCount++;
- Collection<String> testUnitNames = coverageItem.getTestUnits();
- coverageItem.setTestUnitProvider(DbTestUnitProvider.instance());
- coverageItem.setTestUnits(testUnitNames);
- String newXml = coverageItem.toXml();
- ((StringAttribute) attr).setValue(newXml);
- rd.log("Num Test Units " + testUnitNames.size() + " Pre-size " + xml.length() + " Post-size " + newXml.length());
- if (newXml.length() > DefaultAttributeDataProvider.MAX_VARCHAR_LENGTH) {
- rd.logError("Still too big " + newXml.length());
- }
- if (xml.length() > DefaultAttributeDataProvider.MAX_VARCHAR_LENGTH && newXml.length() < DefaultAttributeDataProvider.MAX_VARCHAR_LENGTH) {
- binaryMoveCount++;
- }
- artifact.persist(transaction);
- }
- }
- }
- transaction.execute();
- rd.log(Collections.toString("\n", allTestUnitNames));
- rd.log("Num Coverage Units " + totalCoverageUnits + " Num Coverage Items " + totalCoverageItems);
- rd.log("Fixed " + fixCount + " Binary Moved " + binaryMoveCount);
- rd.report("Test Unit Import");
- }
-
- @SuppressWarnings("unused")
- private void fixCoverageItemNames() throws Exception {
- Pattern linePattern = Pattern.compile("^[0-9]+ [0-9]+(.*?)$");
- // BlkII Code Coverage Branch
- Branch branch = BranchManager.getBranchByGuid("QyUb5GYLbDS3AmXKZWgA");
- Artifact msmCoveragePackageArt = ArtifactQuery.getArtifactFromId("AA6+z8QPbToPZSn9tAgA", branch);
- OseeCoveragePackageStore packageStore = new OseeCoveragePackageStore(msmCoveragePackageArt);
- // Don Coverage Branch
- PropertyStore store = new PropertyStore();
- // Branch branch = BranchManager.getBranchByGuid("ANPixlmF+BNVrPJIUvQA");
- SkynetTransaction transaction = new SkynetTransaction(branch, "Fix coverage item names");
-
- boolean persist = true;
- for (Artifact artifact : ArtifactQuery.getArtifactListFromType(CoverageArtifactTypes.CoverageUnit, branch)) {
- System.out.println("Processing Item " + artifact);
- for (Attribute<?> attr : artifact.getAttributes(CoverageAttributeTypes.Item)) {
- String attrStr = (String) attr.getValue();
- store.load(attrStr);
- CoverageItem item =
- CoverageItem.createCoverageItem(null, attrStr, packageStore.getCoverageOptionManager(),
- new SimpleTestUnitProvider());
- String name = store.get("name");
- if (!Strings.isValid(name)) {
- System.err.println(String.format("Invalid name [%s] for item [%s]", name, item));
- continue;
- }
- System.out.println(String.format("Old [%s]", name));
-
- Matcher m = linePattern.matcher(name);
- if (m.find()) {
- item.setName(m.group(1));
- System.out.println(String.format("New [%s]", item.getName()));
- attr.setFromString(item.toXml());
- } else {
- System.err.println(String.format("Error: name [%s] doesn't match", name));
- }
- }
- if (persist) {
- artifact.persist(transaction);
- }
- }
-
- transaction.execute();
- }
-
- @SuppressWarnings("unused")
- private void fixCoverageInformation() throws Exception {
- // BlkII Code Coverage Branch
- Branch branch = BranchManager.getBranchByGuid("QyUb5GYLbDS3AmXKZWgA");
- // Don Coverage Branch
- PropertyStore store = new PropertyStore();
- // Branch branch = BranchManager.getBranchByGuid("ANPixlmF+BNVrPJIUvQA");
- SkynetTransaction transaction = new SkynetTransaction(branch, "Add missing Decision Reviews");
-
- boolean persist = true;
- Set<Artifact> coverageUnitsFixed = new HashSet<Artifact>();
- for (Artifact artifact : ArtifactQuery.getArtifactListFromType(CoverageArtifactTypes.CoverageUnit, branch)) {
- System.out.println("Processing Item " + artifact);
- for (Attribute<?> attr : artifact.getAttributes(CoverageAttributeTypes.Item)) {
- String str = (String) attr.getValue();
- store.load(str);
- CoverageItem item =
- CoverageItem.createCoverageItem(null, str, CoverageOptionManagerDefault.instance(),
- new SimpleTestUnitProvider());
-
- String executeNum = store.get("executeNum");
- if (!Strings.isValid(executeNum)) {
- System.err.println("Invalid executeNum from artifact " + artifact + " item " + str);
- continue;
- }
- item.setOrderNumber(executeNum);
- System.out.println(String.format("Setting order to %s", executeNum));
-
- String text = store.get("text");
- if (!Strings.isValid(text)) {
- System.err.println("Invalid text from artifact " + artifact + " item " + str);
- continue;
- }
- item.setName(text);
- System.out.println(String.format("Setting text to %s", text));
-
- attr.setFromString(item.toXml());
-
- // Update this artifact's method Num, if not already set
- if (!coverageUnitsFixed.contains(artifact)) {
- // Update this artifact's method Num, if not already set
- String methodNum = store.get("methodNum");
- if (!Strings.isValid(methodNum)) {
- System.err.println("Invalid method from artifact " + artifact + " item " + str);
- continue;
- }
- artifact.addAttribute(CoverageAttributeTypes.Order, methodNum);
- coverageUnitsFixed.add(artifact);
- System.out.println(String.format("Adding method num [%s] to unit [%s]", methodNum, artifact));
- }
- }
- if (persist) {
- artifact.persist(transaction);
- }
- }
-
- transaction.execute();
- }
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java
index ebf7296f5c..a54a818446 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageRelationTypes.java
@@ -38,4 +38,15 @@ public class CoverageRelationTypes extends NamedIdentity implements IRelationEnu
public RelationSide getSide() {
return relationSide;
}
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbTestUnitProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbTestUnitProvider.java
index 495d6fd9dd..9ea8c5c938 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbTestUnitProvider.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbTestUnitProvider.java
@@ -39,7 +39,7 @@ public class DbTestUnitProvider implements ITestUnitProvider {
new HashCollection<CoverageItem, Integer>(1000);
private DbTestUnitProvider() {
- instance = this;
+ // private constructor
}
public static DbTestUnitProvider instance() {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/TestUnitStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/TestUnitStore.java
index f756b28124..26f3f70fb1 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/TestUnitStore.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/TestUnitStore.java
@@ -30,7 +30,7 @@ public class TestUnitStore {
final Map<Integer, String> idToName = new HashMap<Integer, String>(1000);
private TestUnitStore() {
- instance = this;
+ // private constructor
}
private int addTestUnitNameToDb(String name) throws OseeCoreException {

Back to the top