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 214504 - Impossible to rename function and typedef
Summary: Impossible to rename function and typedef
Status: RESOLVED INCOMPLETE
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: PC Linux
: P1 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-20 11:56 UTC by _ pandajava
Modified: 2012-06-22 17:20 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 _ pandajava 2012-06-20 11:56:46 UTC
The function refactoring is impossible. Also typedef renaming does not propagates into function.
Based upon the sample of test specifications : 

http://wiki.netbeans.org/TS_67_CNDrefactoring
Comment 1 soldatov 2012-06-20 14:14:03 UTC
(In reply to comment #0)
> The function refactoring is impossible.
Can you explain your problem?
Comment 2 Vladimir Voskresensky 2012-06-20 14:47:52 UTC
Looks like dup of:
http://netbeans.org/bugzilla/show_bug.cgi?id=214459
&&
http://netbeans.org/bugzilla/show_bug.cgi?id=214460

right?
Comment 3 _ pandajava 2012-06-20 16:05:45 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > The function refactoring is impossible.
> Can you explain your problem?

As a sample here the original program with a main procedure and functions : 

float z; /* This is a global variable */

main() {
    int index;
    float x, y, sqr(), glsqr();
    for (index = 0; index <= 7; index++) {
        x = index; /* convert int to float */
        y = sqr(x); /* square x to a floating point variable */
        printf("The square of %d is %10.4f\n", index, y);
    }
    for (index = 0; index <= 7; index++) {
        z = index;
        y = glsqr();
        printf("The square of %d is %10.4f\n", index, y);
    }
}

float sqr(inval)
float inval;
{
float square;
square = inval * inval;
return(square);
}

float glsqr()  {
    return (z * z);
}


/*****************************************************/

When I decide to rename the function "glsqr" to "glsqrTest" , that's happening :

main() {
    int index;
    float x, y, sqr(), glsqr();
    for (index = 0; index <= 7; index++) {
        x = index; /* convert int to float */
        y = sqr(x); /* square x to a floating point variable */
        printf("The square of %d is %10.4f\n", index, y);
    }
    for (index = 0; index <= 7; index++) {
        z = index;
        y = glsqrTest();
        printf("The square of %d is %10.4f\n", index, y);
    }
}

float sqr(inval)
float inval;
{
float square;
square = inval * inval;
return(square);
}

float glsqrTest()  {
    return (z * z);
}


/***************************************************************/

But the refactoring is not applied to glsqr  in line 3 

 float x, y, sqr(), glsqr(); 

It is same case I noticed with the sample in test specifications.

Constantin
Comment 4 Vladimir Voskresensky 2012-06-20 17:36:30 UTC
Thanks. Please, file a separate bug about your sample code.
We thought you were talking about test cases from
http://wiki.netbeans.org/TS_67_CNDrefactoring
Comment 5 Alexander Pepin 2012-06-22 14:54:48 UTC
I've filed a separate issue #214632 (Function forward declaration inside the other function is not recognized).
Comment 6 _ pandajava 2012-06-22 17:20:34 UTC
(In reply to comment #5)
> I've filed a separate issue #214632 (Function forward declaration inside the
> other function is not recognized).

Ok , if it is understandable.