View Javadoc
1   package com.google.checkstyle.test.chapter3filestructure.rule333orderingandspacing;
2   
3   import static java.awt.Button.ABORT;
4   import static java.io.File.createTempFile;
5   // comments
6   
7   
8   // comments
9   import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
10  // violation above 'Extra separation .* before 'javax.swing.WindowConstants.DISPOSE_ON_CLOSE''
11  
12  // comments
13  
14  import com.google.checkstyle.test.chapter2filebasic.rule21filename.InputFileName1;
15  // violation above ''com.google.checkstyle.test.*' should be separated .* by one line.'
16  import com.google.checkstyle.test.chapter3filestructure.rule3sourcefile.SourceFileStructureTest;
17  // comments
18  
19  import com.google.common.reflect.TypeToken;
20  // violation above 'Extra separation in import group before 'com.google.common.reflect.*''
21  import java.util.List;
22  
23  // comments
24  import java.util.StringTokenizer;
25  // violation above 'Extra separation in import group before 'java.util.StringTokenizer''
26  // comments
27  
28  // comments
29  import java.util.concurrent.AbstractExecutorService;
30  // violation above 'Extra separation .* before 'java.util.concurrent.AbstractExecutorService''
31  
32  /** Some javadoc. */
33  public class InputOrderingAndSpacing5 {
34    /** Some javadoc. */
35    public static void main(String[] args) {
36      // Use of static imports
37      int abortAction = ABORT;
38      try {
39        createTempFile("temp", ".txt");
40      } catch (Exception e) {
41        e.printStackTrace();
42      }
43      int closeOperation = DISPOSE_ON_CLOSE;
44  
45      // Use of com.google classes
46      InputFileName1 inputFileName1 = new InputFileName1();
47      SourceFileStructureTest sourceFileStructureTest = new SourceFileStructureTest();
48      TypeToken<?> typeToken = TypeToken.of(String.class);
49  
50      // Use of java.util classes
51      List<String> list;
52      StringTokenizer tokenizer = new StringTokenizer("Hello World");
53  
54      // Use of java.util.concurrent classes
55      AbstractExecutorService abstractExecutorService = new AbstractExecutorService() {
56        @Override
57        public void shutdown() {
58        }
59  
60        @Override
61        public java.util.List<Runnable> shutdownNow() {
62          return null;
63        }
64  
65        @Override
66        public boolean isShutdown() {
67          return false;
68        }
69  
70        @Override
71        public boolean isTerminated() {
72          return false;
73        }
74  
75        @Override
76        public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) {
77          return false;
78        }
79  
80        @Override
81        public void execute(Runnable command) {
82        }
83      };
84    }
85  }