View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="UnusedImports"/>
5     </module>
6   </module>
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.imports.unusedimports;
10  
11  // xdoc section -- start
12  // limitation as it match field name in code
13  import java.awt.Component; //OK
14  
15  // no ability to recognize what import is not used
16  import static java.util.Map.copyOf; //OK
17  import static java.util.Arrays.copyOf; //OK
18  
19  import java.lang.String; // violation
20  
21  import java.util.Stack;
22  import java.util.Map;   // violation
23  
24  import java.util.List;
25  import java.util.function.Function;
26  
27  import static java.lang.Integer.parseInt; // violation
28  
29  /**
30  * {@link List}
31  */
32  class Example1{
33    Stack stack = new Stack();
34    private Object Component;
35    int[] arr = {0,0};
36    int[] array = copyOf(arr , 1);
37    Function <String, Integer> stringToInteger = Integer::parseInt;
38  }
39  // xdoc section -- end