Renaming a method via refactoring is failing

View: New views
14 Messages — Rating Filter:   Alert me  

Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,



I'm having a strange problem. I am trying to rename a method. The method is only used within a Rails helper. I managed to do it once, but I don't seem to be able to do it again (after I renamed the method I thought there was a better name to rename it to).



Attached is a screen shot. As you can see, the refactoring tool has only found one instance of the method name, but it is clearly visible in more the one method as well as the defining method.



I am trying to rename a method from link_to_routed_url_via_job_number to link_to_routed_url_with_job_number.



I have recorded a Profile through this operation and can send that if necessary.



Am I doing something wrong?




Attachments:
http://forums.netbeans.org//files/screen_shot_131.png



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I've just tried again and it has worked (see screen shot).



This is on XP Pro and I'm using NetBeans 6.7




Attachments:
http://forums.netbeans.org//files/screen_shot_of_success_627.png



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm still getting this problem. It comes and goes. It seems that my refactoring tool is broken. Is there a module I can reinstall to try and correct the problem?



I do have a profile taken across an instance of this problem occurring.



Below are two screen shots showing another manifestation of the problem. Refactoring doesn't find all the instances of a method.



In the first screen shot, the method definition is missed even though it is only a few lines below the method call that is found, and even though the IDE is detecting the presence of the definition and highlighting in buff.



The second screen shot shows the condition after that refactoring is done and this shows it is not just a display problem - the refactoring process is missing the method definition.



At the moment, I'm going to download a new copy of Netbeans and reinstall to see if that fixes the probem.




Attachments:
http://forums.netbeans.org//files/screen_shot_one_found_but_two_exist_result_156.png
http://forums.netbeans.org//files/screen_shot_one_found_but_two_exist_172.png



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Updating to 6.7.1 didn't fix the problem. I uninstalled all the previous versions before installing this version.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Renaming a method via refactoring is failing

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Reggie,

