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 62348 - Toggle breakpoint in JSP throws NPE
Summary: Toggle breakpoint in JSP throws NPE
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Ant (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-16 09:33 UTC by zikmund
Modified: 2005-09-05 09:50 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
java.lang.NullPointerException at org.netbeans.modules.ant.debugger.breakpoints.AntBreakpointActionProvider.doAction(AntBreakpointActionProvider.java:56) (1.76 KB, text/plain)
2005-08-16 09:34 UTC, zikmund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zikmund 2005-08-16 09:33:07 UTC
Build 20050816-0450

1) Create new Web Application
2) Open JSP
3) Toggle breakpoint (Ctrl-F8 or click in left editor margin)
4) NPE
Comment 1 zikmund 2005-08-16 09:34:35 UTC
Created attachment 23882 [details]
java.lang.NullPointerException at org.netbeans.modules.ant.debugger.breakpoints.AntBreakpointActionProvider.doAction(AntBreakpointActionProvider.java:56)
Comment 2 Libor Kotouc 2005-08-16 09:51:48 UTC
NPE in AntBreakpointActionProvider, thus reassigning to ant debugger
Comment 3 Libor Kotouc 2005-08-16 09:56:42 UTC
Ant debugger team, could you please look at it? It seems like line.getLookup()
in AntBreakpointActionProvider.java:56 returns null...?
Comment 4 Libor Kotouc 2005-08-16 11:28:25 UTC
The problem with AntBreakpointActionProvider is that getCurrentLine() can return
null (and it does) and doAction() does not handle this case.

But there is another problem. When JSP is opened then toggle breakpoint action
should be enabled on JspToggleBreakpointActionProvider. But setEnabled is called
with enabled=false!
Comment 5 Libor Kotouc 2005-08-16 11:46:52 UTC
Toggle bp action is disabled on JspToggleBreakpointActionProvider because
EditorContextImpl.getCurrentURL() returns empty string and then we are not able
to recognize the JSP.

BTW, this getCurrentURL() method is very similar to
AntBreakpointActionProvider.getCurrentLine(). It obtains the nodes by calling
TopComponent.getRegistry ().getCurrentNodes () which returns empty array of nodes.

going to explore why...
Comment 6 Libor Kotouc 2005-08-16 14:29:52 UTC
Fixed.

Checking in BaseJspEditorSupport.java;
/cvs/web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditorSupport.java,v
 <--  BaseJspEditorSupport.java
new revision: 1.49; previous revision: 1.48
done
Comment 7 zikmund 2005-09-02 12:03:37 UTC
Verified.