geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r123433 - /geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java /geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java
Date Mon, 27 Dec 2004 17:29:49 GMT
Author: jboynes
Date: Mon Dec 27 09:29:47 2004
New Revision: 123433

URL: http://svn.apache.org/viewcvs?view=rev&rev=123433
Log:
parameter names are case insensitive
Modified:
   geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java
   geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java

Modified: geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java?view=diff&rev=123433&p1=geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java&r1=123432&p2=geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java&r2=123433
==============================================================================
--- geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java	(original)
+++ geronimo/trunk/specs/activation/src/java/javax/activation/MimeTypeParameterList.java	Mon
Dec 27 09:29:47 2004
@@ -48,7 +48,7 @@
             String attribute = parser.expectAttribute();
             parser.expectEquals();
             String value = parser.expectValue();
-            params.put(attribute, value);
+            params.put(attribute.toLowerCase(), value);
         }
     }
 
@@ -61,15 +61,15 @@
     }
 
     public String get(String name) {
-        return (String) params.get(name);
+        return (String) params.get(name.toLowerCase());
     }
 
     public void set(String name, String value) {
-        params.put(name, value);
+        params.put(name.toLowerCase(), value);
     }
 
     public void remove(String name) {
-        params.remove(name);
+        params.remove(name.toLowerCase());
     }
 
     public Enumeration getNames() {

Modified: geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java?view=diff&rev=123433&p1=geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java&r1=123432&p2=geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java&r2=123433
==============================================================================
--- geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java
(original)
+++ geronimo/trunk/specs/activation/src/test/javax/activation/MimeTypeParameterListTest.java
Mon Dec 27 09:29:47 2004
@@ -72,6 +72,20 @@
 		assertEquals("value4", parameterList.get("name4"));
 	}
 
+    public void testCaseInsensitivity() throws MimeTypeParseException {
+        parameterList.parse(";name1=value; NAME2=VALUE; NaMe3=VaLuE");
+        assertEquals(3, parameterList.size());
+        assertEquals("value", parameterList.get("name1"));
+        assertEquals("VALUE", parameterList.get("name2"));
+        assertEquals("VaLuE", parameterList.get("name3"));
+        assertEquals("value", parameterList.get("NAME1"));
+        assertEquals("value", parameterList.get("NaMe1"));
+        parameterList.remove("NAME1");
+        assertNull(parameterList.get("name1"));
+        parameterList.remove("name3");
+        assertEquals("; name2=VALUE", parameterList.toString());
+    }
+
 	public void testNoValueParameterList() {
 		try {
 			parameterList.parse("; name=");

Mime
View raw message