Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 133   Methods: 9
NCLOC: 91   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TryCatchFinallyStatement.java 26.7% 52.9% 44.4% 44.9%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class TryCatchFinallyStatement, 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 TryCatchFinallyStatement extends TryCatchStatement {
 11    private final Block _finallyBlock;
 12   
 13    /**
 14    * Constructs a TryCatchFinallyStatement.
 15    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 16    */
 17  17 public TryCatchFinallyStatement(SourceInfo in_sourceInfo, Block in_tryBlock, CatchBlock[] in_catchBlocks, Block in_finallyBlock) {
 18  17 super(in_sourceInfo, in_tryBlock, in_catchBlocks);
 19   
 20  17 if (in_finallyBlock == null) {
 21  0 throw new java.lang.IllegalArgumentException("Parameter 'finallyBlock' to the TryCatchFinallyStatement constructor was null. This class may not have null field values.");
 22    }
 23  17 _finallyBlock = in_finallyBlock;
 24    }
 25   
 26  24 final public Block getFinallyBlock() { return _finallyBlock; }
 27   
 28  22 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forTryCatchFinallyStatement(this); }
 29  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forTryCatchFinallyStatement(this); }
 30   
 31    /**
 32    * Implementation of toString that uses
 33    * {@link #output} to generated nicely tabbed tree.
 34    */
 35  0 public java.lang.String toString() {
 36  0 java.io.StringWriter w = new java.io.StringWriter();
 37  0 output(w);
 38  0 return w.toString();
 39    }
 40   
 41    /**
 42    * Prints this object out as a nicely tabbed tree.
 43    */
 44  0 public void output(java.io.Writer writer) {
 45  0 outputHelp(new TabPrintWriter(writer, 2));
 46    }
 47   
 48  2 public void outputHelp(TabPrintWriter writer) {
 49  2 writer.print("TryCatchFinallyStatement" + ":");
 50  2 writer.indent();
 51   
 52  2 writer.startLine("");
 53  2 writer.print("sourceInfo = ");
 54  2 SourceInfo temp_sourceInfo = getSourceInfo();
 55  2 if (temp_sourceInfo == null) {
 56  0 writer.print("null");
 57    } else {
 58  2 writer.print(temp_sourceInfo);
 59    }
 60   
 61  2 writer.startLine("");
 62  2 writer.print("tryBlock = ");
 63  2 Block temp_tryBlock = getTryBlock();
 64  2 if (temp_tryBlock == null) {
 65  0 writer.print("null");
 66    } else {
 67  2 temp_tryBlock.outputHelp(writer);
 68    }
 69   
 70  2 writer.startLine("");
 71  2 writer.print("catchBlocks = ");
 72  2 writer.print("{");
 73  2 writer.indent();
 74  2 for (int i = 0; i < getCatchBlocks().length; i++) {
 75  2 CatchBlock temp_catchBlocks = getCatchBlocks()[i];
 76  2 writer.startLine("#" + i + ": ");
 77  2 if (temp_catchBlocks == null) {
 78  0 writer.print("null");
 79    } else {
 80  2 temp_catchBlocks.outputHelp(writer);
 81    }
 82    }
 83  2 writer.unindent();
 84  2 if (getCatchBlocks().length > 0) {
 85  2 writer.startLine("");
 86    }
 87  2 writer.print("}");
 88   
 89  2 writer.startLine("");
 90  2 writer.print("finallyBlock = ");
 91  2 Block temp_finallyBlock = getFinallyBlock();
 92  2 if (temp_finallyBlock == null) {
 93  0 writer.print("null");
 94    } else {
 95  2 temp_finallyBlock.outputHelp(writer);
 96    }
 97  2 writer.unindent();
 98    }
 99   
 100    /**
 101    * Implementation of equals that is based on the values
 102    * of the fields of the object. Thus, two objects
 103    * created with identical parameters will be equal.
 104    */
 105  0 public boolean equals(java.lang.Object obj) {
 106  0 if (obj == null) return false;
 107  0 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 108  0 return false;
 109    } else {
 110  0 TryCatchFinallyStatement casted = (TryCatchFinallyStatement) obj;
 111  0 if (! (getTryBlock().equals(casted.getTryBlock()))) return false;
 112  0 if (this.getCatchBlocks().length != casted.getCatchBlocks().length) return false;
 113  0 for (int i = 0; i < getCatchBlocks().length; i++) if (! getCatchBlocks()[i].equals(casted.getCatchBlocks()[i])) return false;
 114  0 if (! (getFinallyBlock().equals(casted.getFinallyBlock()))) return false;
 115  0 return true;
 116    }
 117    }
 118   
 119    /**
 120    * Implementation of hashCode that is consistent with
 121    * equals. The value of the hashCode is formed by
 122    * XORing the hashcode of the class object with
 123    * the hashcodes of all the fields of the object.
 124    */
 125  0 protected int generateHashCode() {
 126  0 int code = getClass().hashCode();
 127  0 code ^= 0;
 128  0 code ^= getTryBlock().hashCode();
 129  0 for (int i = 0; i < getCatchBlocks().length; i++) code ^= getCatchBlocks()[i].hashCode();
 130  0 code ^= getFinallyBlock().hashCode();
 131  0 return code;
 132    }
 133    }