Skip to content

Commit 517ebd1

Browse files
committed
Consistent formatting
1 parent 2cdb0cf commit 517ebd1

File tree

101 files changed

+677
-505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+677
-505
lines changed

spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 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.
@@ -101,7 +101,7 @@ private boolean matchesReturnValue(Class<?> type, Method method, Object returnVa
101101
else if (Object.class == type && void.class == method.getReturnType()) {
102102
return true;
103103
}
104-
else{
104+
else {
105105
return ClassUtils.isAssignable(type, method.getReturnType());
106106
}
107107
}

spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscovererTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ protected void assertException(Method m, String pointcut, String returning, Stri
307307
try {
308308
discoverer.getParameterNames(m);
309309
fail("Expecting " + exceptionType.getName() + " with message '" + message + "'");
310-
} catch (RuntimeException expected) {
310+
}
311+
catch (RuntimeException expected) {
311312
assertEquals("Expecting exception of type " + exceptionType.getName(),
312313
exceptionType, expected.getClass());
313314
assertEquals("Exception message does not match expected", message, expected.getMessage());

spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ public void before(Method method, Object[] args, Object target) throws Throwable
215215
itb.setSpouse(new TestBean());
216216
try {
217217
itb.unreliableFileOperation();
218-
} catch (IOException ex) {
218+
}
219+
catch (IOException ex) {
219220
// we don't realy care...
220221
}
221222
}

spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2002-2016 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springframework.aop.aspectj;
218

319
import java.lang.annotation.Documented;
@@ -97,12 +113,14 @@ private void testAdvice(Advisor advisor, LogUserAdvice logAdvice, TestService ta
97113
try {
98114
bean.sayHello();
99115
fail("Expected exception");
100-
} catch (TestException e) {
101-
assertEquals(message, e.getMessage());
116+
}
117+
catch (TestException ex) {
118+
assertEquals(message, ex.getMessage());
102119
}
103120
assertEquals(1, logAdvice.getCountThrows());
104121
}
105122

123+
106124
public static class SimpleThrowawayClassLoader extends OverridingClassLoader {
107125

108126
/**
@@ -115,34 +133,40 @@ public SimpleThrowawayClassLoader(ClassLoader parent) {
115133

116134
}
117135

136+
118137
@SuppressWarnings("serial")
119138
public static class TestException extends RuntimeException {
120139

121140
public TestException(String string) {
122141
super(string);
123142
}
124-
125143
}
126144

145+
127146
@Target({ ElementType.METHOD, ElementType.TYPE })
128147
@Retention(RetentionPolicy.RUNTIME)
129148
@Documented
130149
@Inherited
131150
public static @interface Log {
132151
}
133152

153+
134154
public static interface TestService {
155+
135156
public String sayHello();
136157
}
137158

159+
138160
@Log
139161
public static class TestServiceImpl implements TestService {
162+
140163
@Override
141164
public String sayHello() {
142165
throw new TestException("TestServiceImpl");
143166
}
144167
}
145168

169+
146170
public class LogUserAdvice implements MethodBeforeAdvice, ThrowsAdvice {
147171

148172
private int countBefore = 0;
@@ -154,9 +178,9 @@ public void before(Method method, Object[] objects, Object o) throws Throwable {
154178
countBefore++;
155179
}
156180

157-
public void afterThrowing(Exception e) throws Throwable {
181+
public void afterThrowing(Exception ex) throws Throwable {
158182
countThrows++;
159-
throw e;
183+
throw ex;
160184
}
161185

162186
public int getCountBefore() {
@@ -171,7 +195,6 @@ public void reset() {
171195
countThrows = 0;
172196
countBefore = 0;
173197
}
174-
175198
}
176199

177200
}

spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public void testExceptionPathStillLogsCorrectly() throws Throwable {
6161
try {
6262
interceptor.invoke(methodInvocation);
6363
fail("Must have propagated the IllegalArgumentException.");
64-
} catch (IllegalArgumentException expected) {
64+
}
65+
catch (IllegalArgumentException expected) {
6566
}
6667
checkCallCountTotal(interceptor);
6768

spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public void testExceptionPathStillLogsCorrectly() throws Throwable {
6060
try {
6161
interceptor.invokeUnderTrace(mi, log);
6262
fail("Must have propagated the IllegalArgumentException.");
63-
} catch (IllegalArgumentException expected) {
63+
}
64+
catch (IllegalArgumentException expected) {
6465
}
6566

6667
verify(log).trace(anyString());

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ public void testReuseDestroyedTarget() {
154154
// try second time
155155
try {
156156
source.getTarget();
157-
} catch(NullPointerException ex) {
157+
}
158+
catch (NullPointerException ex) {
158159
fail("Should not throw NPE");
159160
}
160161
}

spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ public <T> Future<T> submit(Callable<T> task) {
210210
public synchronized void waitForCompletion() {
211211
try {
212212
wait(WAIT_TIME);
213-
} catch (InterruptedException e) {
213+
}
214+
catch (InterruptedException ex) {
214215
fail("Didn't finish the async job in " + WAIT_TIME + " milliseconds");
215216
}
216217
}

spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 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.
@@ -204,7 +204,7 @@ public Object getObject() throws IllegalAccessException {
204204
// instance field
205205
return this.fieldObject.get(this.targetObject);
206206
}
207-
else{
207+
else {
208208
// class field
209209
return this.fieldObject.get(null);
210210
}

spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,22 @@ public void testErrorOnTooManyOrTooFew() throws Exception {
8181
TestServiceLocator factory = (TestServiceLocator) bf.getBean("factory");
8282
factory.getTestService();
8383
fail("Must fail on more than one matching type");
84-
} catch (NoSuchBeanDefinitionException ex) { /* expected */ }
84+
}
85+
catch (NoSuchBeanDefinitionException ex) { /* expected */ }
8586

8687
try {
8788
TestServiceLocator2 factory = (TestServiceLocator2) bf.getBean("factory2");
8889
factory.getTestService(null);
8990
fail("Must fail on more than one matching type");
90-
} catch (NoSuchBeanDefinitionException ex) { /* expected */ }
91+
}
92+
catch (NoSuchBeanDefinitionException ex) { /* expected */ }
9193

