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 170527 - JComponent created by DiffController throws NPE when component is painted
Summary: JComponent created by DiffController throws NPE when component is painted
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: diff-issues@utilities
URL:
Keywords:
: 170047 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-18 09:32 UTC by mgoe
Modified: 2009-09-16 01:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Module suite project showing the issue (6.69 KB, application/x-gzip)
2009-08-18 09:35 UTC, mgoe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mgoe 2009-08-18 09:32:18 UTC
I'm using DiffController in a Netbeans module suite project. After switching to Netbeans 6.8M1 the JComponent created 
by DiffController.create() throws NPEs when the component is painted.

java.lang.NullPointerException
	at 
org.netbeans.modules.diff.builtin.visualizer.editable.LineNumbersActionsBar.paintComponent(LineNumbersActionsBar.java:333)
	at javax.swing.JComponent.paint(JComponent.java:1029)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JViewport.paint(JViewport.java:747)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1030)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at org.netbeans.swing.tabcontrol.TabbedContainer.paint(TabbedContainer.java:968)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at org.netbeans.core.windows.view.ui.MultiSplitPane.paint(MultiSplitPane.java:325)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
	at javax.swing.JComponent.paintChildren(JComponent.java:864)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5131)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1475)
	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1406)
	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:294)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1220)
	at javax.swing.JComponent.paint(JComponent.java:1015)
	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
	at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
	at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
	at java.awt.Container.paint(Container.java:1780)
	at org.netbeans.core.windows.view.ui.MainWindow.paint(MainWindow.java:593)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
	at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
[catch] at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
	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:117)
	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)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 mgoe 2009-08-18 09:35:26 UTC
Created attachment 86376 [details]
Module suite project showing the issue
Comment 2 mgoe 2009-08-18 10:01:17 UTC
In order to reproduce the bug please compile and run the attached module suite project.
Comment 3 Ondrej Vrabec 2009-08-18 11:00:18 UTC
You also need to add at least a dependency on Plain Editor. Diff uses some functionality from that module (not directly
but through lookup).
Add dependency on ide11/Plain Editor, that should help and eliminate the NPE. This is a WA, i'm lowering the priority to
P3, but leaving this open. We will try to find a way to eliminate the dependency.
Comment 4 Ondrej Vrabec 2009-08-26 08:07:28 UTC
*** Issue 170047 has been marked as a duplicate of this issue. ***
Comment 5 Ondrej Vrabec 2009-09-14 10:04:57 UTC
fix: cdev #3f465a28133c
Comment 6 Ondrej Vrabec 2009-09-14 10:09:55 UTC
The NPE was thrown because a default editor returned an unsupported TextUI (BaseTextUI is needed). When diff doesn't get
an instance of BaseTextUI, it displays a warning message in both panes.
In order to make diff working properly it suffices to enable the Plain Editor module (can be found in ide11 cluster - or
ide12 for 6.8) 
Comment 7 mgoe 2009-09-15 13:38:53 UTC
If the Plain Editor module is required for the diff module to work properly, the diff module should have a dependency 
on the Plain Editor module. Otherwise you will get runtime errors which is not acceptable.
Comment 8 Quality Engineering 2009-09-16 01:09:41 UTC
Integrated into 'main-golden', will be available in build *200909151512* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3f465a28133c
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #170527 - JComponent created by DiffController throws NPE when component is painted
Showing a warning message instead the NPE