View Javadoc
1   ///////////////////////////////////////////////////////////////////////////////////////////////
2   // checkstyle: Checks Java source code and other text files for adherence to a set of rules.
3   //
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  
20  package com.google.checkstyle.test.chapter4formatting.rule461verticalwhitespace;
21  
22  import java.util.concurrent.Callable;
23  
24  class InputFormattedVerticalWhitespace {
25    public static final double FOO_PI = 3.1415;
26    private boolean flag = true;
27  
28    static {
29      // empty static initializer
30    }
31  
32    {
33      // empty instance initializer
34    }
35  
36    /** Some javadoc. */
37    private InputFormattedVerticalWhitespace() {
38      // empty
39    }
40  
41    public int compareTo(InputFormattedVerticalWhitespace obj) {
42      int number = 0;
43      return 0;
44    }
45  
46    /**
47     * Some javadoc.
48     *
49     * @param task some description.
50     * @param result some description.
51     * @return some description.
52     */
53    public static <T> Callable<T> callable(Runnable task, T result) {
54  
55      return null;
56    }
57  
58    public int getBeastNumber() {
59      return 666;
60    }
61  
62    interface IntEnum {}
63  
64    class InnerClass {
65  
66      public static final double FOO_PI_INNER = 3.1415;
67      private boolean flagInner = true;
68  
69      {
70        // empty instance initializer
71      }
72  
73      private InnerClass() {
74        // empty
75      }
76    }
77  
78    class InnerClass2 { // ok
79      private InnerClass2() { // ok
80        // empty
81      }
82    }
83  
84    class InnerClass3 { // ok
85      public int compareTo(InputFormattedVerticalWhitespace obj) { // ok
86        int number = 0;
87        return 0;
88      }
89    }
90  
91    class Clazz { // ok
92      private Clazz() {} // ok
93    }
94  
95    class Class2 {
96      public int compareTo(InputFormattedVerticalWhitespace obj) { // ok
97        int number = 0;
98        return 0;
99      }
100 
101     Class2 anon =
102         new Class2() {
103           public int compareTo(InputFormattedVerticalWhitespace obj) { // ok
104             int number = 0;
105             return 0;
106           }
107         };
108   }
109 }