View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.imports.unusedimports;
2   
3   import java.lang.String; // VIOLATION
4   import java.lang.Math; // VIOLATION
5   import java.lang.Class; // VIOLATION
6   import java.lang.Exception; // VIOLATION
7   import java.lang.Runnable; // VIOLATION
8   import java.lang.RuntimeException; // VIOLATION
9   import java.lang.ProcessBuilder; // VIOLATION
10  import java.lang.Double; // VIOLATION
11  import java.lang.Integer; // VIOLATION
12  import java.lang.Float; // VIOLATION
13  import java.lang.Short; // VIOLATION
14  
15  import java.lang.annotation.Annotation; // OK
16  import java.lang.reflect.Modifier; // OK
17  import java.lang.reflect.Field; // OK
18  
19  import java.lang.*; // OK
20  
21  public class InputUnusedImportsFromJavaLang {
22      private static final String SOMETHING = "a string";
23      private static final double PI =  Math.PI;
24  
25      private Class clazz = this.getClass();
26      private Exception ex = new RuntimeException();
27      private Runnable runnable = new Runnable() {
28          @Override
29          public void run() {
30  
31          }
32      };
33      private ProcessBuilder processBuilder = new ProcessBuilder();
34      private Modifier modifier = new Modifier();
35      private Field field;
36      private Annotation annotation;
37  
38      public static void main(String[] args) {
39          Double d = new Double(0.0d);
40          Float f = new Float(0.1f);
41          Integer i = new Integer(1);
42          Short s = Short.MIN_VALUE;
43      }
44  }