Eclipse - `open call hierarchy` stop searching in lambda chain

后端 未结 2 463
悲&欢浪女
悲&欢浪女 2021-02-02 12:07

Here is my sample java code:

public class Test {

    public static void main(String[] args) {
        methodDepth0(
            ()->
                methodDe         


        
2条回答
  •  不要未来只要你来
    2021-02-02 12:19

    As the second picture clearly shows, Eclipse is able to trace the call hierarchy through the method call myIf.call() inside methodDepth0. This is correct, because the (outer) lambda implements method MyIF.call().

    The fact that the same pattern does not work in the next nesting level looks like a bug. Please consider filing a bug for JDT/UI. TIA.

    Just note, that for lambdas implementing library types like Consumer, the number of callers into accept(T) in a workspace may easily become unmanageable, similar to any call hierarchy through, e.g, Runnable.run() - but that doesn't question the general usefulness of call hierarchies through lambdas.

提交回复
热议问题