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/14 16:11:21 UTC

[jira] Created: (HARMONY-2707) [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in

[classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in
-------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2707
                 URL: http://issues.apache.org/jira/browse/HARMONY-2707
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Alexander Simbirtsev


Use the following code to reproduce:

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

import javax.swing.plaf.basic.BasicArrowButton;

import junit.framework.TestCase;

public class Test extends TestCase {
    private static final int INCORRECT_DIRECTION = 10;

    public void testcase1() {                                    
        try {
            Graphics2D g2D = new BufferedImage(6, 6, BufferedImage.TYPE_INT_RGB).createGraphics();
            BasicArrowButton ab = new BasicArrowButton(0);
            ab.paintTriangle(g2D, 0, 0, 0, INCORRECT_DIRECTION, true);
        } catch (NullPointerException e) {
            fail("NPE 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] Closed: (HARMONY-2707) [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in

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

Mark Hindess closed HARMONY-2707.
---------------------------------


Verified.  Thanks.

> [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2707
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2707
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Assigned To: Mark Hindess
>         Attachments: H2707-BasicArrowButtonTest.patch, Utilities-patch.txt
>
>
> Use the following code to reproduce:
> import java.awt.Graphics2D;
> import java.awt.image.BufferedImage;
> import javax.swing.plaf.basic.BasicArrowButton;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     private static final int INCORRECT_DIRECTION = 10;
>     public void testcase1() {                                    
>         try {
>             Graphics2D g2D = new BufferedImage(6, 6, BufferedImage.TYPE_INT_RGB).createGraphics();
>             BasicArrowButton ab = new BasicArrowButton(0);
>             ab.paintTriangle(g2D, 0, 0, 0, INCORRECT_DIRECTION, true);
>         } catch (NullPointerException e) {
>             fail("NPE 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] Updated: (HARMONY-2707) [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in

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

Dmitry Irlyanov updated HARMONY-2707:
-------------------------------------

    Attachment: H2707-BasicArrowButtonTest.patch

Patch to add the regression test

> [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2707
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2707
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Attachments: H2707-BasicArrowButtonTest.patch, Utilities-patch.txt
>
>
> Use the following code to reproduce:
> import java.awt.Graphics2D;
> import java.awt.image.BufferedImage;
> import javax.swing.plaf.basic.BasicArrowButton;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     private static final int INCORRECT_DIRECTION = 10;
>     public void testcase1() {                                    
>         try {
>             Graphics2D g2D = new BufferedImage(6, 6, BufferedImage.TYPE_INT_RGB).createGraphics();
>             BasicArrowButton ab = new BasicArrowButton(0);
>             ab.paintTriangle(g2D, 0, 0, 0, INCORRECT_DIRECTION, true);
>         } catch (NullPointerException e) {
>             fail("NPE 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-2707) [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in

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

Alexei Fedotov updated HARMONY-2707:
------------------------------------

    Attachment: remove_assert.patch

The post-fix. When assertions are enabled, RI smoothly ignores an incorrect direction, while Harmony fails with assertion.

> [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2707
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2707
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>            Assignee: Mark Hindess
>         Attachments: H2707-BasicArrowButtonTest.patch, remove_assert.patch, Utilities-patch.txt
>
>
> Use the following code to reproduce:
> import java.awt.Graphics2D;
> import java.awt.image.BufferedImage;
> import javax.swing.plaf.basic.BasicArrowButton;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     private static final int INCORRECT_DIRECTION = 10;
>     public void testcase1() {                                    
>         try {
>             Graphics2D g2D = new BufferedImage(6, 6, BufferedImage.TYPE_INT_RGB).createGraphics();
>             BasicArrowButton ab = new BasicArrowButton(0);
>             ab.paintTriangle(g2D, 0, 0, 0, INCORRECT_DIRECTION, true);
>         } catch (NullPointerException e) {
>             fail("NPE 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-2707) [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in

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

Alexander Simbirtsev updated HARMONY-2707:
------------------------------------------

    Attachment: Utilities-patch.txt

Here's the proposed fix

> [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2707
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2707
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Attachments: Utilities-patch.txt
>
>
> Use the following code to reproduce:
> import java.awt.Graphics2D;
> import java.awt.image.BufferedImage;
> import javax.swing.plaf.basic.BasicArrowButton;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     private static final int INCORRECT_DIRECTION = 10;
>     public void testcase1() {                                    
>         try {
>             Graphics2D g2D = new BufferedImage(6, 6, BufferedImage.TYPE_INT_RGB).createGraphics();
>             BasicArrowButton ab = new BasicArrowButton(0);
>             ab.paintTriangle(g2D, 0, 0, 0, INCORRECT_DIRECTION, true);
>         } catch (NullPointerException e) {
>             fail("NPE 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-2707) [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in

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

Alexander Simbirtsev commented on HARMONY-2707:
-----------------------------------------------

Works fine. Thanks Mark!

> [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2707
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2707
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Assigned To: Mark Hindess
>         Attachments: H2707-BasicArrowButtonTest.patch, Utilities-patch.txt
>
>
> Use the following code to reproduce:
> import java.awt.Graphics2D;
> import java.awt.image.BufferedImage;
> import javax.swing.plaf.basic.BasicArrowButton;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     private static final int INCORRECT_DIRECTION = 10;
>     public void testcase1() {                                    
>         try {
>             Graphics2D g2D = new BufferedImage(6, 6, BufferedImage.TYPE_INT_RGB).createGraphics();
>             BasicArrowButton ab = new BasicArrowButton(0);
>             ab.paintTriangle(g2D, 0, 0, 0, INCORRECT_DIRECTION, true);
>         } catch (NullPointerException e) {
>             fail("NPE 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] Resolved: (HARMONY-2707) [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in

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

Mark Hindess resolved HARMONY-2707.
-----------------------------------

    Resolution: Fixed
      Assignee: Mark Hindess

Applied patches in r496107.  I modified the test slightly to let junit handle the exceptions.  Please confirm they have been applied as expected.

> [classlib][swing] javax.swing.plaf.basic.BasicArrowButton.paintTriangle() throws unexpected NPE when incorrect 'direction' parameter is passed in
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2707
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2707
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Simbirtsev
>         Assigned To: Mark Hindess
>         Attachments: H2707-BasicArrowButtonTest.patch, Utilities-patch.txt
>
>
> Use the following code to reproduce:
> import java.awt.Graphics2D;
> import java.awt.image.BufferedImage;
> import javax.swing.plaf.basic.BasicArrowButton;
> import junit.framework.TestCase;
> public class Test extends TestCase {
>     private static final int INCORRECT_DIRECTION = 10;
>     public void testcase1() {                                    
>         try {
>             Graphics2D g2D = new BufferedImage(6, 6, BufferedImage.TYPE_INT_RGB).createGraphics();
>             BasicArrowButton ab = new BasicArrowButton(0);
>             ab.paintTriangle(g2D, 0, 0, 0, INCORRECT_DIRECTION, true);
>         } catch (NullPointerException e) {
>             fail("NPE 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