In the DataFlavor(String) constructor we checked if a space is contained
in the mime string. My TransferHandler testcases show that space is
actually allowed, like in "application/x-java-jvm-local-objectref;
class=java.lang.String".

I will add a more extensive testcase for that particular case soon, and
commit this for the time beeing so that the TransferHandler tests can
pass.

2006-10-18  Roman Kennke  <[EMAIL PROTECTED]>

        * java/awt/datatransfer/DataFlavor.java
        (DataFlavor(String)): Removed check for space in mime string.

/Roman
Index: java/awt/datatransfer/DataFlavor.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/datatransfer/DataFlavor.java,v
retrieving revision 1.31
diff -u -1 -5 -r1.31 DataFlavor.java
--- java/awt/datatransfer/DataFlavor.java	27 Jun 2006 18:00:02 -0000	1.31
+++ java/awt/datatransfer/DataFlavor.java	18 Oct 2006 09:41:08 -0000
@@ -326,32 +326,31 @@
     humanPresentableName = null;
   }
 
   /**
    * Private constructor.
    */
   private DataFlavor(Class representationClass,
                     String mimeType,
                     String humanPresentableName)
   {
     this.representationClass = representationClass;
     this.mimeType = mimeType;
 
     // Do some simple validity checks
     String type = getPrimaryType() + "/" + getSubType();
-    if (type.indexOf(' ') != -1
-        || type.indexOf('=') != -1
+    if (type.indexOf('=') != -1
         || type.indexOf(';') != -1)
       throw new IllegalArgumentException(mimeType);
 
     if (humanPresentableName != null)
       this.humanPresentableName = humanPresentableName;
     else
       this.humanPresentableName = mimeType;
   }
 
   /**
    * Initializes a new instance of <code>DataFlavor</code>.  The class
    * and human readable name are specified, the MIME type will be
    * "application/x-java-serialized-object". If the human readable name
    * is not specified (<code>null</code>) then the human readable name
    * will be the same as the MIME type.

Reply via email to