Skip to content

Commit

Permalink
Issue: checkstyle#13007 Update doc for UnusedImports
Browse files Browse the repository at this point in the history
  • Loading branch information
TanayMorakhia committed Apr 23, 2023
1 parent 04e58d8 commit 1a068b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,15 @@
* <p>Example:</p>
* <pre>
* package com.example;
*
* import com.example.Demo; // violation, class from the same package should not be imported
*
* import java.util.Scanner; // OK
* import java.util.Scanner; // violation, class should not be imported more than once
*
* import java.lang.String; // violation, imported from "java.lang" package
*
* import java.util.Stack; // OK
* import java.util.Map; // violation, this class is not referenced
*
* Stack stack = new Stack();
*
* @link List // violation
* @link java.util.List // OK
* &#64;link List // violation
* &#64;link java.util.List // OK
* </pre>
* <p>
* To configure the check so that it ignores the imports referenced in Javadoc comments:
Expand All @@ -139,21 +133,15 @@
* <p>Example:</p>
* <pre>
* package com.example;
*
* import com.example.Demo; // violation, class from the same package should not be imported
*
* import java.util.Scanner; // OK
* import java.util.Scanner; // violation, class should not be imported more than once
*
* import java.lang.String; // violation, imported from "java.lang" package
*
* import java.util.Stack; // OK
* import java.util.Map; // violation, this class is not referenced
*
* Stack stack = new Stack();
*
* @link List // OK
* @link java.util.List // OK
* &#64;link List // OK
* &#64;link java.util.List // OK
* </pre>
* <p>
* Parent is {@code com.puppycrawl.tools.checkstyle.TreeWalker}
Expand Down
8 changes: 4 additions & 4 deletions src/xdocs/config_imports.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2562,8 +2562,8 @@ import java.util.Map; // violation, this class is not referenced

Stack stack = new Stack();

@link List // violation
@link java.util.List // OK
&#64;link List // violation
&#64;link java.util.List // OK
</source>
<p>
To configure the check so that it ignores the imports referenced in Javadoc comments:
Expand All @@ -2589,8 +2589,8 @@ import java.util.Map; // violation, this class is not referenced

Stack stack = new Stack();

@link List // OK
@link java.util.List // OK
&#64;link List // OK
&#64;link java.util.List // OK
</source>
</subsection>

Expand Down

0 comments on commit 1a068b7

Please sign in to comment.