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 149859 - [65cat] java.lang.NullPointerException at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRenderer.getTableCellRendererComponent(WindowsTableHeaderUI.java:108)
Summary: [65cat] java.lang.NullPointerException at com.sun.java.swing.plaf.windows.Win...
Status: RESOLVED WORKSFORME
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Shansi 11
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
: 149857 149858 149860 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-11 10:44 UTC by ieising
Modified: 2009-02-19 20:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 126638


Attachments
stacktrace (4.89 KB, text/plain)
2008-10-11 10:44 UTC, ieising
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ieising 2008-10-11 10:44:34 UTC
Build: NetBeans IDE Dev (Build 200810041417)
VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25
OS: Windows Vista, 6.0, x86

Stacktrace: 
java.lang.NullPointerException
        at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRenderer.getTableCellRendererComponent(WindowsTableHeaderUI.java:108)
        at org.netbeans.modules.db.dataview.output.DataViewTableSorter$SortableHeaderRenderer.getTableCellRendererComponent(DataViewTableSorter.java:494)
        at javax.swing.plaf.basic.BasicTableHeaderUI.getHeaderRenderer(BasicTableHeaderUI.java:663)
        at javax.swing.plaf.basic.BasicTableHeaderUI.getHeaderHeight(BasicTableHeaderUI.java:698)
        at javax.swing.plaf.basic.BasicTableHeaderUI.createHeaderSize(BasicTableHeaderUI.java:727)
        at javax.swing.plaf.basic.BasicTableHeaderUI.getPreferredSize(BasicTableHeaderUI.java:758)
Comment 1 ieising 2008-10-11 10:44:39 UTC
Created attachment 71604 [details]
stacktrace
Comment 2 John Baker 2008-10-11 23:22:03 UTC
I had a similar issue in History.  If it can be avoided, don't set the TableCellRendererComponent.

This might need to be fixed in 6.5 and priority raised to 1
Comment 3 Roman Mostyka 2008-10-13 08:45:00 UTC
*** Issue 149860 has been marked as a duplicate of this issue. ***
Comment 4 Roman Mostyka 2008-10-13 08:45:18 UTC
*** Issue 149858 has been marked as a duplicate of this issue. ***
Comment 5 Roman Mostyka 2008-10-13 08:45:24 UTC
*** Issue 149857 has been marked as a duplicate of this issue. ***
Comment 6 John Baker 2008-10-13 08:48:30 UTC
Roman, can you reproduce on Windows Vista ?

VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25
OS: Windows Vista, 6.0, x86
Comment 7 Roman Mostyka 2008-10-13 10:58:32 UTC
I tried on Windows Vista with latest build, but without success. I wasn't able to reproduce this issue.
Probably it will be better to have steps to reproduce, since I just tried "View Data" and then sort columns and tried
the same for "SQL History" and don't have any problem, but probably I just didn't do necessary action.
Comment 8 _ ahimanikya 2008-10-13 11:46:01 UTC
I am unable to reproduce this both in Windows and Mac. 
Comment 9 _ ahimanikya 2008-10-13 12:10:44 UTC
This does look like a P2 to me, I have never observed this exception.

I need to set the TableCellRendererComponent for sorting.
Comment 10 _ ahimanikya 2008-10-17 21:50:46 UTC
http://hg.netbeans.org/main/rev/fd9deccbd97d
Comment 11 Andrei Badea 2008-10-20 18:10:00 UTC
The fix for this issue doesn't look right. Either it is working around an issue in the JDK, in which case a JDK bug
needs to be filed, or it is working around a problem in dataview. Either way, it is a workaround. Catching
NullPointerException (or disguising it by catching Exception) is a discouraged practice. What is the exact case of the NPE?
Comment 12 _ ahimanikya 2008-10-21 08:31:38 UTC
I agree. I am not sure whether it is a JDK issue or not. 

I could never reproduce this and did not like this kind of workaround either.
Comment 13 _ ahimanikya 2008-10-21 08:50:59 UTC
I don't know how to fix this. All can do is revert this change, unless someone has a better suggestion.
Comment 14 _ ahimanikya 2008-12-05 06:40:40 UTC
I can never reproduce this both in Windows and Mac. So marking it as Works for me.