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   import java.awt.Button;
9   // violation above ''java.awt.Button' should be separated from previous import group by one line.'
10  import java.awt.Frame;
11  import java.awt.Dialog;
12  // violation above '.* 'java.awt.Dialog' .* Should be before 'java.awt.Frame'.'
13  import java.awt.event.ActionEvent;
14  import javax.swing.JComponent;
15  import javax.swing.JTable;
16  import java.io.File;
17  // violation above '.* 'java.io.File' .* Should be before 'javax.swing.JTable'.'
18  import java.io.IOException;
19  // violation above '.* 'java.io.IOException' .* Should be before 'javax.swing.JTable'.'
20  import java.io.InputStream;
21  // violation above '.* 'java.io.InputStream' .* Should be before 'javax.swing.JTable'.'
22  import java.io.Reader;
23  // violation above '.* 'java.io.Reader' .* Should be before 'javax.swing.JTable'.'
24  
25  import com.google.common.base.Ascii;
26  // 2 violations above:
27  //                    'Extra separation in import group before 'com.google.common.base.Ascii''
28  //                    '.* 'com.google.common.base.Ascii' .* Should be before 'javax.swing.JTable'.'
29  
30  /** Some javadoc. */
31  public class InputOrderingAndSpacing1 {
32    /** some javadoc. */
33    public static void main(String[] args) {
34      // Use of static imports
35      try {
36        File tempFile = createTempFile("temp", ".txt");
37      } catch (IOException e) {
38        e.printStackTrace();
39      }
40      int abortAction = ABORT;
41  
42      Frame frame = new Frame();
43  
44      JTable table = new JTable();
45      int closeOperation = EXIT_ON_CLOSE;
46  
47      File file = new File("example.txt");
48      InputStream inputStream = System.in;
49      Reader reader = null;
50  
51      char ascii = Ascii.BS;
52    }
53  }