Skip to content

changes based on the results of static code analysis by Findbugs #2324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static List<Predicate> getPredicates(String path, CriteriaBuilder cb, Path<?> fr
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a general perspective, we should avoid linebreaks in exceptions. That's something we need to address within the team.

ClassUtils.getShortName(probeType), node));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ private boolean detectUpdatability() {
continue;
}

// may cause NullPointerException if the returned value is null
return (boolean) AnnotationUtils.getValue(annotation, "updatable");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected ClassLoader getConfigurationInspectionClassLoader(ResourceLoader loade
* @return
*/
private static AbstractBeanDefinition getEntityManagerBeanDefinitionFor(RepositoryConfigurationSource config,
@Nullable Object source) {
@Nullable Object source) {

BeanDefinitionBuilder builder = BeanDefinitionBuilder
.rootBeanDefinition("org.springframework.orm.jpa.SharedEntityManagerCreator");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ private String parseParameterBindingsOfQueryIntoBindingsAndReturnCleanedQuery(St
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)) {

Expand All @@ -293,7 +291,7 @@ private String parseParameterBindingsOfQueryIntoBindingsAndReturnCleanedQuery(St
} else {
checkAndRegister(new LikeParameterBinding(parameterName, likeType, expression), bindings);

replacement = expression != null ? ":" + parameterName : matcher.group(5);
replacement = ":" + parameterName;
}

break;
Expand Down