小编ACB*_*ngo的帖子

如何在vscode中插入当前日期时间?

有谁知道我可以通过片段在视觉工作室代码中插入当前日期和时间的方式?

我看过文档,但没有得到任何有关它的信息.

我想创建一个这样的片段:

title: theFileTitle
date: 2016-08-05 09:44:16
Run Code Online (Sandbox Code Playgroud)

visual-studio-code

24
推荐指数
4
解决办法
1万
查看次数

Why when I don't use the "lambda method reference" code style in static block will cause deadlock?

PS: Sorry for my poor english.I can't describe the problem clearly. :(

When I don't use the "lambda method reference" code style in the static block, like:

static{
map.keySet().parallelStream().forEach(e -> {
            System.out.println(e);
        });
}
Run Code Online (Sandbox Code Playgroud)

then the program running forever, never stop.

But when I change the code to

static{
map.keySet().parallelStream().forEach(System.out::println);
}
Run Code Online (Sandbox Code Playgroud)

然后该错误消失了。该程序可以立即完成。

请直接看一下代码,我已经尽力简化了代码。

public class BugSimulate {

    static {
        init();
    }

    private static void init() {
        Map<Integer, String> map = new HashMap<>();

        int i = 0;
        map.put(++i, "1");
        map.put(++i, "1"); …
Run Code Online (Sandbox Code Playgroud)

java lambda jvm jvm-crash java-8

2
推荐指数
1
解决办法
94
查看次数

标签 统计

java ×1

java-8 ×1

jvm ×1

jvm-crash ×1

lambda ×1

visual-studio-code ×1