1   ////////////////////////////////////////////////////////////////////////////////
2   // checkstyle: Checks Java source code for adherence to a set of rules.
3   // Copyright (C) 2001-2014  Oliver Burn
4   //
5   // This library is free software; you can redistribute it and/or
6   // modify it under the terms of the GNU Lesser General Public
7   // License as published by the Free Software Foundation; either
8   // version 2.1 of the License, or (at your option) any later version.
9   //
10  // This library is distributed in the hope that it will be useful,
11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  // Lesser General Public License for more details.
14  //
15  // You should have received a copy of the GNU Lesser General Public
16  // License along with this library; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  ////////////////////////////////////////////////////////////////////////////////
19  package com.google.checkstyle.test.chapter4formatting.rule461verticalwhitespace; //warn
20  import java.io.Serializable; //warn
21  import java.util.ArrayList;
22  import java.util.HashMap;
23  import java.util.List;
24  import java.util.Map;
25  import java.util.concurrent.Callable;
26  import java.util.Collections;
27  import com.puppycrawl.tools.checkstyle.Checker;
28  import com.puppycrawl.tools.checkstyle.ConfigurationLoader;
29  
30  import javax.swing.AbstractAction;
31  
32  import org.apache.commons.beanutils.locale.converters.ByteLocaleConverter;
33  class InputEmptyLineSeparator //warn
34  {
35      public static final double FOO_PI = 3.1415;
36      private boolean flag = true;
37      static {  //warn
38          //empty static initializer
39      }
40  
41      {
42          //empty instance initializer
43      }
44  
45      /**
46       *
47       *
48       *
49       */
50      private InputEmptyLineSeparator()
51      {
52          //empty
53      }
54  
55      public int compareTo(InputEmptyLineSeparator aObject)
56      {
57          int number = 0;
58          return 0;
59      }
60      /**
61       *
62       * @param task
63       * @param result
64       * @return
65       */
66      public static <T> Callable<T> callable(Runnable task, T result) // warn
67      {
68          return null;
69      }
70  
71      public int getBeastNumber()
72      {
73          return 666;
74      }
75      interface IntEnum { //warn
76      }
77  
78      class InnerClass {
79  
80          public static final double FOO_PI_INNER = 3.1415;
81          private boolean flagInner = true;
82          { //warn
83              //empty instance initializer
84          }
85  
86          private InnerClass()
87          {
88              //empty
89          }
90  
91      }
92  
93      class InnerClass2 { //ok
94          private InnerClass2() //ok
95          {
96              //empty
97          }
98      }
99  
100     class InnerClass3 { //ok
101         public int compareTo(InputEmptyLineSeparator aObject) //ok
102         {
103             int number = 0;
104             return 0;
105         }
106 
107     }
108 }
109 
110 class Clazz { //ok
111     private Clazz() {} //ok
112 }
113 class Class2{ //warn
114     public int compareTo(InputEmptyLineSeparator aObject) //ok
115     {
116         int number = 0;
117         return 0;
118     }
119     Class2 anon = new Class2(){ //warn
120         public int compareTo(InputEmptyLineSeparator aObject) //ok
121         {
122             int number = 0;
123             return 0;
124         }
125     };
126 }