Provide a find-usages for variable assignments that iterates over assignments and method parameter bindings.
For example:
 
void boo()
{
  int a = Integer.parseInt(System.getProperty("foo"));
  bar(a, false);
}
 
void foo()
{
  bar(3, true);
}
 
void bar(int a, boolean q)
{
  int b;
  if (q)
    b = a;
  else
    b = 7;
  System.out.println(b);
}
 
In this case, doing a "transitive" find usage (for assignments) should result in the following list:
 
boo(): a = Integer.parseInt(System.getProperty("foo"));
foo(): bar(3, true);
bar(): a [ input parameter ]
bar(): b = 7
 
In other words, if a find usage is performed on a variable A, the find usage should include usages on any variable B in the code, where B is in the transitive closure of { variables that are assigned directly to A; variables that are implicitly assigned to A through a parameter in a method call }
 
This should be an option in the find usages dialog. Presumably not on by default.
 
-Dwight
 

Reply via email to