Skip to content

Commit 6888a6f

Browse files
committed
Restore *.aj whitespace
The removal of whitespace to the *.aj files made in 1762157 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 in 1762157 which resolves the NoSuchMethodErrors. Issue: SPR-10178
1 parent e44b4b8 commit 6888a6f

13 files changed

+129
-145
lines changed

spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerAspect.aj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
16+
1717
package org.springframework.beans.factory.aspectj;
1818

1919
import org.aspectj.lang.annotation.SuppressAjWarnings;
@@ -23,12 +23,12 @@ import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
2323
* Abstract superaspect for AspectJ aspects that can perform Dependency
2424
* Injection on objects, however they may be created. Define the beanCreation()
2525
* pointcut in subaspects.
26-
*
26+
*
2727
* <p>Subaspects may also need a metadata resolution strategy, in the
28-
* {@code BeanWiringInfoResolver} interface. The default implementation
28+
* <code>BeanWiringInfoResolver</code> interface. The default implementation
2929
* looks for a bean with the same name as the FQN. This is the default name
3030
* of a bean in a Spring container if the id value is not supplied explicitly.
31-
*
31+
*
3232
* @author Rob Harrop
3333
* @author Rod Johnson
3434
* @author Adrian Colyer
@@ -62,7 +62,7 @@ public abstract aspect AbstractBeanConfigurerAspect extends BeanConfigurerSuppor
6262

6363
/**
6464
* The initialization of a new object.
65-
*
65+
*
6666
* <p>WARNING: Although this pointcut is non-abstract for backwards
6767
* compatibility reasons, it is meant to be overridden to select
6868
* initialization of any configurable bean.
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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,34 +21,34 @@ import org.aspectj.lang.annotation.SuppressAjWarnings;
2121
/**
2222
* Abstract base aspect that can perform Dependency
2323
* Injection on objects, however they may be created.
24-
*
24+
*
2525
* @author Ramnivas Laddad
2626
* @since 2.5.2
2727
*/
2828
public abstract aspect AbstractDependencyInjectionAspect {
2929
/**
3030
* Select construction join points for objects to inject dependencies
3131
*/
32-
public abstract pointcut beanConstruction(Object bean);
32+
public abstract pointcut beanConstruction(Object bean);
3333

3434
/**
3535
* Select deserialization join points for objects to inject dependencies
3636
*/
3737
public abstract pointcut beanDeserialization(Object bean);
38-
38+
3939
/**
4040
* Select join points in a configurable bean
4141
*/
4242
public abstract pointcut inConfigurableBean();
43-
43+
4444
/**
4545
* Select join points in beans to be configured prior to construction?
4646
* By default, use post-construction injection matching the default in the Configurable annotation.
4747
*/
4848
public pointcut preConstructionConfiguration() : if(false);
49-
49+
5050
/**
51-
* Select the most-specific initialization join point
51+
* Select the most-specific initialization join point
5252
* (most concrete class) for the initialization of an instance.
5353
*/
5454
public pointcut mostSpecificSubTypeConstruction() :
@@ -58,44 +58,44 @@ public abstract aspect AbstractDependencyInjectionAspect {
5858
* Select least specific super type that is marked for DI (so that injection occurs only once with pre-construction inejection
5959
*/
6060
public abstract pointcut leastSpecificSuperTypeConstruction();
61-
61+
6262
/**
6363
* Configure the bean
6464
*/
6565
public abstract void configureBean(Object bean);
6666

67-
68-
private pointcut preConstructionCondition() :
67+
68+
private pointcut preConstructionCondition() :
6969
leastSpecificSuperTypeConstruction() && preConstructionConfiguration();
70-
70+
7171
private pointcut postConstructionCondition() :
7272
mostSpecificSubTypeConstruction() && !preConstructionConfiguration();
73-
73+
7474
/**
7575
* Pre-construction configuration.
7676
*/
7777
@SuppressAjWarnings("adviceDidNotMatch")
78-
before(Object bean) :
79-
beanConstruction(bean) && preConstructionCondition() && inConfigurableBean() {
78+
before(Object bean) :
79+
beanConstruction(bean) && preConstructionCondition() && inConfigurableBean() {
8080
configureBean(bean);
8181
}
8282

8383
/**
8484
* Post-construction configuration.
8585
*/
8686
@SuppressAjWarnings("adviceDidNotMatch")
87-
after(Object bean) returning :
87+
after(Object bean) returning :
8888
beanConstruction(bean) && postConstructionCondition() && inConfigurableBean() {
8989
configureBean(bean);
9090
}
91-
91+
9292
/**
9393
* Post-deserialization configuration.
9494
*/
9595
@SuppressAjWarnings("adviceDidNotMatch")
96-
after(Object bean) returning :
96+
after(Object bean) returning :
9797
beanDeserialization(bean) && inConfigurableBean() {
9898
configureBean(bean);
9999
}
100-
100+
101101
}

spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractInterfaceDrivenDependencyInjectionAspect.aj

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -26,94 +26,94 @@ import java.io.Serializable;
2626
* upon deserialization. Subaspects need to simply provide definition for the configureBean() method. This
2727
* method may be implemented without relying on Spring container if so desired.
2828
* </p>
29-
* <p>
29+
* <p>
3030
* There are two cases that needs to be handled:
3131
* <ol>
32-
* <li>Normal object creation via the '{@code new}' operator: this is
33-
* taken care of by advising {@code initialization()} join points.</li>
32+
* <li>Normal object creation via the '<code>new</code>' operator: this is
33+
* taken care of by advising <code>initialization()</code> join points.</li>
3434
* <li>Object creation through deserialization: since no constructor is
3535
* invoked during deserialization, the aspect needs to advise a method that a
3636
* deserialization mechanism is going to invoke. Ideally, we should not
3737
* require user classes to implement any specific method. This implies that
3838
* we need to <i>introduce</i> the chosen method. We should also handle the cases
3939
* where the chosen method is already implemented in classes (in which case,
40-
* the user's implementation for that method should take precedence over the
40+
* the user's implementation for that method should take precedence over the
4141
* introduced implementation). There are a few choices for the chosen method:
4242
* <ul>
4343
* <li>readObject(ObjectOutputStream): Java requires that the method must be
44-
* {@code private}. Since aspects cannot introduce a private member,
44+
* <code>private</p>. Since aspects cannot introduce a private member,
4545
* while preserving its name, this option is ruled out.</li>
46-
* <li>readResolve(): Java doesn't pose any restriction on an access specifier.
47-
* Problem solved! There is one (minor) limitation of this approach in
48-
* that if a user class already has this method, that method must be
49-
* {@code public}. However, this shouldn't be a big burden, since
50-
* use cases that need classes to implement readResolve() (custom enums,
46+
* <li>readResolve(): Java doesn't pose any restriction on an access specifier.
47+
* Problem solved! There is one (minor) limitation of this approach in
48+
* that if a user class already has this method, that method must be
49+
* <code>public</code>. However, this shouldn't be a big burden, since
50+
* use cases that need classes to implement readResolve() (custom enums,
5151
* for example) are unlikely to be marked as &#64;Configurable, and
52-
* in any case asking to make that method {@code public} should not
52+
* in any case asking to make that method <code>public</code> should not
5353
* pose any undue burden.</li>
5454
* </ul>
55-
* The minor collaboration needed by user classes (i.e., that the
56-
* implementation of {@code readResolve()}, if any, must be
57-
* {@code public}) can be lifted as well if we were to use an
58-
* experimental feature in AspectJ - the {@code hasmethod()} PCD.</li>
55+
* The minor collaboration needed by user classes (i.e., that the
56+
* implementation of <code>readResolve()</code>, if any, must be
57+
* <code>public</code>) can be lifted as well if we were to use an
58+
* experimental feature in AspectJ - the <code>hasmethod()</code> PCD.</li>
5959
* </ol>
6060
6161
* <p>
6262
* While having type implement the {@link ConfigurableObject} interface is certainly a valid choice, an alternative
6363
* is to use a 'declare parents' statement another aspect (a subaspect of this aspect would be a logical choice)
6464
* that declares the classes that need to be configured by supplying the {@link ConfigurableObject} interface.
6565
* </p>
66-
*
66+
*
6767
* @author Ramnivas Laddad
6868
* @since 2.5.2
6969
*/
7070
public abstract aspect AbstractInterfaceDrivenDependencyInjectionAspect extends AbstractDependencyInjectionAspect {
7171
/**
7272
* Select initialization join point as object construction
7373
*/
74-
public pointcut beanConstruction(Object bean) :
75-
initialization(ConfigurableObject+.new(..)) && this(bean);
74+
public pointcut beanConstruction(Object bean) :
75+
initialization(ConfigurableObject+.new(..)) && this(bean);
7676

7777
/**
7878
* Select deserialization join point made available through ITDs for ConfigurableDeserializationSupport
7979
*/
8080
public pointcut beanDeserialization(Object bean) :
8181
execution(Object ConfigurableDeserializationSupport+.readResolve()) &&
8282
this(bean);
83-
83+
8484
public pointcut leastSpecificSuperTypeConstruction() : initialization(ConfigurableObject.new(..));
85-
86-
87-
85+
86+
87+
8888
// Implementation to support re-injecting dependencies once an object is deserialized
8989
/**
90-
* Declare any class implementing Serializable and ConfigurableObject as also implementing
91-
* ConfigurableDeserializationSupport. This allows us to introduce the readResolve()
90+
* Declare any class implementing Serializable and ConfigurableObject as also implementing
91+
* ConfigurableDeserializationSupport. This allows us to introduce the readResolve()
9292
* method and select it with the beanDeserialization() pointcut.
93-
*
93+
*
9494
* <p>Here is an improved version that uses the hasmethod() pointcut and lifts
9595
* even the minor requirement on user classes:
9696
*
9797
* <pre class="code">declare parents: ConfigurableObject+ Serializable+
98-
* && !hasmethod(Object readResolve() throws ObjectStreamException)
98+
* && !hasmethod(Object readResolve() throws ObjectStreamException)
9999
* implements ConfigurableDeserializationSupport;
100100
* </pre>
101101
*/
102-
declare parents:
102+
declare parents:
103103
ConfigurableObject+ && Serializable+ implements ConfigurableDeserializationSupport;
104-
104+
105105
/**
106-
* A marker interface to which the {@code readResolve()} is introduced.
106+
* A marker interface to which the <code>readResolve()</code> is introduced.
107107
*/
108108
static interface ConfigurableDeserializationSupport extends Serializable {
109109
}
110-
110+
111111
/**
112-
* Introduce the {@code readResolve()} method so that we can advise its
112+
* Introduce the <code>readResolve()</code> method so that we can advise its
113113
* execution to configure the object.
114-
*
114+
*
115115
* <p>Note if a method with the same signature already exists in a
116-
* {@code Serializable} class of ConfigurableObject type,
116+
* <code>Serializable</code> class of ConfigurableObject type,
117117
* that implementation will take precedence (a good thing, since we are
118118
* merely interested in an opportunity to detect deserialization.)
119119
*/

spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -32,7 +32,7 @@ import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
3232
* annotation to identify which classes need autowiring.
3333
*
3434
* <p>The bean name to look up will be taken from the
35-
* {@code &#64;Configurable} annotation if specified, otherwise the
35+
* <code>&#64;Configurable</code> annotation if specified, otherwise the
3636
* default bean name to look up will be the FQN of the class being configured.
3737
*
3838
* @author Rod Johnson
@@ -43,15 +43,15 @@ import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
4343
* @see org.springframework.beans.factory.annotation.Configurable
4444
* @see org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver
4545
*/
46-
public aspect AnnotationBeanConfigurerAspect
46+
public aspect AnnotationBeanConfigurerAspect
4747
extends AbstractInterfaceDrivenDependencyInjectionAspect
4848
implements BeanFactoryAware, InitializingBean, DisposableBean {
4949

5050
private BeanConfigurerSupport beanConfigurerSupport = new BeanConfigurerSupport();
5151

5252
public pointcut inConfigurableBean() : @this(Configurable);
5353

54-
public pointcut preConstructionConfiguration() : preConstructionConfigurationSupport(*);
54+
public pointcut preConstructionConfiguration() : preConstructionConfigurationSupport(*);
5555

5656
declare parents: @Configurable * implements ConfigurableObject;
5757

@@ -80,10 +80,10 @@ public aspect AnnotationBeanConfigurerAspect
8080
private pointcut preConstructionConfigurationSupport(Configurable c) : @this(c) && if(c.preConstruction());
8181

8282
/*
83-
* This declaration shouldn't be needed,
83+
* This declaration shouldn't be needed,
8484
* except for an AspectJ bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=214559)
8585
*/
86-
declare parents: @Configurable Serializable+
86+
declare parents: @Configurable Serializable+
8787
implements ConfigurableDeserializationSupport;
8888

8989
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -17,38 +17,38 @@ package org.springframework.beans.factory.aspectj;
1717

1818
/**
1919
* Generic-based dependency injection aspect.
20-
* <p>
21-
* This aspect allows users to implement efficient, type-safe dependency injection without
20+
* <p>
21+
* This aspect allows users to implement efficient, type-safe dependency injection without
2222
* the use of the &#64;Configurable annotation.
23-
*
24-
* The subaspect of this aspect doesn't need to include any AOP constructs.
25-
* For example, here is a subaspect that configures the {@code PricingStrategyClient} objects.
23+
*
24+
* The subaspect of this aspect doesn't need to include any AOP constructs.
25+
* For example, here is a subaspect that configures the <code>PricingStrategyClient</code> objects.
2626
* <pre>
27-
* aspect PricingStrategyDependencyInjectionAspect
27+
* aspect PricingStrategyDependencyInjectionAspect
2828
* extends GenericInterfaceDrivenDependencyInjectionAspect<PricingStrategyClient> {
2929
* private PricingStrategy pricingStrategy;
30-
*
31-
* public void configure(PricingStrategyClient bean) {
32-
* bean.setPricingStrategy(pricingStrategy);
33-
* }
34-
*
35-
* public void setPricingStrategy(PricingStrategy pricingStrategy) {
36-
* this.pricingStrategy = pricingStrategy;
30+
*
31+
* public void configure(PricingStrategyClient bean) {
32+
* bean.setPricingStrategy(pricingStrategy);
3733
* }
34+
*
35+
* public void setPricingStrategy(PricingStrategy pricingStrategy) {
36+
* this.pricingStrategy = pricingStrategy;
37+
* }
3838
* }
3939
* </pre>
4040
* @author Ramnivas Laddad
4141
* @since 3.0.0
4242
*/
4343
public abstract aspect GenericInterfaceDrivenDependencyInjectionAspect<I> extends AbstractInterfaceDrivenDependencyInjectionAspect {
44-
declare parents: I implements ConfigurableObject;
45-
44+
declare parents: I implements ConfigurableObject;
45+
4646
public pointcut inConfigurableBean() : within(I+);
47-
47+
4848
public final void configureBean(Object bean) {
4949
configure((I)bean);
5050
}
51-
52-
// Unfortunately, erasure used with generics won't allow to use the same named method
51+
52+
// Unfortunately, erasure used with generics won't allow to use the same named method
5353
protected abstract void configure(I bean);
5454
}

0 commit comments

Comments
 (0)