Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 104   Methods: 8
NCLOC: 65   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
BracedBody.java 70% 76.1% 62.5% 73%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class BracedBody, 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 BracedBody extends Body {
 11   
 12    /**
 13    * Constructs a BracedBody.
 14    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 15    */
 16  676 public BracedBody(SourceInfo in_sourceInfo, BodyItemI[] in_statements) {
 17  676 super(in_sourceInfo, in_statements);
 18    }
 19   
 20   
 21  1070 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forBracedBody(this); }
 22  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forBracedBody(this); }
 23   
 24    /**
 25    * Implementation of toString that uses
 26    * {@link #output} to generated nicely tabbed tree.
 27    */
 28  0 public java.lang.String toString() {
 29  0 java.io.StringWriter w = new java.io.StringWriter();
 30  0 output(w);
 31  0 return w.toString();
 32    }
 33   
 34    /**
 35    * Prints this object out as a nicely tabbed tree.
 36    */
 37  0 public void output(java.io.Writer writer) {
 38  0 outputHelp(new TabPrintWriter(writer, 2));
 39    }
 40   
 41  124 public void outputHelp(TabPrintWriter writer) {
 42  124 writer.print("BracedBody" + ":");
 43  124 writer.indent();
 44   
 45  124 writer.startLine("");
 46  124 writer.print("sourceInfo = ");
 47  124 SourceInfo temp_sourceInfo = getSourceInfo();
 48  124 if (temp_sourceInfo == null) {
 49  0 writer.print("null");
 50    } else {
 51  124 writer.print(temp_sourceInfo);
 52    }
 53   
 54  124 writer.startLine("");
 55  124 writer.print("statements = ");
 56  124 writer.print("{");
 57  124 writer.indent();
 58  124 for (int i = 0; i < getStatements().length; i++) {
 59  392 BodyItemI temp_statements = getStatements()[i];
 60  392 writer.startLine("#" + i + ": ");
 61  392 if (temp_statements == null) {
 62  0 writer.print("null");
 63    } else {
 64  392 temp_statements.outputHelp(writer);
 65    }
 66    }
 67  124 writer.unindent();
 68  124 if (getStatements().length > 0) {
 69  108 writer.startLine("");
 70    }
 71  124 writer.print("}");
 72  124 writer.unindent();
 73    }
 74   
 75    /**
 76    * Implementation of equals that is based on the values
 77    * of the fields of the object. Thus, two objects
 78    * created with identical parameters will be equal.
 79    */
 80  10 public boolean equals(java.lang.Object obj) {
 81  0 if (obj == null) return false;
 82  10 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 83  0 return false;
 84    } else {
 85  10 BracedBody casted = (BracedBody) obj;
 86  0 if (this.getStatements().length != casted.getStatements().length) return false;
 87  0 for (int i = 0; i < getStatements().length; i++) if (! getStatements()[i].equals(casted.getStatements()[i])) return false;
 88  10 return true;
 89    }
 90    }
 91   
 92    /**
 93    * Implementation of hashCode that is consistent with
 94    * equals. The value of the hashCode is formed by
 95    * XORing the hashcode of the class object with
 96    * the hashcodes of all the fields of the object.
 97    */
 98  10 protected int generateHashCode() {
 99  10 int code = getClass().hashCode();
 100  10 code ^= 0;
 101  1 for (int i = 0; i < getStatements().length; i++) code ^= getStatements()[i].hashCode();
 102  10 return code;
 103    }
 104    }