SPR-7314 - RestTemplate does not handle null uri template parameters

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3457 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma
2010-06-24 09:33:06 +00:00
parent 8be57a72a0
commit 04d607cd77
2 changed files with 37 additions and 2 deletions
@@ -125,8 +125,9 @@ public class UriTemplate {
StringBuffer buffer = new StringBuffer();
int i = 0;
while (matcher.find()) {
String uriVariable = uriVariableValues[i++].toString();
matcher.appendReplacement(buffer, Matcher.quoteReplacement(uriVariable));
Object uriVariable = uriVariableValues[i++];
String replacement = Matcher.quoteReplacement(uriVariable != null ? uriVariable.toString() : "");
matcher.appendReplacement(buffer, replacement);
}
matcher.appendTail(buffer);
return encodeUri(buffer.toString());