mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use StreamEx.ofTree
This commit is contained in:
@@ -510,10 +510,6 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
|
||||
private static void processSubTypes(ReferenceType classType, Consumer<ReferenceType> consumer) {
|
||||
MultiMap<ReferenceType, ReferenceType> inheritance = new MultiMap<>();
|
||||
classType.virtualMachine().allClasses().forEach(type -> supertypes(type).forEach(st -> inheritance.putValue(st, type)));
|
||||
subtypes(classType, inheritance).forEach(consumer);
|
||||
}
|
||||
|
||||
private static Stream<ReferenceType> subtypes(ReferenceType type, MultiMap<ReferenceType, ReferenceType> inheritance) {
|
||||
return StreamEx.of(type).append(StreamEx.of(inheritance.get(type)).flatMap(t -> subtypes(t, inheritance)));
|
||||
StreamEx.ofTree(classType, t -> StreamEx.of(inheritance.get(t))).forEach(consumer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user