Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 111   Methods: 9
NCLOC: 71   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ArrayInitializer.java 27.3% 52% 44.4% 44.4%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class ArrayInitializer, 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 ArrayInitializer extends JExpression implements VariableInitializerI {
 11    private final VariableInitializerI[] _items;
 12   
 13    /**
 14    * Constructs a ArrayInitializer.
 15    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 16    */
 17  33 public ArrayInitializer(SourceInfo in_sourceInfo, VariableInitializerI[] in_items) {
 18  33 super(in_sourceInfo);
 19   
 20  33 if (in_items == null) {
 21  0 throw new java.lang.IllegalArgumentException("Parameter 'items' to the ArrayInitializer constructor was null. This class may not have null field values.");
 22    }
 23  33 _items = in_items;
 24    }
 25   
 26  236 final public VariableInitializerI[] getItems() { return _items; }
 27   
 28  7 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forArrayInitializer(this); }
 29  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forArrayInitializer(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  14 public void outputHelp(TabPrintWriter writer) {
 49  14 writer.print("ArrayInitializer" + ":");
 50  14 writer.indent();
 51   
 52  14 writer.startLine("");
 53  14 writer.print("sourceInfo = ");
 54  14 SourceInfo temp_sourceInfo = getSourceInfo();
 55  14 if (temp_sourceInfo == null) {
 56  0 writer.print("null");
 57    } else {
 58  14 writer.print(temp_sourceInfo);
 59    }
 60   
 61  14 writer.startLine("");
 62  14 writer.print("items = ");
 63  14 writer.print("{");
 64  14 writer.indent();
 65  14 for (int i = 0; i < getItems().length; i++) {
 66  38 VariableInitializerI temp_items = getItems()[i];
 67  38 writer.startLine("#" + i + ": ");
 68  38 if (temp_items == null) {
 69  0 writer.print("null");
 70    } else {
 71  38 temp_items.outputHelp(writer);
 72    }
 73    }
 74  14 writer.unindent();
 75  14 if (getItems().length > 0) {
 76  14 writer.startLine("");
 77    }
 78  14 writer.print("}");
 79  14 writer.unindent();
 80    }
 81   
 82    /**
 83    * Implementation of equals that is based on the values
 84    * of the fields of the object. Thus, two objects
 85    * created with identical parameters will be equal.
 86    */
 87  0 public boolean equals(java.lang.Object obj) {
 88  0 if (obj == null) return false;
 89  0 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 90  0 return false;
 91    } else {
 92  0 ArrayInitializer casted = (ArrayInitializer) obj;
 93  0 if (this.getItems().length != casted.getItems().length) return false;
 94  0 for (int i = 0; i < getItems().length; i++) if (! getItems()[i].equals(casted.getItems()[i])) return false;
 95  0 return true;
 96    }
 97    }
 98   
 99    /**
 100    * Implementation of hashCode that is consistent with
 101    * equals. The value of the hashCode is formed by
 102    * XORing the hashcode of the class object with
 103    * the hashcodes of all the fields of the object.
 104    */
 105  0 protected int generateHashCode() {
 106  0 int code = getClass().hashCode();
 107  0 code ^= 0;
 108  0 for (int i = 0; i < getItems().length; i++) code ^= getItems()[i].hashCode();
 109  0 return code;
 110    }
 111    }