Browse Source

Remove inconsistent spaces

pull/1820/head
Johnny Lim 7 years ago committed by Juergen Hoeller
parent
commit
fb898e1727
  1. 2
      spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java
  2. 10
      spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java
  3. 8
      spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java
  4. 22
      spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java
  5. 14
      spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java
  6. 2
      spring-context/src/test/java/org/springframework/aop/target/CommonsPool2TargetSourceTests.java
  7. 2
      spring-context/src/test/java/org/springframework/cache/AbstractCacheTests.java
  8. 6
      spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
  9. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java
  10. 2
      spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java
  11. 2
      spring-tx/src/test/java/org/springframework/transaction/interceptor/AbstractTransactionAspectTests.java
  12. 2
      spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java
  13. 4
      spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java
  14. 2
      spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java

2
spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java

@ -48,7 +48,7 @@ public class MethodBeforeAdviceInterceptor implements MethodInterceptor, Seriali
@Override @Override
public Object invoke(MethodInvocation mi) throws Throwable { public Object invoke(MethodInvocation mi) throws Throwable {
this.advice.before(mi.getMethod(), mi.getArguments(), mi.getThis() ); this.advice.before(mi.getMethod(), mi.getArguments(), mi.getThis());
return mi.proceed(); return mi.proceed();
} }

10
spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java

