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:
Reinier Zwitserloot
2010-07-21 10:51:09 +02:00
parent c06660bd18
commit 91bb3455da
12 changed files with 172 additions and 58 deletions
+6 -2
View File
@@ -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) + ")";
}
}