349344 Passing empty query string to UrlEncoded#decodeTo(String, MultiMap, String) does not yield an empty map

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3390 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Michael Gorovoy 2011-06-15 23:55:15 +00:00
parent 30c3934931
commit f886b777e8
3 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,7 @@ jetty-7.4.3-SNAPSHOT
+ 347617 Dynamically install/update/remove OSGi bundles discovered in the contexts folder
+ 347717 start.jar destroys dependent child of --exec
+ 347898 Close channel on JVM exceptions
+ 349344 Passing empty query string to UrlEncoded#decodeTo(String, MultiMap, String) does not yield an empty map
+ JETTY-1342 Recreate selector in change task
+ 347889 OSGi should follow directive visibility:=reexport for META-INF/web-fragments and resources

View File

@ -231,7 +231,10 @@ public class UrlEncoded extends MultiMap
key = encoded
?decodeString(content,mark+1,content.length()-mark-1,charset)
:content.substring(mark+1);
map.add(key,"");
if (key != null && key.length() > 0)
{
map.add(key,"");
}
}
}
}

View File

@ -34,7 +34,11 @@ public class URLEncodedTest
{
UrlEncoded url_encoded = new UrlEncoded();
assertEquals("Empty",0, url_encoded.size());
assertEquals("Initially not empty",0, url_encoded.size());
url_encoded.clear();
url_encoded.decode("");
assertEquals("Not empty after decode(\"\")",0, url_encoded.size());
url_encoded.clear();
url_encoded.decode("Name1=Value1");