Bump com.ncorti.ktfmt.gradle from 0.12.0 to 0.19.0 in /lib/kotlin (#3015)
* Bump com.ncorti.ktfmt.gradle from 0.12.0 to 0.19.0 in /lib/kotlin
Bumps com.ncorti.ktfmt.gradle from 0.12.0 to 0.19.0.
---
updated-dependencies:
- dependency-name: com.ncorti.ktfmt.gradle
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* Fix formatting for updated ktfmt
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
diff --git a/lib/kotlin/cross-test-client/src/main/kotlin/org/apache/thrift/test/TestClient.kt b/lib/kotlin/cross-test-client/src/main/kotlin/org/apache/thrift/test/TestClient.kt
index c238d0b..a9241da 100644
--- a/lib/kotlin/cross-test-client/src/main/kotlin/org/apache/thrift/test/TestClient.kt
+++ b/lib/kotlin/cross-test-client/src/main/kotlin/org/apache/thrift/test/TestClient.kt
@@ -114,8 +114,7 @@
TransportType.Framed -> TNonblockingSocket(host, port, socketTimeout)
else ->
throw UnsupportedOperationException(
- "only frame transport type is supported for now, got $transportType"
- )
+ "only frame transport type is supported for now, got $transportType")
}
private val clientManager = TAsyncClientManager()
@@ -273,8 +272,7 @@
if (xtructs != null) {
for ((string_thing, byte_thing, i32_thing, i64_thing) in xtructs) {
print(
- "{\"$string_thing\", $byte_thing, $i32_thing, $i64_thing}, "
- )
+ "{\"$string_thing\", $byte_thing, $i32_thing, $i64_thing}, ")
}
}
print("}")
@@ -286,15 +284,13 @@
if (whoa.size == 2 && whoa.containsKey(1L) && whoa.containsKey(2L)) {
val firstMap = whoa[1L]!!
val secondMap = whoa[2L]!!
- if (
- firstMap.size == 2 &&
- firstMap.containsKey(Numberz.TWO) &&
- firstMap.containsKey(Numberz.THREE) &&
- secondMap.size == 1 &&
- secondMap.containsKey(Numberz.SIX) &&
- insane == firstMap[Numberz.TWO] &&
- insane == firstMap[Numberz.THREE]
- ) {
+ if (firstMap.size == 2 &&
+ firstMap.containsKey(Numberz.TWO) &&
+ firstMap.containsKey(Numberz.THREE) &&
+ secondMap.size == 1 &&
+ secondMap.containsKey(Numberz.SIX) &&
+ insane == firstMap[Numberz.TWO] &&
+ insane == firstMap[Numberz.THREE]) {
val six = secondMap[Numberz.SIX]!!
// Cannot use "new Insanity().equals(six)" because as of now,
// struct/container
@@ -365,11 +361,9 @@
private suspend fun multiplexTest(returnCode: Int): Int {
var code = returnCode
- if (
- protocolType == ProtocolType.Multi ||
- protocolType == ProtocolType.MultiJson ||
- protocolType == ProtocolType.MultiCompact
- ) {
+ if (protocolType == ProtocolType.Multi ||
+ protocolType == ProtocolType.MultiJson ||
+ protocolType == ProtocolType.MultiCompact) {
val secondClient: SecondServiceClient = createSecondServiceClient()
print("secondtestString(\"Test2\")")
val s = secondClient.secondtestString("Test2")
@@ -529,8 +523,7 @@
out.i64_thing = -5
val input: Xtruct = testStruct(out)
print(
- """ = {"${input.string_thing}",${input.byte_thing}, ${input.i32_thing}, ${input.i64_thing}}"""
- )
+ """ = {"${input.string_thing}",${input.byte_thing}, ${input.i32_thing}, ${input.i64_thing}}""")
if (input != out) {
code = code or ERR_STRUCTS
println("*** FAILURE ***\n")
@@ -579,16 +572,14 @@
} else {
val m1 = mm[4]!!
val m2 = mm[-4]!!
- if (
- m1[1] != 1 ||
- m1[2] != 2 ||
- m1[3] != 3 ||
- m1[4] != 4 ||
- m2[-1] != -1 ||
- m2[-2] != -2 ||
- m2[-3] != -3 ||
- m2[-4] != -4
- ) {
+ if (m1[1] != 1 ||
+ m1[2] != 2 ||
+ m1[3] != 3 ||
+ m1[4] != 4 ||
+ m2[-1] != -1 ||
+ m2[-2] != -2 ||
+ m2[-3] != -3 ||
+ m2[-4] != -4) {
returnCode1 = returnCode1 or ERR_CONTAINERS
println("*** FAILURE ***\n")
}
@@ -648,8 +639,7 @@
val input = xstruct2.struct_thing!!
print(
""" = {${xstruct2.byte_thing}, {"${input.string_thing}", ${input.byte_thing}, ${input.i32_thing}, ${input.i64_thing}}, ${xstruct2.i32_thing}}
- """
- )
+ """)
if (xstruct2 != out2) {
code = code or ERR_STRUCTS
println("*** FAILURE ***\n")
diff --git a/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestHandler.kt b/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestHandler.kt
index b7f38d7..160097e 100644
--- a/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestHandler.kt
+++ b/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestHandler.kt
@@ -96,16 +96,15 @@
override suspend fun testStruct(thing: Xtruct): Xtruct {
logger.info(
- """testStruct({"${thing.string_thing}", ${thing.byte_thing}, ${thing.i32_thing}, ${thing.i64_thing}})"""
- )
+ """testStruct({"${thing.string_thing}", ${thing.byte_thing}, ${thing.i32_thing}, ${thing.i64_thing}})""")
return thing
}
override suspend fun testNest(thing: Xtruct2): Xtruct2 {
val thing2: Xtruct = thing.struct_thing!!
logger.info(
- """testNest({${thing.byte_thing}, {"${thing2.string_thing}", ${thing2.byte_thing}, ${thing2.i32_thing}, ${thing2.i64_thing}}, ${thing.i32_thing}})""".trimIndent()
- )
+ """testNest({${thing.byte_thing}, {"${thing2.string_thing}", ${thing2.byte_thing}, ${thing2.i32_thing}, ${thing2.i64_thing}}, ${thing.i32_thing}})"""
+ .trimIndent())
return thing
}
diff --git a/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestServer.kt b/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestServer.kt
index 315d12e..e79420b 100644
--- a/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestServer.kt
+++ b/lib/kotlin/cross-test-server/src/main/kotlin/org/apache/thrift/test/TestServer.kt
@@ -84,8 +84,7 @@
}
} catch (e: Exception) {
throw RuntimeException(
- "The context is not a wrapper and does not implement the interface"
- )
+ "The context is not a wrapper and does not implement the interface")
}
}
@@ -96,10 +95,10 @@
internal class TestServerEventHandler() : TServerEventHandler {
private var nextConnectionId = 1
+
override fun preServe() {
println(
- "TServerEventHandler.preServe - called only once before server starts accepting connections"
- )
+ "TServerEventHandler.preServe - called only once before server starts accepting connections")
}
override fun createContext(input: TProtocol, output: TProtocol): ServerContext {
@@ -109,8 +108,7 @@
println(
"TServerEventHandler.createContext - connection #" +
ctx.connectionId +
- " established"
- )
+ " established")
return ctx
}
@@ -123,8 +121,7 @@
println(
"TServerEventHandler.deleteContext - connection #" +
ctx.connectionId +
- " terminated"
- )
+ " terminated")
}
override fun processContext(
@@ -136,8 +133,7 @@
println(
"TServerEventHandler.processContext - connection #" +
ctx.connectionId +
- " is ready to process next request"
- )
+ " is ready to process next request")
}
}
}
@@ -197,14 +193,12 @@
protocolType,
getProtocolFactory(),
getTransportFactory(),
- useSSL
- )
+ useSSL)
// Set server event handler
serverEngine.setServerEventHandler(TestServer.TestServerEventHandler())
// Run it
println(
- "Starting the ${if (useSSL) "ssl server" else "server"} [$protocolType/$transportType/$serverType] on port $port"
- )
+ "Starting the ${if (useSSL) "ssl server" else "server"} [$protocolType/$transportType/$serverType] on port $port")
serverEngine.serve()
}
@@ -267,8 +261,7 @@
ServerType.NonBlocking -> {
val tNonblockingServerArgs = TNonblockingServer.Args(tNonblockingServerSocket)
tNonblockingServerArgs.processor(
- if (isMulti) multiplexedProcessor else testProcessor
- )
+ if (isMulti) multiplexedProcessor else testProcessor)
tNonblockingServerArgs.protocolFactory(tProtocolFactory)
tNonblockingServerArgs.transportFactory(tTransportFactory)
return TNonblockingServer(tNonblockingServerArgs)
@@ -277,8 +270,7 @@
val tThreadedSelectorServerArgs =
TThreadedSelectorServer.Args(tNonblockingServerSocket)
tThreadedSelectorServerArgs.processor(
- if (isMulti) multiplexedProcessor else testProcessor
- )
+ if (isMulti) multiplexedProcessor else testProcessor)
tThreadedSelectorServerArgs.protocolFactory(tProtocolFactory)
tThreadedSelectorServerArgs.transportFactory(tTransportFactory)
return TThreadedSelectorServer(tThreadedSelectorServerArgs)
@@ -305,8 +297,7 @@
else -> {
val tThreadPoolServerArgs = TThreadPoolServer.Args(tServerSocket)
tThreadPoolServerArgs.processor(
- if (isMulti) multiplexedProcessor else testProcessor
- )
+ if (isMulti) multiplexedProcessor else testProcessor)
tThreadPoolServerArgs.protocolFactory(tProtocolFactory)
tThreadPoolServerArgs.transportFactory(tTransportFactory)
return TThreadPoolServer(tThreadPoolServerArgs)
diff --git a/lib/kotlin/settings.gradle.kts b/lib/kotlin/settings.gradle.kts
index 6bbfd7f..0f00036 100644
--- a/lib/kotlin/settings.gradle.kts
+++ b/lib/kotlin/settings.gradle.kts
@@ -19,7 +19,7 @@
pluginManagement {
plugins {
kotlin("jvm") version "1.9.23"
- id("com.ncorti.ktfmt.gradle") version "0.12.0"
+ id("com.ncorti.ktfmt.gradle") version "0.19.0"
}
}
diff --git a/lib/kotlin/src/test/kotlin/org/apache/thrift/MetaDataTest.kt b/lib/kotlin/src/test/kotlin/org/apache/thrift/MetaDataTest.kt
index e066bbe..16dc71e 100644
--- a/lib/kotlin/src/test/kotlin/org/apache/thrift/MetaDataTest.kt
+++ b/lib/kotlin/src/test/kotlin/org/apache/thrift/MetaDataTest.kt
@@ -36,7 +36,6 @@
"max" to "100000",
"min" to "1",
),
- idField.fieldAnnotations
- )
+ idField.fieldAnnotations)
}
}