Skip to content

Commit 9c9cc7f

Browse files
committed
Use AnnotationTransactionAttributeSource class name to avoid hard dependency on transaction.annotation package
(cherry picked from commit 4133272)
1 parent 5639eb6 commit 9c9cc7f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

spring-tx/src/main/java/org/springframework/transaction/config/AnnotationDrivenBeanDefinitionParser.java

Lines changed: 3 additions & 3 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,7 +26,6 @@
2626
import org.springframework.beans.factory.support.RootBeanDefinition;
2727
import org.springframework.beans.factory.xml.BeanDefinitionParser;
2828
import org.springframework.beans.factory.xml.ParserContext;
29-
import org.springframework.transaction.annotation.AnnotationTransactionAttributeSource;
3029
import org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor;
3130
import org.springframework.transaction.interceptor.TransactionInterceptor;
3231

@@ -117,7 +116,8 @@ public static void configureAutoProxyCreator(Element element, ParserContext pars
117116
Object eleSource = parserContext.extractSource(element);
118117

119118
// Create the TransactionAttributeSource definition.
120-
RootBeanDefinition sourceDef = new RootBeanDefinition(AnnotationTransactionAttributeSource.class);
119+
RootBeanDefinition sourceDef = new RootBeanDefinition(
120+
"org.springframework.transaction.annotation.AnnotationTransactionAttributeSource");
121121
sourceDef.setSource(eleSource);
122122
sourceDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
123123
String sourceName = parserContext.getReaderContext().registerWithGeneratedName(sourceDef);

spring-tx/src/main/java/org/springframework/transaction/config/TxAdviceBeanDefinitionParser.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 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.
@@ -27,7 +27,6 @@
2727
import org.springframework.beans.factory.support.RootBeanDefinition;
2828
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
2929
import org.springframework.beans.factory.xml.ParserContext;
30-
import org.springframework.transaction.annotation.AnnotationTransactionAttributeSource;
3130
import org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource;
3231
import org.springframework.transaction.interceptor.NoRollbackRuleAttribute;
3332
import org.springframework.transaction.interceptor.RollbackRuleAttribute;
@@ -90,7 +89,7 @@ else if (txAttributes.size() == 1) {
9089
else {
9190
// Assume annotations source.
9291
builder.addPropertyValue("transactionAttributeSource",
93-
new RootBeanDefinition(AnnotationTransactionAttributeSource.class));
92+
new RootBeanDefinition("org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"));
9493
}
9594
}
9695

0 commit comments

Comments
 (0)