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 177225 - NullPointerException at org.netbeans.modules.swingapp.ActionPropertyEditorPanel$3.getListCellRendererComponent
Summary: NullPointerException at org.netbeans.modules.swingapp.ActionPropertyEditorPan...
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: App Framework (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-19 10:11 UTC by rogerrhody
Modified: 2010-02-26 03:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 153429


Attachments
stacktrace (6.65 KB, text/plain)
2009-11-19 10:11 UTC, rogerrhody
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rogerrhody 2009-11-19 10:11:35 UTC
Build: NetBeans IDE Dev (Build 200911091156)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02-90, Java(TM) SE Runtime Environment, 1.6.0_15-b03-219
OS: Mac OS X, 10.6.2, x86_64

User Comments:
GUEST: trying to set buttons action via "set action" menu



Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.swingapp.ActionPropertyEditorPanel$3.getListCellRendererComponent(ActionPropertyEditorPanel.java:169)
        at com.apple.laf.AquaComboBoxButton.doRendererPaint(AquaComboBoxButton.java:147)
        at com.apple.laf.AquaComboBoxButton.paintComponent(AquaComboBoxButton.java:139)
        at javax.swing.JComponent.paint(JComponent.java:1029)
        at javax.swing.JComponent.paintChildren(JComponent.java:864)
        at javax.swing.JComponent.paint(JComponent.java:1038)
Comment 1 rogerrhody 2009-11-19 10:11:39 UTC
Created attachment 91368 [details]
stacktrace
Comment 2 Jan Stola 2009-11-20 01:16:33 UTC
The corresponding code is

    public Component getListCellRendererComponent(...,Object value,...) {
        Component comp = super.getListCellRendererComponent(...);
        ProxyAction.Scope scope = (ProxyAction.Scope)value;
->      ((JLabel)comp).setText(scope.toString());
        ...
    }

i.e. the scope variable is null (because value variable is null).

I searched the code and I cannot imagine how the selected item of the corresponding combobox (scopeCombo) can be null there. It seems that AquaComboBoxButton.doRendererPaint() passes null to the renderer in spite of the fact that the selected item is non-null. I searched the Internet and found several similar reports. It seems to be a new problem/feature of Apple's JDK 6.

While I consider this to be a problem of Apple's JDK 6, we can still workaround this issue easily.
Comment 3 Jan Stola 2010-02-26 03:35:30 UTC
Fixed.

Modified file: http://hg.netbeans.org/cdev/rev/3130f9f88d93