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 35465 - View DD throws NPE when trying for context menu in source editor left pane
Summary: View DD throws NPE when trying for context menu in source editor left pane
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Martin Roskanin
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2003-08-18 14:34 UTC by Miloslav Metelka
Modified: 2007-11-05 13:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
diff in -c format (1.52 KB, patch)
2003-08-18 15:32 UTC, Jan Kovar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miloslav Metelka 2003-08-18 14:34:53 UTC
Description: 
Sierra ML release Build :

1/ Opened up an EJB's DD as read-only
2/ To enable line numbers in the source editor, i tried to right click on the
left pane to check 'show line numbers' and i got this NPE.
Wed Jan 15 15:51:17 CST 2003: java.lang.NullPointerException: <no message>
java.lang.NullPointerException
        at
org.netbeans.modules.editor.NbEditorKit$NbToggleLineNumbersAction.isLineNumbersVisible(NbEditorKit.java:445)
        at
org.netbeans.editor.ActionFactory$ToggleLineNumbersAction.getPopupMenuItem(ActionFactory.java:1216)
        at org.netbeans.editor.Annotations.createMenu(Annotations.java:562)
        at org.netbeans.editor.Annotations.createPopupMenu(Annotations.java:479)
        at
org.netbeans.editor.GlyphGutter$GutterMouseListener.mouseClicked(GlyphGutter.java:562)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:208)
        at java.awt.Component.processMouseEvent(Component.java:5024)
        at java.awt.Component.processEvent(Component.java:4818)
        at java.awt.Container.processEvent(Container.java:1525)
        at java.awt.Component.dispatchEventImpl(Component.java:3526)
        at java.awt.Container.dispatchEventImpl(Container.java:1582)
        at java.awt.Component.dispatchEvent(Component.java:3367)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3359)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3083)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004)
        at java.awt.Container.dispatchEventImpl(Container.java:1568)
        at java.awt.Window.dispatchEventImpl(Window.java:1581)
        at java.awt.Component.dispatchEvent(Component.java:3367)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:191)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)


Evaluation: 
Now, when I right click inside of the left pane, the small pop
up menu appears and I'm able to select "Show Line Numbers" with
no problems (no NPE is thrown).

However, the line numbers do not appear even though the check
box (for Show Line Numbers) is checked, so there is still a bug.

The problem is probably occurring because I supply my own
CloneableEditor implementation, but as I don't really do
anything wrt the left pane, I would think that displaying
the line numbers would still work.

xxx@xxxx 2003-03-05

A comment.
Comment 1 Jan Kovar 2003-08-18 15:31:21 UTC
Here is patch for [release35] but there should not be any 
difference with [maintrunk].

Comment 2 Jan Kovar 2003-08-18 15:32:27 UTC
Created attachment 11344 [details]
diff in -c format
Comment 3 Martin Roskanin 2003-08-18 16:26:30 UTC
Yes. The patch is OK and it can be applied also in [maintrunk]. Thanks.
Comment 4 pfelenda 2004-03-04 17:25:58 UTC
[200403031900]

This issue is probably fixed. Am I right ?
I am trying reproduce it, but without success.
If there won't be other input, then I close this issue as worksforme.
Comment 5 Martin Roskanin 2004-03-09 17:49:11 UTC
Issue should be targeted to release36. It was fixed in nevada fixes
branch only...
Comment 6 Martin Roskanin 2004-03-10 11:04:02 UTC
integrated into the [maintrunk]

visual diff:
http://editor.netbeans.org/source/browse/editor/src/org/netbeans/modules/editor/options/BaseOptions.java.diff?r1=1.87&r2=1.88

Mila, could you please review the fix? I just take the fix, Honza K.
proposed. Thanks.

Petr, the issue is hard to reproduce, you should create your own kit
by extending some editor kit, i.e. JavaKit and use options for that...
I believe it was tested already for integration into [nevadafixes] and
[release351A] where this fix is already present.
Comment 7 Miloslav Metelka 2004-03-10 12:35:37 UTC
Approved.
Comment 8 pfelenda 2004-03-11 20:22:09 UTC
I can't reproduce it, but the fix looks good.
Verified.
Comment 9 Martin Roskanin 2004-03-12 09:11:12 UTC
integrated into [release36]

/cvs/editor/src/org/netbeans/modules/editor/options/BaseOptions.java,v
 <--  BaseOptions.java
new revision: 1.87.2.1; previous revision: 1.87
Comment 10 Max Sauer 2005-07-13 16:04:11 UTC
Miloslave, could you please verify this issue?  Thanks.
Comment 11 Miloslav Metelka 2005-07-18 14:15:57 UTC
verified