use generic Class<?> in TransactionAttributeSource signature

This commit is contained in:
Juergen Hoeller
2010-08-15 21:19:52 +00:00
parent a5b30fd074
commit 3963ff6e3b
4 changed files with 10 additions and 11 deletions

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -51,9 +51,8 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute
} }
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) { public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
for (int i = 0; i < this.transactionAttributeSources.length; i++) { for (TransactionAttributeSource tas : this.transactionAttributeSources) {
TransactionAttributeSource tas = this.transactionAttributeSources[i];
TransactionAttribute ta = tas.getTransactionAttribute(method, targetClass); TransactionAttribute ta = tas.getTransactionAttribute(method, targetClass);
if (ta != null) { if (ta != null) {
return ta; return ta;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -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; return this.transactionAttribute;
} }

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -137,7 +137,7 @@ public class MethodMapTransactionAttributeSource
* @param mappedName mapped method name * @param mappedName mapped method name
* @param attr attribute associated with the method * @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(clazz, "Class must not be null");
Assert.notNull(mappedName, "Mapped name must not be null"); Assert.notNull(mappedName, "Mapped name must not be null");
String name = clazz.getName() + '.' + mappedName; String name = clazz.getName() + '.' + mappedName;
@@ -204,7 +204,7 @@ public class MethodMapTransactionAttributeSource
} }
public TransactionAttribute getTransactionAttribute(Method method, Class targetClass) { public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
if (this.eagerlyInitialized) { if (this.eagerlyInitialized) {
return this.transactionAttributeMap.get(method); return this.transactionAttributeMap.get(method);
} }

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -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 // look for direct name match
String methodName = method.getName(); String methodName = method.getName();
TransactionAttribute attr = this.nameMap.get(methodName); TransactionAttribute attr = this.nameMap.get(methodName);