Mixed polishing along with recent changes

(cherry picked from commit 14e5a02)
This commit is contained in:
Juergen Hoeller
2014-02-14 21:39:40 +01:00
parent 5da79ebca6
commit 75e08695a0
5 changed files with 50 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 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.
@@ -16,10 +16,10 @@
package org.springframework.transaction.interceptor;
import org.springframework.util.Assert;
import java.io.Serializable;
import org.springframework.util.Assert;
/**
* Rule determining whether or not a given exception (and any subclasses)
* should cause a rollback.
@@ -59,8 +59,8 @@ public class RollbackRuleAttribute implements Serializable{
* @throws IllegalArgumentException if the supplied {@code clazz} is
* not a {@code Throwable} type or is {@code null}
*/
public RollbackRuleAttribute(Class clazz) {
Assert.notNull(clazz, "'clazz' cannot be null.");
public RollbackRuleAttribute(Class<?> clazz) {
Assert.notNull(clazz, "'clazz' cannot be null");
if (!Throwable.class.isAssignableFrom(clazz)) {
throw new IllegalArgumentException(
"Cannot construct rollback rule from [" + clazz.getName() + "]: it's not a Throwable");
@@ -87,7 +87,7 @@ public class RollbackRuleAttribute implements Serializable{
* {@code exceptionName} is {@code null} or empty
*/
public RollbackRuleAttribute(String exceptionName) {
Assert.hasText(exceptionName, "'exceptionName' cannot be null or empty.");
Assert.hasText(exceptionName, "'exceptionName' cannot be null or empty");
this.exceptionName = exceptionName;
}
@@ -110,8 +110,8 @@ public class RollbackRuleAttribute implements Serializable{
}
private int getDepth(Class exceptionClass, int depth) {
if (exceptionClass.getName().indexOf(this.exceptionName) != -1) {
private int getDepth(Class<?> exceptionClass, int depth) {
if (exceptionClass.getName().contains(this.exceptionName)) {
// Found it!
return depth;
}