Remove trailing whitespace in Java source code

This commit is contained in:
Sam Brannen 2016-08-29 15:25:10 +02:00
parent 9d21abcd37
commit d6d05e8ca0
14 changed files with 36 additions and 36 deletions

View File

@ -57,7 +57,7 @@ public class FactoryBeanAccessTests {
catch (BeanIsNotAFactoryException binafe) { catch (BeanIsNotAFactoryException binafe) {
// success // success
} }
// No such bean // No such bean
try { try {
expr = new SpelExpressionParser().parseRaw("@truck"); expr = new SpelExpressionParser().parseRaw("@truck");

View File

@ -37,34 +37,34 @@ public class MapAccessorTests {
@Test @Test
public void mapAccessorCompilable() { public void mapAccessorCompilable() {
Map<String, Object> testMap = getSimpleTestMap(); Map<String, Object> testMap = getSimpleTestMap();
StandardEvaluationContext sec = new StandardEvaluationContext(); StandardEvaluationContext sec = new StandardEvaluationContext();
sec.addPropertyAccessor(new MapAccessor()); sec.addPropertyAccessor(new MapAccessor());
SpelExpressionParser sep = new SpelExpressionParser(); SpelExpressionParser sep = new SpelExpressionParser();
// basic // basic
Expression ex = sep.parseExpression("foo"); Expression ex = sep.parseExpression("foo");
assertEquals("bar",ex.getValue(sec,testMap)); assertEquals("bar",ex.getValue(sec,testMap));
assertTrue(SpelCompiler.compile(ex)); assertTrue(SpelCompiler.compile(ex));
assertEquals("bar",ex.getValue(sec,testMap)); assertEquals("bar",ex.getValue(sec,testMap));
// compound expression // compound expression
ex = sep.parseExpression("foo.toUpperCase()"); ex = sep.parseExpression("foo.toUpperCase()");
assertEquals("BAR",ex.getValue(sec,testMap)); assertEquals("BAR",ex.getValue(sec,testMap));
assertTrue(SpelCompiler.compile(ex)); assertTrue(SpelCompiler.compile(ex));
assertEquals("BAR",ex.getValue(sec,testMap)); assertEquals("BAR",ex.getValue(sec,testMap));
// nested map // nested map
Map<String,Map<String,Object>> nestedMap = getNestedTestMap(); Map<String,Map<String,Object>> nestedMap = getNestedTestMap();
ex = sep.parseExpression("aaa.foo.toUpperCase()"); ex = sep.parseExpression("aaa.foo.toUpperCase()");
assertEquals("BAR",ex.getValue(sec,nestedMap)); assertEquals("BAR",ex.getValue(sec,nestedMap));
assertTrue(SpelCompiler.compile(ex)); assertTrue(SpelCompiler.compile(ex));
assertEquals("BAR",ex.getValue(sec,nestedMap)); assertEquals("BAR",ex.getValue(sec,nestedMap));
// avoiding inserting checkcast because first part of expression returns a Map // avoiding inserting checkcast because first part of expression returns a Map
ex = sep.parseExpression("getMap().foo"); ex = sep.parseExpression("getMap().foo");
MapGetter mapGetter = new MapGetter(); MapGetter mapGetter = new MapGetter();
assertEquals("bar",ex.getValue(sec,mapGetter)); assertEquals("bar",ex.getValue(sec,mapGetter));
assertTrue(SpelCompiler.compile(ex)); assertTrue(SpelCompiler.compile(ex));
assertEquals("bar",ex.getValue(sec,mapGetter)); assertEquals("bar",ex.getValue(sec,mapGetter));
} }
@ -74,7 +74,7 @@ public class MapAccessorTests {
public MapGetter() { public MapGetter() {
map.put("foo", "bar"); map.put("foo", "bar");
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public Map getMap() { public Map getMap() {
return map; return map;

View File

@ -129,7 +129,7 @@ public class DefaultConversionService extends GenericConversionService {
converterRegistry.addConverterFactory(new StringToEnumConverterFactory()); converterRegistry.addConverterFactory(new StringToEnumConverterFactory());
converterRegistry.addConverter(new EnumToStringConverter((ConversionService) converterRegistry)); converterRegistry.addConverter(new EnumToStringConverter((ConversionService) converterRegistry));
converterRegistry.addConverterFactory(new IntegerToEnumConverterFactory()); converterRegistry.addConverterFactory(new IntegerToEnumConverterFactory());
converterRegistry.addConverter(new EnumToIntegerConverter((ConversionService) converterRegistry)); converterRegistry.addConverter(new EnumToIntegerConverter((ConversionService) converterRegistry));

View File

@ -244,22 +244,22 @@ public class DefaultConversionServiceTests {
public void testEnumToString() { public void testEnumToString() {
assertEquals("BAR", conversionService.convert(Foo.BAR, String.class)); assertEquals("BAR", conversionService.convert(Foo.BAR, String.class));
} }
@Test @Test
public void testIntegerToEnum() throws Exception { public void testIntegerToEnum() throws Exception {
assertEquals(Foo.BAR, conversionService.convert(0, Foo.class)); assertEquals(Foo.BAR, conversionService.convert(0, Foo.class));
} }
@Test @Test
public void testIntegerToEnumWithSubclass() throws Exception { public void testIntegerToEnumWithSubclass() throws Exception {
assertEquals(SubFoo.BAZ, conversionService.convert(1, SubFoo.BAR.getClass())); assertEquals(SubFoo.BAZ, conversionService.convert(1, SubFoo.BAR.getClass()));
} }
@Test @Test
public void testIntegerToEnumNull() { public void testIntegerToEnumNull() {
assertEquals(null, conversionService.convert(null, Foo.class)); assertEquals(null, conversionService.convert(null, Foo.class));
} }
@Test @Test
public void testEnumToInteger() { public void testEnumToInteger() {
assertEquals(Integer.valueOf(0), conversionService.convert(Foo.BAR, Integer.class)); assertEquals(Integer.valueOf(0), conversionService.convert(Foo.BAR, Integer.class));

View File

@ -248,7 +248,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals(false,expression.getValue()); assertEquals(false,expression.getValue());
assertCanCompile(expression); assertCanCompile(expression);
assertEquals(false,expression.getValue()); assertEquals(false,expression.getValue());
// double slot left operand - should get boxed, return false // double slot left operand - should get boxed, return false
expression = parse("3.0d instanceof T(Integer)"); expression = parse("3.0d instanceof T(Integer)");
assertEquals(false,expression.getValue()); assertEquals(false,expression.getValue());
@ -260,7 +260,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals(true,expression.getValue()); assertEquals(true,expression.getValue());
assertCanCompile(expression); assertCanCompile(expression);
assertEquals(true,expression.getValue()); assertEquals(true,expression.getValue());
// Only when the right hand operand is a direct type reference // Only when the right hand operand is a direct type reference
// will it be compilable. // will it be compilable.
StandardEvaluationContext ctx = new StandardEvaluationContext(); StandardEvaluationContext ctx = new StandardEvaluationContext();
@ -275,13 +275,13 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals(false,expression.getValue()); assertEquals(false,expression.getValue());
assertCanCompile(expression); assertCanCompile(expression);
assertEquals(false,expression.getValue()); assertEquals(false,expression.getValue());
expression = parse("3 instanceof T(long)"); expression = parse("3 instanceof T(long)");
assertEquals(false,expression.getValue()); assertEquals(false,expression.getValue());
assertCanCompile(expression); assertCanCompile(expression);
assertEquals(false,expression.getValue()); assertEquals(false,expression.getValue());
} }
@Test @Test
public void stringLiteral() throws Exception { public void stringLiteral() throws Exception {
expression = parser.parseExpression("'abcde'"); expression = parser.parseExpression("'abcde'");
@ -3047,7 +3047,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals("java.lang.String",expression.getValue()); assertEquals("java.lang.String",expression.getValue());
assertCanCompile(expression); assertCanCompile(expression);
assertEquals("java.lang.String",expression.getValue()); assertEquals("java.lang.String",expression.getValue());
// These tests below verify that the chain of static accesses (either method/property or field) // These tests below verify that the chain of static accesses (either method/property or field)
// leave the right thing on top of the stack for processing by any outer consuming code. // leave the right thing on top of the stack for processing by any outer consuming code.
// Here the consuming code is the String.valueOf() function. If the wrong thing were on // Here the consuming code is the String.valueOf() function. If the wrong thing were on
@ -3089,7 +3089,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals("fb",expression.getValue(StaticsHelper.sh)); assertEquals("fb",expression.getValue(StaticsHelper.sh));
assertCanCompile(expression); assertCanCompile(expression);
assertEquals("fb",expression.getValue(StaticsHelper.sh)); assertEquals("fb",expression.getValue(StaticsHelper.sh));
expression = parser.parseExpression("T(String).valueOf(propertya.propertyb)"); expression = parser.parseExpression("T(String).valueOf(propertya.propertyb)");
assertEquals("pb",expression.getValue(StaticsHelper.sh)); assertEquals("pb",expression.getValue(StaticsHelper.sh));
assertCanCompile(expression); assertCanCompile(expression);
@ -3099,7 +3099,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals("mb",expression.getValue(StaticsHelper.sh)); assertEquals("mb",expression.getValue(StaticsHelper.sh));
assertCanCompile(expression); assertCanCompile(expression);
assertEquals("mb",expression.getValue(StaticsHelper.sh)); assertEquals("mb",expression.getValue(StaticsHelper.sh));
} }
@Test @Test
@ -5493,7 +5493,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
public static String methodb() { public static String methodb() {
return "mb"; return "mb";
} }
public static StaticsHelper getPropertya() { public static StaticsHelper getPropertya() {
return sh; return sh;
} }
@ -5501,11 +5501,11 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
public static String getPropertyb() { public static String getPropertyb() {
return "pb"; return "pb";
} }
public static StaticsHelper fielda = sh; public static StaticsHelper fielda = sh;
public static String fieldb = "fb"; public static String fieldb = "fb";
public String toString() { public String toString() {
return "sh"; return "sh";
} }

View File

@ -1964,7 +1964,7 @@ public class SpelReproTests extends AbstractExpressionTests {
assertEquals("custard", expr.getValue(context)); assertEquals("custard", expr.getValue(context));
expr = new SpelExpressionParser().parseRaw("&foo"); expr = new SpelExpressionParser().parseRaw("&foo");
assertEquals("foo factory",expr.getValue(context)); assertEquals("foo factory",expr.getValue(context));
try { try {
expr = new SpelExpressionParser().parseRaw("&@foo"); expr = new SpelExpressionParser().parseRaw("&@foo");
fail("Illegal syntax, error expected"); fail("Illegal syntax, error expected");
@ -1973,7 +1973,7 @@ public class SpelReproTests extends AbstractExpressionTests {
assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode()); assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode());
assertEquals(0,spe.getPosition()); assertEquals(0,spe.getPosition());
} }
try { try {
expr = new SpelExpressionParser().parseRaw("@&foo"); expr = new SpelExpressionParser().parseRaw("@&foo");
fail("Illegal syntax, error expected"); fail("Illegal syntax, error expected");
@ -1981,7 +1981,7 @@ public class SpelReproTests extends AbstractExpressionTests {
catch (SpelParseException spe) { catch (SpelParseException spe) {
assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode()); assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode());
assertEquals(0,spe.getPosition()); assertEquals(0,spe.getPosition());
} }
} }
@Test @Test

View File

@ -72,7 +72,7 @@ public class FailingBeforeAndAfterMethodsTestNGTests {
{ AlwaysFailingAfterTestExecutionTestCase.class.getSimpleName(), 1, 0, 1, 0 }, { AlwaysFailingAfterTestExecutionTestCase.class.getSimpleName(), 1, 0, 1, 0 },
{ AlwaysFailingAfterTestMethodTestCase.class.getSimpleName(), 1, 1, 0, 1 }, { AlwaysFailingAfterTestMethodTestCase.class.getSimpleName(), 1, 1, 0, 1 },
{ FailingBeforeTransactionTestCase.class.getSimpleName(), 1, 0, 0, 1 }, { FailingBeforeTransactionTestCase.class.getSimpleName(), 1, 0, 0, 1 },
{ FailingAfterTransactionTestCase.class.getSimpleName(), 1, 1, 0, 1 } { FailingAfterTransactionTestCase.class.getSimpleName(), 1, 1, 0, 1 }
}; };
// @formatter:on // @formatter:on
} }

View File

@ -36,7 +36,7 @@ import org.springframework.web.server.ServerWebExchange;
*/ */
public class ExpressionValueMethodArgumentResolver extends AbstractNamedValueMethodArgumentResolver { public class ExpressionValueMethodArgumentResolver extends AbstractNamedValueMethodArgumentResolver {
/** /**
* @param beanFactory a bean factory to use for resolving ${...} * @param beanFactory a bean factory to use for resolving ${...}
* placeholder and #{...} SpEL expressions in default values; * placeholder and #{...} SpEL expressions in default values;

View File

@ -192,5 +192,5 @@ public class CompositeContentTypeResolverBuilderTests {
WebSessionManager sessionManager = new MockWebSessionManager(); WebSessionManager sessionManager = new MockWebSessionManager();
return new DefaultServerWebExchange(request, new MockServerHttpResponse(), sessionManager); return new DefaultServerWebExchange(request, new MockServerHttpResponse(), sessionManager);
} }
} }

View File

@ -98,7 +98,7 @@ public class MappingContentTypeResolverTests {
assertEquals("application/xml", mediaTypes.get(0).toString()); assertEquals("application/xml", mediaTypes.get(0).toString());
} }
private static class TestMappingContentTypeResolver extends AbstractMappingContentTypeResolver { private static class TestMappingContentTypeResolver extends AbstractMappingContentTypeResolver {
private final String key; private final String key;

View File

@ -129,7 +129,7 @@ public class SimpleUrlHandlerMappingTests {
@Configuration @Configuration
static class WebConfig { static class WebConfig {
@Bean @SuppressWarnings("unused") @Bean @SuppressWarnings("unused")
public SimpleUrlHandlerMapping handlerMapping() { public SimpleUrlHandlerMapping handlerMapping() {
SimpleUrlHandlerMapping hm = new SimpleUrlHandlerMapping(); SimpleUrlHandlerMapping hm = new SimpleUrlHandlerMapping();

View File

@ -57,7 +57,7 @@ public class HeadersRequestConditionTests {
public void headerPresent() throws Exception { public void headerPresent() throws Exception {
ServerWebExchange exchange = createExchange("Accept", ""); ServerWebExchange exchange = createExchange("Accept", "");
HeadersRequestCondition condition = new HeadersRequestCondition("accept"); HeadersRequestCondition condition = new HeadersRequestCondition("accept");
assertNotNull(condition.getMatchingCondition(exchange)); assertNotNull(condition.getMatchingCondition(exchange));
} }

View File

@ -124,7 +124,7 @@ public class RxNettyServerHttpResponse extends AbstractServerHttpResponse {
We should revisit this code once We should revisit this code once
https://github.com/ReactiveX/RxNetty/issues/194 has been fixed. https://github.com/ReactiveX/RxNetty/issues/194 has been fixed.
@Override @Override
public Mono<Void> writeWith(File file, long position, long count) { public Mono<Void> writeWith(File file, long position, long count) {

View File

@ -102,7 +102,7 @@ public class Jackson2JsonEncoderTests extends AbstractDataBufferAllocatingTestCa
.assertValuesWith(stringConsumer("{\"withView1\":\"with\"}")); .assertValuesWith(stringConsumer("{\"withView1\":\"with\"}"));
} }
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
private static class ParentClass { private static class ParentClass {
} }