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 188794 - NPE from HighlightsViewFactory.updateNewLineOffset
Summary: NPE from HighlightsViewFactory.updateNewLineOffset
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.0
Hardware: PC Linux
: P2 normal (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 14:45 UTC by Jesse Glick
Modified: 2010-08-13 03:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-07-20 14:45:35 UTC
100719-60dd34c0bb05 w/ linewrap. After returning to the IDE after a commit (cannot use built-in diff: bug #188779, so closed diff window), IDE became unresponsive. Log file showed

java.lang.NullPointerException
	at org.netbeans.modules.editor.lib2.view.HighlightsViewFactory.updateNewLineOffset(HighlightsViewFactory.java:210)
	at org.netbeans.modules.editor.lib2.view.HighlightsViewFactory.createView(HighlightsViewFactory.java:165)
	at org.netbeans.modules.editor.lib2.view.ViewBuilder.createNextView(ViewBuilder.java:350)
	at org.netbeans.modules.editor.lib2.view.ViewBuilder.createViews(ViewBuilder.java:291)
	at org.netbeans.modules.editor.lib2.view.ViewUpdates.initChildren(ViewUpdates.java:162)
	at org.netbeans.modules.editor.lib2.view.DocumentView.initChildren(DocumentView.java:473)
	at org.netbeans.modules.editor.lib2.view.EditorBoxViewChildren.getWithChildrenValid(EditorBoxViewChildren.java:297)
	at org.netbeans.modules.editor.lib2.view.EditorBoxViewChildren.paint(EditorBoxViewChildren.java:789)
	at org.netbeans.modules.editor.lib2.view.EditorBoxView.paint(EditorBoxView.java:503)
	at org.netbeans.modules.editor.lib2.view.DocumentView.paint(DocumentView.java:791)
	at org.netbeans.modules.editor.lib2.view.EditorView.paint(EditorView.java:175)
	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1422)
	at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:722)
	at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:869)
	at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:848)
	at javax.swing.JComponent.paintComponent(JComponent.java:752)
	at org.netbeans.modules.diff.builtin.visualizer.editable.DecoratedEditorPane.paintComponent(DecoratedEditorPane.java:131)
	at javax.swing.JComponent.paint(JComponent.java:1029)
....

Then log file filled up with

SEVERE [global]
java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.core.NotifyExcPanel$ExceptionFlasher
	at org.netbeans.core.NotifyExcPanel$2.run(NotifyExcPanel.java:329)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
[catch] at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

though I'm not sure what caused this.
Comment 1 Miloslav Metelka 2010-08-10 12:22:26 UTC
I'm unable to reproduce (I run with editor's part of #188779 fixed). Does the NPE happen randomly?
Comment 2 Jesse Glick 2010-08-10 18:13:10 UTC
Don't know, I have not run with linewrap enabled since then since it was too buggy. Close if you believe it has been fixed.
Comment 3 Miloslav Metelka 2010-08-11 11:41:23 UTC
I've put an additional assert into view factory's HVFactory.restart() method and if it shows up that the lineRootElement is null there then I'll probably have to skip processing of DocumentView's paint() method in such case.
Comment 4 Miloslav Metelka 2010-08-11 11:50:57 UTC
http://hg.netbeans.org/jet-main/rev/0e30c849f84b
Comment 5 Quality Engineering 2010-08-13 03:07:37 UTC
Integrated into 'main-golden', will be available in build *201008130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0e30c849f84b
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #188794 - NPE from HighlightsViewFactory.updateNewLineOffset - added assert for lineRootElement != null.