Fix up a few kotlin build warnings (#8152)

I noticed some kotlin deprecation warnings in the build output, so I
thought I would try and fix them up.

Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com>
This commit is contained in:
jason plumb 2023-03-29 01:55:35 -07:00 committed by GitHub
parent 7235043d0d
commit a455fc5700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View File

@ -154,7 +154,7 @@ plugins.withId("maven-publish") {
} }
configurations.configureEach { configurations.configureEach {
if (name.toLowerCase().endsWith("testruntimeclasspath")) { if (name.endsWith("testruntimeclasspath", ignoreCase = true)) {
// Added by agent, don't let Gradle bring it in when running tests. // Added by agent, don't let Gradle bring it in when running tests.
exclude("io.opentelemetry.javaagent", "opentelemetry-javaagent-bootstrap") exclude("io.opentelemetry.javaagent", "opentelemetry-javaagent-bootstrap")
} }

View File

@ -14,7 +14,7 @@ dependencies {
} }
configurations.configureEach { configurations.configureEach {
if (name.toLowerCase().endsWith("testruntimeclasspath")) { if (name.endsWith("testruntimeclasspath", ignoreCase = true)) {
// Added by agent, don't let Gradle bring it in when running tests. // Added by agent, don't let Gradle bring it in when running tests.
exclude(module = "javaagent-bootstrap") exclude(module = "javaagent-bootstrap")
} }

View File

@ -18,7 +18,7 @@ nullaway {
tasks { tasks {
withType<JavaCompile>().configureEach { withType<JavaCompile>().configureEach {
if (!name.toLowerCase().contains("test")) { if (!name.contains("test", ignoreCase = true)) {
options.errorprone.nullaway { options.errorprone.nullaway {
severity.set(CheckSeverity.ERROR) severity.set(CheckSeverity.ERROR)
} }

View File

@ -50,7 +50,7 @@ val languageTasks = LANGUAGES.map { language ->
return@map null return@map null
} }
val compileTask = tasks.named(compileTaskName) val compileTask = tasks.named(compileTaskName)
createLanguageTask(compileTask, "byteBuddy${language.capitalize()}") createLanguageTask(compileTask, "byteBuddy${language.replaceFirstChar(Char::titlecase)}")
}.filterNotNull() }.filterNotNull()
tasks { tasks {

View File

@ -16,7 +16,7 @@ class AcceptableVersions(private val skipVersions: Collection<String>) :
if (version == null) { if (version == null) {
return false return false
} }
val versionString = version.toString().toLowerCase(Locale.ROOT) val versionString = version.toString().lowercase(Locale.ROOT)
if (skipVersions.contains(versionString)) { if (skipVersions.contains(versionString)) {
return false return false
} }

View File

@ -78,7 +78,7 @@ abstract class MuzzleDirective {
internal val normalizedSkipVersions: Set<String> internal val normalizedSkipVersions: Set<String>
get() = skipVersions.getOrElse(setOf()).stream() get() = skipVersions.getOrElse(setOf()).stream()
.map(String::toLowerCase) .map(String::lowercase)
.collect(Collectors.toSet()) .collect(Collectors.toSet())
override fun toString(): String { override fun toString(): String {