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/09/15 10:46:22 UTC

[jira] Created: (HARMONY-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

[classlib][awt] GradientPaint doesn't throw NPE if Color is null 
-----------------------------------------------------------------

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


Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.

========== Spec =================
Throws: 
     NullPointerException - if either one of colors or points is null

============== Test.java ===========
import java.awt.*;
import java.awt.geom.Point2D;

public class Test {

    static public void main(String[] args) { 
        try {
            System.err.println("1");
            new GradientPaint(
                    new Float(-0.0), new Float(-0.0), null, 
                    new Float(-0.0), new Float(-0.0), new Color(255), false); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }            
        try {
            System.err.println("2");
             new GradientPaint(
                     new Float(-0.0), new Float(-0.0), new Color(255), 
                     new Float(-0.0), new Float(-0.0), null, false); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }  
        try {
            System.err.println("3");
            new GradientPaint(
                    new Float(-0.0), new Float(-0.0), new Color(255), 
                    new Float(-0.0), new Float(-0.0), null); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }  
        try {
            System.err.println("4");
            new GradientPaint(
                    new Float(-0.0), new Float(-0.0), null, 
                    new Float(-0.0), new Float(-0.0), new Color(255)); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }
        try {
            System.err.println("5");
            new GradientPaint(
                    new Point2D.Float(), new Color(255), 
                    new Point2D.Float(), null); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }  
        try {
            System.err.println("6");
            new GradientPaint(
                    new Point2D.Float(), null, 
                    new Point2D.Float(), new Color(255)); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }  
    }       

}

=========== RI output ===============
1
java.lang.NullPointerException: Colors cannot be null
    at java.awt.GradientPaint.<init>(GradientPaint.java:71)
    at java.awt.GradientPaint.<init>(GradientPaint.java:131)
    at Test.main(Test.java:9)
2
java.lang.NullPointerException: Colors cannot be null
    at java.awt.GradientPaint.<init>(GradientPaint.java:71)
    at java.awt.GradientPaint.<init>(GradientPaint.java:131)
    at Test.main(Test.java:17)
3
java.lang.NullPointerException: Colors cannot be null
    at java.awt.GradientPaint.<init>(GradientPaint.java:71)
    at Test.main(Test.java:25)
4
java.lang.NullPointerException: Colors cannot be null
    at java.awt.GradientPaint.<init>(GradientPaint.java:71)
    at Test.main(Test.java:33)
5
java.lang.NullPointerException: Colors and points should be non-null
    at java.awt.GradientPaint.<init>(GradientPaint.java:97)
    at Test.main(Test.java:41)
6
java.lang.NullPointerException: Colors and points should be non-null
    at java.awt.GradientPaint.<init>(GradientPaint.java:97)
    at Test.main(Test.java:49)

========== Harmony output ===============
1
2
3
4
5
6


-- 
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-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

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

Denis Kishenko updated HARMONY-1470:
------------------------------------

    Attachment: 1470-GradientPaint.patch

patch + test

> [classlib][awt] GradientPaint doesn't throw NPE if Color is null
> ----------------------------------------------------------------
>
>                 Key: HARMONY-1470
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1470
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: 1470-GradientPaint.patch, 1470-GradientPaintTest.patch
>
>
> Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.
> ========== Spec =================
> Throws: 
>      NullPointerException - if either one of colors or points is null
> ============== Test.java ===========
> import java.awt.*;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         try {
>             System.err.println("1");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255), false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }            
>         try {
>             System.err.println("2");
>              new GradientPaint(
>                      new Float(-0.0), new Float(-0.0), new Color(255), 
>                      new Float(-0.0), new Float(-0.0), null, false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("3");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), new Color(255), 
>                     new Float(-0.0), new Float(-0.0), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("4");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("5");
>             new GradientPaint(
>                     new Point2D.Float(), new Color(255), 
>                     new Point2D.Float(), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("6");
>             new GradientPaint(
>                     new Point2D.Float(), null, 
>                     new Point2D.Float(), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>     }       
> }
> =========== RI output ===============
> 1
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:9)
> 2
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:17)
> 3
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:25)
> 4
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:33)
> 5
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:41)
> 6
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:49)
> ========== Harmony output ===============
> 1
> 2
> 3
> 4
> 5
> 6

-- 
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-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

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

Mikhail Loenko closed HARMONY-1470.
-----------------------------------


