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.

Bug 258362 - NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.breakpoints.BreakpointManager.hasBreakpointJobAt
Summary: NullPointerException at org.netbeans.modules.cnd.debugger.common2.debugger.br...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: henk89
URL:
Keywords:
: 258693 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-14 18:02 UTC by Leperous
Modified: 2016-06-07 14:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 223006


Attachments
stacktrace (3.13 KB, text/plain)
2016-03-14 18:02 UTC, Leperous
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leperous 2016-03-14 18:02:42 UTC
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)
Comment 1 Leperous 2016-03-14 18:02:44 UTC
Created attachment 158855 [details]
stacktrace
Comment 2 Vladimir Kvashin 2016-03-15 15:43:46 UTC
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?
Comment 3 henk89 2016-04-01 14:40:11 UTC
Fixed in:
http://hg.netbeans.org/cnd-main/rev/6d0f9f4870de
Comment 4 Quality Engineering 2016-04-05 01:44:49 UTC
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
Comment 5 Vladimir Kvashin 2016-04-15 16:59:57 UTC
verified in builds on enum server
Comment 6 henk89 2016-06-07 14:03:08 UTC
*** Bug 258693 has been marked as a duplicate of this bug. ***