Skip to content

Commit 3963ff6

Browse files
committed
use generic Class<?> in TransactionAttributeSource signature
1 parent a5b30fd commit 3963ff6

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2006 the original author or authors.
2+
* Copyright 2002-2010 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.
@@ -51,9 +51,8 @@ public final TransactionAttributeSource[] getTransactionAttributeSources() {
5151
}
5252

5353

54-
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
55-
for (int i = 0; i < this.transactionAttributeSources.length; i++) {
56-
TransactionAttributeSource tas = this.transactionAttributeSources[i];
54+
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
55+
for (TransactionAttributeSource tas : this.transactionAttributeSources) {
5756
TransactionAttribute ta = tas.getTransactionAttribute(method, targetClass);
5857
if (ta != null) {
5958
return ta;

org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/MatchAlwaysTransactionAttributeSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2006 the original author or authors.
2+
* Copyright 2002-2010 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.
@@ -49,7 +49,7 @@ public void setTransactionAttribute(TransactionAttribute transactionAttribute) {
4949
}
5050

5151

52-
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
52+
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
5353
return this.transactionAttribute;
5454
}
5555

org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/MethodMapTransactionAttributeSource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2010 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.
@@ -137,7 +137,7 @@ public void addTransactionalMethod(String name, TransactionAttribute attr) {
137137
* @param mappedName mapped method name
138138
* @param attr attribute associated with the method
139139
*/
140-
public void addTransactionalMethod(Class clazz, String mappedName, TransactionAttribute attr) {
140+
public void addTransactionalMethod(Class<?> clazz, String mappedName, TransactionAttribute attr) {
141141
Assert.notNull(clazz, "Class must not be null");
142142
Assert.notNull(mappedName, "Mapped name must not be null");
143143
String name = clazz.getName() + '.' + mappedName;
@@ -204,7 +204,7 @@ protected boolean isMatch(String methodName, String mappedName) {
204204
}
205205

206206

207-
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
207+
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
208208
if (this.eagerlyInitialized) {
209209
return this.transactionAttributeMap.get(method);
210210
}

org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/NameMatchTransactionAttributeSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2010 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.
@@ -97,7 +97,7 @@ public void addTransactionalMethod(String methodName, TransactionAttribute attr)
9797
}
9898

9999

100-
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
100+
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
101101
// look for direct name match
102102
String methodName = method.getName();
103103
TransactionAttribute attr = this.nameMap.get(methodName);

0 commit comments

Comments
 (0)