FULL PRODUCT VERSION :
javaLinux1.5.0_05
ADDITIONAL OS VERSION INFORMATION :
2.6.16-1.2111_FC5
A DESCRIPTION OF THE PROBLEM :
When the "after" method in the Calendar class is passed a non-Calendar object (and more specifically a Date object), it does not throw an exception. It should either handle the comparison with the Date properly, or throw an exception.
public boolean after(Object when) {
return when instanceof Calendar
&& compareTo((Calendar)when) > 0;
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
call "after" with a non-Calendar argument
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect to see an exception.
ACTUAL -
It returns false, when that may or may not be case.
REPRODUCIBILITY :
This bug can be reproduced always.