From 6a466199b8e864048f1b384e176152184f0c9721 Mon Sep 17 00:00:00 2001
From: Pavel Vojtechovsky
Date: Thu, 15 Feb 2018 18:43:14 +0100
Subject: [PATCH] replace for(m:list()) by forEach(m->)
---
.../spoon/support/reflect/declaration/CtMethodImpl.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java b/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java
index 4fccb2f7cc5..f67a5a48488 100644
--- a/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java
+++ b/src/main/java/spoon/support/reflect/declaration/CtMethodImpl.java
@@ -225,11 +225,11 @@ public Collection> 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> finalMeths = new ArrayList<>(s);