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 bug was originally marked as duplicate of bug 251862, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 8.1 (Build 201510222201) VM: OpenJDK 64-Bit Server VM, 24.65-b04, OpenJDK Runtime Environment, 1.7.0_71-mockbuild_2014_10_03_09_05-b00 OS: Linux User Comments: Leperous: Trying to enable/disable breakpoings Stacktrace: java.lang.NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.breakpoints.BreakpointManager.hasBreakpointJobAt(BreakpointManager.java:354) at org.netbeans.modules.cnd.debugger.common2.debugger.actions.ToggleBreakpointActionProvider.doAction(ToggleBreakpointActionProvider.java:176) at org.netbeans.modules.cnd.debugger.common2.debugger.actions.NativeActionsProvider.postAction(NativeActionsProvider.java:78) at org.netbeans.modules.cnd.debugger.common2.debugger.actions.ToggleBreakpointActionProvider.postAction(ToggleBreakpointActionProvider.java:87) at org.netbeans.api.debugger.ActionsManager.postAction(ActionsManager.java:257) at org.netbeans.modules.debugger.ui.actions.DebuggerAction.actionPerformed(DebuggerAction.java:104)
Created attachment 158855 [details] stacktrace
I think that a null pointer check is definitely needed here. We iterate the entire breakpointJobs.map, and for each BreakpointJob call template() and then call matchesLine() on the breakpoint that is returned by template() method. The template() returns a field that definitely *can* be null - there are at least 3 calls to BreakpointJob constructor that pass null as template. And this bug and also bug 251862 that is closed as non-reproducible prove that. So I'm sure this bug should be fixed via a null pointer check. If we think that it should never be null at this point, then let's add a soft assertion after null check (or even better, use reportOnce) - this will still let us know that the code behaves not the way we think, but will not affect. BTW, together with the bug 251862 that in fact the same, there are 4 duplicate exception reports. Isn't a 81 patch candidate?
Fixed in: http://hg.netbeans.org/cnd-main/rev/6d0f9f4870de
Integrated into 'main-silver', will be available in build *201604050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6d0f9f4870de User: Nikolay Koldunov <henk89@netbeans.org> Log: Fixed #258362 - NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.breakpoints.BreakpointManager.hasBreakpointJobAt
verified in builds on enum server
*** Bug 258693 has been marked as a duplicate of this bug. ***