Description: Fixes the compatibility with Java 11 Origin: backport, https://github.com/non/jawn/commit/928b7b78 --- a/parser/src/main/scala/jawn/AsyncParser.scala +++ b/parser/src/main/scala/jawn/AsyncParser.scala @@ -79,7 +79,7 @@ final def absorb(buf: ByteBuffer)(implicit facade: Facade[J]): Either[ParseException, Seq[J]] = { done = false - val buflen = buf.limit - buf.position + val buflen = buf.limit() - buf.position() val need = len + buflen resizeIfNecessary(need) buf.get(data, len, buflen) --- a/parser/src/main/scala/jawn/ByteBufferParser.scala +++ b/parser/src/main/scala/jawn/ByteBufferParser.scala @@ -14,8 +14,8 @@ * update its own mutable position fields. */ final class ByteBufferParser[J](src: ByteBuffer) extends SyncParser[J] with ByteBasedParser[J] { - private[this] final val start = src.position - private[this] final val limit = src.limit - start + private[this] final val start = src.position() + private[this] final val limit = src.limit() - start private[this] var lineState = 0 protected[this] def line(): Int = lineState