Skip to content

Commit 6a23723

Browse files
jojxblum
jo
authored andcommitted
Remove punctuation in all exception messages.
Closes spring-projects#2603.
1 parent 6e9a3cd commit 6a23723

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
@@ -41,6 +41,7 @@
4141
* @author Ranie Jade Ramiso
4242
* @author Oliver Gierke
4343
* @author Christoph Strobl
44+
* @author Johannes Englmeier
4445
* @since 1.5
4546
*/
4647
final class AnnotationAuditingMetadata {
@@ -108,7 +109,7 @@ private void assertValidDateFieldType(Optional<Field> field) {
108109
}
109110

110111
throw new IllegalStateException(String.format(
111-
"Found created/modified date field with type %s but only %s as well as java.time types are supported!", type,
112+
"Found created/modified date field with type %s but only %s as well as java.time types are supported", type,
112113
SUPPORTED_DATE_TYPES));
113114
});
114115
}

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @author Christoph Strobl
3939
* @author Jens Schauder
4040
* @author Pavel Horal
41+
* @author Johannes Englmeier
4142
* @since 1.5
4243
*/
4344
class DefaultAuditableBeanWrapperFactory implements AuditableBeanWrapperFactory {
@@ -187,7 +188,7 @@ protected Object getDateValueToSet(TemporalAccessor value, Class<?> targetType,
187188

188189
if (!conversionService.canConvert(value.getClass(), Date.class)) {
189190
throw new IllegalArgumentException(
190-
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,
191192
value.getClass(), targetType));
192193
}
193194

@@ -227,7 +228,7 @@ protected <S extends TemporalAccessor> Optional<S> getAsTemporalAccessor(Optiona
227228
}
228229

229230
private static IllegalArgumentException rejectUnsupportedType(Object source) {
230-
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",
231232
source.getClass(), source, AnnotationAuditingMetadata.SUPPORTED_DATE_TYPES));
232233
}
233234

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

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
* @author Christoph Strobl
5555
* @author Mark Paluch
5656
* @author Xeno Amess
57+
* @author Johannes Englmeier
5758
* @since 2.0
5859
*/
5960
public class CustomConversions {

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)
@@ -61,13 +62,13 @@ public ConverterAware andWriting(Function<? super S, ? extends T> function) {
6162
@Override
6263
public GenericConverter getReadingConverter() {
6364
return getOptionalReadingConverter()
64-
.orElseThrow(() -> new IllegalStateException("No reading converter specified!"));
65+
.orElseThrow(() -> new IllegalStateException("No reading converter specified"));
6566
}
6667

6768
@Override
6869
public GenericConverter getWritingConverter() {
6970
return getOptionalWritingConverter()
70-
.orElseThrow(() -> new IllegalStateException("No writing converter specified!"));
71+
.orElseThrow(() -> new IllegalStateException("No writing converter specified"));
7172
}
7273

7374
@Override

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

@@ -87,7 +88,7 @@ private Alias verify(ClassTypeInformation<?> key, Alias alias) {
8788
if (existingAlias.isPresentButDifferent(alias)) {
8889

8990
throw new IllegalArgumentException(
90-
String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s!", alias,
91+
String.format("Trying to register alias '%s', but found already registered alias '%s' for type %s", alias,
9192
existingAlias, key));
9293
}
9394

@@ -100,7 +101,7 @@ private Alias verify(ClassTypeInformation<?> key, Alias alias) {
100101
.findFirst().ifPresent(it -> {
101102

102103
throw new IllegalArgumentException(String.format(
103-
"Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s!", key,
104+
"Detected existing type mapping of %s to alias '%s' but attempted to bind the same alias to %s", key,
104105
alias, it.getKey()));
105106
});
106107
}

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() //
@@ -304,7 +305,7 @@ public static Direction fromString(String value) {
304305
return Direction.valueOf(value.toUpperCase(Locale.US));
305306
} catch (Exception e) {
306307
throw new IllegalArgumentException(String.format(
307-
"Invalid value '%s' for orders given! Has to be either 'desc' or 'asc' (case insensitive).", value), e);
308+
"Invalid value '%s' for orders given! Has to be either 'desc' or 'asc' (case insensitive)", value), e);
308309
}
309310
}
310311

