Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2014-02-19 08:25:59 -0500
committerAnton Leherbauer2014-02-19 09:00:01 -0500
commit48e18a1150a052f940391869a22203114da73c5c (patch)
tree38263f1b161add04d8bad66a999a2383b7af3871
parent59a4ec704506ff244dc5638e6817192fb78cc4e9 (diff)
downloadorg.eclipse.tcf-48e18a1150a052f940391869a22203114da73c5c.tar.gz
org.eclipse.tcf-48e18a1150a052f940391869a22203114da73c5c.tar.xz
org.eclipse.tcf-48e18a1150a052f940391869a22203114da73c5c.zip
TCF Debugger: Bug 428202 - Don't throw NPE pressing edit button
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java4
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java26
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties2
3 files changed, 23 insertions, 9 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java
index e0e9b1fbb..fddfa8cfa 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java
@@ -23,6 +23,10 @@ public class Messages extends NLS {
public static String TCFThreadFilterQueryButtonEdit;
public static String TCFThreadFilterQueryAdvancedLabel;
public static String TCFThreadFilterQueryTreeViewLabel;
+ public static String TCFThreadFilterEditor_cannotEditExpr;
+
+ public static String TCFThreadFilterEditor_cannotRetrieveAttrs;
+
public static String TCFThreadFilterEditor_cannotValidate;
public static String TCFThreadFilterEditor_defaultScopePrefsLink;
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
index f260a194e..06015f7cc 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
@@ -367,14 +367,14 @@ public class TCFThreadFilterEditor {
private String[] getAvailableAttributes() {
String[] result = null;
TCFLaunch launch = (TCFLaunch)getAttributeLaunch();
- if (launch == null) {
+ if (launch == null || launch.isTerminated()) {
return result;
}
final IChannel channel = launch.getChannel();
if (channel == null) {
return result;
}
- result = new TCFTask<String[]>() {
+ result = new TCFTask<String[]>(channel) {
public void run() {
IContextQuery service = channel.getRemoteService(IContextQuery.class);
service.getAttrNames(new IContextQuery.DoneGetAttrNames() {
@@ -501,14 +501,22 @@ public class TCFThreadFilterEditor {
public void handleEvent(Event event) {
String[] attrsList = getAvailableAttributes();
- String result = null;
- TCFContextQueryExpressionDialog dlg = new TCFContextQueryExpressionDialog(parentShell, attrsList, scopeExprCombo.getText());
-
- if (dlg.open() == Window.OK) {
- result = dlg.getExpression();
+ if (attrsList == null) {
+ fPage.setErrorMessage(NLS.bind(Messages.TCFThreadFilterEditor_cannotRetrieveAttrs, Messages.TCFThreadFilterEditorNoOpenChannel));
+ }
+ else if (attrsList.length == 0) {
+ fPage.setErrorMessage(Messages.TCFThreadFilterEditor_cannotEditExpr);
}
- if (result != null) {
- scopeExprCombo.setText(result);
+ else {
+ String result = null;
+ TCFContextQueryExpressionDialog dlg = new TCFContextQueryExpressionDialog(parentShell, attrsList, scopeExprCombo.getText());
+
+ if (dlg.open() == Window.OK) {
+ result = dlg.getExpression();
+ }
+ if (result != null) {
+ scopeExprCombo.setText(result);
+ }
}
}
}
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties
index e1c908a8c..db2f678c5 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties
@@ -16,6 +16,8 @@ TCFThreadFilterQueryButtonAdvanced=Default Settings
TCFThreadFilterQueryButtonEdit=Edit
TCFThreadFilterQueryAdvancedLabel=Breakpoint Scoping Expression:
TCFThreadFilterQueryTreeViewLabel=Restrict to Selected Contexts:
+TCFThreadFilterEditor_cannotEditExpr=Cannot edit expression: No query attributes available
+TCFThreadFilterEditor_cannotRetrieveAttrs=Cannot retrieve query attributes: {0}
TCFThreadFilterEditor_cannotValidate=Cannot validate scope expression: {0}
TCFThreadFilterEditor_defaultScopePrefsLink=<a>Breakpoint Default Scope Preferences</a>
TCFThreadFilterEditorUnbalancedParameters=Parameters must be name value pairs

Back to the top