diff options
author | Darin Wright | 2009-02-04 18:41:30 +0000 |
---|---|---|
committer | Darin Wright | 2009-02-04 18:41:30 +0000 |
commit | 71084267a550add331ed1f9c3f601c6d4fae64a7 (patch) | |
tree | e8060ebd8b1adf76384ff84ab1fadfd3bf368203 /org.eclipse.debug.core | |
parent | 3c9d78b0da309b70827093359f3e00c69ba44264 (diff) | |
download | eclipse.platform.debug-71084267a550add331ed1f9c3f601c6d4fae64a7.tar.gz eclipse.platform.debug-71084267a550add331ed1f9c3f601c6d4fae64a7.tar.xz eclipse.platform.debug-71084267a550add331ed1f9c3f601c6d4fae64a7.zip |
Bug 262814 - Class Cast exception when Expression view has expressions defined by non-Java debug session
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java index e2b0316e6..1ed070755 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java @@ -106,7 +106,9 @@ public class WatchExpression implements IWatchExpression { * @see org.eclipse.debug.core.model.IWatchExpression#setExpressionContext(org.eclipse.debug.core.model.IDebugElement) */ public void setExpressionContext(IDebugElement context) { - fCurrentContext= context; + synchronized (this) { + fCurrentContext= context; + } if (context == null) { setResult(null); return; @@ -125,7 +127,9 @@ public class WatchExpression implements IWatchExpression { * @param result result of a watch expression */ public void setResult(IWatchExpressionResult result) { - fResult= result; + synchronized (this) { + fResult= result; + } fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT)); } @@ -158,7 +162,7 @@ public class WatchExpression implements IWatchExpression { /** * @see org.eclipse.debug.core.model.IExpression#getValue() */ - public IValue getValue() { + public synchronized IValue getValue() { if (fResult == null) { return null; } @@ -186,8 +190,14 @@ public class WatchExpression implements IWatchExpression { * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier() */ public String getModelIdentifier() { - if (fCurrentContext != null) { - return fCurrentContext.getModelIdentifier(); + synchronized (this) { + IValue value = getValue(); + if (value != null) { + return value.getModelIdentifier(); + } + if (fCurrentContext != null) { + return fCurrentContext.getModelIdentifier(); + } } return DebugPlugin.getUniqueIdentifier(); } |