Patch from Rick Giles

This commit is contained in:
Oliver Burn 2002-10-29 13:50:06 +00:00
parent 6e676cac5d
commit b368f9b91f
2 changed files with 2 additions and 32 deletions

View File

@ -32,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
* @author Oliver Burn
*/
public class ParameterFormatCheck
extends AbstractFormatCheck
extends AbstractNameCheck
{
/**
* Creates a new <code>ParameterFormatCheck</code> instance.
@ -47,20 +47,4 @@ public class ParameterFormatCheck
{
return new int[] {TokenTypes.PARAMETER_DEF};
}
/** @see com.puppycrawl.tools.checkstyle.api.Check */
public void visitToken(DetailAST aAST)
{
final DetailAST nameAST =
(DetailAST) aAST.getFirstChild().getNextSibling().getNextSibling();
if (!getRegexp().match(nameAST.getText())) {
log(nameAST.getLineNo(),
nameAST.getColumnNo(),
"name.invalidPattern",
nameAST.getText(),
getFormat());
}
}
}

View File

@ -32,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
* @author Oliver Burn
*/
public class TypeNameCheck
extends AbstractFormatCheck
extends AbstractNameCheck
{
/**
@ -49,18 +49,4 @@ public class TypeNameCheck
return new int[] {TokenTypes.CLASS_DEF,
TokenTypes.INTERFACE_DEF};
}
/** @see com.puppycrawl.tools.checkstyle.api.Check */
public void visitToken(DetailAST aAST)
{
final DetailAST nameAST =
(DetailAST) aAST.getFirstChild().getNextSibling();
if (!getRegexp().match(nameAST.getText())) {
log(nameAST.getLineNo(),
nameAST.getColumnNo(),
"name.invalidPattern",
nameAST.getText(),
getFormat());
}
}
}