View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ExplicitInitialization">
5         <property name="onlyObjectReferences" value="true"/>
6       </module>
7     </module>
8   </module>
9   */
10  package com.puppycrawl.tools.checkstyle.checks.coding.explicitinitialization;
11  
12  // xdoc section -- start
13  public class Example2 {
14    private int intField1 = 0; // ignored
15    private int intField2 = 1;
16    private int intField3;
17  
18    private char charField1 = '\0'; // ignored
19    private char charField2 = 'b';
20    private char charField3;
21  
22    private boolean boolField1 = false; // ignored
23    private boolean boolField2 = true;
24    private boolean boolField3;
25  
26    private Object objField1 = null; // violation
27    private Object objField2 = new Object();
28    private Object objField3;
29  
30    private int arrField1[] = null; // violation
31    private int arrField2[] = new int[10];
32    private int arrField3[];
33  }
34  // xdoc section -- end