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

Key: IDEABKL-5177
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Yu Gor
Votes: 0
Watchers: 0
Available Workflow Actions

Mark as Stalled
Operations

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

Synchronization tracing

Created: 13 Jul 07 21:00   Updated: 20 Jul 07 17:47
Component/s: Find, Replace, Find Usages
Affects Version/s: None
Fix Version/s: None

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

Build: 6,180


 Description  « Hide
It would be extremely useful to enable IDEA with ability to trace a class instance usage as a monitor for synchronization blocks over the project code - resolving of synchronization and concurrent problems is one of the most complex task in programming

 All   Comments   Work Log   Change History      Sort Order:
Dmitry Jemerov - 19 Jul 07 20:53
You can use Structural Search and Replace to find where instances of the class are used as monitors in the "synchronized()" block. Is that what you need?

Yu Gor - 19 Jul 07 21:36 - edited
Noop - the structural search is of little help here...

'synchronized' keyword is used in Java for synchronization of blocks of code (have explicit monitor), for synchronization of instance's methods (on instance itself), and for synchronization of static methods (on instance's class).

Only in the first case structural search could be of some help.
However, if the synchronization monitor is not explicitly stated, structural search would be useless as well:

synchronized(getLock()) { // ... }

The 'synchronized' search I meant is something similar to 'Find Usages...'. It's something like 'Find Usages for Synchronization...' - the search returns all usages of the specified instance used as a synchronization monitor over the specified project scope - whole project, a module, or a directory.


Dmitry Jemerov - 19 Jul 07 21:43
Unfortunately this requires global data flow analysis of the level of sophistication that IntelliJ IDEA is not yet capable of.

Yu Gor - 20 Jul 07 17:47
It seems like the sophistication of the problem is greatly exaggerated - it is not such a sophisticated and unresolvable problem at all. What's more, it looks like JIDEA already is capable of and has almost everything it needs to provide such a service: tracing of instance and instance's class usage for synchronization is pretty much the same as tracing of usages of the class methods with exclusion of not synchronized methods have to be excluded. The only challenge would be in tracing of synchronized block monitor usage which could be done in a manner similar to tracing of an object usage as a method parameter...

Please note that when done, JIDEA would be the FIRST EVER IDE offering such an extremely useful service.