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


##########
flink-architecture-tests/flink-architecture-tests-production/src/main/java/org/apache/flink/architecture/rules/ConnectorRules.java:
##########
@@ -41,16 +39,14 @@ public class ConnectorRules {
         "org.apache.flink.connector..", 
"org.apache.flink.streaming.connectors.."
     };
 
-    private static DescribedPredicate<JavaClass> 
areNotPublicAndResideOutsideOfPackages(
-            String... packageIdentifiers) {
-        return JavaClass.Predicates.resideOutsideOfPackages(packageIdentifiers)
-                .and(
-                        not(areDirectlyAnnotatedWithAtLeastOneOf(
-                                        Public.class, PublicEvolving.class))
-                                .and(not(modifier(PUBLIC))))
+    private static DescribedPredicate<JavaClass>
+            
areFlinkClassesThatResideOutsideOfConnectorPackagesAndAreNotPublic() {
+        return JavaClass.Predicates.resideInAPackage("org.apache.flink..")
+                
.and(JavaClass.Predicates.resideOutsideOfPackages(CONNECTOR_PACKAGES))
+                .and(not(areDirectlyAnnotatedWithAtLeastOneOf(Public.class, 
PublicEvolving.class)))

Review Comment:
   We should _somehow_ replicate the logic of also checking the outer class for 
annotations; right now this creates a lot of false-positives.
   
   Similar to what we do for method checks:
   ```
                               .areDeclaredInClassesThat(
                                       areJavaClasses()
                                               .and(
                                                       
areDirectlyAnnotatedWithAtLeastOneOf(
                                                               
PublicEvolving.class)))
   ```
   
   Not sure yet how to express this properly in archunit.



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