The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,808 other followers

Delphi refactoring bugs – need input

Posted by jpluimers on 2010/11/04

One of the reasons that people are wary of using Delphi refactorings, is that some of them are not always reliable.

The only way to get them resolved is filing good bug reports.
But filing a good bug report is difficult: you need reproducible cases, and finding those can be tough.

Some of the refactorings can only be done by tools that have access to the complete compiler.
Which means that 3rd party tools like Model Maker Code Explorer, Castalia, cnPack and others cannot provide.

So I need some help in filing bugs centered around the refactoring topic:

  • Indicate weak points of the various refactorings
  • Help finding reproducible steps

Here are a few examples I filed recently:

  1. [WayBack] “No statements are selected” when performing “Extract Method” refactoring from case statement
  2. [WayBack] Complete case statement extracted when performing “Extract Method” refactoring from case statement
  3. [WayBack] Refactoring “Find Unit” often does not work any more

Please put your suggestions in the comments!

–jeroen

Some notes:

  1. Set Delphi “Block Indent” to 3
  2. Refactor – Extract method: it uses a Block Indent of 2.

6 Responses to “Delphi refactoring bugs – need input”

  1. wouter said

    I’m using Delphi XE, and another slightly annoying thing is that the refactoring menu items are in a different order in the popupmenu in the code editor than in the main menu.

    The items are the same, but they are just not in the same order, and I just noticed that the popup doesn’t have icons.

  2. wouter said

    Somehow I never got it all to work properly.

    When I want to rename a variable on this machine (control-shift-e), I always get this (utterly useless) errormessage:

    ************** Exception Text **************
    System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    at Borland.Studio.Refactoring.IRefactoringUserInterface.AddRootRefactoringNode(IRefactoringNode node, IRefactoring refactoring)
    at Borland.Studio.Refactoring.BaseRefactoring.CreateRootNode(String description)
    at Borland.Studio.Refactoring.BaseRenameRefactoring.SetupRename(String description)
    at Borland.Studio.Refactoring.BaseRenameRefactoring.SetupRename(String oldTypeName, String oldName, String nsName, String modName, String ext)
    at Borland.Studio.Delphi.RenameRefactoring..ctor(DelphiProjectSymbolManager manager, Symbol sym, String newName, Boolean execNow)
    at Borland.Studio.Delphi.RenameRefactoringForm.a(Object , EventArgs )
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.PerformClick()
    at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
    at System.Windows.Forms.Control.ProcessDialogKey(Keys keyData)
    at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
    at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
    at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
    at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

    If I edit the document (add a space for example), and then try the rename factoring, I get this additional errorpopup as a bonus:

    System.NullReferenceException: Object reference not set to an instance of an object.

    But.. at least the behaviour is predictable :)

  3. Gad D Lord said

    This is not a bug more like a feature: Please make switching off the Model support and Refactoring possible from the Tools|Options. I really don’t need them.

  4. I’m glad to see someone else is having issues with the refactoring available in RAD Studio/Delphi. I have tried most of the features and found them to be a) undocumented as to how to use them b) cumbersome, or c) they didn’t seem to work and I didn’t know why (or if I was using them incorrectly). I am currently using Delphi with CodeRush because Mark Miller had better refactoring and templating support than RAD studio has today and the product was originally released circa D3.

    I brought up some of the issues about refactoring when Mike Rozlog was on the XE tour and he didn’t see interested in documenting any kind of feedback. I pointed out that SyncEdit is not a whole lot more functional that a scope Search Replace, which takes less keystrokes.

    Good luck in getting refactoring bugs fixed and better re-factoring, even though refactoring is a core feature of any IDE, I don’t think EMB is listening…

    • jpluimers said

      Some attention from within Embarcadero has already risen. Please forward what you have to me (anything starting with my firstname at pluimers dot com will eventually end up in my inbox).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: