diff --git a/gradle/validation/forbidden-apis.gradle b/gradle/validation/forbidden-apis.gradle index 2a09ff49dda..acac356af38 100644 --- a/gradle/validation/forbidden-apis.gradle +++ b/gradle/validation/forbidden-apis.gradle @@ -99,7 +99,6 @@ allprojects { prj -> "**.SuppressForbidden" ] - doFirst dynamicSignatures.curry(configurations.toolsCompileClasspath, "lucene") inputs.dir(file(resources)) } @@ -113,18 +112,6 @@ allprojects { prj -> ] } - // Configure solr-specific rules. - if (prj.path.startsWith(":solr")) { - forbiddenApisMain { - doFirst dynamicSignatures.curry(configurations.compileClasspath, "solr") - signaturesFiles += files(file("${resources}/java.solr.txt")) - } - - forbiddenApisTest { - doFirst dynamicSignatures.curry(configurations.testCompileClasspath, "solr") - } - } - // Disable checks on JMH generated files. if (prj.path == ":solr:benchmark") { forbiddenApisMain.exclude("**/jmh_generated/**") diff --git a/gradle/validation/forbidden-apis/defaults.all.txt b/gradle/validation/forbidden-apis/defaults.all.txt index 2faad099236..d51c166fc77 100644 --- a/gradle/validation/forbidden-apis/defaults.all.txt +++ b/gradle/validation/forbidden-apis/defaults.all.txt @@ -43,6 +43,11 @@ 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 Creates threads without a thread name +java.lang.Thread#() +java.lang.Thread#(java.lang.Runnable) +java.lang.Thread#(java.lang.ThreadGroup,java.lang.Runnable) + @defaultMessage The context classloader should never be used for resource lookups, unless there is a 3rd party library that needs it. Always pass a classloader down as method parameters. java.lang.Thread#getContextClassLoader() java.lang.Thread#setContextClassLoader(java.lang.ClassLoader) @@ -54,6 +59,15 @@ java.io.File#delete() @ use Files.delete for real exception, IOUtils.deleteFiles java.util.Collections#shuffle(java.util.List) @ Use shuffle(List, Random) instead so that it can be reproduced +@defaultMessage Use CollectionUtil.newHashMap(int) +java.util.HashMap#(int) + +@defaultMessage Use CollectionUtil.newHashSet(int) +java.util.HashSet#(int) + +@defaultMessage Use CollectionUtil.newLinkedHashMap(int) +java.util.LinkedHashMap#(int) + java.util.Locale#forLanguageTag(java.lang.String) @ use new Locale.Builder().setLanguageTag(...).build() which has error handling java.util.Locale#toString() @ use Locale#toLanguageTag() for a standardized BCP47 locale name diff --git a/gradle/validation/forbidden-apis/java.solr.txt b/gradle/validation/forbidden-apis/java.solr.txt deleted file mode 100644 index b32c9fa8715..00000000000 --- a/gradle/validation/forbidden-apis/java.solr.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@defaultMessage Creates threads without a thread name -java.lang.Thread#() -java.lang.Thread#(java.lang.Runnable) -java.lang.Thread#(java.lang.ThreadGroup,java.lang.Runnable) - -@defaultMessage Use CollectionUtil.newHashMap(int) -java.util.HashMap#(int) - -@defaultMessage Use CollectionUtil.newLinkedHashMap(int) -java.util.LinkedHashMap#(int) - -@defaultMessage Use CollectionUtil.newHashSet(int) -java.util.HashSet#(int)