Skip to content

Commit

Permalink
Merge pull request #7 from pvojtechovsky/feat-getTopDefinitions
Browse files Browse the repository at this point in the history
replace for(m:list()) by forEach(m->)
  • Loading branch information
monperrus authored Feb 15, 2018
2 parents 35cd6f1 + 6a46619 commit 6270063
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ public Collection<CtMethod<?>> getTopDefinitions() {

// first collect potential declarations of this method in the type hierarchy
ClassTypingContext context = new ClassTypingContext(this.getDeclaringType());
for (Object m : getDeclaringType().map(new AllTypeMembersFunction(CtMethod.class)).list()) {
if (m != this && context.isOverriding(this, (CtMethod<?>) m)) {
s.add((CtMethod) m);
getDeclaringType().map(new AllTypeMembersFunction(CtMethod.class)).forEach((CtMethod<?> m) -> {
if (m != this && context.isOverriding(this, m)) {
s.add(m);
}
}
});

// now removing the intermediate methods for which there exists a definition upper in the hierarchy
List<CtMethod<?>> finalMeths = new ArrayList<>(s);
Expand Down

0 comments on commit 6270063

Please sign in to comment.