Skip to content

Commit

Permalink
releng: fix Sonarcloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kwin committed Oct 5, 2023
1 parent a7217e2 commit 66b193b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import javax.jcr.RepositoryException;

import org.apache.jackrabbit.spi.Name;
import org.apache.jackrabbit.vault.util.DocViewNode2;
import org.apache.jackrabbit.vault.util.DocViewProperty2;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -80,7 +81,7 @@ public Calendar getLastReplicationDate(boolean allowNullReturnValue) {
}
});
if (!allowNullReturnValue && !lastReplicationDate.isPresent()) {
throw new IllegalStateException("No replication property found with name " + property.getName());
throw new IllegalStateException("No replication property found with name " + Optional.ofNullable(property).map(DocViewProperty2::getName).map(Name::toString).orElse("?"));
}
return lastReplicationDate.orElse(null);
}
Expand All @@ -93,7 +94,7 @@ public ReplicationActionType getLastReplicationAction(boolean allowNullReturnVal
.flatMap(DocViewProperty2::getStringValue)
.map(ReplicationActionType::fromName);
if (!allowNullReturnValue && !replicationActionType.isPresent()) {
throw new IllegalStateException("No replication property found with name " + property.getName());
throw new IllegalStateException("No replication property found with name " + Optional.ofNullable(property).map(DocViewProperty2::getName).map(Name::toString).orElse("?"));
}
return replicationActionType.orElse(null);
}
Expand Down

0 comments on commit 66b193b

Please sign in to comment.