1
2
3
4
5
6
7
8 package com.puppycrawl.tools.checkstyle.checks.coding.onestatementperline;
9
10 import java.io.BufferedReader;
11 import java.io.FileReader;
12 import java.io.IOException;
13 import java.io.PipedOutputStream;
14 import java.io.OutputStream;
15
16 public class InputOneStatementPerLineBeginTreeTest {
17
18 void testNestedInLambda() {
19 Runnable r = () -> {
20 try (OutputStream s1 = new PipedOutputStream();
21 OutputStream s2 = new PipedOutputStream();) {
22 }
23 catch (IOException e) {
24 }
25 };
26 }
27
28 public void doLegalForLoop() {
29 for (int i = 0; i < 20; i++) {
30 }
31 }
32
33 private void foo4() {
34 for(int n = 0,
35 k = 1
36 ; n<5
37 ; ) { int a = 5,
38 b = 2;}
39 }
40
41 }