Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let's get some terms straight:</p> <ul> <li>The monitor of a synchronized block is in fact the monitor on an object</li> <li>References to the monitor of a synchronized is ambigous: do you want all places in the code where this monitor is referenced or all fields/local variables which points to the monitor?</li> </ul> <p><strong>Where in the code the monitor is referenced?</strong></p> <p>Suraj already describe how to do this: <code>Search &gt; References &gt; Workspace...</code>. You can also filter those references to only read access, write access, implementators, etc. Such references are found through static code analysis, so no need to run the application. This, however, will not automatically detect the cases where a reference to an object is assigned to a field, which is then assigned to another variable. This only detects reference to this particular reference to the object.</p> <p><strong>Which variables points the monitor?</strong></p> <p>This will handle the case when several fields/local variables reference the object. To do this, the application must be running. You need to put breakpoint in a proper place, where the monitor is visible (the easiest way is somewhere around a synchronized block, which use the monitor in question). The Variables view will show all variables available in the current scope. You can get all references to an object by selecting an reference to the object in the Variables view, bringing the context menu and selecting <code>All References...</code>. This will show you all fields/local variables, which reference the object.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload