geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r179695 - in /geronimo/trunk/specs/javamail/src: java/javax/mail/internet/ParameterList.java test/javax/mail/internet/ParameterListTest.java
Date Fri, 03 Jun 2005 01:45:02 GMT
Author: jboynes
Date: Thu Jun  2 18:45:02 2005
New Revision: 179695

URL: http://svn.apache.org/viewcvs?rev=179695&view=rev
Log:
parameters may be quoted strings

Modified:
    geronimo/trunk/specs/javamail/src/java/javax/mail/internet/ParameterList.java
    geronimo/trunk/specs/javamail/src/test/javax/mail/internet/ParameterListTest.java

Modified: geronimo/trunk/specs/javamail/src/java/javax/mail/internet/ParameterList.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/specs/javamail/src/java/javax/mail/internet/ParameterList.java?rev=179695&r1=179694&r2=179695&view=diff
==============================================================================
--- geronimo/trunk/specs/javamail/src/java/javax/mail/internet/ParameterList.java (original)
+++ geronimo/trunk/specs/javamail/src/java/javax/mail/internet/ParameterList.java Thu Jun
 2 18:45:02 2005
@@ -50,7 +50,11 @@
                     throw new ParseException(parameter);
                 } else {
                     String name = parameter.substring(0, eq);
-                    String value = parameter.substring(eq + 1);
+                    String value = parameter.substring(eq + 1).trim();
+                    if (value.charAt(0) == '"') {
+                        int end = value.lastIndexOf('"');
+                        value = value.substring(1, end);
+                    }
                     set(name, value);
                 }
             }

Modified: geronimo/trunk/specs/javamail/src/test/javax/mail/internet/ParameterListTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/specs/javamail/src/test/javax/mail/internet/ParameterListTest.java?rev=179695&r1=179694&r2=179695&view=diff
==============================================================================
--- geronimo/trunk/specs/javamail/src/test/javax/mail/internet/ParameterListTest.java (original)
+++ geronimo/trunk/specs/javamail/src/test/javax/mail/internet/ParameterListTest.java Thu
Jun  2 18:45:02 2005
@@ -31,4 +31,10 @@
         assertEquals("vulue", list.get("thong"));
         assertEquals("git", list.get("thung"));
     }
+
+    public void testQuotedParameter() throws ParseException {
+        ParameterList list = new ParameterList("foo=one;bar=\"two\"");
+        assertEquals("one", list.get("foo"));
+        assertEquals("two", list.get("bar"));
+    }
 }



Mime
View raw message