Clover coverage report - PMD - 3.9
Coverage timestamp: Tue Dec 19 2006 09:38:44 EST
file stats: LOC: 49   Methods: 4
NCLOC: 35   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ASTAnnotation.java 70% 93.3% 75% 82.8%
coverage coverage
 1    /* Generated By:JJTree: Do not edit this line. ASTAnnotation.java */
 2   
 3    package net.sourceforge.pmd.ast;
 4   
 5    import net.sourceforge.pmd.Rule;
 6   
 7    import java.util.Iterator;
 8    import java.util.List;
 9   
 10    public class ASTAnnotation extends SimpleJavaNode {
 11  0 public ASTAnnotation(int id) {
 12  0 super(id);
 13    }
 14   
 15  20 public ASTAnnotation(JavaParser p, int id) {
 16  20 super(p, id);
 17    }
 18   
 19  13 public boolean suppresses(Rule rule) {
 20  13 final String ruleAnno = "\"PMD." + rule.getName() + "\"";
 21   
 22  13 if (jjtGetChild(0) instanceof ASTSingleMemberAnnotation) {
 23  13 ASTSingleMemberAnnotation n = (ASTSingleMemberAnnotation) jjtGetChild(0);
 24   
 25  13 if (n.jjtGetChild(0) instanceof ASTName) {
 26  13 ASTName annName = ((ASTName) n.jjtGetChild(0));
 27   
 28  13 if (annName.getImage().equals("SuppressWarnings")) {
 29  13 List nodes = n.findChildrenOfType(ASTLiteral.class);
 30  13 for (Iterator iter = nodes.iterator(); iter.hasNext();) {
 31  13 ASTLiteral element = (ASTLiteral) iter.next();
 32  13 if (element.hasImageEqualTo("\"PMD\"")
 33    || element.hasImageEqualTo(ruleAnno)) {
 34  11 return true;
 35    }
 36    }
 37    }
 38    }
 39    }
 40  2 return false;
 41    }
 42   
 43    /**
 44    * Accept the visitor.
 45    */
 46  47 public Object jjtAccept(JavaParserVisitor visitor, Object data) {
 47  47 return visitor.visit(this, data);
 48    }
 49    }