echauchot commented on code in PR #22667:
URL: https://github.com/apache/flink/pull/22667#discussion_r1206798251
##########
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..")
Review Comment:
Added flink packages filter otherwise all classes (JDK, deps ...) could
match the rule
##########
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))))
Review Comment:
this predicate was always false as the tested class cannot depend on classes
outside of its package if these classes are not in public visibility. As a
consequence, the rule was never matching any class.
--
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]