Upgrade to forbiddenapis 3.3 (#768)

This commit is contained in:
Uwe Schindler 2022-03-26 17:09:42 +01:00 committed by GitHub
parent bd22f199de
commit ff263f0aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 27 additions and 82 deletions

View File

@ -22,7 +22,7 @@ plugins {
id "base"
id "com.palantir.consistent-versions" version "2.0.0"
id "org.owasp.dependencycheck" version "5.3.0"
id 'de.thetaphi.forbiddenapis' version '3.2' apply false
id 'de.thetaphi.forbiddenapis' version '3.3' apply false
id "de.undercouch.download" version "4.1.1" apply false
id "net.ltgt.errorprone" version "2.0.2" apply false
id 'com.diffplug.spotless' version "5.14.3" apply false

View File

@ -1,17 +0,0 @@
@defaultMessage Use corresponding Java 8 functional/streaming interfaces
com.google.common.base.Function
com.google.common.base.Joiner
com.google.common.base.Predicate
com.google.common.base.Supplier
@defaultMessage Use java.nio.charset.StandardCharsets instead
com.google.common.base.Charsets
@defaultMessage Use methods in java.util.Objects instead
com.google.common.base.Objects#equal(java.lang.Object,java.lang.Object)
com.google.common.base.Objects#hashCode(java.lang.Object[])
com.google.common.base.Preconditions#checkNotNull(java.lang.Object)
com.google.common.base.Preconditions#checkNotNull(java.lang.Object,java.lang.Object)
@defaultMessage Use methods in java.util.Comparator instead
com.google.common.collect.Ordering

View File

@ -1,5 +1,2 @@
@defaultMessage Use java.nio.charset.StandardCharsets instead
org.apache.commons.codec.Charsets
@defaultMessage Use java.util.Base64 instead
org.apache.commons.codec.binary.Base64
org.apache.commons.codec.Charsets @ Use java.nio.charset.StandardCharsets instead
org.apache.commons.codec.binary.Base64 @ Use java.util.Base64 instead

View File

@ -42,22 +42,14 @@ java.util.Locale#forLanguageTag(java.lang.String) @ use new Locale.Builder().set
java.util.Locale#toString() @ use Locale#toLanguageTag() for a standardized BCP47 locale name
@defaultMessage Constructors for wrapper classes of Java primitives should be avoided in favor of the public static methods available or autoboxing
java.lang.Integer#<init>(int)
java.lang.Integer#<init>(java.lang.String)
java.lang.Byte#<init>(byte)
java.lang.Byte#<init>(java.lang.String)
java.lang.Short#<init>(short)
java.lang.Short#<init>(java.lang.String)
java.lang.Long#<init>(long)
java.lang.Long#<init>(java.lang.String)
java.lang.Boolean#<init>(boolean)
java.lang.Boolean#<init>(java.lang.String)
java.lang.Character#<init>(char)
java.lang.Float#<init>(float)
java.lang.Float#<init>(double)
java.lang.Float#<init>(java.lang.String)
java.lang.Double#<init>(double)
java.lang.Double#<init>(java.lang.String)
java.lang.Integer#<init>(**)
java.lang.Byte#<init>(**)
java.lang.Short#<init>(**)
java.lang.Long#<init>(**)
java.lang.Boolean#<init>(**)
java.lang.Character#<init>(**)
java.lang.Float#<init>(**)
java.lang.Double#<init>(**)
@defaultMessage Java deserialization is unsafe when the data is untrusted. The java developer is powerless: no checks or casts help, exploitation can happen in places such as clinit or finalize!
java.io.ObjectInputStream

View File

@ -19,20 +19,11 @@ java.util.logging.Level#FINE
java.util.logging.Level#FINER
java.util.logging.Level#FINEST
java.util.logging.Level#INFO
# TODO: Replace with the new forbiddenapis 3.3 wildcard method signatures: https://github.com/policeman-tools/forbidden-apis/pull/188
java.util.logging.Logger#config(java.lang.String)
java.util.logging.Logger#config(java.util.function.Supplier)
java.util.logging.Logger#fine(java.lang.String)
java.util.logging.Logger#fine(java.util.function.Supplier)
java.util.logging.Logger#finer(java.lang.String)
java.util.logging.Logger#finer(java.util.function.Supplier)
java.util.logging.Logger#finest(java.lang.String)
java.util.logging.Logger#finest(java.util.function.Supplier)
java.util.logging.Logger#info(java.lang.String)
java.util.logging.Logger#info(java.util.function.Supplier)
java.util.logging.Logger#throwing(java.lang.String,java.lang.String,java.lang.Throwable)
java.util.logging.Logger#entering(java.lang.String,java.lang.String)
java.util.logging.Logger#entering(java.lang.String,java.lang.String,java.lang.Object)
java.util.logging.Logger#entering(java.lang.String,java.lang.String,java.lang.Object[])
java.util.logging.Logger#exiting(java.lang.String,java.lang.String)
java.util.logging.Logger#exiting(java.lang.String,java.lang.String,java.lang.Object)
java.util.logging.Logger#config(**)
java.util.logging.Logger#fine(**)
java.util.logging.Logger#finer(**)
java.util.logging.Logger#finest(**)
java.util.logging.Logger#info(**)
java.util.logging.Logger#throwing(**)
java.util.logging.Logger#entering(**)
java.util.logging.Logger#exiting(**)

View File

@ -25,26 +25,5 @@ java.nio.file.Path#toFile()
java.util.jar.JarFile
java.util.zip.ZipFile
@defaultMessage Prefer using ArrayUtil as Arrays#copyOfRange fills zeros for bad bounds
java.util.Arrays#copyOfRange(byte[],int,int)
java.util.Arrays#copyOfRange(char[],int,int)
java.util.Arrays#copyOfRange(short[],int,int)
java.util.Arrays#copyOfRange(int[],int,int)
java.util.Arrays#copyOfRange(long[],int,int)
java.util.Arrays#copyOfRange(float[],int,int)
java.util.Arrays#copyOfRange(double[],int,int)
java.util.Arrays#copyOfRange(boolean[],int,int)
java.util.Arrays#copyOfRange(java.lang.Object[],int,int)
java.util.Arrays#copyOfRange(java.lang.Object[],int,int,java.lang.Class)
@defaultMessage Prefer using ArrayUtil as Arrays#copyOf fills zeros for bad bounds
java.util.Arrays#copyOf(byte[],int)
java.util.Arrays#copyOf(char[],int)
java.util.Arrays#copyOf(short[],int)
java.util.Arrays#copyOf(int[],int)
java.util.Arrays#copyOf(long[],int)
java.util.Arrays#copyOf(float[],int)
java.util.Arrays#copyOf(double[],int)
java.util.Arrays#copyOf(boolean[],int)
java.util.Arrays#copyOf(java.lang.Object[],int)
java.util.Arrays#copyOf(java.lang.Object[],int,java.lang.Class)
java.util.Arrays#copyOfRange(**) @ Prefer using ArrayUtil as Arrays#copyOfRange fills zeros for bad bounds
java.util.Arrays#copyOf(**) @ Prefer using ArrayUtil as Arrays#copyOf fills zeros for bad bounds

View File

@ -20,6 +20,4 @@ java.lang.Math#random() @ Use RandomizedRunner's random().nextDouble() instead
#java.lang.System#currentTimeMillis() @ Don't depend on wall clock times
#java.lang.System#nanoTime() @ Don't depend on wall clock times
@defaultMessage Use LuceneTestCase.collate instead, which can avoid JDK-8071862
java.text.Collator#compare(java.lang.Object,java.lang.Object)
java.text.Collator#compare(java.lang.String,java.lang.String)
java.text.Collator#compare(**) @ Use LuceneTestCase.collate instead, which can avoid JDK-8071862

View File

@ -88,6 +88,11 @@ Bug Fixes
* LUCENE-10477: Highlighter: WeightedSpanTermExtractor.extractWeightedSpanTerms to Query#rewrite
multiple times if necessary. (Christine Poerschke, Adrien Grand)
Build
---------------------
* Upgrade forbiddenapis to version 3.3. (Uwe Schindler)
Other
---------------------
(No changes)