History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-6780
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Maxim Shafirov
Reporter: Keith Lea
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Add intention on "synchronized" method modifier to convert synchronized method modifier to synchronized block

Created: 03 Apr 06 22:25   Updated: 08 Aug 06 20:02
Component/s: Editor. Intention Actions
Fix Version/s: Undefined

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 4,167
Severity: Low


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order:
Bas Leijdekkers - 04 Apr 06 13:09
The inspection "'synchronized' method" does exactly this. Do you need it as an intention too?

Keith Lea - 04 Apr 06 17:07
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.