Class RedundantImportCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class RedundantImportCheck
    extends AbstractCheck

    Checks for imports that are redundant. An import statement is considered redundant if:

    • It is a duplicate of another import. This is, when a class is imported more than once.
    • The class non-statically imported is from the java.lang package. For example importing java.lang.String.
    • The class non-statically imported is from the same package as the current package.

    An example of how to configure the check is:

     <module name="RedundantImport"/>
     
    Compatible with Java 1.5 source.
    Author:
    Oliver Burn