Skip to content

Apache Lucene open-source search software

LUCENE-6594: Update forbiddenapis to 2.0

Uwe Schindler294b30a66e15
diff --git a/dev-tools/maven/pom.xml.template b/dev-tools/maven/pom.xml.template
index 9dbe4b7460e..c83feb6b60c 100644
--- a/dev-tools/maven/pom.xml.template
+++ b/dev-tools/maven/pom.xml.template
@@ -159,7 +159,7 @@
<plugin>
<groupId>de.thetaphi</groupId>
<artifactId>forbiddenapis</artifactId>
- <version>1.8</version>
+ <version>2.0</version>
<configuration>
<!--
This is the default setting, we don't support too new Java versions.
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 6ba0b06cb37..39714272d50 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -2361,9 +2361,9 @@ ${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="1.8"
+ <ivy:cachepath organisation="de.thetaphi" module="forbiddenapis" revision="2.0"
inline="true" conf="default" transitive="true" pathid="forbidden-apis.classpath"/>
- <taskdef name="forbidden-apis" classname="de.thetaphi.forbiddenapis.AntTask" classpathref="forbidden-apis.classpath"/>
+ <taskdef name="forbidden-apis" classname="de.thetaphi.forbiddenapis.ant.AntTask" classpathref="forbidden-apis.classpath"/>
<property name="forbidden-apis.loaded" value="true"/>
</target>
@@ -2392,12 +2392,14 @@ ${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">
- <bundledSignatures name="jdk-unsafe-${javac.target}"/>
- <bundledSignatures name="jdk-deprecated-${javac.target}"/>
- <signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
- <include name="base.txt"/>
- <include name="lucene.txt" if="forbidden-isLucene"/>
- </signaturesFileSet>
+ <signatures>
+ <bundled name="jdk-unsafe-${javac.target}"/>
+ <bundled name="jdk-deprecated-${javac.target}"/>
+ <fileset dir="${common.dir}/tools/forbiddenApis">
+ <include name="base.txt"/>
+ <include name="lucene.txt" if="forbidden-isLucene"/>
+ </fileset>
+ </signatures>
<fileset dir="${build.dir}/classes/java" excludes="${forbidden-base-excludes}"/>
<fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/>
</forbidden-apis>
diff --git a/lucene/tools/forbiddenApis/base.txt b/lucene/tools/forbiddenApis/base.txt
index 39e2f78f304..f83d5b3ba47 100644
--- a/lucene/tools/forbiddenApis/base.txt
+++ b/lucene/tools/forbiddenApis/base.txt
@@ -37,37 +37,3 @@ java.lang.Character#codePointAt(char[],int) @ Implicit end offset is error-prone
java.io.File#delete() @ use Files.delete for real exception, IOUtils.deleteFilesIgnoringExceptions if you dont care
java.util.Collections#shuffle(java.util.List) @ Use shuffle(List, Random) instead so that it can be reproduced
-
-# START: forbidden-apis patch
-# TODO: remove this once forbidden-apis was updated to next version with following commit:
-# https://github.com/policeman-tools/forbidden-apis/commit/c34a02afcd7856478e9adfd32be2fc5bf82ca268
-
-@defaultMessage Uses default time zone
-java.time.LocalDateTime#now()
-java.time.LocalDate#now()
-java.time.LocalTime#now()
-java.time.OffsetDateTime#now()
-java.time.OffsetTime#now()
-java.time.Year#now()
-java.time.YearMonth#now()
-java.time.MonthDay#now()
-java.time.chrono.Chronology#dateNow()
-java.time.chrono.HijrahChronology#dateNow()
-java.time.chrono.JapaneseChronology#dateNow()
-java.time.chrono.MinguoChronology#dateNow()
-java.time.chrono.ThaiBuddhistChronology#dateNow()
-java.time.chrono.IsoChronology#dateNow()
-java.time.chrono.HijrahDate#now()
-java.time.chrono.JapaneseDate#now()
-java.time.chrono.MinguoDate#now()
-java.time.chrono.ThaiBuddhistDate#now()
-
-@defaultMessage Uses default locale
-java.time.format.DateTimeFormatterBuilder#toFormatter(java.time.format.ResolverStyle,java.time.chrono.Chronology)
-java.time.format.DateTimeFormatter#ofLocalizedDate(java.time.format.FormatStyle)
-java.time.format.DateTimeFormatter#ofLocalizedDateTime(java.time.format.FormatStyle,java.time.format.FormatStyle)
-java.time.format.DateTimeFormatter#ofLocalizedDateTime(java.time.format.FormatStyle)
-java.time.format.DateTimeFormatter#ofLocalizedTime(java.time.format.FormatStyle)
-java.time.format.DateTimeFormatter#ofPattern(java.lang.String)
-
-# END: forbidden-apis patch
\ No newline at end of file
diff --git a/solr/common-build.xml b/solr/common-build.xml
index 4dc7b72b8d0..ca4ae3de5f8 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -494,14 +494,16 @@
<target name="-check-forbidden-all" depends="-init-forbidden-apis,compile-core,compile-test">
<property file="${common.dir}/ivy-versions.properties"/> <!-- for commons-io version -->
<forbidden-apis internalRuntimeForbidden="true" suppressAnnotation="**.SuppressForbidden" classpathref="forbidden-apis.allclasses.classpath">
- <bundledSignatures name="jdk-unsafe-${javac.target}"/>
- <bundledSignatures name="jdk-deprecated-${javac.target}"/>
- <bundledSignatures name="commons-io-unsafe-${/commons-io/commons-io}"/>
- <signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
- <include name="base.txt" />
- <include name="servlet-api.txt" />
- <include name="solr.txt" />
- </signaturesFileSet>
+ <signatures>
+ <bundled name="jdk-unsafe-${javac.target}"/>
+ <bundled name="jdk-deprecated-${javac.target}"/>
+ <bundled name="commons-io-unsafe-${/commons-io/commons-io}"/>
+ <fileset dir="${common.dir}/tools/forbiddenApis">
+ <include name="base.txt" />
+ <include name="servlet-api.txt" />
+ <include name="solr.txt" />
+ </fileset>
+ </signatures>
<fileset dir="${build.dir}/classes/java" excludes="${forbidden-base-excludes}"/>
<fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/>
</forbidden-apis>