Clover coverage report - DynamicJava Test Coverage (dynamicjava-20110903-r5436)
Coverage timestamp: Sat Sep 3 2011 03:02:20 CDT
file stats: LOC: 34   Methods: 12
NCLOC: 25   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ArrayLengthField.java - 36.4% 41.7% 39.1%
coverage coverage
 1    package edu.rice.cs.dynamicjava.symbol;
 2   
 3    import java.lang.reflect.Array;
 4    import edu.rice.cs.plt.lambda.Box;
 5    import edu.rice.cs.plt.tuple.Option;
 6    import edu.rice.cs.dynamicjava.symbol.type.Type;
 7   
 8    /** Provides a DJField interface for accessing an array's implicit "length" field. */
 9    public class ArrayLengthField implements DJField {
 10   
 11    public static final ArrayLengthField INSTANCE = new ArrayLengthField();
 12   
 13    /** Limit access to constructor. Singleton should be used instead. */
 14  1 private ArrayLengthField() {}
 15   
 16  0 public String declaredName() { return "length"; }
 17  0 public DJClass declaringClass() { return null; }
 18  216 public Type type() { return TypeSystem.INT; }
 19  0 public boolean isFinal() { return true; }
 20  108 public boolean isStatic() { return false; }
 21  0 public Access accessibility() { return Access.PUBLIC; }
 22  0 public Access.Module accessModule() { return new TopLevelAccessModule("java.lang"); }
 23   
 24  0 public Option<Object> constantValue() { return Option.none(); }
 25  38 public Box<Object> boxForReceiver(final Object receiver) {
 26  38 return new Box<Object>() {
 27  38 public Object value() { return Array.getLength(receiver); }
 28  0 public void set(Object val) {
 29  0 throw new RuntimeException(new IllegalAccessException("Can't set an array's length"));
 30    }
 31    };
 32    }
 33   
 34    }