diff --git a/pmd/src/net/sourceforge/pmd/rules/design/GenericClassCounterRule.java b/pmd/src/net/sourceforge/pmd/rules/design/GenericClassCounterRule.java index 888b7e5829..7e4733aa56 100644 --- a/pmd/src/net/sourceforge/pmd/rules/design/GenericClassCounterRule.java +++ b/pmd/src/net/sourceforge/pmd/rules/design/GenericClassCounterRule.java @@ -21,10 +21,11 @@ import net.sourceforge.pmd.rules.regex.RegexHelper; import org.jaxen.JaxenException; /** - *
A generic rule that can be configurer to "count" classes of certains - * types based on either their name (full name, prefix, suffixes anything can + *
A generic rule that can be configured to "count" classes of certain + * type based on either their name (full name, prefix, suffixes anything can * be matched with a regex), and/or * their type.
+ * *Example of configurations:
*
*
@@ -119,7 +120,7 @@ public class GenericClassCounterRule extends AbstractJavaRule {
public Object visit(ASTImportDeclaration node, Object data) {
// Is there any imported types that match ?
for (Pattern pattern : this.typesMatch) {
- if ( RegexHelper.isMatch(pattern,node.getImage())) {
+ if ( RegexHelper.isMatch(pattern,node.getImportedName())) {
if ( simpleClassname == null )
simpleClassname = new ArrayList