提交 439ea902 编写于 作者: S Stephane Nicoll

Merge pull request #655 from kicktipp/SPR-12239

* SPR-12239:
  Adding @AjSuppressWarnings on some advices
......@@ -19,6 +19,8 @@ package org.springframework.mock.staticmock;
import java.util.Arrays;
import java.util.LinkedList;
import org.aspectj.lang.annotation.SuppressAjWarnings;
import org.springframework.util.ObjectUtils;
/**
......@@ -227,6 +229,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
*/
protected abstract pointcut methodToMock();
@SuppressAjWarnings("adviceDidNotMatch")
after() returning : mockStaticsTestMethod() {
if (recording && (expectations.hasCalls())) {
throw new IllegalStateException(
......@@ -236,6 +239,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
verifyInternal();
}
@SuppressAjWarnings("adviceDidNotMatch")
Object around() : methodToMock() && cflowbelow(mockStaticsTestMethod()) {
if (recording) {
expectations.expectCall(thisJoinPointStaticPart.toLongString(), thisJoinPoint.getArgs());
......
/*
* 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");
* 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.Query;
import org.aspectj.lang.annotation.SuppressAjWarnings;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
......@@ -29,6 +31,7 @@ public aspect JpaExceptionTranslatorAspect {
call(* EntityManager.*(..)) || call(* EntityManagerFactory.*(..)) ||
call(* EntityTransaction.*(..)) || call(* Query.*(..));
@SuppressAjWarnings("adviceDidNotMatch")
after() throwing(RuntimeException re): entityManagerCall() {
DataAccessException dex = EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(re);
if (dex != null) {
......
......@@ -20,6 +20,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import org.aspectj.lang.annotation.SuppressAjWarnings;
import org.aspectj.lang.reflect.MethodSignature;
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}
* otherwise.
*/
@SuppressAjWarnings("adviceDidNotMatch")
Object around() : asyncMethod() {
final MethodSignature methodSignature = (MethodSignature) thisJoinPointStaticPart.getSignature();
AsyncTaskExecutor executor = determineAsyncExecutor(methodSignature.getMethod());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册