Review and polish pull request #132
Content:
- Rename Conditional{Conversion=>Converter}
- Add @since tags where appropriate
- Update Apache date headers to read 2002-2012 (not just 2012)
- Correct minor Javadoc typo
Style:
- Polish line breaks / whitespace
- Use wildcard static imports where appropriate
Issue: SPR-9566, SPR-9692, SPR-9928, SPR-9927
This commit is contained in:
@@ -16,13 +16,6 @@
|
||||
|
||||
package org.springframework.core.convert;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -37,6 +30,8 @@ import java.util.Map;
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.MethodParameter;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Keith Donald
|
||||
* @author Andy Clement
|
||||
|
||||
@@ -16,15 +16,6 @@
|
||||
|
||||
package org.springframework.core.convert.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.SystemColor;
|
||||
import java.util.ArrayList;
|
||||
@@ -42,10 +33,11 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.core.convert.ConversionFailedException;
|
||||
import org.springframework.core.convert.ConverterNotFoundException;
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
import org.springframework.core.convert.converter.ConditionalConversion;
|
||||
import org.springframework.core.convert.converter.ConditionalConverter;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.convert.converter.ConverterFactory;
|
||||
import org.springframework.core.convert.converter.GenericConverter;
|
||||
@@ -54,6 +46,8 @@ import org.springframework.core.io.Resource;
|
||||
import org.springframework.util.StopWatch;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
@@ -751,7 +745,7 @@ public class GenericConversionServiceTests {
|
||||
}
|
||||
|
||||
private static class MyConditionalConverter implements Converter<String, Color>,
|
||||
ConditionalConversion {
|
||||
ConditionalConverter {
|
||||
|
||||
private int matchAttempts = 0;
|
||||
|
||||
@@ -770,7 +764,7 @@ public class GenericConversionServiceTests {
|
||||
}
|
||||
|
||||
private static class MyConditionalGenericConverter implements GenericConverter,
|
||||
ConditionalConversion {
|
||||
ConditionalConverter {
|
||||
|
||||
private Set<TypeDescriptor> sourceTypes = new LinkedHashSet<TypeDescriptor>();
|
||||
|
||||
@@ -794,7 +788,7 @@ public class GenericConversionServiceTests {
|
||||
}
|
||||
|
||||
private static class MyConditionalConverterFactory implements
|
||||
ConverterFactory<String, Color>, ConditionalConversion {
|
||||
ConverterFactory<String, Color>, ConditionalConverter {
|
||||
|
||||
private MyConditionalConverter converter = new MyConditionalConverter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user