}
}
}
else if (param1 instanceof Timestamp || param2 instanceof Timestamp) {
if (param1 instanceof Timestamp && param2 instanceof Timestamp) {
throw new ParseException(DATE_ADDITION);
}
Timestamp d;
Number n;
if (param1 instanceof Timestamp) {
d = (Timestamp)param1;
if (param2 instanceof Number) {
n = (Number)param2;
} else {
throw new ParseException(DATE_ADDITION);
}
return new Timestamp(d.getTime()+toDay(n));
}
else if (param2 instanceof Timestamp) {
d = (Timestamp)param2;
if (param1 instanceof Number) {
n = (Number)param1;
} else {
throw new ParseException(DATE_ADDITION);
}
return new Timestamp(d.getTime()+toDay(n));
}
throw new ParseException(INTERNAL_ERROR);
} else {
throw new ParseException(WRONG_TYPE+" ("+param1.getClass()+"+"+param2.getClass()+")");
}
}