Skip to content

Commit

Permalink
Bump com.ncorti.ktfmt.gradle from 0.12.0 to 0.19.0 in /lib/kotlin (#3015
Browse files Browse the repository at this point in the history
)

* 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>
  • Loading branch information
dependabot[bot] and ctubbsii authored Aug 15, 2024
1 parent a44c0c6 commit 539c922
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ class TestClient : CliktCommand() {
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()
Expand Down Expand Up @@ -273,8 +272,7 @@ class TestClient : CliktCommand() {
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("}")
Expand All @@ -286,15 +284,13 @@ class TestClient : CliktCommand() {
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
Expand Down Expand Up @@ -365,11 +361,9 @@ class TestClient : CliktCommand() {

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")
Expand Down Expand Up @@ -529,8 +523,7 @@ private suspend fun ThriftTestClient.structTest(returnCode: Int): Pair<Xtruct, I
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")
Expand Down Expand Up @@ -579,16 +572,14 @@ private suspend fun ThriftTestClient.nestedMapTest(returnCode: Int): Int {
} 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")
}
Expand Down Expand Up @@ -648,8 +639,7 @@ private suspend fun ThriftTestClient.nestedStructTest(out: Xtruct, returnCode: I
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,15 @@ class TestHandler : ThriftTest {

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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ object TestServer {
}
} 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")
}
}

Expand All @@ -96,10 +95,10 @@ object TestServer {

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 {
Expand All @@ -109,8 +108,7 @@ object TestServer {
println(
"TServerEventHandler.createContext - connection #" +
ctx.connectionId +
" established"
)
" established")
return ctx
}

Expand All @@ -123,8 +121,7 @@ object TestServer {
println(
"TServerEventHandler.deleteContext - connection #" +
ctx.connectionId +
" terminated"
)
" terminated")
}

override fun processContext(
Expand All @@ -136,8 +133,7 @@ object TestServer {
println(
"TServerEventHandler.processContext - connection #" +
ctx.connectionId +
" is ready to process next request"
)
" is ready to process next request")
}
}
}
Expand Down Expand Up @@ -197,14 +193,12 @@ class TestServerCommand : CliktCommand() {
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()
}

Expand Down Expand Up @@ -267,8 +261,7 @@ private fun getServerEngine(
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)
Expand All @@ -277,8 +270,7 @@ private fun getServerEngine(
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)
Expand All @@ -305,8 +297,7 @@ private fun getServerEngine(
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/kotlin/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
3 changes: 1 addition & 2 deletions lib/kotlin/src/test/kotlin/org/apache/thrift/MetaDataTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ internal class MetaDataTest {
"max" to "100000",
"min" to "1",
),
idField.fieldAnnotations
)
idField.fieldAnnotations)
}
}

0 comments on commit 539c922

Please sign in to comment.