Bug Report T358985
Visible to All Users

Organize Members wrongly sorts some fields

created 9 years ago

Given a method that looks like this:

C#
namespace MyNamespace { public class TestClass { public void DoWork() { } public TestClass() { } private Lazy<Guid> _id = new Lazy<Guid>(() => Guid.NewGuid()); } }

And the Organize Members settings are set to "StyleCop"
When you execute Organize Members the Lazy<Guid> _id field should get moved to the top of the class but instead it stays at the bottom. Even if you manually put it at the top, after Organize Members runs it gets put back at the bottom incorrectly.

It appears the field is getting sorted like a private method rather than a private field.

Comments (2)
TI TI
Travis Illig (FISV) 9 years ago

    This also seems to affect static readonly fields. For example, this field will get sorted to the bottom of the class, too:

    public static readonly string SomeName = "SomeValue";

    DevExpress Support Team 9 years ago

      Hi Travis,

      Thank you for letting us know about this problem. I have reproduced this behavior locally and will pass this ticket to our developers for further research.

      Answers approved by DevExpress Support

      created 9 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.

      Additional information:

      Hi Travis,
      Initialized fields weren't touched by Organize Members (and moved to the end of  class) because of possible side effects. However, in most cases, this check is not necessary. In CRR 1.0.11, we have introduced an option - 'Skip initialized fields'. If you uncheck it, initialized fields will be organized as any other members. We plan to release CRR 1.0.11 shortly.

        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.