test coverage. now > 95%

This commit is contained in:
Andy Clement
2009-05-27 19:59:32 +00:00
parent 233c84e0b9
commit 88e32a3cfe
4 changed files with 27 additions and 6 deletions

View File

@@ -119,8 +119,7 @@ public class SpelExpression implements Expression {
* {@inheritDoc}
*/
public Class getValueType(EvaluationContext context) throws EvaluationException {
// TODO is this a legal implementation? The null return value could be very unhelpful. See other getValueType()
// also.
// TODO both getValueType() methods could use getValueInternal and return a type descriptor from the resultant TypedValue
Object value = getValue(context);
return (value != null ? value.getClass() : null);
}

View File

@@ -40,10 +40,8 @@ public abstract class SpelNodeImpl implements SpelNode, CommonTypeDescriptors {
public SpelNodeImpl(int pos, SpelNodeImpl... operands) {
this.pos = pos;
if (pos==0) {
// pos embodies start and end so can never be zero because tokens cannot be zero length
throw new IllegalStateException("Node cannot have zero position: "+this.getClass());
}
// pos combines start and end so can never be zero because tokens cannot be zero length
assert pos!=0;
if (operands!=null && operands.length>0) {
this.children = operands;
}