Is this reproducible from scratch with some simple example, or does this
happen only in this particular case? Could you also please try the
latest dev build and see if the issue is still there
(http://wiki.netbeans.org/RubyInstallation#section-RubyInstallation-GettingADevelopmentBuild)?

Thanks,
Erno



ReggieB wrote:

> I'm still getting this problem. It comes and goes. It seems that my refactoring tool is broken. Is there a module I can reinstall to try and correct the problem?
>
>
>
> I do have a profile taken across an instance of this problem occurring.
>
>
>
> Below are two screen shots showing another manifestation of the problem. Refactoring doesn't find all the instances of a method.
>
>
>
> In the first screen shot, the method definition is missed even though it is only a few lines below the method call that is found, and even though the IDE is detecting the presence of the definition and highlighting in buff.
>
>
>
> The second screen shot shows the condition after that refactoring is done and this shows it is not just a display problem - the refactoring process is missing the method definition.
>
>
>
> At the moment, I'm going to download a new copy of Netbeans and reinstall to see if that fixes the probem.
>
>
>
>
> Attachments:
> http://forums.netbeans.org//files/screen_shot_one_found_but_two_exist_result_156.png
> http://forums.netbeans.org//files/screen_shot_one_found_but_two_exist_172.png
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Erno,



I've now done the following:



1. Installed a copy of Netbeans 6.7.1 on another PC (also running XP Pro)

2. Created in a text editor a simple file comprising the code for a single ruby class. The class contains two methods. method_one calls method_two

3. Opened Netbeans and created a ruby project

4. Copied the file into the new project

5. Tried to rename method_two from within Netbeans.



The method declaration was ignored.



I then installed Netbeans 6.5 on the same PC and tried again and the renaming worked perfectly.



See screen shots




Attachments:
http://forums.netbeans.org//files/refactor_test_netbeans6_5_146.png
http://forums.netbeans.org//files/refactor_test_netbeans6_7_1_898.png



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


BTW. I noticed in the screen shot that Netbeans 6.7.1 was still scanning the project when I ran the test (hence the lack of detail in the Navigator pane). I've rerun the test again after the project scanning has completed and got the same result - only method_two only updated in one place.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I've tried the test in what I think is the latest development version of Netbeans. Problem is there too.



Looks like I'm rolling back to 6.5 for a while.




Attachments:
http://forums.netbeans.org//files/refactor_test_netbeans_dev_ruby_3048_on_090826_103.png



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Renaming a method via refactoring is failing

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks a lot for the steps, I will take a look at this.

Cheers,
Erno

ReggieB wrote:

> Hi Erno,
>
>
>
> I've now done the following:
>
>
>
> 1. Installed a copy of Netbeans 6.7.1 on another PC (also running XP Pro)
>
> 2. Created in a text editor a simple file comprising the code for a single ruby class. The class contains two methods. method_one calls method_two
>
> 3. Opened Netbeans and created a ruby project
>
> 4. Copied the file into the new project
>
> 5. Tried to rename method_two from within Netbeans.
>
>
>
> The method declaration was ignored.
>
>
>
> I then installed Netbeans 6.5 on the same PC and tried again and the renaming worked perfectly.
>
>
>
> See screen shots
>
>
>
>
> Attachments:
> http://forums.netbeans.org//files/refactor_test_netbeans6_5_146.png
> http://forums.netbeans.org//files/refactor_test_netbeans6_7_1_898.png
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Renaming a method via refactoring is failing

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Just FYI, this is now fixed in the latest dev builds (tracked in
http://www.netbeans.org/issues/show_bug.cgi?id=171160).

For 6.8 final I'll also try to enhance the rename refactoring action to
better handle inherited / overriding methods, I noticed we don't handle
those too well.

Thanks for reporting this once again,

Erno

ReggieB wrote:

> I've tried the test in what I think is the latest development version of Netbeans. Problem is there too.
>
>
>
> Looks like I'm rolling back to 6.5 for a while.
>
>
>
>
> Attachments:
> http://forums.netbeans.org//files/refactor_test_netbeans_dev_ruby_3048_on_090826_103.png
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Erno,



I'm glad you've managed to fix the problem. Good stuff.



Personally, I don't see why there is "rename" on the root of the right click menu AND on the right click refactor sub-menu. That is the same action in two places on the right click menu.



On the other hand I often find myself highlighting a word and then right clicking it for a find/replace action, only then remembering that I have to go to the edit menu.



If it were me, I'd replace the rename on the root of the right click menu with "replace" (same action as that on the edit menu) and/or "find". The refactor replace could stay where it is.



Just a thought while you are altering things in this area.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Renaming a method via refactoring is failing

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Reggie,

Thanks for your thoughts, I'll discuss them with the UI people here and
see if they'd be willing to do changes in this area (these aren't really
specific to NB Ruby as such). Personally I do like having the Refactor
menu in the context menu too, but I can see your point.

Cheers,
Erno


ReggieB wrote:

> Erno,
>
>
>
> I'm glad you've managed to fix the problem. Good stuff.
>
>
>
> Personally, I don't see why there is "rename" on the root of the right click menu AND on the right click refactor sub-menu. That is the same action in two places on the right click menu.
>
>
>
> On the other hand I often find myself highlighting a word and then right clicking it for a find/replace action, only then remembering that I have to go to the edit menu.
>
>
>
> If it were me, I'd replace the rename on the root of the right click menu with "replace" (same action as that on the edit menu) and/or "find". The refactor replace could stay where it is.
>
>
>
> Just a thought while you are altering things in this area.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Renaming a method via refactoring is failing

by ReggieB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Erno,



I'm just fired up the latest build (20090911401). I've had to do rename a method and the refactoring worked fine with this build!



I've signed up to NetCAT and intend to work with the latest build until the 6.8 release (it's easy enough to fire 6.5 back up if I hit a problem), so I'm glad this is working now.



Thanks again



Reggie






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Renaming a method via refactoring is failing

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



ReggieB wrote:
> Erno,
>
>
>
> I'm just fired up the latest build (20090911401). I've had to do rename a method and the refactoring worked fine with this build!
>
>  

That's good, let me know if you run into any issues with it.

>
> I've signed up to NetCAT and intend to work with the latest build until the 6.8 release (it's easy enough to fire 6.5 back up if I hit a problem), so I'm glad this is working now.
>  

Great to hear that! I've had very good experiences with the NetCAT
program, it helps a lot in improving the overall quality and focusing on
issues that really matter.

Erno

>
>
> Thanks again
>
>
>
> Reggie
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...