Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
125 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
test/transform/resource/after-delombok/EqualsAndHashCodeWithNonNullByDefault.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import javax.annotation.ParametersAreNonnullByDefault; | ||
@ParametersAreNonnullByDefault | ||
class EqualsAndHashCodeWithNonNullByDefault { | ||
int x; | ||
boolean[] y; | ||
Object[] z; | ||
String a; | ||
String b; | ||
@java.lang.Override | ||
@java.lang.SuppressWarnings("all") | ||
public boolean equals(@javax.annotation.Nullable final java.lang.Object o) { | ||
if (o == this) return true; | ||
if (!(o instanceof EqualsAndHashCodeWithNonNullByDefault)) return false; | ||
final EqualsAndHashCodeWithNonNullByDefault other = (EqualsAndHashCodeWithNonNullByDefault) o; | ||
if (!other.canEqual((java.lang.Object) this)) return false; | ||
if (this.x != other.x) return false; | ||
if (!java.util.Arrays.equals(this.y, other.y)) return false; | ||
if (!java.util.Arrays.deepEquals(this.z, other.z)) return false; | ||
final java.lang.Object this$a = this.a; | ||
final java.lang.Object other$a = other.a; | ||
if (this$a == null ? other$a != null : !this$a.equals(other$a)) return false; | ||
final java.lang.Object this$b = this.b; | ||
final java.lang.Object other$b = other.b; | ||
if (this$b == null ? other$b != null : !this$b.equals(other$b)) return false; | ||
return true; | ||
} | ||
@java.lang.SuppressWarnings("all") | ||
protected boolean canEqual(@javax.annotation.Nullable final java.lang.Object other) { | ||
return other instanceof EqualsAndHashCodeWithNonNullByDefault; | ||
} | ||
@java.lang.Override | ||
@java.lang.SuppressWarnings("all") | ||
public int hashCode() { | ||
final int PRIME = 59; | ||
int result = 1; | ||
result = result * PRIME + this.x; | ||
result = result * PRIME + java.util.Arrays.hashCode(this.y); | ||
result = result * PRIME + java.util.Arrays.deepHashCode(this.z); | ||
final java.lang.Object $a = this.a; | ||
result = result * PRIME + ($a == null ? 43 : $a.hashCode()); | ||
final java.lang.Object $b = this.b; | ||
result = result * PRIME + ($b == null ? 43 : $b.hashCode()); | ||
return result; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
test/transform/resource/after-ecj/EqualsAndHashCodeWithNonNullByDefault.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import javax.annotation.ParametersAreNonnullByDefault; | ||
@lombok.EqualsAndHashCode @ParametersAreNonnullByDefault class EqualsAndHashCodeWithNonNullByDefault { | ||
int x; | ||
boolean[] y; | ||
Object[] z; | ||
String a; | ||
String b; | ||
EqualsAndHashCodeWithNonNullByDefault() { | ||
super(); | ||
} | ||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final @javax.annotation.Nullable java.lang.Object o) { | ||
if ((o == this)) | ||
return true; | ||
if ((! (o instanceof EqualsAndHashCodeWithNonNullByDefault))) | ||
return false; | ||
final EqualsAndHashCodeWithNonNullByDefault other = (EqualsAndHashCodeWithNonNullByDefault) o; | ||
if ((! other.canEqual((java.lang.Object) this))) | ||
return false; | ||
if ((this.x != other.x)) | ||
return false; | ||
if ((! java.util.Arrays.equals(this.y, other.y))) | ||
return false; | ||
if ((! java.util.Arrays.deepEquals(this.z, other.z))) | ||
return false; | ||
final java.lang.Object this$a = this.a; | ||
final java.lang.Object other$a = other.a; | ||
if (((this$a == null) ? (other$a != null) : (! this$a.equals(other$a)))) | ||
return false; | ||
final java.lang.Object this$b = this.b; | ||
final java.lang.Object other$b = other.b; | ||
if (((this$b == null) ? (other$b != null) : (! this$b.equals(other$b)))) | ||
return false; | ||
return true; | ||
} | ||
protected @java.lang.SuppressWarnings("all") boolean canEqual(final @javax.annotation.Nullable java.lang.Object other) { | ||
return (other instanceof EqualsAndHashCodeWithNonNullByDefault); | ||
} | ||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { | ||
final int PRIME = 59; | ||
int result = 1; | ||
result = ((result * PRIME) + this.x); | ||
result = ((result * PRIME) + java.util.Arrays.hashCode(this.y)); | ||
result = ((result * PRIME) + java.util.Arrays.deepHashCode(this.z)); | ||
final java.lang.Object $a = this.a; | ||
result = ((result * PRIME) + (($a == null) ? 43 : $a.hashCode())); | ||
final java.lang.Object $b = this.b; | ||
result = ((result * PRIME) + (($b == null) ? 43 : $b.hashCode())); | ||
return result; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/transform/resource/before/EqualsAndHashCodeWithNonNullByDefault.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//CONF: lombok.addNullAnnotations = javax | ||
import javax.annotation.ParametersAreNonnullByDefault; | ||
@lombok.EqualsAndHashCode | ||
@ParametersAreNonnullByDefault | ||
class EqualsAndHashCodeWithNonNullByDefault { | ||
int x; | ||
boolean[] y; | ||
Object[] z; | ||
String a; | ||
String b; | ||
} |