Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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");
- map.put(++i, "1");
- map.put(++i, "1");
- map.put(++i, "1");
- map.put(++i, "1");
- map.put(++i, "1");
- map.put(++i, "1");
- map.put(++i, "1");
- // stuck
- map.keySet().parallelStream().forEach(e -> {
- System.out.println(e);
- });
- // no stuck
- // map.keySet().parallelStream().forEach(System.out::println);
- }
- @Test
- public void test() {
- new BugSimulate();
- }
- }
- e -> {System.out.println(e);}
- System.out::println
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement