You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexander Simbirtsev (JIRA)" <ji...@apache.org> on 2006/12/15 16:03:21 UTC

[jira] Created: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

[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

        

[jira] Updated: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Dmitry Irlyanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2753?page=all ]

Dmitry Irlyanov updated HARMONY-2753:
-------------------------------------

    Attachment: H2753-LayoutFocusTraversalPolicyTest.patch

Correct version for the test

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

        

[jira] Resolved: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Commented: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Alexander Simbirtsev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464678 ] 

Alexander Simbirtsev commented on HARMONY-2753:
-----------------------------------------------

Yes, It does pass. 
Sorry for misleading. 
The patch suggests only a bit of refactoring for exception messages.
However, it's not "required".

> [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
>         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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko closed HARMONY-2753.
------------------------------------


And I'm happy for you! :)

Closed.

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


[jira] Updated: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Dmitry Irlyanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2753?page=all ]

Dmitry Irlyanov updated HARMONY-2753:
-------------------------------------

    Attachment: H2753-LayoutFocusTraversalPolicyTest.patch

Test added

> [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
>         Attachments: 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.
-
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

        

[jira] Assigned: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko reassigned HARMONY-2753:
----------------------------------------

    Assignee: Alexey Petrenko

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


[jira] Updated: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Alexander Simbirtsev (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2753?page=all ]

Alexander Simbirtsev updated HARMONY-2753:
------------------------------------------

    Attachment: LayoutFocusTraversalPolicy-patch.txt

Here's the proposed fix

> [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
>         Attachments: 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.
-
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

        

[jira] Commented: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464619 ] 

Mark Hindess commented on HARMONY-2753:
---------------------------------------

For me, the tests pass even without the fix?  Is it still required?


> [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
>         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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2753) [classlib][swing] javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(null) throws NPE instead of IAE

Posted by "Alexander Simbirtsev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478492 ] 

Alexander Simbirtsev commented on HARMONY-2753:
-----------------------------------------------

Absolutely happy

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