Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 181   Methods: 8
NCLOC: 137   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AbstractMethodDef.java 16.7% 42.6% 37.5% 33.9%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class AbstractMethodDef, 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 AbstractMethodDef extends MethodDef {
 11   
 12    /**
 13    * Constructs a AbstractMethodDef.
 14    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 15    */
 16  51 public AbstractMethodDef(SourceInfo in_sourceInfo, ModifiersAndVisibility in_mav, TypeParameter[] in_typeParams, ReturnTypeI in_result, Word in_name, FormalParameter[] in_params, ReferenceType[] in_throws) {
 17  51 super(in_sourceInfo, in_mav, in_typeParams, in_result, in_name, in_params, in_throws);
 18    }
 19   
 20   
 21  74 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forAbstractMethodDef(this); }
 22  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forAbstractMethodDef(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  6 public void outputHelp(TabPrintWriter writer) {
 42  6 writer.print("AbstractMethodDef" + ":");
 43  6 writer.indent();
 44   
 45  6 writer.startLine("");
 46  6 writer.print("sourceInfo = ");
 47  6 SourceInfo temp_sourceInfo = getSourceInfo();
 48  6 if (temp_sourceInfo == null) {
 49  0 writer.print("null");
 50    } else {
 51  6 writer.print(temp_sourceInfo);
 52    }
 53   
 54  6 writer.startLine("");
 55  6 writer.print("mav = ");
 56  6 ModifiersAndVisibility temp_mav = getMav();
 57  6 if (temp_mav == null) {
 58  0 writer.print("null");
 59    } else {
 60  6 temp_mav.outputHelp(writer);
 61    }
 62   
 63  6 writer.startLine("");
 64  6 writer.print("typeParams = ");
 65  6 writer.print("{");
 66  6 writer.indent();
 67  6 for (int i = 0; i < getTypeParams().length; i++) {
 68  0 TypeParameter temp_typeParams = getTypeParams()[i];
 69  0 writer.startLine("#" + i + ": ");
 70  0 if (temp_typeParams == null) {
 71  0 writer.print("null");
 72    } else {
 73  0 temp_typeParams.outputHelp(writer);
 74    }
 75    }
 76  6 writer.unindent();
 77  6 if (getTypeParams().length > 0) {
 78  0 writer.startLine("");
 79    }
 80  6 writer.print("}");
 81   
 82  6 writer.startLine("");
 83  6 writer.print("result = ");
 84  6 ReturnTypeI temp_result = getResult();
 85  6 if (temp_result == null) {
 86  0 writer.print("null");
 87    } else {
 88  6 temp_result.outputHelp(writer);
 89    }
 90   
 91  6 writer.startLine("");
 92  6 writer.print("name = ");
 93  6 Word temp_name = getName();
 94  6 if (temp_name == null) {
 95  0 writer.print("null");
 96    } else {
 97  6 temp_name.outputHelp(writer);
 98    }
 99   
 100  6 writer.startLine("");
 101  6 writer.print("params = ");
 102  6 writer.print("{");
 103  6 writer.indent();
 104  6 for (int i = 0; i < getParams().length; i++) {
 105  0 FormalParameter temp_params = getParams()[i];
 106  0 writer.startLine("#" + i + ": ");
 107  0 if (temp_params == null) {
 108  0 writer.print("null");
 109    } else {
 110  0 temp_params.outputHelp(writer);
 111    }
 112    }
 113  6 writer.unindent();
 114  6 if (getParams().length > 0) {
 115  0 writer.startLine("");
 116    }
 117  6 writer.print("}");
 118   
 119  6 writer.startLine("");
 120  6 writer.print("throws = ");
 121  6 writer.print("{");
 122  6 writer.indent();
 123  6 for (int i = 0; i < getThrows().length; i++) {
 124  0 ReferenceType temp_throws = getThrows()[i];
 125  0 writer.startLine("#" + i + ": ");
 126  0 if (temp_throws == null) {
 127  0 writer.print("null");
 128    } else {
 129  0 temp_throws.outputHelp(writer);
 130    }
 131    }
 132  6 writer.unindent();
 133  6 if (getThrows().length > 0) {
 134  0 writer.startLine("");
 135    }
 136  6 writer.print("}");
 137  6 writer.unindent();
 138    }
 139   
 140    /**
 141    * Implementation of equals that is based on the values
 142    * of the fields of the object. Thus, two objects
 143    * created with identical parameters will be equal.
 144    */
 145  0 public boolean equals(java.lang.Object obj) {
 146  0 if (obj == null) return false;
 147  0 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 148  0 return false;
 149    } else {
 150  0 AbstractMethodDef casted = (AbstractMethodDef) obj;
 151  0 if (! (getMav().equals(casted.getMav()))) return false;
 152  0 if (this.getTypeParams().length != casted.getTypeParams().length) return false;
 153  0 for (int i = 0; i < getTypeParams().length; i++) if (! getTypeParams()[i].equals(casted.getTypeParams()[i])) return false;
 154  0 if (! (getResult().equals(casted.getResult()))) return false;
 155  0 if (! (getName().equals(casted.getName()))) return false;
 156  0 if (this.getParams().length != casted.getParams().length) return false;
 157  0 for (int i = 0; i < getParams().length; i++) if (! getParams()[i].equals(casted.getParams()[i])) return false;
 158  0 if (this.getThrows().length != casted.getThrows().length) return false;
 159  0 for (int i = 0; i < getThrows().length; i++) if (! getThrows()[i].equals(casted.getThrows()[i])) return false;
 160  0 return true;
 161    }
 162    }
 163   
 164    /**
 165    * Implementation of hashCode that is consistent with
 166    * equals. The value of the hashCode is formed by
 167    * XORing the hashcode of the class object with
 168    * the hashcodes of all the fields of the object.
 169    */
 170  0 protected int generateHashCode() {
 171  0 int code = getClass().hashCode();
 172  0 code ^= 0;
 173  0 code ^= getMav().hashCode();
 174  0 for (int i = 0; i < getTypeParams().length; i++) code ^= getTypeParams()[i].hashCode();
 175  0 code ^= getResult().hashCode();
 176  0 code ^= getName().hashCode();
 177  0 for (int i = 0; i < getParams().length; i++) code ^= getParams()[i].hashCode();
 178  0 for (int i = 0; i < getThrows().length; i++) code ^= getThrows()[i].hashCode();
 179  0 return code;
 180    }
 181    }