简体   繁体   English

IntelliJ IDEA (java) 中的流式调试

[英]Stream Debug in IntelliJ IDEA (java)

I have this code with Stream I want to debug.我有我想调试的 Stream 代码。 I run Debug mode and Click the Trace Current Stream Chain button in the Debug tool window Then the Stream trace window opens, though I have an Internal error instead of evaluated results.我运行调试模式并单击调试工具窗口中的跟踪当前流链按钮然后流跟踪窗口打开,尽管我有一个内部错误而不是评估结果。

(Community Edition 2020.3) (社区版 2020.3)

public class Main {公共类主要{

public static void main(String... args) throws IOException {

    String input = "Speedment";

    String result = Stream.of(input.split(""))
            .map(s -> s.charAt(0))
            .sorted()
            .limit(5)
            .map(String::valueOf)
            .collect(joining());
    System.out.println(result);
}

} }

I pressed Flat mode button and it works!我按下了平面模式按钮,它起作用了!

The reason is that there are too many operations in stream and memory of notebook is not sufficient.原因是stream中的操作太多,notebook的内存不够。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM