This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This issue was reported manually by alexvsimon. It already has 1 duplicates Build: NetBeans IDE 8.0.1 (Build 201408251540) VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b70, Java(TM) SE Runtime Environment, 1.8.0-b132 OS: Windows 7 User Comments: GUEST: Some trouble during evaluate expressions Please check Stacktrace: java.lang.NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.EvaluationWindow.exprEval(EvaluationWindow.java:205) at org.netbeans.modules.cnd.debugger.common2.debugger.actions.EvaluateAction.performAction(EvaluateAction.java:84) at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:130) at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:95) at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116) at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
Created attachment 150331 [details] stacktrace
Evaluation: looks like regression after fixing bz#245760 the code below doesn't look like correct one, as Expression Evaluation Window is not initialized yet 3.1 --- a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/EvaluateAction.java 3.2 +++ b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/EvaluateAction.java 3.3 @@ -52,7 +52,7 @@ 3.4 import org.netbeans.modules.cnd.debugger.common2.debugger.State; 3.5 import org.netbeans.modules.cnd.debugger.common2.debugger.StateListener; 3.6 import org.netbeans.modules.cnd.debugger.common2.debugger.EditorBridge; 3.7 -import org.netbeans.modules.cnd.debugger.common2.debugger.assembly.FormatOption; 3.8 +import org.netbeans.modules.cnd.debugger.common2.debugger.EvaluationWindow; 3.9 3.10 /** 3.11 * Action which "stepi" one assembly instruction 3.12 @@ -80,10 +80,8 @@ 3.13 if (debugger != null) { 3.14 // 6574620 3.15 String selectedStr = EditorBridge.getCurrentSelection(); 3.16 - if (selectedStr == null) 3.17 - debugger.exprEval(FormatOption.EMPTY, ""); // NOI18N 3.18 - else 3.19 - debugger.exprEval(FormatOption.EMPTY, selectedStr); 3.20 + selectedStr = (selectedStr == null ? "" : selectedStr); // NOI18N 3.21 + EvaluationWindow.getDefault().exprEval(selectedStr); 3.22 } 3.23 3.24 }
proposed fix: hg diff diff --git a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/EvaluationWindow.java b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/EvaluationWindow.java --- a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/EvaluationWindow.java +++ b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/EvaluationWindow.java @@ -203,8 +203,9 @@ public void exprEval(String expr) { this.expr = expr; format = (FormatOption)format_jcb.getSelectedItem(); - if (expr != null && !expr.equals("") && format != null) { - debugger.exprEval(format, expr); + if (expr != null && !expr.equals("")) { + //see bz#248470 + debugger.exprEval(format == null ? FormatOption.EMPTY : format, expr); } } diff --git a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/EvaluateAction.java b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/EvaluateAction.java --- a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/EvaluateAction.java +++ b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/EvaluateAction.java @@ -75,13 +75,20 @@ } // interface CallableSystemAction + @Override public void performAction() { NativeDebugger debugger = NativeDebuggerManager.get().currentDebugger(); if (debugger != null) { // 6574620 String selectedStr = EditorBridge.getCurrentSelection(); selectedStr = (selectedStr == null ? "" : selectedStr); // NOI18N - EvaluationWindow.getDefault().exprEval(selectedStr); + //bz#248470 + //we are in EDT thread already, no need to use SqingUtilitites + EvaluationWindow evalWindow = EvaluationWindow.getDefault(); + evalWindow.open(); + evalWindow.requestActive(); + evalWindow.componentShowing(); + evalWindow.evalResult(selectedStr); } }
last line in proposed fix is incorrect, should be: evalWindow.exprEval(selectedStr)
fixed in changeset: 280738:466da6d6b1f8 tag: tip user: Maria Dalmatova <mromashova@netbeans.org> date: Tue Nov 11 12:54:42 2014 +0400 summary: fixed bz#248470 NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.EvaluationWindow.exprEval
regression of bz#245760
Integrated into 'main-silver', will be available in build *201411120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/466da6d6b1f8 User: Maria Dalmatova <mromashova@netbeans.org> Log: fixed bz#248470 NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.EvaluationWindow.exprEval
Integrated into 'main-silver', will be available in build *201411130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/466da6d6b1f8 User: Maria Dalmatova <mromashova@netbeans.org> Log: fixed bz#248470 NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.EvaluationWindow.exprEval
Integrated into 'main-silver', will be available in build *201411140002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/466da6d6b1f8 User: Maria Dalmatova <mromashova@netbeans.org> Log: fixed bz#248470 NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.EvaluationWindow.exprEval