izzyacademy commented on a change in pull request #10926: URL: https://github.com/apache/kafka/pull/10926#discussion_r660952604
########## File path: streams/src/main/java/org/apache/kafka/streams/kstream/SessionWindows.java ########## @@ -108,13 +147,12 @@ public static SessionWindows with(final Duration inactivityGap) { * @param afterWindowEnd The grace period to admit out-of-order events to a window. * @return this updated builder * @throws IllegalArgumentException if the {@code afterWindowEnd} is negative of can't be represented as {@code long milliseconds} + * @deprecated since 3.0 Use {@link #ofInactivityGapAndGrace(Duration, Duration)} instead */ + @Deprecated public SessionWindows grace(final Duration afterWindowEnd) throws IllegalArgumentException { final String msgPrefix = prepareMillisCheckFailMsgPrefix(afterWindowEnd, "afterWindowEnd"); final long afterWindowEndMs = validateMillisecondDuration(afterWindowEnd, msgPrefix); - if (afterWindowEndMs < 0) { - throw new IllegalArgumentException("Grace period must not be negative."); - } Review comment: Thanks for this feedback @showuon I have updated the code to share/reuse constructors. I think @ableegoldman will like that as well. -- 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