Skip to content

Commit 040d131

Browse files
committed
Polishing
(cherry picked from commit ce42ed4)
1 parent 73bbe08 commit 040d131

File tree

5 files changed

+16
-18
lines changed

5 files changed

+16
-18
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 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.
@@ -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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 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.
@@ -194,7 +194,7 @@ else if (typeConverter.canConvert(suppliedArg, expectedArg)) {
194194
TypeDescriptor varargsDesc = expectedArgTypes.get(expectedArgTypes.size() - 1);
195195
Class<?> varargsParamType = varargsDesc.getElementTypeDescriptor().getType();
196196

197-
// All remaining parameters must be of this type or convertable to this type
197+
// All remaining parameters must be of this type or convertible to this type
198198
for (int i = expectedArgTypes.size() - 1; i < suppliedArgTypes.size(); i++) {
199199
TypeDescriptor suppliedArg = suppliedArgTypes.get(i);
200200
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
@@ -2873,18 +2873,15 @@ public static class MyModelAndViewResolver implements ModelAndViewResolver {
28732873

28742874
@Override
28752875
@SuppressWarnings("rawtypes")
2876-
public ModelAndView resolveModelAndView(Method handlerMethod,
2877-
Class handlerType,
2878-
Object returnValue,
2879-
ExtendedModelMap implicitModel,
2880-
NativeWebRequest webRequest) {
2876+
public ModelAndView resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue,
2877+
ExtendedModelMap implicitModel, NativeWebRequest webRequest) {
2878+
28812879
if (returnValue instanceof MySpecialArg) {
28822880
return new ModelAndView(new View() {
28832881
@Override
28842882
public String getContentType() {
28852883
return "text/html";
28862884
}
2887-
28882885
@Override
28892886
public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response)
28902887
throws Exception {

0 commit comments

Comments
 (0)