Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
Get rid of exception in positional parameter detection.
  • Loading branch information
christophstrobl committed Oct 4, 2023
1 parent 5b67e1e commit 1d13be8
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,10 @@ protected String mapPropertyName(MongoPersistentProperty property) {

static boolean isPositionalParameter(String partial) {

if(!StringUtils.hasText(partial)) {
return false;
}

if ("$".equals(partial)) {
return true;
}
Expand All @@ -1499,12 +1503,12 @@ static boolean isPositionalParameter(String partial) {
return true;
}

try {
Long.valueOf(partial);
return true;
} catch (NumberFormatException e) {
return false;
for (int i = 0; i < partial.length(); i++) {
if (!Character.isDigit(partial.charAt(i))) {
return false;
}
}
return true;
}
}
}
Expand Down

0 comments on commit 1d13be8

Please sign in to comment.