6912866: (date) java.util.Date.before / after may be expensive
Reviewed-by: peytoia
--- a/jdk/src/share/classes/java/util/Date.java Thu Jan 21 21:53:15 2010 +0300
+++ b/jdk/src/share/classes/java/util/Date.java Tue Jan 26 15:42:06 2010 +0900
@@ -953,7 +953,7 @@
* without affecting its internal state.
*/
static final long getMillisOf(Date date) {
- if (date.cdate == null) {
+ if (date.cdate == null || date.cdate.isNormalized()) {
return date.fastTime;
}
BaseCalendar.Date d = (BaseCalendar.Date) date.cdate.clone();