1
2
3
4
5
6
7
8
9
10
11 package com.puppycrawl.tools.checkstyle.checks.coding.onestatementperline;
12
13
14 import java.io.IOException;
15 import java.io.OutputStream;
16 import java.io.PipedOutputStream;
17 import java.io.Reader;
18 import java.io.PipedReader;
19 import java.io.BufferedReader; import java.io.EOFException;
20
21
22 public class Example2 {
23 public void method1() {
24 int var1; int var2;
25 var1 = 1; var2 = 2;
26 }
27
28 public void method2() {
29 int var2;
30
31 Object obj1 = new Object(); Object obj2 = new Object();
32 int var1 = 1
33 ; var2 = 2;
34 int o = 1, p = 2
35 , r = 5; int t;
36 }
37
38 public void method3() throws IOException {
39 final OutputStream s1 = new PipedOutputStream();
40 final OutputStream s2 = new PipedOutputStream();
41 try (s1; s2; OutputStream s3 = new PipedOutputStream()) {
42 }
43
44 try (Reader r = new PipedReader(); s2; Reader s3 = new PipedReader()) {
45 }
46 }
47 }
48