I have the following code:
-----------------------
//My SampleClass Class
public class SampleClass
{
public String Foo(ICollection collection)
{
SampleClass sampleClass;
}
}
--------------------
1. I use Rename refactoring for class SampleClass and rename it to SampleClass1.
2. When it shows related symbols, I navigate to the variable location and change its name form sampleClass to myClass.
When the refactoring is performed, the variable declaration looks as follows:
-------------------------
SampleClass sampleClass1;
-------------------------
As you can see, the type is not changed.