Skip to content

Commit

Permalink
refactor: use new CtMethod#isOverriding - simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
pvojtechovsky committed Apr 30, 2017
1 parent f8ba46e commit 3cfb781
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public OverriddenMethodFilter(CtMethod<?> method) {
public boolean matches(CtMethod<?> element) {
final CtType expectedParent = method.getParent(CtType.class);
final CtType<?> currentParent = element.getParent(CtType.class);
return expectedParent.isSubtypeOf(currentParent.getReference()) //
&& !currentParent.equals(expectedParent) //
&& method.getReference().isOverriding(element.getReference());
return !currentParent.equals(expectedParent) //
&& method.isOverriding(element);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public OverridingMethodFilter(CtMethod<?> method) {
public boolean matches(CtMethod<?> element) {
final CtType expectedParent = method.getParent(CtType.class);
final CtType<?> currentParent = element.getParent(CtType.class);
return currentParent.isSubtypeOf(expectedParent.getReference()) //
&& !currentParent.equals(expectedParent) //
&& element.getReference().isOverriding(method.getReference());
return !currentParent.equals(expectedParent) //
&& element.isOverriding(method);
}
}

0 comments on commit 3cfb781

Please sign in to comment.