Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forbidden-apis: Don't need java.solr.txt file #2866

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions gradle/validation/forbidden-apis.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ allprojects { prj ->
"**.SuppressForbidden"
]

doFirst dynamicSignatures.curry(configurations.toolsCompileClasspath, "lucene")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand this line but the reference to "lucene" probably matches nothing.

inputs.dir(file(resources))
}

Expand All @@ -113,18 +112,6 @@ allprojects { prj ->
]
}

// Configure solr-specific rules.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole configuration overall is for Solr

if (prj.path.startsWith(":solr")) {
forbiddenApisMain {
doFirst dynamicSignatures.curry(configurations.compileClasspath, "solr")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I should have kept this line? I'm not sure what it accomplishes.

signaturesFiles += files(file("${resources}/java.solr.txt"))
}

forbiddenApisTest {
doFirst dynamicSignatures.curry(configurations.testCompileClasspath, "solr")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I should have kept this line? I'm not sure what it accomplishes.

}
}

// Disable checks on JMH generated files.
if (prj.path == ":solr:benchmark") {
forbiddenApisMain.exclude("**/jmh_generated/**")
Expand Down
14 changes: 14 additions & 0 deletions gradle/validation/forbidden-apis/defaults.all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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#<init>()
java.lang.Thread#<init>(java.lang.Runnable)
java.lang.Thread#<init>(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)
Expand All @@ -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#<init>(int)

@defaultMessage Use CollectionUtil.newHashSet(int)
java.util.HashSet#<init>(int)

@defaultMessage Use CollectionUtil.newLinkedHashMap(int)
java.util.LinkedHashMap#<init>(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

Expand Down
28 changes: 0 additions & 28 deletions gradle/validation/forbidden-apis/java.solr.txt

This file was deleted.

Loading