Skip to content

Commit

Permalink
Refactor user construtor to fix max method length checkstyle warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslow committed Sep 30, 2024
1 parent 9740e2b commit ce6849e
Showing 1 changed file with 4 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,10 @@ public User(User user) {
this.defaultGalleryViewMode = user.defaultGalleryViewMode;
this.showPhysicalPageNumberBelowThumbnail = user.showPhysicalPageNumberBelowThumbnail;

if (user.roles != null) {
this.roles = user.roles;
} else {
this.roles = new ArrayList<>();
}

if (Objects.isNull(user.projects)) {
this.projects = new ArrayList<>();
} else {
this.projects = user.projects;
}

if (Objects.isNull(user.clients)) {
this.clients = new ArrayList<>();
} else {
this.clients = user.clients;
}

if (Objects.isNull(user.filters)) {
this.filters = new ArrayList<>();
} else {
this.filters = user.filters;
}
this.roles = Objects.isNull(user.roles) ? new ArrayList<>() : user.roles;
this.projects = Objects.isNull(user.projects) ? new ArrayList<>() : user.projects;
this.clients = Objects.isNull(user.clients) ? new ArrayList<>() : user.clients;
this.filters = Objects.isNull(user.filters) ? new ArrayList<>() : user.filters;

if (Objects.nonNull(user.tableSize)) {
this.tableSize = user.tableSize;
Expand Down

0 comments on commit ce6849e

Please sign in to comment.