Merge pull request #655 from kicktipp/SPR-12239
* SPR-12239: Adding @AjSuppressWarnings on some advices
This commit is contained in:
commit
439ea90205
|
|
@ -19,6 +19,8 @@ package org.springframework.mock.staticmock;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import org.aspectj.lang.annotation.SuppressAjWarnings;
|
||||||
|
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -227,6 +229,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
|
||||||
*/
|
*/
|
||||||
protected abstract pointcut methodToMock();
|
protected abstract pointcut methodToMock();
|
||||||
|
|
||||||
|
@SuppressAjWarnings("adviceDidNotMatch")
|
||||||
after() returning : mockStaticsTestMethod() {
|
after() returning : mockStaticsTestMethod() {
|
||||||
if (recording && (expectations.hasCalls())) {
|
if (recording && (expectations.hasCalls())) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
|
|
@ -236,6 +239,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
|
||||||
verifyInternal();
|
verifyInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressAjWarnings("adviceDidNotMatch")
|
||||||
Object around() : methodToMock() && cflowbelow(mockStaticsTestMethod()) {
|
Object around() : methodToMock() && cflowbelow(mockStaticsTestMethod()) {
|
||||||
if (recording) {
|
if (recording) {
|
||||||
expectations.expectCall(thisJoinPointStaticPart.toLongString(), thisJoinPoint.getArgs());
|
expectations.expectCall(thisJoinPointStaticPart.toLongString(), thisJoinPoint.getArgs());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -21,6 +21,8 @@ import javax.persistence.EntityManagerFactory;
|
||||||
import javax.persistence.EntityTransaction;
|
import javax.persistence.EntityTransaction;
|
||||||
import javax.persistence.Query;
|
import javax.persistence.Query;
|
||||||
|
|
||||||
|
import org.aspectj.lang.annotation.SuppressAjWarnings;
|
||||||
|
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
|
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
|
||||||
|
|
||||||
|
|
@ -29,6 +31,7 @@ public aspect JpaExceptionTranslatorAspect {
|
||||||
call(* EntityManager.*(..)) || call(* EntityManagerFactory.*(..)) ||
|
call(* EntityManager.*(..)) || call(* EntityManagerFactory.*(..)) ||
|
||||||
call(* EntityTransaction.*(..)) || call(* Query.*(..));
|
call(* EntityTransaction.*(..)) || call(* Query.*(..));
|
||||||
|
|
||||||
|
@SuppressAjWarnings("adviceDidNotMatch")
|
||||||
after() throwing(RuntimeException re): entityManagerCall() {
|
after() throwing(RuntimeException re): entityManagerCall() {
|
||||||
DataAccessException dex = EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(re);
|
DataAccessException dex = EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(re);
|
||||||
if (dex != null) {
|
if (dex != null) {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
import org.aspectj.lang.annotation.SuppressAjWarnings;
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
|
|
||||||
import org.springframework.aop.interceptor.AsyncExecutionAspectSupport;
|
import org.springframework.aop.interceptor.AsyncExecutionAspectSupport;
|
||||||
|
|
@ -58,6 +59,7 @@ public abstract aspect AbstractAsyncExecutionAspect extends AsyncExecutionAspect
|
||||||
* @return {@link Future} if the original method returns {@code Future}; {@code null}
|
* @return {@link Future} if the original method returns {@code Future}; {@code null}
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
|
@SuppressAjWarnings("adviceDidNotMatch")
|
||||||
Object around() : asyncMethod() {
|
Object around() : asyncMethod() {
|
||||||
final MethodSignature methodSignature = (MethodSignature) thisJoinPointStaticPart.getSignature();
|
final MethodSignature methodSignature = (MethodSignature) thisJoinPointStaticPart.getSignature();
|
||||||
AsyncTaskExecutor executor = determineAsyncExecutor(methodSignature.getMethod());
|
AsyncTaskExecutor executor = determineAsyncExecutor(methodSignature.getMethod());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue