Skip to content

Commit 6263c9a

Browse files
committed
Fix package cycle in @EnableSpringConfigured
@EnableSpringConfigured and its @import'ed SpringConfiguredConfiguration @configuration class inadvertently established a package cycle between beans.factory.aspectj and context.annotation due to SpringConfiguredConfiguration's dependency on annotations such as @configuration, @bean and @ROLE. This commit fixes this architecture bug by moving @EnableSpringConfigured and SpringConfiguredConfiguration from the beans.factory.aspectj package to the context.annotation package where they belong. This change is assumed to be very low impact as @EnableSpringConfigured was introduced in 3.1.0 and relocation is happening as quickly as possible in 3.1.2. @EnableSpringConfigured is assumed to be infrequently used at this point, and for those that are the migration path is straightforward. When upgrading from Spring 3.1.0 or 3.1.1, update import statements in any affected @configuration classes to reflect the new packaging. Backporter's note: this change causes Bundlor warnings in org.springframework.aspect as its manifest now "imports and exports the package org.springframework.context.annotation". To 'solve' this problem, `fail.on.warnings=false` has been added to build.properties. This means that future Bundlor-based warnings may go unnoticed. Issue: SPR-9442 Backport-Issue: SPR-9441 Backport-Commit: 5327a7a
1 parent 1eb5029 commit 6263c9a

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

build.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ aj.osgi.range="[1.6.8, 2.0.0)"
2727
## For trunk development / ci builds
2828
release.type=integration
2929
build.stamp=BUILD-SNAPSHOT
30+
31+
#bundlor
32+
fail.on.warnings=false
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.beans.factory.aspectj;
17+
package org.springframework.context.annotation;
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
@@ -25,14 +25,16 @@
2525
import org.springframework.context.annotation.Import;
2626

2727
/**
28-
* Signals the current application context to apply dependency injection to non-managed
29-
* classes that are instantiated outside of the Spring bean factory (typically classes
30-
* annotated with the @{@link org.springframework.beans.factory.annotation.Configurable
28+
* Signals the current application context to apply dependency injection to
29+
* non-managed classes that are instantiated outside of the Spring bean factory
30+
* (typically classes annotated with the @
31+
* {@link org.springframework.beans.factory.annotation.Configurable
3132
* Configurable} annotation).
3233
*
33-
* <p>Similar to functionality found in Spring's {@code <context:spring-configured>} XML
34-
* element. Often used in conjunction with {@link
35-
* org.springframework.context.annotation.EnableLoadTimeWeaving @EnableLoadTimeWeaving}.
34+
* <p>Similar to functionality found in Spring's
35+
* {@code <context:spring-configured>} XML element. Often used in conjunction
36+
* with {@link org.springframework.context.annotation.EnableLoadTimeWeaving
37+
* @EnableLoadTimeWeaving}.
3638
*
3739
* @author Chris Beams
3840
* @since 3.1
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 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.
@@ -14,8 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.beans.factory.aspectj;
17+
package org.springframework.context.annotation;
1818

19+
import org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect;
1920
import org.springframework.beans.factory.config.BeanDefinition;
2021
import org.springframework.context.annotation.Bean;
2122
import org.springframework.context.annotation.Configuration;
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 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.
@@ -14,16 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.beans.factory.aspectj;
17+
package org.springframework.context.annotation;
1818

19+
import org.springframework.beans.factory.aspectj.AbstractBeanConfigurerTests;
1920
import org.springframework.context.ConfigurableApplicationContext;
20-
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
21-
import org.springframework.context.annotation.Configuration;
22-
import org.springframework.context.annotation.ImportResource;
2321

2422
/**
2523
* Tests that @EnableSpringConfigured properly registers an
26-
* {@link AnnotationBeanConfigurerAspect}, just as does {@code <context:spring-configured>}
24+
* {@link org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect}, just
25+
* as does {@code <context:spring-configured>}
2726
*
2827
* @author Chris Beams
2928
* @since 3.1

0 commit comments

Comments
 (0)