diff --git a/spring-core/src/main/java/org/springframework/util/StringUtils.java b/spring-core/src/main/java/org/springframework/util/StringUtils.java index 14938f2eafd..9846018a749 100644 --- a/spring-core/src/main/java/org/springframework/util/StringUtils.java +++ b/spring-core/src/main/java/org/springframework/util/StringUtils.java @@ -983,7 +983,7 @@ public abstract class StringUtils { /** * Trim the elements of the given {@code String} array, * calling {@code String.trim()} on each of them. - * @param array the original {@code String} array (potentially {@code null} or empty) + * @param array the original {@code String} array (potentially empty) * @return the resulting array (of the same size) with trimmed elements */ public static String[] trimArrayElements(String[] array) { diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSource.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSource.java index 132bca731e5..b881bb346c8 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSource.java +++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSource.java @@ -156,14 +156,13 @@ public class AnnotationTransactionAttributeSource extends AbstractFallbackTransa * for parsing known annotations into Spring's metadata attribute class. * Returns {@code null} if it's not transactional. *
Can be overridden to support custom annotations that carry transaction metadata.
- * @param ae the annotated method or class
- * @return the configured transaction attribute,
- * or {@code null} if none was found
+ * @param element the annotated method or class
+ * @return the configured transaction attribute, or {@code null} if none was found
*/
@Nullable
- protected TransactionAttribute determineTransactionAttribute(AnnotatedElement ae) {
+ protected TransactionAttribute determineTransactionAttribute(AnnotatedElement element) {
for (TransactionAnnotationParser annotationParser : this.annotationParsers) {
- TransactionAttribute attr = annotationParser.parseTransactionAnnotation(ae);
+ TransactionAttribute attr = annotationParser.parseTransactionAnnotation(element);
if (attr != null) {
return attr;
}
diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/Ejb3TransactionAnnotationParser.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/Ejb3TransactionAnnotationParser.java
index 7e989876f85..57a3177f183 100644
--- a/spring-tx/src/main/java/org/springframework/transaction/annotation/Ejb3TransactionAnnotationParser.java
+++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/Ejb3TransactionAnnotationParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -37,8 +37,8 @@ public class Ejb3TransactionAnnotationParser implements TransactionAnnotationPar
@Override
@Nullable
- public TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae) {
- javax.ejb.TransactionAttribute ann = ae.getAnnotation(javax.ejb.TransactionAttribute.class);
+ public TransactionAttribute parseTransactionAnnotation(AnnotatedElement element) {
+ javax.ejb.TransactionAttribute ann = element.getAnnotation(javax.ejb.TransactionAttribute.class);
if (ann != null) {
return parseTransactionAnnotation(ann);
}
@@ -51,6 +51,7 @@ public class Ejb3TransactionAnnotationParser implements TransactionAnnotationPar
return new Ejb3TransactionAttribute(ann.value());
}
+
@Override
public boolean equals(Object other) {
return (this == other || other instanceof Ejb3TransactionAnnotationParser);
diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/JtaTransactionAnnotationParser.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/JtaTransactionAnnotationParser.java
index 0d4901b918a..df4dcf90bc2 100644
--- a/spring-tx/src/main/java/org/springframework/transaction/annotation/JtaTransactionAnnotationParser.java
+++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/JtaTransactionAnnotationParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -19,6 +19,7 @@ package org.springframework.transaction.annotation;
import java.io.Serializable;
import java.lang.reflect.AnnotatedElement;
import java.util.ArrayList;
+import java.util.List;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.annotation.AnnotationAttributes;
@@ -40,9 +41,9 @@ public class JtaTransactionAnnotationParser implements TransactionAnnotationPars
@Override
@Nullable
- public TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae) {
- AnnotationAttributes attributes =
- AnnotatedElementUtils.getMergedAnnotationAttributes(ae, javax.transaction.Transactional.class);
+ public TransactionAttribute parseTransactionAnnotation(AnnotatedElement element) {
+ AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(
+ element, javax.transaction.Transactional.class);
if (attributes != null) {
return parseTransactionAnnotation(attributes);
}
@@ -57,23 +58,23 @@ public class JtaTransactionAnnotationParser implements TransactionAnnotationPars
protected TransactionAttribute parseTransactionAnnotation(AnnotationAttributes attributes) {
RuleBasedTransactionAttribute rbta = new RuleBasedTransactionAttribute();
+
rbta.setPropagationBehaviorName(
RuleBasedTransactionAttribute.PREFIX_PROPAGATION + attributes.getEnum("value").toString());
- ArrayList This essentially parses a known transaction annotation into Spring's
- * metadata attribute class. Returns {@code null} if the method/class
- * is not transactional.
- * @param ae the annotated method or class
- * @return the configured transaction attribute,
- * or {@code null} if none was found
+ * based on an annotation type understood by this parser.
+ * This essentially parses a known transaction annotation into Spring's metadata
+ * attribute class. Returns {@code null} if the method/class is not transactional.
+ * @param element the annotated method or class
+ * @return the configured transaction attribute, or {@code null} if none found
* @see AnnotationTransactionAttributeSource#determineTransactionAttribute
*/
@Nullable
- TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae);
+ TransactionAttribute parseTransactionAnnotation(AnnotatedElement element);
}