Restore *.aj whitespace
The removal of whitespace to the *.aj files made in1762157
cause NoSuchMethodError for code compiled against previous versions of spring-aspects due to a bug in AspectJ (see SPR-10178 for details). This commit reverts all the whitespace changes made in1762157
which resolves the NoSuchMethodErrors. Issue: SPR-10178
This commit is contained in:
parent
e44b4b831e
commit
6888a6f286
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
@ -25,7 +25,7 @@ import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
|
||||||
* pointcut in subaspects.
|
* pointcut in subaspects.
|
||||||
*
|
*
|
||||||
* <p>Subaspects may also need a metadata resolution strategy, in the
|
* <p>Subaspects may also need a metadata resolution strategy, in the
|
||||||
* {@code BeanWiringInfoResolver} interface. The default implementation
|
* <code>BeanWiringInfoResolver</code> interface. The default implementation
|
||||||
* looks for a bean with the same name as the FQN. This is the default name
|
* looks for a bean with the same name as the FQN. This is the default name
|
||||||
* of a bean in a Spring container if the id value is not supplied explicitly.
|
* of a bean in a Spring container if the id value is not supplied explicitly.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
@ -29,8 +29,8 @@ import java.io.Serializable;
|
||||||
* <p>
|
* <p>
|
||||||
* There are two cases that needs to be handled:
|
* There are two cases that needs to be handled:
|
||||||
* <ol>
|
* <ol>
|
||||||
* <li>Normal object creation via the '{@code new}' operator: this is
|
* <li>Normal object creation via the '<code>new</code>' operator: this is
|
||||||
* taken care of by advising {@code initialization()} join points.</li>
|
* taken care of by advising <code>initialization()</code> join points.</li>
|
||||||
* <li>Object creation through deserialization: since no constructor is
|
* <li>Object creation through deserialization: since no constructor is
|
||||||
* invoked during deserialization, the aspect needs to advise a method that a
|
* invoked during deserialization, the aspect needs to advise a method that a
|
||||||
* deserialization mechanism is going to invoke. Ideally, we should not
|
* deserialization mechanism is going to invoke. Ideally, we should not
|
||||||
|
@ -41,21 +41,21 @@ import java.io.Serializable;
|
||||||
* introduced implementation). There are a few choices for the chosen method:
|
* introduced implementation). There are a few choices for the chosen method:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>readObject(ObjectOutputStream): Java requires that the method must be
|
* <li>readObject(ObjectOutputStream): Java requires that the method must be
|
||||||
* {@code private}. Since aspects cannot introduce a private member,
|
* <code>private</p>. Since aspects cannot introduce a private member,
|
||||||
* while preserving its name, this option is ruled out.</li>
|
* while preserving its name, this option is ruled out.</li>
|
||||||
* <li>readResolve(): Java doesn't pose any restriction on an access specifier.
|
* <li>readResolve(): Java doesn't pose any restriction on an access specifier.
|
||||||
* Problem solved! There is one (minor) limitation of this approach in
|
* Problem solved! There is one (minor) limitation of this approach in
|
||||||
* that if a user class already has this method, that method must be
|
* that if a user class already has this method, that method must be
|
||||||
* {@code public}. However, this shouldn't be a big burden, since
|
* <code>public</code>. However, this shouldn't be a big burden, since
|
||||||
* use cases that need classes to implement readResolve() (custom enums,
|
* use cases that need classes to implement readResolve() (custom enums,
|
||||||
* for example) are unlikely to be marked as @Configurable, and
|
* for example) are unlikely to be marked as @Configurable, and
|
||||||
* in any case asking to make that method {@code public} should not
|
* in any case asking to make that method <code>public</code> should not
|
||||||
* pose any undue burden.</li>
|
* pose any undue burden.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* The minor collaboration needed by user classes (i.e., that the
|
* The minor collaboration needed by user classes (i.e., that the
|
||||||
* implementation of {@code readResolve()}, if any, must be
|
* implementation of <code>readResolve()</code>, if any, must be
|
||||||
* {@code public}) can be lifted as well if we were to use an
|
* <code>public</code>) can be lifted as well if we were to use an
|
||||||
* experimental feature in AspectJ - the {@code hasmethod()} PCD.</li>
|
* experimental feature in AspectJ - the <code>hasmethod()</code> PCD.</li>
|
||||||
* </ol>
|
* </ol>
|
||||||
|
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -103,17 +103,17 @@ public abstract aspect AbstractInterfaceDrivenDependencyInjectionAspect extends
|
||||||
ConfigurableObject+ && Serializable+ implements ConfigurableDeserializationSupport;
|
ConfigurableObject+ && Serializable+ implements ConfigurableDeserializationSupport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A marker interface to which the {@code readResolve()} is introduced.
|
* A marker interface to which the <code>readResolve()</code> is introduced.
|
||||||
*/
|
*/
|
||||||
static interface ConfigurableDeserializationSupport extends Serializable {
|
static interface ConfigurableDeserializationSupport extends Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Introduce the {@code readResolve()} method so that we can advise its
|
* Introduce the <code>readResolve()</code> method so that we can advise its
|
||||||
* execution to configure the object.
|
* execution to configure the object.
|
||||||
*
|
*
|
||||||
* <p>Note if a method with the same signature already exists in a
|
* <p>Note if a method with the same signature already exists in a
|
||||||
* {@code Serializable} class of ConfigurableObject type,
|
* <code>Serializable</code> class of ConfigurableObject type,
|
||||||
* that implementation will take precedence (a good thing, since we are
|
* that implementation will take precedence (a good thing, since we are
|
||||||
* merely interested in an opportunity to detect deserialization.)
|
* merely interested in an opportunity to detect deserialization.)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
@ -32,7 +32,7 @@ import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
|
||||||
* annotation to identify which classes need autowiring.
|
* annotation to identify which classes need autowiring.
|
||||||
*
|
*
|
||||||
* <p>The bean name to look up will be taken from the
|
* <p>The bean name to look up will be taken from the
|
||||||
* {@code @Configurable} annotation if specified, otherwise the
|
* <code>@Configurable</code> annotation if specified, otherwise the
|
||||||
* default bean name to look up will be the FQN of the class being configured.
|
* default bean name to look up will be the FQN of the class being configured.
|
||||||
*
|
*
|
||||||
* @author Rod Johnson
|
* @author Rod Johnson
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
@ -22,7 +22,7 @@ package org.springframework.beans.factory.aspectj;
|
||||||
* the use of the @Configurable annotation.
|
* the use of the @Configurable annotation.
|
||||||
*
|
*
|
||||||
* The subaspect of this aspect doesn't need to include any AOP constructs.
|
* The subaspect of this aspect doesn't need to include any AOP constructs.
|
||||||
* For example, here is a subaspect that configures the {@code PricingStrategyClient} objects.
|
* For example, here is a subaspect that configures the <code>PricingStrategyClient</code> objects.
|
||||||
* <pre>
|
* <pre>
|
||||||
* aspect PricingStrategyDependencyInjectionAspect
|
* aspect PricingStrategyDependencyInjectionAspect
|
||||||
* extends GenericInterfaceDrivenDependencyInjectionAspect<PricingStrategyClient> {
|
* extends GenericInterfaceDrivenDependencyInjectionAspect<PricingStrategyClient> {
|
||||||
|
@ -41,7 +41,7 @@ package org.springframework.beans.factory.aspectj;
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
public abstract aspect GenericInterfaceDrivenDependencyInjectionAspect<I> extends AbstractInterfaceDrivenDependencyInjectionAspect {
|
public abstract aspect GenericInterfaceDrivenDependencyInjectionAspect<I> extends AbstractInterfaceDrivenDependencyInjectionAspect {
|
||||||
declare parents: I implements ConfigurableObject;
|
declare parents: I implements ConfigurableObject;
|
||||||
|
|
||||||
public pointcut inConfigurableBean() : within(I+);
|
public pointcut inConfigurableBean() : within(I+);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
@ -106,7 +106,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
|
||||||
* Validate the call and provide the expected return value
|
* Validate the call and provide the expected return value
|
||||||
* @param lastSig
|
* @param lastSig
|
||||||
* @param args
|
* @param args
|
||||||
* @return the return value
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object respond(String lastSig, Object[] args) {
|
public Object respond(String lastSig, Object[] args) {
|
||||||
Call call = nextCall();
|
Call call = nextCall();
|
||||||
|
@ -114,7 +114,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
|
||||||
if (responseType == CallResponse.return_) {
|
if (responseType == CallResponse.return_) {
|
||||||
return call.returnValue(lastSig, args);
|
return call.returnValue(lastSig, args);
|
||||||
} else if(responseType == CallResponse.throw_) {
|
} else if(responseType == CallResponse.throw_) {
|
||||||
return call.throwException(lastSig, args);
|
return (RuntimeException)call.throwException(lastSig, args);
|
||||||
} else if(responseType == CallResponse.nothing) {
|
} else if(responseType == CallResponse.nothing) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
@ -18,7 +18,7 @@ package org.springframework.mock.staticmock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Annotation-based aspect to use in test build to enable mocking static methods
|
* Annotation-based aspect to use in test build to enable mocking static methods
|
||||||
* on JPA-annotated {@code @Entity} classes, as used by Roo for finders.
|
* on JPA-annotated <code>@Entity</code> classes, as used by Roo for finders.
|
||||||
*
|
*
|
||||||
* <p>Mocking will occur in the call stack of any method in a class (typically a test class)
|
* <p>Mocking will occur in the call stack of any method in a class (typically a test class)
|
||||||
* that is annotated with the @MockStaticEntityMethods annotation.
|
* that is annotated with the @MockStaticEntityMethods annotation.
|
||||||
|
|
|
@ -1,19 +1,3 @@
|
||||||
/*
|
|
||||||
* Copyright 2002-2012 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.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.springframework.orm.jpa.aspectj;
|
package org.springframework.orm.jpa.aspectj;
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
@ -25,14 +9,14 @@ import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
|
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
|
||||||
|
|
||||||
public aspect JpaExceptionTranslatorAspect {
|
public aspect JpaExceptionTranslatorAspect {
|
||||||
pointcut entityManagerCall(): call(* EntityManager.*(..)) || call(* EntityManagerFactory.*(..)) || call(* EntityTransaction.*(..)) || call(* Query.*(..));
|
pointcut entityManagerCall(): call(* EntityManager.*(..)) || call(* EntityManagerFactory.*(..)) || call(* EntityTransaction.*(..)) || call(* Query.*(..));
|
||||||
|
|
||||||
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) {
|
||||||
throw dex;
|
throw dex;
|
||||||
} else {
|
} else {
|
||||||
throw re;
|
throw re;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
@ -25,7 +25,7 @@ import org.springframework.transaction.interceptor.TransactionAttributeSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract superaspect for AspectJ transaction aspects. Concrete
|
* Abstract superaspect for AspectJ transaction aspects. Concrete
|
||||||
* subaspects will implement the {@code transactionalMethodExecution()}
|
* subaspects will implement the <code>transactionalMethodExecution()</code>
|
||||||
* pointcut using a strategy such as Java 5 annotations.
|
* pointcut using a strategy such as Java 5 annotations.
|
||||||
*
|
*
|
||||||
* <p>Suitable for use inside or outside the Spring IoC container.
|
* <p>Suitable for use inside or outside the Spring IoC container.
|
||||||
|
@ -66,7 +66,7 @@ public abstract aspect AbstractTransactionAspect extends TransactionAspectSuppor
|
||||||
@SuppressAjWarnings("adviceDidNotMatch")
|
@SuppressAjWarnings("adviceDidNotMatch")
|
||||||
after(Object txObject) throwing(Throwable t) : transactionalMethodExecution(txObject) {
|
after(Object txObject) throwing(Throwable t) : transactionalMethodExecution(txObject) {
|
||||||
try {
|
try {
|
||||||
completeTransactionAfterThrowing(TransactionAspectSupport.currentTransactionInfo(), t);
|
completeTransactionAfterThrowing(TransactionAspectSupport.currentTransactionInfo(), t);
|
||||||
}
|
}
|
||||||
catch (Throwable t2) {
|
catch (Throwable t2) {
|
||||||
logger.error("Failed to close transaction after throwing in a transactional method", t2);
|
logger.error("Failed to close transaction after throwing in a transactional method", t2);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2013 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.
|
||||||
|
|
Loading…
Reference in New Issue