fix: resolve Kotlin compiler warnings in quartz and quic

- Replace unused Unit/null expressions in statement-position when branches
  with empty blocks (CommandSerializer, QuicConnection, QuicConnectionParser,
  Http3FrameReader, WtPeerStreamDemux).
- Suppress DEPRECATION on KindNames.names, which intentionally registers the
  deprecated GitReplyEvent and TorrentCommentEvent kinds for display.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018nqdy4VTLKidUWzGTJPja9
This commit is contained in:
Claude
2026-07-07 21:32:41 +00:00
parent b5d5fc2d2a
commit 560b95c2ec
6 changed files with 9 additions and 22 deletions
@@ -326,6 +326,7 @@ data class KindName(
* platform concern layered on top, never a fork of this data.
*/
object KindNames {
@Suppress("DEPRECATION") // registry intentionally names deprecated kinds (GitReply, TorrentComment) for display
val names: Map<Int, KindName> =
mapOf(
AcceptedBadgeSetEvent.KIND to KindName("Accepted Badge Set", "58"),
@@ -83,9 +83,7 @@ class CommandSerializer : StdSerializer<Command>(Command::class.java) {
gen.writeString(cmd.subId)
}
else -> {
null
}
else -> {}
}
gen.writeEndArray()
@@ -2523,9 +2523,7 @@ class QuicConnection(
PathValidator.RecordResult.Stored,
PathValidator.RecordResult.Duplicate,
PathValidator.RecordResult.AlreadyRetired,
-> {
Unit
}
-> {}
PathValidator.RecordResult.PoolFull -> {
// Peer over-issued past its own advertised
@@ -2573,11 +2571,9 @@ class QuicConnection(
// same path before the next outbound packet (which would
// otherwise stamp a now-retired CID).
when (val rotation = pathValidator.forceRotateToHigherSequence()) {
null -> {
Unit
}
// active CID is still valid; nothing to do.
null -> {}
PathValidator.ForcedRotationResult.NoSpareCid -> {
// Watermark forced retirement of the active CID but
// the pool is empty — we have nothing valid to use.
@@ -2613,9 +2609,7 @@ class QuicConnection(
when (val outcome = pathValidator.applyPathResponse(payload)) {
PathValidator.ValidationOutcome.NotValidating,
PathValidator.ValidationOutcome.PayloadMismatch,
-> {
Unit
}
-> {}
is PathValidator.ValidationOutcome.Validated -> {
// Bug-7 fix: a valid PATH_RESPONSE proves the peer
@@ -852,9 +852,7 @@ private fun dispatchFrames(
// peer knows it just violated the spec instead of
// having its bytes silently dropped.
when (stream.receive.insert(frame.offset, frame.data, frame.fin)) {
com.vitorpamplona.quic.stream.ReceiveBuffer.InsertResult.OK -> {
Unit
}
com.vitorpamplona.quic.stream.ReceiveBuffer.InsertResult.OK -> {}
com.vitorpamplona.quic.stream.ReceiveBuffer.InsertResult.OFFSET_PAST_FIN -> {
conn.markClosedExternally(
@@ -165,9 +165,7 @@ class Http3FrameReader(
)
}
when (context) {
StreamContext.UNCHECKED -> {
Unit
}
StreamContext.UNCHECKED -> {}
StreamContext.CONTROL -> {
// §7.2.4: SETTINGS MUST be the first frame on the
@@ -491,9 +491,7 @@ class WtPeerStreamDemux(
}
// no new requests; we don't enforce yet
else -> {
Unit
}
else -> {}
}
}
}