Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 115   Methods: 8
NCLOC: 75   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
NormalTryCatchStatement.java 37.5% 29.1% 50% 33.3%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class NormalTryCatchStatement, 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 NormalTryCatchStatement extends TryCatchStatement {
 11   
 12    /**
 13    * Constructs a NormalTryCatchStatement.
 14    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 15    */
 16  27 public NormalTryCatchStatement(SourceInfo in_sourceInfo, Block in_tryBlock, CatchBlock[] in_catchBlocks) {
 17  27 super(in_sourceInfo, in_tryBlock, in_catchBlocks);
 18    }
 19   
 20   
 21  31 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forNormalTryCatchStatement(this); }
 22  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forNormalTryCatchStatement(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  0 public void outputHelp(TabPrintWriter writer) {
 42  0 writer.print("NormalTryCatchStatement" + ":");
 43  0 writer.indent();
 44   
 45  0 writer.startLine("");
 46  0 writer.print("sourceInfo = ");
 47  0 SourceInfo temp_sourceInfo = getSourceInfo();
 48  0 if (temp_sourceInfo == null) {
 49  0 writer.print("null");
 50    } else {
 51  0 writer.print(temp_sourceInfo);
 52    }
 53   
 54  0 writer.startLine("");
 55  0 writer.print("tryBlock = ");
 56  0 Block temp_tryBlock = getTryBlock();
 57  0 if (temp_tryBlock == null) {
 58  0 writer.print("null");
 59    } else {
 60  0 temp_tryBlock.outputHelp(writer);
 61    }
 62   
 63  0 writer.startLine("");
 64  0 writer.print("catchBlocks = ");
 65  0 writer.print("{");
 66  0 writer.indent();
 67  0 for (int i = 0; i < getCatchBlocks().length; i++) {
 68  0 CatchBlock temp_catchBlocks = getCatchBlocks()[i];
 69  0 writer.startLine("#" + i + ": ");
 70  0 if (temp_catchBlocks == null) {
 71  0 writer.print("null");
 72    } else {
 73  0 temp_catchBlocks.outputHelp(writer);
 74    }
 75    }
 76  0 writer.unindent();
 77  0 if (getCatchBlocks().length > 0) {
 78  0 writer.startLine("");
 79    }
 80  0 writer.print("}");
 81  0 writer.unindent();
 82    }
 83   
 84    /**
 85    * Implementation of equals that is based on the values
 86    * of the fields of the object. Thus, two objects
 87    * created with identical parameters will be equal.
 88    */
 89  4 public boolean equals(java.lang.Object obj) {
 90  0 if (obj == null) return false;
 91  4 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 92  0 return false;
 93    } else {
 94  4 NormalTryCatchStatement casted = (NormalTryCatchStatement) obj;
 95  0 if (! (getTryBlock().equals(casted.getTryBlock()))) return false;
 96  0 if (this.getCatchBlocks().length != casted.getCatchBlocks().length) return false;
 97  0 for (int i = 0; i < getCatchBlocks().length; i++) if (! getCatchBlocks()[i].equals(casted.getCatchBlocks()[i])) return false;
 98  4 return true;
 99    }
 100    }
 101   
 102    /**
 103    * Implementation of hashCode that is consistent with
 104    * equals. The value of the hashCode is formed by
 105    * XORing the hashcode of the class object with
 106    * the hashcodes of all the fields of the object.
 107    */
 108  2 protected int generateHashCode() {
 109  2 int code = getClass().hashCode();
 110  2 code ^= 0;
 111  2 code ^= getTryBlock().hashCode();
 112  2 for (int i = 0; i < getCatchBlocks().length; i++) code ^= getCatchBlocks()[i].hashCode();
 113  2 return code;
 114    }
 115    }