diff --git a/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/EnversRevisionRepositoryImpl.java b/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/EnversRevisionRepositoryImpl.java index 838d64721..537c66783 100755 --- a/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/EnversRevisionRepositoryImpl.java +++ b/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/EnversRevisionRepositoryImpl.java @@ -77,7 +77,7 @@ public class EnversRevisionRepositoryImpl 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> 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 singleResult = (List) 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 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", diff --git a/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/ReflectionRevisionEntityInformation.java b/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/ReflectionRevisionEntityInformation.java index 65d22ff77..c441ef954 100644 --- a/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/ReflectionRevisionEntityInformation.java +++ b/spring-data-envers/src/main/java/org/springframework/data/envers/repository/support/ReflectionRevisionEntityInformation.java @@ -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); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java index fc8732ec5..6949090e4 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilder.java @@ -96,9 +96,9 @@ public class QueryByExamplePredicateBuilder { public static Predicate getPredicate(Root root, CriteriaBuilder cb, Example 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)); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java index e43754cb0..5adc6fab8 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java @@ -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 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 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 , T, S> Path 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

, T, S> Path 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 properties) { - Assert.notEmpty(properties, "Properties must not be empty!"); + Assert.notEmpty(properties, "Properties must not be empty"); List orders = new ArrayList<>(properties.size()); @@ -330,7 +330,7 @@ public class JpaSort extends Sort { private List> add(Attribute attribute) { - Assert.notNull(attribute, "Attribute must not be null!"); + Assert.notNull(attribute, "Attribute must not be null"); List> newAttributes = new ArrayList>(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 orders = new ArrayList<>(properties.length); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessor.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessor.java index d3581f9d9..d76ca704c 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessor.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessor.java @@ -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 correctly!", o_O); + "Invalid auditing setup; Make sure you've used @EnableJpaAuditing or correctly", o_O); } for (String beanName : getEntityManagerFactoryBeanNames(beanFactory)) { diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingEntityListener.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingEntityListener.java index ca73ad9d9..25dabceb6 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingEntityListener.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/support/AuditingEntityListener.java @@ -70,7 +70,7 @@ public class AuditingEntityListener { */ public void setAuditingHandler(ObjectFactory 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) { diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContext.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContext.java index 0d129cccf..a42e77266 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContext.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContext.java @@ -54,8 +54,8 @@ public class JpaMetamodelMappingContext */ public JpaMetamodelMappingContext(Set 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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentEntityImpl.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentEntityImpl.java index 2165ce61b..e55d44a23 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentEntityImpl.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentEntityImpl.java @@ -41,7 +41,7 @@ class JpaPersistentEntityImpl extends BasicPersistentEntity extends BasicPersistentEntity extends BasicPersistentEntity super.isAssociation() // || ASSOCIATION_ANNOTATIONS.stream().anyMatch(this::isAnnotationPresent)); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/JpaClassUtils.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/JpaClassUtils.java index dc3be2c4a..ab68486d8 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/JpaClassUtils.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/JpaClassUtils.java @@ -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); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java index fa4f87f94..73a09f631 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java @@ -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 metamodelType = metamodel.getClass(); PersistenceProvider cachedProvider = CACHE.get(metamodelType); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java index 01412b744..9073a843f 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryBean.java @@ -60,7 +60,7 @@ class JpaRepositoryBean extends CdiRepositoryBean { 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); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtension.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtension.java index 71634d5bc..9cdb3bba1 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtension.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtension.java @@ -52,7 +52,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport { private final Map, Bean> 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 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) 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 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)); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParser.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParser.java index 3b080f7b7..79379625b 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParser.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParser.java @@ -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(); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrar.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrar.java index 9e536f42e..fc0404169 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrar.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrar.java @@ -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(); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaMetamodelMappingContextFactoryBean.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaMetamodelMappingContextFactoryBean.java index 96fff0518..1d3d10b0f 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaMetamodelMappingContextFactoryBean.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/config/JpaMetamodelMappingContextFactoryBean.java @@ -69,7 +69,7 @@ public class JpaMetamodelMappingContextFactoryBean extends AbstractFactoryBean getMetamodels() { if (beanFactory == null) { - throw new IllegalStateException("BeanFactory must not be null!"); + throw new IllegalStateException("BeanFactory must not be null"); } Collection factories = BeanFactoryUtils diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java index 52e9c3aa9..7fe6bafde 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractJpaQuery.java @@ -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 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 { - 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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQuery.java index 20611985b..64e61530f 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQuery.java @@ -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 diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/DefaultJpaEntityMetadata.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/DefaultJpaEntityMetadata.java index 56b1551e9..de2d8416a 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/DefaultJpaEntityMetadata.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/DefaultJpaEntityMetadata.java @@ -38,7 +38,7 @@ public class DefaultJpaEntityMetadata implements JpaEntityMetadata { */ public DefaultJpaEntityMetadata(Class domainType) { - Assert.notNull(domainType, "Domain type must not be null!"); + Assert.notNull(domainType, "Domain type must not be null"); this.domainType = domainType; } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/EmptyDeclaredQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/EmptyDeclaredQuery.java index 725719785..a2cf99840 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/EmptyDeclaredQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/EmptyDeclaredQuery.java @@ -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); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQuery.java index ce399d321..8bb25aa6c 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQuery.java @@ -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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JSqlParserQueryEnhancer.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JSqlParserQueryEnhancer.java index d8322ec8e..9ac2bc746 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JSqlParserQueryEnhancer.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JSqlParserQueryEnhancer.java @@ -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); } } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/Jpa21Utils.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/Jpa21Utils.java index b8e7a561b..30152a169 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/Jpa21Utils.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/Jpa21Utils.java @@ -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); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaEntityGraph.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaEntityGraph.java index e822ef986..759a143e2 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaEntityGraph.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaEntityGraph.java @@ -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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaParameters.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaParameters.java index 5a5ce1d22..329c01335 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaParameters.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaParameters.java @@ -85,7 +85,7 @@ public class JpaParameters extends Parameters { 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 { 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() { diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java index 8a6527b11..836cca29f 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryCreator.java @@ -225,8 +225,8 @@ public class JpaQueryCreator extends AbstractQueryCreator 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> collectionPath = traversePath(root, property); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java index 2cc12a5a1..008067075 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryExecution.java @@ -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"); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategy.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategy.java index 4df1c9ab8..7fcab82bd 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategy.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategy.java @@ -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)); } } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java index e3138c5bd..d510577d3 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java @@ -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())); } /** diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaResultConverters.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaResultConverters.java index fb80a62d5..77dba961c 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaResultConverters.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/JpaResultConverters.java @@ -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); } } } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java index e79a39a3e..b2b8a66d8 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java @@ -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) { diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java index 49d129cd0..af76bb547 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinder.java @@ -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 parameterSetters; @@ -62,8 +62,8 @@ public class ParameterBinder { public ParameterBinder(JpaParameters parameters, Iterable 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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinderFactory.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinderFactory.java index a16547cea..77ebedf3d 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinderFactory.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterBinderFactory.java @@ -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 bindings = getBindings(parameters); @@ -63,8 +63,8 @@ class ParameterBinderFactory { */ static ParameterBinder createCriteriaBinder(JpaParameters parameters, List> 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 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 bindings = query.getParameterBindings(); QueryParameterSetterFactory expressionSetterFactory = QueryParameterSetterFactory.parsing(parser, diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java index e214ffe4c..97696f1cf 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ParameterMetadataProvider.java @@ -96,9 +96,9 @@ class ParameterMetadataProvider { private ParameterMetadataProvider(CriteriaBuilder builder, @Nullable Iterator 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 ParameterMetadata 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) next(part, parameter.getType(), parameter); @@ -155,7 +155,7 @@ class ParameterMetadataProvider { */ private ParameterMetadata next(Part part, Class 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 expressionType = expression.getJavaType(); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java index 28c08f47b..7ec72f956 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java @@ -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); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryEnhancerFactory.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryEnhancerFactory.java index 156a49aee..8365122cd 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryEnhancerFactory.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryEnhancerFactory.java @@ -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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetter.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetter.java index 8bc189e31..e3c40f18a 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetter.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetter.java @@ -67,7 +67,7 @@ interface QueryParameterSetter { NamedOrIndexedQueryParameterSetter(Function 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; } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactory.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactory.java index 72986cf4b..c27abbd2b 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactory.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactory.java @@ -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> 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> 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; } } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java index 2a422e870..bd39edc50 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java @@ -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 Query applyAndBind(String queryString, Iterable 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 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 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) 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); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/SimpleJpaQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/SimpleJpaQuery.java index 1e765db9c..c2e23738d 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/SimpleJpaQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/SimpleJpaQuery.java @@ -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)); } } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSource.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSource.java index db63ce83c..8d321db92 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSource.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSource.java @@ -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(); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributes.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributes.java index 36e981c84..40cfcd244 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributes.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributes.java @@ -63,8 +63,8 @@ class StoredProcedureAttributes { StoredProcedureAttributes(String procedureName, List 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"); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureJpaQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureJpaQuery.java index f4af59547..e7a5b02f2 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureJpaQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StoredProcedureJpaQuery.java @@ -96,7 +96,7 @@ class StoredProcedureJpaQuery extends AbstractJpaQuery { @Override protected TypedQuery 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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java index 994a7837c..36ec1ca17 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/StringQuery.java @@ -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)"); // ?[digit] private static final Pattern NAMED_STYLE_PARAM = Pattern.compile(" :\\w+"); // :[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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java index 69c9152ef..5b286814a 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPostProcessor.java @@ -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); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultJpaContext.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultJpaContext.java index 1672f0ee4..4f0bb1dc0 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultJpaContext.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultJpaContext.java @@ -44,8 +44,8 @@ public class DefaultJpaContext implements JpaContext { */ public DefaultJpaContext(Set 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 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)); } } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultQueryHints.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultQueryHints.java index 9d8d11451..67d19a550 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultQueryHints.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/DefaultQueryHints.java @@ -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); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByExample.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByExample.java index 315244a3a..8e27ab733 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByExample.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByExample.java @@ -81,7 +81,7 @@ class FetchableFluentQueryByExample extends FluentQuerySupport imple @Override public FetchableFluentQuery 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 extends FluentQuerySupport imple @Override public FetchableFluentQuery as(Class 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."); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByPredicate.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByPredicate.java index 20fe4b717..9eea021af 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByPredicate.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryByPredicate.java @@ -84,7 +84,7 @@ class FetchableFluentQueryByPredicate extends FluentQuerySupport imp @Override public FetchableFluentQuery 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 extends FluentQuerySupport imp @Override public FetchableFluentQuery as(Class 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."); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java index f8061ec5d..1183936e7 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java @@ -78,7 +78,7 @@ class FetchableFluentQueryBySpecification extends FluentQuerySupport @Override public FetchableFluentQuery 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 extends FluentQuerySupport @Override public FetchableFluentQuery as(Class 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."); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformation.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformation.java index 0a75ea183..71345b64d 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformation.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformation.java @@ -54,7 +54,7 @@ public interface JpaEntityInformation extends EntityInformation, 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())); } /** diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java index 29a694881..a242ed224 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupport.java @@ -55,8 +55,8 @@ public abstract class JpaEntityInformationSupport extends AbstractEntityI @SuppressWarnings({ "rawtypes", "unchecked" }) public static JpaEntityInformation getEntityInformation(Class 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(); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java index cdc386df0..f9dfa2065 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java @@ -69,19 +69,19 @@ public class JpaMetamodelEntityInformation extends JpaEntityInformationSu super(domainClass); - Assert.notNull(metamodel, "Metamodel must not be null!"); + Assert.notNull(metamodel, "Metamodel must not be null"); this.metamodel = metamodel; ManagedType 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 identifiableType = (IdentifiableType) type; @@ -201,7 +201,7 @@ public class JpaMetamodelEntityInformation 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 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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java index 46f8624c7..12adf8f2b 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java @@ -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 { - 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()); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryBean.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryBean.java index f093e1247..f866ef06b 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryBean.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryBean.java @@ -103,7 +103,7 @@ public class JpaRepositoryFactoryBean, 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, 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(); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHintValue.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHintValue.java index 6dcd0da94..7052de795 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHintValue.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHintValue.java @@ -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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHints.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHints.java index 9952790e5..8f4ea196b 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHints.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QueryHints.java @@ -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(); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java index 772b8ec5c..cef0b06d1 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/Querydsl.java @@ -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> 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 JPQLQuery applyPagination(Pageable pageable, JPQLQuery 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 JPQLQuery applySorting(Sort sort, JPQLQuery 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 JPQLQuery addOrderByFrom(Sort sort, JPQLQuery 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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java index de10c83bc..c4f4b07b9 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaPredicateExecutor.java @@ -88,7 +88,7 @@ public class QuerydslJpaPredicateExecutor implements QuerydslPredicateExecuto @Override public Optional 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 implements QuerydslPredicateExecuto @Override public List 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 implements QuerydslPredicateExecuto @Override public List 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 implements QuerydslPredicateExecuto @Override public List 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 implements QuerydslPredicateExecuto @Override public List 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 implements QuerydslPredicateExecuto @Override public Page 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 query = querydsl.applyPagination(pageable, createQuery(predicate).select(path)); @@ -147,8 +147,8 @@ public class QuerydslJpaPredicateExecutor implements QuerydslPredicateExecuto @Override public R findBy(Predicate predicate, Function, 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> finder = sort -> { AbstractJPAQuery select = (AbstractJPAQuery) createQuery(predicate).select(path); @@ -202,7 +202,7 @@ public class QuerydslJpaPredicateExecutor 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(); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaRepository.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaRepository.java index 9f093211d..3ef8c5db4 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaRepository.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslJpaRepository.java @@ -120,7 +120,7 @@ public class QuerydslJpaRepository extends SimpleJpa @Override public List 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 extends SimpleJpa @Override public List 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 extends SimpleJpa @Override public Page 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 query = querydsl.applyPagination(pageable, createQuery(predicate).select(path)); diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslRepositorySupport.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslRepositorySupport.java index f4f54c770..89a49edab 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslRepositorySupport.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/QuerydslRepositorySupport.java @@ -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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java index 9f4552d96..f968c86ff 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java @@ -91,7 +91,7 @@ import org.springframework.util.Assert; @Transactional(readOnly = true) public class SimpleJpaRepository implements JpaRepositoryImplementation { - 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 entityInformation; private final EntityManager em; @@ -108,8 +108,8 @@ public class SimpleJpaRepository implements JpaRepositoryImplementation 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 implements JpaRepositoryImplementation 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 implements JpaRepositoryImplementation implements JpaRepositoryImplementation 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 implements JpaRepositoryImplementation 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 implements JpaRepositoryImplementation 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 implements JpaRepositoryImplementation 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 implements JpaRepositoryImplementation findAllById(Iterable 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 implements JpaRepositoryImplementation R findBy(Example example, Function, 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> finder = sort -> { @@ -553,8 +553,8 @@ public class SimpleJpaRepository implements JpaRepositoryImplementation R findBy(Specification spec, Function, 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> finder = sort -> { return getQuery(spec, getDomainClass(), sort); @@ -580,7 +580,7 @@ public class SimpleJpaRepository implements JpaRepositoryImplementation 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 implements JpaRepositoryImplementation List saveAll(Iterable entities) { - Assert.notNull(entities, "Entities must not be null!"); + Assert.notNull(entities, "Entities must not be null"); List result = new ArrayList<>(); @@ -770,8 +770,8 @@ public class SimpleJpaRepository implements JpaRepositoryImplementation Root applySpecificationToCriteria(@Nullable Specification spec, Class domainClass, CriteriaQuery 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 root = query.from(domainClass); @@ -829,7 +829,7 @@ public class SimpleJpaRepository implements JpaRepositoryImplementation query) { - Assert.notNull(query, "TypedQuery must not be null!"); + Assert.notNull(query, "TypedQuery must not be null"); List totals = query.getResultList(); long total = 0L; @@ -898,8 +898,8 @@ public class SimpleJpaRepository implements JpaRepositoryImplementation 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; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java index 3b85ad653..77b91782d 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java @@ -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 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); } } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/MergingPersistenceUnitManager.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/MergingPersistenceUnitManager.java index c729ba812..40d8224aa 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/MergingPersistenceUnitManager.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/support/MergingPersistenceUnitManager.java @@ -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); } diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/util/JpaMetamodel.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/util/JpaMetamodel.java index 963e48d0a..e34c940eb 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/util/JpaMetamodel.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/util/JpaMetamodel.java @@ -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; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java index b9f331f7c..63570f18a 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/AuditorAwareStub.java @@ -36,7 +36,7 @@ public class AuditorAwareStub implements AuditorAware { public AuditorAwareStub(AuditableUserRepository repository) { - Assert.notNull(repository, "AuditableUserRepository must not be null!"); + Assert.notNull(repository, "AuditableUserRepository must not be null"); this.repository = repository; } diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java index 6b100acc0..e3cacb124 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java @@ -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; } diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/infrastructure/HibernateTestUtils.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/infrastructure/HibernateTestUtils.java index 29ffe8ccb..5e4cfb915 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/infrastructure/HibernateTestUtils.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/infrastructure/HibernateTestUtils.java @@ -55,6 +55,6 @@ public class HibernateTestUtils { } } - throw new IllegalStateException("Could not obtain Hibernate PersistenceProvider!"); + throw new IllegalStateException("Could not obtain Hibernate PersistenceProvider"); } } diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java index 2dbc99d01..fa58802e6 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java @@ -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); } diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java index 55f1a3021..574682081 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java @@ -51,7 +51,7 @@ class CdiExtensionIntegrationTests { .addPackages(PersonRepository.class) // .initialize(); - LOGGER.debug("CDI container bootstrapped!"); + LOGGER.debug("CDI container bootstrapped"); } @AfterAll diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/JpaQueryRewriterWithCdiIntegrationTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/JpaQueryRewriterWithCdiIntegrationTests.java index 3077542d7..596b46d90 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/JpaQueryRewriterWithCdiIntegrationTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/cdi/JpaQueryRewriterWithCdiIntegrationTests.java @@ -67,7 +67,7 @@ public class JpaQueryRewriterWithCdiIntegrationTests { .addPackages(UserRepositoryWithRewriter.class) // .initialize(); - LOGGER.debug("CDI container bootstrapped!"); + LOGGER.debug("CDI container bootstrapped"); } @AfterAll diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsTests.java index b50bd96da..e2192de93 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsTests.java @@ -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()) // diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java index 745d6cac5..d95ca2306 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java @@ -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); diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java index e79fa55c6..e0177b213 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java @@ -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; } diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactoryUnitTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactoryUnitTests.java index ee126b039..832dbc0ff 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactoryUnitTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/QueryParameterSetterFactoryUnitTests.java @@ -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"); } } diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/sample/UserRepositoryImpl.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/sample/UserRepositoryImpl.java index 0110d4560..4757e2a54 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/sample/UserRepositoryImpl.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/sample/UserRepositoryImpl.java @@ -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"); } } diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java index f922babaf..c632917f7 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java @@ -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"); } }; }