Skip to content

Commit 6950d55

Browse files
kicktippsnicoll
authored andcommitted
Adding @AjSuppressWarnings on some advices
Issue: SPR-12239
1 parent a864028 commit 6950d55

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package org.springframework.mock.staticmock;
1919
import java.util.Arrays;
2020
import java.util.LinkedList;
2121

22+
import org.aspectj.lang.annotation.SuppressAjWarnings;
23+
2224
import org.springframework.util.ObjectUtils;
2325

2426
/**
@@ -227,6 +229,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
227229
*/
228230
protected abstract pointcut methodToMock();
229231

232+
@SuppressAjWarnings("adviceDidNotMatch")
230233
after() returning : mockStaticsTestMethod() {
231234
if (recording && (expectations.hasCalls())) {
232235
throw new IllegalStateException(
@@ -236,6 +239,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
236239
verifyInternal();
237240
}
238241

242+
@SuppressAjWarnings("adviceDidNotMatch")
239243
Object around() : methodToMock() && cflowbelow(mockStaticsTestMethod()) {
240244
if (recording) {
241245
expectations.expectCall(thisJoinPointStaticPart.toLongString(), thisJoinPoint.getArgs());

spring-aspects/src/main/java/org/springframework/orm/jpa/aspectj/JpaExceptionTranslatorAspect.aj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -21,6 +21,8 @@ import javax.persistence.EntityManagerFactory;
2121
import javax.persistence.EntityTransaction;
2222
import javax.persistence.Query;
2323

24+
import org.aspectj.lang.annotation.SuppressAjWarnings;
25+
2426
import org.springframework.dao.DataAccessException;
2527
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
2628

@@ -29,6 +31,7 @@ public aspect JpaExceptionTranslatorAspect {
2931
call(* EntityManager.*(..)) || call(* EntityManagerFactory.*(..)) ||
3032
call(* EntityTransaction.*(..)) || call(* Query.*(..));
3133

34+
@SuppressAjWarnings("adviceDidNotMatch")
3235
after() throwing(RuntimeException re): entityManagerCall() {
3336
DataAccessException dex = EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(re);
3437
if (dex != null) {

spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AbstractAsyncExecutionAspect.aj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import java.util.concurrent.Callable;
2020
import java.util.concurrent.Executor;
2121
import java.util.concurrent.Future;
2222

23+
import org.aspectj.lang.annotation.SuppressAjWarnings;
2324
import org.aspectj.lang.reflect.MethodSignature;
2425

2526
import org.springframework.aop.interceptor.AsyncExecutionAspectSupport;
@@ -58,6 +59,7 @@ public abstract aspect AbstractAsyncExecutionAspect extends AsyncExecutionAspect
5859
* @return {@link Future} if the original method returns {@code Future}; {@code null}
5960
* otherwise.
6061
*/
62+
@SuppressAjWarnings("adviceDidNotMatch")
6163
Object around() : asyncMethod() {
6264
final MethodSignature methodSignature = (MethodSignature) thisJoinPointStaticPart.getSignature();
6365
AsyncTaskExecutor executor = determineAsyncExecutor(methodSignature.getMethod());

0 commit comments

Comments
 (0)