1
2
3
4
5
6
7
8 package com.puppycrawl.tools.checkstyle.checks.coding.arraytrailingcomma;
9
10 public class InputArrayTrailingCommaAlwaysDemandTrailingComma {
11 public int[] test() {
12 if (true) {
13 return new int[]{0,};
14 }
15 return new int[]{0};
16 }
17
18 public int[] test2() {
19 if (true) {
20 return new int[]{0, 1,};
21 }
22 return new int[]{0, 1};
23 }
24
25 public void test3() {
26 int[] a = new int[]
27 {0};
28 int[] b = new int[]
29 {0, 1};
30 int[] c = new int[]
31 {0, 1,
32 2, 3
33 };
34 int[] d = new int[]
35 {
36 1,
37 2,
38 3
39 };
40 int[] e = new int[]
41 {
42 1,
43 5,
44 6,
45 };
46 int[] f = {1,
47 2
48 };
49 int[] g = {1,
50 2,
51 };
52 int[][] empty2d = {{}};
53 int[][] multiDimensionalArray = {
54 {1, 2},
55 {1,},
56 {3, 2, 1,}
57 };
58 }
59 }