Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2015-02-27 10:46:58 -0500
committerDani Megert2015-02-27 10:46:58 -0500
commit40d0ba0794763196261101dffb294e948cfa0ea8 (patch)
treee4fe31759e843021a9f8fcfe0fb4aab4c5e22658
parentf4634884a11f2278f6bf5990d3c4a251a23acd60 (diff)
downloadeclipse.platform.team-R3_8_maintenance.tar.gz
eclipse.platform.team-R3_8_maintenance.tar.xz
eclipse.platform.team-R3_8_maintenance.zip
Backported fix for bug 404873: [History View] SporadicR3_8_maintenance
StackOverflowError
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java56
1 files changed, 34 insertions, 22 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
index 9ed44495b..f7e2f7dba 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
* 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
@@ -340,33 +340,45 @@ public class GenericHistoryView extends PageBookView implements IHistoryView, IP
private ISelectionListener selectionListener = new ISelectionListener() {
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ private boolean isUpdatingSelection= false;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structSelection = (IStructuredSelection) selection;
- //Always take the first element - this is not intended to work with multiple selection
- //Also, hang on to this selection for future use in case the history view is not visible
- lastSelectedElement = structSelection.getFirstElement();
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if (isUpdatingSelection)
+ return;
- if (!isLinkingEnabled() || !checkIfPageIsVisible()) {
+ try {
+ isUpdatingSelection = true;
+ if (GenericHistoryView.this == part)
return;
- }
- if (lastSelectedElement != null){
- Object resource;
- if (lastSelectedElement instanceof SyncInfoModelElement) {
- SyncInfoModelElement syncInfoModelElement = (SyncInfoModelElement) lastSelectedElement;
- resource = syncInfoModelElement.getSyncInfo().getLocal();
- } else {
- resource = Utils.getAdapter(lastSelectedElement, IResource.class);
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structSelection= (IStructuredSelection)selection;
+ //Always take the first element - this is not intended to work with multiple selection
+ //Also, hang on to this selection for future use in case the history view is not visible
+ lastSelectedElement= structSelection.getFirstElement();
+
+ if (!isLinkingEnabled() || !checkIfPageIsVisible()) {
+ return;
+ }
+
+ if (lastSelectedElement != null) {
+ Object resource;
+ if (lastSelectedElement instanceof SyncInfoModelElement) {
+ SyncInfoModelElement syncInfoModelElement= (SyncInfoModelElement)lastSelectedElement;
+ resource= syncInfoModelElement.getSyncInfo().getLocal();
+ } else {
+ resource= Utils.getAdapter(lastSelectedElement, IResource.class);
+ }
+ if (resource != null)
+ showHistory(resource);
+ else
+ showHistory(lastSelectedElement);
+ //reset lastSelectedElement
+ lastSelectedElement= null;
}
- if (resource != null)
- showHistory(resource);
- else
- showHistory(lastSelectedElement);
- //reset lastSelectedElement
- lastSelectedElement = null;
}
+ } finally {
+ isUpdatingSelection= false;
}
}

Back to the top