Eclipse Refactoring [message #218905] |
Mon, 14 November 2005 11:11 |
Eclipse User |
|
|
|
Originally posted by: irum.cs.utoronto.ca
Hi,
I am trying to understand the data flow analysis in Eclipse Extract
Method Refactoring. These are the observations I have made and I would
appreciate if someone can confirm for me that I am not missing on
something, or misunderstood something.
1) Basically, in terms of data flow, the refactoring deterimines:
arguments, local variables and return values of the methods.
The selected portion of the code to be refactored is checked for
variables that are being read and written to. All variables that are being
read in their first use (inside the selection) are passed as arguments to
the
extracted method. All variables that are written to in their first use
are captured as local variables in the extracted method.
For return values, the variables that are being written(in the
selection)are compared to variables that are read in their first use right
"after" the selection. If there is one such variable it is captured as the
return value. If there are >1 such variables, then there is an error since
there are >1 return values. Also, there is the case of the loop
re-entrance.
2) Additionally, the flow analyzer checks if there are any partial
returns or branches off the selection, and if so, then it will throw an
error.
I will really appreciate if somebody can point out to me any scenarios
that I may have missed.
Thanks a lot,
Sincerely,
Irum Godil.
|
|
|
Powered by
FUDForum. Page generated in 0.02550 seconds