Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2013-03-05 17:23:32 +0000
committerPawel Piech2013-03-05 17:23:32 +0000
commitea9faad83adbc4171da2e0350852d56491ac5f55 (patch)
treed943fc7760e535186652e2d0f95c9253c06eae02
parentfce982b44876d35cf39b8e2a2515e682118d06fe (diff)
downloadeclipse.platform.debug-ea9faad83adbc4171da2e0350852d56491ac5f55.tar.gz
eclipse.platform.debug-ea9faad83adbc4171da2e0350852d56491ac5f55.tar.xz
eclipse.platform.debug-ea9faad83adbc4171da2e0350852d56491ac5f55.zip
Bug 372181 - Working set support for Expressions View
- Added a limit to the number of saved working sets entries.
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
index 4185c798e..f5896f6c3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
@@ -96,6 +96,9 @@ public class ExpressionView extends VariablesView {
// The preference name for saving fWorkingSetMementos.
private static final String PREF_ELEMENT_WORKINGSET_MEMENTOS = DebugUIPlugin.getUniqueIdentifier() + ".workingSetMementos"; //$NON-NLS-1$
+ // Limit on the number of entries in the working sets / selection map.
+ private static final int MAX_WORKING_SETS_MEMENTOS = 100;
+
private static final IWorkingSet[] EMPTY_WORKING_SETS = new IWorkingSet[0];
private PasteWatchExpressionsAction fPasteAction;
@@ -105,7 +108,13 @@ public class ExpressionView extends VariablesView {
private boolean fAutoSelectnWorkingSets = true;
- private Map fWorkingSetMementos = new LinkedHashMap();
+ private Map fWorkingSetMementos = new LinkedHashMap(16, (float)0.75, true) {
+ private static final long serialVersionUID = 1L;
+
+ protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
+ return size() > MAX_WORKING_SETS_MEMENTOS;
+ }
+ };
private Set fPendingCompareRequests;

Back to the top