> [classlib][awt] GradientPaint doesn't throw NPE if Color is null
> ----------------------------------------------------------------
>
>                 Key: HARMONY-1470
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1470
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Mikhail Loenko
>         Attachments: 1470-GradientPaint.patch, 1470-GradientPaintTest.patch
>
>
> Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.
> ========== Spec =================
> Throws: 
>      NullPointerException - if either one of colors or points is null
> ============== Test.java ===========
> import java.awt.*;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         try {
>             System.err.println("1");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255), false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }            
>         try {
>             System.err.println("2");
>              new GradientPaint(
>                      new Float(-0.0), new Float(-0.0), new Color(255), 
>                      new Float(-0.0), new Float(-0.0), null, false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("3");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), new Color(255), 
>                     new Float(-0.0), new Float(-0.0), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("4");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("5");
>             new GradientPaint(
>                     new Point2D.Float(), new Color(255), 
>                     new Point2D.Float(), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("6");
>             new GradientPaint(
>                     new Point2D.Float(), null, 
>                     new Point2D.Float(), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>     }       
> }
> =========== RI output ===============
> 1
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:9)
> 2
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:17)
> 3
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:25)
> 4
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:33)
> 5
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:41)
> 6
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:49)
> ========== Harmony output ===============
> 1
> 2
> 3
> 4
> 5
> 6

-- 
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-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1470?page=comments#action_12434929 ] 
            
Denis Kishenko commented on HARMONY-1470:
-----------------------------------------

One more test, contstructor doesn't check value of Point2D parameters.

============== Test.java ==============
import java.awt.*;
import java.awt.geom.Point2D;

public class Test {

    static public void main(String[] args) { 
        try {
            System.err.println("7");
            new GradientPaint(
                    null, new Color(255), 
                    new Point2D.Float(), new Color(255)); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }  
        try {
            System.err.println("8");
            new GradientPaint(
                    new Point2D.Float(), new Color(255), 
                    null, new Color(255)); 
        } catch (NullPointerException e) {
            e.printStackTrace();
        }  
    }       

}

=========== RI output ===============
7
java.lang.NullPointerException: Colors and points should be non-null
    at java.awt.GradientPaint.<init>(GradientPaint.java:97)
    at Test.main(Test.java:9)
8
java.lang.NullPointerException: Colors and points should be non-null
    at java.awt.GradientPaint.<init>(GradientPaint.java:97)
    at Test.main(Test.java:17)

========== Harmony output ==========
7
8


> [classlib][awt] GradientPaint doesn't throw NPE if Color is null
> ----------------------------------------------------------------
>
>                 Key: HARMONY-1470
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1470
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>
> Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.
> ========== Spec =================
> Throws: 
>      NullPointerException - if either one of colors or points is null
> ============== Test.java ===========
> import java.awt.*;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         try {
>             System.err.println("1");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255), false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }            
>         try {
>             System.err.println("2");
>              new GradientPaint(
>                      new Float(-0.0), new Float(-0.0), new Color(255), 
>                      new Float(-0.0), new Float(-0.0), null, false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("3");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), new Color(255), 
>                     new Float(-0.0), new Float(-0.0), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("4");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("5");
>             new GradientPaint(
>                     new Point2D.Float(), new Color(255), 
>                     new Point2D.Float(), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("6");
>             new GradientPaint(
>                     new Point2D.Float(), null, 
>                     new Point2D.Float(), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>     }       
> }
> =========== RI output ===============
> 1
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:9)
> 2
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:17)
> 3
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:25)
> 4
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:33)
> 5
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:41)
> 6
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:49)
> ========== Harmony output ===============
> 1
> 2
> 3
> 4
> 5
> 6

-- 
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-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1470?page=comments#action_12444269 ] 
            
Denis Kishenko commented on HARMONY-1470:
-----------------------------------------

Verified, thanks!

> [classlib][awt] GradientPaint doesn't throw NPE if Color is null
> ----------------------------------------------------------------
>
>                 Key: HARMONY-1470
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1470
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Mikhail Loenko
>         Attachments: 1470-GradientPaint.patch, 1470-GradientPaintTest.patch
>
>
> Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.
> ========== Spec =================
> Throws: 
>      NullPointerException - if either one of colors or points is null
> ============== Test.java ===========
> import java.awt.*;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         try {
>             System.err.println("1");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255), false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }            
>         try {
>             System.err.println("2");
>              new GradientPaint(
>                      new Float(-0.0), new Float(-0.0), new Color(255), 
>                      new Float(-0.0), new Float(-0.0), null, false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("3");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), new Color(255), 
>                     new Float(-0.0), new Float(-0.0), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("4");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("5");
>             new GradientPaint(
>                     new Point2D.Float(), new Color(255), 
>                     new Point2D.Float(), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("6");
>             new GradientPaint(
>                     new Point2D.Float(), null, 
>                     new Point2D.Float(), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>     }       
> }
> =========== RI output ===============
> 1
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:9)
> 2
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:17)
> 3
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:25)
> 4
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:33)
> 5
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:41)
> 6
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:49)
> ========== Harmony output ===============
> 1
> 2
> 3
> 4
> 5
> 6

