Community
Participate
Working Groups
Eclipse IDE for C/C++ Developers Version: Kepler Service Release 1 Build id: 20130919-0819 Reproducing the bug: Consider the following code: ======== Original Version ======== #define Id_0 int GlobalVar_0 = 1; int func_0() { int LocalVar_0 = 0; // To extract return GlobalVar_0; } int Function_0(int LocalVar_0) { return GlobalVar_0; } ================================== Now, let's the extract a function named "GlobalVar_0" Applying the refactoring: ========== Refactored ============ #define Id_0 int GlobalVar_0 = 1; int GlobalVar_0() { return 0; } int func_0() { int LocalVar_0 = GlobalVar_0(); return GlobalVar_0; } int Function_0(int LocalVar_0) { return GlobalVar_0; } ================================= The tool shouldn't allow to apply invalid transformations like this. Notice that now the program has a compilation error. It would be good if it was possible to prevent incorrect extractions by checking if at least there's no name collisions. Thanks in advance.
Correcting: * Now, let's extract a function named "GlobalVar_0"