diff --git a/zio-schema-json/js/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala b/zio-schema-json/js/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala index 6916c349f..fc49b2531 100644 --- a/zio-schema-json/js/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala +++ b/zio-schema-json/js/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala @@ -1,12 +1,10 @@ package zio.schema.codec object JsonPlatformSpecific { - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificEncoderTests = Seq.empty - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificDecoderTests = Seq.empty } diff --git a/zio-schema-json/jvm/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala b/zio-schema-json/jvm/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala index 6784395f0..5819ef452 100644 --- a/zio-schema-json/jvm/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala +++ b/zio-schema-json/jvm/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala @@ -6,9 +6,7 @@ import zio.test.{ Gen, check } object JsonPlatformSpecific { - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificEncoderTests = Seq( test("Currency") { assertEncodesJson( @@ -18,9 +16,7 @@ object JsonPlatformSpecific { } ) - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificDecoderTests = Seq( test("Currency") { check(Gen.currency)( diff --git a/zio-schema-json/native/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala b/zio-schema-json/native/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala index 6916c349f..fc49b2531 100644 --- a/zio-schema-json/native/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala +++ b/zio-schema-json/native/src/test/scala-2/zio/schema/codec/JsonPlatformSpecific.scala @@ -1,12 +1,10 @@ package zio.schema.codec object JsonPlatformSpecific { - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificEncoderTests = Seq.empty - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificDecoderTests = Seq.empty } diff --git a/zio-schema-protobuf/js/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala b/zio-schema-protobuf/js/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala index f8499fde2..177f43384 100644 --- a/zio-schema-protobuf/js/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala +++ b/zio-schema-protobuf/js/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala @@ -1,8 +1,7 @@ package zio.schema.codec object ProtobufPlatformSpecific { - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificEncodeAndDecode = Seq.empty } diff --git a/zio-schema-protobuf/jvm/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala b/zio-schema-protobuf/jvm/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala index 3c6f15c1e..9b4f461ab 100644 --- a/zio-schema-protobuf/jvm/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala +++ b/zio-schema-protobuf/jvm/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala @@ -8,9 +8,7 @@ import zio.test.{ Gen, assert, check } object ProtobufPlatformSpecific { - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificEncodeAndDecode = Seq( test("currencies") { check(Gen.currency) { value => diff --git a/zio-schema-protobuf/native/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala b/zio-schema-protobuf/native/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala index f8499fde2..177f43384 100644 --- a/zio-schema-protobuf/native/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala +++ b/zio-schema-protobuf/native/src/test/scala-2/zio/schema/codec/ProtobufPlatformSpecific.scala @@ -1,8 +1,7 @@ package zio.schema.codec object ProtobufPlatformSpecific { - @SuppressWarnings(Array( - "scalafix:ExplicitResultTypes" - )) + + @SuppressWarnings(Array("scalafix:ExplicitResultTypes")) val platformSpecificEncodeAndDecode = Seq.empty } diff --git a/zio-schema/jvm/src/main/scala/zio/schema/StandardType.scala b/zio-schema/jvm/src/main/scala/zio/schema/StandardType.scala index 933413d94..ab9742f3a 100644 --- a/zio-schema/jvm/src/main/scala/zio/schema/StandardType.scala +++ b/zio-schema/jvm/src/main/scala/zio/schema/StandardType.scala @@ -167,14 +167,13 @@ object StandardType { implicit object CurrencyType extends StandardType[java.util.Currency] { override def tag: String = Tags.CURRENCY - override def defaultValue: Either[String, java.util.Currency] = { + override def defaultValue: Either[String, java.util.Currency] = try { Right(java.util.Currency.getInstance(java.util.Locale.getDefault())) } catch { case _: NullPointerException => throw new Exception("Could not get default currency. Default locale was null.") - case ex => throw new Exception(s"Could not get default currency. ${ex.getMessage}") + case ex: Throwable => throw new Exception(s"Could not get default currency. ${ex.getMessage}") } - } override def compare(x: java.util.Currency, y: java.util.Currency): Int = x.getCurrencyCode.compareTo(y.getCurrencyCode)