Please provide
- Operating system: MacOS Ventunar 13.0
- SonarLint plugin version: 7.4.0.60471
- Programming language you’re coding in: Java
- Is connected mode used:
- Connected to SonarCloud or SonarQube (and which version): no
And a thorough description of the problem/question:
I used isPresent
already, but it still warns the bug
// Optional<User> user = .....
if (user.isPresent()) {
new TransactionTemplate(transactionManager, attribute)
.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
sendingEmailService.sendRemindEmail(param, user.get());
}
});
entityManager.clear();
ReadOnlyEntityManager.clear();
}