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] Resolved: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE
Date Tue, 06 Mar 2007 17:13:24 GMT

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

Alexey Petrenko resolved HARMONY-2753.
--------------------------------------

    Resolution: Duplicate

The issue closed as duplicate.
Alexander, please verify that you are happy with the resolution.

> [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws
NPE instead of IAE
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2753
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2753
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Assigned To: Alexey Petrenko
>         Attachments: H2753-LayoutFocusTraversalPolicyTest.patch, H2753-LayoutFocusTraversalPolicyTest.patch,
LayoutFocusTraversalPolicy-patch.txt
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message