Skip to content

Commit

Permalink
Update scala-library, scala-reflect to 2.13.14 (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
scala-steward committed Jun 13, 2024
1 parent 7815a0e commit dfd48d5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ val shapelessVersion = "2.3.10"
val slf4jNopVersion = "2.0.13"

val scala212 = "2.12.18"
val scala213 = "2.13.12"
val scala213 = "2.13.14"
val scala3 = "3.3.1"

ThisBuild / versionScheme := Some("early-semver")
Expand Down
24 changes: 12 additions & 12 deletions modules/core/src/main/scala/vulcan/Codec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ object Codec extends CodecCompanionCompat {
extends Codec.InstanceForTypes[Avro.Boolean, Boolean](
"Boolean",
SchemaBuilder.builder().booleanType(),
_.asRight, { case (boolean: Boolean, _) => Right(boolean) },
_.asRight, { case (value: Boolean, _) => Right(value) },
Some("Boolean")
)

Expand Down Expand Up @@ -361,11 +361,11 @@ object Codec extends CodecCompanionCompat {
override def decode(value: Any, writerSchema: Schema): Either[AvroError, BigDecimal] = {
if (writerSchema.getType == Schema.Type.BYTES) {
value match {
case bytes: Avro.Bytes =>
case avroBytes: Avro.Bytes =>
writerSchema.getLogicalType match {
case decimal: LogicalTypes.Decimal =>
val conversion = new Conversions.DecimalConversion()
val bigDecimal = BigDecimal(conversion.fromBytes(bytes, writerSchema, decimal))
val bigDecimal = BigDecimal(conversion.fromBytes(avroBytes, writerSchema, decimal))
if (bigDecimal.precision <= decimal.getPrecision) {
Right(bigDecimal)
} else
Expand Down Expand Up @@ -580,15 +580,15 @@ object Codec extends CodecCompanionCompat {
Left(AvroError.encodeExceedsFixedSize(bytes.length, size))
}
}, {
case (fixed: Avro.Fixed, schema) =>
case (fixed: Avro.Fixed, avroSchema) =>
val bytes = fixed.bytes()
if (bytes.length == schema.getFixedSize) {
if (bytes.length == avroSchema.getFixedSize) {
decode(bytes)
} else {
Left {
AvroError.decodeNotEqualFixedSize(
bytes.length,
schema.getFixedSize
avroSchema.getFixedSize
)
}
}
Expand Down Expand Up @@ -770,14 +770,14 @@ object Codec extends CodecCompanionCompat {
Right(coll)
}
}, {
case (as: java.util.Collection[_], schema) =>
case (as: java.util.Collection[_], avroShema) =>
val it = as.iterator()
val coll: ju.Collection[A] = new ju.ArrayList
AvroError.catchNonFatal {
while (it.hasNext)(coll
.add(
codec
.decode(it.next(), schema.getElementType)
.decode(it.next(), avroShema.getElementType)
.fold(err => throw err.throwable, identity)
))
Right(coll)
Expand Down Expand Up @@ -887,11 +887,11 @@ object Codec extends CodecCompanionCompat {
.tupleLeft(Avro.String(key))
}
.map(_.toMap.asJava), {
case (map: java.util.Map[_, _], schema) =>
case (map: java.util.Map[_, _], avroSchema) =>
map.asScala.toList
.traverse {
case (key: Avro.String, value) =>
codec.decode(value, schema.getValueType).tupleLeft(key.toString)
codec.decode(value, avroSchema.getValueType).tupleLeft(key.toString)
case (key, _) => Left(AvroError.decodeUnexpectedMapKey(key))
}
.map(_.toMap)
Expand Down Expand Up @@ -1191,8 +1191,8 @@ object Codec extends CodecCompanionCompat {
value match {
case string: String => Right(string)
case avroString: Avro.String => Right(avroString.toString)
case bytes: Avro.Bytes =>
AvroError.catchNonFatal(Right(StandardCharsets.UTF_8.decode(bytes).toString))
case avroBytes: Avro.Bytes =>
AvroError.catchNonFatal(Right(StandardCharsets.UTF_8.decode(avroBytes).toString))
case other =>
Left {
AvroError
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/main/scala/vulcan/Props.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ object Props {

override final def toString: String =
toChain match {
case Right(props) =>
props.toList
case Right(pairs) =>
pairs.toList
.map { case (name, value) => s"$name -> $value" }
.mkString("Props(", ", ", ")")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

package vulcan.generic

import cats.implicits._
import org.scalatest.Assertion
import org.scalatest.funspec.AnyFunSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
Expand Down

0 comments on commit dfd48d5

Please sign in to comment.