You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mark Hindess (JIRA)" <ji...@apache.org> on 2007/01/15 21:34:28 UTC

[jira] Closed: (HARMONY-2623) [classlib][swing] JScrollBar() throw unspecified NPE instead of IAE

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

Mark Hindess closed HARMONY-2623.
---------------------------------


Verified.  Thanks.

> [classlib][swing] JScrollBar() throw unspecified NPE instead of IAE
> -------------------------------------------------------------------
>
>                 Key: HARMONY-2623
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2623
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Mark Hindess
>         Attachments: Harmony-2623-JScrollBar.patch, Harmony-2623-JScrollBarTest.patch
>
>
> According to J2SE API 5.0 specifications of javax.swing.JScrollBar(int,int,int,int,int) constructor: 
> "Throws: IllegalArgumentException - if orientation is not one of VERTICAL, HORIZONTAL".
> Harmony throws NPE while RI throws IllegalArgumentException.
> JScrollBar() throw unspecified NPE instead of IllegalArgumentException.
> Test for reproducing:
> import junit.framework.TestCase;
> import javax.swing.*;
> public class Test extends TestCase {       
>     public void testcase1() {
>         try {
>             new JScrollBar(2000, 512, 128, 16, 10001);
>             fail("IllegalArgumentException should be thrown");
>         } catch ( IllegalArgumentException e) { 
>           //expected
>         }
>     }                
> }
> Output on Sun 1.5
> =================
> .
> Time: 0.015
> OK (1 test)
> Output on Harmony:
> ==================
> .E
> Time: 0.609
> There was 1 error:
> 1) testcase1(Test)java.lang.NullPointerException
>         at
> javax.swing.plaf.basic.BasicScrollBarUI.installComponents(BasicScrollBarUI.java:356)
>         at
> javax.swing.plaf.basic.BasicScrollBarUI.installUI(BasicScrollBarUI.java:419)
>         at javax.swing.JComponent.setUI(JComponent.java:1211)
>         at javax.swing.JScrollBar.setUI(JScrollBar.java:138)
>         at javax.swing.JScrollBar.updateUI(JScrollBar.java:146)
>         at javax.swing.JScrollBar.<init>(JScrollBar.java:134)
>         at Test.testcase1(Test.java:7)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 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: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira