View Javadoc
1   /*
2   NoArrayTrailingComma
3   
4   
5   */
6   
7   package com.puppycrawl.tools.checkstyle.checks.coding.noarraytrailingcomma;
8   
9   public class InputNoArrayTrailingComma {
10  
11      int[] t1 = new int[] {
12              1,
13              2,
14              3
15      };
16  
17      int[] t2 = new int[] {
18              1,
19              2,
20              3, // violation 'Array should not contain trailing comma.'
21      };
22  
23      int[] t3 = new int[] {1,2,3};
24  
25      int[] t4 = new int[] {1,2,3,}; // violation 'Array should not contain trailing comma.'
26  
27      int[][] t5 = new int[][] {{1, 2}, {3, 3}, {5, 6}};
28  
29      // violation below 'Array should not contain trailing comma.'
30      int[][] t6 = new int[][] {{1, 2}, {3, 3}, {5, 6},};
31  
32      int[][] t7 = new int[][]
33      {
34          {1, 2},
35          {3, 3},
36          {5, 6}
37      };
38  
39      int[][] t8 = new int[][]
40      {
41          {1,
42           2},
43          {3, 3},
44          {5, 6}, // violation 'Array should not contain trailing comma.'
45      };
46  
47      int[][] t9 = new int[][] {
48              {1,2,}, // violation 'Array should not contain trailing comma.'
49              {2,3}
50      };
51  
52      int[][] t10 = new int[][] {
53              {1,
54              2,} // violation 'Array should not contain trailing comma.'
55      };
56  
57      int[][] t11 = new int[][] {
58              {1,
59              2}
60      };
61  
62      int[] t12 = new int[] {1};
63  
64      int[] t13 = new int[]{};
65  
66      int[][] t14 = new int[][]{};
67  
68      int[] t15 = new int[] {1,}; // violation 'Array should not contain trailing comma.'
69  }