diff --git a/debian/changelog b/debian/changelog index 40268ae..403200e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ * New upstream release - Build the new jawn-util module * No longer build with the embedded SBT using Scala 2.10 (Closes: #893456) + * Fixed a build failure with Java 11 * Standards-Version updated to 4.2.1 * Switch to debhelper level 11 * Added the missing Vcs-* fields diff --git a/debian/patches/01-java11-compatibility.patch b/debian/patches/01-java11-compatibility.patch new file mode 100644 index 0000000..ab46117 --- /dev/null +++ b/debian/patches/01-java11-compatibility.patch @@ -0,0 +1,26 @@ +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 diff --git a/debian/patches/series b/debian/patches/series index 78e9091..181d7c6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ #use-latest-sbt.patch +01-java11-compatibility.patch