rethianita / spring-book

Class doesn't override equals from superclass JAVA-W0100
Bug risk
Major
3 occurrences in this check
User does not override equals method defined in superclass ComparableEntity
16
17@Document(collection = "users")
18@Getter @Setter
19public class User extends ComparableEntity implements UserDetails {2021  @Id22  private ObjectId id;2324  @CreatedDate25  private LocalDateTime createdAt;26  @LastModifiedDate27  private LocalDateTime modifiedAt;2829  private boolean enabled = true;3031  @Indexed(unique = true)32  private String username;33  private String password;34  @Indexed35  private String fullName;36  private Set<Role> authorities = new HashSet<>();3738  public User() {39  }4041  public User(String username, String password) {42    this.username = username;43    this.password = password;44  }4546  @Override47  public boolean isAccountNonExpired() {48    return enabled;49  }5051  @Override52  public boolean isAccountNonLocked() {53    return enabled;54  }5556  @Override57  public boolean isCredentialsNonExpired() {58    return enabled;59  }60}
Book does not override equals method defined in superclass ComparableEntity
17
18@Document(collection = "books")
19@Getter @Setter
20public class Book extends ComparableEntity {2122  @Id23  private ObjectId id;2425  @CreatedBy26  private ObjectId creatorId;27  @LastModifiedBy28  private ObjectId modifierId;2930  @CreatedDate31  private LocalDateTime createdAt;32  @LastModifiedDate33  private LocalDateTime modifiedAt;3435  private String title;36  private String about;37  private String language;38  private Set<String> genres = new HashSet<>();39  private String isbn13;40  private String isbn10;41  private String publisher;42  private LocalDate publishDate;43  private int hardcover;4445  private Set<ObjectId> authorIds = new HashSet<>();4647}
Author does not override equals method defined in superclass ComparableEntity
16
17@Document(collection = "authors")
18@Getter @Setter
19public class Author extends ComparableEntity {2021  @Id22  private ObjectId id;2324  @CreatedBy25  private ObjectId creatorId;26  @LastModifiedBy27  private ObjectId modifierId;2829  @CreatedDate30  private LocalDateTime createdAt;31  @LastModifiedDate32  private LocalDateTime modifiedAt;3334  private String fullName;35  private String about;36  private String nationality;37  private Set<String> genres = new HashSet<>();3839  private Set<ObjectId> bookIds = new HashSet<>();4041}