Skip to content

Apache Lucene open-source search software

use setTimeinMillis - we require 1.4 so we don't need to worry that it was protected on 1.3 anymore

Mark Robert Miller370a3f458053
diff --git a/src/java/org/apache/lucene/document/DateTools.java b/src/java/org/apache/lucene/document/DateTools.java
index 3e4c1c6a757..4cbdd3857bb 100644
--- a/src/java/org/apache/lucene/document/DateTools.java
+++ b/src/java/org/apache/lucene/document/DateTools.java
@@ -88,10 +88,7 @@ public class DateTools {
public static String timeToString(long time, Resolution resolution) {
Calendar cal = Calendar.getInstance(GMT);
- //protected in JDK's prior to 1.4
- //cal.setTimeInMillis(round(time, resolution));
-
- cal.setTime(new Date(round(time, resolution)));
+ cal.setTimeInMillis(round(time, resolution));
String result;
if (resolution == Resolution.YEAR) {