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 251556 - NullPointerException at org.netbeans.spi.debugger.ui.EditorContextDispatcher.getMIMETypesOnLine
Summary: NullPointerException at org.netbeans.spi.debugger.ui.EditorContextDispatcher....
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 12:19 UTC by Jiri Kovalsky
Modified: 2015-04-08 13:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 216505


Attachments
stacktrace (2.39 KB, text/plain)
2015-04-01 12:19 UTC, Jiri Kovalsky
Details
Project reproducing the described NPE upon starting the debugger. (23.21 KB, application/x-java-archive)
2015-04-01 13:13 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2015-04-01 12:19:27 UTC
Build: NetBeans IDE Dev (Build 201504010001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.40-b25, Java(TM) SE Runtime Environment, 1.8.0_40-b25
OS: Linux

User Comments:
jkovalsky: I set breakpoint at line 210 with Calendar calendar = Calendar.getInstance(); in org.test.DigitalWatch.updateCurrentTime() method and invoked Ctrl+F5 to start debugging the project. This exception was thrown but application was run without problems.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.spi.debugger.ui.EditorContextDispatcher.getMIMETypesOnLine(EditorContextDispatcher.java:307)
   at org.netbeans.spi.debugger.ui.EditorContextDispatcher.getMIMETypesOnCurrentLine(EditorContextDispatcher.java:302)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:0)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:497)
Comment 1 Jiri Kovalsky 2015-04-01 12:19:29 UTC
Created attachment 152970 [details]
stacktrace
Comment 2 Jiri Kovalsky 2015-04-01 13:13:26 UTC
Created attachment 152974 [details]
Project reproducing the described NPE upon starting the debugger.

100% reproducible:

1. Open MemoryLeak project in NetBeans.
2. Open org.test.DigitalWatch.java in Editor.
3. Toggle line 210 breakpoint with the following code:

Calendar calendar = Calendar.getInstance();

4. Press Ctrl+F5 to start debugging session.

Expected: Program is started and breakpoint is hit.
Actual: Program is started, exception is thrown and breakpoint is hit.
Comment 3 Martin Entlicher 2015-04-01 16:24:24 UTC
Thanks for the test project.
Reproduced and fixed by changeset:   285684:13943f59a2c7
http://hg.netbeans.org/web-main/rev/13943f59a2c7
Comment 4 Quality Engineering 2015-04-03 03:06:21 UTC
Integrated into 'main-silver', will be available in build *201504030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/13943f59a2c7
User: mentlicher@netbeans.org
Log: #251556: Try to get the EditorCookie from the DataObject if the Line does not provide it. Handle missing EditorCookie.
Comment 5 Jiri Kovalsky 2015-04-08 13:33:08 UTC
Product Version: NetBeans IDE Dev (Build 201504070001)
Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb)

Verified. Thanks for the quick fix.