refactored

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4620 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Brian Remedios
2006-10-10 05:48:29 +00:00
parent 23f2e78266
commit 337140049f

View File

@ -34,7 +34,7 @@ public class UnusedImportsRule extends AbstractRule {
if (!node.isImportOnDemand()) {
ASTName importedType = (ASTName) node.jjtGetChild(0);
String className;
if (importedType.getImage().indexOf('.') != -1) {
if (isQualifiedName(importedType)) {
int lastDot = importedType.getImage().lastIndexOf('.') + 1;
className = importedType.getImage().substring(lastDot);
} else {
@ -58,7 +58,7 @@ public class UnusedImportsRule extends AbstractRule {
private void check(SimpleNode node) {
String name;
if (node.getImage().indexOf('.') == -1) {
if (!isQualifiedName(node)) {
name = node.getImage();
} else {
name = node.getImage().substring(0, node.getImage().indexOf('.'));