Skip to content

Commit 6aa5931

Browse files
committed
Polishing
1 parent a1f5fb5 commit 6aa5931

File tree

6 files changed

+25
-31
lines changed

6 files changed

+25
-31
lines changed

spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void testBindLocalDateWithSpecificFormatter() throws Exception {
124124
@Test
125125
public void testBindLocalDateArray() {
126126
MutablePropertyValues propertyValues = new MutablePropertyValues();
127-
propertyValues.add("localDate", new String[]{"10/31/09"});
127+
propertyValues.add("localDate", new String[] {"10/31/09"});
128128
binder.bind(propertyValues);
129129
assertEquals(0, binder.getBindingResult().getErrorCount());
130130
}

spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ private static Method determineFactoryMethod(Class<?> targetClass, Class<?> sour
185185
method = ClassUtils.getStaticMethod(targetClass, "of", sourceClass);
186186
if (method == null) {
187187
method = ClassUtils.getStaticMethod(targetClass, "from", sourceClass);
188-
if (method == null) {
189-
return null;
190-
}
191188
}
192189
}
193190
return method;

spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 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.
@@ -19,18 +19,18 @@
1919
import org.springframework.core.convert.support.ConfigurableConversionService;
2020

2121
/**
22-
* Configuration interface to be implemented by most if not all {@link PropertyResolver
23-
* PropertyResolver} types. Provides facilities for accessing and customizing the
24-
* {@link org.springframework.core.convert.ConversionService ConversionService} used when
25-
* converting property values from one type to another.
22+
* Configuration interface to be implemented by most if not all {@link PropertyResolver}
23+
* types. Provides facilities for accessing and customizing the
24+
* {@link org.springframework.core.convert.ConversionService ConversionService}
25+
* used when converting property values from one type to another.
2626
*
2727
* @author Chris Beams
2828
* @since 3.1
2929
*/
3030
public interface ConfigurablePropertyResolver extends PropertyResolver {
3131

3232
/**
33-
* @return the {@link ConfigurableConversionService} used when performing type
33+
* Return the {@link ConfigurableConversionService} used when performing type
3434
* conversions on properties.
3535
* <p>The configurable nature of the returned conversion service allows for
3636
* the convenient addition and removal of individual {@code Converter} instances:
@@ -46,10 +46,10 @@ public interface ConfigurablePropertyResolver extends PropertyResolver {
4646
/**
4747
* Set the {@link ConfigurableConversionService} to be used when performing type
4848
* conversions on properties.
49-
* <p><strong>Note:</strong> as an alternative to fully replacing the {@code
50-
* ConversionService}, consider adding or removing individual {@code Converter}
51-
* instances by drilling into {@link #getConversionService()} and calling methods
52-
* such as {@code #addConverter}.
49+
* <p><strong>Note:</strong> as an alternative to fully replacing the
50+
* {@code ConversionService}, consider adding or removing individual
51+
* {@code Converter} instances by drilling into {@link #getConversionService()}
52+
* and calling methods such as {@code #addConverter}.
5353
* @see PropertyResolver#getProperty(String, Class)
5454
* @see #getConversionService()
5555
* @see org.springframework.core.convert.converter.ConverterRegistry#addConverter

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.servlet.mvc.method.annotation;
1718

1819
import java.lang.reflect.Method;
@@ -40,14 +41,8 @@
4041
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
4142
import org.springframework.web.method.support.ModelAndViewContainer;
4243

43-
import static org.junit.Assert.assertEquals;
44-
import static org.junit.Assert.assertFalse;
45-
import static org.junit.Assert.assertNotNull;
46-
import static org.junit.Assert.assertNull;
47-
import static org.junit.Assert.assertSame;
48-
import static org.junit.Assert.assertTrue;
49-
import static org.junit.Assert.fail;
50-
import static org.mockito.BDDMockito.given;
44+
import static org.junit.Assert.*;
45+
import static org.mockito.BDDMockito.*;
5146
import static org.mockito.Mockito.mock;
5247

5348
/**
@@ -87,7 +82,7 @@ public void setUp() throws Exception {
8782
@Test
8883
public void supportsParameter() throws Exception {
8984
assertTrue(this.resolver.supportsParameter(new MethodParameter(this.handleMethod, 0)));
90-
assertFalse(this.resolver.supportsParameter(new MethodParameter(this.handleMethod, 4)));
85+
assertFalse(this.resolver.supportsParameter(new MethodParameter(this.handleMethod, -1)));
9186
}
9287

9388
@Test
@@ -180,6 +175,8 @@ private void handleWithSessionAttribute(
180175
@SessionAttribute(name="foo") Optional<Foo> optionalFoo) {
181176
}
182177

178+
183179
private static class Foo {
184180
}
181+
185182
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.servlet.mvc.method.annotation;
1718

1819
import org.springframework.web.context.request.RequestAttributes;
1920
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
2021

21-
2222
/**
2323
* Unit tests for {@link RequestAttributeMethodArgumentResolver}.
24+
*
2425
* @author Rossen Stoyanchev
26+
* @since 4.3
2527
*/
26-
public class RequestAttributeMethodArgumentResolverTests
27-
extends AbstractRequestAttributesArgumentResolverTests {
28-
28+
public class RequestAttributeMethodArgumentResolverTests extends AbstractRequestAttributesArgumentResolverTests {
2929

3030
@Override
3131
protected HandlerMethodArgumentResolver createResolver() {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.servlet.mvc.method.annotation;
1718

1819
import org.springframework.web.context.request.RequestAttributes;
1920
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
2021

21-
2222
/**
2323
* Unit tests for {@link SessionAttributeMethodArgumentResolver}.
24+
*
2425
* @author Rossen Stoyanchev
26+
* @since 4.3
2527
*/
26-
public class SessionAttributeMethodArgumentResolverTests
27-
extends AbstractRequestAttributesArgumentResolverTests {
28-
28+
public class SessionAttributeMethodArgumentResolverTests extends AbstractRequestAttributesArgumentResolverTests {
2929

3030
@Override
3131
protected HandlerMethodArgumentResolver createResolver() {

0 commit comments

Comments
 (0)