Browse Source

Remove trailing whitespace from source code

pull/984/head
Sam Brannen 9 years ago
parent
commit
61824b1ade
  1. 2
      spring-context/src/test/java/org/springframework/context/expression/FactoryBeanAccessTests.java
  2. 22
      spring-context/src/test/java/org/springframework/context/expression/MapAccessorTests.java
  3. 16
      spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationCoverageTests.java
  4. 8
      spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java
  5. 2
      spring-web/src/test/java/org/springframework/http/client/OkHttpAsyncClientHttpRequestFactoryTests.java
  6. 2
      spring-web/src/test/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequestTests.java

2
spring-context/src/test/java/org/springframework/context/expression/FactoryBeanAccessTests.java

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

22
spring-context/src/test/java/org/springframework/context/expression/MapAccessorTests.java

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

16
spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationCoverageTests.java

@ -3000,11 +3000,11 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests { @@ -3000,11 +3000,11 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals("java.lang.String",expression.getValue());
assertCanCompile(expression);
assertEquals("java.lang.String",expression.getValue());
// 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.
// Here the consuming code is the String.valueOf() function. If the wrong thing were on
// the stack (for example if the compiled code for static methods wasn't popping the
// the stack (for example if the compiled code for static methods wasn't popping the
// previous thing off the stack) the valueOf() would operate on the wrong value.
String shclass = StaticsHelper.class.getName();
@ -3042,7 +3042,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests { @@ -3042,7 +3042,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals("fb",expression.getValue(StaticsHelper.sh));
assertCanCompile(expression);
assertEquals("fb",expression.getValue(StaticsHelper.sh));
expression = parser.parseExpression("T(String).valueOf(propertya.propertyb)");
assertEquals("pb",expression.getValue(StaticsHelper.sh));
assertCanCompile(expression);
@ -3052,9 +3052,9 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests { @@ -3052,9 +3052,9 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertEquals("mb",expression.getValue(StaticsHelper.sh));
assertCanCompile(expression);
assertEquals("mb",expression.getValue(StaticsHelper.sh));
}
}
@Test
public void constructorReference_SPR12326() {
String type = this.getClass().getName();
@ -5446,7 +5446,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests { @@ -5446,7 +5446,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
public static String methodb() {
return "mb";
}
public static StaticsHelper getPropertya() {
return sh;
}
@ -5454,11 +5454,11 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests { @@ -5454,11 +5454,11 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
public static String getPropertyb() {
return "pb";
}
public static StaticsHelper fielda = sh;
public static String fieldb = "fb";
public String toString() {
return "sh";
}

8
spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java

@ -1955,7 +1955,7 @@ public class SpelReproTests extends AbstractExpressionTests { @@ -1955,7 +1955,7 @@ public class SpelReproTests extends AbstractExpressionTests {
res = parser.parseExpression("#root.![values()]").getValue(context, List.class);
assertEquals("[[test12, test11], [test22, test21]]", res.toString());
}
@Test
public void AccessingFactoryBean_spr9511() {
StandardEvaluationContext context = new StandardEvaluationContext();
@ -1964,7 +1964,7 @@ public class SpelReproTests extends AbstractExpressionTests { @@ -1964,7 +1964,7 @@ public class SpelReproTests extends AbstractExpressionTests {
assertEquals("custard", expr.getValue(context));
expr = new SpelExpressionParser().parseRaw("&foo");
assertEquals("foo factory",expr.getValue(context));
try {
expr = new SpelExpressionParser().parseRaw("&@foo");
fail("Illegal syntax, error expected");
@ -1972,14 +1972,14 @@ public class SpelReproTests extends AbstractExpressionTests { @@ -1972,14 +1972,14 @@ public class SpelReproTests extends AbstractExpressionTests {
assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode());
assertEquals(0,spe.getPosition());
}
try {
expr = new SpelExpressionParser().parseRaw("@&foo");
fail("Illegal syntax, error expected");
} catch (SpelParseException spe) {
assertEquals(SpelMessage.INVALID_BEAN_REFERENCE,spe.getMessageCode());
assertEquals(0,spe.getPosition());
}
}
}
@Test

2
spring-web/src/test/java/org/springframework/http/client/OkHttpAsyncClientHttpRequestFactoryTests.java

@ -24,7 +24,7 @@ import org.springframework.http.HttpMethod; @@ -24,7 +24,7 @@ import org.springframework.http.HttpMethod;
* @author Luciano Leggieri
*/
public class OkHttpAsyncClientHttpRequestFactoryTests extends AbstractAsyncHttpRequestFactoryTestCase {
@Override
protected AsyncClientHttpRequestFactory createRequestFactory() {
return new OkHttpClientHttpRequestFactory();

2
spring-web/src/test/java/org/springframework/web/context/request/async/StandardServletAsyncWebRequestTests.java

@ -147,7 +147,7 @@ public class StandardServletAsyncWebRequestTests { @@ -147,7 +147,7 @@ public class StandardServletAsyncWebRequestTests {
}
// SPR-13292
@Test
public void onCompletionHandlerAfterOnErrorEvent() throws Exception {
Runnable handler = mock(Runnable.class);

Loading…
Cancel
Save