Skip to content

Commit d781f29

Browse files
committed
Use extracted attributes instead of annotation access
See gh-31034
1 parent 6fc4898 commit d781f29

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-tx/src/main/java/org/springframework/transaction/event/TransactionalApplicationListenerMethodAdapter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
public class TransactionalApplicationListenerMethodAdapter extends ApplicationListenerMethodAdapter
4949
implements TransactionalApplicationListener<ApplicationEvent> {
5050

51-
private final TransactionalEventListener annotation;
52-
5351
private final TransactionPhase transactionPhase;
5452

53+
private final boolean fallbackExecution;
54+
5555
private final List<SynchronizationCallback> callbacks = new CopyOnWriteArrayList<>();
5656

5757

@@ -68,8 +68,8 @@ public TransactionalApplicationListenerMethodAdapter(String beanName, Class<?> t
6868
if (eventAnn == null) {
6969
throw new IllegalStateException("No TransactionalEventListener annotation found on method: " + method);
7070
}
71-
this.annotation = eventAnn;
7271
this.transactionPhase = eventAnn.phase();
72+
this.fallbackExecution = eventAnn.fallbackExecution();
7373
}
7474

7575

@@ -92,8 +92,8 @@ public void onApplicationEvent(ApplicationEvent event) {
9292
TransactionSynchronizationManager.registerSynchronization(
9393
new TransactionalApplicationListenerSynchronization<>(event, this, this.callbacks));
9494
}
95-
else if (this.annotation.fallbackExecution()) {
96-
if (this.annotation.phase() == TransactionPhase.AFTER_ROLLBACK && logger.isWarnEnabled()) {
95+
else if (this.fallbackExecution) {
96+
if (getTransactionPhase() == TransactionPhase.AFTER_ROLLBACK && logger.isWarnEnabled()) {
9797
logger.warn("Processing " + event + " as a fallback execution on AFTER_ROLLBACK phase");
9898
}
9999
processEvent(event);

0 commit comments

Comments
 (0)