mjsax commented on code in PR #14596: URL: https://github.com/apache/kafka/pull/14596#discussion_r1387465423
########## streams/src/main/java/org/apache/kafka/streams/query/VersionedKeyQuery.java: ########## @@ -35,32 +35,33 @@ public final class VersionedKeyQuery<K, V> implements Query<VersionedRecord<V>> private final Optional<Instant> asOfTimestamp; private VersionedKeyQuery(final K key, final Optional<Instant> asOfTimestamp) { - this.key = Objects.requireNonNull(key); + this.key = key; this.asOfTimestamp = asOfTimestamp; } /** * Creates a query that will retrieve the record from a versioned state store identified by {@code key} if it exists * (or {@code null} otherwise). - * <P> + * <p> * While the query by default returns the latest value of the specified {@code key}, setting * the {@code asOfTimestamp} (by calling the {@link #asOf(Instant)} method), makes the query - * to return the value associated to the specified {@code asOfTimestamp} + * to return the value associated to the specified {@code asOfTimestamp}. * * @param key The key to retrieve * @param <K> The type of the key * @param <V> The type of the value that will be retrieved * @throws NullPointerException if {@code key} is null */ public static <K, V> VersionedKeyQuery<K, V> withKey(final K key) { + Objects.requireNonNull(key, "Key can not be null."); Review Comment: I just realize that we don't have an error message in the equivalent check inside `asOf(...)` below. We should add one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org