mirror of
https://github.com/tiennm99/lombok.git
synced 2026-08-05 14:23:54 +00:00
Added using .getX() instead of using .x in equals, hashCode, and toString. Also updated changelog as well as the docs.
Also updated usage examples for @EqualsAndHashCode, @ToString, and @Data, which also contained some other minor issues (such as missing this. qualifiers). Still to do is to detect that getters don't exist _yet_ but will later due to @Getter or @Data.
This commit is contained in:
@@ -7,6 +7,10 @@ public class ToStringExample {
|
||||
private String[] tags;
|
||||
private int id;
|
||||
|
||||
public String getName() {
|
||||
return this.getName();
|
||||
}
|
||||
|
||||
public static class Square extends Shape {
|
||||
private final int width, height;
|
||||
|
||||
@@ -16,11 +20,11 @@ public class ToStringExample {
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return "Square(super=" + super.toString() + ", width=" + width + ", height=" + height + ")";
|
||||
return "Square(super=" + super.toString() + ", width=" + this.width + ", height=" + this.height + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return "ToStringExample(" + name + ", " + shape + ", " + Arrays.deepToString(tags) + ")";
|
||||
return "ToStringExample(" + this.getName() + ", " + this.shape + ", " + Arrays.deepToString(this.tags) + ")";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user