Remove punctuation in all exception messages.

Closes #2603.
This commit is contained in:
jo
2022-06-04 16:05:30 +02:00
committed by John Blum
parent 6e9a3cdccf
commit 6a23723f07
99 changed files with 275 additions and 174 deletions

View File

@@ -51,6 +51,7 @@ import org.springframework.web.bind.WebDataBinder;
* A {@link WebDataBinder} that automatically binds all properties exposed in the given type using a {@link Map}.
*
* @author Oliver Gierke
* @author Johannes Englmeier
* @since 1.10
*/
class MapDataBinder extends WebDataBinder {
@@ -80,7 +81,7 @@ class MapDataBinder extends WebDataBinder {
Object target = super.getTarget();
if (target == null) {
throw new IllegalStateException("Target bean should never be null!");
throw new IllegalStateException("Target bean should never be null");
}
return (Map<String, Object>) target;
@@ -96,6 +97,7 @@ class MapDataBinder extends WebDataBinder {
* deeply nested Map structures.
*
* @author Oliver Gierke
* @author Johannes Englmeier
* @since 1.10
*/
private static class MapPropertyAccessor extends AbstractPropertyAccessor {
@@ -160,7 +162,7 @@ class MapDataBinder extends WebDataBinder {
leafProperty.getSegment());
if (descriptor == null) {
throw new IllegalStateException(String.format("Couldn't find PropertyDescriptor for %s on %s!",
throw new IllegalStateException(String.format("Couldn't find PropertyDescriptor for %s on %s",
leafProperty.getSegment(), owningType.getType()));
}
@@ -186,7 +188,7 @@ class MapDataBinder extends WebDataBinder {
try {
expression.setValue(context, value);
} catch (SpelEvaluationException o_O) {
throw new NotWritablePropertyException(type, propertyName, "Could not write property!", o_O);
throw new NotWritablePropertyException(type, propertyName, "Could not write property", o_O);
}
}

View File

@@ -41,6 +41,7 @@ import org.springframework.web.method.support.ModelAndViewContainer;
* @author Oliver Gierke
* @author Nick Williams
* @author Christoph Strobl
* @author Johannes Englmeier
*/
public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArgumentResolver {
@@ -93,7 +94,7 @@ public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArg
Method method = parameter.getMethod();
if (method == null) {
throw new IllegalArgumentException(String.format("Could not obtain method from parameter %s!", parameter));
throw new IllegalArgumentException(String.format("Could not obtain method from parameter %s", parameter));
}
MethodParameters parameters = MethodParameters.of(method);

View File

@@ -40,6 +40,7 @@ import org.springframework.util.StringUtils;
* @see ReactiveSortHandlerMethodArgumentResolver
* @author Mark Paluch
* @author Vedran Pavic
* @author Johannes Englmeier
*/
public abstract class SortHandlerMethodArgumentResolverSupport {
@@ -125,7 +126,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport {
if (annotatedDefault != null && annotatedDefaults != null) {
throw new IllegalArgumentException(
String.format("Cannot use both @%s and @%s on parameter %s! Move %s into %s to define sorting order!",
String.format("Cannot use both @%s and @%s on parameter %s! Move %s into %s to define sorting order",
SORT_DEFAULTS_NAME, SORT_DEFAULT_NAME, parameter.toString(), SORT_DEFAULT_NAME, SORT_DEFAULTS_NAME));
}
@@ -273,7 +274,7 @@ public abstract class SortHandlerMethodArgumentResolverSupport {
builder = new ExpressionBuilder(direction);
} else if (!builder.hasSameDirectionAs(order)) {
throw new IllegalArgumentException(String.format(
"%s in legacy configuration only supports a single direction to sort by!", getClass().getSimpleName()));
"%s in legacy configuration only supports a single direction to sort by", getClass().getSimpleName()));
}
builder.add(order.getProperty());

View File

@@ -35,6 +35,7 @@ import org.springframework.util.ObjectUtils;
*
* @author Oliver Gierke
* @author Mark Paluch
* @author Johannes Englmeier
*/
abstract class SpringDataAnnotationUtils {
@@ -50,7 +51,7 @@ abstract class SpringDataAnnotationUtils {
Method method = parameter.getMethod();
if (method == null) {
throw new IllegalArgumentException(String.format("Method parameter %s is not backed by a method.", parameter));
throw new IllegalArgumentException(String.format("Method parameter %s is not backed by a method", parameter));
}
if (containsMoreThanOnePageableParameter(method)) {
@@ -102,7 +103,7 @@ abstract class SpringDataAnnotationUtils {
: propertyValue;
if (result == null) {
throw new IllegalStateException("Exepected to be able to look up an annotation property value but failed!");
throw new IllegalStateException("Exepected to be able to look up an annotation property value but failed");
}
return (T) result;
@@ -151,7 +152,7 @@ abstract class SpringDataAnnotationUtils {
}
if (values.contains(qualifier.value())) {
throw new IllegalStateException("Values of the user Qualifiers must be unique!");
throw new IllegalStateException("Values of the user Qualifiers must be unique");
}
values.add(qualifier.value());

View File

@@ -42,6 +42,7 @@ import org.xmlbeam.config.DefaultXMLFactoriesConfig;
*
* @author Oliver Gierke
* @author Christoph Strobl
* @author Johannes Englmeier
* @see <a href="https://www.xmlbeam.org">https://www.xmlbeam.org</a>
* @soundtrack Dr. Kobayashi Maru & The Mothership Connection - Anthem (EPisode One)
*/
@@ -121,7 +122,7 @@ public class XmlBeamHttpMessageConverter extends AbstractHttpMessageConverter<Ob
Throwable cause = o_O.getCause();
if (SAXParseException.class.isInstance(cause)) {
throw new HttpMessageNotReadableException("Cannot read input message!", cause, inputMessage);
throw new HttpMessageNotReadableException("Cannot read input message", cause, inputMessage);
} else {
throw o_O;
}

View File

@@ -39,6 +39,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
*
* @author Oliver Gierke
* @author Mark Paluch
* @author Johannes Englmeier
* @soundtrack Apparat With Soap & Skin - Goodbye (Dark Theme Song - https://www.youtube.com/watch?v=66VnOdk6oto)
*/
@Configuration(proxyBeanMethods = false)
@@ -111,7 +112,7 @@ public class ProjectingArgumentResolverRegistrar {
if (currentResolvers == null) {
throw new IllegalStateException(
String.format("No HandlerMethodArgumentResolvers found in RequestMappingHandlerAdapter %s!", beanName));
String.format("No HandlerMethodArgumentResolvers found in RequestMappingHandlerAdapter %s", beanName));
}
List<HandlerMethodArgumentResolver> newResolvers = new ArrayList<HandlerMethodArgumentResolver>(

View File

@@ -45,6 +45,7 @@ import com.querydsl.core.types.Predicate;
* @author Christoph Strobl
* @author Oliver Gierke
* @author Matías Hermosilla
* @author Johannes Englmeier
* @since 2.5
*/
public abstract class QuerydslPredicateArgumentResolverSupport {
@@ -83,7 +84,7 @@ public abstract class QuerydslPredicateArgumentResolverSupport {
MergedAnnotations annotations = MergedAnnotations.from(parameter.getParameter());
if (annotations.isPresent(QuerydslPredicate.class)) {
throw new IllegalArgumentException(String.format("Parameter at position %s must be of type Predicate but was %s.",
throw new IllegalArgumentException(String.format("Parameter at position %s must be of type Predicate but was %s",
parameter.getParameterIndex(), parameter.getParameterType()));
}
@@ -143,7 +144,7 @@ public abstract class QuerydslPredicateArgumentResolverSupport {
Method method = parameter.getMethod();
if (method == null) {
throw new IllegalArgumentException("Method parameter is not backed by a method!");
throw new IllegalArgumentException("Method parameter is not backed by a method");
}
return detectDomainType(ClassTypeInformation.fromReturnTypeOf(method));
@@ -158,7 +159,7 @@ public abstract class QuerydslPredicateArgumentResolverSupport {
TypeInformation<?> actualType = source.getActualType();
if (actualType == null) {
throw new IllegalArgumentException(String.format("Could not determine domain type from %s!", source));
throw new IllegalArgumentException(String.format("Could not determine domain type from %s", source));
}
if (source != actualType) {