Refactoring does not include paramaters variables in new extracted method
Original Reporter info from Mantis: motaz
-
Reporter name: Motaz Abdel Azeem
Original Reporter info from Mantis: motaz
- Reporter name: Motaz Abdel Azeem
Description:
When extracting a method from a procedure, the newly extracted method will not contain the parameters that exist in origional procedure, only local variables are included
Steps to reproduce:
Write this sample procedure:
procedure DoSomething(List: TStringList);
var
i: Integer;
begin
Writeln('First');
// Refactor this
for i:= 0 to List.Count do
if List.IndexOf('-') > 0 then
writeln('Seperator');
// End of refactor
Writeln('Last');
end;
After refactoring you will get this new procedure:
procedure NewProc;
var
i: Integer;
begin
// Refactor this
for i:= 0 to List.Count do
if List.IndexOf('-') > 0 then
writeln('Seperator');
// End of refactor
end;
Note that List is not included in NewProc parameters
Mantis conversion info:
- Mantis ID: 24298
- OS: Linux
- OS Build: Ubuntu 12.04
- Build: 40849
- Platform: all
- Version: 1.0.9 (SVN)