View Javadoc
1   /*
2   NoWhitespaceAfter
3   allowLineBreaks = (default)true
4   tokens = ARRAY_DECLARATOR,INDEX_OP
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;
10  
11  public class InputNoWhitespaceAfterArrayDeclarations
12  {
13      Object[] someStuff = {}; //Correct
14      Object [] someStuff1 = {}; // violation
15      Object someStuff2[] = {}; //Correct
16      Object someStuff3 [] = {}; // violation
17      int [] a = {}; // violation
18      String s [] = {}; // violation
19      double d [] = {}; // violation
20      char[] c = {}; //Correct
21      short sh[] = {}; //Correct
22      long[] l = {}; //Correct
23      byte b[] = {}; //Correct
24      int get() [] { // violation
25          return a;}
26      int [] receive() { return a; } // violation
27      int get1(int k, int c, int b) [] { // violation
28          return null;
29      }
30      private String[] getLines() { //Correct
31          return new String[] { //Correct
32                  "s"
33          };
34      }
35      String aOptions[][]; //Correct
36      int [][][] abc; // violation
37      int cba [][][]; // violation
38      private String[][][] getSeveralLines() { //Correct
39          return new String [][][] { // violation
40                  new String [][] { // violation
41                          new String[] { //Correct
42                                  "s"
43                          }
44                  }
45          };
46      }
47      int ar [] = new int [] {1, 2}; // 2 violations
48      private int [][][] getMultiArray() { // violation
49          return null;
50      }
51      private long getLongMultiArray(int someParam, String value) [][][] { // violation
52          return null;
53      }
54      int aa = new int[]{1}[0];//Correct
55      int bb = new int[]{1} [0]; // violation
56      int aaa = new int[][]{{1},{2}}[0][0];//Correct
57      int bbb = new int [][]{{1},{2}}[0][0]; // violation
58      int ccc = new int[] []{{1},{2}}[0][0]; // violation
59      int ddd = new int[][]{{1},{2}} [0][0]; // violation
60      int eee = new int[][]{{1},{2}}[0] [0]; // violation
61      int in1 = new int[][]{{1},{2}}[ 0][0];//Correct
62      int in2 = new int[][]{{1},{2}}[0 ][0];//Correct
63      int in3 = new int[][]{{1},{2}}[0][ 0];//Correct
64      int in4 = new int[][]{{1},{2}}[0][0 ];//Correct
65  }