You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vasily Zakharov (JIRA)" <ji...@apache.org> on 2007/03/19 20:01:32 UTC

[jira] Created: (HARMONY-3430) [classlib][swing] DebugGraphics.getClip() throws NPE

[classlib][swing] DebugGraphics.getClip() throws NPE
----------------------------------------------------

                 Key: HARMONY-3430
                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Vasily Zakharov
            Priority: Minor


Consider the following test:

import java.awt.Container;
import javax.swing.DebugGraphics;

public class Test {
    public static void main(String args[]) throws Exception {
        new Container().paint(new DebugGraphics());
        System.out.println("SUCCESS");
    }
}

Output on RI:

SUCCESS

Output on Harmony:

Exception in thread "main" java.lang.NullPointerException
        at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
        at java.awt.Container.paintComponentsImpl(Container.java:996)
        at java.awt.Container.paint(Container.java:936)
        at Test.main(Test.java:6)

The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.

The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.

The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3430) [classlib][swing] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov commented on HARMONY-3430:
------------------------------------------

This issue is similar to HARMONY-3443.


> [classlib][swing] DebugGraphics.getClip() throws NPE
> ----------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov updated HARMONY-3430:
-------------------------------------

    Summary: [classlib][awt] DebugGraphics.getClip() throws NPE  (was: [classlib][swing] DebugGraphics.getClip() throws NPE)

> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3430) [classlib][swing] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov updated HARMONY-3430:
-------------------------------------

    Summary: [classlib][swing] DebugGraphics.getClip() throws NPE  (was: [classlib][awt] DebugGraphics.getClip() throws NPE)

> [classlib][swing] DebugGraphics.getClip() throws NPE
> ----------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Andrey Pavlenko commented on HARMONY-3430:
------------------------------------------

Vasily, this is not awt but swing issue. I think the best resolution is to initialize this field with a valid graphics implementation.
Could you please change the component back to swing?

> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3430) [classlib][swing] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov commented on HARMONY-3430:
------------------------------------------

I'm not sure if this is really necessary, but I think it's a compatibility issue, and we should either fix or close it as a non-bug difference.


> [classlib][swing] DebugGraphics.getClip() throws NPE
> ----------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Alexey Petrenko reassigned HARMONY-3430:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Alexey Petrenko resolved HARMONY-3430.
--------------------------------------

    Resolution: Fixed

The issue fixes as part of HARMONY-3443

> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3430) [classlib][swing] DebugGraphics.getClip() throws NPE

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

Andrey Pavlenko commented on HARMONY-3430:
------------------------------------------

Moreover, the test provided by Vasily also fails if the container is visible. See the following test case:

public void test() {
        final Frame f = new Frame();
        final DebugGraphics g = new DebugGraphics();

        try {
            f.paint(g);
            f.setVisible(true);
            f.paint(g);
        } finally {
            f.dispose();
        }
}

It looks like on RI the method Container.paint() do nothing with the Graphics object in case the container is not visible.
I could create a patch to workaround this issue if it's necessary.


> [classlib][swing] DebugGraphics.getClip() throws NPE
> ----------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov updated HARMONY-3430:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Andrey Pavlenko commented on HARMONY-3430:
------------------------------------------

BTW, new DebugGraphics().getClip(); also throws NPE on RI. It looks like on RI this method is not invoked by Container.paint().

> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov updated HARMONY-3430:
-------------------------------------

    Summary: [classlib][awt] DebugGraphics.getClip() throws NPE  (was: [classlib][swing] DebugGraphics.getClip() throws NPE)

> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov commented on HARMONY-3430:
------------------------------------------

The patch for this issue is available at HARMONY-3443.


> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-3430) [classlib][awt] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov closed HARMONY-3430.
------------------------------------


Verified, closing.


> [classlib][awt] DebugGraphics.getClip() throws NPE
> --------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3430) [classlib][swing] DebugGraphics.getClip() throws NPE

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

Vasily Zakharov commented on HARMONY-3430:
------------------------------------------

Thanks for the investigation, Andrey.

Probably, this issue is about Container.paint() calling Graphics.getClip() ? Is this a correct behaviour?


> [classlib][swing] DebugGraphics.getClip() throws NPE
> ----------------------------------------------------
>
>                 Key: HARMONY-3430
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3430
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>
> Consider the following test:
> import java.awt.Container;
> import javax.swing.DebugGraphics;
> public class Test {
>     public static void main(String args[]) throws Exception {
>         new Container().paint(new DebugGraphics());
>         System.out.println("SUCCESS");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony:
> Exception in thread "main" java.lang.NullPointerException
>         at javax.swing.DebugGraphics.getClip(DebugGraphics.java:769)
>         at java.awt.Container.paintComponentsImpl(Container.java:996)
>         at java.awt.Container.paint(Container.java:936)
>         at Test.main(Test.java:6)
> The reason for that is getClip() references originalGraphics field, that is initialized with null by no-parameter constuctor.
> The same problem also exists for many other DebugGraphics methods that reference originalGraphics directly.
> The proper resolution would be either checking originalGraphics for null each time before using, or initialize originalGraphics with some non-null value. I'm not sure which way is right to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.