Apache Lucene open-source search software
LUCENE-7296: Update forbiddenapis to version 2.1
Uwe Schindlera5f19028696a
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex d4f58414909..f6788cabeb8 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -155,6 +155,9 @@ Buildcompilation on Java 9+ to ensure real cross-compilation.(Uwe Schindler)+* LUCENE-7296: Update forbiddenapis to version 2.1.+ (Uwe Schindler)+======================= Lucene 6.0.1 =======================(No Changes)diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex 8fb9ea0721b..b4074ac856f 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -2330,7 +2330,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<property name="forbidden-sysout-excludes" value=""/><target name="-install-forbidden-apis" unless="forbidden-apis.loaded" depends="ivy-availability-check,ivy-configure">- <ivy:cachepath organisation="de.thetaphi" module="forbiddenapis" revision="2.0"+ <ivy:cachepath organisation="de.thetaphi" module="forbiddenapis" revision="2.1"inline="true" conf="default" transitive="true" pathid="forbidden-apis.classpath"/><taskdef name="forbidden-apis" classname="de.thetaphi.forbiddenapis.ant.AntTask" classpathref="forbidden-apis.classpath"/><property name="forbidden-apis.loaded" value="true"/>@@ -2360,11 +2360,12 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<!-- applies to both source and test code --><target name="-check-forbidden-all" depends="-init-forbidden-apis,compile-core,compile-test">- <forbidden-apis internalRuntimeForbidden="true" suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath">+ <forbidden-apis suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath" targetVersion="${javac.release}"><signatures>- <!-- TODO: fix this in forbiddenapis 2.1+ -->- <bundled name="jdk-unsafe-1.${javac.release}"/>- <bundled name="jdk-deprecated-1.${javac.release}"/>+ <bundled name="jdk-unsafe"/>+ <bundled name="jdk-deprecated"/>+ <bundled name="jdk-non-portable"/>+ <bundled name="jdk-reflection"/><fileset dir="${common.dir}/tools/forbiddenApis"><include name="base.txt"/><include name="lucene.txt" if="forbidden-isLucene"/>@@ -2377,7 +2378,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<!-- applies to only test code --><target name="-check-forbidden-tests" depends="-init-forbidden-apis,compile-test">- <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath">+ <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath" targetVersion="${javac.release}"><fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}"/></forbidden-apis></target>@@ -2386,7 +2387,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}<target name="-check-forbidden-core" depends="-init-forbidden-apis,compile-core,-check-forbidden-sysout" /><target name="-check-forbidden-sysout" depends="-init-forbidden-apis,compile-core">- <forbidden-apis bundledSignatures="jdk-system-out" suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath">+ <forbidden-apis bundledSignatures="jdk-system-out" suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath" targetVersion="${javac.release}"><fileset dir="${build.dir}/classes/java" excludes="${forbidden-sysout-excludes}"/></forbidden-apis></target>diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.javaindex 7d9316bd155..fca8386c670 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java@@ -92,7 +92,7 @@ public abstract class QueryNodeImpl implements QueryNode, Cloneable {if (isLeaf() || this.clauses == null) {ResourceBundle bundle = ResourceBundle- .getBundle("org.apache.lucene.queryParser.messages.QueryParserMessages");+ .getBundle("org.apache.lucene.queryParser.messages.QueryParserMessages", Locale.getDefault());String message = bundle.getObject("Q0008E.NODE_ACTION_NOT_SUPPORTED").toString();diff --git a/lucene/tools/forbiddenApis/base.txt b/lucene/tools/forbiddenApis/base.txtindex 401fcec3c92..1bb8118de15 100644--- a/lucene/tools/forbiddenApis/base.txt+++ b/lucene/tools/forbiddenApis/base.txt@@ -27,10 +27,6 @@ java.util.Properties#load(java.io.InputStream)java.util.Properties#save(java.io.OutputStream,java.lang.String)java.util.Properties#store(java.io.OutputStream,java.lang.String)-@defaultMessage Accessing private members of foreign classes breaks in security-sensitive environments. In addition, it no longer works with Java 9 on runtime classes.-java.lang.reflect.AccessibleObject#setAccessible(boolean)-java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObject[],boolean)-java.lang.Character#codePointBefore(char[],int) @ Implicit start offset is error-prone when the char[] is a buffer and the first chars are random charsjava.lang.Character#codePointAt(char[],int) @ Implicit end offset is error-prone when the char[] is a buffer and the last chars are random charsdiff --git a/solr/common-build.xml b/solr/common-build.xmlindex 39e15612379..c6ff09224b0 100644--- a/solr/common-build.xml+++ b/solr/common-build.xml@@ -504,12 +504,15 @@<!-- Forbidden API Task, customizations for Solr --><target name="-check-forbidden-all" depends="-init-forbidden-apis,compile-core,compile-test">- <property prefix="ivyversions" file="${common.dir}/ivy-versions.properties"/> <!-- for commons-io version -->- <forbidden-apis internalRuntimeForbidden="true" suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath">+ <!--<property prefix="ivyversions" file="${common.dir}/ivy-versions.properties"/>--> <!-- for commons-io version -->+ <!-- HACK: --><property name="ivyversions./commons-io/commons-io" value="2.4"/>+ <forbidden-apis suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath" targetVersion="${javac.release}"><signatures>- <!-- TODO: fix this in forbiddenapis 2.1+ -->- <bundled name="jdk-unsafe-1.${javac.release}"/>- <bundled name="jdk-deprecated-1.${javac.release}"/>+ <bundled name="jdk-unsafe"/>+ <bundled name="jdk-deprecated"/>+ <bundled name="jdk-non-portable"/>+ <bundled name="jdk-reflection"/>+ <bundled name="commons-io-unsafe-${ivyversions./commons-io/commons-io}"/><fileset dir="${common.dir}/tools/forbiddenApis"><include name="base.txt" /><include name="servlet-api.txt" />diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/ResultSetImpl.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/ResultSetImpl.javaindex 91b99b9b837..7be0ebd9698 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/ResultSetImpl.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/ResultSetImpl.java@@ -40,6 +40,7 @@ import java.sql.Timestamp;import java.util.Calendar;import java.util.Map;+import org.apache.solr.common.util.SuppressForbidden;import org.apache.solr.client.solrj.io.Tuple;import org.apache.solr.client.solrj.io.stream.PushBackStream;import org.apache.solr.client.solrj.io.stream.SolrStream;@@ -177,6 +178,7 @@ class ResultSetImpl implements ResultSet {}@Override+ @SuppressForbidden(reason = "Implements deprecated method")public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {return this.getBigDecimal(this.resultSetMetaData.getColumnLabel(columnIndex), scale);}