Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2005-06-02 12:01:06 -0400
committerMichael Valenta2005-06-02 12:01:06 -0400
commita3e6ef6b2ce1d6ea37f5ea9b875a6179b71bb196 (patch)
treef096caf9d1dfabd28cf0008800081f00c6828214
parent8d9977aa1524e3c755b6e0ad4922eab62e697993 (diff)
downloadeclipse.platform.team-a3e6ef6b2ce1d6ea37f5ea9b875a6179b71bb196.tar.gz
eclipse.platform.team-a3e6ef6b2ce1d6ea37f5ea9b875a6179b71bb196.tar.xz
eclipse.platform.team-a3e6ef6b2ce1d6ea37f5ea9b875a6179b71bb196.zip
Bug 98070 CVSActionSelectionProperties keeps references to jdt debug model elements
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java
index 5d3432e2e..0679acfca 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSActionSelectionProperties.java
@@ -27,7 +27,7 @@ public class CVSActionSelectionProperties {
// Use a weak hash map so that the properties ae collected when the selection is no longer referenced
private static Map selectionProperties = new WeakHashMap();
- private IStructuredSelection selection;
+ private Object[] selection;
private Map properties = new HashMap();
private static final String SELECTED_RESOURCES = "selectedResources"; //$NON-NLS-1$
@@ -39,17 +39,14 @@ public class CVSActionSelectionProperties {
CVSActionSelectionProperties props = (CVSActionSelectionProperties)selectionProperties.get(selection);
if (props == null) {
props = new CVSActionSelectionProperties(selection);
- selectionProperties.put(props.getSelection(), props);
+ selectionProperties.put(selection, props);
}
return props;
}
public CVSActionSelectionProperties(IStructuredSelection selection) {
- this.selection = selection;
- }
-
- public IStructuredSelection getSelection() {
- return selection;
+ // Copy the selection so that the WeakHashMap will not think the seleciton used for the key is still in use
+ this.selection = selection.toArray();
}
public void put(String key, Object value) {
@@ -63,7 +60,7 @@ public class CVSActionSelectionProperties {
public IResource[] getAllSelectedResources() {
IResource[] resources = (IResource[])get(SELECTED_RESOURCES);
if (resources == null) {
- resources = getResources(selection.toArray());
+ resources = getResources(selection);
put(SELECTED_RESOURCES, resources);
}
return resources;

Back to the top