Polish for Exception message punctuation cleanup.

Closes #2603.
This commit is contained in:
John Blum
2022-06-07 11:39:44 -07:00
parent 6a23723f07
commit 8721ab4170
226 changed files with 762 additions and 764 deletions

View File

@@ -78,7 +78,7 @@ final class AnnotationAuditingMetadata {
*/
private AnnotationAuditingMetadata(Class<?> type) {
Assert.notNull(type, "Given type must not be null!");
Assert.notNull(type, "Given type must not be null");
this.createdByField = Optional.ofNullable(ReflectionUtils.findField(type, CREATED_BY_FILTER));
this.createdDateField = Optional.ofNullable(ReflectionUtils.findField(type, CREATED_DATE_FILTER));

View File

@@ -48,7 +48,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
public AuditingHandler(PersistentEntities entities) {
super(entities);
Assert.notNull(entities, "PersistentEntities must not be null!");
Assert.notNull(entities, "PersistentEntities must not be null");
this.auditorAware = Optional.empty();
}
@@ -60,7 +60,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
*/
public void setAuditorAware(AuditorAware<?> auditorAware) {
Assert.notNull(auditorAware, "AuditorAware must not be null!");
Assert.notNull(auditorAware, "AuditorAware must not be null");
this.auditorAware = Optional.of(auditorAware);
}
@@ -71,7 +71,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
*/
public <T> T markCreated(T source) {
Assert.notNull(source, "Entity must not be null!");
Assert.notNull(source, "Entity must not be null");
return markCreated(getAuditor(), source);
}
@@ -83,7 +83,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
*/
public <T> T markModified(T source) {
Assert.notNull(source, "Entity must not be null!");
Assert.notNull(source, "Entity must not be null");
return markModified(getAuditor(), source);
}
@@ -97,7 +97,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
public void afterPropertiesSet() {
if (!auditorAware.isPresent()) {
logger.debug("No AuditorAware set! Auditing will not be applied!");
logger.debug("No AuditorAware set; Auditing will not be applied");
}
}
}

View File

@@ -53,7 +53,7 @@ public abstract class AuditingHandlerSupport {
*/
public AuditingHandlerSupport(PersistentEntities entities) {
Assert.notNull(entities, "PersistentEntities must not be null!");
Assert.notNull(entities, "PersistentEntities must not be null");
this.factory = new MappingAuditableBeanWrapperFactory(entities);
}
@@ -96,7 +96,7 @@ public abstract class AuditingHandlerSupport {
*/
protected final boolean isAuditable(Object source) {
Assert.notNull(source, "Source entity must not be null!");
Assert.notNull(source, "Source entity must not be null");
return factory.getBeanWrapperFor(source).isPresent();
}
@@ -109,7 +109,7 @@ public abstract class AuditingHandlerSupport {
*/
<T> T markCreated(Auditor<?> auditor, T source) {
Assert.notNull(source, "Source entity must not be null!");
Assert.notNull(source, "Source entity must not be null");
return touch(auditor, source, true);
}
@@ -122,7 +122,7 @@ public abstract class AuditingHandlerSupport {
*/
<T> T markModified(Auditor<?> auditor, T source) {
Assert.notNull(source, "Source entity must not be null!");
Assert.notNull(source, "Source entity must not be null");
return touch(auditor, source, false);
}
@@ -163,7 +163,7 @@ public abstract class AuditingHandlerSupport {
return;
}
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!");
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null");
if (isNew) {
wrapper.setCreatedBy(auditor.getValue());
@@ -183,11 +183,11 @@ public abstract class AuditingHandlerSupport {
*/
private Optional<TemporalAccessor> touchDate(AuditableBeanWrapper<?> wrapper, boolean isNew) {
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!");
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null");
Optional<TemporalAccessor> now = dateTimeProvider.getNow();
Assert.notNull(now, () -> String.format("Now must not be null! Returned by: %s!", dateTimeProvider.getClass()));
Assert.notNull(now, () -> String.format("Now must not be null Returned by: %s", dateTimeProvider.getClass()));
now.filter(__ -> isNew).ifPresent(wrapper::setCreatedDate);
now.filter(__ -> !isNew || modifyOnCreation).ifPresent(wrapper::setLastModifiedDate);

View File

@@ -68,7 +68,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
@SuppressWarnings("unchecked")
public <T> Optional<AuditableBeanWrapper<T>> getBeanWrapperFor(T source) {
Assert.notNull(source, "Source must not be null!");
Assert.notNull(source, "Source must not be null");
return Optional.of(source).map(it -> {
@@ -188,7 +188,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
if (!conversionService.canConvert(value.getClass(), Date.class)) {
throw new IllegalArgumentException(
String.format("Cannot convert date type for member %s! From %s to java.util.Date to %s", source,
String.format("Cannot convert date type for member %s; From %s to java.util.Date to %s", source,
value.getClass(), targetType));
}
@@ -228,7 +228,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
}
private static IllegalArgumentException rejectUnsupportedType(Object source) {
return new IllegalArgumentException(String.format("Invalid date type %s for member %s! Supported types are %s",
return new IllegalArgumentException(String.format("Invalid date type %s for member %s; Supported types are %s",
source.getClass(), source, AnnotationAuditingMetadata.SUPPORTED_DATE_TYPES));
}
@@ -251,7 +251,7 @@ class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory
public ReflectionAuditingBeanWrapper(ConversionService conversionService, T target) {
super(conversionService);
Assert.notNull(target, "Target object must not be null!");
Assert.notNull(target, "Target object must not be null");
this.metadata = AnnotationAuditingMetadata.getMetadata(target.getClass());
this.target = target;

View File

@@ -56,7 +56,7 @@ public class IsNewAwareAuditingHandler extends AuditingHandler {
*/
public Object markAudited(Object object) {
Assert.notNull(object, "Source object must not be null!");
Assert.notNull(object, "Source object must not be null");
if (!isAuditable(object)) {
return object;

View File

@@ -64,7 +64,7 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
*/
public MappingAuditableBeanWrapperFactory(PersistentEntities entities) {
Assert.notNull(entities, "PersistentEntities must not be null!");
Assert.notNull(entities, "PersistentEntities must not be null");
this.entities = entities;
this.metadataCache = new ConcurrentReferenceHashMap<>();
@@ -118,7 +118,7 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
*/
public <P> MappingAuditingMetadata(MappingContext<?, ? extends PersistentProperty<?>> context, Class<?> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
this.createdByPaths = findPropertyPaths(type, CreatedBy.class, context);
this.createdDatePaths = findPropertyPaths(type, CreatedDate.class, context);
@@ -184,8 +184,8 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
MappingAuditingMetadata metadata) {
super(conversionService);
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null!");
Assert.notNull(metadata, "Auditing metadata must not be null!");
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null");
Assert.notNull(metadata, "Auditing metadata must not be null");
this.accessor = accessor;
this.metadata = metadata;

View File

@@ -49,7 +49,7 @@ public class ReactiveAuditingHandler extends AuditingHandlerSupport {
*/
public void setAuditorAware(ReactiveAuditorAware<?> auditorAware) {
Assert.notNull(auditorAware, "AuditorAware must not be null!");
Assert.notNull(auditorAware, "AuditorAware must not be null");
this.auditorAware = auditorAware;
}
@@ -60,7 +60,7 @@ public class ReactiveAuditingHandler extends AuditingHandlerSupport {
*/
public <T> Mono<T> markCreated(T source) {
Assert.notNull(source, "Entity must not be null!");
Assert.notNull(source, "Entity must not be null");
return getAuditor() //
.map(auditor -> markCreated(auditor, source));
@@ -73,7 +73,7 @@ public class ReactiveAuditingHandler extends AuditingHandlerSupport {
*/
public <T> Mono<T> markModified(T source) {
Assert.notNull(source, "Entity must not be null!");
Assert.notNull(source, "Entity must not be null");
return getAuditor() //
.map(auditor -> markModified(auditor, source));

View File

@@ -56,7 +56,7 @@ public class ReactiveIsNewAwareAuditingHandler extends ReactiveAuditingHandler {
*/
public Mono<Object> markAudited(Object object) {
Assert.notNull(object, "Source object must not be null!");
Assert.notNull(object, "Source object must not be null");
if (!isAuditable(object)) {
return Mono.just(object);

View File

@@ -31,7 +31,7 @@ import org.springframework.util.Assert;
*/
public class AnnotationAuditingConfiguration implements AuditingConfiguration {
private static final String MISSING_ANNOTATION_ATTRIBUTES = "Couldn't find annotation attributes for %s in %s!";
private static final String MISSING_ANNOTATION_ATTRIBUTES = "Couldn't find annotation attributes for %s in %s";
private final AnnotationAttributes attributes;
@@ -44,8 +44,8 @@ public class AnnotationAuditingConfiguration implements AuditingConfiguration {
*/
public AnnotationAuditingConfiguration(AnnotationMetadata metadata, Class<? extends Annotation> annotation) {
Assert.notNull(metadata, "AnnotationMetadata must not be null!");
Assert.notNull(annotation, "Annotation must not be null!");
Assert.notNull(metadata, "AnnotationMetadata must not be null");
Assert.notNull(annotation, "Annotation must not be null");
Map<String, Object> attributesSource = metadata.getAnnotationAttributes(annotation.getName());

View File

@@ -53,8 +53,8 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe
@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");
AbstractBeanDefinition ahbd = registerAuditHandlerBeanDefinition(registry, getConfiguration(annotationMetadata));
registerAuditListenerBeanDefinition(ahbd, registry);
@@ -70,8 +70,8 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe
private AbstractBeanDefinition registerAuditHandlerBeanDefinition(BeanDefinitionRegistry registry,
AuditingConfiguration configuration) {
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
Assert.notNull(configuration, "AuditingConfiguration must not be null");
AbstractBeanDefinition ahbd = getAuditHandlerBeanDefinitionBuilder(configuration).getBeanDefinition();
registry.registerBeanDefinition(getAuditingHandlerBeanName(), ahbd);
@@ -87,7 +87,7 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe
*/
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
Assert.notNull(configuration, "AuditingConfiguration must not be null");
return configureDefaultAuditHandlerAttributes(configuration,
BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class));

View File

@@ -56,7 +56,7 @@ public class AuditingHandlerBeanDefinitionParser extends AbstractSingleBeanDefin
@SuppressWarnings("null")
public AuditingHandlerBeanDefinitionParser(String mappingContextBeanName) {
Assert.hasText(mappingContextBeanName, "MappingContext bean name must not be null!");
Assert.hasText(mappingContextBeanName, "MappingContext bean name must not be null");
this.mappingContextBeanName = mappingContextBeanName;
}