-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
Given the following class
package some.pkg;
import static some.pkg.ImportedClass.*;
class SomeClass {
}
The UnnecessaryImport
mutator removes the star import. The cause is a subtle bug in
Lines 207 to 211 in fa9f073
var imp = i.getNameAsString(); | |
if (packageName.isEmpty()) { | |
return !imp.contains("."); | |
} | |
return imp.startsWith(packageName) && imp.lastIndexOf('.') <= packageName.length(); |
getNameAsString()
for that ImportDeclaration
returns some.pkg.ImportedClass
and not some.pkg.ImportedClass.*
as one could expect. Therefore the import is removed.
Metadata
Metadata
Assignees
Labels
No labels