/** * Returns the list of type nodes denoting the exception types * caught by this catch block. The returned list has at least * one element. */ public List<ASTType> getCaughtExceptionTypeNodes() { // maybe cache the list return getFirstChildOfType(ASTFormalParameter.class).findChildrenOfType(ASTType.class); }
@Override public boolean hasSuppressWarningsAnnotationFor(Rule rule) { for (ASTAnnotation a : findChildrenOfType(ASTAnnotation.class)) { if (a.suppresses(rule)) { return true; } } return false; }
@Override public Object visit(ASTFormalParameters node, Object data) { if (!checkParameters) { return data; } ASTMethodDeclaration methodDeclaration = node.getFirstParentOfType(ASTMethodDeclaration.class); if (!checkNativeMethodParameters && methodDeclaration.isNative()) { return data; } for (ASTFormalParameter formalParameter : node.findChildrenOfType(ASTFormalParameter.class)) { for (ASTVariableDeclaratorId variableDeclaratorId : formalParameter .findChildrenOfType(ASTVariableDeclaratorId.class)) { checkVariableDeclaratorId(parameterPrefixes, parameterSuffixes, false, formalParameter.isFinal(), variableDeclaratorId, data); } } return data; }
/** * Returns the list of type nodes denoting the exception types * caught by this catch block. The returned list has at least * one element. */ public List<ASTType> getCaughtExceptionTypeNodes() { // maybe cache the list return getFirstChildOfType(ASTFormalParameter.class).findChildrenOfType(ASTType.class); }
@Override public boolean hasSuppressWarningsAnnotationFor(Rule rule) { for (ASTAnnotation a : findChildrenOfType(ASTAnnotation.class)) { if (a.suppresses(rule)) { return true; } } return false; }
@Override public Object visit(ASTFormalParameters node, Object data) { if (!checkParameters) { return data; } ASTMethodDeclaration methodDeclaration = node.getFirstParentOfType(ASTMethodDeclaration.class); if (!checkNativeMethodParameters && methodDeclaration.isNative()) { return data; } for (ASTFormalParameter formalParameter : node.findChildrenOfType(ASTFormalParameter.class)) { for (ASTVariableDeclaratorId variableDeclaratorId : formalParameter .findChildrenOfType(ASTVariableDeclaratorId.class)) { checkVariableDeclaratorId(parameterPrefixes, parameterSuffixes, false, formalParameter.isFinal(), variableDeclaratorId, data); } } return data; }