zentol commented on code in PR #23491:
URL: https://github.com/apache/flink/pull/23491#discussion_r1351993174


##########
flink-architecture-tests/flink-architecture-tests-base/src/main/java/org/apache/flink/architecture/common/Predicates.java:
##########
@@ -62,40 +68,42 @@ public static DescribedPredicate<JavaClass> 
containAnyFieldsInClassHierarchyThat
     }
 
     /**
-     * Tests that the given field is {@code public static} and of the given 
type {@code clazz} .
+     * Tests that the given field is {@code public static} and has the fully 
qualified type name of
+     * {@code fqClassName}.
      *
      * <p>Attention: changing the description will add a rule into the 
stored.rules.
      */
-    public static DescribedPredicate<JavaField> arePublicStaticOfType(Class<?> 
clazz) {

Review Comment:
   Do we know whether any of these methods are also used by connector repos? 
Wondering about compile error when working against newer Flink versions.



##########
flink-architecture-tests/flink-architecture-tests-base/src/main/java/org/apache/flink/architecture/common/Predicates.java:
##########
@@ -157,6 +166,35 @@ public static <T> DescribedPredicate<T> exactlyOneOf(
                 t -> Arrays.stream(other).map(dp -> dp.test(t)).reduce(false, 
Boolean::logicalXor));
     }
 
+    /**
+     * Extracts the class name from the given fully qualified class name.
+     *
+     * <p>Example:
+     *
+     * <pre>
+     *     getClassFromFqName("com.example.MyClass");  // Returns: "MyClass"
+     * </pre>
+     */
+    public static String getClassSimpleNameFromFqName(String fqClassName) {

Review Comment:
   One thing to be careful of is what kind of fqcn you are using.
   
   Canonical names can for example contain a `$` before the simple name if you 
are dealing with an inner class. Or its the other way around that getName 
returns it; this always trips me up.



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