Minor changes based on FindBugs findings.

Original pull request #2324
This commit is contained in:
dk2k
2021-10-04 17:26:26 +03:00
committed by Jens Schauder
parent 08bcf5571f
commit 65aa03f31c
3 changed files with 3 additions and 4 deletions

View File

@@ -160,7 +160,7 @@ public class QueryByExamplePredicateBuilder {
PathNode node = currentNode.add(attribute.getName(), attributeValue);
if (node.spansCycle()) {
throw new InvalidDataAccessApiUsageException(
String.format("Path '%s' from root %s must not span a cyclic property reference!\r\n%s", currentPath,
String.format("Path '%s' from root %s must not span a cyclic property reference!%n%s", currentPath,
ClassUtils.getShortName(probeType), node));
}

View File

@@ -333,6 +333,7 @@ class JpaPersistentPropertyImpl extends AnnotationBasedPersistentProperty<JpaPer
continue;
}
// may cause NullPointerException if the returned value is null
return (boolean) AnnotationUtils.getValue(annotation, "updatable");
}

View File

@@ -266,8 +266,6 @@ class StringQuery implements DeclaredQuery {
String expression = spelExtractor.getParameter(parameterName == null ? parameterIndexString : parameterName);
String replacement = null;
Assert.isTrue(parameterIndexString != null || parameterName != null, () -> String.format("We need either a name or an index! Offending query string: %s", query));
expressionParameterIndex++;
if ("".equals(parameterIndexString)) {
@@ -293,7 +291,7 @@ class StringQuery implements DeclaredQuery {
} else {
checkAndRegister(new LikeParameterBinding(parameterName, likeType, expression), bindings);
replacement = expression != null ? ":" + parameterName : matcher.group(5);
replacement = ":" + parameterName;
}
break;