parent
acfa6b7b5b
commit
a549db6035
|
|
@ -36,6 +36,7 @@ import java.time.Instant;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
|
@ -155,7 +156,9 @@ public class DomainsApi {
|
|||
|
||||
boolean updated = false;
|
||||
|
||||
if (!domainData.getDescription().equals(domain.getDescription())) {
|
||||
if (!Objects.equals(
|
||||
domainData.getDescription(), domain.getDescription()
|
||||
)) {
|
||||
domain.setDescription(domainData.getDescription());
|
||||
updated = true;
|
||||
}
|
||||
|
|
@ -163,7 +166,7 @@ public class DomainsApi {
|
|||
final String domainReleased = DateTimeFormatter.ISO_DATE_TIME.format(
|
||||
domain.getReleased().toInstant()
|
||||
);
|
||||
if (!domainData.getReleased().equals(domainReleased)) {
|
||||
if (!Objects.equals(domainData.getReleased(), domainReleased)) {
|
||||
final TemporalAccessor released = DateTimeFormatter.ISO_DATE_TIME
|
||||
.parse(domainData.getReleased());
|
||||
final Instant relasedInstant = Instant.from(released);
|
||||
|
|
@ -171,12 +174,12 @@ public class DomainsApi {
|
|||
updated = true;
|
||||
}
|
||||
|
||||
if (!domainData.getTitle().equals(domain.getTitle())) {
|
||||
if (!Objects.equals(domainData.getTitle(), domain.getTitle())) {
|
||||
domain.setTitle(domainData.getTitle());
|
||||
updated = true;
|
||||
}
|
||||
|
||||
if (!domainData.getVersion().equals(domain.getVersion())) {
|
||||
if (!Objects.equals(domainData.getVersion(), domain.getVersion())) {
|
||||
domain.setVersion(domainData.getVersion());
|
||||
updated = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import org.libreccm.api.admin.security.dto.PartyRoleMembership;
|
|||
import org.libreccm.api.dto.ListView;
|
||||
import org.libreccm.core.CoreConstants;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
|
@ -53,6 +52,7 @@ import org.libreccm.security.User;
|
|||
import org.libreccm.security.UserManager;
|
||||
import org.libreccm.security.UserRepository;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.ws.rs.core.Context;
|
||||
|
|
@ -258,14 +258,12 @@ public class UsersApi {
|
|||
final User user = repository.findUser(userIdentifier);
|
||||
|
||||
boolean updated = false;
|
||||
if (userData.getFamilyName() != null
|
||||
&& !userData.getFamilyName().equals(user.getFamilyName())) {
|
||||
if (!Objects.equals(userData.getFamilyName(), user.getFamilyName())) {
|
||||
user.setFamilyName(userData.getFamilyName());
|
||||
updated = true;
|
||||
}
|
||||
|
||||
if (userData.getGivenName() != null
|
||||
&& !userData.getGivenName().equals(user.getGivenName())) {
|
||||
if (!Objects.equals(userData.getGivenName(), user.getGivenName())) {
|
||||
user.setGivenName(userData.getGivenName());
|
||||
updated = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue