Skip to content

Commit 844b677

Browse files
jojxblum
jo
authored andcommitted
Remove punctuation in all exception messages.
Closes spring-projects#2603.
1 parent 3879e2c commit 844b677

File tree

99 files changed

+275
-174
lines changed

Some content is hidden

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

99 files changed

+275
-174
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* @author Ranie Jade Ramiso
4343
* @author Oliver Gierke
4444
* @author Christoph Strobl
45+
* @author Johannes Englmeier
4546
* @since 1.5
4647
*/
4748
final class AnnotationAuditingMetadata {
@@ -114,7 +115,7 @@ private void assertValidDateFieldType(Optional<Field> field) {
114115
}
115116

116117
throw new IllegalStateException(String.format(
117-
"Found created/modified date field with type %s but only %s as well as java.time types are supported!", type,
118+
"Found created/modified date field with type %s but only %s as well as java.time types are supported", type,
118119
SUPPORTED_DATE_TYPES));
119120
});
120121
}

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @author Christoph Strobl
4141
* @author Jens Schauder
4242
* @author Pavel Horal
43+
* @author Johannes Englmeier
4344
* @since 1.5
4445
*/
4546
class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory {
@@ -215,7 +216,7 @@ protected Object getDateValueToSet(TemporalAccessor value, Class<?> targetType,
215216

216217
if (!conversionService.canConvert(value.getClass(), Date.class)) {
217218
throw new IllegalArgumentException(
218-
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,
219220
value.getClass(), targetType));
220221
}
221222

@@ -255,7 +256,7 @@ protected <S extends TemporalAccessor> Optional<S> getAsTemporalAccessor(Optiona
255256
}
256257

257258
private static IllegalArgumentException rejectUnsupportedType(Object source) {
258-
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",
259260
source.getClass(), source, AnnotationAuditingMetadata.SUPPORTED_DATE_TYPES));
260261
}
261262

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* implementation.
2626
*
2727
* @author Oliver Gierke
28+
* @author Johannes Englmeier
2829
* @since 2.0
2930
* @soundtrack Richard Spaven - The Self (feat. Jordan Rakei)
3031
*/
@@ -44,7 +45,7 @@ public static ResourceLoader getRequiredResourceLoader(XmlReaderContext context)
4445
ResourceLoader resourceLoader = context.getResourceLoader();
4546

4647
if (resourceLoader == null) {
47-
throw new IllegalArgumentException("Could not obtain ResourceLoader from XmlReaderContext!");
48+
throw new IllegalArgumentException("Could not obtain ResourceLoader from XmlReaderContext");
4849
}
4950

5051
return resourceLoader;
@@ -75,7 +76,7 @@ public static ClassLoader getRequiredClassLoader(ResourceLoader resourceLoader)
7576
ClassLoader classLoader = resourceLoader.getClassLoader();
7677

7778
if (classLoader == null) {
78-
throw new IllegalArgumentException("Could not obtain ClassLoader from ResourceLoader!");
79+
throw new IllegalArgumentException("Could not obtain ClassLoader from ResourceLoader");
7980
}
8081

8182
return classLoader;
@@ -96,7 +97,7 @@ public static String getRequiredBeanClassName(BeanDefinition beanDefinition) {
9697

9798
if (result == null) {
9899
throw new IllegalArgumentException(
99-
String.format("Could not obtain required bean class name from BeanDefinition!", beanDefinition));
100+
String.format("Could not obtain required bean class name from BeanDefinition", beanDefinition));
100101
}
101102

102103
return result;

