This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 240437 - [refactoring-rename] Changing behavior when renaming macro to an existing name
Summary: [refactoring-rename] Changing behavior when renaming macro to an existing name
Status: RESOLVED DUPLICATE of bug 240303
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 04:29 UTC by gugawag
Modified: 2014-02-11 13:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gugawag 2014-01-14 04:29:13 UTC
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 A // Macro to be renamed
int main(int argc, char** argv) {
    int a;
#ifdef A
    a = 1;
#endif
#ifdef B
    a = 2;
#endif
    return a;
}
==================================

Now, let's rename the macro A to "B".
Applying the refactoring:
========== Refactored ============
#define B
int main(int argc, char** argv) {
    int a;
#ifdef B
    a = 1;
#endif
#ifdef B
    a = 2;
#endif
    return a;
}
=================================

The refactoring tool didn't check for existing references. In this case, B should not be permitted for a renaming because of the existing #ifdef B.


Thanks in advance.
Comment 1 Vladimir Voskresensky 2014-02-11 13:06:05 UTC

*** This bug has been marked as a duplicate of bug 240303 ***