Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Eclipse Refactoring

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.
 
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.
 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Back to the top