src/main/java/org/springframework/data/convert/ConfigurableTypeInformationMapper.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* inspecting the {@link PersistentEntity} instances for type alias information.
3434
*
3535
* @author Oliver Gierke
36+
* @author Johannes Englmeier
3637
*/
3738
public class ConfigurableTypeInformationMapper implements TypeInformationMapper {
3839

@@ -58,7 +59,7 @@ public ConfigurableTypeInformationMapper(Map<? extends Class<?>, String> sourceT
5859

5960
if (typeToAlias.containsValue(alias)) {
6061
throw new IllegalArgumentException(
61-
String.format("Detected mapping ambiguity! String %s cannot be mapped to more than one type!", alias));
62+
String.format("Detected mapping ambiguity! String %s cannot be mapped to more than one type", alias));
6263
}
6364

6465
this.typeToAlias.put(type, alias);

src/main/java/org/springframework/data/convert/CustomConversions.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
* @author Thomas Darimont
5858
* @author Christoph Strobl
5959
* @author Mark Paluch
60+
* @author Johannes Englmeier
6061
* @since 2.0
6162
*/
6263
public class CustomConversions {
@@ -782,7 +783,7 @@ public Streamable<ConverterRegistration> getRegistrationsFor(Object converter) {
782783
return getRegistrationFor(converter, Converter.class, isReading, isWriting);
783784

784785
} else {
785-
throw new IllegalArgumentException(String.format("Unsupported converter type %s!", converter));
786+
throw new IllegalArgumentException(String.format("Unsupported converter type %s", converter));
786787
}
787788
}
788789

@@ -793,7 +794,7 @@ private Streamable<ConverterRegistration> getRegistrationFor(Object converter, C
793794
Class<?>[] arguments = GenericTypeResolver.resolveTypeArguments(converterType, type);
794795

795796
if (arguments == null) {
796-
throw new IllegalStateException(String.format("Couldn't resolve type arguments for %s!", converterType));
797+
throw new IllegalStateException(String.format("Couldn't resolve type arguments for %s", converterType));
797798
}
798799

799800
return Streamable.of(register(converter, arguments[0], arguments[1], isReading, isWriting));

src/main/java/org/springframework/data/convert/DefaultConverterBuilder.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
*
3939
* @author Oliver Gierke
4040
* @author Mark Paluch
41+
* @author Johannes Englmeier
4142
* @since 2.0
4243
* @see ConverterBuilder#writing(Class, Class, Function)
4344
* @see ConverterBuilder#reading(Class, Class, Function)
@@ -83,7 +84,7 @@ public ConverterAware andWriting(Function<? super S, ? extends T> function) {
8384
@Override
8485
public GenericConverter getReadingConverter() {
8586
return getOptionalReadingConverter()
86-
.orElseThrow(() -> new IllegalStateException("No reading converter specified!"));
87+
.orElseThrow(() -> new IllegalStateException("No reading converter specified"));
8788
}
8889

8990
/*
@@ -93,7 +94,7 @@ public GenericConverter getReadingConverter() {
9394
@Override
9495
public GenericConverter getWritingConverter() {
9596
return getOptionalWritingConverter()
96-
.orElseThrow(() -> new IllegalStateException("No writing converter specified!"));
97+
.orElseThrow(() -> new IllegalStateException("No writing converter specified"));
9798
}
9899

99100
/*

src/main/java/org/springframework/data/convert/MappingContextTypeInformationMapper.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
*
3535
* @author Oliver Gierke
3636
* @author Christoph Strobl
37+
* @author Johannes Englmeier
3738
*/
3839
public class MappingContextTypeInformationMapper implements TypeInformationMapper {
3940

@@ -91,7 +92,7 @@ private Alias verify(ClassTypeInformation<?> key, Alias alias) {
9192
if (existingAlias.isPresentButDifferent(alias)) {
9293

9394
throw new IllegalArgumentException(
94-
String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s!", alias,
95+
String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s", alias,
9596
existingAlias, key));
9697
}
9798

@@ -104,7 +105,7 @@ private Alias verify(ClassTypeInformation<?> key, Alias alias) {
104105
.findFirst().ifPresent(it -> {
105106

106107
throw new IllegalArgumentException(String.format(
107-
"Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s!", key,
108+
"Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s", key,
108109
alias, it.getKey()));
109110
});
110111
}

src/main/java/org/springframework/data/crossstore/ChangeSetBackedTransactionSynchronization.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
import org.apache.commons.logging.LogFactory;
2020

2121
import org.springframework.transaction.support.TransactionSynchronization;
22-
22+
/**
23+
* @author Johannes Englmeier
24+
*/
2325
public class ChangeSetBackedTransactionSynchronization implements TransactionSynchronization {
2426

2527
private static final Log logger = LogFactory.getLog(ChangeSetBackedTransactionSynchronization.class);
@@ -63,12 +65,12 @@ public void flush() {
6365

6466
public void resume() {
6567
throw new IllegalStateException(
66-
"ChangedSetBackedTransactionSynchronization does not support transaction suspension currently.");
68+
"ChangedSetBackedTransactionSynchronization does not support transaction suspension currently");
6769
}
6870

6971
public void suspend() {
7072
throw new IllegalStateException(
71-
"ChangedSetBackedTransactionSynchronization does not support transaction suspension currently.");
73+
"ChangedSetBackedTransactionSynchronization does not support transaction suspension currently");
7274
}
7375

7476
}

src/main/java/org/springframework/data/domain/AbstractPageRequest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @author Thomas Darimont
2424
* @author Oliver Gierke
2525
* @author Alex Bondarev
26+
* @author Johannes Englmeier
2627
*/
2728
public abstract class AbstractPageRequest implements Pageable, Serializable {
2829

@@ -41,11 +42,11 @@ public abstract class AbstractPageRequest implements Pageable, Serializable {
4142
public AbstractPageRequest(int page, int size) {
4243

4344
if (page < 0) {
44-
throw new IllegalArgumentException("Page index must not be less than zero!");
45+
throw new IllegalArgumentException("Page index must not be less than zero");
4546
}
4647

4748
if (size < 1) {
48-
throw new IllegalArgumentException("Page size must not be less than one!");
49+
throw new IllegalArgumentException("Page size must not be less than one");
4950
}
5051

5152
this.page = page;

src/main/java/org/springframework/data/domain/Sort.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @author Oliver Gierke
4141
* @author Thomas Darimont
4242
* @author Mark Paluch
43+
* @author Johannes Englmeier
4344
*/
4445
public class Sort implements Streamable<org.springframework.data.domain.Sort.Order>, Serializable {
4546

@@ -64,7 +65,7 @@ protected Sort(List<Order> orders) {
6465
private Sort(Direction direction, List<String> properties) {
6566

6667
if (properties == null || properties.isEmpty()) {
67-
throw new IllegalArgumentException("You have to provide at least one property to sort by!");
68+
throw new IllegalArgumentException("You have to provide at least one property to sort by");
6869
}
6970

7071
this.orders = properties.stream() //
@@ -322,7 +323,7 @@ public static Direction fromString(String value) {
322323
return Direction.valueOf(value.toUpperCase(Locale.US));
323324
} catch (Exception e) {
324325
throw new IllegalArgumentException(String.format(
325-
"Invalid value '%s' for orders given! Has to be either 'desc' or 'asc' (case insensitive).", value), e);
326+
"Invalid value '%s' for orders given! Has to be either 'desc' or 'asc' (case insensitive)", value), e);
326327
}
327328
}
328329

@@ -454,7 +455,7 @@ public static Order desc(String property) {
454455
private Order(@Nullable Direction direction, String property, boolean ignoreCase, NullHandling nullHandling) {
455456

456457
if (!StringUtils.hasText(property)) {
457-
throw new IllegalArgumentException("Property must not be null or empty!");
458+
throw new IllegalArgumentException("Property must not be null or empty");
458459
}
459460

460461
this.direction = direction == null ? DEFAULT_DIRECTION : direction;

src/main/java/org/springframework/data/history/AnnotationRevisionMetadata.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* @author Oliver Gierke
3737
* @author Jens Schauder
3838
* @author Mark Paluch
39+
* @author Johannes Englmeier
3940
*/
4041
public class AnnotationRevisionMetadata<N extends Number & Comparable<N>> implements RevisionMetadata<N> {
4142

@@ -152,6 +153,6 @@ private static Instant convertToInstant(Object timestamp) {
152153
return Date.class.cast(timestamp).toInstant();
153154
}
154155

155-
throw new IllegalArgumentException(String.format("Can't convert %s to Instant!", timestamp));
156+
throw new IllegalArgumentException(String.format("Can't convert %s to Instant", timestamp));
156157
}
157158
}

src/main/java/org/springframework/data/history/RevisionMetadata.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* @author Philipp Huegelmeyer
2525
* @author Oliver Gierke
2626
* @author Jens Schauder
27+
* @author Johannes Englmeier
2728
*/
2829
public interface RevisionMetadata<N extends Number & Comparable<N>> {
2930

@@ -43,7 +44,7 @@ public interface RevisionMetadata<N extends Number & Comparable<N>> {
4344
default N getRequiredRevisionNumber() {
4445

4546
return getRevisionNumber().orElseThrow(
46-
() -> new IllegalStateException(String.format("No revision number found on %s!", this.<Object> getDelegate())));
47+
() -> new IllegalStateException(String.format("No revision number found on %s", this.<Object> getDelegate())));
4748
}
4849

4950
/**
@@ -62,7 +63,7 @@ default N getRequiredRevisionNumber() {
6263
default Instant getRequiredRevisionInstant() {
6364

6465
return getRevisionInstant().orElseThrow(
65-
() -> new IllegalStateException(String.format("No revision date found on %s!", this.<Object> getDelegate())));
66+
() -> new IllegalStateException(String.format("No revision date found on %s", this.<Object> getDelegate())));
6667
}
6768

6869
/**

src/main/java/org/springframework/data/mapping/IdentifierAccessor.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*
2323
* @author Oliver Gierke
2424
* @author Mark Paluch
25+
* @author Johannes Englmeier
2526
* @see TargetAwareIdentifierAccessor
2627
*/
2728
public interface IdentifierAccessor {
@@ -51,6 +52,6 @@ default Object getRequiredIdentifier() {
5152
return identifier;
5253
}
5354

54-
throw new IllegalStateException("Could not obtain identifier!");
55+
throw new IllegalStateException("Could not obtain identifier");
5556
}
5657
}

src/main/java/org/springframework/data/mapping/PersistentEntity.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* @author Patryk Wasik
3333
* @author Mark Paluch
3434
* @author Christoph Strobl
35+
* @author Johannes Englmeier
3536
*/
3637
public interface PersistentEntity<T, P extends PersistentProperty<P>> extends Iterable<P> {
3738

@@ -103,7 +104,7 @@ default P getRequiredIdProperty() {
103104
return property;
104105
}
105106

106-
throw new IllegalStateException(String.format("Required identifier property not found for %s!", getType()));
107+
throw new IllegalStateException(String.format("Required identifier property not found for %s", getType()));
107108
}
108109

109110
/**
@@ -131,7 +132,7 @@ default P getRequiredVersionProperty() {
131132
return property;
132133
}
133134

134-
throw new IllegalStateException(String.format("Required version property not found for %s!", getType()));
135+
throw new IllegalStateException(String.format("Required version property not found for %s", getType()));
135136
}
136137

137138
/**
@@ -158,7 +159,7 @@ default P getRequiredPersistentProperty(String name) {
158159
return property;
159160
}
160161

161-
throw new IllegalStateException(String.format("Required property %s not found for %s!", name, getType()));
162+
throw new IllegalStateException(String.format("Required property %s not found for %s", name, getType()));
162163
}
163164

164165
/**
@@ -284,7 +285,7 @@ default <A extends Annotation> A getRequiredAnnotation(Class<A> annotationType)
284285
}
285286

286287
throw new IllegalStateException(
287-
String.format("Required annotation %s not found for %s!", annotationType, getType()));
288+
String.format("Required annotation %s not found for %s", annotationType, getType()));
288289
}
289290

290291
/**

0 commit comments

Comments
 (0)