View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ArrayTrailingComma">
5           <property name="alwaysDemandTrailingComma" value="true"/>
6       </module>
7     </module>
8   </module>
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.coding.arraytrailingcomma;
12  
13  // xdoc section -- start
14  public class Example2 {
15    int[] numbers = {1, 2, 3}; // violation
16    boolean[] bools = {
17      true,
18      true,
19      false // violation
20    };
21  
22    String[][] text = {{},{},};
23  
24    double[][] decimals = {
25      {0.5, 2.3, 1.1,},
26      {1.7, 1.9, 0.6}, // violation
27      {0.8, 7.4, 6.5,} // violation
28    };
29  
30    char[] chars = {'a', 'b', 'c'  // violation
31    };
32  
33    String[] letters = {
34      "a", "b", "c"}; // violation
35  
36    int[] a1 = new int[]{
37      1,
38      2
39      ,
40    };
41  
42    int[] a2 = new int[]{
43      1,
44      2
45      ,};
46  }
47  // xdoc section -- end
48  
49  
50  
51  
52  
53