@@ -436,7 +437,7 @@ public static Order desc(String property) {
436437
private Order(@Nullable Direction direction, String property, boolean ignoreCase, NullHandling nullHandling) {
437438

438439
if (!StringUtils.hasText(property)) {
439-
throw new IllegalArgumentException("Property must not be null or empty!");
440+
throw new IllegalArgumentException("Property must not be null or empty");
440441
}
441442

442443
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

@@ -135,6 +136,6 @@ private static Instant convertToInstant(Object timestamp) {
135136
return ((Date) timestamp).toInstant();
136137
}
137138

138-
throw new IllegalArgumentException(String.format("Can't convert %s to Instant!", timestamp));
139+
throw new IllegalArgumentException(String.format("Can't convert %s to Instant", timestamp));
139140
}
140141
}

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

@@ -131,7 +132,7 @@ default P getRequiredIdProperty() {
131132
return property;
132133
}
133134

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

137138
/**
@@ -159,7 +160,7 @@ default P getRequiredVersionProperty() {
159160
return property;
160161
}
161162

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

165166
/**
@@ -186,7 +187,7 @@ default P getRequiredPersistentProperty(String name) {
186187
return property;
187188
}
188189

189-
throw new IllegalStateException(String.format("Required property %s not found for %s!", name, getType()));
190+
throw new IllegalStateException(String.format("Required property %s not found for %s", name, getType()));
190191
}
191192

192193
/**
@@ -312,7 +313,7 @@ default <A extends Annotation> A getRequiredAnnotation(Class<A> annotationType)
312313
}
313314

314315
throw new IllegalStateException(
315-
String.format("Required annotation %s not found for %s!", annotationType, getType()));
316+
String.format("Required annotation %s not found for %s", annotationType, getType()));
316317
}
317318

318319
/**

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* @author Mark Paluch
3535
* @author Jens Schauder
3636
* @author Christoph Strobl
37+
* @author Johannes Englmeier
3738
*/
3839
public interface PersistentProperty<P extends PersistentProperty<P>> {
3940

@@ -89,7 +90,7 @@ default Method getRequiredGetter() {
8990
Method getter = getGetter();
9091

9192
if (getter == null) {
92-
throw new IllegalArgumentException(String.format("No getter available for persistent property %s!", this));
93+
throw new IllegalArgumentException(String.format("No getter available for persistent property %s", this));
9394
}
9495

9596
return getter;
@@ -109,7 +110,7 @@ default Method getRequiredSetter() {
109110
Method setter = getSetter();
110111

111112
if (setter == null) {
112-
throw new IllegalArgumentException(String.format("No setter available for persistent property %s!", this));
113+
throw new IllegalArgumentException(String.format("No setter available for persistent property %s", this));
113114
}
114115

115116
return setter;
@@ -147,7 +148,7 @@ default Method getRequiredWither() {
147148
Method wither = getWither();
148149

149150
if (wither == null) {
150-
throw new IllegalArgumentException(String.format("No wither available for persistent property %s!", this));
151+
throw new IllegalArgumentException(String.format("No wither available for persistent property %s", this));
151152
}
152153

153154
return wither;
@@ -161,7 +162,7 @@ default Field getRequiredField() {
161162
Field field = getField();
162163

163164
if (field == null) {
164-
throw new IllegalArgumentException(String.format("No field backing persistent property %s!", this));
165+
throw new IllegalArgumentException(String.format("No field backing persistent property %s", this));
165166
}
166167

167168
return field;
@@ -193,7 +194,7 @@ default Association<P> getRequiredAssociation() {
193194
return association;
194195
}
195196

196-
throw new IllegalStateException("No association found!");
197+
throw new IllegalStateException("No association found");
197198
}
198199

199200
/**

0 commit comments

Comments
 (0)