View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule451wheretobreak;
2   
3   /** Some javadoc. */
4   public class InputSeparatorWrapComma {
5     /** Some javadoc. */
6     public void goodCase() {
7       int i = 0;
8       String s = "ffffooooString";
9       s.isEmpty(); // ok
10      s.isEmpty();
11  
12      foo(i, s); // ok
13    }
14  
15    /** Some javadoc. */
16    public static void foo(int i, String s) {}
17  }
18  
19  // violation below 'Top-level class BadCaseComma has to reside in its own source file.'
20  class BadCaseComma {
21  
22    /** Some javadoc. */
23    public void goodCase(int... foo) {
24      int i = 0;
25  
26      String s = "ffffooooString";
27      // violation below ''.' should be on a new line.'
28      boolean b = s.
29              isEmpty();
30      foo(i
31              , s); // violation '',' should be on the previous line.'
32      int[] j;
33    }
34  
35    /** Some javadoc. */
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  }