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

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

[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

        

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

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

Sergey Krivenko updated HARMONY-2623:
-------------------------------------

    Attachment: Harmony-2623-JScrollBar.patch

the attached file resolves the issue

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

        

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

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

Denis Kishenko updated HARMONY-2623:
------------------------------------

    Patch Info: [Patch Available]

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

        

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

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

Sergey Krivenko updated HARMONY-2623:
-------------------------------------

    Attachment: Harmony-2623-JScrollBarTest.patch

the attached file is a patch to the test

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

        

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

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

Sergey Krivenko commented on HARMONY-2623:
------------------------------------------

Verified

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

        

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

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

        

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

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

        

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

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

Mark Hindess resolved HARMONY-2623.
-----------------------------------

    Resolution: Fixed
      Assignee: Mark Hindess

Applied patches in r495972.  I fixed the syntax error in test patch.  Please confirm they have been applied as expected.

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