harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r466072 - in /incubator/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, 20 Oct 2006 11:37:58 GMT
Author: mloenko
Date: Fri Oct 20 04:37:58 2006
New Revision: 466072

URL: http://svn.apache.org/viewvc?view=rev&rev=466072
Log:
applied patch from HARMONY-1477
Unexpected IAE from DataFlavor.isMimeTypeEqual method when parameter is empty string

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java?view=diff&rev=466072&r1=466071&r2=466072
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/datatransfer/DataFlavor.java
Fri Oct 20 04:37:58 2006
@@ -329,7 +329,7 @@
         try {
             return mimeInfo.equals(MimeTypeProcessor.parse(mimeType));
         } catch (IllegalArgumentException e) {
-            throw new IllegalArgumentException("Can't parse MIME type: " + mimeType);
+            return false;
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java?view=diff&rev=466072&r1=466071&r2=466072
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/datatransfer/DataFlavorTest.java
Fri Oct 20 04:37:58 2006
@@ -422,4 +422,14 @@
         }), new DataFlavor("text/xml; class=java.lang.String; charset=UTF-16", ""));
     }
 
+    public void testHarmony1477Regression() {
+        // Regression for HARMONY-1477
+        DataFlavor df = new DataFlavor();
+        try {
+            assertFalse(df.equals(""));
+            assertFalse(df.isMimeTypeEqual(""));
+        } catch (IllegalArgumentException iae) {
+            fail("Regression test failed");
+        }
+    }
 }



Mime
View raw message