harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495758 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/dnd/DropTargetEvent.java test/api/java/common/java/awt/dnd/DropTargetEventTest.java
Date Fri, 12 Jan 2007 22:07:55 GMT
Author: hindessm
Date: Fri Jan 12 14:07:53 2007
New Revision: 495758

URL: http://svn.apache.org/viewvc?view=rev&rev=495758
Log:
Applied patch from "[#HARMONY-2430] [classlib][awt] DropTargetEvent(null)
throws IAE while RI throws NPE".

Added:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/dnd/DropTargetEventTest.java
  (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DropTargetEvent.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DropTargetEvent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DropTargetEvent.java?view=diff&rev=495758&r1=495757&r2=495758
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DropTargetEvent.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/dnd/DropTargetEvent.java
Fri Jan 12 14:07:53 2007
@@ -36,7 +36,7 @@
     private Point location;
 
     public DropTargetEvent(DropTargetContext dtc) {
-        super(dtc);
+        super(dtc.getDropTarget());
 
         context = dtc;
     }

Added: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/dnd/DropTargetEventTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/dnd/DropTargetEventTest.java?view=auto&rev=495758
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/dnd/DropTargetEventTest.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/dnd/DropTargetEventTest.java
Fri Jan 12 14:07:53 2007
@@ -0,0 +1,29 @@
+package java.awt.dnd;
+
+import junit.framework.TestCase;
+
+public class DropTargetEventTest extends TestCase {
+
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(DropTargetEventTest.class);
+    }
+
+    /**
+     * Test method for
+     * {@link java.awt.dnd.DropTargetEvent#DropTargetEvent(java.awt.dnd.DropTargetContext)}.
+     */
+    public void testDropTargetEventDropTargetContext() {
+        // Regression test for HARMONY-2430
+        try {
+            new DropTargetEvent(null);
+            fail("NPE was not thrown");
+        } catch (NullPointerException ex) {
+            // passed
+        }
+
+        final DropTarget dt = new DropTarget();
+        final DropTargetEvent e = new DropTargetEvent(dt.getDropTargetContext());
+
+        assertSame(dt, e.getSource());
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/dnd/DropTargetEventTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message