View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.coding.explicitinitialization;
2   
3   public class InputExplicitInitialization {
4       private int x = 0;
5       private Object bar = /* comment test */null;
6       private int y = 1;
7       private long y1 = 1 - 1;
8       private long y3;
9       private long y4 = 0L;
10      private boolean b1 = false;
11      private boolean b2 = true;
12      private boolean b3;
13      private String str = "";
14      java.lang.String str1 = null, str3 = null;
15      int ar1[] = null;
16      int ar2[] = new int[1];
17      int ar3[];
18      float f1 = 0f;
19      double d1 = 0.0;
20  
21      static char ch;
22      static char ch1 = 0;
23      static char ch2 = '\0';
24      static char ch3 = '\1';
25  
26      void method() {
27          int xx = 0;
28          String s = null;
29      }
30  }
31  
32  interface interface1{
33      int TOKEN_first = 0x00;
34      int TOKEN_second = 0x01;
35      int TOKEN_third = 0x02;
36  }
37  
38  class InputExplicitInit2 {
39      private Bar<String> bar = null;
40      private Bar<String>[] barArray = null;
41  }
42  
43  enum InputExplicitInit3 {
44      A,
45      B
46      {
47          private int x = 0;
48          private Bar<String> bar = null;
49          private Bar<String>[] barArray = null;
50          private int y = 1;
51      };
52      private int x = 0;
53      private Bar<String> bar = null;
54      private Bar<String>[] barArray = null;
55      private int y = 1;
56  }
57  
58  @interface annotation1{
59      int TOKEN_first = 0x00;
60      int TOKEN_second = 0x01;
61      int TOKEN_third = 0x02;
62  }
63  
64  class ForEach {
65      public ForEach(java.util.Collection<String> strings)
66      {
67          for(String s : strings) //this should not even be checked
68          {
69  
70          }
71      }
72  }
73  
74  class Bar<T> {
75  }
76  
77  class Chars {
78      char a;
79      char b = a;
80      byte c = 1;
81      short d = 1;
82      final long e = 0; 
83  }