harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2623) [classlib][swing] JScrollBar() throw unspecified NPE instead of IAE
Date Tue, 12 Dec 2006 10:48:21 GMT
[classlib][swing] JScrollBar() throw unspecified NPE instead of IAE
-------------------------------------------------------------------

                 Key: HARMONY-2623
                 URL: http://issues.apache.org/jira/browse/HARMONY-2623
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Denis Kishenko


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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message