Skip to content

Recipe to move fields to the top of class definition #721

@greg-at-moderne

Description

@greg-at-moderne

What problem are you trying to solve?

Increase readability. Follow conventions.

Describe the situation before applying the recipe

class A {
    void foo(String bar) {
        int i = Integer.valueOf(bar);
    }

    String myField = "important";
}

Describe the situation after applying the recipe

class A {
    String myField = "important";

    void foo(String bar) {
        int i = Integer.valueOf(bar);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions