harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2623) [classlib][swing] JScrollBar() throw unspecified NPE instead of IAE
Date Sat, 13 Jan 2007 21:27:27 GMT

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

Mark Hindess commented on HARMONY-2623:
---------------------------------------

Sergey, What compiler do you use?  Mine complains about:

  public void testConstructor throws Exception {

because of the lack of brackets '()' after testConstructor. ;-)

I'll apply the patches anyway.


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

        

Mime
View raw message