Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-10303: Fix precommit

Joel Bernstein0bcd88b181b3
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TemporalEvaluatorEpoch.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TemporalEvaluatorEpoch.java
index bea4f5ddaee..a8554b3e580 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TemporalEvaluatorEpoch.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TemporalEvaluatorEpoch.java
@@ -20,7 +20,6 @@ package org.apache.solr.client.solrj.io.eval;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
-import java.time.temporal.ChronoField;
import java.time.temporal.TemporalAccessor;
import java.util.Locale;
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.java
index d3b839bbae7..8205cea33a8 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.java
@@ -26,6 +26,7 @@ import java.time.ZoneOffset;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
+import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
@@ -197,8 +198,8 @@ public class TemporalEvaluatorsTest {
@Test
public void testFunctionsOnDate() throws Exception {
- Calendar calendar = new GregorianCalendar(2017,12,5, 23, 59);
- calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
+ Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"), Locale.ROOT);
+ calendar.set(2017, 12, 5, 23, 59);
Date aDate = calendar.getTime();
testFunction("year(a)", aDate, calendar.get(Calendar.YEAR));
testFunction("month(a)", aDate, calendar.get(Calendar.MONTH)+1);
@@ -210,8 +211,8 @@ public class TemporalEvaluatorsTest {
@Test
public void testFunctionsOnInstant() throws Exception {
- Calendar calendar = new GregorianCalendar(2017,12,5, 23, 59);
- calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
+ Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"), Locale.ROOT);
+ calendar.set(2017, 12, 5, 23, 59);
Date aDate = calendar.getTime();
Instant instant = aDate.toInstant();
testFunction("year(a)", instant, calendar.get(Calendar.YEAR));