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

[jira] Assigned: (HARMONY-2465) [classlib][awt] java.awt.Component.processEvent(null) throws NPE while RI does not

     [ https://issues.apache.org/jira/browse/HARMONY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov reassigned HARMONY-2465:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][awt] java.awt.Component.processEvent(null) throws NPE while RI does not
> ----------------------------------------------------------------------------------
>
>                 Key: HARMONY-2465
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2465
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>
> Test case:
> ----------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.MenuItem;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         TestMenuItem mi = new TestMenuItem();
>         mi.processEvent((AWTEvent) null);
>     }
>     public void testcase2() {
>         TestComponent c = new TestComponent();
>         c.processEvent((AWTEvent) null);
>     }
>     public void testcase3() {
>         TestComponent c = new TestComponent();
>         TestEvent e = new TestEvent(c, 2000);
>         c.processEvent(e);
>     }
>     static class TestMenuItem extends MenuItem {
>         TestMenuItem() {
>             super();
>         }
>         public void processEvent(AWTEvent e) {
>             super.processEvent(e);
>         }
>     }
>     static class TestComponent extends Component {
>         TestComponent() {
>             super();
>         }
>         public void processEvent(AWTEvent e) {
>             super.processEvent(e);
>         }
>     }
>     class TestEvent extends AWTEvent {
>         public TestEvent(Object source, int id) {
>             super(source, id);
>         }
>     }
> }
> RI output:
> --------------
> ...
> Time: 0,111
> OK (3 tests)
> Harmony output:
> --------------
> .E.E.E
> Time: 0.581
> There were 3 errors:
> 1) testcase1(TheTest)java.lang.NullPointerException
> 	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
> 	at java.awt.MenuItem.processEvent(MenuItem.java:367)
> 	at TheTest$TestMenuItem.processEvent(TheTest.java)
> 	at TheTest.testcase1(TheTest.java:15)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:11)
> 2) testcase2(TheTest)java.lang.NullPointerException
> 	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
> 	at java.awt.Component.processEvent(Component.java:3630)
> 	at TheTest$TestComponent.processEvent(TheTest.java)
> 	at TheTest.testcase2(TheTest.java:20)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:11)
> 3) testcase3(TheTest)java.lang.NullPointerException
> 	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
> 	at java.awt.Component.processEvent(Component.java:3630)
> 	at TheTest$TestComponent.processEvent(TheTest.java)
> 	at TheTest.testcase3(TheTest.java:26)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:11)
> FAILURES!!!
> Tests run: 3,  Failures: 0,  Errors: 3

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