@ -70,13 +70,13 @@ public class HotSwappableTargetSourceTests {
@Test @Test
public void testBasicFunctionality() { public void testBasicFunctionality() {
SideEffectBean proxied = (SideEffectBean) beanFactory.getBean("swappable"); SideEffectBean proxied = (SideEffectBean) beanFactory.getBean("swappable");
assertEquals(INITIAL_COUNT, proxied.getCount() ); assertEquals(INITIAL_COUNT, proxied.getCount());
proxied.doWork(); proxied.doWork();
assertEquals(INITIAL_COUNT + 1, proxied.getCount() ); assertEquals(INITIAL_COUNT + 1, proxied.getCount());
proxied = (SideEffectBean) beanFactory.getBean("swappable"); proxied = (SideEffectBean) beanFactory.getBean("swappable");
proxied.doWork(); proxied.doWork();
assertEquals(INITIAL_COUNT + 2, proxied.getCount() ); assertEquals(INITIAL_COUNT + 2, proxied.getCount());
} }
@Test @Test
@ -85,9 +85,9 @@ public class HotSwappableTargetSourceTests {
SideEffectBean target2 = (SideEffectBean) beanFactory.getBean("target2"); SideEffectBean target2 = (SideEffectBean) beanFactory.getBean("target2");
SideEffectBean proxied = (SideEffectBean) beanFactory.getBean("swappable"); SideEffectBean proxied = (SideEffectBean) beanFactory.getBean("swappable");
assertEquals(target1.getCount(), proxied.getCount() ); assertEquals(target1.getCount(), proxied.getCount());
proxied.doWork(); proxied.doWork();
assertEquals(INITIAL_COUNT + 1, proxied.getCount() ); assertEquals(INITIAL_COUNT + 1, proxied.getCount());
HotSwappableTargetSource swapper = (HotSwappableTargetSource) beanFactory.getBean("swapper"); HotSwappableTargetSource swapper = (HotSwappableTargetSource) beanFactory.getBean("swapper");
Object old = swapper.swap(target2); Object old = swapper.swap(target2);

8
spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java

@ -56,14 +56,14 @@ public class PrototypeTargetSourceTests {
@Test @Test
public void testPrototypeAndSingletonBehaveDifferently() { public void testPrototypeAndSingletonBehaveDifferently() {
SideEffectBean singleton = (SideEffectBean) beanFactory.getBean("singleton"); SideEffectBean singleton = (SideEffectBean) beanFactory.getBean("singleton");
assertEquals(INITIAL_COUNT, singleton.getCount() ); assertEquals(INITIAL_COUNT, singleton.getCount());
singleton.doWork(); singleton.doWork();
assertEquals(INITIAL_COUNT + 1, singleton.getCount() ); assertEquals(INITIAL_COUNT + 1, singleton.getCount());
SideEffectBean prototype = (SideEffectBean) beanFactory.getBean("prototype"); SideEffectBean prototype = (SideEffectBean) beanFactory.getBean("prototype");
assertEquals(INITIAL_COUNT, prototype.getCount() ); assertEquals(INITIAL_COUNT, prototype.getCount());
prototype.doWork(); prototype.doWork();
assertEquals(INITIAL_COUNT, prototype.getCount() ); assertEquals(INITIAL_COUNT, prototype.getCount());
} }

22
spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java

@ -62,9 +62,9 @@ public class ThreadLocalTargetSourceTests {
@Test @Test
public void testUseDifferentManagedInstancesInSameThread() { public void testUseDifferentManagedInstancesInSameThread() {
SideEffectBean apartment = (SideEffectBean) beanFactory.getBean("apartment"); SideEffectBean apartment = (SideEffectBean) beanFactory.getBean("apartment");
assertEquals(INITIAL_COUNT, apartment.getCount() ); assertEquals(INITIAL_COUNT, apartment.getCount());
apartment.doWork(); apartment.doWork();
assertEquals(INITIAL_COUNT + 1, apartment.getCount() ); assertEquals(INITIAL_COUNT + 1, apartment.getCount());
ITestBean test = (ITestBean) beanFactory.getBean("threadLocal2"); ITestBean test = (ITestBean) beanFactory.getBean("threadLocal2");
assertEquals("Rod", test.getName()); assertEquals("Rod", test.getName());
@ -74,12 +74,12 @@ public class ThreadLocalTargetSourceTests {
@Test @Test
public void testReuseInSameThread() { public void testReuseInSameThread() {
SideEffectBean apartment = (SideEffectBean) beanFactory.getBean("apartment"); SideEffectBean apartment = (SideEffectBean) beanFactory.getBean("apartment");
assertEquals(INITIAL_COUNT, apartment.getCount() ); assertEquals(INITIAL_COUNT, apartment.getCount());
apartment.doWork(); apartment.doWork();
assertEquals(INITIAL_COUNT + 1, apartment.getCount() ); assertEquals(INITIAL_COUNT + 1, apartment.getCount());
apartment = (SideEffectBean) beanFactory.getBean("apartment"); apartment = (SideEffectBean) beanFactory.getBean("apartment");
assertEquals(INITIAL_COUNT + 1, apartment.getCount() ); assertEquals(INITIAL_COUNT + 1, apartment.getCount());
} }
/** /**
@ -106,20 +106,20 @@ public class ThreadLocalTargetSourceTests {
@Test @Test
public void testNewThreadHasOwnInstance() throws InterruptedException { public void testNewThreadHasOwnInstance() throws InterruptedException {
SideEffectBean apartment = (SideEffectBean) beanFactory.getBean("apartment"); SideEffectBean apartment = (SideEffectBean) beanFactory.getBean("apartment");
assertEquals(INITIAL_COUNT, apartment.getCount() ); assertEquals(INITIAL_COUNT, apartment.getCount());
apartment.doWork(); apartment.doWork();
apartment.doWork(); apartment.doWork();
apartment.doWork(); apartment.doWork();
assertEquals(INITIAL_COUNT + 3, apartment.getCount() ); assertEquals(INITIAL_COUNT + 3, apartment.getCount());
class Runner implements Runnable { class Runner implements Runnable {
public SideEffectBean mine; public SideEffectBean mine;
@Override @Override
public void run() { public void run() {
this.mine = (SideEffectBean) beanFactory.getBean("apartment"); this.mine = (SideEffectBean) beanFactory.getBean("apartment");
assertEquals(INITIAL_COUNT, mine.getCount() ); assertEquals(INITIAL_COUNT, mine.getCount());
mine.doWork(); mine.doWork();
assertEquals(INITIAL_COUNT + 1, mine.getCount() ); assertEquals(INITIAL_COUNT + 1, mine.getCount());
} }
} }
Runner r = new Runner(); Runner r = new Runner();
@ -130,11 +130,11 @@ public class ThreadLocalTargetSourceTests {
assertNotNull(r); assertNotNull(r);
// Check it didn't affect the other thread's copy // Check it didn't affect the other thread's copy
assertEquals(INITIAL_COUNT + 3, apartment.getCount() ); assertEquals(INITIAL_COUNT + 3, apartment.getCount());
// When we use other thread's copy in this thread // When we use other thread's copy in this thread
// it should behave like ours // it should behave like ours
assertEquals(INITIAL_COUNT + 3, r.mine.getCount() ); assertEquals(INITIAL_COUNT + 3, r.mine.getCount());
// Bound to two threads // Bound to two threads
assertEquals(2, ((ThreadLocalTargetSourceStats) apartment).getObjectCount()); assertEquals(2, ((ThreadLocalTargetSourceStats) apartment).getObjectCount());

14
spring-context/src/test/java/org/springframework/aop/framework/ProxyFactoryBeanTests.java

@ -260,22 +260,22 @@ public class ProxyFactoryBeanTests {
// Check it works without AOP // Check it works without AOP
SideEffectBean raw = (SideEffectBean) bf.getBean("prototypeTarget"); SideEffectBean raw = (SideEffectBean) bf.getBean("prototypeTarget");
assertEquals(INITIAL_COUNT, raw.getCount() ); assertEquals(INITIAL_COUNT, raw.getCount());
raw.doWork(); raw.doWork();
assertEquals(INITIAL_COUNT+1, raw.getCount() ); assertEquals(INITIAL_COUNT+1, raw.getCount());
raw = (SideEffectBean) bf.getBean("prototypeTarget"); raw = (SideEffectBean) bf.getBean("prototypeTarget");
assertEquals(INITIAL_COUNT, raw.getCount() ); assertEquals(INITIAL_COUNT, raw.getCount());
// Now try with advised instances // Now try with advised instances
SideEffectBean prototype2FirstInstance = (SideEffectBean) bf.getBean(beanName); SideEffectBean prototype2FirstInstance = (SideEffectBean) bf.getBean(beanName);
assertEquals(INITIAL_COUNT, prototype2FirstInstance.getCount() ); assertEquals(INITIAL_COUNT, prototype2FirstInstance.getCount());
prototype2FirstInstance.doWork(); prototype2FirstInstance.doWork();
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount() ); assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount());
SideEffectBean prototype2SecondInstance = (SideEffectBean) bf.getBean(beanName); SideEffectBean prototype2SecondInstance = (SideEffectBean) bf.getBean(beanName);
assertFalse("Prototypes are not ==", prototype2FirstInstance == prototype2SecondInstance); assertFalse("Prototypes are not ==", prototype2FirstInstance == prototype2SecondInstance);
assertEquals(INITIAL_COUNT, prototype2SecondInstance.getCount() ); assertEquals(INITIAL_COUNT, prototype2SecondInstance.getCount());
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount() ); assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount());
return prototype2FirstInstance; return prototype2FirstInstance;
} }

2
spring-context/src/test/java/org/springframework/aop/target/CommonsPool2TargetSourceTests.java

@ -84,7 +84,7 @@ public class CommonsPool2TargetSourceTests {
// Just check that it works--we can't make assumptions // Just check that it works--we can't make assumptions
// about the count // about the count
pooled.doWork(); pooled.doWork();
//assertEquals(INITIAL_COUNT + 1, apartment.getCount() ); //assertEquals(INITIAL_COUNT + 1, apartment.getCount());
} }
@Test @Test

2
spring-context/src/test/java/org/springframework/cache/AbstractCacheTests.java vendored

@ -132,7 +132,7 @@ public abstract class AbstractCacheTests<T extends Cache> {
String key = createRandomKey(); String key = createRandomKey();
assertNull(cache.get(key)); assertNull(cache.get(key));
Object value = cache.get(key, () -> returnValue ); Object value = cache.get(key, () -> returnValue);
assertEquals(returnValue, value); assertEquals(returnValue, value);
assertEquals(value, cache.get(key).get()); assertEquals(value, cache.get(key).get());
} }

6
spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java

@ -89,7 +89,7 @@ public class LocalSlsbInvokerInterceptorTests {
LocalSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); LocalSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName);
ProxyFactory pf = new ProxyFactory(new Class<?>[] { BusinessMethods.class } ); ProxyFactory pf = new ProxyFactory(new Class<?>[] { BusinessMethods.class });
pf.addAdvice(si); pf.addAdvice(si);
BusinessMethods target = (BusinessMethods) pf.getProxy(); BusinessMethods target = (BusinessMethods) pf.getProxy();
@ -110,7 +110,7 @@ public class LocalSlsbInvokerInterceptorTests {
LocalSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); LocalSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName);
ProxyFactory pf = new ProxyFactory(new Class<?>[] { BusinessMethods.class } ); ProxyFactory pf = new ProxyFactory(new Class<?>[] { BusinessMethods.class });
pf.addAdvice(si); pf.addAdvice(si);
BusinessMethods target = (BusinessMethods) pf.getProxy(); BusinessMethods target = (BusinessMethods) pf.getProxy();
@ -129,7 +129,7 @@ public class LocalSlsbInvokerInterceptorTests {
LocalSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName); LocalSlsbInvokerInterceptor si = configuredInterceptor(mockContext, jndiName);
ProxyFactory pf = new ProxyFactory(new Class<?>[] { LocalInterfaceWithBusinessMethods.class } ); ProxyFactory pf = new ProxyFactory(new Class<?>[] { LocalInterfaceWithBusinessMethods.class });
pf.addAdvice(si); pf.addAdvice(si);
LocalInterfaceWithBusinessMethods target = (LocalInterfaceWithBusinessMethods) pf.getProxy(); LocalInterfaceWithBusinessMethods target = (LocalInterfaceWithBusinessMethods) pf.getProxy();

2
spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java

@ -112,7 +112,7 @@ public class SqlLobValueTests {
lob.setTypeValue(preparedStatement, 1, Types.CLOB, "test"); lob.setTypeValue(preparedStatement, 1, Types.CLOB, "test");
verify(creator).setClobAsAsciiStream(eq(preparedStatement), eq(1), inputStreamCaptor.capture(), eq(3)); verify(creator).setClobAsAsciiStream(eq(preparedStatement), eq(1), inputStreamCaptor.capture(), eq(3));
byte[] bytes = new byte[3]; byte[] bytes = new byte[3];
inputStreamCaptor.getValue().read(bytes ); inputStreamCaptor.getValue().read(bytes);
assertThat(bytes, equalTo(testContent)); assertThat(bytes, equalTo(testContent));
} }

2
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java

@ -73,7 +73,7 @@ public class HeaderMethodArgumentResolver extends AbstractNamedValueMethodArgume
logger.warn("Message headers contain two values for the same header '" + name + "', " + logger.warn("Message headers contain two values for the same header '" + name + "', " +
"one in the top level header map and a second in the nested map with native headers. " + "one in the top level header map and a second in the nested map with native headers. " +
"Using the value from top level map. " + "Using the value from top level map. " +
"Use 'nativeHeader.myHeader' to resolve to the value from the nested native header map." ); "Use 'nativeHeader.myHeader' to resolve to the value from the nested native header map.");
} }
} }

2
spring-tx/src/test/java/org/springframework/transaction/interceptor/AbstractTransactionAspectTests.java

@ -406,7 +406,7 @@ public abstract class AbstractTransactionAspectTests {
} }
catch (Throwable t) { catch (Throwable t) {
if (rollbackException) { if (rollbackException) {
assertEquals("Caught wrong exception", tex, t ); assertEquals("Caught wrong exception", tex, t);
} }
else { else {
assertEquals("Caught wrong exception", ex, t); assertEquals("Caught wrong exception", ex, t);

2
spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java

@ -260,7 +260,7 @@ public class MappingJackson2JsonView extends AbstractJackson2View {
} }
if (jsonpFunction != null) { if (jsonpFunction != null) {
generator.writeRaw("/**/"); generator.writeRaw("/**/");
generator.writeRaw(jsonpFunction + "(" ); generator.writeRaw(jsonpFunction + "(");
} }
} }

4
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java

@ -354,7 +354,7 @@ public class RequestMappingInfoHandlerMappingTests {
urlPathHelper.setUrlDecode(false); urlPathHelper.setUrlDecode(false);
urlPathHelper.setRemoveSemicolonContent(false); urlPathHelper.setRemoveSemicolonContent(false);
this.handlerMapping.setUrlPathHelper(urlPathHelper ); this.handlerMapping.setUrlPathHelper(urlPathHelper);
request = new MockHttpServletRequest(); request = new MockHttpServletRequest();
handleMatch(request, "/path{filter}", "/path;mvar=a%2fb"); handleMatch(request, "/path{filter}", "/path;mvar=a%2fb");
@ -534,4 +534,4 @@ public class RequestMappingInfoHandlerMappingTests {
} }
} }
} }

2
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java

@ -89,7 +89,7 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
private long heartbeatTime = TimeUnit.SECONDS.toMillis(25); private long heartbeatTime = TimeUnit.SECONDS.toMillis(25);
private long disconnectDelay = TimeUnit.SECONDS.toMillis(5 ); private long disconnectDelay = TimeUnit.SECONDS.toMillis(5);
private int httpMessageCacheSize = 100; private int httpMessageCacheSize = 100;

Loading…
Cancel
Save