Apache Lucene open-source search software
LUCENE-5950: Move to Java 8 as minimum Java version
Ryan Ernst5e17f315d47f
diff --git a/build.xml b/build.xmlindex e0808c625cc..57f848ea33d 100644--- a/build.xml+++ b/build.xml@@ -279,7 +279,7 @@<echo>SUCCESS: You must right-click your project and choose Refresh.- Your project must use a Java 7 JRE.+ Your project must use a Java 8 JRE.</echo></target>@@ -326,7 +326,7 @@ following two XML attributes/values (adjust values according toJDKs you have defined locally - seeFile | Project Structure | Platform Settings | SDKs):- idea.jdk = project-jdk-name="1.7" project-jdk-type="JavaSDK"+ idea.jdk = project-jdk-name="1.8" project-jdk-type="JavaSDK"</echo></target>@@ -373,22 +373,13 @@ File | Project Structure | Platform Settings | SDKs):</subant></target>- <target name="-nightly-smoke-java8params" if="smokeTestRelease.java8">- <!-- convert path to UNIX style, so windows backslashes don't hurt escaping: -->- <pathconvert targetos="unix" property="-smokeTestRelease.java8params">- <regexpmapper from="^(.*)$" to="--test-java8 '\1'"/>- <path location="${smokeTestRelease.java8}"/>- </pathconvert>- </target>-- <target name="nightly-smoke" description="Builds an unsigned release and smoke tests it (pass '-DsmokeTestRelease.java8=/path/to/jdk1.8.0' to additionally test with Java 8)"- depends="clean,-nightly-smoke-java8params">- <fail message="To run nightly smoke, the JDK must be exactly Java 1.7, was: ${java.specification.version}">+ <target name="nightly-smoke" description="Builds an unsigned release and smoke tests it"+ depends="clean">+ <fail message="To run nightly smoke, the JDK must be exactly Java 1.8, was: ${java.specification.version}"><condition>- <not><equals arg1="${java.specification.version}" arg2="1.7"/></not>+ <not><equals arg1="${java.specification.version}" arg2="1.8"/></not></condition></fail>- <property name="-smokeTestRelease.java8params" value=""/><!-- (if not yet defined) --><exec executable="${python32.exe}" failonerror="true" taskname="python32"><arg value="-V"/></exec>@@ -412,7 +403,6 @@ File | Project Structure | Platform Settings | SDKs):<!-- Tell Python not to write any bytecode cache into the filesystem: --><arg value="-B"/><arg file="dev-tools/scripts/smokeTestRelease.py"/>- <arg line="${-smokeTestRelease.java8params}"/><arg value="--revision"/><arg value="skip"/><!-- pass ${version.base} here to emulate a real release, without appendix like "-SNAPSHOT": -->diff --git a/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefs b/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefsindex c8527279444..5ad4c2a00e7 100644--- a/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefs+++ b/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefs@@ -1,7 +1,7 @@#Sun Sep 23 13:02:27 EDT 2012eclipse.preferences.version=1-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7-org.eclipse.jdt.core.compiler.compliance=1.7+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8+org.eclipse.jdt.core.compiler.compliance=1.8org.eclipse.jdt.core.compiler.doc.comment.support=enabledorg.eclipse.jdt.core.compiler.problem.assertIdentifier=errororg.eclipse.jdt.core.compiler.problem.enumIdentifier=error@@ -18,7 +18,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignoreorg.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabledorg.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabledorg.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public-org.eclipse.jdt.core.compiler.source=1.7+org.eclipse.jdt.core.compiler.source=1.8org.eclipse.jdt.core.formatter.align_type_members_on_columns=falseorg.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0diff --git a/dev-tools/maven/README.maven b/dev-tools/maven/README.mavenindex 8bd031c9ab1..a942ec99369 100644--- a/dev-tools/maven/README.maven+++ b/dev-tools/maven/README.maven@@ -36,7 +36,7 @@ A. How to use nightly Jenkins-built Lucene/Solr Maven artifactsB. How to generate Lucene/Solr Maven artifacts- Prerequisites: JDK 1.7+ and Ant 1.8.2++ Prerequisites: JDK 1.8+ and Ant 1.8.2+Run 'ant generate-maven-artifacts' to create an internal Mavenrepository, including POMs, binary .jars, source .jars, and javadoc@@ -50,7 +50,7 @@ B. How to generate Lucene/Solr Maven artifactsC. How to deploy Maven artifacts to a repository- Prerequisites: JDK 1.7+ and Ant 1.8.2++ Prerequisites: JDK 1.8+ and Ant 1.8.2+You can deploy targets for all of Lucene/Solr, only Lucene, or only Solr,as in B. above. To deploy to a Maven repository, the command is the same@@ -77,7 +77,7 @@ D. How to use Maven to build Lucene/SolrThe details, followed by some example Maven commands:- 1. Prerequisites: JDK 1.7+ and Maven 2.2.1 or 3.X+ 1. Prerequisites: JDK 1.8+ and Maven 2.2.1 or 3.X2. Make sure your sources are up to date. If you checked your sources outfrom the Apache Subversion repository, run "svn update" from the topdiff --git a/dev-tools/maven/pom.xml.template b/dev-tools/maven/pom.xml.templateindex 7bc80429b3f..f5dd902c6e3 100644--- a/dev-tools/maven/pom.xml.template+++ b/dev-tools/maven/pom.xml.template@@ -43,7 +43,7 @@<vc-browse-base-url>http://svn.apache.org/viewvc/lucene/dev/trunk</vc-browse-base-url><specification.version>@spec.version@</specification.version><maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>- <java.compat.version>1.7</java.compat.version>+ <java.compat.version>1.8</java.compat.version><jetty.version>8.1.10.v20130312</jetty.version><!-- RandomizedTesting library system properties -->diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.pyindex c88257ea4f4..2e1c18fa636 100644--- a/dev-tools/scripts/smokeTestRelease.py+++ b/dev-tools/scripts/smokeTestRelease.py@@ -171,15 +171,15 @@ def checkJARMetaData(desc, jarFile, svnRevision, version):for verify in ('Specification-Vendor: The Apache Software Foundation','Implementation-Vendor: The Apache Software Foundation',- # Make sure 1.7 compiler was used to build release bits:- 'X-Compile-Source-JDK: 1.7',+ # Make sure 1.8 compiler was used to build release bits:+ 'X-Compile-Source-JDK: 1.8',# Make sure 1.8 ant was used to build release bits: (this will match 1.8+)'Ant-Version: Apache Ant 1.8',- # Make sure .class files are 1.7 format:- 'X-Compile-Target-JDK: 1.7',+ # Make sure .class files are 1.8 format:+ 'X-Compile-Target-JDK: 1.8','Specification-Version: %s' % version,- # Make sure the release was compiled with 1.7:- 'Created-By: 1.7'):+ # Make sure the release was compiled with 1.8:+ 'Created-By: 1.8'):if s.find(verify) == -1:raise RuntimeError('%s is missing "%s" inside its META-INF/MANIFEST.MF' % \(desc, verify))@@ -705,54 +705,32 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, teraise RuntimeError('source release has WARs...')print(' run "ant validate"')- java.run_java7('ant validate', '%s/validate.log' % unpackPath)+ java.run_java8('ant validate', '%s/validate.log' % unpackPath)if project == 'lucene':- print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs)- java.run_java7('ant clean test %s' % testArgs, '%s/test.log' % unpackPath)- java.run_java7('ant jar', '%s/compile.log' % unpackPath)- testDemo(java.run_java7, isSrc, version, '1.7')+ print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs)+ java.run_java8('ant clean test %s' % testArgs, '%s/test.log' % unpackPath)+ java.run_java8('ant jar', '%s/compile.log' % unpackPath)+ testDemo(java.run_java8, isSrc, version, '1.8')- print(' generate javadocs w/ Java 7...')- java.run_java7('ant javadocs', '%s/javadocs.log' % unpackPath)+ print(' generate javadocs w/ Java 8...')+ java.run_java8('ant javadocs', '%s/javadocs.log' % unpackPath)checkJavadocpathFull('%s/build/docs' % unpackPath)- if java.run_java8:- print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs)- java.run_java8('ant clean test %s' % testArgs, '%s/test.log' % unpackPath)- java.run_java8('ant jar', '%s/compile.log' % unpackPath)- testDemo(java.run_java8, isSrc, version, '1.8')-- print(' generate javadocs w/ Java 8...')- java.run_java8('ant javadocs', '%s/javadocs.log' % unpackPath)- checkJavadocpathFull('%s/build/docs' % unpackPath)-else:os.chdir('solr')- print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs)- java.run_java7('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath)+ print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs)+ java.run_java8('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath)# test javadocs- print(' generate javadocs w/ Java 7...')- java.run_java7('ant clean javadocs', '%s/javadocs.log' % unpackPath)+ print(' generate javadocs w/ Java 8...')+ java.run_java8('ant clean javadocs', '%s/javadocs.log' % unpackPath)checkJavadocpathFull('%s/solr/build/docs' % unpackPath, False)- print(' test solr example w/ Java 7...')- java.run_java7('ant clean example', '%s/antexample.log' % unpackPath)- testSolrExample(unpackPath, java.java7_home, True)-- if java.run_java8:- print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs)- java.run_java8('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath)-- print(' generate javadocs w/ Java 8...')- java.run_java8('ant clean javadocs', '%s/javadocs.log' % unpackPath)- checkJavadocpathFull('%s/solr/build/docs' % unpackPath, False)-- print(' test solr example w/ Java 8...')- java.run_java8('ant clean example', '%s/antexample.log' % unpackPath)- testSolrExample(unpackPath, java.java8_home, True)+ print(' test solr example w/ Java 8...')+ java.run_java8('ant clean example', '%s/antexample.log' % unpackPath)+ testSolrExample(unpackPath, java.java8_home, True)os.chdir('..')print(' check NOTICE')@@ -763,9 +741,7 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, techeckAllJARs(os.getcwd(), project, svnRevision, version, tmpDir, baseURL)if project == 'lucene':- testDemo(java.run_java7, isSrc, version, '1.7')- if java.run_java8:- testDemo(java.run_java8, isSrc, version, '1.8')+ testDemo(java.run_java8, isSrc, version, '1.8')print(' check Lucene\'s javadoc JAR')checkJavadocpath('%s/docs' % unpackPath)@@ -773,24 +749,14 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, teelse:checkSolrWAR('%s/server/webapps/solr.war' % unpackPath, svnRevision, version, tmpDir, baseURL)- print(' copying unpacked distribution for Java 7 ...')- java7UnpackPath = '%s-java7' % unpackPath- if os.path.exists(java7UnpackPath):- shutil.rmtree(java7UnpackPath)- shutil.copytree(unpackPath, java7UnpackPath)- os.chdir(java7UnpackPath)- print(' test solr example w/ Java 7...')- testSolrExample(java7UnpackPath, java.java7_home, False)-- if java.run_java8:- print(' copying unpacked distribution for Java 8 ...')- java8UnpackPath = '%s-java8' % unpackPath- if os.path.exists(java8UnpackPath):- shutil.rmtree(java8UnpackPath)- shutil.copytree(unpackPath, java8UnpackPath)- os.chdir(java8UnpackPath)- print(' test solr example w/ Java 8...')- testSolrExample(java8UnpackPath, java.java8_home, False)+ print(' copying unpacked distribution for Java 8 ...')+ java8UnpackPath = '%s-java8' % unpackPath+ if os.path.exists(java8UnpackPath):+ shutil.rmtree(java8UnpackPath)+ shutil.copytree(unpackPath, java8UnpackPath)+ os.chdir(java8UnpackPath)+ print(' test solr example w/ Java 8...')+ testSolrExample(java8UnpackPath, java.java8_home, False)os.chdir(unpackPath)@@ -1302,16 +1268,13 @@ def make_java_config(parser, java8_home):def run_java(cmd, logfile):run('%s; %s' % (cmd_prefix, cmd), logfile)return run_java- java7_home = os.environ.get('JAVA_HOME')- if java7_home is None:+ java8_home = os.environ.get('JAVA_HOME')+ if java8_home is None:parser.error('JAVA_HOME must be set')- run_java7 = _make_runner(java7_home, '1.7')- run_java8 = None- if java8_home is not None:- run_java8 = _make_runner(java8_home, '1.8')+ run_java8 = _make_runner(java8_home, '1.8')- jc = namedtuple('JavaConfig', 'run_java7 java7_home run_java8 java8_home')- return jc(run_java7, java7_home, run_java8, java8_home)+ jc = namedtuple('JavaConfig', 'run_java8 java8_home')+ return jc(run_java8, java8_home)version_re = re.compile(r'(\d+\.\d+\.\d+(-ALPHA|-BETA)?)')revision_re = re.compile(r'rev(\d+)')diff --git a/lucene/BUILD.txt b/lucene/BUILD.txtindex 5658305de0c..9c66e813662 100644--- a/lucene/BUILD.txt+++ b/lucene/BUILD.txt@@ -1,19 +1,19 @@Lucene Build InstructionsBasic steps:- 0) Install JDK 1.7 (or greater), Ant 1.8.2+, Ivy 2.2.0+ 0) Install JDK 1.8 (or greater), Ant 1.8.2+, Ivy 2.2.01) Download Lucene from Apache and unpack it2) Connect to the top-level of your Lucene installation3) Install JavaCC (optional)4) Run ant-Step 0) Set up your development environment (JDK 1.7 or greater,+Step 0) Set up your development environment (JDK 1.8 or greater,Ant 1.8.2+, Ivy 2.2.0)We'll assume that you know how to get and set up the JDK - if you-don't, then we suggest starting at http://java.sun.com and learning+don't, then we suggest starting at http://www.oracle.com/java/ and learningmore about Java, before returning to this README. Lucene runs with-JDK 1.7 and later.+JDK 1.8 and later.Like many Open Source java projects, Lucene uses Apache Ant for buildcontrol. Specifically, you MUST use Ant version 1.8.2+.diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 1d9d55ab80c..46a1d58e81b 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -5,6 +5,11 @@ http://s.apache.org/luceneversions======================= Lucene 6.0.0 =======================+System Requirements++* LUCENE-5950: Move to Java 8 as minimum Java version.+ (Ryan Ernst)+New FeaturesAPI Changesdiff --git a/lucene/SYSTEM_REQUIREMENTS.txt b/lucene/SYSTEM_REQUIREMENTS.txtindex 623120de281..a8887198555 100644--- a/lucene/SYSTEM_REQUIREMENTS.txt+++ b/lucene/SYSTEM_REQUIREMENTS.txt@@ -1,9 +1,6 @@# System Requirements-Apache Lucene runs of Java 7 or greater, Java 8 is verified to be-compatible and may bring some performance improvements. When using-Oracle Java 7 or OpenJDK 7, be sure to not use the GA build 147 or-update versions u40, u45 and u51! We recommend using u55 or later.+Apache Lucene runs on Java 8 or greater.It is also recommended to always use the latest update version of yourJava VM, because bugs may affect Lucene. An overview of known JVM bugsdiff --git a/lucene/build.xml b/lucene/build.xmlindex 0b98bb6cdac..a1c4c867a32 100644--- a/lucene/build.xml+++ b/lucene/build.xml@@ -336,7 +336,7 @@<svn-export-source source.dir="."/><!-- Exclude javadoc package-list files under licenses incompatible with the ASL -->- <delete dir="${svn.export.dir}/tools/javadoc/java7"/>+ <delete dir="${svn.export.dir}/tools/javadoc/java8"/><!-- Exclude clover license files incompatible with the ASL --><delete dir="${svn.export.dir}/tools/clover"/>diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex 772fa65cc78..0ac0d7e6842 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -162,13 +162,13 @@<property name="javac.deprecation" value="off"/><property name="javac.debug" value="on"/>- <property name="javac.source" value="1.7"/>- <property name="javac.target" value="1.7"/>+ <property name="javac.source" value="1.8"/>+ <property name="javac.target" value="1.8"/><property name="javac.args" value="-Xlint -Xlint:-deprecation -Xlint:-serial -Xlint:-options"/>- <property name="javadoc.link" value="http://download.oracle.com/javase/7/docs/api/"/>+ <property name="javadoc.link" value="http://download.oracle.com/javase/8/docs/api/"/><property name="javadoc.link.junit" value="http://junit.sourceforge.net/javadoc/"/><property name="javadoc.packagelist.dir" location="${common.dir}/tools/javadoc"/>- <available file="${javadoc.packagelist.dir}/java7/package-list" property="javadoc.java7.packagelist.exists"/>+ <available file="${javadoc.packagelist.dir}/java8/package-list" property="javadoc.java8.packagelist.exists"/><property name="javadoc.access" value="protected"/><property name="javadoc.charset" value="utf-8"/><property name="javadoc.dir" location="${common.dir}/build/docs"/>@@ -287,7 +287,7 @@</propertyset><patternset id="lucene.local.src.package.patterns"- excludes="**/pom.xml,**/*.iml,**/*.jar,build/**,dist/**,benchmark/work/**,benchmark/temp/**,tools/javadoc/java7/**,tools/clover/**"+ excludes="**/pom.xml,**/*.iml,**/*.jar,build/**,dist/**,benchmark/work/**,benchmark/temp/**,tools/javadoc/java8/**,tools/clover/**"/><!-- Default exclude sources and javadoc jars from Ivy fetch to save time and bandwidth -->@@ -304,9 +304,9 @@</condition></fail>- <fail message="Minimum supported Java version is 1.7.">+ <fail message="Minimum supported Java version is 1.8."><condition>- <not><hasmethod classname="java.lang.Throwable" method="getSuppressed"/></not>+ <not><hasmethod classname="java.util.Arrays" method="parallelSort"/></not></condition></fail>@@ -332,7 +332,6 @@--><condition property="build.java.runtime" value="${-cleaned.specification.version}" else="unknown"><or>- <equals arg1="${-cleaned.specification.version}" arg2="1.7"/><equals arg1="${-cleaned.specification.version}" arg2="1.8"/><equals arg1="${-cleaned.specification.version}" arg2="1.9"/></or>@@ -350,10 +349,7 @@<contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/><contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/></or>- <or>- <equals arg1="${build.java.runtime}" arg2="1.7"/>- <equals arg1="${build.java.runtime}" arg2="1.8"/>- </or>+ <equals arg1="${build.java.runtime}" arg2="1.8"/><!-- TODO: Fix this! For now only run this on 64bit, because jTIDY OOMs with default heap size: --><contains string="${os.arch}" substring="64"/></and>@@ -361,15 +357,10 @@<!-- workaround for https://issues.apache.org/bugzilla/show_bug.cgi?id=53347 --><condition property="build.compiler" value="javac1.7">- <and>- <not>- <equals arg1="${build.java.runtime}" arg2="1.7"/>- </not>- <or>- <antversion exactly="1.8.3" />- <antversion exactly="1.8.4" />- </or>- </and>+ <or>+ <antversion exactly="1.8.3" />+ <antversion exactly="1.8.4" />+ </or></condition><target name="-documentation-lint-unsupported" unless="documentation-lint.supported">@@ -381,12 +372,8 @@<echo level="warning" message="WARN: Linting documentation HTML is not supported on this Java version (${build.java.runtime}) / JVM (${java.vm.name}). NOTHING DONE!"/></target>- <!-- for now disable doclint on JDK 8+: -->- <condition property="javadoc.args" value="-Xdoclint:none" else="">- <not>- <equals arg1="${build.java.runtime}" arg2="1.7"/>- </not>- </condition>+ <!-- for now disable doclint: -->+ <property name="javadoc.args" value="-Xdoclint:none"/><!-- Import custom ANT tasks. --><import file="${common.dir}/tools/custom-tasks.xml" />@@ -919,7 +906,7 @@<value><!-- empty/ default encoding. --></value><!--- Disabled because of Java 1.7 bug on Linux/ Unix:+ Disabled because of Java 1.8 bug on Linux/ Unix:http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7181721<value>UTF-16</value>@@ -1875,10 +1862,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<!-- ECJ Javadoc linting: --><condition property="ecj-javadoc-lint.supported">- <or>- <equals arg1="${build.java.runtime}" arg2="1.7"/>- <equals arg1="${build.java.runtime}" arg2="1.8"/>- </or>+ <equals arg1="${build.java.runtime}" arg2="1.8"/></condition><condition property="ecj-javadoc-lint-tests.supported">@@ -1974,7 +1958,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<attribute name="overview" default="${src.dir}/overview.html"/><attribute name="linksource" default="no"/><sequential>- <antcall target="download-java7-javadoc-packagelist"/>+ <antcall target="download-java8-javadoc-packagelist"/><delete file="@{destdir}/stylesheet.css" failonerror="false"/><copy todir="@{destdir}" file="${prettify.dir}/prettify.js" overwrite="false" /><record name="@{destdir}/log_javadoc.txt" action="start" append="no"/>@@ -2004,7 +1988,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<tag name="lucene.internal"description="NOTE: This API is for internal purposes only and might change in incompatible ways in the next release."/><link offline="true" packagelistLoc="${javadoc.dir}"/>- <link offline="true" href="${javadoc.link}" packagelistLoc="${javadoc.packagelist.dir}/java7"/>+ <link offline="true" href="${javadoc.link}" packagelistLoc="${javadoc.packagelist.dir}/java8"/><bottom><![CDATA[<i>Copyright © ${year} Apache Software Foundation. All Rights Reserved.</i><script src='{@docRoot}/prettify.js' type='text/javascript'></script>@@ -2144,10 +2128,10 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}</sequential></macrodef>- <target name="download-java7-javadoc-packagelist" unless="javadoc.java7.packagelist.exists">- <mkdir dir="${javadoc.packagelist.dir}/java7"/>+ <target name="download-java8-javadoc-packagelist" unless="javadoc.java8.packagelist.exists">+ <mkdir dir="${javadoc.packagelist.dir}/java8"/><get src="${javadoc.link}/package-list"- dest="${javadoc.packagelist.dir}/java7/package-list" ignoreerrors="true"/>+ dest="${javadoc.packagelist.dir}/java8/package-list" ignoreerrors="true"/></target><!-- VALIDATION work -->diff --git a/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java b/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.javaindex bed65336649..99c3292e5e6 100644--- a/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java+++ b/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java@@ -101,7 +101,7 @@ public abstract class LiveFieldValues<S,T> implements ReferenceManager.RefreshLiif (value == missingValue) {// Deleted but the deletion is not yet reflected in// the reader:- return null;+ return (T)null;} else if (value != null) {return value;} else {diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java b/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.javaindex b300b513635..36326bb424d 100644--- a/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java+++ b/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java@@ -110,7 +110,10 @@ public class SpanMultiTermQueryWrapper<Q extends MultiTermQuery> extends SpanQuepublic String toString(String field) {StringBuilder builder = new StringBuilder();builder.append("SpanMultiTermQueryWrapper(");- builder.append(query.toString(field));+ // NOTE: query.toString must be placed in a temp local to avoid compile errors on Java 8u20+ // see https://bugs.openjdk.java.net/browse/JDK-8056984?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab+ String queryStr = query.toString(field);+ builder.append(queryStr);builder.append(")");if (getBoost() != 1F) {builder.append('^');diff --git a/lucene/core/src/java/org/apache/lucene/util/Constants.java b/lucene/core/src/java/org/apache/lucene/util/Constants.javaindex 4d767081570..d4fe9ead95f 100644--- a/lucene/core/src/java/org/apache/lucene/util/Constants.java+++ b/lucene/core/src/java/org/apache/lucene/util/Constants.java@@ -92,7 +92,7 @@ public final class Constants {}JRE_IS_64BIT = is64Bit;}-+public static final boolean JRE_IS_MINIMUM_JAVA8 = JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 8);public static final boolean JRE_IS_MINIMUM_JAVA9 = JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 9);diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.javaindex 4676904ef6e..d5be334d9e7 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java@@ -113,7 +113,9 @@ public class TestPrefixCodedTerms extends LuceneTestCase {}Iterator<Term> expected = superSet.iterator();- Iterator<Term> actual = new MergedIterator<>(subs.toArray(new Iterator[0]));+ // NOTE: currenlty using diamond operator on MergedIterator (without explicit Term class) causes+ // errors on ecj used for javadoc lint+ Iterator<Term> actual = new MergedIterator<Term>(subs.toArray(new Iterator[0]));while (actual.hasNext()) {assertTrue(expected.hasNext());assertEquals(expected.next(), actual.next());diff --git a/lucene/expressions/build.xml b/lucene/expressions/build.xmlindex 123e92c4723..4efbb867216 100644--- a/lucene/expressions/build.xml+++ b/lucene/expressions/build.xml@@ -98,10 +98,6 @@<property name="-grammar.relative.path" location="${grammar.path}" relative="true"/><replace-value property="grammar.relative.path" value="${-grammar.relative.path}${file.separator}" from="${file.separator}" to="/"/><java classname="org.antlr.Tool" fork="true" failonerror="true" classpathref="antlr.classpath" taskname="antlr">- <!-- this is a hack because antlr generates code comments in nondeterministic order- (using HashMap somewhere it should use LinkedHashMap). This hack only works for Java 7,- Java 8 always uses murmurhash for strings and uses time-of-day as seed. -->- <sysproperty key="jdk.map.althashing.threshold" value="-1"/><sysproperty key="file.encoding" value="UTF-8"/><sysproperty key="user.language" value="en"/><sysproperty key="user.country" value="US"/>diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.javaindex 3f2f6da307a..bbab2b6a549 100644--- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java+++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java@@ -315,7 +315,9 @@ public class TestGrouping extends LuceneTestCase {BytesRef groupValue = mvalGd.groupValue.exists() ? ((MutableValueStr) mvalGd.groupValue).value.get() : null;groups.add(new GroupDocs<>(Float.NaN, mvalGd.maxScore, mvalGd.totalHits, mvalGd.scoreDocs, groupValue, mvalGd.groupSortValues));}- return new TopGroups<>(mvalTopGroups.groupSort, mvalTopGroups.withinGroupSort, mvalTopGroups.totalHitCount, mvalTopGroups.totalGroupedHitCount, groups.toArray(new GroupDocs[groups.size()]), Float.NaN);+ // NOTE: currenlty using diamond operator on TopGroups (without explicit Term class) causes+ // errors on ecj used for javadoc lint+ return new TopGroups<BytesRef>(mvalTopGroups.groupSort, mvalTopGroups.withinGroupSort, mvalTopGroups.totalHitCount, mvalTopGroups.totalGroupedHitCount, groups.toArray(new GroupDocs[groups.size()]), Float.NaN);}fail();return null;diff --git a/lucene/tools/javadoc/ecj.javadocs.prefs b/lucene/tools/javadoc/ecj.javadocs.prefsindex 8a01bdd379d..63f22e6c1ec 100644--- a/lucene/tools/javadoc/ecj.javadocs.prefs+++ b/lucene/tools/javadoc/ecj.javadocs.prefs@@ -4,9 +4,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNorg.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefaultorg.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabledorg.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7-org.eclipse.jdt.core.compiler.compliance=1.7+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8+org.eclipse.jdt.core.compiler.compliance=1.8org.eclipse.jdt.core.compiler.doc.comment.support=enabledorg.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignoreorg.eclipse.jdt.core.compiler.problem.assertIdentifier=error@@ -93,4 +93,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disaorg.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignoreorg.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignoreorg.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=ignore-org.eclipse.jdt.core.compiler.source=1.7+org.eclipse.jdt.core.compiler.source=1.8diff --git a/lucene/tools/javadoc/java7/package-list b/lucene/tools/javadoc/java8/package-listsimilarity index 96%rename from lucene/tools/javadoc/java7/package-listrename to lucene/tools/javadoc/java8/package-listindex b52fe94b6a1..351c1868559 100644--- a/lucene/tools/javadoc/java7/package-list+++ b/lucene/tools/javadoc/java8/package-list@@ -44,15 +44,22 @@ java.security.specjava.sqljava.textjava.text.spi+java.time+java.time.chrono+java.time.format+java.time.temporal+java.time.zonejava.utiljava.util.concurrentjava.util.concurrent.atomicjava.util.concurrent.locks+java.util.functionjava.util.jarjava.util.loggingjava.util.prefsjava.util.regexjava.util.spi+java.util.streamjava.util.zipjavax.accessibilityjavax.activation@@ -204,6 +211,7 @@ org.w3c.domorg.w3c.dom.bootstraporg.w3c.dom.eventsorg.w3c.dom.ls+org.w3c.dom.viewsorg.xml.saxorg.xml.sax.extorg.xml.sax.helpersdiff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 75be57814c7..53c9d648454 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -29,6 +29,11 @@ Velocity 1.7 and Velocity Tools 2.0Apache UIMA 2.3.1Apache ZooKeeper 3.4.6+System Requirements+----------------------+* LUCENE-5950: Move to Java 8 as minimum Java version.+ (Ryan Ernst)+Upgrading from Solr 5.x----------------------diff --git a/solr/README.txt b/solr/README.txtindex 4d5e296dfd4..680e08f524c 100644--- a/solr/README.txt+++ b/solr/README.txt@@ -111,10 +111,10 @@ docs/index.htmlInstructions for Building Apache Solr from Source--------------------------------------------------1. Download the Java SE 7 JDK (Java Development Kit) or later from http://java.sun.com/+1. Download the Java SE 8 JDK (Java Development Kit) or later from http://www.oracle.com/java/You will need the JDK installed, and the $JAVA_HOME/bin (Windows: %JAVA_HOME%\bin)folder included on your command path. To test this, issue a "java -version" command- from your shell (command prompt) and verify that the Java version is 1.7 or later.+ from your shell (command prompt) and verify that the Java version is 1.8 or later.2. Download the Apache Ant binary distribution (1.8.2+) fromhttp://ant.apache.org/ You will need Ant installed and the $ANT_HOME/bin (Windows:diff --git a/solr/SYSTEM_REQUIREMENTS.txt b/solr/SYSTEM_REQUIREMENTS.txtindex a14c8f5d838..2c0fa87981e 100644--- a/solr/SYSTEM_REQUIREMENTS.txt+++ b/solr/SYSTEM_REQUIREMENTS.txt@@ -1,9 +1,6 @@# System Requirements-Apache Solr runs of Java 7 or greater, Java 8 is verified to be-compatible and may bring some performance improvements. When using-Oracle Java 7 or OpenJDK 7, be sure to not use the GA build 147 or-update versions u40, u45 and u51! We recommend using u55 or later.+Apache Solr runs of Java 8 or greater.It is also recommended to always use the latest update version of yourJava VM, because bugs may affect Solr. An overview of known JVM bugsdiff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmdindex 3063583e39a..a7035b32202 100644--- a/solr/bin/solr.cmd+++ b/solr/bin/solr.cmd@@ -1052,11 +1052,11 @@ IF "%FIRST_ARG%"=="start" ():need_java_home-@echo Please set the JAVA_HOME environment variable to the path where you installed Java 1.7++@echo Please set the JAVA_HOME environment variable to the path where you installed Java 1.8+goto done:need_java_vers-@echo Java 1.7 or later is required to run Solr.+@echo Java 1.8 or later is required to run Solr.goto done:errdiff --git a/solr/build.xml b/solr/build.xmlindex 022f9ec05d1..1404f5baa43 100644--- a/solr/build.xml+++ b/solr/build.xml@@ -380,7 +380,7 @@<svn-export-source source.dir=".."/><!-- Exclude javadoc package-list files under licenses incompatible with the ASL -->- <delete dir="${svn.export.dir}/lucene/tools/javadoc/java7"/>+ <delete dir="${svn.export.dir}/lucene/tools/javadoc/java8"/><!-- Exclude clover license files incompatible with the ASL --><delete dir="${svn.export.dir}/lucene/tools/clover"/>diff --git a/solr/common-build.xml b/solr/common-build.xmlindex f964aa5ae85..223e360b5bb 100644--- a/solr/common-build.xml+++ b/solr/common-build.xml@@ -25,9 +25,9 @@<property name="Name" value="Solr" />- <!-- solr uses 1.7 -->- <property name="javac.source" value="1.7"/>- <property name="javac.target" value="1.7"/>+ <!-- solr uses 1.8 -->+ <property name="javac.source" value="1.8"/>+ <property name="javac.target" value="1.8"/><property name="javac.args" value=""/><property name="dest" location="${common-solr.dir}/build" />diff --git a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xmlindex 981577c5446..3ca6b12c27c 100644--- a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml+++ b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml@@ -244,7 +244,7 @@See the Java Regular Expression documentation for moreinfomation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xmlindex 8eb1bde0e2a..a40174cca22 100644--- a/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml+++ b/solr/contrib/dataimporthandler/src/test-files/dih/solr/collection1/conf/dataimport-solr_id-schema.xml@@ -229,7 +229,7 @@See the Java Regular Expression documentation for moreinfomation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml b/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xmlindex fe70b376d68..997dc3c562d 100644--- a/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml+++ b/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/schema.xml@@ -361,7 +361,7 @@documentation for more information on pattern and replacementstring syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])"replacement="" replace="all" />diff --git a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xmlindex f63705bc399..62d1f91c7eb 100644--- a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml+++ b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml@@ -357,7 +357,7 @@documentation for more information on pattern and replacementstring syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])"replacement="" replace="all" />diff --git a/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.javaindex 1ce15fa8ae5..636697322b8 100644--- a/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java+++ b/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java@@ -59,8 +59,9 @@ public final class MaxFieldValueUpdateProcessorFactory extends FieldValueSubsetUpublic Collection pickSubset(Collection values) {Collection result = values;try {- result = Collections.singletonList- (Collections.max(values));+ // NOTE: max must be put into a temp local in order to avoid ecj errors for javadoc lint+ Object max = Collections.max(values);+ result = Collections.singletonList(max);} catch (ClassCastException e) {throw new SolrException(BAD_REQUEST,diff --git a/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.javaindex fe4e23b12de..da18d73f3e4 100644--- a/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java+++ b/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java@@ -59,8 +59,9 @@ public final class MinFieldValueUpdateProcessorFactory extends FieldValueSubsetUpublic Collection pickSubset(Collection values) {Collection result = values;try {- result = Collections.singletonList- (Collections.min(values));+ // NOTE: min must be put into a temp local in order to avoid ecj errors for javadoc lint+ Object min = Collections.min(values);+ result = Collections.singletonList(min);} catch (ClassCastException e) {throw new SolrException(BAD_REQUEST,diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xmlindex 0f879b038e7..bb2b3541e74 100644--- a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml+++ b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml@@ -219,7 +219,7 @@See the Java Regular Expression documentation for moreinfomation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/core/src/test-files/solr/collection1/conf/schema11.xml b/solr/core/src/test-files/solr/collection1/conf/schema11.xmlindex 6bf7d6208a5..92b352e43f4 100755--- a/solr/core/src/test-files/solr/collection1/conf/schema11.xml+++ b/solr/core/src/test-files/solr/collection1/conf/schema11.xml@@ -214,7 +214,7 @@See the Java Regular Expression documentation for moreinfomation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/example/example-DIH/solr/db/conf/schema.xml b/solr/example/example-DIH/solr/db/conf/schema.xmlindex 99b301c8025..4d8bc335843 100755--- a/solr/example/example-DIH/solr/db/conf/schema.xml+++ b/solr/example/example-DIH/solr/db/conf/schema.xml@@ -615,7 +615,7 @@See the Java Regular Expression documentation for moreinformation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/example/example-DIH/solr/mail/conf/schema.xml b/solr/example/example-DIH/solr/mail/conf/schema.xmlindex 3a63422ae69..db4a8227fda 100755--- a/solr/example/example-DIH/solr/mail/conf/schema.xml+++ b/solr/example/example-DIH/solr/mail/conf/schema.xml@@ -534,7 +534,7 @@See the Java Regular Expression documentation for moreinformation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/example/example-DIH/solr/rss/conf/schema.xml b/solr/example/example-DIH/solr/rss/conf/schema.xmlindex 1c611facb16..16bd650bbca 100755--- a/solr/example/example-DIH/solr/rss/conf/schema.xml+++ b/solr/example/example-DIH/solr/rss/conf/schema.xml@@ -565,7 +565,7 @@See the Java Regular Expression documentation for moreinformation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/example/example-DIH/solr/solr/conf/schema.xml b/solr/example/example-DIH/solr/solr/conf/schema.xmlindex 04fb4ce64d9..465b717d302 100755--- a/solr/example/example-DIH/solr/solr/conf/schema.xml+++ b/solr/example/example-DIH/solr/solr/conf/schema.xml@@ -615,7 +615,7 @@See the Java Regular Expression documentation for moreinformation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/schema.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/schema.xmlindex 208e9cf4095..0a93b74b31c 100755--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/schema.xml+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/schema.xml@@ -616,7 +616,7 @@See the Java Regular Expression documentation for moreinformation on pattern and replacement string syntax.- http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html+ http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html--><filter class="solr.PatternReplaceFilterFactory"pattern="([^a-z])" replacement="" replace="all"diff --git a/solr/site/html/tutorial.html b/solr/site/html/tutorial.htmlindex db5dfb16a5d..725c1aad64b 100755--- a/solr/site/html/tutorial.html+++ b/solr/site/html/tutorial.html@@ -54,13 +54,13 @@ To follow along with this tutorial, you will need...</p><ol>-<li>Java 1.7 or greater. Some places you can get it are from+<li>Java 1.8 or greater. Some places you can get it are from<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Oracle</a>,<a href="http://openjdk.java.net/">Open JDK</a>, or<a href="http://www.ibm.com/developerworks/java/jdk/">IBM</a>.<ul><li>Running <span class="codefrag">java -version</span> at the command- line should indicate a version number starting with 1.7.+ line should indicate a version number starting with 1.8.</li><li>Gnu's GCJ is not supported and does not work with Solr.</li></ul>