harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2630) [classlib][swing] javax.swing.JMenu.createActionChangeListener(null) throws unspecified NPE while RI does not
Date Thu, 28 Dec 2006 22:17:23 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2630?page=comments#action_12461264 ] 
            
Vasily Zakharov commented on HARMONY-2630:
------------------------------------------

The problem is RI somehow manages to create a listener for null menu item (non-null value
is returned), and our implementation clearly cannot:

    protected PropertyChangeListener createActionChangeListener(JMenuItem item) {
        return item.createActionPropertyChangeListener(getAction());
    }

Looks like some essential redesign is necessary to fix this issue.

I'm giving this up hoping someone confident in Swing would look into it.


> [classlib][swing] javax.swing.JMenu.createActionChangeListener(null) throws unspecified
NPE while RI does not
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2630
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2630
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>            Priority: Minor
>
> Test case:
> --------------
> import java.beans.PropertyChangeListener;
> import javax.swing.JMenu;
> import javax.swing.JMenuItem;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         TestJMenu jm = new TestJMenu();
>         jm.createActionChangeListener(null);
>     }
>     static class TestJMenu extends JMenu {
>         public PropertyChangeListener createActionChangeListener(JMenuItem arg0) {
>             return super.createActionChangeListener(arg0);
>         }
>     }
> }
> Harmony output:
> ----------------
> .E
> Time: 0.982
> There was 1 error:
> 1) testcase1(TheTest)java.lang.NullPointerException
> 	at javax.swing.JMenu.createActionChangeListener(JMenu.java:172)
> 	at TheTest$TestJMenu.createActionChangeListener(TheTest.java)
> 	at TheTest.testcase1(TheTest.java:15)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:11)
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message