Skip to content

Commit b0bbaec

Browse files
committed
Polishing.
See #3373
1 parent 1c57978 commit b0bbaec

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/org/springframework/data/repository/core/RepositoryCreationException.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package org.springframework.data.repository.core;
1717

18+
import org.jspecify.annotations.Nullable;
19+
1820
import org.springframework.dao.InvalidDataAccessApiUsageException;
1921

2022
/**
@@ -34,7 +36,7 @@ public class RepositoryCreationException extends InvalidDataAccessApiUsageExcept
3436
* @param msg the detail message.
3537
* @param repositoryInterface the repository interface.
3638
*/
37-
public RepositoryCreationException(String msg, Class<?> repositoryInterface) {
39+
public RepositoryCreationException(@Nullable String msg, Class<?> repositoryInterface) {
3840
super(msg);
3941
this.repositoryInterface = repositoryInterface;
4042
}
@@ -46,12 +48,13 @@ public RepositoryCreationException(String msg, Class<?> repositoryInterface) {
4648
* @param cause the root cause from the data access API in use.
4749
* @param repositoryInterface the repository interface.
4850
*/
49-
public RepositoryCreationException(String msg, Throwable cause, Class<?> repositoryInterface) {
51+
public RepositoryCreationException(@Nullable String msg, @Nullable Throwable cause, Class<?> repositoryInterface) {
5052
super(msg, cause);
5153
this.repositoryInterface = repositoryInterface;
5254
}
5355

5456
public Class<?> getRepositoryInterface() {
5557
return repositoryInterface;
5658
}
59+
5760
}

src/main/java/org/springframework/data/repository/query/QueryCreationException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public final class QueryCreationException extends RepositoryCreationException {
3232

3333
private static final @Serial long serialVersionUID = -1238456123580L;
34-
private static final String MESSAGE_TEMPLATE = "Could not create query for method [%s]; Could not find property '%s' on domain class '%s'";
34+
private static final String MESSAGE_TEMPLATE = "Cannot create query for method [%s]; Could not find property '%s' on domain class '%s'";
3535

3636
private final Method method;
3737

@@ -139,7 +139,7 @@ public static QueryCreationException create(@Nullable String message, @Nullable
139139
}
140140

141141
private static String createMessage(@Nullable String message, Method method) {
142-
return String.format("Could not create query for [%s]; Reason: %s", method, message);
142+
return String.format("Cannot create query for [%s]; Reason: %s", method, message);
143143
}
144144

145145
/**

0 commit comments

Comments
 (0)