diff options
author | Pawel Piech | 2013-03-11 18:08:46 +0000 |
---|---|---|
committer | Pawel Piech | 2013-03-11 18:10:34 +0000 |
commit | e859d55406f5ae33cf329228ff97252b8c850d10 (patch) | |
tree | 12621a50419fccef1edc82fea86c5bbae362ee5b | |
parent | 3b5b7d15bdcc50c1784a415b13177f0b28dfb5e7 (diff) | |
download | eclipse.platform.debug-e859d55406f5ae33cf329228ff97252b8c850d10.tar.gz eclipse.platform.debug-e859d55406f5ae33cf329228ff97252b8c850d10.tar.xz eclipse.platform.debug-e859d55406f5ae33cf329228ff97252b8c850d10.zip |
Bug 402946 - WatchExpressionTests.testDeferredExpression fails
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java | 61 |
1 files changed, 33 insertions, 28 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 40f047092..ce7163aa0 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 @@ -393,14 +393,16 @@ public class ExpressionView extends VariablesView { } private String[] loadWorkingSetNames(IMemento memento) { - IMemento[] workingsets = memento.getChildren(PREF_ELEMENT_WORKINGSET); - if (workingsets != null) { - List list = new ArrayList(); - for (int j=0; j<workingsets.length; j++) { - list.add(workingsets[j].getID()); - } - return (String[])list.toArray(new String[list.size()]); - } + if (memento != null) { + IMemento[] workingsets = memento.getChildren(PREF_ELEMENT_WORKINGSET); + if (workingsets != null) { + List list = new ArrayList(); + for (int j=0; j<workingsets.length; j++) { + list.add(workingsets[j].getID()); + } + return (String[])list.toArray(new String[list.size()]); + } + } return new String[0]; } @@ -417,27 +419,30 @@ public class ExpressionView extends VariablesView { } private void initWorkingSetMementos() { - IMemento[] workingsetMementos = getMemento().getChildren(PREF_ELEMENT_WORKINGSET_MEMENTOS); - if (workingsetMementos != null) { - for (int j=0; j<workingsetMementos.length; j++) { - String[] workingSetNames = loadWorkingSetNames(workingsetMementos[j]); - String string = workingsetMementos[j].getID(); - if(string.length() > 0 && workingSetNames != null) { - ByteArrayInputStream bin = new ByteArrayInputStream(string.getBytes()); - InputStreamReader reader = new InputStreamReader(bin); - try { - XMLMemento workingSetsKey = XMLMemento.createReadRoot(reader); - fWorkingSetMementos.put( new XMLMementoKey(workingSetsKey), workingSetNames ); - } catch (WorkbenchException e) { - } finally { - try { - reader.close(); - bin.close(); - } catch (IOException e){} - } - } + IMemento memento = getMemento(); + if (memento != null) { + IMemento[] workingsetMementos = memento.getChildren(PREF_ELEMENT_WORKINGSET_MEMENTOS); + if (workingsetMementos != null) { + for (int j=0; j<workingsetMementos.length; j++) { + String[] workingSetNames = loadWorkingSetNames(workingsetMementos[j]); + String string = workingsetMementos[j].getID(); + if(string.length() > 0 && workingSetNames != null) { + ByteArrayInputStream bin = new ByteArrayInputStream(string.getBytes()); + InputStreamReader reader = new InputStreamReader(bin); + try { + XMLMemento workingSetsKey = XMLMemento.createReadRoot(reader); + fWorkingSetMementos.put( new XMLMementoKey(workingSetsKey), workingSetNames ); + } catch (WorkbenchException e) { + } finally { + try { + reader.close(); + bin.close(); + } catch (IOException e){} + } + } + } } - } + } } public void saveViewerState(IMemento memento) { |