Polishing

(cherry picked from commit e5207e6)
This commit is contained in:
Juergen Hoeller
2015-02-27 22:29:42 +01:00
parent 1259671f3f
commit 3783591083
6 changed files with 31 additions and 29 deletions

View File

@@ -24,7 +24,6 @@ import org.springframework.context.annotation.ImportAware;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
/**
@@ -50,8 +49,10 @@ public abstract class AbstractTransactionManagementConfiguration implements Impo
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableTx = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(EnableTransactionManagement.class.getName(), false));
Assert.notNull(this.enableTx,
"@EnableTransactionManagement is not present on importing class " + importMetadata.getClassName());
if (this.enableTx == null) {
throw new IllegalArgumentException(
"@EnableTransactionManagement is not present on importing class " + importMetadata.getClassName());
}
}
@Autowired(required = false)