Skip to content

Commit 8721ab4

Browse files
committed
Polish for Exception message punctuation cleanup.
Closes spring-projects#2603.
1 parent 6a23723 commit 8721ab4

File tree

226 files changed

+762
-764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+762
-764
lines changed

src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ final class AnnotationAuditingMetadata {
7878
*/
7979
private AnnotationAuditingMetadata(Class<?> type) {
8080

81-
Assert.notNull(type, "Given type must not be null!");
81+
Assert.notNull(type, "Given type must not be null");
8282

8383
this.createdByField = Optional.ofNullable(ReflectionUtils.findField(type, CREATED_BY_FILTER));
8484
this.createdDateField = Optional.ofNullable(ReflectionUtils.findField(type, CREATED_DATE_FILTER));

src/main/java/org/springframework/data/auditing/AuditingHandler.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
4848
public AuditingHandler(PersistentEntities entities) {
4949

5050
super(entities);
51-
Assert.notNull(entities, "PersistentEntities must not be null!");
51+
Assert.notNull(entities, "PersistentEntities must not be null");
5252

5353
this.auditorAware = Optional.empty();
5454
}
@@ -60,7 +60,7 @@ public AuditingHandler(PersistentEntities entities) {
6060
*/
6161
public void setAuditorAware(AuditorAware<?> auditorAware) {
6262

63-
Assert.notNull(auditorAware, "AuditorAware must not be null!");
63+
Assert.notNull(auditorAware, "AuditorAware must not be null");
6464
this.auditorAware = Optional.of(auditorAware);
6565
}
6666

@@ -71,7 +71,7 @@ public void setAuditorAware(AuditorAware<?> auditorAware) {
7171
*/
7272
public <T> T markCreated(T source) {
7373

74-
Assert.notNull(source, "Entity must not be null!");
74+
Assert.notNull(source, "Entity must not be null");
7575

7676
return markCreated(getAuditor(), source);
7777
}
@@ -83,7 +83,7 @@ public <T> T markCreated(T source) {
8383
*/
8484
public <T> T markModified(T source) {
8585

86-
Assert.notNull(source, "Entity must not be null!");
86+
Assert.notNull(source, "Entity must not be null");
8787

8888
return markModified(getAuditor(), source);
8989
}
@@ -97,7 +97,7 @@ Auditor<?> getAuditor() {
9797
public void afterPropertiesSet() {
9898

9999
if (!auditorAware.isPresent()) {
100-
logger.debug("No AuditorAware set! Auditing will not be applied!");
100+
logger.debug("No AuditorAware set; Auditing will not be applied");
101101
}
102102
}
103103
}

src/main/java/org/springframework/data/auditing/AuditingHandlerSupport.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public abstract class AuditingHandlerSupport {
5353
*/
5454
public AuditingHandlerSupport(PersistentEntities entities) {
5555

56-
Assert.notNull(entities, "PersistentEntities must not be null!");
56+
Assert.notNull(entities, "PersistentEntities must not be null");
5757

5858
this.factory = new MappingAuditableBeanWrapperFactory(entities);
5959
}
@@ -96,7 +96,7 @@ public void setDateTimeProvider(@Nullable DateTimeProvider dateTimeProvider) {
9696
*/
9797
protected final boolean isAuditable(Object source) {
9898

99-
Assert.notNull(source, "Source entity must not be null!");
99+
Assert.notNull(source, "Source entity must not be null");
100100

101101
return factory.getBeanWrapperFor(source).isPresent();
102102
}
@@ -109,7 +109,7 @@ protected final boolean isAuditable(Object source) {
109109
*/
110110
<T> T markCreated(Auditor<?> auditor, T source) {
111111

112-
Assert.notNull(source, "Source entity must not be null!");
112+
Assert.notNull(source, "Source entity must not be null");
113113

114114
return touch(auditor, source, true);
115115
}
@@ -122,7 +122,7 @@ <T> T markCreated(Auditor<?> auditor, T source) {
122122
*/
123123
<T> T markModified(Auditor<?> auditor, T source) {
124124

125-
Assert.notNull(source, "Source entity must not be null!");
125+
Assert.notNull(source, "Source entity must not be null");
126126

127127
return touch(auditor, source, false);
128128
}
@@ -163,7 +163,7 @@ private void touchAuditor(Auditor<?> auditor, AuditableBeanWrapper<?> wrapper, b
163163
return;
164164
}
165165

166-
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!");
166+
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null");
167167

168168
if (isNew) {
169169
wrapper.setCreatedBy(auditor.getValue());
@@ -183,11 +183,11 @@ private void touchAuditor(Auditor<?> auditor, AuditableBeanWrapper<?> wrapper, b
183183
*/
184184
private Optional<TemporalAccessor> touchDate(AuditableBeanWrapper<?> wrapper, boolean isNew) {
185185

186-
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null!");
186+
Assert.notNull(wrapper, "AuditableBeanWrapper must not be null");
187187

188188
Optional<TemporalAccessor> now = dateTimeProvider.getNow();
189189

190-
Assert.notNull(now, () -> String.format("Now must not be null! Returned by: %s!", dateTimeProvider.getClass()));
190+
Assert.notNull(now, () -> String.format("Now must not be null Returned by: %s", dateTimeProvider.getClass()));
191191

192192
now.filter(__ -> isNew).ifPresent(wrapper::setCreatedDate);
193193
now.filter(__ -> !isNew || modifyOnCreation).ifPresent(wrapper::setLastModifiedDate);

src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ConversionService getConversionService() {
6868
@SuppressWarnings("unchecked")
6969
public <T> Optional<AuditableBeanWrapper<T>> getBeanWrapperFor(T source) {
7070

71-
Assert.notNull(source, "Source must not be null!");
71+
Assert.notNull(source, "Source must not be null");
7272

7373
return Optional.of(source).map(it -> {
7474

@@ -188,7 +188,7 @@ protected Object getDateValueToSet(TemporalAccessor value, Class<?> targetType,
188188

189189
if (!conversionService.canConvert(value.getClass(), Date.class)) {
190190
throw new IllegalArgumentException(
191-
String.format("Cannot convert date type for member %s! From %s to java.util.Date to %s", source,
191+
String.format("Cannot convert date type for member %s; From %s to java.util.Date to %s", source,
192192
value.getClass(), targetType));
193193
}
194194

@@ -228,7 +228,7 @@ protected <S extends TemporalAccessor> Optional<S> getAsTemporalAccessor(Optiona
228228
}
229229

230230
private static IllegalArgumentException rejectUnsupportedType(Object source) {
231-
return new IllegalArgumentException(String.format("Invalid date type %s for member %s! Supported types are %s",
231+
return new IllegalArgumentException(String.format("Invalid date type %s for member %s; Supported types are %s",
232232
source.getClass(), source, AnnotationAuditingMetadata.SUPPORTED_DATE_TYPES));
233233
}
234234

@@ -251,7 +251,7 @@ static class ReflectionAuditingBeanWrapper<T> extends DateConvertingAuditableBea
251251
public ReflectionAuditingBeanWrapper(ConversionService conversionService, T target) {
252252
super(conversionService);
253253

254-
Assert.notNull(target, "Target object must not be null!");
254+
Assert.notNull(target, "Target object must not be null");
255255

256256
this.metadata = AnnotationAuditingMetadata.getMetadata(target.getClass());
257257
this.target = target;

src/main/java/org/springframework/data/auditing/IsNewAwareAuditingHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public IsNewAwareAuditingHandler(PersistentEntities entities) {
5656
*/
5757
public Object markAudited(Object object) {
5858

59-
Assert.notNull(object, "Source object must not be null!");
59+
Assert.notNull(object, "Source object must not be null");
6060

6161
if (!isAuditable(object)) {
6262
return object;

src/main/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactory.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class MappingAuditableBeanWrapperFactory extends DefaultAuditableBeanWrap
6464
*/
6565
public MappingAuditableBeanWrapperFactory(PersistentEntities entities) {
6666

67-
Assert.notNull(entities, "PersistentEntities must not be null!");
67+
Assert.notNull(entities, "PersistentEntities must not be null");
6868

6969
this.entities = entities;
7070
this.metadataCache = new ConcurrentReferenceHashMap<>();
@@ -118,7 +118,7 @@ static class MappingAuditingMetadata {
118118
*/
119119
public <P> MappingAuditingMetadata(MappingContext<?, ? extends PersistentProperty<?>> context, Class<?> type) {
120120

121-
Assert.notNull(type, "Type must not be null!");
121+
Assert.notNull(type, "Type must not be null");
122122

123123
this.createdByPaths = findPropertyPaths(type, CreatedBy.class, context);
124124
this.createdDatePaths = findPropertyPaths(type, CreatedDate.class, context);
@@ -184,8 +184,8 @@ public MappingMetadataAuditableBeanWrapper(
184184
MappingAuditingMetadata metadata) {
185185
super(conversionService);
186186

187-
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null!");
188-
Assert.notNull(metadata, "Auditing metadata must not be null!");
187+
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null");
188+
Assert.notNull(metadata, "Auditing metadata must not be null");
189189

190190
this.accessor = accessor;
191191
this.metadata = metadata;

src/main/java/org/springframework/data/auditing/ReactiveAuditingHandler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public ReactiveAuditingHandler(PersistentEntities entities) {
4949
*/
5050
public void setAuditorAware(ReactiveAuditorAware<?> auditorAware) {
5151

52-
Assert.notNull(auditorAware, "AuditorAware must not be null!");
52+
Assert.notNull(auditorAware, "AuditorAware must not be null");
5353
this.auditorAware = auditorAware;
5454
}
5555

@@ -60,7 +60,7 @@ public void setAuditorAware(ReactiveAuditorAware<?> auditorAware) {
6060
*/
6161
public <T> Mono<T> markCreated(T source) {
6262

63-
Assert.notNull(source, "Entity must not be null!");
63+
Assert.notNull(source, "Entity must not be null");
6464

6565
return getAuditor() //
6666
.map(auditor -> markCreated(auditor, source));
@@ -73,7 +73,7 @@ public <T> Mono<T> markCreated(T source) {
7373
*/
7474
public <T> Mono<T> markModified(T source) {
7575

76-
Assert.notNull(source, "Entity must not be null!");
76+
Assert.notNull(source, "Entity must not be null");
7777

7878
return getAuditor() //
7979
.map(auditor -> markModified(auditor, source));

src/main/java/org/springframework/data/auditing/ReactiveIsNewAwareAuditingHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public ReactiveIsNewAwareAuditingHandler(PersistentEntities entities) {
5656
*/
5757
public Mono<Object> markAudited(Object object) {
5858

59-
Assert.notNull(object, "Source object must not be null!");
59+
Assert.notNull(object, "Source object must not be null");
6060

6161
if (!isAuditable(object)) {
6262
return Mono.just(object);

src/main/java/org/springframework/data/auditing/config/AnnotationAuditingConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
public class AnnotationAuditingConfiguration implements AuditingConfiguration {
3333

34-
private static final String MISSING_ANNOTATION_ATTRIBUTES = "Couldn't find annotation attributes for %s in %s!";
34+
private static final String MISSING_ANNOTATION_ATTRIBUTES = "Couldn't find annotation attributes for %s in %s";
3535

3636
private final AnnotationAttributes attributes;
3737

@@ -44,8 +44,8 @@ public class AnnotationAuditingConfiguration implements AuditingConfiguration {
4444
*/
4545
public AnnotationAuditingConfiguration(AnnotationMetadata metadata, Class<? extends Annotation> annotation) {
4646

47-
Assert.notNull(metadata, "AnnotationMetadata must not be null!");
48-
Assert.notNull(annotation, "Annotation must not be null!");
47+
Assert.notNull(metadata, "AnnotationMetadata must not be null");
48+
Assert.notNull(annotation, "Annotation must not be null");
4949

5050
Map<String, Object> attributesSource = metadata.getAnnotationAttributes(annotation.getName());
5151

src/main/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupport.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe
5353
@Override
5454
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
5555

56-
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!");
57-
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
56+
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null");
57+
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
5858

5959
AbstractBeanDefinition ahbd = registerAuditHandlerBeanDefinition(registry, getConfiguration(annotationMetadata));
6060
registerAuditListenerBeanDefinition(ahbd, registry);
@@ -70,8 +70,8 @@ public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanD
7070
private AbstractBeanDefinition registerAuditHandlerBeanDefinition(BeanDefinitionRegistry registry,
7171
AuditingConfiguration configuration) {
7272

73-
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
74-
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
73+
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
74+
Assert.notNull(configuration, "AuditingConfiguration must not be null");
7575

7676
AbstractBeanDefinition ahbd = getAuditHandlerBeanDefinitionBuilder(configuration).getBeanDefinition();
7777
registry.registerBeanDefinition(getAuditingHandlerBeanName(), ahbd);
@@ -87,7 +87,7 @@ private AbstractBeanDefinition registerAuditHandlerBeanDefinition(BeanDefinition
8787
*/
8888
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
8989

90-
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
90+
Assert.notNull(configuration, "AuditingConfiguration must not be null");
9191

9292
return configureDefaultAuditHandlerAttributes(configuration,
9393
BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class));

src/main/java/org/springframework/data/auditing/config/AuditingHandlerBeanDefinitionParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class AuditingHandlerBeanDefinitionParser extends AbstractSingleBeanDefin
5656
@SuppressWarnings("null")
5757
public AuditingHandlerBeanDefinitionParser(String mappingContextBeanName) {
5858

59-
Assert.hasText(mappingContextBeanName, "MappingContext bean name must not be null!");
59+
Assert.hasText(mappingContextBeanName, "MappingContext bean name must not be null");
6060
this.mappingContextBeanName = mappingContextBeanName;
6161
}
6262

src/main/java/org/springframework/data/config/BeanComponentDefinitionBuilder.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public class BeanComponentDefinitionBuilder {
4444
*/
4545
public BeanComponentDefinitionBuilder(Element defaultSource, ParserContext context) {
4646

47-
Assert.notNull(defaultSource, "DefaultSource must not be null!");
48-
Assert.notNull(context, "Context must not be null!");
47+
Assert.notNull(defaultSource, "DefaultSource must not be null");
48+
Assert.notNull(context, "Context must not be null");
4949

5050
this.defaultSource = defaultSource;
5151
this.context = context;
@@ -59,7 +59,7 @@ public BeanComponentDefinitionBuilder(Element defaultSource, ParserContext conte
5959
*/
6060
public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder) {
6161

62-
Assert.notNull(builder, "Builder must not be null!");
62+
Assert.notNull(builder, "Builder must not be null");
6363

6464
AbstractBeanDefinition definition = builder.getRawBeanDefinition();
6565
String name = BeanDefinitionReaderUtils.generateBeanName(definition, context.getRegistry(), context.isNested());
@@ -77,7 +77,7 @@ public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder) {
7777
*/
7878
public BeanComponentDefinition getComponentIdButFallback(BeanDefinitionBuilder builder, String fallback) {
7979

80-
Assert.hasText(fallback, "Fallback component id must not be null or empty!");
80+
Assert.hasText(fallback, "Fallback component id must not be null or empty");
8181

8282
String id = defaultSource.getAttribute("id");
8383
return getComponent(builder, StringUtils.hasText(id) ? id : fallback);
@@ -105,8 +105,8 @@ public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder, Strin
105105
*/
106106
public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder, String name, Object rawSource) {
107107

108-
Assert.notNull(builder, "Builder must not be null!");
109-
Assert.hasText(name, "Name of bean must not be null or empty!");
108+
Assert.notNull(builder, "Builder must not be null");
109+
Assert.hasText(name, "Name of bean must not be null or empty");
110110

111111
AbstractBeanDefinition definition = builder.getRawBeanDefinition();
112112
definition.setSource(context.extractSource(rawSource));

src/main/java/org/springframework/data/config/ConfigurationUtils.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface ConfigurationUtils {
4040
*/
4141
public static ResourceLoader getRequiredResourceLoader(XmlReaderContext context) {
4242

43-
Assert.notNull(context, "XmlReaderContext must not be null!");
43+
Assert.notNull(context, "XmlReaderContext must not be null");
4444

4545
ResourceLoader resourceLoader = context.getResourceLoader();
4646

@@ -71,7 +71,7 @@ public static ClassLoader getRequiredClassLoader(XmlReaderContext context) {
7171
*/
7272
public static ClassLoader getRequiredClassLoader(ResourceLoader resourceLoader) {
7373

74-
Assert.notNull(resourceLoader, "ResourceLoader must not be null!");
74+
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
7575

7676
ClassLoader classLoader = resourceLoader.getClassLoader();
7777

@@ -91,7 +91,7 @@ public static ClassLoader getRequiredClassLoader(ResourceLoader resourceLoader)
9191
*/
9292
public static String getRequiredBeanClassName(BeanDefinition beanDefinition) {
9393

94-
Assert.notNull(beanDefinition, "BeanDefinition must not be null!");
94+
Assert.notNull(beanDefinition, "BeanDefinition must not be null");
9595

9696
String result = beanDefinition.getBeanClassName();
9797

0 commit comments

Comments
 (0)