From 86a8aa30bf88430023b7dfdcdf0fb1b930b7af63 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 19 Jan 2022 11:58:19 +0100 Subject: [PATCH] Forbiddenapis: Split the guava16-only signatures file from main signatures file --- codestyle/druid-forbidden-apis.txt | 2 -- codestyle/guava16-forbidden-apis.txt | 3 +++ extensions-contrib/opentelemetry-emitter/pom.xml | 10 ++++++++++ pom.xml | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 codestyle/guava16-forbidden-apis.txt diff --git a/codestyle/druid-forbidden-apis.txt b/codestyle/druid-forbidden-apis.txt index fa078c052ff9..5ae020a923d2 100644 --- a/codestyle/druid-forbidden-apis.txt +++ b/codestyle/druid-forbidden-apis.txt @@ -21,7 +21,6 @@ com.google.common.collect.Sets#newLinkedHashSet() @ Create java.util.LinkedHashS com.google.common.collect.Sets#newTreeSet() @ Create java.util.TreeSet directly com.google.common.collect.Sets#newTreeSet(java.util.Comparator) @ Create java.util.TreeSet directly com.google.common.io.Files#createTempDir() @ Use org.apache.druid.java.util.common.FileUtils.createTempDir() -com.google.common.util.concurrent.MoreExecutors#sameThreadExecutor() @ Use org.apache.druid.java.util.common.concurrent.Execs#directExecutor() java.io.File#mkdirs() @ Use org.apache.druid.java.util.common.FileUtils.mkdirp instead java.io.File#toURL() @ Use java.io.File#toURI() and java.net.URI#toURL() instead java.lang.String#matches(java.lang.String) @ Use startsWith(), endsWith(), contains(), or compile and cache a Pattern explicitly @@ -46,7 +45,6 @@ org.apache.commons.io.FileUtils#getTempDirectory() @ Use org.junit.rules.Tempora org.apache.commons.io.FileUtils#deleteDirectory(java.io.File) @ Use org.apache.druid.java.util.common.FileUtils#deleteDirectory() org.apache.commons.io.FileUtils#forceMkdir(java.io.File) @ Use org.apache.druid.java.util.common.FileUtils.mkdirp instead java.lang.Class#getCanonicalName() @ Class.getCanonicalName can return null for anonymous types, use Class.getName instead. -com.google.common.base.Objects#firstNonNull(java.lang.Object, java.lang.Object) @ Use org.apache.druid.common.guava.GuavaUtils#firstNonNull(java.lang.Object, java.lang.Object) instead (probably... the GuavaUtils method return object is nullable) @defaultMessage Use Locale.ENGLISH com.ibm.icu.text.DateFormatSymbols#() diff --git a/codestyle/guava16-forbidden-apis.txt b/codestyle/guava16-forbidden-apis.txt new file mode 100644 index 000000000000..274a12696fb2 --- /dev/null +++ b/codestyle/guava16-forbidden-apis.txt @@ -0,0 +1,3 @@ +# Those signatures are only available in Guava 16: +com.google.common.util.concurrent.MoreExecutors#sameThreadExecutor() @ Use org.apache.druid.java.util.common.concurrent.Execs#directExecutor() +com.google.common.base.Objects#firstNonNull(java.lang.Object, java.lang.Object) @ Use org.apache.druid.common.guava.GuavaUtils#firstNonNull(java.lang.Object, java.lang.Object) instead (probably... the GuavaUtils method return object is nullable) diff --git a/extensions-contrib/opentelemetry-emitter/pom.xml b/extensions-contrib/opentelemetry-emitter/pom.xml index 8d81db58cdd7..cd4f59dc7531 100644 --- a/extensions-contrib/opentelemetry-emitter/pom.xml +++ b/extensions-contrib/opentelemetry-emitter/pom.xml @@ -212,6 +212,16 @@ + + de.thetaphi + forbiddenapis + + + ${project.parent.basedir}/codestyle/joda-time-forbidden-apis.txt + ${project.parent.basedir}/codestyle/druid-forbidden-apis.txt + + + diff --git a/pom.xml b/pom.xml index 803bf188eed2..385f45d6d374 100644 --- a/pom.xml +++ b/pom.xml @@ -1297,9 +1297,8 @@ de.thetaphi forbiddenapis - 3.1 + 3.2 - false true