Browse Source

Polishing

Get rid of exception in positional parameter detection.
issue/4502
Christoph Strobl 2 years ago
parent
commit
1d13be8dc8
No known key found for this signature in database
GPG Key ID: 8CC1AB53391458C8
  1. 14
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java

14
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/QueryMapper.java

@ -1490,6 +1490,10 @@ public class QueryMapper {
static boolean isPositionalParameter(String partial) { static boolean isPositionalParameter(String partial) {
if(!StringUtils.hasText(partial)) {
return false;
}
if ("$".equals(partial)) { if ("$".equals(partial)) {
return true; return true;
} }
@ -1499,12 +1503,12 @@ public class QueryMapper {
return true; return true;
} }
try { for (int i = 0; i < partial.length(); i++) {
Long.valueOf(partial); if (!Character.isDigit(partial.charAt(i))) {
return true; return false;
} catch (NumberFormatException e) { }
return false;
} }
return true;
} }
} }
} }

Loading…
Cancel
Save