Skip to content

Commit

Permalink
Fix compilation errors for kotlin 2.1
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 2f35eace38f6455a3156d38405e3b8d80b87d43b
  • Loading branch information
staktrace authored and svc-squareup-copybara committed Jan 27, 2025
1 parent b63b143 commit b8bddd3
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ServiceMetadataAction @Inject constructor(
// Misk-web expects an UPPERCASE environment. Since this action could get a serviceMetadata
// object from anywhere, it must be transformed here.
val metadata = with(optionalBinder.serviceMetadata) {
copy(environment = this.environment.toUpperCase())
copy(environment = this.environment.uppercase())
}
return Response(serviceMetadata = metadata)
}
Expand Down
2 changes: 1 addition & 1 deletion misk-config/src/main/kotlin/misk/config/MiskConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ object MiskConfig {
private fun embeddedConfigFileNames(appName: String, deployment: Deployment) =
listOf(
"common",
deployment.mapToEnvironmentName().toLowerCase(Locale.US)
deployment.mapToEnvironmentName().lowercase(Locale.US)
).map { "$appName-$it.yaml" }

class SecretJacksonModule(val resourceLoader: ResourceLoader, val mapper: ObjectMapper) :
Expand Down
2 changes: 1 addition & 1 deletion misk-core/src/main/kotlin/misk/web/mediatype/MediaRange.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ data class MediaRange @JvmOverloads constructor(
"$s is not a valid media range; encountered charset parameter in extensions"
}

charset = Charset.forName(p.second.toUpperCase())
charset = Charset.forName(p.second.uppercase())
}
inParameters -> parameters[p.first] = p.second
else -> extensions[p.first] = p.second
Expand Down
2 changes: 1 addition & 1 deletion misk-jdbc/src/main/kotlin/misk/vitess/Destination.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ data class Destination(
val tabletType = if (index == -1) {
null
} else {
var name = string.substring(index + 1).toUpperCase()
var name = string.substring(index + 1).uppercase()
if (name == "PRIMARY") {
name = "MASTER"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class JdbcTestFixture(
val truncatedTableNames = mutableListOf<String>()
connection.createStatement().use { statement ->
for (tableName in allTableNames) {
if (persistentTables.contains(tableName.toLowerCase(Locale.ROOT))) continue
if (persistentTables.contains(tableName.lowercase(Locale.ROOT))) continue
if (tableName.endsWith("_seq") || tableName.equals("dual")) continue

if (config.type == DataSourceType.COCKROACHDB || config.type == DataSourceType.POSTGRESQL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HelloWebPostAction @Inject constructor() : WebAction {
@RequestContentType(MediaTypes.APPLICATION_JSON)
@ResponseContentType(MediaTypes.APPLICATION_JSON)
fun hello(@PathParam name: String, @RequestBody body: PostBody): HelloPostResponse {
return HelloPostResponse(body.greeting, name.toUpperCase())
return HelloPostResponse(body.greeting, name.uppercase())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class HelloWebProtoAction @Inject constructor() : WebAction {
return Response(
HelloWebResponse().newBuilder()
.greeting(greeting(request))
.name(request.nick_name?.toUpperCase() ?: request.name.toUpperCase())
.name(request.nick_name?.uppercase() ?: request.name.uppercase())
.build()
)
}
Expand Down

0 comments on commit b8bddd3

Please sign in to comment.