Skip to content

Commit cbf6991

Browse files
committed
Merge branch 'SPR-10129' into cleanup-3.2.x
* SPR-10129: Add @OverRide annotations to test sources Update test source and target JDK compatibility
2 parents aa82464 + 4c8cd7b commit cbf6991

File tree

799 files changed

+4775
-6
lines changed

Some content is hidden

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

799 files changed

+4775
-6
lines changed

build.gradle

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@ configure(allprojects) {
3232

3333
group = "org.springframework"
3434

35-
sourceCompatibility=1.5
36-
targetCompatibility=1.5
35+
compileJava {
36+
sourceCompatibility=1.5
37+
targetCompatibility=1.5
38+
}
39+
compileTestJava {
40+
sourceCompatibility=1.7
41+
targetCompatibility=1.7
42+
}
3743

3844
[compileJava, compileTestJava]*.options*.compilerArgs = [
3945
"-Xlint:serial",
@@ -333,6 +339,14 @@ project("spring-tx") {
333339
project("spring-oxm") {
334340
description = "Spring Object/XML Marshalling"
335341
apply from: "oxm.gradle"
342+
343+
compileTestJava {
344+
// necessary to avoid java.lang.VerifyError on jibx compilation
345+
// see http://jira.codehaus.org/browse/JIBX-465
346+
sourceCompatibility=1.6
347+
targetCompatibility=1.6
348+
}
349+
336350
dependencies {
337351
compile(project(":spring-beans"))
338352
compile(project(":spring-core"))
@@ -458,6 +472,14 @@ project("spring-web") {
458472

459473
project("spring-orm") {
460474
description = "Spring Object/Relational Mapping"
475+
476+
compileTestJava {
477+
// necessary to avoid java.lang.VerifyError on toplink compilation
478+
// TODO: remove this block when we remove toplink
479+
sourceCompatibility=1.6
480+
targetCompatibility=1.6
481+
}
482+
461483
dependencies {
462484
compile("aopalliance:aopalliance:1.0")
463485
optional("org.hibernate:hibernate-core:3.3.2.GA")

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public void testTarget() throws SecurityException, NoSuchMethodException {
113113

114114
public static class OtherIOther implements IOther {
115115

116+
@Override
116117
public void absquatulate() {
117118
// Empty
118119
}
@@ -354,6 +355,7 @@ class CallCountingInterceptor implements MethodInterceptor {
354355

355356
private int count;
356357

358+
@Override
357359
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
358360
count++;
359361
return methodInvocation.proceed();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ private void assertMisMatch(String beanName, String pcExpression) {
9090
private static boolean matches(final String beanName, String pcExpression) {
9191
@SuppressWarnings("serial")
9292
AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut() {
93+
@Override
9394
protected String getCurrentProxiedBeanName() {
9495
return beanName;
9596
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public void testCanGetMethodSignatureFromJoinPoint() {
7979
pf.addAdvice(new MethodBeforeAdvice() {
8080
private int depth;
8181

82+
@Override
8283
public void before(Method method, Object[] args, Object target) throws Throwable {
8384
JoinPoint jp = AbstractAspectJAdvice.currentJoinPoint();
8485
assertTrue("Method named in toString", jp.toString().contains(method.getName()));
@@ -135,6 +136,7 @@ public void testCanGetSourceLocationFromJoinPoint() {
135136
ProxyFactory pf = new ProxyFactory(raw);
136137
pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
137138
pf.addAdvice(new MethodBeforeAdvice() {
139+
@Override
138140
public void before(Method method, Object[] args, Object target) throws Throwable {
139141
SourceLocation sloc = AbstractAspectJAdvice.currentJoinPoint().getSourceLocation();
140142
assertEquals("Same source location must be returned on subsequent requests", sloc, AbstractAspectJAdvice.currentJoinPoint().getSourceLocation());
@@ -167,6 +169,7 @@ public void testCanGetStaticPartFromJoinPoint() {
167169
ProxyFactory pf = new ProxyFactory(raw);
168170
pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
169171
pf.addAdvice(new MethodBeforeAdvice() {
172+
@Override
170173
public void before(Method method, Object[] args, Object target) throws Throwable {
171174
StaticPart staticPart = AbstractAspectJAdvice.currentJoinPoint().getStaticPart();
172175
assertEquals("Same static part must be returned on subsequent requests", staticPart, AbstractAspectJAdvice.currentJoinPoint().getStaticPart());
@@ -186,6 +189,7 @@ public void toShortAndLongStringFormedCorrectly() throws Exception {
186189
ProxyFactory pf = new ProxyFactory(raw);
187190
pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
188191
pf.addAdvice(new MethodBeforeAdvice() {
192+
@Override
189193
public void before(Method method, Object[] args, Object target) throws Throwable {
190194
// makeEncSJP, although meant for computing the enclosing join point,
191195
// it serves our purpose here

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public static interface TestService {
137137

138138
@Log
139139
public static class TestServiceImpl implements TestService {
140+
@Override
140141
public String sayHello() {
141142
throw new TestException("TestServiceImpl");
142143
}
@@ -148,6 +149,7 @@ public class LogUserAdvice implements MethodBeforeAdvice, ThrowsAdvice {
148149

149150
private int countThrows = 0;
150151

152+
@Override
151153
public void before(Method method, Object[] objects, Object o) throws Throwable {
152154
countBefore++;
153155
}

spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,19 +675,23 @@ public int getInstantiationCount() {
675675
return this.count;
676676
}
677677

678+
@Override
678679
public Object getAspectInstance() {
679680
++this.count;
680681
return new PerTypeWithinAspect();
681682
}
682683

684+
@Override
683685
public ClassLoader getAspectClassLoader() {
684686
return PerTypeWithinAspect.class.getClassLoader();
685687
}
686688

689+
@Override
687690
public AspectMetadata getAspectMetadata() {
688691
return new AspectMetadata(PerTypeWithinAspect.class, "perTypeWithin");
689692
}
690693

694+
@Override
691695
public int getOrder() {
692696
return Ordered.LOWEST_PRECEDENCE;
693697
}
@@ -897,14 +901,17 @@ public interface MutableModifable extends Modifiable {
897901
public static class ModifiableImpl implements MutableModifable {
898902
private boolean modified;
899903

904+
@Override
900905
public void acceptChanges() {
901906
modified = false;
902907
}
903908

909+
@Override
904910
public boolean isModified() {
905911
return modified;
906912
}
907913

914+
@Override
908915
public void markDirty() {
909916
this.modified = true;
910917
}
@@ -1020,17 +1027,21 @@ public void checkNotLocked(
10201027

10211028
class CannotBeUnlocked implements Lockable, Comparable<Object> {
10221029

1030+
@Override
10231031
public void lock() {
10241032
}
10251033

1034+
@Override
10261035
public void unlock() {
10271036
throw new UnsupportedOperationException();
10281037
}
10291038

1039+
@Override
10301040
public boolean locked() {
10311041
return true;
10321042
}
10331043

1044+
@Override
10341045
public int compareTo(Object arg0) {
10351046
throw new UnsupportedOperationException();
10361047
}

spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ArgumentBindingTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public interface ITransactionalBean {
8484

8585
public static class TransactionalBean implements ITransactionalBean {
8686

87+
@Override
8788
@Transactional
8889
public void doInTransaction() {
8990
}

spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public static class TestBean implements ITestBean {
111111

112112
private int age;
113113

114+
@Override
114115
public int getAge() {
115116
return age;
116117
}

spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ private Advisor createAspectJAdvice(int advisorOrder, int adviceDeclarationOrder
194194

195195
private Advisor createSpringAOPAfterAdvice(int order) {
196196
AfterReturningAdvice advice = new AfterReturningAdvice() {
197+
@Override
197198
public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
198199
}
199200
};

spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public void testProxiedUserInterfacesWithMultipleInterfaces() {
129129
public void testProxiedUserInterfacesWithNoInterface() {
130130
Object proxy = Proxy.newProxyInstance(getClass().getClassLoader(), new Class[0],
131131
new InvocationHandler() {
132+
@Override
132133
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
133134
return null;
134135
}

0 commit comments

Comments
 (0)