Bug Report T431421
Visible to All Users

Refactorings - The "Rename Namespace to Match Folder Structure" refactoring incorrectly works when there are two classes with the same name

created 8 years ago

Hello,

I have a class "ProductMap" …

  1. The class is in "Mapping"
  2. I rename the namespace to not match the folder structre.
  3. I do a copy of the class to \infrastructure
  4. I apply the command the namespace is renamed to match folder structure BUT the class in \Mapping too.
  5. In RentProductsContext , where there is the using to  \Mapping\ProductMap, the using in the context file is renamed too.

I join a video.

Christian,

Comments (3)
DevExpress Support Team 8 years ago

    Hello Christian,

    Thank you for providing the screencast.

    I have reproduced this issue on my side.

    The cause of the issue that at the moment when you have two classes with the same full names, we cannot correctly detect which references are related to each of the class.
    So, we are going to fix this by making the "Rename namespace to mach folder structure" refactoring unavailable for such cases.

    As a workaround, we suggest you first rename the new class and after that apply the "Rename namespace to mach folder structure" refactoring.

    We will notify you as soon as we fix this.

    CI CI
    Christian Ista 8 years ago

      unavailable ? The command should be available but in this case  only change the namespace in the current file only and not everywhere.

      DevExpress Support Team 8 years ago

        Hello Cristian,

        Thank you for sharing your opinion with us.

        We have discussed this with our team and concluded that we should make this refactoring unavailable with non-compilable code.

        You can get the required behavior if you change the name of a new type to make code compilable. After that, you can use the "Rename namespace to match folder structure" refactoring.

        We appreciate your cooperation.

        Answers approved by DevExpress Support

        created 8 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.