You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kr...@apache.org on 2019/01/30 19:58:02 UTC

[lucene-solr] branch jira/solr-9515 updated: Check commons-lang3 FastDateFormat doesn't cause ArrayIndexOutOfBoundsException

This is an automated email from the ASF dual-hosted git repository.

krisden pushed a commit to branch jira/solr-9515
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/jira/solr-9515 by this push:
     new 112cbaa  Check commons-lang3 FastDateFormat doesn't cause ArrayIndexOutOfBoundsException
112cbaa is described below

commit 112cbaa80ef87f1798298d1f1243495686d6b5ac
Author: Kevin Risden <kr...@apache.org>
AuthorDate: Wed Jan 30 14:57:06 2019 -0500

    Check commons-lang3 FastDateFormat doesn't cause ArrayIndexOutOfBoundsException
    
    Signed-off-by: Kevin Risden <kr...@apache.org>
---
 solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java
index 4aa4cb9..db55c92 100644
--- a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java
+++ b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java
@@ -26,6 +26,7 @@ import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.commons.lang3.time.FastDateFormat;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
@@ -67,6 +68,14 @@ public class HdfsTestUtil {
     LuceneTestCase.assumeFalse("HDFS tests were disabled by -Dtests.disableHdfs",
       Boolean.parseBoolean(System.getProperty("tests.disableHdfs", "false")));
 
+    // Checks that commons-lang3 FastDateFormat works with configured locale
+    try {
+      FastDateFormat.getInstance().format(System.currentTimeMillis());
+    } catch (ArrayIndexOutOfBoundsException e) {
+      LuceneTestCase.assumeNoException("commons-lang3 FastDateFormat doesn't work with " +
+          Locale.getDefault().toLanguageTag(), e);
+    }
+
     if (!HA_TESTING_ENABLED) haTesting = false;
 
     int dataNodes = Integer.getInteger("tests.hdfs.numdatanodes", 2);