Skip to content

Commit

Permalink
Add support for canonical class names in MutableException. checkstyle…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkordas committed May 25, 2015
1 parent c578d26 commit 2f31188
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ private boolean isNamedAsException(DetailAST ast) {
private boolean isExtendedClassNamedAsException(DetailAST ast) {
final DetailAST extendsClause = ast.findFirstToken(TokenTypes.EXTENDS_CLAUSE);
if (extendsClause != null) {
final DetailAST extendedClass = extendsClause.findFirstToken(TokenTypes.IDENT);
if (extendedClass != null) {
final String extendedClassName = extendedClass.getText();
return extendedClassName.matches(extendedClassNameFormat);
DetailAST currentNode = extendsClause;
while (currentNode.getType() != TokenTypes.IDENT) {
currentNode = currentNode.getLastChild();
}
final String extendedClassName = currentNode.getText();
return extendedClassName.matches(extendedClassNameFormat);
}
return false;
}
Expand Down

0 comments on commit 2f31188

Please sign in to comment.