-- 
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] Assigned: (HARMONY-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

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

Mikhail Loenko reassigned HARMONY-1470:
---------------------------------------

    Assignee: Mikhail Loenko

> [classlib][awt] GradientPaint doesn't throw NPE if Color is null
> ----------------------------------------------------------------
>
>                 Key: HARMONY-1470
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1470
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Mikhail Loenko
>         Attachments: 1470-GradientPaint.patch, 1470-GradientPaintTest.patch
>
>
> Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.
> ========== Spec =================
> Throws: 
>      NullPointerException - if either one of colors or points is null
> ============== Test.java ===========
> import java.awt.*;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         try {
>             System.err.println("1");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255), false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }            
>         try {
>             System.err.println("2");
>              new GradientPaint(
>                      new Float(-0.0), new Float(-0.0), new Color(255), 
>                      new Float(-0.0), new Float(-0.0), null, false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("3");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), new Color(255), 
>                     new Float(-0.0), new Float(-0.0), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("4");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("5");
>             new GradientPaint(
>                     new Point2D.Float(), new Color(255), 
>                     new Point2D.Float(), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("6");
>             new GradientPaint(
>                     new Point2D.Float(), null, 
>                     new Point2D.Float(), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>     }       
> }
> =========== RI output ===============
> 1
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:9)
> 2
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:17)
> 3
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:25)
> 4
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:33)
> 5
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:41)
> 6
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:49)
> ========== Harmony output ===============
> 1
> 2
> 3
> 4
> 5
> 6

-- 
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-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

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

Denis Kishenko updated HARMONY-1470:
------------------------------------

    Attachment: 1470-GradientPaintTest.patch

> [classlib][awt] GradientPaint doesn't throw NPE if Color is null
> ----------------------------------------------------------------
>
>                 Key: HARMONY-1470
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1470
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: 1470-GradientPaint.patch, 1470-GradientPaintTest.patch
>
>
> Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.
> ========== Spec =================
> Throws: 
>      NullPointerException - if either one of colors or points is null
> ============== Test.java ===========
> import java.awt.*;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         try {
>             System.err.println("1");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255), false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }            
>         try {
>             System.err.println("2");
>              new GradientPaint(
>                      new Float(-0.0), new Float(-0.0), new Color(255), 
>                      new Float(-0.0), new Float(-0.0), null, false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("3");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), new Color(255), 
>                     new Float(-0.0), new Float(-0.0), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("4");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("5");
>             new GradientPaint(
>                     new Point2D.Float(), new Color(255), 
>                     new Point2D.Float(), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("6");
>             new GradientPaint(
>                     new Point2D.Float(), null, 
>                     new Point2D.Float(), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>     }       
> }
> =========== RI output ===============
> 1
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:9)
> 2
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:17)
> 3
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:25)
> 4
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:33)
> 5
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:41)
> 6
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:49)
> ========== Harmony output ===============
> 1
> 2
> 3
> 4
> 5
> 6

-- 
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] Resolved: (HARMONY-1470) [classlib][awt] GradientPaint doesn't throw NPE if Color is null

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

Mikhail Loenko resolved HARMONY-1470.
-------------------------------------

    Resolution: Fixed

fixed in revision 466036
Denis, please check the patch was applied as expected

> [classlib][awt] GradientPaint doesn't throw NPE if Color is null
> ----------------------------------------------------------------
>
>                 Key: HARMONY-1470
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1470
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Mikhail Loenko
>         Attachments: 1470-GradientPaint.patch, 1470-GradientPaintTest.patch
>
>
> Harmony implementation of GradientPaint constructors doesn't throw NPE if Color parameter is null while RI does.
> ========== Spec =================
> Throws: 
>      NullPointerException - if either one of colors or points is null
> ============== Test.java ===========
> import java.awt.*;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         try {
>             System.err.println("1");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255), false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }            
>         try {
>             System.err.println("2");
>              new GradientPaint(
>                      new Float(-0.0), new Float(-0.0), new Color(255), 
>                      new Float(-0.0), new Float(-0.0), null, false); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("3");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), new Color(255), 
>                     new Float(-0.0), new Float(-0.0), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("4");
>             new GradientPaint(
>                     new Float(-0.0), new Float(-0.0), null, 
>                     new Float(-0.0), new Float(-0.0), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }
>         try {
>             System.err.println("5");
>             new GradientPaint(
>                     new Point2D.Float(), new Color(255), 
>                     new Point2D.Float(), null); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>         try {
>             System.err.println("6");
>             new GradientPaint(
>                     new Point2D.Float(), null, 
>                     new Point2D.Float(), new Color(255)); 
>         } catch (NullPointerException e) {
>             e.printStackTrace();
>         }  
>     }       
> }
> =========== RI output ===============
> 1
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:9)
> 2
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at java.awt.GradientPaint.<init>(GradientPaint.java:131)
>     at Test.main(Test.java:17)
> 3
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:25)
> 4
> java.lang.NullPointerException: Colors cannot be null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:71)
>     at Test.main(Test.java:33)
> 5
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:41)
> 6
> java.lang.NullPointerException: Colors and points should be non-null
>     at java.awt.GradientPaint.<init>(GradientPaint.java:97)
>     at Test.main(Test.java:49)
> ========== Harmony output ===============
> 1
> 2
> 3
> 4
> 5
> 6

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