aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForTestDot.java
blob: 60ba345715d0196e8f72f317ed1a16a259fa9bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.puppycrawl.tools.checkstyle.checks.whitespace.separatorwrap;

public class InputSeparatorWrapForTestDot<T extends FooForTestDot
        & BarForTestDot> {
    public void goodCase() throws FooExceptionForTestDot, BarExceptionForTestDot
    {
        int i = 0;
        String s = "ffffooooString";
        s
                .isEmpty(); //good wrapping
        s.isEmpty();
        try {
            foo(i, s);
        } catch (FooExceptionForTestDot |
                BarExceptionForTestDot e) {}
        foo(i,
                s); //good wrapping
    }
    public static void foo(int i, String s) throws FooExceptionForTestDot, BarExceptionForTestDot
    {

    }
}

class badCaseForTestDot<T extends FooForTestDot &  BarForTestDot> {


    public void goodCaseForTestDot(int... aFoo) throws FooExceptionForTestDot, BarExceptionForTestDot
    {
        String s = "ffffooooString";
        s.
                isEmpty(); //bad wrapping
        try {
            foo(1, s);
        } catch (FooExceptionForTestDot
                | BarExceptionForTestDot e) {}

        foo(1
                ,s);  //bad wrapping
        int[] i;
    }
    public static String foo(int i, String s) throws FooExceptionForTestDot, BarExceptionForTestDot
    {
        return new StringBuilder("")
                .append("", 0, 1)
                .append("")
                .toString();
    }
}

interface FooForTestDot {

}

interface BarForTestDot {

}

class FooExceptionForTestDot extends Exception {

}

class BarExceptionForTestDot extends Exception {

}