9294
try {
9395
TestService2Locator factory = (TestService2Locator) bf.getBean("factory3");
9496
factory.getTestService();
9597
fail("Must fail on no matching types");
96-
} catch (NoSuchBeanDefinitionException ex) { /* expected */ }
98+
}
99+
catch (NoSuchBeanDefinitionException ex) { /* expected */ }
97100
}
98101

99102
@Test
@@ -138,7 +141,8 @@ public void testErrorOnTooManyOrTooFewWithCustomServiceLocatorException() {
138141
TestService2Locator factory3 = (TestService2Locator) bf.getBean("factory3");
139142
factory3.getTestService();
140143
fail("Must fail on no matching type");
141-
} catch (CustomServiceLocatorException3 ex) { /* expected */ }
144+
}
145+
catch (CustomServiceLocatorException3 ex) { /* expected */ }
142146
}
143147

144148
@Test
@@ -160,7 +164,8 @@ public void testStringArgGetter() throws Exception {
160164
try {
161165
factory.getTestService("bogusTestService");
162166
fail("Illegal operation allowed");
163-
} catch (NoSuchBeanDefinitionException ex) { /* expected */ }
167+
}
168+
catch (NoSuchBeanDefinitionException ex) { /* expected */ }
164169
}
165170

166171
@Ignore @Test // worked when using an ApplicationContext (see commented), fails when using BeanFactory
@@ -275,7 +280,8 @@ public void testRequiresListableBeanFactoryAndChokesOnAnythingElse() throws Exce
275280
try {
276281
ServiceLocatorFactoryBean factory = new ServiceLocatorFactoryBean();
277282
factory.setBeanFactory(beanFactory);
278-
} catch (FatalBeanException ex) {
283+
}
284+
catch (FatalBeanException ex) {
279285
// expected
280286
}
281287
}

0 commit comments

Comments
 (0)