@@ -370,26 +370,33 @@ private BindableValue bindableValueFor(JsonToken token) {
370
370
371
371
if (token .getType ().equals (JsonTokenType .UNQUOTED_STRING )) {
372
372
373
- if (matcher .find ()) {
374
-
375
- int index = computeParameterIndex (matcher .group ());
376
- bindableValue .setValue (getBindableValueForIndex (index ));
377
- bindableValue .setType (bsonTypeForValue (getBindableValueForIndex (index )));
378
- return bindableValue ;
379
- }
380
-
381
373
Matcher regexMatcher = EXPRESSION_BINDING_PATTERN .matcher (tokenValue );
382
374
if (regexMatcher .find ()) {
383
375
384
376
String binding = regexMatcher .group ();
385
377
String expression = binding .substring (3 , binding .length () - 1 );
386
378
379
+ Matcher inSpelMatcher = PARAMETER_BINDING_PATTERN .matcher (expression );
380
+ while (inSpelMatcher .find ()) {
381
+
382
+ int index = computeParameterIndex (inSpelMatcher .group ());
383
+ expression = expression .replace (inSpelMatcher .group (), getBindableValueForIndex (index ).toString ());
384
+ }
385
+
387
386
Object value = evaluateExpression (expression );
388
387
bindableValue .setValue (value );
389
388
bindableValue .setType (bsonTypeForValue (value ));
390
389
return bindableValue ;
391
390
}
392
391
392
+ if (matcher .find ()) {
393
+
394
+ int index = computeParameterIndex (matcher .group ());
395
+ bindableValue .setValue (getBindableValueForIndex (index ));
396
+ bindableValue .setType (bsonTypeForValue (getBindableValueForIndex (index )));
397
+ return bindableValue ;
398
+ }
399
+
393
400
bindableValue .setValue (tokenValue );
394
401
bindableValue .setType (BsonType .STRING );
395
402
return bindableValue ;
@@ -398,26 +405,35 @@ private BindableValue bindableValueFor(JsonToken token) {
398
405
399
406
String computedValue = tokenValue ;
400
407
401
- boolean matched = false ;
402
- while (matcher .find ()) {
403
408
404
- matched = true ;
405
- String group = matcher .group ();
406
- int index = computeParameterIndex (group );
407
- computedValue = computedValue .replace (group , nullSafeToString (getBindableValueForIndex (index )));
408
- }
409
409
410
- if (! matched ) {
410
+ Matcher regexMatcher = EXPRESSION_BINDING_PATTERN . matcher ( computedValue );
411
411
412
- Matcher regexMatcher = EXPRESSION_BINDING_PATTERN . matcher ( tokenValue );
412
+ while ( regexMatcher . find ()) {
413
413
414
- while (regexMatcher .find ()) {
414
+ String binding = regexMatcher .group ();
415
+ String expression = binding .substring (3 , binding .length () - 1 );
415
416
416
- String binding = regexMatcher . group ( );
417
- String expression = binding . substring ( 3 , binding . length () - 1 );
417
+ Matcher inSpelMatcher = PARAMETER_BINDING_PATTERN . matcher ( expression );
418
+ while ( inSpelMatcher . find ()) {
418
419
419
- computedValue = computedValue .replace (binding , nullSafeToString (evaluateExpression (expression )));
420
+ int index = computeParameterIndex (inSpelMatcher .group ());
421
+ expression = expression .replace (inSpelMatcher .group (), getBindableValueForIndex (index ).toString ());
420
422
}
423
+
424
+ computedValue = computedValue .replace (binding , nullSafeToString (evaluateExpression (expression )));
425
+
426
+ bindableValue .setValue (computedValue );
427
+ bindableValue .setType (BsonType .STRING );
428
+
429
+ return bindableValue ;
430
+ }
431
+
432
+ while (matcher .find ()) {
433
+
434
+ String group = matcher .group ();
435
+ int index = computeParameterIndex (group );
436
+ computedValue = computedValue .replace (group , nullSafeToString (getBindableValueForIndex (index )));
421
437
}
422
438
423
439
bindableValue .setValue (computedValue );
0 commit comments