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