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