harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495864 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/AWTEvent.java test/api/java/common/java/awt/EventTest.java
Date Sat, 13 Jan 2007 10:03:55 GMT
Author: hindessm
Date: Sat Jan 13 02:03:54 2007
New Revision: 495864

URL: http://svn.apache.org/viewvc?view=rev&rev=495864
Log:
Applied patches from "[#HARMONY-2460] [classlib][awt]
MenuItem.dispatchEvent(AWTEvent) throws unspecified NPE".

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventTest.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java?view=diff&rev=495864&r1=495863&r2=495864
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
Sat Jan 13 02:03:54 2007
@@ -292,7 +292,8 @@
         }
 
         long getEventMask(AWTEvent event) {
-            return getEventDescriptor(event).eventMask;
+            final EventDescriptor ed = getEventDescriptor(event);
+            return ed == null ? -1 : ed.eventMask;
         }
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventTest.java?view=diff&rev=495864&r1=495863&r2=495864
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventTest.java
Sat Jan 13 02:03:54 2007
@@ -173,4 +173,18 @@
         assertTrue(evt.shiftDown());
     }
 
+    public void testDispatchEvent() {
+        // Regression test for HARMONY-2460
+        new MenuItem().dispatchEvent(new AWTEventImpl(new Button(), 1));
+    }
+
+    class AWTEventImpl extends AWTEvent {
+        public AWTEventImpl(Object source, int id) {
+            super(source, id);
+        }
+    }
+    
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(EventTest.class);
+    }
 }



Mime
View raw message