Transient fields should by default be excluded from equals and hashCode. Fixes #1724

This commit is contained in:
Roel Spilker committed 2018-06-18 23:56:27 +02:00
1 parent 2264ce492c
commit f241ef8c30
7 files changed
+207 -3

No files matched your search

@@ -0,0 +1,20 @@
class ToStringAutoExclude {
int x;
String $a;
transient String b;
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "ToStringAutoExclude(x=" + this.x + ", b=" + this.b + ")";
}
}
class ToStringAutoExclude2 {
int x;
String $a;
transient String b;
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "ToStringAutoExclude2(x=" + this.x + ", $a=" + this.$a + ", b=" + this.b + ")";
}
}