muralibasani commented on code in PR #24326:
URL: https://github.com/apache/kafka/pull/24326#discussion_r4701116523


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/StoreMethodSignatures.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams.state.internals;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * Reflection helpers shared by the store completeness tests (KAFKA-20328).
+ * <p>
+ * A wrapper (adapter or decorator) that does not override a store interface 
method falls back to the
+ * interface default, which cannot reach the wrapped store: it either throws
+ * {@link UnsupportedOperationException} (e.g. {@code 
WindowStore#backwardFetch}) or silently stops
+ * delegating (e.g. {@code readOnly} returning {@code this}). Completeness 
tests use these helpers to
+ * turn such a dropped override into a test failure instead of a bug found by 
manual testing.
+ * <p>
+ * Signatures use erased parameter types, so a key ({@code K}) or value 
({@code V}) appears as
+ * {@code Object}.
+ */
+public final class StoreMethodSignatures {
+
+    private StoreMethodSignatures() {
+    }
+
+    /** Public, non-static, non-synthetic methods of {@code type}, including 
inherited ones. */
+    public static Stream<Method> instanceMethods(final Class<?> type) {
+        return Arrays.stream(type.getMethods())

Review Comment:
   I think getMethods() is not an issue here, when class is an interface. The 
javadoc says so: "If this Class object represents an interface then the 
returned array does not contain any implicitly declared methods from Object"



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to