Clover coverage report - DynamicJava Test Coverage (dynamicjava-20130622-r5436)
Coverage timestamp: Sat Jun 22 2013 03:01:29 CDT
file stats: LOC: 115   Methods: 8
NCLOC: 77   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
UnionType.java 37.5% 53.2% 50% 48.1%
coverage coverage
 1    package edu.rice.cs.dynamicjava.symbol.type;
 2   
 3    import edu.rice.cs.dynamicjava.symbol.*;
 4   
 5    /**
 6    * Class UnionType, 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 Jun 22 03:00:38 CDT 2013
 9    */
 10    @SuppressWarnings("unused")
 11    public class UnionType extends BoundType {
 12   
 13    /**
 14    * Constructs a UnionType.
 15    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 16    */
 17  394 public UnionType(Iterable<? extends Type> in_ofTypes) {
 18  394 super(in_ofTypes);
 19    }
 20   
 21   
 22  491 public <RetType> RetType apply(TypeVisitor<RetType> visitor) {
 23  491 return visitor.forUnionType(this);
 24    }
 25   
 26  0 public void apply(TypeVisitor_void visitor) {
 27  0 visitor.forUnionType(this);
 28    }
 29   
 30    /**
 31    * Implementation of toString that uses
 32    * {@link #output} to generate a nicely tabbed tree.
 33    */
 34  0 public java.lang.String toString() {
 35  0 java.io.StringWriter w = new java.io.StringWriter();
 36  0 walk(new ToStringWalker(w, 2));
 37  0 return w.toString();
 38    }
 39   
 40    /**
 41    * Prints this object out as a nicely tabbed tree.
 42    */
 43  0 public void output(java.io.Writer writer) {
 44  0 walk(new ToStringWalker(writer, 2));
 45    }
 46   
 47    /**
 48    * Implementation of equals that is based on the values of the fields of the
 49    * object. Thus, two objects created with identical parameters will be equal.
 50    */
 51  417 public boolean equals(java.lang.Object obj) {
 52  0 if (obj == null) return false;
 53  417 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 54  393 return false;
 55    }
 56    else {
 57  24 UnionType casted = (UnionType) obj;
 58  24 Iterable<? extends Type> temp_ofTypes = ofTypes();
 59  24 Iterable<? extends Type> casted_ofTypes = casted.ofTypes();
 60  24 if (temp_ofTypes != casted_ofTypes) {
 61  24 java.util.Iterator<? extends Type> iter_temp_ofTypes = temp_ofTypes.iterator();
 62  24 java.util.Iterator<? extends Type> iter_casted_ofTypes = casted_ofTypes.iterator();
 63  24 while (iter_temp_ofTypes.hasNext() && iter_casted_ofTypes.hasNext()) {
 64  48 Type elt_temp_ofTypes = iter_temp_ofTypes.next();
 65  48 Type elt_casted_ofTypes = iter_casted_ofTypes.next();
 66  0 if (!(elt_temp_ofTypes == elt_casted_ofTypes || elt_temp_ofTypes != null && elt_casted_ofTypes!= null && elt_temp_ofTypes.equals(elt_casted_ofTypes))) return false;
 67    }
 68  0 if (iter_temp_ofTypes.hasNext() || iter_casted_ofTypes.hasNext()) return false;
 69    }
 70  24 return true;
 71    }
 72    }
 73   
 74   
 75    /**
 76    * Implementation of hashCode that is consistent with equals. The value of
 77    * the hashCode is formed by XORing the hashcode of the class object with
 78    * the hashcodes of all the fields of the object.
 79    */
 80  32 public int generateHashCode() {
 81  32 int code = getClass().hashCode();
 82  32 Iterable<? extends Type> temp_ofTypes = ofTypes();
 83  32 code ^= temp_ofTypes.getClass().hashCode();
 84  32 int index_temp_ofTypes = 0;
 85  32 for (Type elt_temp_ofTypes : temp_ofTypes) {
 86  64 code ^= index_temp_ofTypes++;
 87  64 code ^= (elt_temp_ofTypes == null) ? 0 : elt_temp_ofTypes.hashCode();
 88    }
 89  32 return code;
 90    }
 91   
 92  0 public void walk(TreeWalker w) {
 93  0 if (w.visitNode(this, "UnionType", 1)) {
 94  0 Iterable<? extends Type> temp_ofTypes = ofTypes();
 95  0 if (w.visitNodeField("ofTypes", temp_ofTypes)) {
 96  0 if (w.visitIterated(temp_ofTypes)) {
 97  0 int i_temp_ofTypes = 0;
 98  0 for (Type elt_temp_ofTypes : temp_ofTypes) {
 99  0 if (w.visitIteratedElement(i_temp_ofTypes, elt_temp_ofTypes)) {
 100  0 if (elt_temp_ofTypes == null) w.visitNull();
 101    else {
 102  0 elt_temp_ofTypes.walk(w);
 103    }
 104    }
 105  0 i_temp_ofTypes++;
 106    }
 107  0 w.endIterated(temp_ofTypes, i_temp_ofTypes);
 108    }
 109  0 w.endNodeField("ofTypes", temp_ofTypes);
 110    }
 111  0 w.endNode(this, "UnionType", 1);
 112    }
 113    }
 114   
 115    }