@@ -243,7 +243,7 @@ static String expandUriComponent(@Nullable String source, UriTemplateVariables u
243
243
244
244
@ Nullable
245
245
static String expandUriComponent (@ Nullable String source , UriTemplateVariables uriVariables ,
246
- @ Nullable UnaryOperator <String > variableEncoder ) {
246
+ @ Nullable UnaryOperator <String > encoder ) {
247
247
248
248
if (source == null ) {
249
249
return null ;
@@ -258,15 +258,14 @@ static String expandUriComponent(@Nullable String source, UriTemplateVariables u
258
258
StringBuffer sb = new StringBuffer ();
259
259
while (matcher .find ()) {
260
260
String match = matcher .group (1 );
261
- String variableName = getVariableName (match );
262
- Object variablesValue = uriVariables .getValue (variableName );
263
- if (UriTemplateVariables .SKIP_VALUE .equals (variablesValue )) {
261
+ String varName = getVariableName (match );
262
+ Object varValue = uriVariables .getValue (varName );
263
+ if (UriTemplateVariables .SKIP_VALUE .equals (varValue )) {
264
264
continue ;
265
265
}
266
- String formattedValue = getVariableValueAsString (variablesValue );
267
- formattedValue = Matcher .quoteReplacement (formattedValue );
268
- formattedValue = variableEncoder != null ? variableEncoder .apply (formattedValue ) : formattedValue ;
269
- matcher .appendReplacement (sb , formattedValue );
266
+ String formatted = getVariableValueAsString (varValue );
267
+ formatted = encoder != null ? encoder .apply (formatted ) : Matcher .quoteReplacement (formatted );
268
+ matcher .appendReplacement (sb , formatted );
270
269
}
271
270
matcher .appendTail (sb );
272
271
return sb .toString ();
0 commit comments