Clover coverage report - DynamicJava Test Coverage (dynamicjava-20120303-r5436)
Coverage timestamp: Sat Mar 3 2012 03:02:19 CST
file stats: LOC: 91   Methods: 6
NCLOC: 26   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
VariableAccess.java 25% 45.5% 50% 42.9%
coverage coverage
 1    /*
 2    * DynamicJava - Copyright (C) 1999-2001
 3    *
 4    * Permission is hereby granted, free of charge, to any person obtaining a
 5    * copy of this software and associated documentation files
 6    * (the "Software"), to deal in the Software without restriction, including
 7    * without limitation the rights to use, copy, modify, merge, publish,
 8    * distribute, sublicense, and/or sell copies of the Software, and to permit
 9    * persons to whom the Software is furnished to do so, subject to the
 10    * following conditions:
 11    * The above copyright notice and this permission notice shall be included
 12    * in all copies or substantial portions of the Software.
 13    *
 14    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15    * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 17    * IN NO EVENT SHALL DYADE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 18    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 19    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 20    * DEALINGS IN THE SOFTWARE.
 21    *
 22    * Except as contained in this notice, the name of Dyade shall not be
 23    * used in advertising or otherwise to promote the sale, use or other
 24    * dealings in this Software without prior written authorization from
 25    * Dyade.
 26    *
 27    */
 28   
 29    package koala.dynamicjava.tree;
 30   
 31    import koala.dynamicjava.tree.visitor.Visitor;
 32   
 33    public class VariableAccess extends PrimaryExpression implements LeftHandSide {
 34    /**
 35    * The field name
 36    */
 37    private String variableName;
 38   
 39    /**
 40    * Creates a new field access node
 41    * @param varName the variable name
 42    * @exception IllegalArgumentException if varName is null
 43    */
 44  0 public VariableAccess(String varName) {
 45  0 this(varName, SourceInfo.NONE);
 46    }
 47   
 48    /**
 49    * Creates a new field access node
 50    * @param varName the variable name
 51    * @exception IllegalArgumentException if varName is null
 52    */
 53  1573 public VariableAccess(String varName, SourceInfo si) {
 54  1573 super(si);
 55   
 56  0 if (varName == null) throw new IllegalArgumentException("Null variable name in VariableAccess construction");
 57   
 58  1573 variableName = varName;
 59    }
 60   
 61    /**
 62    * Returns the field name
 63    */
 64  1573 public String getVariableName() {
 65  1573 return variableName;
 66    }
 67   
 68    /**
 69    * Sets the field name
 70    */
 71  0 public void setVariableName(String s) {
 72  0 if (s == null) throw new IllegalArgumentException("Null variable name in VariableAccess update");
 73  0 variableName = s;
 74    }
 75   
 76    /**
 77    * Allows a visitor to traverse the tree
 78    * @param visitor the visitor to accept
 79    */
 80  2576 public <T> T acceptVisitor(Visitor<T> visitor) {
 81  2576 return visitor.visit(this);
 82    }
 83   
 84    /**
 85    * Implementation of toString for use in unit testing
 86    */
 87  0 public String toString() {
 88  0 return "("+getClass().getName()+": "+getVariableName()+")";
 89    }
 90   
 91    }