View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule4832nocstylearray;
2   
3   /**
4    * Test case for ArrayTypeStyle (Java vs C)
5    **/
6   public class InputArrayTypeStyle
7   {
8       private int[] javaStyle = new int[0];
9       private int cStyle[] = new int[0]; //warn
10  
11      public static void mainJava(String[] aJavaStyle) //ok
12      {
13      }
14  
15      public static void mainC(String aCStyle[]) //warn
16      {
17          final int[] blah = new int[0]; //ok
18          final boolean isOK1 = aCStyle instanceof String[]; //ok
19          final boolean isOK2 = aCStyle instanceof java.lang.String[]; //ok
20          final boolean isOK3 = blah instanceof int[]; //ok
21          int[] array[] = new int [2][2]; //warn
22          int array2[][][] = new int[3][3][3]; //warn
23      }
24  
25      public class Test
26      {
27          public Test[]
28              variable; //ok
29  
30          public Test[]
31              getTests()
32          {
33              return null;
34          }
35  
36          public Test[] getNewTest() //ok
37          {
38              return null;
39          }
40  
41          public Test getOldTest()[] //warn
42          {
43              return null;
44          }
45  
46          public Test getOldTests()[][] //warn
47          {
48              return null;
49          }
50  
51          public Test[]
52              getMoreTests()[] //warn
53          {
54              return null;
55          }
56  
57          public Test[][] getTests2() //ok
58          {
59              return null;
60          }
61      }
62      int[] array[] = new int [2][2]; //warn
63      int array2[][][] = new int[3][3][3]; //warn
64  }