Remove punctuation in Exception messages.

Closes #2566.
This commit is contained in:
John Blum
2022-06-08 12:42:17 -07:00
parent 48790adebb
commit b57eb85a23
77 changed files with 323 additions and 323 deletions

View File

@@ -77,7 +77,7 @@ public class EnversRevisionRepositoryImpl<T, ID, N extends Number & Comparable<N
public EnversRevisionRepositoryImpl(JpaEntityInformation<T, ?> entityInformation,
RevisionEntityInformation revisionEntityInformation, EntityManager entityManager) {
Assert.notNull(revisionEntityInformation, "RevisionEntityInformation must not be null!");
Assert.notNull(revisionEntityInformation, "RevisionEntityInformation must not be null");
this.entityInformation = entityInformation;
this.entityManager = entityManager;
@@ -91,7 +91,7 @@ public class EnversRevisionRepositoryImpl<T, ID, N extends Number & Comparable<N
.setMaxResults(1) //
.getResultList();
Assert.state(singleResult.size() <= 1, "We expect at most one result.");
Assert.state(singleResult.size() <= 1, "We expect at most one result");
if (singleResult.isEmpty()) {
return Optional.empty();
@@ -104,14 +104,14 @@ public class EnversRevisionRepositoryImpl<T, ID, N extends Number & Comparable<N
@SuppressWarnings("unchecked")
public Optional<Revision<N, T>> findRevision(ID id, N revisionNumber) {
Assert.notNull(id, "Identifier must not be null!");
Assert.notNull(revisionNumber, "Revision number must not be null!");
Assert.notNull(id, "Identifier must not be null");
Assert.notNull(revisionNumber, "Revision number must not be null");
List<Object[]> singleResult = (List<Object[]>) createBaseQuery(id) //
.add(AuditEntity.revisionNumber().eq(revisionNumber)) //
.getResultList();
Assert.state(singleResult.size() <= 1, "We expect at most one result.");
Assert.state(singleResult.size() <= 1, "We expect at most one result");
if (singleResult.isEmpty()) {
return Optional.empty();
@@ -185,7 +185,7 @@ public class EnversRevisionRepositoryImpl<T, ID, N extends Number & Comparable<N
Assert.notNull(data, "Data must not be null");
Assert.isTrue( //
data.length == 3, //
() -> String.format("Data must have length three, but has length %d.", data.length));
() -> String.format("Data must have length three, but has length %d", data.length));
Assert.isTrue( //
data[2] instanceof RevisionType, //
() -> String.format("The third array element must be of type Revision type, but is of type %s",

View File

@@ -40,7 +40,7 @@ public class ReflectionRevisionEntityInformation implements RevisionEntityInform
*/
public ReflectionRevisionEntityInformation(Class<?> revisionEntityClass) {
Assert.notNull(revisionEntityClass, "Revision entity type must not be null!");
Assert.notNull(revisionEntityClass, "Revision entity type must not be null");
AnnotationDetectionFieldCallback fieldCallback = new AnnotationDetectionFieldCallback(RevisionNumber.class);
ReflectionUtils.doWithFields(revisionEntityClass, fieldCallback);

View File

@@ -96,9 +96,9 @@ public class QueryByExamplePredicateBuilder {
public static <T> Predicate getPredicate(Root<T> root, CriteriaBuilder cb, Example<T> example,
EscapeCharacter escapeCharacter) {
Assert.notNull(root, "Root must not be null!");
Assert.notNull(cb, "CriteriaBuilder must not be null!");
Assert.notNull(example, "Example must not be null!");
Assert.notNull(root, "Root must not be null");
Assert.notNull(cb, "CriteriaBuilder must not be null");
Assert.notNull(example, "Example must not be null");
ExampleMatcher matcher = example.getMatcher();
@@ -167,7 +167,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!%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

@@ -145,7 +145,7 @@ public class JpaSort extends Sort {
*/
public JpaSort and(@Nullable Direction direction, Attribute<?, ?>... attributes) {
Assert.notNull(attributes, "Attributes must not be null!");
Assert.notNull(attributes, "Attributes must not be null");
return and(direction, paths(attributes));
}
@@ -159,7 +159,7 @@ public class JpaSort extends Sort {
*/
public JpaSort and(@Nullable Direction direction, Path<?, ?>... paths) {
Assert.notNull(paths, "Paths must not be null!");
Assert.notNull(paths, "Paths must not be null");
List<Order> existing = new ArrayList<>();
@@ -179,7 +179,7 @@ public class JpaSort extends Sort {
*/
public JpaSort andUnsafe(@Nullable Direction direction, String... properties) {
Assert.notEmpty(properties, "Properties must not be empty!");
Assert.notEmpty(properties, "Properties must not be empty");
List<Order> orders = new ArrayList<>();
@@ -202,8 +202,8 @@ public class JpaSort extends Sort {
*/
private static Path<?, ?>[] paths(Attribute<?, ?>[] attributes) {
Assert.notNull(attributes, "Attributes must not be null!");
Assert.notEmpty(attributes, "Attributes must not be empty!");
Assert.notNull(attributes, "Attributes must not be null");
Assert.notEmpty(attributes, "Attributes must not be empty");
Path<?, ?>[] paths = new Path[attributes.length];
@@ -233,7 +233,7 @@ public class JpaSort extends Sort {
*/
public static <A extends Attribute<T, S>, T, S> Path<T, S> path(A attribute) {
Assert.notNull(attribute, "Attribute must not be null!");
Assert.notNull(attribute, "Attribute must not be null");
return new Path<>(Collections.singletonList(attribute));
}
@@ -245,7 +245,7 @@ public class JpaSort extends Sort {
*/
public static <P extends PluralAttribute<T, ?, S>, T, S> Path<T, S> path(P attribute) {
Assert.notNull(attribute, "Attribute must not be null!");
Assert.notNull(attribute, "Attribute must not be null");
return new Path<>(Collections.singletonList(attribute));
}
@@ -268,9 +268,9 @@ public class JpaSort extends Sort {
*/
public static JpaSort unsafe(Direction direction, String... properties) {
Assert.notNull(direction, "Direction must not be null!");
Assert.notEmpty(properties, "Properties must not be empty!");
Assert.noNullElements(properties, "Properties must not contain null values!");
Assert.notNull(direction, "Direction must not be null");
Assert.notEmpty(properties, "Properties must not be empty");
Assert.noNullElements(properties, "Properties must not contain null values");
return unsafe(direction, Arrays.asList(properties));
}
@@ -284,7 +284,7 @@ public class JpaSort extends Sort {
*/
public static JpaSort unsafe(Direction direction, List<String> properties) {
Assert.notEmpty(properties, "Properties must not be empty!");
Assert.notEmpty(properties, "Properties must not be empty");
List<Order> orders = new ArrayList<>(properties.size());
@@ -330,7 +330,7 @@ public class JpaSort extends Sort {
private List<Attribute<?, ?>> add(Attribute<?, ?> attribute) {
Assert.notNull(attribute, "Attribute must not be null!");
Assert.notNull(attribute, "Attribute must not be null");
List<Attribute<?, ?>> newAttributes = new ArrayList<Attribute<?, ?>>(attributes.size() + 1);
newAttributes.addAll(attributes);
@@ -415,8 +415,8 @@ public class JpaSort extends Sort {
*/
public Sort withUnsafe(String... properties) {
Assert.notEmpty(properties, "Properties must not be empty!");
Assert.noNullElements(properties, "Properties must not contain null values!");
Assert.notEmpty(properties, "Properties must not be empty");
Assert.noNullElements(properties, "Properties must not contain null values");
List<Order> orders = new ArrayList<>(properties.length);

View File

@@ -44,7 +44,7 @@ public class AuditingBeanFactoryPostProcessor implements BeanFactoryPostProcesso
getBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME, beanFactory);
} catch (NoSuchBeanDefinitionException o_O) {
throw new IllegalStateException(
"Invalid auditing setup! Make sure you've used @EnableJpaAuditing or <jpa:auditing /> correctly!", o_O);
"Invalid auditing setup; Make sure you've used @EnableJpaAuditing or <jpa:auditing /> correctly", o_O);
}
for (String beanName : getEntityManagerFactoryBeanNames(beanFactory)) {

View File

@@ -70,7 +70,7 @@ public class AuditingEntityListener {
*/
public void setAuditingHandler(ObjectFactory<AuditingHandler> auditingHandler) {
Assert.notNull(auditingHandler, "AuditingHandler must not be null!");
Assert.notNull(auditingHandler, "AuditingHandler must not be null");
this.handler = auditingHandler;
}
@@ -83,7 +83,7 @@ public class AuditingEntityListener {
@PrePersist
public void touchForCreate(Object target) {
Assert.notNull(target, "Entity must not be null!");
Assert.notNull(target, "Entity must not be null");
if (handler != null) {
@@ -103,7 +103,7 @@ public class AuditingEntityListener {
@PreUpdate
public void touchForUpdate(Object target) {
Assert.notNull(target, "Entity must not be null!");
Assert.notNull(target, "Entity must not be null");
if (handler != null) {

View File

@@ -54,8 +54,8 @@ public class JpaMetamodelMappingContext
*/
public JpaMetamodelMappingContext(Set<Metamodel> models) {
Assert.notNull(models, "JPA metamodel must not be null!");
Assert.notEmpty(models, "JPA metamodel must not be empty!");
Assert.notNull(models, "JPA metamodel must not be null");
Assert.notEmpty(models, "JPA metamodel must not be empty");
this.models = new Metamodels(models);
this.persistenceProvider = PersistenceProvider.fromMetamodel(models.iterator().next());
@@ -137,7 +137,7 @@ public class JpaMetamodelMappingContext
JpaMetamodel metamodel = getMetamodel(type);
if (metamodel == null) {
throw new IllegalArgumentException(String.format("Required JpaMetamodel not found for %s!", type));
throw new IllegalArgumentException(String.format("Required JpaMetamodel not found for %s", type));
}
return metamodel;

View File

@@ -41,7 +41,7 @@ class JpaPersistentEntityImpl<T> extends BasicPersistentEntity<T, JpaPersistentP
private static final String INVALID_VERSION_ANNOTATION = "%s is annotated with "
+ org.springframework.data.annotation.Version.class.getName() + " but needs to use "
+ jakarta.persistence.Version.class.getName() + " to trigger optimistic locking correctly!";
+ jakarta.persistence.Version.class.getName() + " to trigger optimistic locking correctly";
private final ProxyIdAccessor proxyIdAccessor;
private final JpaMetamodel metamodel;
@@ -58,7 +58,7 @@ class JpaPersistentEntityImpl<T> extends BasicPersistentEntity<T, JpaPersistentP
super(information, null);
Assert.notNull(proxyIdAccessor, "ProxyIdAccessor must not be null!");
Assert.notNull(proxyIdAccessor, "ProxyIdAccessor must not be null");
this.proxyIdAccessor = proxyIdAccessor;
this.metamodel = metamodel;
}
@@ -113,7 +113,7 @@ class JpaPersistentEntityImpl<T> extends BasicPersistentEntity<T, JpaPersistentP
super(entity, bean);
Assert.notNull(proxyIdAccessor, "Proxy identifier accessor must not be null!");
Assert.notNull(proxyIdAccessor, "Proxy identifier accessor must not be null");
this.proxyIdAccessor = proxyIdAccessor;
this.bean = bean;

View File

@@ -99,7 +99,7 @@ class JpaPersistentPropertyImpl extends AnnotationBasedPersistentProperty<JpaPer
super(property, owner, simpleTypeHolder);
Assert.notNull(metamodel, "Metamodel must not be null!");
Assert.notNull(metamodel, "Metamodel must not be null");
this.isAssociation = Lazy.of(() -> super.isAssociation() //
|| ASSOCIATION_ANNOTATIONS.stream().anyMatch(this::isAnnotationPresent));

View File

@@ -61,8 +61,8 @@ abstract class JpaClassUtils {
private static boolean isOfType(Object source, String typeName, @Nullable ClassLoader classLoader) {
Assert.notNull(source, "Source instance must not be null!");
Assert.hasText(typeName, "Target type name must not be null or empty!");
Assert.notNull(source, "Source instance must not be null");
Assert.hasText(typeName, "Target type name must not be null or empty");
try {
return ClassUtils.forName(typeName, classLoader).isInstance(source);

View File

@@ -200,7 +200,7 @@ public enum PersistenceProvider implements QueryExtractor, ProxyIdAccessor {
*/
public static PersistenceProvider fromEntityManager(EntityManager em) {
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(em, "EntityManager must not be null");
Class<?> entityManagerType = em.getDelegate().getClass();
PersistenceProvider cachedProvider = CACHE.get(entityManagerType);
@@ -229,7 +229,7 @@ public enum PersistenceProvider implements QueryExtractor, ProxyIdAccessor {
*/
public static PersistenceProvider fromMetamodel(Metamodel metamodel) {
Assert.notNull(metamodel, "Metamodel must not be null!");
Assert.notNull(metamodel, "Metamodel must not be null");
Class<? extends Metamodel> metamodelType = metamodel.getClass();
PersistenceProvider cachedProvider = CACHE.get(metamodelType);

View File

@@ -60,7 +60,7 @@ class JpaRepositoryBean<T> extends CdiRepositoryBean<T> {
super(qualifiers, repositoryType, beanManager, detector);
Assert.notNull(entityManagerBean, "EntityManager bean must not be null!");
Assert.notNull(entityManagerBean, "EntityManager bean must not be null");
this.entityManagerBean = entityManagerBean;
this.queryRewriterProvider = new BeanManagerQueryRewriterProvider(beanManager);
}

View File

@@ -52,7 +52,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
private final Map<Set<Annotation>, Bean<EntityManager>> entityManagers = new HashMap<>();
public JpaRepositoryExtension() {
LOGGER.info("Activating CDI extension for Spring Data JPA repositories.");
LOGGER.info("Activating CDI extension for Spring Data JPA repositories");
}
/**
@@ -71,7 +71,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
if (type instanceof Class<?> && EntityManager.class.isAssignableFrom((Class<?>) type)) {
Set<Annotation> qualifiers = new HashSet<>(bean.getQualifiers());
if (bean.isAlternative() || !entityManagers.containsKey(qualifiers)) {
LOGGER.debug(String.format("Discovered '%s' with qualifiers %s.", EntityManager.class.getName(), qualifiers));
LOGGER.debug(String.format("Discovered '%s' with qualifiers %s", EntityManager.class.getName(), qualifiers));
entityManagers.put(qualifiers, (Bean<EntityManager>) bean);
}
}
@@ -94,7 +94,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
// Create the bean representing the repository.
CdiRepositoryBean<?> repositoryBean = createRepositoryBean(repositoryType, qualifiers, beanManager);
LOGGER.info(String.format("Registering bean for '%s' with qualifiers %s.", repositoryType.getName(), qualifiers));
LOGGER.info(String.format("Registering bean for '%s' with qualifiers %s", repositoryType.getName(), qualifiers));
// Register the bean to the extension and the container.
registerBean(repositoryBean);
@@ -117,7 +117,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
Bean<EntityManager> entityManagerBean = entityManagers.get(qualifiers);
if (entityManagerBean == null) {
throw new UnsatisfiedResolutionException(String.format("Unable to resolve a bean for '%s' with qualifiers %s.",
throw new UnsatisfiedResolutionException(String.format("Unable to resolve a bean for '%s' with qualifiers %s",
EntityManager.class.getName(), qualifiers));
}

View File

@@ -97,8 +97,8 @@ public class AuditingBeanDefinitionParser implements BeanDefinitionParser {
if (!ClassUtils.isPresent(BEAN_CONFIGURER_ASPECT_CLASS_NAME, getClass().getClassLoader())) {
parserContext.getReaderContext().error(
"Could not configure Spring Data JPA auditing-feature because"
+ " spring-aspects.jar is not on the classpath!\n"
+ "If you want to use auditing please add spring-aspects.jar to the classpath.", element);
+ " spring-aspects.jar is not on the classpath;\n"
+ "If you want to use auditing please add spring-aspects.jar to the classpath", element);
}
RootBeanDefinition def = new RootBeanDefinition();

View File

@@ -70,8 +70,8 @@ class JpaAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
@Override
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
registerBeanConfigurerAspectIfNecessary(registry);
super.registerBeanDefinitions(annotationMetadata, registry);
@@ -106,10 +106,10 @@ class JpaAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
}
if (!ClassUtils.isPresent(BEAN_CONFIGURER_ASPECT_CLASS_NAME, getClass().getClassLoader())) {
throw new BeanDefinitionStoreException(BEAN_CONFIGURER_ASPECT_CLASS_NAME + " not found. \n"
throw new BeanDefinitionStoreException(BEAN_CONFIGURER_ASPECT_CLASS_NAME + " not found; \n"
+ "Could not configure Spring Data JPA auditing-feature because"
+ " spring-aspects.jar is not on the classpath!\n"
+ "If you want to use auditing please add spring-aspects.jar to the classpath.");
+ " spring-aspects.jar is not on the classpath;\n"
+ "If you want to use auditing please add spring-aspects.jar to the classpath");
}
RootBeanDefinition def = new RootBeanDefinition();

View File

@@ -69,7 +69,7 @@ public class JpaMetamodelMappingContextFactoryBean extends AbstractFactoryBean<J
context.initialize();
if (LOG.isDebugEnabled()) {
LOG.debug("Finished initializing JpaMetamodelMappingContext!");
LOG.debug("Finished initializing JpaMetamodelMappingContext");
}
return context;
@@ -83,7 +83,7 @@ public class JpaMetamodelMappingContextFactoryBean extends AbstractFactoryBean<J
private Set<Metamodel> getMetamodels() {
if (beanFactory == null) {
throw new IllegalStateException("BeanFactory must not be null!");
throw new IllegalStateException("BeanFactory must not be null");
}
Collection<EntityManagerFactory> factories = BeanFactoryUtils

View File

@@ -80,8 +80,8 @@ public abstract class AbstractJpaQuery implements RepositoryQuery {
*/
public AbstractJpaQuery(JpaQueryMethod method, EntityManager em) {
Assert.notNull(method, "JpaQueryMethod must not be null!");
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(method, "JpaQueryMethod must not be null");
Assert.notNull(em, "EntityManager must not be null");
this.method = method;
this.em = em;
@@ -198,8 +198,8 @@ public abstract class AbstractJpaQuery implements RepositoryQuery {
*/
protected <T extends Query> void applyQueryHint(T query, QueryHint hint) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(hint, "QueryHint must not be null!");
Assert.notNull(query, "Query must not be null");
Assert.notNull(hint, "QueryHint must not be null");
query.setHint(hint.name(), hint.value());
}
@@ -297,7 +297,7 @@ public abstract class AbstractJpaQuery implements RepositoryQuery {
*/
public TupleConverter(ReturnedType type) {
Assert.notNull(type, "Returned type must not be null!");
Assert.notNull(type, "Returned type must not be null");
this.type = type;
}
@@ -333,7 +333,7 @@ public abstract class AbstractJpaQuery implements RepositoryQuery {
*/
private static class TupleBackedMap implements Map<String, Object> {
private static final String UNMODIFIABLE_MESSAGE = "A TupleBackedMap cannot be modified.";
private static final String UNMODIFIABLE_MESSAGE = "A TupleBackedMap cannot be modified";
private final Tuple tuple;

View File

@@ -70,10 +70,10 @@ abstract class AbstractStringBasedJpaQuery extends AbstractJpaQuery {
super(method, em);
Assert.hasText(queryString, "Query string must not be null or empty!");
Assert.notNull(evaluationContextProvider, "ExpressionEvaluationContextProvider must not be null!");
Assert.notNull(parser, "Parser must not be null!");
Assert.notNull(queryRewriter, "QueryRewriter must not be null!");
Assert.hasText(queryString, "Query string must not be null or empty");
Assert.notNull(evaluationContextProvider, "ExpressionEvaluationContextProvider must not be null");
Assert.notNull(parser, "Parser must not be null");
Assert.notNull(queryRewriter, "QueryRewriter must not be null");
this.evaluationContextProvider = evaluationContextProvider;
this.query = new ExpressionBasedStringQuery(queryString, method.getEntityInformation(), parser,
@@ -87,7 +87,7 @@ abstract class AbstractStringBasedJpaQuery extends AbstractJpaQuery {
this.queryRewriter = queryRewriter;
Assert.isTrue(method.isNativeQuery() || !query.usesJdbcStyleParameters(),
"JDBC style parameters (?) are not supported for JPA queries.");
"JDBC style parameters (?) are not supported for JPA queries");
}
@Override

View File

@@ -38,7 +38,7 @@ public class DefaultJpaEntityMetadata<T> implements JpaEntityMetadata<T> {
*/
public DefaultJpaEntityMetadata(Class<T> domainType) {
Assert.notNull(domainType, "Domain type must not be null!");
Assert.notNull(domainType, "Domain type must not be null");
this.domainType = domainType;
}

View File

@@ -67,7 +67,7 @@ class EmptyDeclaredQuery implements DeclaredQuery {
@Override
public DeclaredQuery deriveCountQuery(@Nullable String countQuery, @Nullable String countQueryProjection) {
Assert.hasText(countQuery, "CountQuery must not be empty!");
Assert.hasText(countQuery, "CountQuery must not be empty");
return DeclaredQuery.of(countQuery, false);
}

View File

@@ -85,9 +85,9 @@ class ExpressionBasedStringQuery extends StringQuery {
private static String renderQueryIfExpressionOrReturnQuery(String query, JpaEntityMetadata<?> metadata,
SpelExpressionParser parser) {
Assert.notNull(query, "query must not be null!");
Assert.notNull(metadata, "metadata must not be null!");
Assert.notNull(parser, "parser must not be null!");
Assert.notNull(query, "query must not be null");
Assert.notNull(metadata, "metadata must not be null");
Assert.notNull(parser, "parser must not be null");
if (!containsExpression(query)) {
return query;

View File

@@ -96,7 +96,7 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
public String applySorting(Sort sort, @Nullable String alias) {
String queryString = query.getQueryString();
Assert.hasText(queryString, "Query must not be null or empty!");
Assert.hasText(queryString, "Query must not be null or empty");
if (this.parsedType != ParsedType.SELECT) {
return queryString;
@@ -284,7 +284,7 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
return this.query.getQueryString();
}
Assert.hasText(this.query.getQueryString(), "OriginalQuery must not be null or empty!");
Assert.hasText(this.query.getQueryString(), "OriginalQuery must not be null or empty");
Select selectStatement = parseSelectStatement(this.query.getQueryString());
PlainSelect selectBody = (PlainSelect) selectStatement.getSelectBody();
@@ -333,7 +333,7 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
return "";
}
Assert.hasText(query.getQueryString(), "Query must not be null or empty!");
Assert.hasText(query.getQueryString(), "Query must not be null or empty");
Select selectStatement = parseSelectStatement(query.getQueryString());
PlainSelect selectBody = (PlainSelect) selectStatement.getSelectBody();
@@ -360,7 +360,7 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
try {
return (Select) CCJSqlParserUtil.parse(query);
} catch (JSQLParserException e) {
throw new IllegalArgumentException("The query you provided is not a valid SQL Query!", e);
throw new IllegalArgumentException("The query you provided is not a valid SQL Query", e);
}
}

View File

@@ -96,13 +96,13 @@ public class Jpa21Utils {
@Nullable
private static EntityGraph<?> tryGetFetchGraph(EntityManager em, JpaEntityGraph jpaEntityGraph, Class<?> entityType) {
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(jpaEntityGraph, "EntityGraph must not be null!");
Assert.notNull(entityType, "EntityType must not be null!");
Assert.notNull(em, "EntityManager must not be null");
Assert.notNull(jpaEntityGraph, "EntityGraph must not be null");
Assert.notNull(entityType, "EntityType must not be null");
Assert.isTrue(JPA21_AVAILABLE, "The EntityGraph-Feature requires at least a JPA 2.1 persistence provider!");
Assert.isTrue(JPA21_AVAILABLE, "The EntityGraph-Feature requires at least a JPA 2.1 persistence provider");
Assert.isTrue(GET_ENTITY_GRAPH_METHOD != null,
"It seems that you have the JPA 2.1 API but a JPA 2.0 implementation on the classpath!");
"It seems that you have the JPA 2.1 API but a JPA 2.0 implementation on the classpath");
try {
// first check whether an entityGraph with that name is already registered.
@@ -125,10 +125,10 @@ public class Jpa21Utils {
private static EntityGraph<?> createDynamicEntityGraph(EntityManager em, JpaEntityGraph jpaEntityGraph,
Class<?> entityType) {
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(jpaEntityGraph, "JpaEntityGraph must not be null!");
Assert.notNull(entityType, "Entity type must not be null!");
Assert.isTrue(jpaEntityGraph.isAdHocEntityGraph(), "The given " + jpaEntityGraph + " is not dynamic!");
Assert.notNull(em, "EntityManager must not be null");
Assert.notNull(jpaEntityGraph, "JpaEntityGraph must not be null");
Assert.notNull(entityType, "Entity type must not be null");
Assert.isTrue(jpaEntityGraph.isAdHocEntityGraph(), "The given " + jpaEntityGraph + " is not dynamic");
EntityGraph<?> entityGraph = em.createEntityGraph(entityType);
configureFetchGraphFrom(jpaEntityGraph, entityGraph);

View File

@@ -60,8 +60,8 @@ public class JpaEntityGraph {
*/
public JpaEntityGraph(String name, EntityGraphType type, @Nullable String[] attributePaths) {
Assert.hasText(name, "The name of an EntityGraph must not be null or empty!");
Assert.notNull(type, "FetchGraphType must not be null!");
Assert.hasText(name, "The name of an EntityGraph must not be null or empty");
Assert.notNull(type, "FetchGraphType must not be null");
this.name = name;
this.type = type;

View File

@@ -85,7 +85,7 @@ public class JpaParameters extends Parameters<JpaParameters, JpaParameter> {
if (!isDateParameter() && hasTemporalParamAnnotation()) {
throw new IllegalArgumentException(
Temporal.class.getSimpleName() + " annotation is only allowed on Date parameter!");
Temporal.class.getSimpleName() + " annotation is only allowed on Date parameter");
}
}
@@ -127,7 +127,7 @@ public class JpaParameters extends Parameters<JpaParameters, JpaParameter> {
return temporalType;
}
throw new IllegalStateException(String.format("Required temporal type not found for %s!", getType()));
throw new IllegalStateException(String.format("Required temporal type not found for %s", getType()));
}
private boolean hasTemporalParamAnnotation() {

View File

@@ -225,8 +225,8 @@ public class JpaQueryCreator extends AbstractQueryCreator<CriteriaQuery<? extend
*/
public PredicateBuilder(Part part, Root<?> root) {
Assert.notNull(part, "Part must not be null!");
Assert.notNull(root, "Root must not be null!");
Assert.notNull(part, "Part must not be null");
Assert.notNull(root, "Root must not be null");
this.part = part;
this.root = root;
}
@@ -312,7 +312,7 @@ public class JpaQueryCreator extends AbstractQueryCreator<CriteriaQuery<? extend
case IS_NOT_EMPTY:
if (!property.getLeafProperty().isCollection()) {
throw new IllegalArgumentException("IsEmpty / IsNotEmpty can only be used on collection properties!");
throw new IllegalArgumentException("IsEmpty / IsNotEmpty can only be used on collection properties");
}
Expression<Collection<Object>> collectionPath = traversePath(root, property);

View File

@@ -81,8 +81,8 @@ public abstract class JpaQueryExecution {
@Nullable
public Object execute(AbstractJpaQuery query, JpaParametersParameterAccessor accessor) {
Assert.notNull(query, "AbstractJpaQuery must not be null!");
Assert.notNull(accessor, "JpaParametersParameterAccessor must not be null!");
Assert.notNull(query, "AbstractJpaQuery must not be null");
Assert.notNull(accessor, "JpaParametersParameterAccessor must not be null");
Object result;
@@ -211,7 +211,7 @@ public abstract class JpaQueryExecution {
*/
public ModifyingExecution(JpaQueryMethod method, EntityManager em) {
Assert.notNull(em, "The EntityManager must not be null.");
Assert.notNull(em, "The EntityManager must not be null");
Class<?> returnType = method.getReturnType();
@@ -219,7 +219,7 @@ public abstract class JpaQueryExecution {
boolean isInt = ClassUtils.isAssignable(returnType, Integer.class);
Assert.isTrue(isInt || isVoid,
"Modifying queries can only use void or int/Integer as return type! Offending method: " + method);
"Modifying queries can only use void or int/Integer as return type; Offending method: " + method);
this.em = em;
this.flush = method.getFlushAutomatically();
@@ -294,7 +294,7 @@ public abstract class JpaQueryExecution {
*/
static class ProcedureExecution extends JpaQueryExecution {
private static final String NO_SURROUNDING_TRANSACTION = "You're trying to execute a @Procedure method without a surrounding transaction that keeps the connection open so that the ResultSet can actually be consumed. Make sure the consumer code uses @Transactional or any other way of declaring a (read-only) transaction.";
private static final String NO_SURROUNDING_TRANSACTION = "You're trying to execute a @Procedure method without a surrounding transaction that keeps the connection open so that the ResultSet can actually be consumed; Make sure the consumer code uses @Transactional or any other way of declaring a (read-only) transaction";
@Override
protected Object doExecute(AbstractJpaQuery jpaQuery, JpaParametersParameterAccessor accessor) {
@@ -331,7 +331,7 @@ public abstract class JpaQueryExecution {
*/
static class StreamExecution extends JpaQueryExecution {
private static final String NO_SURROUNDING_TRANSACTION = "You're trying to execute a streaming query method without a surrounding transaction that keeps the connection open so that the Stream can actually be consumed. Make sure the code consuming the stream uses @Transactional or any other way of declaring a (read-only) transaction.";
private static final String NO_SURROUNDING_TRANSACTION = "You're trying to execute a streaming query method without a surrounding transaction that keeps the connection open so that the Stream can actually be consumed; Make sure the code consuming the stream uses @Transactional or any other way of declaring a (read-only) transaction";
private static Method streamMethod = ReflectionUtils.findMethod(Query.class, "getResultStream");

View File

@@ -80,8 +80,8 @@ public final class JpaQueryLookupStrategy {
public AbstractQueryLookupStrategy(EntityManager em, JpaQueryMethodFactory queryMethodFactory,
QueryRewriterProvider queryRewriterProvider) {
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(queryMethodFactory, "JpaQueryMethodFactory must not be null!");
Assert.notNull(em, "EntityManager must not be null");
Assert.notNull(queryMethodFactory, "JpaQueryMethodFactory must not be null");
this.em = em;
this.queryMethodFactory = queryMethodFactory;
@@ -164,7 +164,7 @@ public final class JpaQueryLookupStrategy {
if (method.hasAnnotatedQueryName()) {
LOG.warn(String.format(
"Query method %s is annotated with both, a query and a query name. Using the declared query.", method));
"Query method %s is annotated with both, a query and a query name; Using the declared query", method));
}
return JpaQueryFactory.INSTANCE.fromMethodWithQueryString(method, em, method.getRequiredAnnotatedQuery(),
@@ -238,8 +238,8 @@ public final class JpaQueryLookupStrategy {
super(em, queryMethodFactory, queryRewriterProvider);
Assert.notNull(createStrategy, "CreateQueryLookupStrategy must not be null!");
Assert.notNull(lookupStrategy, "DeclaredQueryLookupStrategy must not be null!");
Assert.notNull(createStrategy, "CreateQueryLookupStrategy must not be null");
Assert.notNull(lookupStrategy, "DeclaredQueryLookupStrategy must not be null");
this.createStrategy = createStrategy;
this.lookupStrategy = lookupStrategy;
@@ -272,8 +272,8 @@ public final class JpaQueryLookupStrategy {
@Nullable Key key, QueryMethodEvaluationContextProvider evaluationContextProvider,
QueryRewriterProvider queryRewriterProvider, EscapeCharacter escape) {
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");
Assert.notNull(em, "EntityManager must not be null");
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null");
switch (key != null ? key : Key.CREATE_IF_NOT_FOUND) {
case CREATE:
@@ -287,7 +287,7 @@ public final class JpaQueryLookupStrategy {
new DeclaredQueryLookupStrategy(em, queryMethodFactory, evaluationContextProvider, queryRewriterProvider),
queryRewriterProvider);
default:
throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s!", key));
throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s", key));
}
}

View File

@@ -108,8 +108,8 @@ public class JpaQueryMethod extends QueryMethod {
super(method, metadata, factory);
Assert.notNull(method, "Method must not be null!");
Assert.notNull(extractor, "Query extractor must not be null!");
Assert.notNull(method, "Method must not be null");
Assert.notNull(extractor, "Query extractor must not be null");
this.method = method;
this.returnType = potentiallyUnwrapReturnTypeFor(metadata, method);
@@ -137,7 +137,7 @@ public class JpaQueryMethod extends QueryMethod {
this.entityMetadata = Lazy.of(() -> new DefaultJpaEntityMetadata<>(getDomainClass()));
Assert.isTrue(!(isModifyingQuery() && getParameters().hasSpecialParameter()),
String.format("Modifying method must not contain %s!", Parameters.TYPES));
String.format("Modifying method must not contain %s", Parameters.TYPES));
assertParameterNamesInAnnotatedQuery();
}
@@ -171,7 +171,7 @@ public class JpaQueryMethod extends QueryMethod {
|| !annotatedQuery.contains(String.format(":%s", parameter.getName().get()))
&& !annotatedQuery.contains(String.format("#%s", parameter.getName().get()))) {
throw new IllegalStateException(
String.format("Using named parameters for method %s but parameter '%s' not found in annotated query '%s'!",
String.format("Using named parameters for method %s but parameter '%s' not found in annotated query '%s'",
method, parameter.getName(), annotatedQuery));
}
}
@@ -295,7 +295,7 @@ public class JpaQueryMethod extends QueryMethod {
return query;
}
throw new IllegalStateException(String.format("No annotated query found for query method %s!", getName()));
throw new IllegalStateException(String.format("No annotated query found for query method %s", getName()));
}
/**

View File

@@ -71,13 +71,13 @@ final class JpaResultConverters {
}
} catch (SQLException | IOException e) {
throw new DataRetrievalFailureException("Couldn't retrieve data from blob.", e);
throw new DataRetrievalFailureException("Couldn't retrieve data from blob", e);
} finally {
if (blobStream != null) {
try {
blobStream.close();
} catch (IOException e) {
throw new CleanupFailureDataAccessException("Couldn't close binary stream for given blob.", e);
throw new CleanupFailureDataAccessException("Couldn't close binary stream for given blob", e);
}
}
}

View File

@@ -40,9 +40,9 @@ import org.springframework.lang.Nullable;
final class NamedQuery extends AbstractJpaQuery {
private static final String CANNOT_EXTRACT_QUERY = "Your persistence provider does not support extracting the JPQL query from a "
+ "named query thus you can't use Pageable inside your query method. Make sure you "
+ "named query thus you can't use Pageable inside your query method; Make sure you "
+ "have a JpaDialect configured at your EntityManagerFactoryBean as this affects "
+ "discovering the concrete persistence provider.";
+ "discovering the concrete persistence provider";
private static final Log LOG = LogFactory.getLog(NamedQuery.class);
@@ -69,8 +69,8 @@ final class NamedQuery extends AbstractJpaQuery {
Parameters<?, ?> parameters = method.getParameters();
if (parameters.hasSortParameter()) {
throw new IllegalStateException(String.format("Finder method %s is backed " + "by a NamedQuery and must "
+ "not contain a sort parameter as we cannot modify the query! Use @Query instead!", method));
throw new IllegalStateException(String.format("Finder method %s is backed by a NamedQuery and must "
+ "not contain a sort parameter as we cannot modify the query; Use @Query instead", method));
}
this.namedCountQueryIsPresent = hasNamedQuery(em, countQueryName);
@@ -89,7 +89,7 @@ final class NamedQuery extends AbstractJpaQuery {
if (parameters.hasPageableParameter()) {
LOG.warn(String.format(
"Finder method %s is backed by a NamedQuery but contains a Pageable parameter! Sorting delivered via this Pageable will not be applied!",
"Finder method %s is backed by a NamedQuery but contains a Pageable parameter; Sorting delivered via this Pageable will not be applied",
method));
}
@@ -149,7 +149,7 @@ final class NamedQuery extends AbstractJpaQuery {
RepositoryQuery query = new NamedQuery(method, em);
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Found named query %s!", queryName));
LOG.debug(String.format("Found named query %s", queryName));
}
return query;
} catch (IllegalArgumentException e) {

View File

@@ -33,7 +33,7 @@ import org.springframework.util.Assert;
*/
public class ParameterBinder {
static final String PARAMETER_NEEDS_TO_BE_NAMED = "For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.";
static final String PARAMETER_NEEDS_TO_BE_NAMED = "For queries with named parameters you need to use provide names for method parameters; Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters";
private final JpaParameters parameters;
private final Iterable<QueryParameterSetter> parameterSetters;
@@ -62,8 +62,8 @@ public class ParameterBinder {
public ParameterBinder(JpaParameters parameters, Iterable<QueryParameterSetter> parameterSetters,
boolean useJpaForPaging) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(parameterSetters, "Parameter setters must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
Assert.notNull(parameterSetters, "Parameter setters must not be null");
this.parameters = parameters;
this.parameterSetters = parameterSetters;

View File

@@ -44,7 +44,7 @@ class ParameterBinderFactory {
*/
static ParameterBinder createBinder(JpaParameters parameters) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
QueryParameterSetterFactory setterFactory = QueryParameterSetterFactory.basic(parameters);
List<ParameterBinding> bindings = getBindings(parameters);
@@ -63,8 +63,8 @@ class ParameterBinderFactory {
*/
static ParameterBinder createCriteriaBinder(JpaParameters parameters, List<ParameterMetadata<?>> metadata) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(metadata, "Parameter metadata must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
Assert.notNull(metadata, "Parameter metadata must not be null");
QueryParameterSetterFactory setterFactory = QueryParameterSetterFactory.forCriteriaQuery(parameters, metadata);
List<ParameterBinding> bindings = getBindings(parameters);
@@ -87,10 +87,10 @@ class ParameterBinderFactory {
static ParameterBinder createQueryAwareBinder(JpaParameters parameters, DeclaredQuery query,
SpelExpressionParser parser, QueryMethodEvaluationContextProvider evaluationContextProvider) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(query, "StringQuery must not be null!");
Assert.notNull(parser, "SpelExpressionParser must not be null!");
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
Assert.notNull(query, "StringQuery must not be null");
Assert.notNull(parser, "SpelExpressionParser must not be null");
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null");
List<ParameterBinding> bindings = query.getParameterBindings();
QueryParameterSetterFactory expressionSetterFactory = QueryParameterSetterFactory.parsing(parser,

View File

@@ -96,9 +96,9 @@ class ParameterMetadataProvider {
private ParameterMetadataProvider(CriteriaBuilder builder, @Nullable Iterator<Object> bindableParameterValues,
Parameters<?, ?> parameters, EscapeCharacter escape) {
Assert.notNull(builder, "CriteriaBuilder must not be null!");
Assert.notNull(parameters, "Parameters must not be null!");
Assert.notNull(escape, "EscapeCharacter must not be null!");
Assert.notNull(builder, "CriteriaBuilder must not be null");
Assert.notNull(parameters, "Parameters must not be null");
Assert.notNull(escape, "EscapeCharacter must not be null");
this.builder = builder;
this.parameters = parameters.getBindableParameters().iterator();
@@ -122,7 +122,7 @@ class ParameterMetadataProvider {
@SuppressWarnings("unchecked")
public <T> ParameterMetadata<T> next(Part part) {
Assert.isTrue(parameters.hasNext(), () -> String.format("No parameter available for part %s.", part));
Assert.isTrue(parameters.hasNext(), () -> String.format("No parameter available for part %s", part));
Parameter parameter = parameters.next();
return (ParameterMetadata<T>) next(part, parameter.getType(), parameter);
@@ -155,7 +155,7 @@ class ParameterMetadataProvider {
*/
private <T> ParameterMetadata<T> next(Part part, Class<T> type, Parameter parameter) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
/*
* We treat Expression types as Object vales since the real value to be bound as a parameter is determined at query time.
@@ -233,7 +233,7 @@ class ParameterMetadataProvider {
@Nullable
public Object prepare(Object value) {
Assert.notNull(value, "Value must not be null!");
Assert.notNull(value, "Value must not be null");
Class<? extends T> expressionType = expression.getJavaType();

View File

@@ -93,7 +93,7 @@ public class PartTreeJpaQuery extends AbstractJpaQuery {
} catch (Exception o_O) {
throw new IllegalArgumentException(
String.format("Failed to create query for method %s! %s", method, o_O.getMessage()), o_O);
String.format("Failed to create query for method %s; %s", method, o_O.getMessage()), o_O);
}
}
@@ -147,7 +147,7 @@ public class PartTreeJpaQuery extends AbstractJpaQuery {
if (!parameters.getBindableParameters().hasParameterAt(index)) {
throw new IllegalStateException(String.format(
"Method %s expects at least %d arguments but only found %d. This leaves an operator of type %s for property %s unbound.",
"Method %s expects at least %d arguments but only found %d; This leaves an operator of type %s for property %s unbound",
methodName, index + 1, index, type.name(), property));
}
@@ -163,7 +163,7 @@ public class PartTreeJpaQuery extends AbstractJpaQuery {
private static String wrongParameterTypeMessage(String methodName, String property, Type operatorType,
String expectedArgumentType, JpaParameter parameter) {
return String.format("Operator %s on %s requires a %s argument, found %s in method %s.", operatorType.name(),
return String.format("Operator %s on %s requires a %s argument, found %s in method %s", operatorType.name(),
property, expectedArgumentType, parameter.getType(), methodName);
}
@@ -223,7 +223,7 @@ public class PartTreeJpaQuery extends AbstractJpaQuery {
}
if (parameterBinder == null) {
throw new IllegalStateException("ParameterBinder is null!");
throw new IllegalStateException("ParameterBinder is null");
}
TypedQuery<?> query = createQuery(criteriaQuery);

View File

@@ -68,7 +68,7 @@ public final class QueryEnhancerFactory {
try {
Class.forName("net.sf.jsqlparser.parser.JSqlParser", false, QueryEnhancerFactory.class.getClassLoader());
LOG.info("JSqlParser is in classpath. If applicable JSqlParser will be used.");
LOG.info("JSqlParser is in classpath; If applicable JSqlParser will be used");
return true;
} catch (ClassNotFoundException e) {
return false;

View File

@@ -67,7 +67,7 @@ interface QueryParameterSetter {
NamedOrIndexedQueryParameterSetter(Function<JpaParametersParameterAccessor, Object> valueExtractor,
Parameter<?> parameter, @Nullable TemporalType temporalType) {
Assert.notNull(valueExtractor, "ValueExtractor must not be null!");
Assert.notNull(valueExtractor, "ValueExtractor must not be null");
this.valueExtractor = valueExtractor;
this.parameter = parameter;
@@ -275,7 +275,7 @@ interface QueryParameterSetter {
} catch (RuntimeException e) {
LogFactory.getLog(QueryMetadata.class).warn("Failed to unwrap actual class for Query proxy.", e);
LogFactory.getLog(QueryMetadata.class).warn("Failed to unwrap actual class for Query proxy", e);
return queryType;
}

View File

@@ -57,7 +57,7 @@ abstract class QueryParameterSetterFactory {
*/
static QueryParameterSetterFactory basic(JpaParameters parameters) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
return new BasicQueryParameterSetterFactory(parameters);
}
@@ -72,8 +72,8 @@ abstract class QueryParameterSetterFactory {
*/
static QueryParameterSetterFactory forCriteriaQuery(JpaParameters parameters, List<ParameterMetadata<?>> metadata) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(metadata, "ParameterMetadata must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
Assert.notNull(metadata, "ParameterMetadata must not be null");
return new CriteriaQueryParameterSetterFactory(parameters, metadata);
}
@@ -91,9 +91,9 @@ abstract class QueryParameterSetterFactory {
static QueryParameterSetterFactory parsing(SpelExpressionParser parser,
QueryMethodEvaluationContextProvider evaluationContextProvider, Parameters<?, ?> parameters) {
Assert.notNull(parser, "SpelExpressionParser must not be null!");
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");
Assert.notNull(parameters, "Parameters must not be null!");
Assert.notNull(parser, "SpelExpressionParser must not be null");
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null");
Assert.notNull(parameters, "Parameters must not be null");
return new ExpressionBasedQueryParameterSetterFactory(parser, evaluationContextProvider, parameters);
}
@@ -138,9 +138,9 @@ abstract class QueryParameterSetterFactory {
ExpressionBasedQueryParameterSetterFactory(SpelExpressionParser parser,
QueryMethodEvaluationContextProvider evaluationContextProvider, Parameters<?, ?> parameters) {
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");
Assert.notNull(parser, "SpelExpressionParser must not be null!");
Assert.notNull(parameters, "Parameters must not be null!");
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null");
Assert.notNull(parser, "SpelExpressionParser must not be null");
Assert.notNull(parameters, "Parameters must not be null");
this.evaluationContextProvider = evaluationContextProvider;
this.parser = parser;
@@ -192,7 +192,7 @@ abstract class QueryParameterSetterFactory {
*/
BasicQueryParameterSetterFactory(JpaParameters parameters) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
this.parameters = parameters;
}
@@ -200,7 +200,7 @@ abstract class QueryParameterSetterFactory {
@Override
public QueryParameterSetter create(ParameterBinding binding, DeclaredQuery declaredQuery) {
Assert.notNull(binding, "Binding must not be null.");
Assert.notNull(binding, "Binding must not be null");
JpaParameter parameter;
@@ -214,7 +214,7 @@ abstract class QueryParameterSetterFactory {
Assert.isTrue( //
parameterIndex < bindableParameters.getNumberOfParameters(), //
() -> String.format( //
"At least %s parameter(s) provided but only %s parameter(s) present in query.", //
"At least %s parameter(s) provided but only %s parameter(s) present in query", //
binding.getRequiredPosition(), //
bindableParameters.getNumberOfParameters() //
) //
@@ -271,8 +271,8 @@ abstract class QueryParameterSetterFactory {
*/
CriteriaQueryParameterSetterFactory(JpaParameters parameters, List<ParameterMetadata<?>> metadata) {
Assert.notNull(parameters, "JpaParameters must not be null!");
Assert.notNull(metadata, "Expressions must not be null!");
Assert.notNull(parameters, "JpaParameters must not be null");
Assert.notNull(metadata, "Expressions must not be null");
this.parameters = parameters;
this.expressions = metadata;
@@ -286,7 +286,7 @@ abstract class QueryParameterSetterFactory {
Assert.isTrue( //
parameterIndex < expressions.size(), //
() -> String.format( //
"At least %s parameter(s) provided but only %s parameter(s) present in query.", //
"At least %s parameter(s) provided but only %s parameter(s) present in query", //
binding.getRequiredPosition(), //
expressions.size() //
) //
@@ -372,7 +372,7 @@ abstract class QueryParameterSetterFactory {
}
return parameter.isNamedParameter() //
? parameter.getName().orElseThrow(() -> new IllegalArgumentException("o_O parameter needs to have a name!")) //
? parameter.getName().orElseThrow(() -> new IllegalArgumentException("o_O parameter needs to have a name")) //
: null;
}
}

View File

@@ -133,8 +133,8 @@ public abstract class QueryUtils {
private static final Pattern FIELD_ALIAS_PATTERN;
private static final String UNSAFE_PROPERTY_REFERENCE = "Sort expression '%s' must only contain property references or "
+ "aliases used in the select clause. If you really want to use something other than that for sorting, please use "
+ "JpaSort.unsafe(…)!";
+ "aliases used in the select clause; If you really want to use something other than that for sorting, please use "
+ "JpaSort.unsafe(…)";
static {
@@ -231,7 +231,7 @@ public abstract class QueryUtils {
*/
public static String getQueryString(String template, String entityName) {
Assert.hasText(entityName, "Entity name must not be null or empty!");
Assert.hasText(entityName, "Entity name must not be null or empty");
return String.format(template, entityName);
}
@@ -257,7 +257,7 @@ public abstract class QueryUtils {
*/
public static String applySorting(String query, Sort sort, @Nullable String alias) {
Assert.hasText(query, "Query must not be null or empty!");
Assert.hasText(query, "Query must not be null or empty");
if (sort.isUnsorted()) {
return query;
@@ -518,9 +518,9 @@ public abstract class QueryUtils {
public static <T> Query applyAndBind(String queryString, Iterable<T> entities, EntityManager entityManager) {
Assert.notNull(queryString, "Querystring must not be null!");
Assert.notNull(entities, "Iterable of entities must not be null!");
Assert.notNull(entityManager, "EntityManager must not be null!");
Assert.notNull(queryString, "Querystring must not be null");
Assert.notNull(entities, "Iterable of entities must not be null");
Assert.notNull(entityManager, "EntityManager must not be null");
Iterator<T> iterator = entities.iterator();
@@ -581,7 +581,7 @@ public abstract class QueryUtils {
@Deprecated
public static String createCountQueryFor(String originalQuery, @Nullable String countProjection) {
Assert.hasText(originalQuery, "OriginalQuery must not be null or empty!");
Assert.hasText(originalQuery, "OriginalQuery must not be null or empty");
Matcher matcher = COUNT_MATCH.matcher(originalQuery);
String countQuery;
@@ -621,7 +621,7 @@ public abstract class QueryUtils {
*/
public static boolean hasNamedParameter(Query query) {
Assert.notNull(query, "Query must not be null!");
Assert.notNull(query, "Query must not be null");
for (Parameter<?> parameter : query.getParameters()) {
@@ -661,8 +661,8 @@ public abstract class QueryUtils {
return Collections.emptyList();
}
Assert.notNull(from, "From must not be null!");
Assert.notNull(cb, "CriteriaBuilder must not be null!");
Assert.notNull(from, "From must not be null");
Assert.notNull(cb, "CriteriaBuilder must not be null");
List<jakarta.persistence.criteria.Order> orders = new ArrayList<>();
@@ -682,7 +682,7 @@ public abstract class QueryUtils {
*/
public static boolean hasConstructorExpression(String query) {
Assert.hasText(query, "Query must not be null or empty!");
Assert.hasText(query, "Query must not be null or empty");
return CONSTRUCTOR_EXPRESSION.matcher(query).find();
}
@@ -696,7 +696,7 @@ public abstract class QueryUtils {
*/
public static String getProjection(String query) {
Assert.hasText(query, "Query must not be null or empty!");
Assert.hasText(query, "Query must not be null or empty");
Matcher matcher = PROJECTION_CLAUSE.matcher(query);
String projection = matcher.find() ? matcher.group(1) : "";
@@ -767,7 +767,7 @@ public abstract class QueryUtils {
return (Expression<T>) join;
}
PropertyPath nextProperty = Objects.requireNonNull(property.next(), "An element of the property path is null!");
PropertyPath nextProperty = Objects.requireNonNull(property.next(), "An element of the property path is null");
// recurse with the next property
return toExpressionRecursively(join, nextProperty, isForSelection, requiresOuterJoin);

View File

@@ -67,11 +67,11 @@ final class SimpleJpaQuery extends AbstractStringBasedJpaQuery {
super(method, em, queryString, countQueryString, queryRewriter, evaluationContextProvider, parser);
validateQuery(getQuery().getQueryString(), "Validation failed for query for method %s!", method);
validateQuery(getQuery().getQueryString(), "Validation failed for query for method %s", method);
if (method.isPageQuery()) {
validateQuery(getCountQuery().getQueryString(),
String.format("Count query validation failed for method %s!", method));
String.format("Count query validation failed for method %s", method));
}
}

View File

@@ -59,11 +59,11 @@ enum StoredProcedureAttributeSource {
*/
public StoredProcedureAttributes createFrom(Method method, JpaEntityMetadata<?> entityMetadata) {
Assert.notNull(method, "Method must not be null!");
Assert.notNull(entityMetadata, "EntityMetadata must not be null!");
Assert.notNull(method, "Method must not be null");
Assert.notNull(entityMetadata, "EntityMetadata must not be null");
Procedure procedure = AnnotatedElementUtils.findMergedAnnotation(method, Procedure.class);
Assert.notNull(procedure, "Method must have an @Procedure annotation!");
Assert.notNull(procedure, "Method must have an @Procedure annotation");
NamedStoredProcedureQuery namedStoredProc = tryFindAnnotatedNamedStoredProcedureQuery(method, entityMetadata,
procedure);
@@ -179,9 +179,9 @@ enum StoredProcedureAttributeSource {
private NamedStoredProcedureQuery tryFindAnnotatedNamedStoredProcedureQuery(Method method,
JpaEntityMetadata<?> entityMetadata, Procedure procedure) {
Assert.notNull(method, "Method must not be null!");
Assert.notNull(entityMetadata, "EntityMetadata must not be null!");
Assert.notNull(procedure, "Procedure must not be null!");
Assert.notNull(method, "Method must not be null");
Assert.notNull(entityMetadata, "EntityMetadata must not be null");
Assert.notNull(procedure, "Procedure must not be null");
Class<?> entityType = entityMetadata.getJavaType();

View File

@@ -63,8 +63,8 @@ class StoredProcedureAttributes {
StoredProcedureAttributes(String procedureName, List<ProcedureParameter> outputProcedureParameters,
boolean namedStoredProcedure) {
Assert.notNull(procedureName, "ProcedureName must not be null!");
Assert.notNull(outputProcedureParameters, "OutputProcedureParameters must not be null!");
Assert.notNull(procedureName, "ProcedureName must not be null");
Assert.notNull(outputProcedureParameters, "OutputProcedureParameters must not be null");
Assert.isTrue(outputProcedureParameters.size() != 1 || outputProcedureParameters.get(0) != null,
"ProcedureParameters must not have size 1 with a null value");

View File

@@ -96,7 +96,7 @@ class StoredProcedureJpaQuery extends AbstractJpaQuery {
@Override
protected TypedQuery<Long> doCreateCountQuery(JpaParametersParameterAccessor accessor) {
throw new UnsupportedOperationException("StoredProcedureQuery does not support count queries!");
throw new UnsupportedOperationException("StoredProcedureQuery does not support count queries");
}
/**
@@ -110,7 +110,7 @@ class StoredProcedureJpaQuery extends AbstractJpaQuery {
@Nullable
Object extractOutputValue(StoredProcedureQuery storedProcedureQuery) {
Assert.notNull(storedProcedureQuery, "StoredProcedureQuery must not be null!");
Assert.notNull(storedProcedureQuery, "StoredProcedureQuery must not be null");
if (!procedureAttributes.hasReturnValue()) {
return null;

View File

@@ -68,7 +68,7 @@ class StringQuery implements DeclaredQuery {
@SuppressWarnings("deprecation")
StringQuery(String query, boolean isNative) {
Assert.hasText(query, "Query must not be null or empty!");
Assert.hasText(query, "Query must not be null or empty");
this.isNative = isNative;
this.bindings = new ArrayList<>();
@@ -170,8 +170,8 @@ class StringQuery implements DeclaredQuery {
private static final Pattern NUMBERED_STYLE_PARAM = Pattern.compile(" \\?(?=\\d)"); // <space>?[digit]
private static final Pattern NAMED_STYLE_PARAM = Pattern.compile(" :\\w+"); // <space>:[text]
private static final String MESSAGE = "Already found parameter binding with same index / parameter name but differing binding type! "
+ "Already have: %s, found %s! If you bind a parameter multiple times make sure they use the same binding.";
private static final String MESSAGE = "Already found parameter binding with same index / parameter name but differing binding type; "
+ "Already have: %s, found %s; If you bind a parameter multiple times make sure they use the same binding";
private static final int INDEXED_PARAMETER_GROUP = 4;
private static final int NAMED_PARAMETER_GROUP = 6;
private static final int COMPARISION_TYPE_GROUP = 1;
@@ -244,7 +244,7 @@ class StringQuery implements DeclaredQuery {
String typeSource = matcher.group(COMPARISION_TYPE_GROUP);
Assert.isTrue(parameterIndexString != null || parameterName != null,
() -> String.format("We need either a name or an index! Offending query string: %s", query));
() -> String.format("We need either a name or an index; Offending query string: %s", query));
String expression = spelExtractor.getParameter(parameterName == null ? parameterIndexString : parameterName);
String replacement = null;
@@ -258,7 +258,7 @@ class StringQuery implements DeclaredQuery {
}
if (usesJpaStyleParameters && queryMeta.usesJdbcStyleParameters) {
throw new IllegalArgumentException("Mixing of ? parameters and other forms like ?1 is not supported!");
throw new IllegalArgumentException("Mixing of ? parameters and other forms like ?1 is not supported");
}
switch (ParameterBindingType.of(typeSource)) {
@@ -417,7 +417,7 @@ class StringQuery implements DeclaredQuery {
}
}
throw new IllegalArgumentException(String.format("Unsupported parameter binding type %s!", typeSource));
throw new IllegalArgumentException(String.format("Unsupported parameter binding type %s", typeSource));
}
}
}
@@ -453,11 +453,11 @@ class StringQuery implements DeclaredQuery {
ParameterBinding(@Nullable String name, @Nullable Integer position, @Nullable String expression) {
if (name == null) {
Assert.notNull(position, "Position must not be null!");
Assert.notNull(position, "Position must not be null");
}
if (position == null) {
Assert.notNull(name, "Name must not be null!");
Assert.notNull(name, "Name must not be null");
}
this.name = name;
@@ -502,7 +502,7 @@ class StringQuery implements DeclaredQuery {
return name;
}
throw new IllegalStateException(String.format("Required name for %s not available!", this));
throw new IllegalStateException(String.format("Required name for %s not available", this));
}
/**
@@ -526,7 +526,7 @@ class StringQuery implements DeclaredQuery {
return position;
}
throw new IllegalStateException(String.format("Required position for %s not available!", this));
throw new IllegalStateException(String.format("Required position for %s not available", this));
}
/**
@@ -657,11 +657,11 @@ class StringQuery implements DeclaredQuery {
super(name, null, expression);
Assert.hasText(name, "Name must not be null or empty!");
Assert.notNull(type, "Type must not be null!");
Assert.hasText(name, "Name must not be null or empty");
Assert.notNull(type, "Type must not be null");
Assert.isTrue(SUPPORTED_TYPES.contains(type),
String.format("Type must be one of %s!", StringUtils.collectionToCommaDelimitedString(SUPPORTED_TYPES)));
String.format("Type must be one of %s", StringUtils.collectionToCommaDelimitedString(SUPPORTED_TYPES)));
this.type = type;
}
@@ -687,11 +687,11 @@ class StringQuery implements DeclaredQuery {
super(null, position, expression);
Assert.isTrue(position > 0, "Position must be greater than zero!");
Assert.notNull(type, "Type must not be null!");
Assert.isTrue(position > 0, "Position must be greater than zero");
Assert.notNull(type, "Type must not be null");
Assert.isTrue(SUPPORTED_TYPES.contains(type),
String.format("Type must be one of %s!", StringUtils.collectionToCommaDelimitedString(SUPPORTED_TYPES)));
String.format("Type must be one of %s", StringUtils.collectionToCommaDelimitedString(SUPPORTED_TYPES)));
this.type = type;
}
@@ -763,7 +763,7 @@ class StringQuery implements DeclaredQuery {
*/
private static Type getLikeTypeFrom(String expression) {
Assert.hasText(expression, "Expression must not be null or empty!");
Assert.hasText(expression, "Expression must not be null or empty");
if (expression.matches("%.*%")) {
return Type.CONTAINING;

View File

@@ -190,7 +190,7 @@ class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor, B
*/
DefaultCrudMethodMetadata(Method method) {
Assert.notNull(method, "Method must not be null!");
Assert.notNull(method, "Method must not be null");
this.lockModeType = findLockModeType(method);
this.queryHints = findQueryHints(method, it -> true);

View File

@@ -44,8 +44,8 @@ public class DefaultJpaContext implements JpaContext {
*/
public DefaultJpaContext(Set<EntityManager> entityManagers) {
Assert.notNull(entityManagers, "EntityManagers must not be null!");
Assert.notEmpty(entityManagers, "EntityManagers must not be empty!");
Assert.notNull(entityManagers, "EntityManagers must not be null");
Assert.notEmpty(entityManagers, "EntityManagers must not be empty");
this.entityManagers = new LinkedMultiValueMap<>();
@@ -59,10 +59,10 @@ public class DefaultJpaContext implements JpaContext {
@Override
public EntityManager getEntityManagerByManagedType(Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
if (!entityManagers.containsKey(type)) {
throw new IllegalArgumentException(String.format("%s is not a managed type!", type));
throw new IllegalArgumentException(String.format("%s is not a managed type", type));
}
List<EntityManager> candidates = this.entityManagers.get(type);
@@ -72,6 +72,6 @@ public class DefaultJpaContext implements JpaContext {
}
throw new IllegalArgumentException(
String.format("%s managed by more than one EntityManagers: %s!", type.getName(), candidates));
String.format("%s managed by more than one EntityManagers: %s", type.getName(), candidates));
}
}

View File

@@ -69,8 +69,8 @@ class DefaultQueryHints implements QueryHints {
*/
public static QueryHints of(JpaEntityInformation<?, ?> information, CrudMethodMetadata metadata) {
Assert.notNull(information, "JpaEntityInformation must not be null!");
Assert.notNull(metadata, "CrudMethodMetadata must not be null!");
Assert.notNull(information, "JpaEntityInformation must not be null");
Assert.notNull(metadata, "CrudMethodMetadata must not be null");
return new DefaultQueryHints(information, metadata, Optional.empty(), false);
}

View File

@@ -81,7 +81,7 @@ class FetchableFluentQueryByExample<S, R> extends FluentQuerySupport<S, R> imple
@Override
public FetchableFluentQuery<R> sortBy(Sort sort) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(sort, "Sort must not be null");
return new FetchableFluentQueryByExample<>(example, entityType, resultType, this.sort.and(sort), properties, finder,
countOperation, existsOperation, entityManager, escapeCharacter);
@@ -90,7 +90,7 @@ class FetchableFluentQueryByExample<S, R> extends FluentQuerySupport<S, R> imple
@Override
public <NR> FetchableFluentQuery<NR> as(Class<NR> resultType) {
Assert.notNull(resultType, "Projection target type must not be null!");
Assert.notNull(resultType, "Projection target type must not be null");
if (!resultType.isInterface()) {
throw new UnsupportedOperationException("Class-based DTOs are not yet supported.");
}

View File

@@ -84,7 +84,7 @@ class FetchableFluentQueryByPredicate<S, R> extends FluentQuerySupport<S, R> imp
@Override
public FetchableFluentQuery<R> sortBy(Sort sort) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(sort, "Sort must not be null");
return new FetchableFluentQueryByPredicate<>(predicate, entityType, resultType, this.sort.and(sort), properties,
finder, pagedFinder, countOperation, existsOperation, entityManager);
@@ -93,7 +93,7 @@ class FetchableFluentQueryByPredicate<S, R> extends FluentQuerySupport<S, R> imp
@Override
public <NR> FetchableFluentQuery<NR> as(Class<NR> resultType) {
Assert.notNull(resultType, "Projection target type must not be null!");
Assert.notNull(resultType, "Projection target type must not be null");
if (!resultType.isInterface()) {
throw new UnsupportedOperationException("Class-based DTOs are not yet supported.");

View File

@@ -78,7 +78,7 @@ class FetchableFluentQueryBySpecification<S, R> extends FluentQuerySupport<S, R>
@Override
public FetchableFluentQuery<R> sortBy(Sort sort) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(sort, "Sort must not be null");
return new FetchableFluentQueryBySpecification<>(spec, entityType, resultType, this.sort.and(sort), properties,
finder, countOperation, existsOperation, entityManager);
@@ -87,7 +87,7 @@ class FetchableFluentQueryBySpecification<S, R> extends FluentQuerySupport<S, R>
@Override
public <NR> FetchableFluentQuery<NR> as(Class<NR> resultType) {
Assert.notNull(resultType, "Projection target type must not be null!");
Assert.notNull(resultType, "Projection target type must not be null");
if (!resultType.isInterface()) {
throw new UnsupportedOperationException("Class-based DTOs are not yet supported.");
}

View File

@@ -54,7 +54,7 @@ public interface JpaEntityInformation<T, ID> extends EntityInformation<T, ID>, J
}
throw new IllegalArgumentException(
String.format("Could not obtain required identifier attribute for type %s!", getEntityName()));
String.format("Could not obtain required identifier attribute for type %s", getEntityName()));
}
/**

View File

@@ -55,8 +55,8 @@ public abstract class JpaEntityInformationSupport<T, ID> extends AbstractEntityI
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> JpaEntityInformation<T, ?> getEntityInformation(Class<T> domainClass, EntityManager em) {
Assert.notNull(domainClass, "Domain class must not be null!");
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(domainClass, "Domain class must not be null");
Assert.notNull(em, "EntityManager must not be null");
Metamodel metamodel = em.getMetamodel();

View File

@@ -69,19 +69,19 @@ public class JpaMetamodelEntityInformation<T, ID> extends JpaEntityInformationSu
super(domainClass);
Assert.notNull(metamodel, "Metamodel must not be null!");
Assert.notNull(metamodel, "Metamodel must not be null");
this.metamodel = metamodel;
ManagedType<T> type = metamodel.managedType(domainClass);
if (type == null) {
throw new IllegalArgumentException("The given domain class can not be found in the given Metamodel!");
throw new IllegalArgumentException("The given domain class can not be found in the given Metamodel");
}
this.entityName = type instanceof EntityType ? ((EntityType<?>) type).getName() : null;
if (!(type instanceof IdentifiableType)) {
throw new IllegalArgumentException("The given domain class does not contain an id attribute!");
throw new IllegalArgumentException("The given domain class does not contain an id attribute");
}
IdentifiableType<T> identifiableType = (IdentifiableType<T>) type;
@@ -201,7 +201,7 @@ public class JpaMetamodelEntityInformation<T, ID> extends JpaEntityInformationSu
@Override
public Object getCompositeIdAttributeValue(Object id, String idAttribute) {
Assert.isTrue(hasCompositeId(), "Model must have a composite Id!");
Assert.isTrue(hasCompositeId(), "Model must have a composite Id");
return new DirectFieldAccessFallbackBeanWrapper(id).getPropertyValue(idAttribute);
}
@@ -409,7 +409,7 @@ public class JpaMetamodelEntityInformation<T, ID> extends JpaEntityInformationSu
ManagedType<?> managedType = this.metamodel.managedType(userClass);
if (managedType == null) {
throw new IllegalStateException("ManagedType must not be null. We checked that it exists before.");
throw new IllegalStateException("ManagedType must not be null; We checked that it exists before.");
}
return managedType.getPersistenceType() == PersistenceType.ENTITY;

View File

@@ -96,7 +96,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
*/
public JpaRepositoryFactory(EntityManager entityManager) {
Assert.notNull(entityManager, "EntityManager must not be null!");
Assert.notNull(entityManager, "EntityManager must not be null");
this.entityManager = entityManager;
this.extractor = PersistenceProvider.fromEntityManager(entityManager);
@@ -137,7 +137,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
super.setBeanFactory(beanFactory);
Assert.notNull(beanFactory, "BeanFactory must not be null!");
Assert.notNull(beanFactory, "BeanFactory must not be null");
setQueryRewriterProvider(new BeanFactoryQueryRewriterProvider(beanFactory));
}
@@ -149,7 +149,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
*/
public void setEntityPathResolver(EntityPathResolver entityPathResolver) {
Assert.notNull(entityPathResolver, "EntityPathResolver must not be null!");
Assert.notNull(entityPathResolver, "EntityPathResolver must not be null");
this.entityPathResolver = entityPathResolver;
}
@@ -170,7 +170,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
*/
public void setQueryMethodFactory(JpaQueryMethodFactory queryMethodFactory) {
Assert.notNull(queryMethodFactory, "QueryMethodFactory must not be null!");
Assert.notNull(queryMethodFactory, "QueryMethodFactory must not be null");
this.queryMethodFactory = queryMethodFactory;
}
@@ -184,7 +184,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
*/
public void setQueryRewriterProvider(QueryRewriterProvider queryRewriterProvider) {
Assert.notNull(queryRewriterProvider, "QueryRewriterProvider must not be null!");
Assert.notNull(queryRewriterProvider, "QueryRewriterProvider must not be null");
this.queryRewriterProvider = queryRewriterProvider;
}
@@ -312,7 +312,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
*/
private static class EclipseLinkProjectionQueryCreationListener implements QueryCreationListener<AbstractJpaQuery> {
private static final String ECLIPSELINK_PROJECTIONS = "Usage of Spring Data projections detected on persistence provider EclipseLink. Make sure the following query methods declare result columns in exactly the order the accessors are declared in the projecting interface or the order of parameters for DTOs:";
private static final String ECLIPSELINK_PROJECTIONS = "Usage of Spring Data projections detected on persistence provider EclipseLink; Make sure the following query methods declare result columns in exactly the order the accessors are declared in the projecting interface or the order of parameters for DTOs:";
private static final Log log = LogFactory.getLog(EclipseLinkProjectionQueryCreationListener.class);
@@ -327,7 +327,7 @@ public class JpaRepositoryFactory extends RepositoryFactorySupport {
*/
public EclipseLinkProjectionQueryCreationListener(EntityManager em) {
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(em, "EntityManager must not be null");
this.metamodel = JpaMetamodel.of(em.getMetamodel());
}

View File

@@ -103,7 +103,7 @@ public class JpaRepositoryFactoryBean<T extends Repository<S, ID>, S, ID>
@Override
protected RepositoryFactorySupport doCreateRepositoryFactory() {
Assert.state(entityManager != null, "EntityManager must not be null!");
Assert.state(entityManager != null, "EntityManager must not be null");
return createRepositoryFactory(entityManager);
}
@@ -127,7 +127,7 @@ public class JpaRepositoryFactoryBean<T extends Repository<S, ID>, S, ID>
@Override
public void afterPropertiesSet() {
Assert.state(entityManager != null, "EntityManager must not be null!");
Assert.state(entityManager != null, "EntityManager must not be null");
super.afterPropertiesSet();
}

View File

@@ -32,8 +32,8 @@ public class QueryHintValue {
public QueryHintValue(String name, Object value) {
Assert.notNull(name, "Name must not be null.");
Assert.notNull(value, "Value must not be null.");
Assert.notNull(name, "Name must not be null");
Assert.notNull(value, "Value must not be null");
this.name = name;
this.value = value;

View File

@@ -42,7 +42,7 @@ public interface QueryHints {
*/
static QueryHints from(QueryHints... sources) {
Assert.notNull(sources, "Sources must not be null!");
Assert.notNull(sources, "Sources must not be null");
MutableQueryHints result = new MutableQueryHints();

View File

@@ -63,8 +63,8 @@ public class Querydsl {
*/
public Querydsl(EntityManager em, PathBuilder<?> builder) {
Assert.notNull(em, "EntityManager must not be null!");
Assert.notNull(builder, "PathBuilder must not be null!");
Assert.notNull(em, "EntityManager must not be null");
Assert.notNull(builder, "PathBuilder must not be null");
this.em = em;
this.provider = PersistenceProvider.fromEntityManager(em);
@@ -97,7 +97,7 @@ public class Querydsl {
*/
public AbstractJPAQuery<Object, JPAQuery<Object>> createQuery(EntityPath<?>... paths) {
Assert.notNull(paths, "Paths must not be null!");
Assert.notNull(paths, "Paths must not be null");
return createQuery().from(paths);
}
@@ -111,8 +111,8 @@ public class Querydsl {
*/
public <T> JPQLQuery<T> applyPagination(Pageable pageable, JPQLQuery<T> query) {
Assert.notNull(pageable, "Pageable must not be null!");
Assert.notNull(query, "JPQLQuery must not be null!");
Assert.notNull(pageable, "Pageable must not be null");
Assert.notNull(query, "JPQLQuery must not be null");
if (pageable.isUnpaged()) {
return query;
@@ -133,8 +133,8 @@ public class Querydsl {
*/
public <T> JPQLQuery<T> applySorting(Sort sort, JPQLQuery<T> query) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(query, "Query must not be null!");
Assert.notNull(sort, "Sort must not be null");
Assert.notNull(query, "Query must not be null");
if (sort.isUnsorted()) {
return query;
@@ -171,8 +171,8 @@ public class Querydsl {
*/
private <T> JPQLQuery<T> addOrderByFrom(Sort sort, JPQLQuery<T> query) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(query, "Query must not be null!");
Assert.notNull(sort, "Sort must not be null");
Assert.notNull(query, "Query must not be null");
for (Order order : sort) {
query.orderBy(toOrderSpecifier(order));
@@ -205,7 +205,7 @@ public class Querydsl {
*/
private NullHandling toQueryDslNullHandling(org.springframework.data.domain.Sort.NullHandling nullHandling) {
Assert.notNull(nullHandling, "NullHandling must not be null!");
Assert.notNull(nullHandling, "NullHandling must not be null");
switch (nullHandling) {
@@ -229,7 +229,7 @@ public class Querydsl {
*/
private Expression<?> buildOrderPropertyPathFrom(Order order) {
Assert.notNull(order, "Order must not be null!");
Assert.notNull(order, "Order must not be null");
PropertyPath path = PropertyPath.from(order.getProperty(), builder.getType());
Expression<?> sortPropertyExpression = builder;

View File

@@ -88,7 +88,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
@Override
public Optional<T> findOne(Predicate predicate) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
try {
return Optional.ofNullable(createQuery(predicate).select(path).fetchOne());
@@ -100,7 +100,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
@Override
public List<T> findAll(Predicate predicate) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
return createQuery(predicate).select(path).fetch();
}
@@ -108,8 +108,8 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
@Override
public List<T> findAll(Predicate predicate, OrderSpecifier<?>... orders) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(orders, "Order specifiers must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(orders, "Order specifiers must not be null");
return executeSorted(createQuery(predicate).select(path), orders);
}
@@ -117,8 +117,8 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
@Override
public List<T> findAll(Predicate predicate, Sort sort) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(sort, "Sort must not be null");
return executeSorted(createQuery(predicate).select(path), sort);
}
@@ -126,7 +126,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
@Override
public List<T> findAll(OrderSpecifier<?>... orders) {
Assert.notNull(orders, "Order specifiers must not be null!");
Assert.notNull(orders, "Order specifiers must not be null");
return executeSorted(createQuery(new Predicate[0]).select(path), orders);
}
@@ -134,8 +134,8 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
@Override
public Page<T> findAll(Predicate predicate, Pageable pageable) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(pageable, "Pageable must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(pageable, "Pageable must not be null");
final JPQLQuery<?> countQuery = createCountQuery(predicate);
JPQLQuery<T> query = querydsl.applyPagination(pageable, createQuery(predicate).select(path));
@@ -147,8 +147,8 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
@Override
public <S extends T, R> R findBy(Predicate predicate, Function<FetchableFluentQuery<S>, R> queryFunction) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(queryFunction, "Query function must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(queryFunction, "Query function must not be null");
Function<Sort, AbstractJPAQuery<?, ?>> finder = sort -> {
AbstractJPAQuery<?, ?> select = (AbstractJPAQuery<?, ?>) createQuery(predicate).select(path);
@@ -202,7 +202,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
*/
protected AbstractJPAQuery<?, ?> createQuery(Predicate... predicate) {
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(predicate, "Predicate must not be null");
AbstractJPAQuery<?, ?> query = doCreateQuery(getQueryHints().withFetchGraphs(entityManager), predicate);
CrudMethodMetadata metadata = getRepositoryMethodMetadata();

View File

@@ -120,7 +120,7 @@ public class QuerydslJpaRepository<T, ID extends Serializable> extends SimpleJpa
@Override
public List<T> findAll(Predicate predicate, Sort sort) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(sort, "Sort must not be null");
return executeSorted(createQuery(predicate).select(path), sort);
}
@@ -128,7 +128,7 @@ public class QuerydslJpaRepository<T, ID extends Serializable> extends SimpleJpa
@Override
public List<T> findAll(OrderSpecifier<?>... orders) {
Assert.notNull(orders, "Order specifiers must not be null!");
Assert.notNull(orders, "Order specifiers must not be null");
return executeSorted(createQuery(new Predicate[0]).select(path), orders);
}
@@ -136,7 +136,7 @@ public class QuerydslJpaRepository<T, ID extends Serializable> extends SimpleJpa
@Override
public Page<T> findAll(Predicate predicate, Pageable pageable) {
Assert.notNull(pageable, "Pageable must not be null!");
Assert.notNull(pageable, "Pageable must not be null");
final JPQLQuery<?> countQuery = createCountQuery(predicate);
JPQLQuery<T> query = querydsl.applyPagination(pageable, createQuery(predicate).select(path));

View File

@@ -54,7 +54,7 @@ public abstract class QuerydslRepositorySupport {
*/
public QuerydslRepositorySupport(Class<?> domainClass) {
Assert.notNull(domainClass, "Domain class must not be null!");
Assert.notNull(domainClass, "Domain class must not be null");
this.builder = new PathBuilderFactory().create(domainClass);
}
@@ -66,7 +66,7 @@ public abstract class QuerydslRepositorySupport {
@Autowired
public void setEntityManager(EntityManager entityManager) {
Assert.notNull(entityManager, "EntityManager must not be null!");
Assert.notNull(entityManager, "EntityManager must not be null");
this.querydsl = new Querydsl(entityManager, builder);
this.entityManager = entityManager;
}
@@ -76,8 +76,8 @@ public abstract class QuerydslRepositorySupport {
*/
@PostConstruct
public void validate() {
Assert.notNull(entityManager, "EntityManager must not be null!");
Assert.notNull(querydsl, "Querydsl must not be null!");
Assert.notNull(entityManager, "EntityManager must not be null");
Assert.notNull(querydsl, "Querydsl must not be null");
}
/**
@@ -154,7 +154,7 @@ public abstract class QuerydslRepositorySupport {
private Querydsl getRequiredQuerydsl() {
if (querydsl == null) {
throw new IllegalStateException("Querydsl is null!");
throw new IllegalStateException("Querydsl is null");
}
return querydsl;
@@ -163,7 +163,7 @@ public abstract class QuerydslRepositorySupport {
private EntityManager getRequiredEntityManager() {
if (entityManager == null) {
throw new IllegalStateException("EntityManager is null!");
throw new IllegalStateException("EntityManager is null");
}
return entityManager;

View File

@@ -91,7 +91,7 @@ import org.springframework.util.Assert;
@Transactional(readOnly = true)
public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T, ID> {
private static final String ID_MUST_NOT_BE_NULL = "The given id must not be null!";
private static final String ID_MUST_NOT_BE_NULL = "The given id must not be null";
private final JpaEntityInformation<T, ?> entityInformation;
private final EntityManager em;
@@ -108,8 +108,8 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
*/
public SimpleJpaRepository(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) {
Assert.notNull(entityInformation, "JpaEntityInformation must not be null!");
Assert.notNull(entityManager, "EntityManager must not be null!");
Assert.notNull(entityInformation, "JpaEntityInformation must not be null");
Assert.notNull(entityManager, "EntityManager must not be null");
this.entityInformation = entityInformation;
this.em = entityManager;
@@ -168,7 +168,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
Assert.notNull(id, ID_MUST_NOT_BE_NULL);
delete(findById(id).orElseThrow(() -> new EmptyResultDataAccessException(
String.format("No %s entity with id %s exists!", entityInformation.getJavaType(), id), 1)));
String.format("No %s entity with id %s exists", entityInformation.getJavaType(), id), 1)));
}
@Override
@@ -176,7 +176,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@SuppressWarnings("unchecked")
public void delete(T entity) {
Assert.notNull(entity, "Entity must not be null!");
Assert.notNull(entity, "Entity must not be null");
if (entityInformation.isNew(entity)) {
return;
@@ -198,7 +198,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Transactional
public void deleteAllById(Iterable<? extends ID> ids) {
Assert.notNull(ids, "Ids must not be null!");
Assert.notNull(ids, "Ids must not be null");
for (ID id : ids) {
deleteById(id);
@@ -209,7 +209,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Transactional
public void deleteAllByIdInBatch(Iterable<ID> ids) {
Assert.notNull(ids, "Ids must not be null!");
Assert.notNull(ids, "Ids must not be null");
if (!ids.iterator().hasNext()) {
return;
@@ -246,7 +246,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Transactional
public void deleteAll(Iterable<? extends T> entities) {
Assert.notNull(entities, "Entities must not be null!");
Assert.notNull(entities, "Entities must not be null");
for (T entity : entities) {
delete(entity);
@@ -257,7 +257,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Transactional
public void deleteAllInBatch(Iterable<T> entities) {
Assert.notNull(entities, "Entities must not be null!");
Assert.notNull(entities, "Entities must not be null");
if (!entities.iterator().hasNext()) {
return;
@@ -387,7 +387,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Override
public List<T> findAllById(Iterable<ID> ids) {
Assert.notNull(ids, "Ids must not be null!");
Assert.notNull(ids, "Ids must not be null");
if (!ids.iterator().hasNext()) {
return Collections.emptyList();
@@ -533,8 +533,8 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Override
public <S extends T, R> R findBy(Example<S> example, Function<FetchableFluentQuery<S>, R> queryFunction) {
Assert.notNull(example, "Sample must not be null!");
Assert.notNull(queryFunction, "Query function must not be null!");
Assert.notNull(example, "Sample must not be null");
Assert.notNull(queryFunction, "Query function must not be null");
Function<Sort, TypedQuery<S>> finder = sort -> {
@@ -553,8 +553,8 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Override
public <S extends T, R> R findBy(Specification<T> spec, Function<FetchableFluentQuery<S>, R> queryFunction) {
Assert.notNull(spec, "Specification must not be null!");
Assert.notNull(queryFunction, "Query function must not be null!");
Assert.notNull(spec, "Specification must not be null");
Assert.notNull(queryFunction, "Query function must not be null");
Function<Sort, TypedQuery<T>> finder = sort -> {
return getQuery(spec, getDomainClass(), sort);
@@ -580,7 +580,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Override
public <S extends T> S save(S entity) {
Assert.notNull(entity, "Entity must not be null.");
Assert.notNull(entity, "Entity must not be null");
if (entityInformation.isNew(entity)) {
em.persist(entity);
@@ -604,7 +604,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
@Override
public <S extends T> List<S> saveAll(Iterable<S> entities) {
Assert.notNull(entities, "Entities must not be null!");
Assert.notNull(entities, "Entities must not be null");
List<S> result = new ArrayList<>();
@@ -770,8 +770,8 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
private <S, U extends T> Root<U> applySpecificationToCriteria(@Nullable Specification<U> spec, Class<U> domainClass,
CriteriaQuery<S> query) {
Assert.notNull(domainClass, "Domain class must not be null!");
Assert.notNull(query, "CriteriaQuery must not be null!");
Assert.notNull(domainClass, "Domain class must not be null");
Assert.notNull(query, "CriteriaQuery must not be null");
Root<U> root = query.from(domainClass);
@@ -829,7 +829,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
*/
private static long executeCountQuery(TypedQuery<Long> query) {
Assert.notNull(query, "TypedQuery must not be null!");
Assert.notNull(query, "TypedQuery must not be null");
List<Long> totals = query.getResultList();
long total = 0L;
@@ -898,8 +898,8 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
*/
ExampleSpecification(Example<T> example, EscapeCharacter escapeCharacter) {
Assert.notNull(example, "Example must not be null!");
Assert.notNull(escapeCharacter, "EscapeCharacter must not be null!");
Assert.notNull(example, "Example must not be null");
Assert.notNull(escapeCharacter, "EscapeCharacter must not be null");
this.example = example;
this.escapeCharacter = escapeCharacter;

View File

@@ -74,7 +74,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
*/
public ClasspathScanningPersistenceUnitPostProcessor(String basePackage) {
Assert.hasText(basePackage, "Base package must not be null or empty!");
Assert.hasText(basePackage, "Base package must not be null or empty");
this.basePackage = basePackage;
}
@@ -87,7 +87,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
*/
public void setMappingFileNamePattern(String mappingFilePattern) {
Assert.hasText(mappingFilePattern, "Mapping file pattern must not be null or empty!");
Assert.hasText(mappingFilePattern, "Mapping file pattern must not be null or empty");
this.mappingFileNamePattern = mappingFilePattern;
}
@@ -95,7 +95,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
@Override
public void setResourceLoader(ResourceLoader resourceLoader) {
Assert.notNull(resourceLoader, "ResourceLoader must not be null!");
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
this.mappingFileResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
this.resourceLoader = resourceLoader;
@@ -104,7 +104,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
@Override
public void setEnvironment(Environment environment) {
Assert.notNull(environment, "Environment must not be null!");
Assert.notNull(environment, "Environment must not be null");
this.environment = environment;
}
@@ -121,7 +121,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
for (BeanDefinition definition : provider.findCandidateComponents(basePackage)) {
LOG.debug(String.format("Registering classpath-scanned entity %s in persistence unit info!", definition.getBeanClassName()));
LOG.debug(String.format("Registering classpath-scanned entity %s in persistence unit info", definition.getBeanClassName()));
if (definition.getBeanClassName() != null) {
pui.addManagedClassName(definition.getBeanClassName());
@@ -130,7 +130,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
for (String location : scanForMappingFileLocations()) {
LOG.debug(String.format("Registering classpath-scanned entity mapping file %s in persistence unit info!", location));
LOG.debug(String.format("Registering classpath-scanned entity mapping file %s in persistence unit info", location));
pui.addMappingFileName(location);
}
@@ -165,7 +165,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
try {
scannedResources = mappingFileResolver.getResources(path);
} catch (IOException e) {
throw new IllegalStateException(String.format("Cannot load mapping files from path %s!", path), e);
throw new IllegalStateException(String.format("Cannot load mapping files from path %s", path), e);
}
Set<String> mappingFileUris = new HashSet<>();
@@ -179,7 +179,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor
mappingFileUris.add(resourcePathInClasspath);
} catch (IOException e) {
throw new IllegalStateException(String.format("Couldn't get URI for %s!", resource), e);
throw new IllegalStateException(String.format("Couldn't get URI for %s", resource), e);
}
}

View File

@@ -62,7 +62,7 @@ public class MergingPersistenceUnitManager extends DefaultPersistenceUnitManager
if (!pui.getJarFileUrls().contains(url)) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Adding JAR file URL %s to persistence unit %s.", url, persistenceUnitName));
LOG.debug(String.format("Adding JAR file URL %s to persistence unit %s", url, persistenceUnitName));
}
pui.addJarFileUrl(url);
}
@@ -82,7 +82,7 @@ public class MergingPersistenceUnitManager extends DefaultPersistenceUnitManager
if (!pui.getMappingFileNames().contains(mappingFileName)) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Adding mapping file %s to persistence unit %s.", mappingFileName, persistenceUnitName));
LOG.debug(String.format("Adding mapping file %s to persistence unit %s", mappingFileName, persistenceUnitName));
}
pui.addMappingFileName(mappingFileName);
}

View File

@@ -59,7 +59,7 @@ public class JpaMetamodel {
*/
private JpaMetamodel(Metamodel metamodel) {
Assert.notNull(metamodel, "Metamodel must not be null!");
Assert.notNull(metamodel, "Metamodel must not be null");
this.metamodel = metamodel;
@@ -87,7 +87,7 @@ public class JpaMetamodel {
*/
public boolean isJpaManaged(Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
return managedTypes.get().contains(type);
}
@@ -120,7 +120,7 @@ public class JpaMetamodel {
*/
public boolean isMappedType(Class<?> entity) {
Assert.notNull(entity, "Type must not be null!");
Assert.notNull(entity, "Type must not be null");
if (!isJpaManaged(entity)) {
return false;

View File

@@ -36,7 +36,7 @@ public class AuditorAwareStub implements AuditorAware<AuditableUser> {
public AuditorAwareStub(AuditableUserRepository repository) {
Assert.notNull(repository, "AuditableUserRepository must not be null!");
Assert.notNull(repository, "AuditableUserRepository must not be null");
this.repository = repository;
}

View File

@@ -40,8 +40,8 @@ public class SampleEntityPK implements Serializable {
public SampleEntityPK(String first, String second) {
Assert.notNull(first, "First must not be null!");
Assert.notNull(second, "Second must not be null!");
Assert.notNull(first, "First must not be null");
Assert.notNull(second, "Second must not be null");
this.first = first;
this.second = second;
}

View File

@@ -55,6 +55,6 @@ public class HibernateTestUtils {
}
}
throw new IllegalStateException("Could not obtain Hibernate PersistenceProvider!");
throw new IllegalStateException("Could not obtain Hibernate PersistenceProvider");
}
}

View File

@@ -66,7 +66,7 @@ class EclipseLinkNamespaceUserRepositoryTests extends NamespaceUserRepositoryTes
Query query = em.createNativeQuery("select 1 from User where firstname=? and lastname=?");
assertThat(query.getParameters()).describedAs(
"Due to a bug eclipse has size 0. If this is no longer the case the special code path triggered in NamedOrIndexedQueryParameterSetter.registerExcessParameters can be removed")
"Due to a bug eclipse has size 0; If this is no longer the case the special code path triggered in NamedOrIndexedQueryParameterSetter.registerExcessParameters can be removed")
.hasSize(0);
}

View File

@@ -51,7 +51,7 @@ class CdiExtensionIntegrationTests {
.addPackages(PersonRepository.class) //
.initialize();
LOGGER.debug("CDI container bootstrapped!");
LOGGER.debug("CDI container bootstrapped");
}
@AfterAll

View File

@@ -67,7 +67,7 @@ public class JpaQueryRewriterWithCdiIntegrationTests {
.addPackages(UserRepositoryWithRewriter.class) //
.initialize();
LOGGER.debug("CDI container bootstrapped!");
LOGGER.debug("CDI container bootstrapped");
}
@AfterAll

View File

@@ -255,7 +255,7 @@ public class Jpa21UtilsTests {
Assertions.assertThat(attributeNode.getSubgraphs()) //
.describedAs(
String.format("Leaf properties %s could not be found. The node does not have any subgraphs.", nodes)) //
String.format("Leaf properties %s could not be found; The node does not have any subgraphs", nodes)) //
.isNotNull() //
.isNotEmpty();
@@ -267,13 +267,13 @@ public class Jpa21UtilsTests {
AttributeNode<?> node = findNode(nodeName, graph.getAttributeNodes());
String notInSubgraph = String.format(
"AttributeNode '%s' could not be found in subgraph for '%s'. Know nodes are: %s.", nodeName,
"AttributeNode '%s' could not be found in subgraph for '%s'; Know nodes are: %s", nodeName,
attributeNode.getAttributeName(), extractExistingAttributeNames(graph));
softly.assertThat(node).describedAs(notInSubgraph).isNotNull();
String notLeaf = String.format(
"AttributeNode %s of subgraph %s is not a leaf property but has %d SubGraph(s).", nodeName,
"AttributeNode %s of subgraph %s is not a leaf property but has %d SubGraph(s)", nodeName,
attributeNode.getAttributeName(), node.getSubgraphs().size());
softly.assertThat(node.getSubgraphs()) //
@@ -291,7 +291,7 @@ public class Jpa21UtilsTests {
Assertions.assertThat(attributeNode.getSubgraphs()) //
.describedAs(
String.format("Subgraphs %s could not be found. The node does not have any subgraphs.", subgraphs)) //
String.format("Subgraphs %s could not be found; The node does not have any subgraphs", subgraphs)) //
.isNotNull() //
.isNotEmpty();
@@ -303,13 +303,13 @@ public class Jpa21UtilsTests {
AttributeNode<?> node = findNode(subgraphName, graph.getAttributeNodes());
String notFound = String.format("Subgraph '%s' could not be found in SubGraph for '%s'. Known nodes are: %s.",
String notFound = String.format("Subgraph '%s' could not be found in SubGraph for '%s'; Known nodes are: %s",
subgraphName, attributeNode.getAttributeName(), extractExistingAttributeNames(graph));
softly.assertThat(node) //
.describedAs(notFound) //
.isNotNull();
String notSubGraph = String.format("'%s' of SubGraph '%s' is not a SubGraph.", subgraphName,
String notSubGraph = String.format("'%s' of SubGraph '%s' is not a SubGraph", subgraphName,
attributeNode.getAttributeName());
softly.assertThat(node.getSubgraphs()) //

View File

@@ -181,7 +181,7 @@ public class JpaQueryLookupStrategyUnitTests {
assertThatIllegalStateException()
.isThrownBy(() -> strategy.resolveQuery(method, metadata, projectionFactory, namedQueries))
.withMessageContaining(
"is backed by a NamedQuery and must not contain a sort parameter as we cannot modify the query! Use @Query instead!");
"is backed by a NamedQuery and must not contain a sort parameter as we cannot modify the query; Use @Query instead");
}
@Test // GH-2018
@@ -211,7 +211,7 @@ public class JpaQueryLookupStrategyUnitTests {
RepositoryMetadata jdbcStyleMetadata = new DefaultRepositoryMetadata(UserRepository.class);
strategy.resolveQuery(jdbcStyleMethod, jdbcStyleMetadata, projectionFactory, namedQueries);
}).withMessageContaining("JDBC style parameters (?) are not supported for JPA queries.");
}).withMessageContaining("JDBC style parameters (?) are not supported for JPA queries");
Method jpaStyleMethod = UserRepository.class.getMethod("customQueryWithQuestionMarksAndNumberedStyleParam",
String.class);

View File

@@ -254,11 +254,11 @@ public class PartTreeJpaQueryIntegrationTests {
while (split.hasNext()) {
Assert.notNull(result, "result must not be null.");
Assert.notNull(result, "result must not be null");
result = getField(result, split.next());
}
Assert.notNull(result, "result must not be null.");
Assert.notNull(result, "result must not be null");
return (T) result;
}

View File

@@ -79,7 +79,7 @@ class QueryParameterSetterFactoryUnitTests {
assertThatExceptionOfType(IllegalArgumentException.class) //
.isThrownBy(() -> setterFactory.create(binding, DeclaredQuery.of("QueryStringWith :NamedParameter", false))) //
.withMessage("At least 1 parameter(s) provided but only 0 parameter(s) present in query.");
.withMessage("At least 1 parameter(s) provided but only 0 parameter(s) present in query");
}
@Test // DATAJPA-1281
@@ -93,6 +93,6 @@ class QueryParameterSetterFactoryUnitTests {
assertThatExceptionOfType(IllegalArgumentException.class) //
.isThrownBy(() -> setterFactory.create(binding, DeclaredQuery.of("QueryStringWith ?1", false))) //
.withMessage("At least 1 parameter(s) provided but only 0 parameter(s) present in query.");
.withMessage("At least 1 parameter(s) provided but only 0 parameter(s) present in query");
}
}

View File

@@ -33,16 +33,16 @@ public class UserRepositoryImpl implements UserRepositoryCustom {
@Autowired
public UserRepositoryImpl(JpaContext context) {
Assert.notNull(context, "JpaContext must not be null!");
Assert.notNull(context, "JpaContext must not be null");
}
@Override
public void someCustomMethod(User u) {
LOG.debug("Some custom method was invoked!");
LOG.debug("Some custom method was invoked");
}
@Override
public void findByOverrridingMethod() {
LOG.debug("A method overriding a finder was invoked!");
LOG.debug("A method overriding a finder was invoked");
}
}

View File

@@ -210,13 +210,13 @@ public class JpaRepositoryFactoryUnitTests {
@Override
public void throwingRuntimeException() {
throw new IllegalArgumentException("You lose!");
throw new IllegalArgumentException("You lose");
}
@Override
public void throwingCheckedException() throws IOException {
throw new IOException("You lose!");
throw new IOException("You lose");
}
};
}