harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-5223) [classlib][swing][EIOffice] JComboBox.setEditor throws NPE if editor.getEditorComponent returns null
Date Thu, 29 Nov 2007 15:54:43 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexey Petrenko closed HARMONY-5223.
------------------------------------

    Resolution: Fixed

The fix and unit test update are applied.

> [classlib][swing][EIOffice] JComboBox.setEditor throws NPE if editor.getEditorComponent
returns null
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5223
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5223
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Alexey Petrenko
>            Assignee: Alexey Petrenko
>
> JComboBox.setEditor throws the following NPE if editor.getEditorComponent returns null:
> java.lang.NullPointerException
> 	at javax.swing.plaf.basic.BasicComboBoxUI.configureEditor(BasicComboBoxUI.java:701)
> 	at javax.swing.plaf.metal.MetalComboBoxUI.configureEditor(MetalComboBoxUI.java:109)
> 	at javax.swing.plaf.basic.BasicComboBoxUI.addEditor(BasicComboBoxUI.java:411)
> 	at javax.swing.plaf.basic.BasicComboBoxUI$PropertyChangeHandler.propertyChange(BasicComboBoxUI.java:231)
> 	at javax.swing.plaf.metal.MetalComboBoxUI$MetalPropertyChangeListener.propertyChange(MetalComboBoxUI.java:82)
> 	at java.beans.PropertyChangeSupport.doFirePropertyChange(PropertyChangeSupport.java:263)
> 	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:54)
> 	at java.awt.Component.firePropertyChangeImpl(Component.java:1668)
> 	at java.awt.Component.firePropertyChange(Component.java:1682)
> 	at javax.swing.JComboBox.setEditor(JComboBox.java:323)
> 	at ComboBoxEditorTest.main(ComboBoxEditorTest.java:19)
> RI does not throw any exception in this case.
> Here is a test case:
> import java.awt.Component;
> import javax.swing.JComboBox;
> import javax.swing.plaf.basic.BasicComboBoxEditor;
> public class ComboBoxEditorTest {
>     public static class NullComboBoxEditor extends BasicComboBoxEditor {
>         public NullComboBoxEditor() {
>             super();
>         }
>         public Component getEditorComponent() {
>             return null;
>         }
>     }
>     public static void main(String[] args) {
>         JComboBox cb = new JComboBox();
>         cb.setEditor(new NullComboBoxEditor());
>         System.err.println("OK");
>     }
> }
> The issue was discovered while running EIOffice on top of Harmony

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message