harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495707 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/datatransfer/DataFlavor.java test/api/java/common/java/awt/datatransfer/DataFlavorTest.java
Date Fri, 12 Jan 2007 19:46:32 GMT
Author: hindessm
Date: Fri Jan 12 11:46:31 2007
New Revision: 495707

URL: http://svn.apache.org/viewvc?view=rev&rev=495707
Log:
Applied patches from "[#HARMONY-2069] [classlib][awt] DataFlavor.clone()
throws NPE".  I modified the test slightly to allow junit to handle the
exception.

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java?view=diff&rev=495707&r1=495706&r2=495707
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java
Fri Jan 12 11:46:31 2007
@@ -357,7 +357,8 @@
 
         clone.humanPresentableName = humanPresentableName;
         clone.representationClass = representationClass;
-        clone.mimeInfo = (MimeTypeProcessor.MimeType) mimeInfo.clone();
+        clone.mimeInfo = (mimeInfo != null) ? (MimeTypeProcessor.MimeType)
+                mimeInfo.clone() : null;
 
         return clone;
     }

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java?view=diff&rev=495707&r1=495706&r2=495707
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java
Fri Jan 12 11:46:31 2007
@@ -433,4 +433,11 @@
             fail("Regression test failed");
         }
     }
+    
+    public void testCloneNullMimeInfo()
+            throws CloneNotSupportedException,NullPointerException {
+        // Regression for HARMONY-2069
+        DataFlavor df = new DataFlavor();
+        df.clone(); 
+    }
 }



Mime
View raw message