Skip to content

Commit ce42ed4

Browse files
committed
Polishing
1 parent c69e6a3 commit ce42ed4

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private DateFormat createDateFormat(Locale locale) {
191191
if (timeStyle != -1) {
192192
return DateFormat.getTimeInstance(timeStyle, locale);
193193
}
194-
throw new IllegalStateException("Unsupported style pattern '"+ this.stylePattern+ "'");
194+
throw new IllegalStateException("Unsupported style pattern '" + this.stylePattern + "'");
195195

196196
}
197197
return DateFormat.getDateInstance(this.style, locale);

spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectionHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ else if (typeConverter.canConvert(suppliedArg, expectedArg)) {
195195
TypeDescriptor varargsDesc = expectedArgTypes.get(expectedArgTypes.size() - 1);
196196
Class<?> varargsParamType = varargsDesc.getElementTypeDescriptor().getType();
197197

198-
// All remaining parameters must be of this type or convertable to this type
198+
// All remaining parameters must be of this type or convertible to this type
199199
for (int i = expectedArgTypes.size() - 1; i < suppliedArgTypes.size(); i++) {
200200
TypeDescriptor suppliedArg = suppliedArgTypes.get(i);
201201
if (suppliedArg == null) {

spring-tx/src/main/java/org/springframework/dao/support/DataAccessUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -122,7 +122,7 @@ public static <T> T requiredUniqueResult(Collection<T> results) throws Incorrect
122122
/**
123123
* Return a unique result object from the given Collection.
124124
* Throws an exception if 0 or more than 1 result objects found,
125-
* of if the unique result object is not convertable to the
125+
* of if the unique result object is not convertible to the
126126
* specified required type.
127127
* @param results the result Collection (can be {@code null})
128128
* @return the unique result object
@@ -162,15 +162,15 @@ else if (Number.class.isAssignableFrom(requiredType) && Number.class.isInstance(
162162
/**
163163
* Return a unique int result from the given Collection.
164164
* Throws an exception if 0 or more than 1 result objects found,
165-
* of if the unique result object is not convertable to an int.
165+
* of if the unique result object is not convertible to an int.
166166
* @param results the result Collection (can be {@code null})
167167
* @return the unique int result
168168
* @throws IncorrectResultSizeDataAccessException if more than one
169169
* result object has been found in the given Collection
170170
* @throws EmptyResultDataAccessException if no result object
171171
* at all has been found in the given Collection
172172
* @throws TypeMismatchDataAccessException if the unique object
173-
* in the collection is not convertable to an int
173+
* in the collection is not convertible to an int
174174
*/
175175
public static int intResult(Collection<?> results)
176176
throws IncorrectResultSizeDataAccessException, TypeMismatchDataAccessException {
@@ -181,15 +181,15 @@ public static int intResult(Collection<?> results)
181181
/**
182182
* Return a unique long result from the given Collection.
183183
* Throws an exception if 0 or more than 1 result objects found,
184-
* of if the unique result object is not convertable to a long.
184+
* of if the unique result object is not convertible to a long.
185185
* @param results the result Collection (can be {@code null})
186186
* @return the unique long result
187187
* @throws IncorrectResultSizeDataAccessException if more than one
188188
* result object has been found in the given Collection
189189
* @throws EmptyResultDataAccessException if no result object
190190
* at all has been found in the given Collection
191191
* @throws TypeMismatchDataAccessException if the unique object
192-
* in the collection is not convertable to a long
192+
* in the collection is not convertible to a long
193193
*/
194194
public static long longResult(Collection<?> results)
195195
throws IncorrectResultSizeDataAccessException, TypeMismatchDataAccessException {

spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandlerTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ public TestModelAndViewResolver(Class<?> returnValueType) {
126126

127127
@Override
128128
@SuppressWarnings("rawtypes")
129-
public ModelAndView resolveModelAndView(Method method, Class handlerType, Object returnValue,
129+
public ModelAndView resolveModelAndView(Method method, Class<?> handlerType, Object returnValue,
130130
ExtendedModelMap model, NativeWebRequest request) {
131+
131132
if (returnValue != null && returnValue.getClass().equals(returnValueType)) {
132133
return new ModelAndView("viewName", "modelAttrName", returnValue);
133134
}
@@ -137,4 +138,4 @@ public ModelAndView resolveModelAndView(Method method, Class handlerType, Object
137138
}
138139
}
139140

140-
}
141+
}

spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,18 +2851,15 @@ public static class MyModelAndViewResolver implements ModelAndViewResolver {
28512851

28522852
@Override
28532853
@SuppressWarnings("rawtypes")
2854-
public ModelAndView resolveModelAndView(Method handlerMethod,
2855-
Class handlerType,
2856-
Object returnValue,
2857-
ExtendedModelMap implicitModel,
2858-
NativeWebRequest webRequest) {
2854+
public ModelAndView resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue,
2855+
ExtendedModelMap implicitModel, NativeWebRequest webRequest) {
2856+
28592857
if (returnValue instanceof MySpecialArg) {
28602858
return new ModelAndView(new View() {
28612859
@Override
28622860
public String getContentType() {
28632861
return "text/html";
28642862
}
2865-
28662863
@Override
28672864
public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response)
28682865
throws Exception {

0 commit comments

Comments
 (0)