1
2
3
4
5
6
7
8
9
10 package com.puppycrawl.tools.checkstyle.checks.blocks.needbraces;
11
12 public class InputNeedBracesTestNotAllowSingleLineLambda {
13
14
15 static Runnable r1 = ()->String.CASE_INSENSITIVE_ORDER.equals("Hello world one!");
16
17 static Runnable r2 = () -> String.CASE_INSENSITIVE_ORDER.equals("Hello world two!");
18 static Runnable r3 = () ->
19 String.CASE_INSENSITIVE_ORDER.equals("Hello world two!");
20 static Runnable r4 = () -> {String.CASE_INSENSITIVE_ORDER.equals("Hello world two!");};
21 Runnable r5 = () -> java.util.Objects.hash(1, 2,
22 3,4);
23 Runnable r6 = () -> {java.util.Objects.hash(1, 2,
24 3,4);};
25 {
26
27 java.util.concurrent.CompletableFuture.runAsync(() -> System.out.println(
28 (Runnable) () -> System.out.println(
29 123)));
30 }
31 {
32 java.util.concurrent.CompletableFuture.runAsync(() -> {System.out.println(
33 (Runnable) () -> {System.out.println(
34 123);});});
35 }
36 }