From 3b68e97710cfd5e03d7c44366574e18e146e5c3c Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Tue, 12 Jul 2022 11:53:04 +0200 Subject: [PATCH] Fix and improve Javadoc in spring-tx Closes gh-28794 --- .../dao/CleanupFailureDataAccessException.java | 4 ++-- .../java/org/springframework/dao/DataAccessException.java | 4 ++-- .../java/org/springframework/dao/DuplicateKeyException.java | 2 +- .../dao/NonTransientDataAccessException.java | 2 +- .../springframework/dao/RecoverableDataAccessException.java | 2 +- .../springframework/dao/TransientDataAccessException.java | 2 +- .../support/PersistenceExceptionTranslationInterceptor.java | 2 +- .../jca/endpoint/GenericMessageEndpointFactory.java | 2 +- .../jca/endpoint/GenericMessageEndpointManager.java | 6 +++--- .../org/springframework/transaction/SavepointManager.java | 2 +- .../interceptor/DefaultTransactionAttribute.java | 2 +- .../transaction/interceptor/RollbackRuleAttribute.java | 2 +- .../transaction/interceptor/TransactionAspectSupport.java | 2 +- .../transaction/interceptor/TransactionAttributeEditor.java | 2 +- .../reactive/AbstractReactiveTransactionManager.java | 2 +- .../support/AbstractPlatformTransactionManager.java | 2 +- .../transaction/support/AbstractTransactionStatus.java | 2 +- .../transaction/support/ResourceTransactionDefinition.java | 2 +- .../transaction/support/SmartTransactionObject.java | 2 +- .../transaction/JndiJtaTransactionManagerTests.java | 2 +- .../transaction/JtaTransactionManagerTests.java | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java index 87eebf7222..32dfd248f4 100644 --- a/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java @@ -17,14 +17,14 @@ package org.springframework.dao; /** - * Exception thrown when we couldn't cleanup after a data access operation, + * Exception thrown when we couldn't clean up after a data access operation, * but the actual operation went OK. * *

For example, this exception or a subclass might be thrown if a JDBC * Connection couldn't be closed after it had been used successfully. * *

Note that data access code might perform resources cleanup in a - * finally block and therefore log cleanup failure rather than rethrow it, + * {@code finally} block and therefore log cleanup failure rather than rethrow it, * to keep the original data access exception, if any. * * @author Rod Johnson diff --git a/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java index 85113ce5a5..19098424c0 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DataAccessException.java @@ -27,7 +27,7 @@ import org.springframework.lang.Nullable; * *

This exception hierarchy aims to let user code find and handle the * kind of error encountered without knowing the details of the particular - * data access API in use (e.g. JDBC). Thus it is possible to react to an + * data access API in use (e.g. JDBC). Thus, it is possible to react to an * optimistic locking failure without knowing that JDBC is being used. * *

As this class is a runtime exception, there is no need for user code @@ -50,7 +50,7 @@ public abstract class DataAccessException extends NestedRuntimeException { /** * Constructor for DataAccessException. * @param msg the detail message - * @param cause the root cause (usually from using a underlying + * @param cause the root cause (usually from using an underlying * data access API such as JDBC) */ public DataAccessException(@Nullable String msg, @Nullable Throwable cause) { diff --git a/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java b/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java index f31a3a172d..b406391a3f 100644 --- a/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java +++ b/spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java @@ -18,7 +18,7 @@ package org.springframework.dao; /** * Exception thrown when an attempt to insert or update data - * results in violation of an primary key or unique constraint. + * results in violation of a primary key or unique constraint. * Note that this is not necessarily a purely relational concept; * unique primary keys are required by most database types. * diff --git a/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java index acf5770509..4fb6b7498a 100644 --- a/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java @@ -41,7 +41,7 @@ public abstract class NonTransientDataAccessException extends DataAccessExceptio /** * Constructor for NonTransientDataAccessException. * @param msg the detail message - * @param cause the root cause (usually from using a underlying + * @param cause the root cause (usually from using an underlying * data access API such as JDBC) */ public NonTransientDataAccessException(@Nullable String msg, @Nullable Throwable cause) { diff --git a/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java index 21f292e241..6065622b89 100644 --- a/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java @@ -41,7 +41,7 @@ public class RecoverableDataAccessException extends DataAccessException { /** * Constructor for RecoverableDataAccessException. * @param msg the detail message - * @param cause the root cause (usually from using a underlying + * @param cause the root cause (usually from using an underlying * data access API such as JDBC) */ public RecoverableDataAccessException(String msg, Throwable cause) { diff --git a/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java index 420715092b..98981e6dc9 100644 --- a/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java @@ -41,7 +41,7 @@ public abstract class TransientDataAccessException extends DataAccessException { /** * Constructor for TransientDataAccessException. * @param msg the detail message - * @param cause the root cause (usually from using a underlying + * @param cause the root cause (usually from using an underlying * data access API such as JDBC) */ public TransientDataAccessException(String msg, @Nullable Throwable cause) { diff --git a/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java b/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java index 8ac82c07b2..8ddcd40e80 100644 --- a/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java +++ b/spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java @@ -99,7 +99,7 @@ public class PersistenceExceptionTranslationInterceptor * raw exception when declared, i.e. when the originating method signature's exception * declarations allow for the raw exception to be thrown ("false"). *

Default is "false". Switch this flag to "true" in order to always translate - * applicable exceptions, independent from the originating method signature. + * applicable exceptions, independent of the originating method signature. *

Note that the originating method does not have to declare the specific exception. * Any base class will do as well, even {@code throws Exception}: As long as the * originating method does explicitly declare compatible exceptions, the raw exception diff --git a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java index 15cb289dce..e4b5b7e610 100644 --- a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java +++ b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java @@ -35,7 +35,7 @@ import org.springframework.util.ReflectionUtils; * {@link javax.resource.spi.endpoint.MessageEndpointFactory} interface, * providing transaction management capabilities for any kind of message * listener object (e.g. {@link javax.jms.MessageListener} objects or - * {@link javax.resource.cci.MessageListener} objects. + * {@link javax.resource.cci.MessageListener} objects). * *

Uses AOP proxies for concrete endpoint instances, simply wrapping * the specified message listener object and exposing all of its implemented diff --git a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java index f97dcc9bc9..e19166ca6a 100644 --- a/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java +++ b/spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java @@ -240,9 +240,9 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi /** * Specify the phase in which this endpoint manager should be started * and stopped. The startup order proceeds from lowest to highest, and - * the shutdown order is the reverse of that. By default this value is - * Integer.MAX_VALUE meaning that this endpoint manager starts as late - * as possible and stops as soon as possible. + * the shutdown order is the reverse of that. By default, this value is + * {@code Integer.MAX_VALUE} meaning that this endpoint manager starts + * as late as possible and stops as soon as possible. */ public void setPhase(int phase) { this.phase = phase; diff --git a/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java b/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java index ca12743cb4..757269cc32 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java @@ -26,7 +26,7 @@ package org.springframework.transaction; * else, a subtransaction with PROPAGATION_NESTED is preferable. * *

This interface is inspired by JDBC 3.0's Savepoint mechanism - * but is independent from any specific persistence technology. + * but is independent of any specific persistence technology. * * @author Juergen Hoeller * @since 1.1 diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java index 1c488ee067..ab3df073c7 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java @@ -170,7 +170,7 @@ public class DefaultTransactionAttribute extends DefaultTransactionDefinition im /** * The default behavior is as with EJB: rollback on unchecked exception - * ({@link RuntimeException}), assuming an unexpected outcome outside of any + * ({@link RuntimeException}), assuming an unexpected outcome outside any * business rules. Additionally, we also attempt to rollback on {@link Error} which * is clearly an unexpected outcome as well. By contrast, a checked exception is * considered a business exception and therefore a regular expected outcome of the diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java index a643c4c9b1..49327d9345 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java @@ -22,7 +22,7 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** - * Rule determining whether or not a given exception should cause a rollback. + * Rule determining whether a given exception should cause a rollback. * *

Multiple such rules can be applied to determine whether a transaction * should commit or rollback after an exception has been thrown. diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java index 783992f52c..1dbbdaa605 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java @@ -570,7 +570,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init * @param txAttr the TransactionAttribute (may be {@code null}) * @param joinpointIdentification the fully qualified method name * (used for monitoring and logging purposes) - * @return a TransactionInfo object, whether or not a transaction was created. + * @return a TransactionInfo object, whether a transaction was created. * The {@code hasTransaction()} method on TransactionInfo can be used to * tell if there was a transaction created. * @see #getTransactionAttributeSource() diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java index e6a13c8130..86dd748af3 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java @@ -44,7 +44,7 @@ public class TransactionAttributeEditor extends PropertyEditorSupport { /** * Format is PROPAGATION_NAME,ISOLATION_NAME,readOnly,timeout_NNNN,+Exception1,-Exception2. - * Null or the empty string means that the method is non transactional. + * Null or the empty string means that the method is non-transactional. */ @Override public void setAsText(String text) throws IllegalArgumentException { diff --git a/spring-tx/src/main/java/org/springframework/transaction/reactive/AbstractReactiveTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/reactive/AbstractReactiveTransactionManager.java index 5b6e58be45..cdc434fc73 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/reactive/AbstractReactiveTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/reactive/AbstractReactiveTransactionManager.java @@ -632,7 +632,7 @@ public abstract class AbstractReactiveTransactionManager implements ReactiveTran } else if (!synchronizations.isEmpty()) { // Existing transaction that we participate in, controlled outside - // of the scope of this Spring transaction manager -> try to register + // the scope of this Spring transaction manager -> try to register // an afterCompletion callback with the existing (JTA) transaction. return registerAfterCompletionWithExistingTransaction( synchronizationManager, status.getTransaction(), synchronizations); diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java index 74dc7a3d5a..e3f52fded7 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java @@ -953,7 +953,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran } else if (!synchronizations.isEmpty()) { // Existing transaction that we participate in, controlled outside - // of the scope of this Spring transaction manager -> try to register + // the scope of this Spring transaction manager -> try to register // an afterCompletion callback with the existing (JTA) transaction. registerAfterCompletionWithExistingTransaction(status.getTransaction(), synchronizations); } diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java index 97d9cd3348..f6abfdfda6 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java @@ -222,7 +222,7 @@ public abstract class AbstractTransactionStatus implements TransactionStatus { //--------------------------------------------------------------------- /** - * This implementations is empty, considering flush as a no-op. + * This implementation is empty, considering flush as a no-op. */ @Override public void flush() { diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionDefinition.java b/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionDefinition.java index ae295384b6..cc03421807 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionDefinition.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionDefinition.java @@ -31,7 +31,7 @@ public interface ResourceTransactionDefinition extends TransactionDefinition { /** * Determine whether the transactional resource is ready for local optimizations. * @return {@code true} if the resource is known to be entirely transaction-local, - * not affecting any operations outside of the scope of the current transaction + * not affecting any operations outside the scope of the current transaction * @see #isReadOnly() */ boolean isLocalResource(); diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java b/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java index 923e004804..1bb2bf1731 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java @@ -20,7 +20,7 @@ import java.io.Flushable; /** * Interface to be implemented by transaction objects that are able to - * return an internal rollback-only marker, typically from a another + * return an internal rollback-only marker, typically from another * transaction that has participated and marked it as rollback-only. * *

Autodetected by DefaultTransactionStatus, to always return a diff --git a/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java b/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java index 2319d34261..0c0e1e39d6 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java @@ -215,7 +215,7 @@ public class JndiJtaTransactionManagerTests { } /** - * Prevent any side-effects due to this test modifying ThreadLocals that might + * Prevent any side effects due to this test modifying ThreadLocals that might * affect subsequent tests when all tests are run in the same JVM, as with Eclipse. */ @AfterEach diff --git a/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java b/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java index 8666e6155b..8814e847c0 100644 --- a/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java +++ b/spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java @@ -1185,7 +1185,7 @@ public class JtaTransactionManagerTests { /** - * Prevent any side-effects due to this test modifying ThreadLocals that might + * Prevent any side effects due to this test modifying ThreadLocals that might * affect subsequent tests when all tests are run in the same JVM, as with Eclipse. */ @AfterEach