6912866: (date) java.util.Date.before / after may be expensive
authorokutsu
Tue, 26 Jan 2010 15:42:06 +0900
changeset 4847 22fbbcbcab1d
parent 4846 48f8e6d40dde
child 4848 ffcc849b9351
6912866: (date) java.util.Date.before / after may be expensive Reviewed-by: peytoia
jdk/src/share/classes/java/util/Date.java
--- 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();