Unnecessary imports should be removed
Created by: teerth-preprod[bot]
The imports part of a file should be handled by the Integrated Development Environment (IDE), not manually by the developer.
Unused and useless imports should not occur if that is the case.
Leaving them in reduces the code's readability, since their presence can be confusing.
Noncompliant Code Example
package my.company;import java.lang.String; // Noncompliant; java.lang classes are always implicitly importedimport my.company.SomeClass; // Noncompliant; same-package files are always implicitly importedimport java.io.File; // Noncompliant; File is not usedimport my.company2.SomeType;import my.company2.SomeType; // Noncompliant; 'SomeType' is already importedclass ExampleClass { public String someString; public SomeType something;}
Exceptions
Imports for types mentioned in comments, such as Javadocs, are ignored.
File Path: webgoat-server/src/main/java/org/owasp/webgoat/HSQLDBDatabaseConfig.java:12
Mitigation: Remove this unused import 'org.springframework.core.annotation.Order'.