Skip to content

Remove unreachable code from TransactionTemplate [SPR-10148] #14781

Closed
@spring-projects-issues

Description

@spring-projects-issues

Elad Tabak opened SPR-10148 and commented

The method org.springframework.transaction.support.TransactionTemplate.exectue() have dead code where calling upon the TransactionCallback.doInTransaction() is surrounded with 'try/catch', only the last "catch" for "Exception" is unnecessary, since the "doInTransaction()" does not declare any checked exception to be thrown.
The last "catch" statement is actually dead/unreachable code, since only RuntimeExceptions and Errors can be thrown from the "doInTransaction" method.


Affects: 3.1.3

Issue Links:

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: declinedA suggestion or change that we don't feel we should currently applytype: taskA general task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions