Skip to content

Commit

Permalink
Issue #7688: update doc for RedundantImport
Browse files Browse the repository at this point in the history
  • Loading branch information
Binita-tech authored and romani committed Dec 17, 2021
1 parent c9134ce commit de4cb77
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
* <module name="RedundantImport"/>
* </pre>
* <p>
* Example:
* </p>
* <pre>
* package Test;
* import static Test.MyClass.*; // OK, static import
* import static java.lang.Integer.MAX_VALUE; // OK, static import
*
* import Test.MyClass; // violation, imported from the same package as the current package
* import java.lang.String; // violation, the class imported is from the 'java.lang' package
* import java.util.Scanner; // OK
* import java.util.Scanner; // violation, it is a duplicate of another import
* public class MyClass{ };
* </pre>
* <p>
* Parent is {@code com.puppycrawl.tools.checkstyle.TreeWalker}
* </p>
* <p>
Expand Down
14 changes: 14 additions & 0 deletions src/xdocs/config_imports.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2359,6 +2359,20 @@ public class SomeClass { }
<source>
&lt;module name=&quot;RedundantImport&quot;/&gt;
</source>
<p>
Example:
</p>
<source>
package Test;
import static Test.MyClass.*; // OK, static import
import static java.lang.Integer.MAX_VALUE; // OK, static import

import Test.MyClass; // violation, imported from the same package as the current package
import java.lang.String; // violation, the class imported is from the 'java.lang' package
import java.util.Scanner; // OK
import java.util.Scanner; // violation, it is a duplicate of another import
public class MyClass{ };
</source>
</subsection>

<subsection name="Example of Usage" id="RedundantImport_Example_of_Usage">
Expand Down

0 comments on commit de4cb77

Please sign in to comment.