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