Project
IntelliJ IDEA
Priority
Normal
Type
Feature
Fix versions
No Fix versions
State
Open
Assignee
Maxim Shafirov
Subsystem
Editor. Intention Actions
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Keith Lea
    5 years ago (03 Apr 2006 23:25)
  • Updated by   root
    2 years ago (17 Jan 2010 20:27)
  • Jira: IDEADEV-6780
    (history, comments)
 
IDEA-31859 Add intention on "synchronized" method modifier to convert synchronized method modifier to synchronized block
1
Issue is visible to: All Users
  The issue is visible to the selected user group only
I'd like intention for this:
synchronized void x(int y) {
  z = y;
}


to be converted to this:
void x(int y) {
  synchronized(this) {
    z = y;
  }
}


I do this manually a few times a week and it's a pain. I expect the intention would only trigger on the "synchronized" keyword.
Comments (2)
 
History
 
Linked Issues (?)
 
Bas Leijdekkers
  Bas Leijdekkers
04 Apr 2006 14:09
5 years ago
The inspection "'synchronized' method" does exactly this. Do you need it as an intention too?
Keith Lea
  Keith Lea
04 Apr 2006 18:07
5 years ago
Yes, I think synchronized methods are somewhat elegant and I don't want IDEA to warn me about them. Sometimes I decide that I need to fire some events outside the lock or something so I need to convert the sync method to a sync block.