soarez commented on a change in pull request #9000:
URL: https://github.com/apache/kafka/pull/9000#discussion_r516680210



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/kstream/ValueTransformerSupplier.java
##########
@@ -33,12 +38,17 @@
  * @see TransformerSupplier
  * @see KStream#transform(TransformerSupplier, String...)
  */
-public interface ValueTransformerSupplier<V, VR> extends 
ConnectedStoreProvider {
+public interface ValueTransformerSupplier<V, VR> extends 
ConnectedStoreProvider, Supplier<ValueTransformer<V, VR>> {

Review comment:
       Indeed, that was why. Since it already conforms to the interface, I 
didn't realize this would be a public API change. Will revert and overload 
`checkSupplier` instead.

##########
File path: 
streams/src/main/java/org/apache/kafka/streams/internals/ApiUtils.java
##########
@@ -75,4 +81,31 @@ public static long validateMillisecondInstant(final Instant 
instant, final Strin
     public static String prepareMillisCheckFailMsgPrefix(final Object value, 
final String name) {
         return format(MILLISECOND_VALIDATION_FAIL_MSG_FRMT, name, value);
     }
+
+    /**
+     * @throws IllegalArgumentException if the same instance is obtained each 
time
+     */
+    public static void checkSupplier(final Supplier<?> supplier) {
+        if (supplier.get() == supplier.get()) {
+            final String supplierClass = 
getAllImplementedInterfaces(supplier.getClass()).stream()

Review comment:
       We don't _really_ need to. I thought it could make for a better, and 
also predictable, error message. But maybe just using the implementing class 
name is fine.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to