Skip to content

Commit 0c7410a

Browse files
committed
Polish for Exception message punctuation cleanup.
Closes spring-projects#2603.
1 parent e3cf3f2 commit 0c7410a

File tree

226 files changed

+781
-786
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

+781
-786
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ final class AnnotationAuditingMetadata {
8484
*/
8585
private AnnotationAuditingMetadata(Class<?> type) {
8686

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

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

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public AuditingHandler(
6464
public AuditingHandler(PersistentEntities entities) {
6565

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

6969
this.auditorAware = Optional.empty();
7070
}
@@ -76,7 +76,7 @@ public AuditingHandler(PersistentEntities entities) {
7676
*/
7777
public void setAuditorAware(AuditorAware<?> auditorAware) {
7878

79-
Assert.notNull(auditorAware, "AuditorAware must not be null!");
79+
Assert.notNull(auditorAware, "AuditorAware must not be null");
8080
this.auditorAware = Optional.of(auditorAware);
8181
}
8282

@@ -87,7 +87,7 @@ public void setAuditorAware(AuditorAware<?> auditorAware) {
8787
*/
8888
public <T> T markCreated(T source) {
8989

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

9292
return markCreated(getAuditor(), source);
9393
}
@@ -99,7 +99,7 @@ public <T> T markCreated(T source) {
9999
*/
100100
public <T> T markModified(T source) {
101101

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

104104
return markModified(getAuditor(), source);
105105
}
@@ -117,7 +117,7 @@ Auditor<?> getAuditor() {
117117
public void afterPropertiesSet() {
118118

119119
if (!auditorAware.isPresent()) {
120-
logger.debug("No AuditorAware set! Auditing will not be applied!");
120+
logger.debug("No AuditorAware set; Auditing will not be applied");
121121
}
122122
}
123123
}

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

Lines changed: 7 additions & 7 deletions
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, bool
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, bool
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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ConversionService getConversionService() {
7272
@SuppressWarnings("unchecked")
7373
public <T> Optional<AuditableBeanWrapper<T>> getBeanWrapperFor(T source) {
7474

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

7777
return Optional.of(source).map(it -> {
7878

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

217217
if (!conversionService.canConvert(value.getClass(), Date.class)) {
218218
throw new IllegalArgumentException(
219-
String.format("Cannot convert date type for member %s! From %s to java.util.Date to %s", source,
219+
String.format("Cannot convert date type for member %s; From %s to java.util.Date to %s", source,
220220
value.getClass(), targetType));
221221
}
222222

@@ -256,7 +256,7 @@ protected <S extends TemporalAccessor> Optional<S> getAsTemporalAccessor(Optiona
256256
}
257257

258258
private static IllegalArgumentException rejectUnsupportedType(Object source) {
259-
return new IllegalArgumentException(String.format("Invalid date type %s for member %s! Supported types are %s",
259+
return new IllegalArgumentException(String.format("Invalid date type %s for member %s; Supported types are %s",
260260
source.getClass(), source, AnnotationAuditingMetadata.SUPPORTED_DATE_TYPES));
261261
}
262262

@@ -279,7 +279,7 @@ static class ReflectionAuditingBeanWrapper<T> extends DateConvertingAuditableBea
279279
public ReflectionAuditingBeanWrapper(ConversionService conversionService, T target) {
280280
super(conversionService);
281281

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

284284
this.metadata = AnnotationAuditingMetadata.getMetadata(target.getClass());
285285
this.target = target;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public IsNewAwareAuditingHandler(PersistentEntities entities) {
6969
*/
7070
public Object markAudited(Object object) {
7171

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

7474
if (!isAuditable(object)) {
7575
return object;

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

Lines changed: 4 additions & 4 deletions
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<>();
@@ -122,7 +122,7 @@ static class MappingAuditingMetadata {
122122
*/
123123
public <P> MappingAuditingMetadata(MappingContext<?, ? extends PersistentProperty<?>> context, Class<?> type) {
124124

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

127127
this.createdByPaths = findPropertyPaths(type, CreatedBy.class, context);
128128
this.createdDatePaths = findPropertyPaths(type, CreatedDate.class, context);
@@ -188,8 +188,8 @@ public MappingMetadataAuditableBeanWrapper(
188188
MappingAuditingMetadata metadata) {
189189
super(conversionService);
190190

191-
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null!");
192-
Assert.notNull(metadata, "Auditing metadata must not be null!");
191+
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null");
192+
Assert.notNull(metadata, "Auditing metadata must not be null");
193193

194194
this.accessor = accessor;
195195
this.metadata = metadata;

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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public abstract class AuditingBeanDefinitionRegistrarSupport implements ImportBe
5757
@Override
5858
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
5959

60-
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!");
61-
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
60+
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null");
61+
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
6262

6363
AbstractBeanDefinition ahbd = registerAuditHandlerBeanDefinition(registry, getConfiguration(annotationMetadata));
6464
registerAuditListenerBeanDefinition(ahbd, registry);
@@ -74,8 +74,8 @@ public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanD
7474
private AbstractBeanDefinition registerAuditHandlerBeanDefinition(BeanDefinitionRegistry registry,
7575
AuditingConfiguration configuration) {
7676

77-
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
78-
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
77+
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
78+
Assert.notNull(configuration, "AuditingConfiguration must not be null");
7979

8080
AbstractBeanDefinition ahbd = getAuditHandlerBeanDefinitionBuilder(configuration).getBeanDefinition();
8181
registry.registerBeanDefinition(getAuditingHandlerBeanName(), ahbd);
@@ -91,7 +91,7 @@ private AbstractBeanDefinition registerAuditHandlerBeanDefinition(BeanDefinition
9191
*/
9292
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
9393

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

9696
return configureDefaultAuditHandlerAttributes(configuration,
9797
BeanDefinitionBuilder.rootBeanDefinition(AuditingHandler.class));

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public class BeanComponentDefinitionBuilder {
4343
*/
4444
public BeanComponentDefinitionBuilder(Element defaultSource, ParserContext context) {
4545

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

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

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

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

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

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

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

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

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

Lines changed: 3 additions & 3 deletions
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)