Skip to content

Commit 29b7305

Browse files
committed
Remove punctuation in Exception messages.
Closes #2152.
1 parent 93d0d74 commit 29b7305

File tree

121 files changed

+478
-478
lines changed

Some content is hidden

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

121 files changed

+478
-478
lines changed

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public LdapName convert(String source) {
3737
try {
3838
return new LdapName(source);
3939
} catch (InvalidNameException e) {
40-
throw new IllegalArgumentException(String.format("Cannot create LdapName for '%s'!", source), e);
40+
throw new IllegalArgumentException(String.format("Cannot create LdapName for '%s'", source), e);
4141
}
4242
}
4343
}

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/UriToEntityConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ public class UriToEntityConverter implements ConditionalGenericConverter {
5959
public UriToEntityConverter(PersistentEntities entities, RepositoryInvokerFactory invokerFactory,
6060
Repositories repositories) {
6161

62-
Assert.notNull(entities, "PersistentEntities must not be null!");
63-
Assert.notNull(invokerFactory, "RepositoryInvokerFactory must not be null!");
64-
Assert.notNull(repositories, "Repositories must not be null!");
62+
Assert.notNull(entities, "PersistentEntities must not be null");
63+
Assert.notNull(invokerFactory, "RepositoryInvokerFactory must not be null");
64+
Assert.notNull(repositories, "Repositories must not be null");
6565

6666
Set<ConvertiblePair> convertiblePairs = new HashSet<ConvertiblePair>();
6767

@@ -108,7 +108,7 @@ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor t
108108

109109
if (parts.length < 2) {
110110
throw new ConversionFailedException(sourceType, targetType, source, new IllegalArgumentException(
111-
"Cannot resolve URI " + uri + ". Is it local or remote? Only local URIs are resolvable."));
111+
"Cannot resolve URI " + uri + "; Is it local or remote; Only local URIs are resolvable"));
112112
}
113113

