GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — [java] AvoidSynchronizedStatement: Improve rule doc by adangel · Pull Request #6657 · pmd/pmd Conversation
Member
Describe the PRRefs #5175 (comment) While it's not wrong to put "lock.lock()" inside the try, the best practice documented in https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/concurrent/locks/ReentrantLock.html puts it directly before the try. Also added an explicit example of tryLock() usage. Related issues
Ready?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
Compared to main: (comment created at 2026-05-19 18:23:41+00:00 for 3499944) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
New description looks good!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Refs pmd#5175 (comment) While it's not wrong to put "lock.lock()" inside the try, the best practice documented in https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/concurrent/locks/ReentrantLock.html puts it directly before the try. Also added an explicit example of tryLock() usage.
a96aaec to
3499944
Compare
|
Thanks for the reviews! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.