View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.whitespace.whitespacearound;
2   
3   public class InputWhitespaceAroundArrayInitialization {
4       
5       public void arrayInitTest() {
6           
7           final int[] COLORS = new int[]{5 }; // missing WS before "{"
8           
9           final int[] COLORS1 = new int[] {5 }; // valid
10          
11          final String[][] COLORS2 = {{"Green"}, {"Red"}}; //missing WS before inner array
12          
13          final String[][] COLORS21 = { {"Green", "Red"},{"White"} }; //missing WS between "," and "{"
14          
15          final String[][] COLORS22 = { {"White", "Yellow"}, {"Pink"} }; //valid
16          
17          final String[][][] COLORS31 = { { {"Black", "Blue"}, {"Gray", "White"}},
18          		                       { {"Green", "Brown", "Magneta"}},
19          		                       { {"Red", "Purple", "Violet"}} }; //valid
20          
21          final String[][][] COLORS32 = { {{"Red", "Green"},{"Pink"}} }; //missing WS before "{"Red"" and ",{"Pink""
22         
23          final String[][][] COLORS33 = {{{"White"}}}; //missing WS before "{"
24          
25          final String[][][][] COLORS41 = { { { {"Orange"}, {"Green"}}, { {"Purple"}}}, { { {"Yellow"}}} }; //valid
26          
27          final String[][][][] COLORS42 = { { {{"White", "Blue"}, //missing WS between "{"
28                                               {"Gray", "Black"},},},
29                                               { { {"Red"}}}};
30  
31      }
32  
33  }