View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule451wheretobreak;
2   
3   /** Some javadoc. */
4   public class InputSeparatorWrap {
5     /** Some javadoc. */
6     public void goodCase() {
7       int i = 0;
8       String s = "ffffooooString";
9       s
10          .isEmpty(); // ok
11      s.isEmpty();
12  
13      foo(i,
14              s); // ok
15    }
16  
17    /** Some javadoc. */
18    public static void foo(int i, String s) {}
19  }
20  
21  // violation below 'Top-level class BadCase has to reside in its own source file.'
22  class BadCase {
23  
24    public void goodCase(int... foo) {
25      int i = 0;
26  
27      String s = "ffffooooString";
28      // violation below ''.' should be on a new line.'
29      boolean b = s.
30              isEmpty();
31      foo(i
32              , s); // violation '',' should be on the previous line.'
33      int[] j;
34    }
35  
36    public static String foo(int i, String s) {
37      String maxLength = "123";
38      int truncationLength = 1;
39      CharSequence seq = null;
40      Object truncationIndicator = null;
41      return new StringBuilder(maxLength)
42              .append(seq, 0, truncationLength)
43              .append(truncationIndicator)
44              .toString();
45    }
46  }