Skip to content

Commit

Permalink
Fix up a few kotlin build warnings (#8152)
Browse files Browse the repository at this point in the history
I noticed some kotlin deprecation warnings in the build output, so I
thought I would try and fix them up.

Co-authored-by: opentelemetrybot <[email protected]>
  • Loading branch information
breedx-splk and opentelemetrybot authored Mar 29, 2023
1 parent 7235043 commit a455fc5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ plugins.withId("maven-publish") {
}

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.
exclude("io.opentelemetry.javaagent", "opentelemetry-javaagent-bootstrap")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
}

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.
exclude(module = "javaagent-bootstrap")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nullaway {

tasks {
withType<JavaCompile>().configureEach {
if (!name.toLowerCase().contains("test")) {
if (!name.contains("test", ignoreCase = true)) {
options.errorprone.nullaway {
severity.set(CheckSeverity.ERROR)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ val languageTasks = LANGUAGES.map { language ->
return@map null
}
val compileTask = tasks.named(compileTaskName)
createLanguageTask(compileTask, "byteBuddy${language.capitalize()}")
createLanguageTask(compileTask, "byteBuddy${language.replaceFirstChar(Char::titlecase)}")
}.filterNotNull()

tasks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AcceptableVersions(private val skipVersions: Collection<String>) :
if (version == null) {
return false
}
val versionString = version.toString().toLowerCase(Locale.ROOT)
val versionString = version.toString().lowercase(Locale.ROOT)
if (skipVersions.contains(versionString)) {
return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ abstract class MuzzleDirective {

internal val normalizedSkipVersions: Set<String>
get() = skipVersions.getOrElse(setOf()).stream()
.map(String::toLowerCase)
.map(String::lowercase)
.collect(Collectors.toSet())

override fun toString(): String {
Expand Down

0 comments on commit a455fc5

Please sign in to comment.