You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Lombok 1.16.22 uses both transient and non-transient fields to produce equals and hashCode methods.
I use IntelliJ 2018.1 with lombok plugin.
@Getter
@EqualsAndHashCode
public class SomeClass {
private transient String someTransientField;
private String someNonTransientField;
}
Lombok 1.16.22 produces;
public int hashCode() {
int PRIME = true;
int result = 1;
Object $someTransientField = this.getSomeTransientField();
int result = result * 59 + ($someTransientField == null ? 43 : $someTransientField.hashCode());
Object $someNonTransientField = this.getSomeNonTransientField();
result = result * 59 + ($someNonTransientField == null ? 43 : $someNonTransientField.hashCode());
return result;
}
Lombok 1.16.20 produces;
public int hashCode() {
int PRIME = true;
int result = 1;
Object $someNonTransientField = this.getSomeNonTransientField();
int result = result * 59 + ($someNonTransientField == null ? 43 : $someNonTransientField.hashCode());
return result;
}
The text was updated successfully, but these errors were encountered:
mucahitkurt
changed the title
Lombok 1.16.22 @EqualsHashCode use transient field
Lombok 1.16.22 @EqualsHashCode uses transient field
Jun 26, 2018
Hello,
Lombok 1.16.22 uses both transient and non-transient fields to produce equals and hashCode methods.
I use IntelliJ 2018.1 with lombok plugin.
Lombok 1.16.22 produces;
Lombok 1.16.20 produces;
The text was updated successfully, but these errors were encountered: