Skip to content

Commit

Permalink
Remove punctuation in Exception messages.
Browse files Browse the repository at this point in the history
Closes #2566.
  • Loading branch information
jxblum committed Jun 8, 2022
1 parent 48790ad commit b57eb85
Show file tree
Hide file tree
Showing 77 changed files with 323 additions and 323 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class EnversRevisionRepositoryImpl<T, ID, N extends Number & Comparable<N
public EnversRevisionRepositoryImpl(JpaEntityInformation<T, ?> entityInformation,
RevisionEntityInformation revisionEntityInformation, EntityManager entityManager) {

Assert.notNull(revisionEntityInformation, "RevisionEntityInformation must not be null!");
Assert.notNull(revisionEntityInformation, "RevisionEntityInformation must not be null");

this.entityInformation = entityInformation;
this.entityManager = entityManager;
Expand All @@ -91,7 +91,7 @@ public Optional<Revision<N, T>> findLastChangeRevision(ID id) {
.setMaxResults(1) //
.getResultList();

Assert.state(singleResult.size() <= 1, "We expect at most one result.");
Assert.state(singleResult.size() <= 1, "We expect at most one result");

if (singleResult.isEmpty()) {
return Optional.empty();
Expand All @@ -104,14 +104,14 @@ public Optional<Revision<N, T>> findLastChangeRevision(ID id) {
@SuppressWarnings("unchecked")
public Optional<Revision<N, T>> findRevision(ID id, N revisionNumber) {

Assert.notNull(id, "Identifier must not be null!");
Assert.notNull(revisionNumber, "Revision number must not be null!");
Assert.notNull(id, "Identifier must not be null");
Assert.notNull(revisionNumber, "Revision number must not be null");

List<Object[]> singleResult = (List<Object[]>) createBaseQuery(id) //
.add(AuditEntity.revisionNumber().eq(revisionNumber)) //
.getResultList();

Assert.state(singleResult.size() <= 1, "We expect at most one result.");
Assert.state(singleResult.size() <= 1, "We expect at most one result");

if (singleResult.isEmpty()) {
return Optional.empty();
Expand Down Expand Up @@ -185,7 +185,7 @@ static class QueryResult<T> {
Assert.notNull(data, "Data must not be null");
Assert.isTrue( //
data.length == 3, //
() -> String.format("Data must have length three, but has length %d.", data.length));
() -> String.format("Data must have length three, but has length %d", data.length));
Assert.isTrue( //
data[2] instanceof RevisionType, //
() -> String.format("The third array element must be of type Revision type, but is of type %s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public static <T> Predicate getPredicate(Root<T> root, CriteriaBuilder cb, Examp
public static <T> Predicate getPredicate(Root<T> root, CriteriaBuilder cb, Example<T> example,
EscapeCharacter escapeCharacter) {

Assert.notNull(root, "Root must not be null!");
Assert.notNull(cb, "CriteriaBuilder must not be null!");
Assert.notNull(example, "Example must not be null!");
Assert.notNull(root, "Root must not be null");
Assert.notNull(cb, "CriteriaBuilder must not be null");
Assert.notNull(example, "Example must not be null");

ExampleMatcher matcher = example.getMatcher();

Expand Down Expand Up @@ -167,7 +167,7 @@ static List<Predicate> getPredicates(String path, CriteriaBuilder cb, Path<?> fr
PathNode node = currentNode.add(attribute.getName(), attributeValue);
if (node.spansCycle()) {
throw new InvalidDataAccessApiUsageException(
String.format("Path '%s' from root %s must not span a cyclic property reference!%n%s", currentPath,
String.format("Path '%s' from root %s must not span a cyclic property reference%n%s", currentPath,
ClassUtils.getShortName(probeType), node));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static JpaSort of(Direction direction, Path<?, ?>... paths) {
*/
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));
}
Expand All @@ -159,7 +159,7 @@ public JpaSort and(@Nullable Direction direction, Attribute<?, ?>... attributes)
*/
public JpaSort and(@Nullable Direction direction, Path<?, ?>... paths) {

Assert.notNull(paths, "Paths must not be null!");
Assert.notNull(paths, "Paths must not be null");

List<Order> existing = new ArrayList<>();

Expand All @@ -179,7 +179,7 @@ public JpaSort and(@Nullable Direction direction, Path<?, ?>... paths) {
*/
public JpaSort andUnsafe(@Nullable Direction direction, String... properties) {

Assert.notEmpty(properties, "Properties must not be empty!");
Assert.notEmpty(properties, "Properties must not be empty");

List<Order> orders = new ArrayList<>();

Expand All @@ -202,8 +202,8 @@ public JpaSort andUnsafe(@Nullable Direction direction, String... properties) {
*/
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];

Expand Down Expand Up @@ -233,7 +233,7 @@ private static List<Order> combine(List<Order> orders, @Nullable Direction direc
*/
public static <A extends Attribute<T, S>, T, S> Path<T, S> path(A attribute) {

Assert.notNull(attribute, "Attribute must not be null!");
Assert.notNull(attribute, "Attribute must not be null");
return new Path<>(Collections.singletonList(attribute));
}

Expand All @@ -245,7 +245,7 @@ public static <A extends Attribute<T, S>, T, S> Path<T, S> path(A attribute) {
*/
public static <P extends PluralAttribute<T, ?, S>, T, S> Path<T, S> path(P attribute) {

Assert.notNull(attribute, "Attribute must not be null!");
Assert.notNull(attribute, "Attribute must not be null");
return new Path<>(Collections.singletonList(attribute));
}

Expand All @@ -268,9 +268,9 @@ public static JpaSort unsafe(String... properties) {
*/
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));
}
Expand All @@ -284,7 +284,7 @@ public static JpaSort unsafe(Direction direction, String... properties) {
*/
public static JpaSort unsafe(Direction direction, List<String> properties) {

Assert.notEmpty(properties, "Properties must not be empty!");
Assert.notEmpty(properties, "Properties must not be empty");

List<Order> orders = new ArrayList<>(properties.size());

Expand Down Expand Up @@ -330,7 +330,7 @@ public <A extends Attribute<S, U>, U> Path<S, U> dot(A attribute) {

private List<Attribute<?, ?>> add(Attribute<?, ?> attribute) {

Assert.notNull(attribute, "Attribute must not be null!");
Assert.notNull(attribute, "Attribute must not be null");

List<Attribute<?, ?>> newAttributes = new ArrayList<Attribute<?, ?>>(attributes.size() + 1);
newAttributes.addAll(attributes);
Expand Down Expand Up @@ -415,8 +415,8 @@ public JpaOrder with(NullHandling nullHandling) {
*/
public Sort withUnsafe(String... properties) {

Assert.notEmpty(properties, "Properties must not be empty!");
Assert.noNullElements(properties, "Properties must not contain null values!");
Assert.notEmpty(properties, "Properties must not be empty");
Assert.noNullElements(properties, "Properties must not contain null values");

List<Order> orders = new ArrayList<>(properties.length);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
getBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME, beanFactory);
} catch (NoSuchBeanDefinitionException o_O) {
throw new IllegalStateException(
"Invalid auditing setup! Make sure you've used @EnableJpaAuditing or <jpa:auditing /> correctly!", o_O);
"Invalid auditing setup; Make sure you've used @EnableJpaAuditing or <jpa:auditing /> correctly", o_O);
}

for (String beanName : getEntityManagerFactoryBeanNames(beanFactory)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class AuditingEntityListener {
*/
public void setAuditingHandler(ObjectFactory<AuditingHandler> auditingHandler) {

Assert.notNull(auditingHandler, "AuditingHandler must not be null!");
Assert.notNull(auditingHandler, "AuditingHandler must not be null");
this.handler = auditingHandler;
}

Expand All @@ -83,7 +83,7 @@ public void setAuditingHandler(ObjectFactory<AuditingHandler> auditingHandler) {
@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) {

Expand All @@ -103,7 +103,7 @@ public void touchForCreate(Object target) {
@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) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public class JpaMetamodelMappingContext
*/
public JpaMetamodelMappingContext(Set<Metamodel> models) {

Assert.notNull(models, "JPA metamodel must not be null!");
Assert.notEmpty(models, "JPA metamodel must not be empty!");
Assert.notNull(models, "JPA metamodel must not be null");
Assert.notEmpty(models, "JPA metamodel must not be empty");

this.models = new Metamodels(models);
this.persistenceProvider = PersistenceProvider.fromMetamodel(models.iterator().next());
Expand Down Expand Up @@ -137,7 +137,7 @@ public JpaMetamodel getRequiredMetamodel(TypeInformation<?> type) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class JpaPersistentEntityImpl<T> extends BasicPersistentEntity<T, JpaPersistentP

private static final String INVALID_VERSION_ANNOTATION = "%s is annotated with "
+ org.springframework.data.annotation.Version.class.getName() + " but needs to use "
+ jakarta.persistence.Version.class.getName() + " to trigger optimistic locking correctly!";
+ jakarta.persistence.Version.class.getName() + " to trigger optimistic locking correctly";

private final ProxyIdAccessor proxyIdAccessor;
private final JpaMetamodel metamodel;
Expand All @@ -58,7 +58,7 @@ public JpaPersistentEntityImpl(TypeInformation<T> information, ProxyIdAccessor p

super(information, null);

Assert.notNull(proxyIdAccessor, "ProxyIdAccessor must not be null!");
Assert.notNull(proxyIdAccessor, "ProxyIdAccessor must not be null");
this.proxyIdAccessor = proxyIdAccessor;
this.metamodel = metamodel;
}
Expand Down Expand Up @@ -113,7 +113,7 @@ private static class JpaProxyAwareIdentifierAccessor extends IdPropertyIdentifie

super(entity, bean);

Assert.notNull(proxyIdAccessor, "Proxy identifier accessor must not be null!");
Assert.notNull(proxyIdAccessor, "Proxy identifier accessor must not be null");

this.proxyIdAccessor = proxyIdAccessor;
this.bean = bean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public JpaPersistentPropertyImpl(JpaMetamodel metamodel, Property property,

super(property, owner, simpleTypeHolder);

Assert.notNull(metamodel, "Metamodel must not be null!");
Assert.notNull(metamodel, "Metamodel must not be null");

this.isAssociation = Lazy.of(() -> super.isAssociation() //
|| ASSOCIATION_ANNOTATIONS.stream().anyMatch(this::isAnnotationPresent));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public static boolean isMetamodelOfType(Metamodel metamodel, String type) {

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private static PersistenceProvider cacheAndReturn(Class<?> type, PersistenceProv
*/
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);
Expand Down Expand Up @@ -229,7 +229,7 @@ public static PersistenceProvider fromEntityManager(EntityManager em) {
*/
public static PersistenceProvider fromMetamodel(Metamodel metamodel) {

Assert.notNull(metamodel, "Metamodel must not be null!");
Assert.notNull(metamodel, "Metamodel must not be null");

Class<? extends Metamodel> metamodelType = metamodel.getClass();
PersistenceProvider cachedProvider = CACHE.get(metamodelType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class JpaRepositoryBean<T> extends CdiRepositoryBean<T> {

super(qualifiers, repositoryType, beanManager, detector);

Assert.notNull(entityManagerBean, "EntityManager bean must not be null!");
Assert.notNull(entityManagerBean, "EntityManager bean must not be null");
this.entityManagerBean = entityManagerBean;
this.queryRewriterProvider = new BeanManagerQueryRewriterProvider(beanManager);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
private final Map<Set<Annotation>, Bean<EntityManager>> entityManagers = new HashMap<>();

public JpaRepositoryExtension() {
LOGGER.info("Activating CDI extension for Spring Data JPA repositories.");
LOGGER.info("Activating CDI extension for Spring Data JPA repositories");
}

/**
Expand All @@ -71,7 +71,7 @@ <X> void processBean(@Observes ProcessBean<X> processBean) {
if (type instanceof Class<?> && EntityManager.class.isAssignableFrom((Class<?>) type)) {
Set<Annotation> qualifiers = new HashSet<>(bean.getQualifiers());
if (bean.isAlternative() || !entityManagers.containsKey(qualifiers)) {
LOGGER.debug(String.format("Discovered '%s' with qualifiers %s.", EntityManager.class.getName(), qualifiers));
LOGGER.debug(String.format("Discovered '%s' with qualifiers %s", EntityManager.class.getName(), qualifiers));
entityManagers.put(qualifiers, (Bean<EntityManager>) bean);
}
}
Expand All @@ -94,7 +94,7 @@ void afterBeanDiscovery(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanMan

// 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);
Expand All @@ -117,7 +117,7 @@ private <T> CdiRepositoryBean<T> createRepositoryBean(Class<T> repositoryType, S
Bean<EntityManager> entityManagerBean = entityManagers.get(qualifiers);

if (entityManagerBean == null) {
throw new UnsatisfiedResolutionException(String.format("Unable to resolve a bean for '%s' with qualifiers %s.",
throw new UnsatisfiedResolutionException(String.format("Unable to resolve a bean for '%s' with qualifiers %s",
EntityManager.class.getName(), qualifiers));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public BeanDefinition parse(Element element, ParserContext parserContext) {
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingCon
@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);
Expand Down Expand Up @@ -106,10 +106,10 @@ private void registerBeanConfigurerAspectIfNecessary(BeanDefinitionRegistry regi
}

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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected JpaMetamodelMappingContext createInstance() {
context.initialize();

if (LOG.isDebugEnabled()) {
LOG.debug("Finished initializing JpaMetamodelMappingContext!");
LOG.debug("Finished initializing JpaMetamodelMappingContext");
}

return context;
Expand All @@ -83,7 +83,7 @@ protected JpaMetamodelMappingContext createInstance() {
private Set<Metamodel> getMetamodels() {

if (beanFactory == null) {
throw new IllegalStateException("BeanFactory must not be null!");
throw new IllegalStateException("BeanFactory must not be null");
}

Collection<EntityManagerFactory> factories = BeanFactoryUtils
Expand Down
Loading

0 comments on commit b57eb85

Please sign in to comment.