From 2cfd15899d94be7f201c634e877abec6db6bfbfb Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 26 Oct 2012 13:54:14 +0200 Subject: [PATCH] Fix split package introduced by @EnableSpringConfigured Commit 6263c9abf950692c15b5bc5edd854b3949b10b19 @EnableSpringConfigured from beans.factory.aspectj => context.annotation within the spring-aspects module. This resolved a package cycle but had the side-effect of causing a "split package" [1] problem between spring-context and spring-aspects in OSGi-based classloader environments because the context.annotation package now exists in both modules. The simplest and best solution from an OSGi perspective is to relocate @EnableSpringConfigured and its supporting SpringConfiguredConfiguration class into a new package. This commit moves both these types into context.annotation.aspectj, following convention with other such "aspectj"-qualified packages in the spring-aspects module. As with the previous move, it is presumed this change will be low-impact as the "spring-configured" approach to domain object injection is a niche feature to begin with, and @EnableSpringConfigured has existed in its current location only since 3.1.2 and this change is being made in time for 3.1.3. [1]: http://wiki.osgi.org/wiki/Split_Packages Issue: SPR-9811, SPR-9441 Backport-Commit: 54db7387de861273a1faa4ed2f3c30052999ddea --- .../annotation/{ => aspectj}/EnableSpringConfigured.java | 2 +- .../{ => aspectj}/SpringConfiguredConfiguration.java | 2 +- .../{ => aspectj}/AnnotationBeanConfigurerTests.java | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) rename org.springframework.aspects/src/main/java/org/springframework/context/annotation/{ => aspectj}/EnableSpringConfigured.java (96%) rename org.springframework.aspects/src/main/java/org/springframework/context/annotation/{ => aspectj}/SpringConfiguredConfiguration.java (97%) rename org.springframework.aspects/src/test/java/org/springframework/context/annotation/{ => aspectj}/AnnotationBeanConfigurerTests.java (80%) diff --git a/org.springframework.aspects/src/main/java/org/springframework/context/annotation/EnableSpringConfigured.java b/org.springframework.aspects/src/main/java/org/springframework/context/annotation/aspectj/EnableSpringConfigured.java similarity index 96% rename from org.springframework.aspects/src/main/java/org/springframework/context/annotation/EnableSpringConfigured.java rename to org.springframework.aspects/src/main/java/org/springframework/context/annotation/aspectj/EnableSpringConfigured.java index 0b49f7c5b74..9451997ce43 100644 --- a/org.springframework.aspects/src/main/java/org/springframework/context/annotation/EnableSpringConfigured.java +++ b/org.springframework.aspects/src/main/java/org/springframework/context/annotation/aspectj/EnableSpringConfigured.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.context.annotation; +package org.springframework.context.annotation.aspectj; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/org.springframework.aspects/src/main/java/org/springframework/context/annotation/SpringConfiguredConfiguration.java b/org.springframework.aspects/src/main/java/org/springframework/context/annotation/aspectj/SpringConfiguredConfiguration.java similarity index 97% rename from org.springframework.aspects/src/main/java/org/springframework/context/annotation/SpringConfiguredConfiguration.java rename to org.springframework.aspects/src/main/java/org/springframework/context/annotation/aspectj/SpringConfiguredConfiguration.java index 4f1fe7d883e..2471296f832 100644 --- a/org.springframework.aspects/src/main/java/org/springframework/context/annotation/SpringConfiguredConfiguration.java +++ b/org.springframework.aspects/src/main/java/org/springframework/context/annotation/aspectj/SpringConfiguredConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.context.annotation; +package org.springframework.context.annotation.aspectj; import org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect; import org.springframework.beans.factory.config.BeanDefinition; diff --git a/org.springframework.aspects/src/test/java/org/springframework/context/annotation/AnnotationBeanConfigurerTests.java b/org.springframework.aspects/src/test/java/org/springframework/context/annotation/aspectj/AnnotationBeanConfigurerTests.java similarity index 80% rename from org.springframework.aspects/src/test/java/org/springframework/context/annotation/AnnotationBeanConfigurerTests.java rename to org.springframework.aspects/src/test/java/org/springframework/context/annotation/aspectj/AnnotationBeanConfigurerTests.java index 9165b89cb29..69dc45b2779 100644 --- a/org.springframework.aspects/src/test/java/org/springframework/context/annotation/AnnotationBeanConfigurerTests.java +++ b/org.springframework.aspects/src/test/java/org/springframework/context/annotation/aspectj/AnnotationBeanConfigurerTests.java @@ -14,10 +14,14 @@ * limitations under the License. */ -package org.springframework.context.annotation; +package org.springframework.context.annotation.aspectj; import org.springframework.beans.factory.aspectj.AbstractBeanConfigurerTests; import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.ImportResource; +import org.springframework.context.annotation.aspectj.EnableSpringConfigured; /** * Tests that @EnableSpringConfigured properly registers an