114114
return invokerFactory.getInvokerFor(targetType.getType()).invokeFindById(parts[parts.length - 1]).orElse(null);

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/ValidationErrors.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public ValidationErrors(Object source, PersistentEntities entities) {
5757

5858
super(source.getClass().getSimpleName());
5959

60-
Assert.notNull(source, "Entity must not be null!");
61-
Assert.notNull(entities, "PersistentEntities must not be null!");
60+
Assert.notNull(source, "Entity must not be null");
61+
Assert.notNull(entities, "PersistentEntities must not be null");
6262

6363
this.entities = entities;
6464
this.source = source;

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/EntityLookupConfiguration.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private class MappingBuilder<T, ID, R extends Repository<T, ?>>
9292
*/
9393
public MappingBuilder(Class<R> type) {
9494

95-
Assert.notNull(type, "Repository type must not be null!");
95+
Assert.notNull(type, "Repository type must not be null");
9696

9797
this.repositoryType = type;
9898
}
@@ -105,7 +105,7 @@ public MappingBuilder(Class<R> type) {
105105
*/
106106
private MappingBuilder(Class<R> repositoryType, Converter<T, ID> mapping) {
107107
this(repositoryType);
108-
Assert.notNull(mapping, "Converter must not be null!");
108+
Assert.notNull(mapping, "Converter must not be null");
109109
this.idMapping = mapping;
110110
}
111111

@@ -134,7 +134,7 @@ public <ID2> LookupRegistrar<T, ID2, R> withIdMapping(Converter<T, ID2> idMappin
134134
*/
135135
public List<EntityLookup<?>> getEntityLookups(Repositories repositories) {
136136

137-
Assert.notNull(repositories, "Repositories must not be null!");
137+
Assert.notNull(repositories, "Repositories must not be null");
138138

139139
return lookupInformation.stream() //
140140
.map(it -> new RepositoriesEntityLookup<>(repositories, it)) //
@@ -166,17 +166,17 @@ private static class RepositoriesEntityLookup<T> implements EntityLookup<T> {
166166
@SuppressWarnings("unchecked")
167167
public RepositoriesEntityLookup(Repositories repositories,
168168
LookupInformation<Object, Object, Repository<? extends T, ?>> lookupInformation) {
169-
Assert.notNull(repositories, "Repositories must not be null!");
170-
Assert.notNull(lookupInformation, "LookupInformation must not be null!");
169+
Assert.notNull(repositories, "Repositories must not be null");
170+
Assert.notNull(lookupInformation, "LookupInformation must not be null");
171171
RepositoryInformation information = //
172172
repositories.getRepositoryInformation(lookupInformation.repositoryType)
173173
.orElseThrow(() -> new IllegalStateException(
174-
"No repository found for type " + lookupInformation.repositoryType.getName() + "!"));
174+
"No repository found for type " + lookupInformation.repositoryType.getName()));
175175
this.domainType = information.getDomainType();
176176
this.lookupInfo = lookupInformation;
177177
this.repository = (Repository<? extends T, ?>) //
178178
repositories.getRepositoryFor(information.getDomainType()).orElseThrow(() -> new IllegalStateException(
179-
"No repository found for type " + information.getDomainType().getName() + "!"));
179+
"No repository found for type " + information.getDomainType().getName()));
180180
this.lookupProperty = //
181181
Optional.of(domainType).flatMap(it -> //
182182
//
@@ -216,9 +216,9 @@ private static final class LookupInformation<T, ID, R extends Repository<? exten
216216
public LookupInformation(Class<R> repositoryType, Converter<T, ID> identifierMapping,
217217
Lookup<R, ID> lookup) {
218218

219-
Assert.notNull(repositoryType, "Repository type must not be null!");
220-
Assert.notNull(identifierMapping, "Identifier mapping must not be null!");
221-
Assert.notNull(lookup, "Lookup must not be null!");
219+
Assert.notNull(repositoryType, "Repository type must not be null");
220+
Assert.notNull(identifierMapping, "Identifier mapping must not be null");
221+
Assert.notNull(lookup, "Lookup must not be null");
222222

223223
this.repositoryType = repositoryType;
224224
this.identifierMapping = identifierMapping;

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/MetadataConfiguration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public boolean alpsEnabled() {
7575

7676
public void registerJsonSchemaFormat(JsonSchemaFormat format, Class<?>... types) {
7777

78-
Assert.notNull(format, "JsonSchemaFormat must not be null!");
78+
Assert.notNull(format, "JsonSchemaFormat must not be null");
7979

8080
for (Class<?> type : types) {
8181
schemaFormats.put(type, format);
@@ -100,8 +100,8 @@ public JsonSchemaFormat getSchemaFormatFor(Class<?> type) {
100100
*/
101101
public void registerFormattingPatternFor(String pattern, Class<?> type) {
102102

103-
Assert.hasText(pattern, "Pattern must not be null or empty!");
104-
Assert.notNull(type, "Type must not be null!");
103+
Assert.hasText(pattern, "Pattern must not be null or empty");
104+
Assert.notNull(type, "Type must not be null");
105105

106106
this.patterns.put(type, Pattern.compile(pattern));
107107
}
@@ -114,7 +114,7 @@ public void registerFormattingPatternFor(String pattern, Class<?> type) {
114114
*/
115115
public Pattern getPatternFor(Class<?> type) {
116116

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

119119
for (Entry<Class<?>, Pattern> entry : this.patterns.entrySet()) {
120120
if (entry.getKey().isAssignableFrom(type)) {

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/ProjectionDefinitionConfiguration.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
public class ProjectionDefinitionConfiguration implements ProjectionDefinitions {
3636

37-
private static final String PROJECTION_ANNOTATION_NOT_FOUND = "Projection annotation not found on %s! Either add the annotation or hand source type to the registration manually!";
37+
private static final String PROJECTION_ANNOTATION_NOT_FOUND = "Projection annotation not found on %s; Either add the annotation or hand source type to the registration manually";
3838
private static final String DEFAULT_PROJECTION_PARAMETER_NAME = "projection";
3939

4040
private final Set<ProjectionDefinition> projectionDefinitions;
@@ -71,7 +71,7 @@ public void setParameterName(String parameterName) {
7171
*/
7272
public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType) {
7373

74-
Assert.notNull(projectionType, "Projection type must not be null!");
74+
Assert.notNull(projectionType, "Projection type must not be null");
7575

7676
Projection annotation = AnnotationUtils.findAnnotation(projectionType, Projection.class);
7777

@@ -97,7 +97,7 @@ public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType)
9797
*/
9898
public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType, Class<?>... sourceTypes) {
9999

100-
Assert.notNull(projectionType, "Projection type must not be null!");
100+
Assert.notNull(projectionType, "Projection type must not be null");
101101

102102
return addProjection(projectionType, StringUtils.uncapitalize(projectionType.getSimpleName()), sourceTypes);
103103
}
@@ -113,9 +113,9 @@ public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType,
113113
public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType, String name,
114114
Class<?>... sourceTypes) {
115115

116-
Assert.notNull(projectionType, "Projection type must not be null!");
117-
Assert.hasText(name, "Name must not be null or empty!");
118-
Assert.notEmpty(sourceTypes, "Source types must not be null!");
116+
Assert.notNull(projectionType, "Projection type must not be null");
117+
Assert.hasText(name, "Name must not be null or empty");
118+
Assert.notEmpty(sourceTypes, "Source types must not be null");
119119

120120
for (Class<?> sourceType : sourceTypes) {
121121
this.projectionDefinitions.add(ProjectionDefinition.of(sourceType, projectionType, name));
@@ -150,7 +150,7 @@ public boolean hasProjectionFor(Class<?> sourceType) {
150150
*/
151151
public Map<String, Class<?>> getProjectionsFor(Class<?> sourceType) {
152152

153-
Assert.notNull(sourceType, "Source type must not be null!");
153+
Assert.notNull(sourceType, "Source type must not be null");
154154

155155
Class<?> userType = ProxyUtils.getUserClass(sourceType);
156156
Map<String, ProjectionDefinition> byName = new HashMap<String, ProjectionDefinition>();
@@ -189,9 +189,9 @@ static final class ProjectionDefinition {
189189

190190
private ProjectionDefinition(Class<?> sourceType, Class<?> targetType, String name) {
191191

192-
Assert.notNull(sourceType, "Source type must not be null!");
193-
Assert.notNull(targetType, "Target type must not be null!");
194-
Assert.notNull(name, "Name must not be null!");
192+
Assert.notNull(sourceType, "Source type must not be null");
193+
Assert.notNull(targetType, "Target type must not be null");
194+
Assert.notNull(name, "Name must not be null");
195195

196196
this.sourceType = sourceType;
197197
this.targetType = targetType;
@@ -207,7 +207,7 @@ private ProjectionDefinition(Class<?> sourceType, Class<?> targetType, String na
207207
*/
208208
static ProjectionDefinition of(Class<?> sourceType, Class<?> targetType, String name) {
209209

210-
Assert.hasText(name, "Name must not be null or empty!");
210+
Assert.hasText(name, "Name must not be null or empty");
211211

212212
return new ProjectionDefinition(sourceType, targetType, name);
213213
}

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public class RepositoryRestConfiguration {
8787
public RepositoryRestConfiguration(ProjectionDefinitionConfiguration projectionConfiguration,
8888
MetadataConfiguration metadataConfiguration, EnumTranslationConfiguration enumTranslationConfiguration) {
8989

90-
Assert.notNull(projectionConfiguration, "ProjectionDefinitionConfiguration must not be null!");
91-
Assert.notNull(metadataConfiguration, "MetadataConfiguration must not be null!");
92-
Assert.notNull(enumTranslationConfiguration, "EnumTranslationConfiguration must not be null!");
90+
Assert.notNull(projectionConfiguration, "ProjectionDefinitionConfiguration must not be null");
91+
Assert.notNull(metadataConfiguration, "MetadataConfiguration must not be null");
92+
Assert.notNull(enumTranslationConfiguration, "EnumTranslationConfiguration must not be null");
9393

9494
this.projectionConfiguration = projectionConfiguration;
9595
this.metadataConfiguration = metadataConfiguration;
@@ -133,7 +133,7 @@ public RepositoryRestConfiguration setBasePath(String basePath) {
133133
basePath = StringUtils.trimTrailingCharacter(basePath, '/');
134134
this.basePath = URI.create(basePath.startsWith("/") ? basePath : "/".concat(basePath));
135135

136-
Assert.isTrue(!this.basePath.isAbsolute(), "Absolute URIs are not supported as base path!");
136+
Assert.isTrue(!this.basePath.isAbsolute(), "Absolute URIs are not supported as base path");
137137

138138
return this;
139139
}
@@ -154,7 +154,7 @@ public int getDefaultPageSize() {
154154
* @return {@literal this}
155155
*/
156156
public RepositoryRestConfiguration setDefaultPageSize(int defaultPageSize) {
157-
Assert.isTrue(defaultPageSize > 0, "Page size must be greater than 0.");
157+
Assert.isTrue(defaultPageSize > 0, "Page size must be greater than 0");
158158
this.defaultPageSize = defaultPageSize;
159159
return this;
160160
}
@@ -175,7 +175,7 @@ public int getMaxPageSize() {
175175
* @return {@literal this}
176176
*/
177177
public RepositoryRestConfiguration setMaxPageSize(int maxPageSize) {
178-
Assert.isTrue(defaultPageSize > 0, "Maximum page size must be greater than 0.");
178+
Assert.isTrue(defaultPageSize > 0, "Maximum page size must be greater than 0");
179179
this.maxPageSize = maxPageSize;
180180
return this;
181181
}
@@ -196,7 +196,7 @@ public String getPageParamName() {
196196
* @return {@literal this}
197197
*/
198198
public RepositoryRestConfiguration setPageParamName(String pageParamName) {
199-
Assert.notNull(pageParamName, "Page param name cannot be null.");
199+
Assert.notNull(pageParamName, "Page param name cannot be null");
200200
this.pageParamName = pageParamName;
201201
return this;
202202
}
@@ -219,7 +219,7 @@ public String getLimitParamName() {
219219
* @return {@literal this}
220220
*/
221221
public RepositoryRestConfiguration setLimitParamName(String limitParamName) {
222-
Assert.notNull(limitParamName, "Limit param name cannot be null.");
222+
Assert.notNull(limitParamName, "Limit param name cannot be null");
223223
this.limitParamName = limitParamName;
224224
return this;
225225
}
@@ -240,7 +240,7 @@ public String getSortParamName() {
240240
* @return {@literal this}
241241
*/
242242
public RepositoryRestConfiguration setSortParamName(String sortParamName) {
243-
Assert.notNull(sortParamName, "Sort param name cannot be null.");
243+
Assert.notNull(sortParamName, "Sort param name cannot be null");
244244
this.sortParamName = sortParamName;
245245
return this;
246246
}
@@ -654,7 +654,7 @@ public EntityLookupRegistrar withEntityLookup() {
654654
*/
655655
public List<EntityLookup<?>> getEntityLookups(Repositories repositories) {
656656

657-
Assert.notNull(repositories, "Repositories must not be null!");
657+
Assert.notNull(repositories, "Repositories must not be null");
658658

659659
return entityLookupConfiguration.getEntityLookups(repositories);
660660
}
@@ -709,7 +709,7 @@ public LinkRelationProvider getLinkRelationProvider() {
709709
*/
710710
public RepositoryRestConfiguration setLinkRelationProvider(LinkRelationProvider provider) {
711711

712-
Assert.notNull(provider, "LinkRelationProvider must not be null!");
712+
Assert.notNull(provider, "LinkRelationProvider must not be null");
713713

714714
this.linkRelationProvider = provider;
715715

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/AnnotatedEventHandlerInvoker.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
public class AnnotatedEventHandlerInvoker implements ApplicationListener<RepositoryEvent>, BeanPostProcessor {
4949

5050
private static final Logger LOG = LoggerFactory.getLogger(AnnotatedEventHandlerInvoker.class);
51-
private static final String PARAMETER_MISSING = "Invalid event handler method %s! At least a single argument is required to determine the domain type for which you are interested in events.";
51+
private static final String PARAMETER_MISSING = "Invalid event handler method %s; At least a single argument is required to determine the domain type for which you are interested in events";
5252

5353
private final MultiValueMap<Class<? extends RepositoryEvent>, EventHandlerMethod> handlerMethods = new LinkedMultiValueMap<Class<? extends RepositoryEvent>, EventHandlerMethod>();
5454

@@ -77,7 +77,7 @@ public void onApplicationEvent(RepositoryEvent event) {
7777
}
7878

7979
if (LOG.isDebugEnabled()) {
80-
LOG.debug("Invoking {} handler for {}.", event.getClass().getSimpleName(), event.getSource());
80+
LOG.debug("Invoking {} handler for {}", event.getClass().getSimpleName(), event.getSource());
8181
}
8282

8383
ReflectionUtils.invokeMethod(handlerMethod.method, handlerMethod.handler, parameters.toArray());
@@ -169,9 +169,9 @@ static class EventHandlerMethod implements Comparable<EventHandlerMethod> {
169169

170170
public EventHandlerMethod(Class<?> targetType, Method method, Object handler) {
171171

172-
Assert.notNull(targetType, "Target type must not be null!");
173-
Assert.notNull(method, "Method must not be null!");
174-
Assert.notNull(handler, "Handler must not be null!");
172+
Assert.notNull(targetType, "Target type must not be null");
173+
Assert.notNull(method, "Method must not be null");
174+
Assert.notNull(handler, "Handler must not be null");
175175

176176
this.targetType = targetType;
177177
this.method = method;

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/event/ValidatingRepositoryEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ValidatingRepositoryEventListener extends AbstractRepositoryEventLi
5454
*/
5555
public ValidatingRepositoryEventListener(ObjectFactory<PersistentEntities> persistentEntitiesFactory) {
5656

57-
Assert.notNull(persistentEntitiesFactory, "PersistentEntities must not be null!");
57+
Assert.notNull(persistentEntitiesFactory, "PersistentEntities must not be null");
5858

5959
this.persistentEntitiesFactory = persistentEntitiesFactory;
6060
this.validators = new LinkedMultiValueMap<String, Validator>();

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/AnnotationBasedResourceDescription.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public class AnnotationBasedResourceDescription extends ResolvableResourceDescri
4040
*/
4141
public AnnotationBasedResourceDescription(Description description, ResourceDescription fallback) {
4242

43-
Assert.notNull(description, "Description must not be null!");
44-
Assert.notNull(fallback, "Fallback resource description must not be null!");
43+
Assert.notNull(description, "Description must not be null");
44+
Assert.notNull(fallback, "Fallback resource description must not be null");
4545

4646
this.message = description.value();
4747
this.fallback = fallback;

0 commit comments

Comments
 (0)