chore: bump scalafmt to 3.9.7 (#1916)

This commit is contained in:
He-Pin(kerr) 2025-06-24 16:27:14 +08:00 committed by GitHub
parent 21ad8968b1
commit 9577b01b10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
308 changed files with 689 additions and 688 deletions

View file

@ -76,7 +76,7 @@ object TimestampOffset {
case t: TimestampOffset => t
case NoOffset => TimestampOffset.Zero
case null => throw new IllegalArgumentException("Offset must not be null")
case other =>
case other =>
throw new IllegalArgumentException(
s"Supported offset types are TimestampOffset and NoOffset, " +
s"received ${other.getClass.getName}")

View file

@ -62,7 +62,7 @@ import pekko.serialization.Serializers
override def manifest(o: AnyRef): String = o match {
case _: EventEnvelope[_] => EventEnvelopeManifest
case offset: Offset => toStorageRepresentation(offset)._2
case _ =>
case _ =>
throw new IllegalArgumentException(s"Can't serialize object of type ${o.getClass} in [${getClass.getName}]")
}
@ -130,14 +130,14 @@ import pekko.serialization.Serializers
case SequenceOffsetManifest => Offset.sequence(offsetStr.toLong)
case TimeBasedUUIDOffsetManifest => Offset.timeBasedUUID(UUID.fromString(offsetStr))
case NoOffsetManifest => NoOffset
case _ =>
case _ =>
manifest.split(manifestSeparator) match {
case Array(serializerIdStr, serializerManifest) =>
val serializerId = serializerIdStr.toInt
val bytes = Base64.getDecoder.decode(offsetStr)
serialization.deserialize(bytes, serializerId, serializerManifest).get match {
case offset: Offset => offset
case other =>
case other =>
throw new NotSerializableException(
s"Unimplemented deserialization of offset with serializerId [$serializerId] and manifest [$manifest] " +
s"in [${getClass.getName}]. [${other.getClass.getName}] is not an Offset.")
@ -160,7 +160,7 @@ import pekko.serialization.Serializers
case seq: Sequence => (seq.value.toString, SequenceOffsetManifest)
case tbu: TimeBasedUUID => (tbu.value.toString, TimeBasedUUIDOffsetManifest)
case NoOffset => ("", NoOffsetManifest)
case _ =>
case _ =>
val obj = offset.asInstanceOf[AnyRef]
val serializer = serialization.findSerializerFor(obj)
val serializerId = serializer.identifier
@ -191,7 +191,7 @@ import pekko.serialization.Serializers
.grouped(2)
.map {
case pid :: seqNr :: Nil => pid -> seqNr.toLong
case _ =>
case _ =>
throw new IllegalArgumentException(
s"Invalid representation of Map(pid -> seqNr) [${parts.toList.drop(1).mkString(",")}]")
}

View file

@ -247,7 +247,7 @@ class LeveldbReadJournal(system: ExtendedActorSystem, config: Config)
.named("eventsByTag-" + URLEncoder.encode(tag, ByteString.UTF_8))
case NoOffset => eventsByTag(tag, Sequence(0L)) // recursive
case _ =>
case _ =>
throw new IllegalArgumentException(
"LevelDB does not support " + Logging.simpleName(offset.getClass) + " offsets")
}
@ -269,7 +269,7 @@ class LeveldbReadJournal(system: ExtendedActorSystem, config: Config)
new EventsByTagStage(tag, seq.value, maxBufSize, Long.MaxValue, writeJournalPluginId, None, mat))
.named("currentEventsByTag-" + URLEncoder.encode(tag, ByteString.UTF_8))
case NoOffset => currentEventsByTag(tag, Sequence(0L))
case _ =>
case _ =>
throw new IllegalArgumentException(
"LevelDB does not support " + Logging.simpleName(offset.getClass) + " offsets")
}

View file

@ -73,7 +73,7 @@ final class EventEnvelope[Event](
def event: Event =
eventOption match {
case Some(evt) => evt
case None =>
case None =>
throw new IllegalStateException(
"Event was not loaded. Use eventOption and load the event on demand with LoadEventQuery.")
}
@ -84,7 +84,7 @@ final class EventEnvelope[Event](
def getEvent(): Event =
eventOption match {
case Some(evt) => evt
case None =>
case None =>
throw new IllegalStateException(
"Event was not loaded. Use getOptionalEvent and load the event on demand with LoadEventQuery.")
}