harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Simbirtsev (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE
Date Fri, 15 Dec 2006 15:03:21 GMT
[classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE
instead of IAE
----------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2753
                 URL: http://issues.apache.org/jira/browse/HARMONY-2753
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Alexander Simbirtsev


According to the specification
javax.swing.LayoutFocusTraversalPolicy.getFirstComponent/getLastComponent(Container
aContainer) must throw IllegalAgumentexception is aContainer==null.
RI throws IAE while Harmony throws NPE.

Use the following code to reproduce:

import javax.swing.LayoutFocusTraversalPolicy;

import junit.framework.TestCase;

public class Test extends TestCase {       
    public void testcase1() {
        LayoutFocusTraversalPolicy pl = new LayoutFocusTraversalPolicy();       
        try {
            pl.getFirstComponent(null);
            fail("IllegalAgumentexception should be thrown");
        } catch (IllegalArgumentException e) {
            //expected
        } catch (NullPointerException e) {
            fail("IllegalAgumentexception should be thrown");
        }

    } 
    public void testcase2() {
        LayoutFocusTraversalPolicy pl = new LayoutFocusTraversalPolicy();       
        try {
            pl.getLastComponent(null);
        } catch (IllegalArgumentException e) {
            //expected
        } catch (NullPointerException e) {
            fail("IllegalAgumentexception should be thrown");
        }      
    }      
}

-- 
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