Browse Source

use generic Class<?> in TransactionAttributeSource signature

pull/1234/head
Juergen Hoeller 15 years ago
parent
commit
3963ff6e3b
  1. 7
      org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java
  2. 4
      org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/MatchAlwaysTransactionAttributeSource.java
  3. 6
      org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/MethodMapTransactionAttributeSource.java
  4. 4
      org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/NameMatchTransactionAttributeSource.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -51,9 +51,8 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute @@ -51,9 +51,8 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute
}
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
for (int i = 0; i < this.transactionAttributeSources.length; i++) {
TransactionAttributeSource tas = this.transactionAttributeSources[i];
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
for (TransactionAttributeSource tas : this.transactionAttributeSources) {
TransactionAttribute ta = tas.getTransactionAttribute(method, targetClass);
if (ta != null) {
return ta;

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -49,7 +49,7 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu @@ -49,7 +49,7 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu
}
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
return this.transactionAttribute;
}

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -137,7 +137,7 @@ public class MethodMapTransactionAttributeSource @@ -137,7 +137,7 @@ public class MethodMapTransactionAttributeSource
* @param mappedName mapped method name
* @param attr attribute associated with the method
*/
public void addTransactionalMethod(Class clazz, String mappedName, TransactionAttribute attr) {
public void addTransactionalMethod(Class<?> clazz, String mappedName, TransactionAttribute attr) {
Assert.notNull(clazz, "Class must not be null");
Assert.notNull(mappedName, "Mapped name must not be null");
String name = clazz.getName() + '.' + mappedName;
@ -204,7 +204,7 @@ public class MethodMapTransactionAttributeSource @@ -204,7 +204,7 @@ public class MethodMapTransactionAttributeSource
}
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
if (this.eagerlyInitialized) {
return this.transactionAttributeMap.get(method);
}

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -97,7 +97,7 @@ public class NameMatchTransactionAttributeSource implements TransactionAttribute @@ -97,7 +97,7 @@ public class NameMatchTransactionAttributeSource implements TransactionAttribute
}
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) {
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
// look for direct name match
String methodName = method.getName();
TransactionAttribute attr = this.nameMap.get(methodName);

Loading…
Cancel
Save