netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Organize Members hint: don't rearrange record components

Open mbien opened this issue 11 months ago • 0 comments

if the formatter is configured to sort members alphabetically, the hint should not rearrange record components.

The fix reuses the existing special case for enums, which holds the enum "members" in place and does the same for synthetic record members.

import java.awt.Color;

// enable formatter setting: ordering -> alphabetical member sort
// this should not influence record components
public record OrderMembersRecord(Color borderColor, double borderSize, int width, int height) {

    public static int c;
    public static int b;
    public static int d;
    public static int a;

}

mbien avatar Feb 02 '25 13:02 mbien