Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2011-08-08 18:00:53 +0000
committerMichael Rennie2011-08-08 18:00:53 +0000
commit809b468b3a0e74116d5c07e656fdbebfe03100cd (patch)
tree3ea0bafada2e13dd4aa49700209064ebaf0a949a
parentab30cb7cccae259b35a0428c360875aa4cc23b1a (diff)
downloadeclipse.platform.debug-809b468b3a0e74116d5c07e656fdbebfe03100cd.tar.gz
eclipse.platform.debug-809b468b3a0e74116d5c07e656fdbebfe03100cd.tar.xz
eclipse.platform.debug-809b468b3a0e74116d5c07e656fdbebfe03100cd.zip
Bug 352784 - Null pointer exception when press F2 on an expression in expression view without columns
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
index 1b09da346..fffbdd2bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
@@ -56,26 +56,25 @@ public class EditWatchExpressinInPlaceAction extends Action implements ISelectio
return;
}
-
// Always edit multi-line expressions in dialog. Otherwise try to find the expression
// column and activate cell editor there.
int expressionColumn = getExpressionColumnIndex();
- if (expressionColumn != -1 || isWatchExpressionWithNewLine()) {
+ IWatchExpression[] expressions = fEditActionDelegate.getSelectedExpressions();
+ if (expressionColumn != -1 && !isWatchExpressionWithNewLine(expressions)) {
fViewer.editElement(selelection.getFirstElement(), expressionColumn);
- } else {
+ } else if (expressions.length == 1) {
fEditActionDelegate.run(this);
}
}
- private boolean isWatchExpressionWithNewLine() {
- IWatchExpression[] expressions = fEditActionDelegate.getSelectedExpressions();
+ private boolean isWatchExpressionWithNewLine(IWatchExpression[] expressions) {
return expressions.length == 1 &&
- expressions[0].getExpressionText().indexOf('\n') == -1;
+ expressions[0].getExpressionText().indexOf('\n') != -1;
}
private int getExpressionColumnIndex() {
Object[] columnProperties = fViewer.getColumnProperties();
- for (int i = 0; i < columnProperties.length; i++) {
+ for (int i = 0; columnProperties != null && i < columnProperties.length; i++) {
if (VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnProperties[i])) {
return i;
}

Back to the top