Clover coverage report - PMD - 3.9
Coverage timestamp: Tue Dec 19 2006 09:38:44 EST
file stats: LOC: 26   Methods: 1
NCLOC: 19   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SymbolTableTestRule.java 0% 0% 0% 0%
coverage
 1    /**
 2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 3    */
 4    package net.sourceforge.pmd.rules;
 5   
 6    import net.sourceforge.pmd.AbstractRule;
 7    import net.sourceforge.pmd.Rule;
 8    import net.sourceforge.pmd.ast.ASTFieldDeclaration;
 9    import net.sourceforge.pmd.ast.ASTVariableDeclaratorId;
 10    import net.sourceforge.pmd.ast.SimpleNode;
 11    import net.sourceforge.pmd.symboltable.NameOccurrence;
 12   
 13    import java.util.Iterator;
 14   
 15    public class SymbolTableTestRule extends AbstractRule implements Rule {
 16   
 17  0 public Object visit(ASTFieldDeclaration node,Object data) {
 18  0 ASTVariableDeclaratorId declaration = (ASTVariableDeclaratorId)node.findChildrenOfType(ASTVariableDeclaratorId.class).get(0);
 19  0 for (Iterator iter = declaration.getUsages().iterator();iter.hasNext();) {
 20  0 NameOccurrence no = (NameOccurrence)iter.next();
 21  0 SimpleNode location = no.getLocation();
 22  0 System.out.println(declaration.getImage() + " is used here: " + location.getImage());
 23    }
 24  0 return data;
 25    }
 26    }