[lucene-solr] 03/04: Fixed a test failure with Java 8 (Closes: #760927)
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jul 13 13:29:55 UTC 2015
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository lucene-solr.
commit 36b3efbcf406f48ccb8ff0dc44cd7b3bc20029c7
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Mon Jul 13 14:43:13 2015 +0200
Fixed a test failure with Java 8 (Closes: #760927)
---
debian/changelog | 1 +
debian/patches/java8-compatibility.patch | 41 ++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 43 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index ced11d1..303a7fd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ lucene-solr (3.6.2+dfsg-7) UNRELEASED; urgency=medium
* Team upload.
* Removed the dependency on libgeronimo-stax-1.2-spec-java
* Fixed a test failure with commons-codec 1.10
+ * Fixed a test failure with Java 8 (Closes: #760927)
-- Emmanuel Bourg <ebourg at apache.org> Mon, 13 Jul 2015 10:19:53 +0200
diff --git a/debian/patches/java8-compatibility.patch b/debian/patches/java8-compatibility.patch
new file mode 100644
index 0000000..332ea02
--- /dev/null
+++ b/debian/patches/java8-compatibility.patch
@@ -0,0 +1,41 @@
+Description: Fix a test failure with Java 8
+Origin: backport, https://svn.apache.org/r1367129
+Bug-Debian: http://bugs.debian.org/760927
+--- a/solr/core/src/test/org/apache/solr/handler/component/DummyCustomParamSpellChecker.java
++++ b/solr/core/src/test/org/apache/solr/handler/component/DummyCustomParamSpellChecker.java
+@@ -9,9 +9,11 @@
+ import org.apache.solr.spelling.SpellingResult;
+
+ import java.io.IOException;
++import java.util.ArrayList;
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Iterator;
++import java.util.List;
+ /**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+@@ -56,12 +58,20 @@
+
+ SpellingResult result = new SpellingResult();
+ //just spit back out the results
++
++ // sort the keys to make ordering predictable
+ Iterator<String> iterator = options.customParams.getParameterNamesIterator();
++ List<String> lst = new ArrayList<String>();
++ while (iterator.hasNext()) {
++ lst.add(iterator.next());
++ }
++ Collections.sort(lst);
++
+ int i = 0;
+- while (iterator.hasNext()){
+- String name = iterator.next();
++ for (String name : lst) {
+ String value = options.customParams.get(name);
+- result.add(new Token(name, i++, i++), Collections.singletonList(value));
++ result.add(new Token(name, i, i+1), Collections.singletonList(value));
++ i += 2;
+ }
+ return result;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index ae65253..baeab1c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ CVE-2013-6397.patch
CVE-2013-6407_CVE-2013-6408.patch
jetty8-compatibility.patch
commons-codec-compatibility.patch
+java8-compatibility.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/lucene-solr.git
More information about the pkg-java-commits
mailing list