View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule451wheretobreak;
2   
3   /** Some javadoc. */
4   public class InputFormattedSeparatorWrapComma {
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 ExtraBadCaseComma has to reside in its own source file.'
20  class ExtraBadCaseComma {
21  
22    /** Some javadoc. */
23    public void goodCase(int... foo) {
24      int i = 0;
25  
26      String s = "ffffooooString";
27      boolean b = s.isEmpty();
28      foo(i, s);
29      int[] j;
30    }
31  
32    /** Some javadoc. */
33    public static String foo(int i, String s) {
34      String maxLength = "123";
35      int truncationLength = 1;
36      CharSequence seq = null;
37      Object truncationIndicator = null;
38      return new StringBuilder(maxLength)
39          .append(seq, 0, truncationLength)
40          .append(truncationIndicator)
41          .toString();
42    }
43  }