zentol commented on a change in pull request #17914:
URL: https://github.com/apache/flink/pull/17914#discussion_r756964259
##########
File path:
flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
##########
@@ -153,14 +153,20 @@
@Override
public boolean apply(JavaMethodCall
call) {
final JavaClass targetOwner =
call.getTargetOwner();
- if
(call.getOriginOwner().equals(targetOwner)) {
+ final JavaClass originOwner =
call.getOriginOwner();
+ if
(originOwner.equals(targetOwner)) {
return false;
}
- if
(call.getOriginOwner().isInnerClass()
- && call.getOriginOwner()
-
.getEnclosingClass()
-
.map(targetOwner::equals)
- .orElse(false)) {
+ if (originOwner
+ .getEnclosingClass()
+ .map(targetOwner::equals)
+ .orElse(false)) {
+ return false;
+ }
+ if (targetOwner
Review comment:
Initially this also checked `isInnerClass()`, but then no violation was
removed. Seems like this only returns true if the class is not static, which
was a bit surprising.
--
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]