Skip to content

Fix mail lock race condition & Sonar smells #2721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 28, 2019

Conversation

artembilan
Copy link
Member

https://build.spring.io/browse/INT-MASTERSPRING40-599/

  • The folderReadLock might not be re-locked when openFolder()
    throws an exception
  • Fix all the Sonar smells for mail module
  • Optimize all the dynamic Assert messages to Supplier
  • Refactor MailReceiverFactoryBean to be based on the AbstractFactoryBean

https://build.spring.io/browse/INT-MASTERSPRING40-599/

* The `folderReadLock` might not be re-locked when `openFolder()`
throws an exception
* Fix all the Sonar smells for mail module
* Optimize all the dynamic `Assert` messages to `Supplier`
* Refactor `MailReceiverFactoryBean` to be based on the `AbstractFactoryBean`
Folder folder = getFolder();
logger.debug("Canceling IDLE");
if (folder != null) {
folder.isOpen(); // resets idle state
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume this was to avoid log noise. Why change? If your intention is to alert the user of the problem, it would be better to log rather than the task executor printing the stack trace.

//
// public static void closeFolder(Folder folder) {
// closeFolder(folder, false);
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just delete this?

* Remove commented code in the `MailTransportUtils`
@garyrussell garyrussell merged commit 5295a76 into spring-projects:master Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants