Skip to content

Commit

Permalink
Parser needs to be instantiated on every call to .parse (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirocchj authored Feb 14, 2024
1 parent dbdd7f6 commit 0ba0f41
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions core/src/main/scala/tamer/Codec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ object Schema {
catch { case NonFatal(e) => s"Unexpected exception during compatibility check: ${e.getMessage()}" :: Nil }
}
private object Avro {
private[this] final val parser = new org.apache.avro.Schema.Parser()

final def parse(s: String): org.apache.avro.Schema = parser.parse(s)
final def parse(s: String): org.apache.avro.Schema = new org.apache.avro.Schema.Parser().parse(s)
}

final def fromAvro(s: =>org.apache.avro.Schema): Schema.Avro = Schema.Avro(s)
Expand Down

0 comments on commit 0ba0f41

Please sign in to comment.