Use Java Records

jSparrow Eclipse 4.5.0 & jSparrow Maven 3.12.0

We are happy to announce the jSparrow November release with one new refactoring rule! The 105th rule is motivated by Java Records.

Use Java Records

Since Java 16, record classes are a new kind of class in the Java language. Record classes help to model plain data aggregates with less ceremony than normal classes. This rule replaces the declarations of local classes, inner classes, and package private root classes with record class declarations.

For instance, the following code:

class Point {
    private final int x;
    private final int y;

    Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int x() {
        return x;
    }

    public int y() {
        return y;
    }
}

is transformed to:

record Point(int x, int y) {}

The new rule brings jSparrow to a total of 105 automatic refactoring rules.

Find out more information in the Release Notes for jSparrow Eclipse and jSparrow Maven!

“Good code is its own best documentation.” ― Steve McConnell

Promotion pop-up

jSparrow 22% off promotion image