Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 110   Methods: 10
NCLOC: 69   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
FormalParameter.java 50% 74.5% 70% 68.5%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class FormalParameter, a component of the JExpressionIF composite hierarchy.
 7    * Note: null is not allowed as a value for any field.
 8    * @version Generated automatically by ASTGen at Sun Mar 04 22:01:28 CST 2012
 9    */
 10    public class FormalParameter extends JExpression {
 11    private final VariableDeclarator _declarator;
 12    private final boolean _isFinal;
 13   
 14    /**
 15    * Constructs a FormalParameter.
 16    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 17    */
 18  136 public FormalParameter(SourceInfo in_sourceInfo, VariableDeclarator in_declarator, boolean in_isFinal) {
 19  136 super(in_sourceInfo);
 20   
 21  136 if (in_declarator == null) {
 22  0 throw new java.lang.IllegalArgumentException("Parameter 'declarator' to the FormalParameter constructor was null. This class may not have null field values.");
 23    }
 24  136 _declarator = in_declarator;
 25  136 _isFinal = in_isFinal;
 26    }
 27   
 28  286 final public VariableDeclarator getDeclarator() { return _declarator; }
 29  95 final public boolean isIsFinal() { return _isFinal; }
 30   
 31  60 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forFormalParameter(this); }
 32  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forFormalParameter(this); }
 33   
 34    /**
 35    * Implementation of toString that uses
 36    * {@link #output} to generated nicely tabbed tree.
 37    */
 38  0 public java.lang.String toString() {
 39  0 java.io.StringWriter w = new java.io.StringWriter();
 40  0 output(w);
 41  0 return w.toString();
 42    }
 43   
 44    /**
 45    * Prints this object out as a nicely tabbed tree.
 46    */
 47  0 public void output(java.io.Writer writer) {
 48  0 outputHelp(new TabPrintWriter(writer, 2));
 49    }
 50   
 51  22 public void outputHelp(TabPrintWriter writer) {
 52  22 writer.print("FormalParameter" + ":");
 53  22 writer.indent();
 54   
 55  22 writer.startLine("");
 56  22 writer.print("sourceInfo = ");
 57  22 SourceInfo temp_sourceInfo = getSourceInfo();
 58  22 if (temp_sourceInfo == null) {
 59  0 writer.print("null");
 60    } else {
 61  22 writer.print(temp_sourceInfo);
 62    }
 63   
 64  22 writer.startLine("");
 65  22 writer.print("declarator = ");
 66  22 VariableDeclarator temp_declarator = getDeclarator();
 67  22 if (temp_declarator == null) {
 68  0 writer.print("null");
 69    } else {
 70  22 temp_declarator.outputHelp(writer);
 71    }
 72   
 73  22 writer.startLine("");
 74  22 writer.print("isFinal = ");
 75  22 boolean temp_isFinal = isIsFinal();
 76  22 writer.print(temp_isFinal);
 77  22 writer.unindent();
 78    }
 79   
 80    /**
 81    * Implementation of equals that is based on the values
 82    * of the fields of the object. Thus, two objects
 83    * created with identical parameters will be equal.
 84    */
 85  5 public boolean equals(java.lang.Object obj) {
 86  0 if (obj == null) return false;
 87  5 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 88  0 return false;
 89    } else {
 90  5 FormalParameter casted = (FormalParameter) obj;
 91  0 if (! (getDeclarator().equals(casted.getDeclarator()))) return false;
 92  0 if (! (isIsFinal() == casted.isIsFinal())) return false;
 93  5 return true;
 94    }
 95    }
 96   
 97    /**
 98    * Implementation of hashCode that is consistent with
 99    * equals. The value of the hashCode is formed by
 100    * XORing the hashcode of the class object with
 101    * the hashcodes of all the fields of the object.
 102    */
 103  3 protected int generateHashCode() {
 104  3 int code = getClass().hashCode();
 105  3 code ^= 0;
 106  3 code ^= getDeclarator().hashCode();
 107  3 code ^= (isIsFinal() ? 1231 : 1237);
 108  3 return code;
 109    }
 110    }