harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Dolgov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2465) [classlib][awt] java.awt.Component.processEvent(null) throws NPE while RI does not
Date Tue, 05 Dec 2006 13:46:21 GMT
[classlib][awt] java.awt.Component.processEvent(null) throws NPE while RI does not
----------------------------------------------------------------------------------

                 Key: HARMONY-2465
                 URL: http://issues.apache.org/jira/browse/HARMONY-2465
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Pavel Dolgov
            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);
    }     


    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);
        }
    }
}

RI output:
--------------
..
Time: 0,131

OK (2 tests)


Harmony output:
--------------
.E.E
Time: 0.641
There were 2 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:14)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:10)
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:19)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:10)

FAILURES!!!
Tests run: 2,  Failures: 0,  Errors: 2



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

        

Mime
View raw message