Clover coverage report - DynamicJava Test Coverage (dynamicjava-20120303-r5436)
Coverage timestamp: Sat Mar 3 2012 03:02:19 CST
file stats: LOC: 131   Methods: 9
NCLOC: 93   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ParameterizedClassType.java 43.3% 57.4% 66.7% 54%
coverage coverage
 1    package edu.rice.cs.dynamicjava.symbol.type;
 2   
 3    import edu.rice.cs.dynamicjava.symbol.*;
 4   
 5    /**
 6    * Class ParameterizedClassType, a component of the ASTGen-generated composite hierarchy.
 7    * Note: null is not allowed as a value for any field.
 8    * @version Generated automatically by ASTGen at Sat Mar 03 03:01:27 CST 2012
 9    */
 10    @SuppressWarnings("unused")
 11    public class ParameterizedClassType extends ClassType {
 12    private final Iterable<? extends Type> _typeArguments;
 13   
 14    /**
 15    * Constructs a ParameterizedClassType.
 16    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 17    */
 18  13124 public ParameterizedClassType(DJClass in_ofClass, Iterable<? extends Type> in_typeArguments) {
 19  13124 super(in_ofClass);
 20  13124 if (in_typeArguments == null) {
 21  0 throw new java.lang.IllegalArgumentException("Parameter 'typeArguments' to the ParameterizedClassType constructor was null");
 22    }
 23  13124 _typeArguments = in_typeArguments;
 24    }
 25   
 26  120831 final public Iterable<? extends Type> typeArguments() { return _typeArguments; }
 27   
 28  50017 public <RetType> RetType apply(TypeVisitor<RetType> visitor) {
 29  50017 return visitor.forParameterizedClassType(this);
 30    }
 31   
 32  67 public void apply(TypeVisitor_void visitor) {
 33  67 visitor.forParameterizedClassType(this);
 34    }
 35   
 36    /**
 37    * Implementation of toString that uses
 38    * {@link #output} to generate a nicely tabbed tree.
 39    */
 40  0 public java.lang.String toString() {
 41  0 java.io.StringWriter w = new java.io.StringWriter();
 42  0 walk(new ToStringWalker(w, 2));
 43  0 return w.toString();
 44    }
 45   
 46    /**
 47    * Prints this object out as a nicely tabbed tree.
 48    */
 49  0 public void output(java.io.Writer writer) {
 50  0 walk(new ToStringWalker(writer, 2));
 51    }
 52   
 53    /**
 54    * Implementation of equals that is based on the values of the fields of the
 55    * object. Thus, two objects created with identical parameters will be equal.
 56    */
 57  58271 public boolean equals(java.lang.Object obj) {
 58  0 if (obj == null) return false;
 59  58271 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 60  10104 return false;
 61    }
 62    else {
 63  48167 ParameterizedClassType casted = (ParameterizedClassType) obj;
 64  48167 DJClass temp_ofClass = ofClass();
 65  48167 DJClass casted_ofClass = casted.ofClass();
 66  0 if (!(temp_ofClass == casted_ofClass || temp_ofClass.equals(casted_ofClass))) return false;
 67  48167 Iterable<? extends Type> temp_typeArguments = typeArguments();
 68  48167 Iterable<? extends Type> casted_typeArguments = casted.typeArguments();
 69  48167 if (temp_typeArguments != casted_typeArguments) {
 70  190 java.util.Iterator<? extends Type> iter_temp_typeArguments = temp_typeArguments.iterator();
 71  190 java.util.Iterator<? extends Type> iter_casted_typeArguments = casted_typeArguments.iterator();
 72  190 while (iter_temp_typeArguments.hasNext() && iter_casted_typeArguments.hasNext()) {
 73  190 Type elt_temp_typeArguments = iter_temp_typeArguments.next();
 74  190 Type elt_casted_typeArguments = iter_casted_typeArguments.next();
 75  2 if (!(elt_temp_typeArguments == elt_casted_typeArguments || elt_temp_typeArguments != null && elt_casted_typeArguments!= null && elt_temp_typeArguments.equals(elt_casted_typeArguments))) return false;
 76    }
 77  0 if (iter_temp_typeArguments.hasNext() || iter_casted_typeArguments.hasNext()) return false;
 78    }
 79  48165 return true;
 80    }
 81    }
 82   
 83   
 84    /**
 85    * Implementation of hashCode that is consistent with equals. The value of
 86    * the hashCode is formed by XORing the hashcode of the class object with
 87    * the hashcodes of all the fields of the object.
 88    */
 89  3635 public int generateHashCode() {
 90  3635 int code = getClass().hashCode();
 91  3635 DJClass temp_ofClass = ofClass();
 92  3635 code ^= temp_ofClass.hashCode();
 93  3635 Iterable<? extends Type> temp_typeArguments = typeArguments();
 94  3635 code ^= temp_typeArguments.getClass().hashCode();
 95  3635 int index_temp_typeArguments = 0;
 96  3635 for (Type elt_temp_typeArguments : temp_typeArguments) {
 97  3635 code ^= index_temp_typeArguments++;
 98  3635 code ^= (elt_temp_typeArguments == null) ? 0 : elt_temp_typeArguments.hashCode();
 99    }
 100  3635 return code;
 101    }
 102   
 103  0 public void walk(TreeWalker w) {
 104  0 if (w.visitNode(this, "ParameterizedClassType", 2)) {
 105  0 DJClass temp_ofClass = ofClass();
 106  0 if (w.visitNodeField("ofClass", temp_ofClass)) {
 107  0 w.visitUnknownObject(temp_ofClass);
 108  0 w.endNodeField("ofClass", temp_ofClass);
 109    }
 110  0 Iterable<? extends Type> temp_typeArguments = typeArguments();
 111  0 if (w.visitNodeField("typeArguments", temp_typeArguments)) {
 112  0 if (w.visitIterated(temp_typeArguments)) {
 113  0 int i_temp_typeArguments = 0;
 114  0 for (Type elt_temp_typeArguments : temp_typeArguments) {
 115  0 if (w.visitIteratedElement(i_temp_typeArguments, elt_temp_typeArguments)) {
 116  0 if (elt_temp_typeArguments == null) w.visitNull();
 117    else {
 118  0 elt_temp_typeArguments.walk(w);
 119    }
 120    }
 121  0 i_temp_typeArguments++;
 122    }
 123  0 w.endIterated(temp_typeArguments, i_temp_typeArguments);
 124    }
 125  0 w.endNodeField("typeArguments", temp_typeArguments);
 126    }
 127  0 w.endNode(this, "ParameterizedClassType", 2);
 128    }
 129    }
 130   
 131    }