Browse Source

Fix and improve Javadoc in spring-tx

Closes gh-28794
pull/28850/head
Marc Wrobel 2 years ago committed by Sam Brannen
parent
commit
3b68e97710
  1. 4
      spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java
  2. 4
      spring-tx/src/main/java/org/springframework/dao/DataAccessException.java
  3. 2
      spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java
  4. 2
      spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java
  5. 2
      spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java
  6. 2
      spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java
  7. 2
      spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java
  8. 2
      spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java
  9. 6
      spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java
  10. 2
      spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java
  11. 2
      spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java
  12. 2
      spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java
  13. 2
      spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java
  14. 2
      spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java
  15. 2
      spring-tx/src/main/java/org/springframework/transaction/reactive/AbstractReactiveTransactionManager.java
  16. 2
      spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java
  17. 2
      spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java
  18. 2
      spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionDefinition.java
  19. 2
      spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java
  20. 2
      spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java
  21. 2
      spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java

4
spring-tx/src/main/java/org/springframework/dao/CleanupFailureDataAccessException.java

@ -17,14 +17,14 @@ @@ -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.
*
* <p>For example, this exception or a subclass might be thrown if a JDBC
* Connection couldn't be closed after it had been used successfully.
*
* <p>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

4
spring-tx/src/main/java/org/springframework/dao/DataAccessException.java

@ -27,7 +27,7 @@ import org.springframework.lang.Nullable; @@ -27,7 +27,7 @@ import org.springframework.lang.Nullable;
*
* <p>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.
*
* <p>As this class is a runtime exception, there is no need for user code
@ -50,7 +50,7 @@ public abstract class DataAccessException extends NestedRuntimeException { @@ -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) {

2
spring-tx/src/main/java/org/springframework/dao/DuplicateKeyException.java

@ -18,7 +18,7 @@ package org.springframework.dao; @@ -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.
*

2
spring-tx/src/main/java/org/springframework/dao/NonTransientDataAccessException.java

@ -41,7 +41,7 @@ public abstract class NonTransientDataAccessException extends DataAccessExceptio @@ -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) {

2
spring-tx/src/main/java/org/springframework/dao/RecoverableDataAccessException.java

@ -41,7 +41,7 @@ public class RecoverableDataAccessException extends DataAccessException { @@ -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) {

2
spring-tx/src/main/java/org/springframework/dao/TransientDataAccessException.java

@ -41,7 +41,7 @@ public abstract class TransientDataAccessException extends DataAccessException { @@ -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) {

2
spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java

@ -99,7 +99,7 @@ public class PersistenceExceptionTranslationInterceptor @@ -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").
* <p>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.
* <p>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

2
spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointFactory.java

@ -35,7 +35,7 @@ import org.springframework.util.ReflectionUtils; @@ -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).
*
* <p>Uses AOP proxies for concrete endpoint instances, simply wrapping
* the specified message listener object and exposing all of its implemented

6
spring-tx/src/main/java/org/springframework/jca/endpoint/GenericMessageEndpointManager.java

@ -240,9 +240,9 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi @@ -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;

2
spring-tx/src/main/java/org/springframework/transaction/SavepointManager.java

@ -26,7 +26,7 @@ package org.springframework.transaction; @@ -26,7 +26,7 @@ package org.springframework.transaction;
* else, a subtransaction with PROPAGATION_NESTED is preferable.
*
* <p>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

2
spring-tx/src/main/java/org/springframework/transaction/interceptor/DefaultTransactionAttribute.java

@ -170,7 +170,7 @@ public class DefaultTransactionAttribute extends DefaultTransactionDefinition im @@ -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

2
spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java

@ -22,7 +22,7 @@ import org.springframework.lang.Nullable; @@ -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.
*
* <p>Multiple such rules can be applied to determine whether a transaction
* should commit or rollback after an exception has been thrown.

2
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java

@ -570,7 +570,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init @@ -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()

2
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeEditor.java

@ -44,7 +44,7 @@ public class TransactionAttributeEditor extends PropertyEditorSupport { @@ -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 {

2
spring-tx/src/main/java/org/springframework/transaction/reactive/AbstractReactiveTransactionManager.java

@ -632,7 +632,7 @@ public abstract class AbstractReactiveTransactionManager implements ReactiveTran @@ -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);

2
spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java

@ -953,7 +953,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran @@ -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);
}

2
spring-tx/src/main/java/org/springframework/transaction/support/AbstractTransactionStatus.java

@ -222,7 +222,7 @@ public abstract class AbstractTransactionStatus implements TransactionStatus { @@ -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() {

2
spring-tx/src/main/java/org/springframework/transaction/support/ResourceTransactionDefinition.java

@ -31,7 +31,7 @@ public interface ResourceTransactionDefinition extends TransactionDefinition { @@ -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();

2
spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java

@ -20,7 +20,7 @@ import java.io.Flushable; @@ -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.
*
* <p>Autodetected by DefaultTransactionStatus, to always return a

2
spring-tx/src/test/java/org/springframework/transaction/JndiJtaTransactionManagerTests.java

@ -215,7 +215,7 @@ public class JndiJtaTransactionManagerTests { @@ -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

2
spring-tx/src/test/java/org/springframework/transaction/JtaTransactionManagerTests.java

@ -1185,7 +1185,7 @@ public class JtaTransactionManagerTests { @@ -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

Loading…
Cancel
Save