diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-08-13 15:04:43 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-08-22 22:42:48 +0200 |
commit | 15df143df6d35dd64459d717a451a039eb26d761 (patch) | |
tree | 70fc0be372fd02491f9c5e9d7d68ffe7901da6d8 /test/transform/resource/after-ecj/CheckerFrameworkBasic.java | |
parent | ff1c01d9e9e66d898c30939b497490b04fe6163c (diff) | |
download | lombok-15df143df6d35dd64459d717a451a039eb26d761.tar.gz lombok-15df143df6d35dd64459d717a451a039eb26d761.tar.bz2 lombok-15df143df6d35dd64459d717a451a039eb26d761.zip |
[checkerframework]
A bit of a shadow feature because the checker framework folks need to do some work on their side.
this update makes lombok generate a few checker framework annotations (if configured to do so)
which let the checker framework add warnings and errors for example if you misuse builders, or ignore
the return values of withers, etc.
Diffstat (limited to 'test/transform/resource/after-ecj/CheckerFrameworkBasic.java')
-rw-r--r-- | test/transform/resource/after-ecj/CheckerFrameworkBasic.java | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/transform/resource/after-ecj/CheckerFrameworkBasic.java b/test/transform/resource/after-ecj/CheckerFrameworkBasic.java new file mode 100644 index 00000000..03313c6d --- /dev/null +++ b/test/transform/resource/after-ecj/CheckerFrameworkBasic.java @@ -0,0 +1,59 @@ +import lombok.Data; +import lombok.experimental.Accessors; +import lombok.experimental.Wither; +@Data @Accessors(chain = true) class CheckerFrameworkBasic { + private final @Wither int x; + private final int y; + private int z; + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") CheckerFrameworkBasic withX(final int x) { + return ((this.x == x) ? this : new CheckerFrameworkBasic(x, this.y, this.z)); + } + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int getY() { + return this.y; + } + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int getZ() { + return this.z; + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBasic setZ(final int z) { + this.z = z; + return this; + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof CheckerFrameworkBasic))) + return false; + final CheckerFrameworkBasic other = (CheckerFrameworkBasic) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.getX() != other.getX())) + return false; + if ((this.getY() != other.getY())) + return false; + if ((this.getZ() != other.getZ())) + return false; + return true; + } + protected @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof CheckerFrameworkBasic); + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.getX()); + result = ((result * PRIME) + this.getY()); + result = ((result * PRIME) + this.getZ()); + return result; + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("CheckerFrameworkBasic(x=" + this.getX()) + ", y=") + this.getY()) + ", z=") + this.getZ()) + ")"); + } + public @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") CheckerFrameworkBasic(final int x, final int y) { + super(); + this.x = x; + this.y = y; + } +} |