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 121058 - [rename] refactoring does not care about static import
Summary: [rename] refactoring does not care about static import
Status: VERIFIED DUPLICATE of bug 90769
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-03 16:55 UTC by damian_nb
Modified: 2007-11-09 15:30 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 damian_nb 2007-11-03 16:55:01 UTC
I tried to rename method abs in the following class to 'cos':

package aaa;

import static java.lang.Math.abs;
import static java.lang.Math.cos;
import static aaa.MyAbsMethod.abs;

class MyAbsMethod
{
	public static double abs(double x)
	{
		return x;
	}
}

but then static import (third import) was not renamed and it causes compilation error
Comment 1 Jan Pokorsky 2007-11-03 17:44:10 UTC
Static imports seems to be really missed by the rename. Thanks for the report. 
Comment 2 Jan Pokorsky 2007-11-03 18:00:57 UTC
For the record, static imports are special case. It is not possible just rename them in all cases since the import may
be used for several class members. Like in the following case:

class MyAbsMethod {
    public static double abs;
    public static double abs(double x) {
        return x;
    }
    public static double abs(double x, double y) {
        return x;
    }
}

import static MyAbsMethod.abs;
class Class2 {
    void m() {
        abs = 2;
        abs(1);
        abs(0, 1);
    }
}
Comment 3 Jan Becicka 2007-11-05 15:51:25 UTC

*** This issue has been marked as a duplicate of 90769 ***
Comment 4 damian_nb 2007-11-09 15:30:07 UTC
verified