Closed christhalinger closed 6 years ago
I think the fix is just this:
diff --git a/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/ByteBufferUtils.scala b/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/ByteBufferU
index 59ccaff..de61053 100644
--- a/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/ByteBufferUtils.scala
+++ b/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/ByteBufferUtils.scala
@@ -36,7 +36,7 @@ private[finatra] object ByteBufferUtils extends Logging {
val buf = Buf.ByteBuffer.Shared(copy)
val str = buf.utf8str
- debug(s"byteBuffer: $str pos: ${byteBuffer.position}")
+ debug(s"byteBuffer: $str pos: ${byteBuffer.position()}")
}
}
}
diff --git a/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/JsonArrayChunker.scala b/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/JsonArrayC
index 35f3ded..4ad4526 100644
--- a/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/JsonArrayChunker.scala
+++ b/jackson/src/main/scala/com/twitter/finatra/json/internal/streaming/JsonArrayChunker.scala
@@ -72,7 +72,7 @@ private[finatra] class JsonArrayChunker extends Logging {
parsingState = InsideString
}
// If the double quote wasn't escaped then this is the end of a string.
- else if (in.get(in.position - 2) != '\\') {
+ else if (in.get(in.position() - 2) != '\\') {
debug("State = Parsing")
parsingState = Normal
}
@@ -83,7 +83,7 @@ private[finatra] class JsonArrayChunker extends Logging {
private def extractBuf(): Buf = {
val copy = byteBuffer.duplicate()
copy.position(0)
- copy.limit(byteBuffer.position - 1)
+ copy.limit(byteBuffer.position() - 1)
val copyBuf = Buf.ByteBuffer.Shared(copy)
byteBuffer = byteBuffer.slice()
but I'm by no means an expert.
@christhalinger it's not obvious to me why java9 overriding ByteBuffer#position(int newPosition)
would confuse usage of the non-parameterized version but your fix looks semantically correct so if that resolves it, let's go with that.
want to post a PR?
I have no idea. Yes, I'll post a PR.
Fixed merged in 65561afe9d6695c9e0d0b06bc59efca1ed4d68c8.
Some method usages are ambiguous with 9.
Expected behavior
No build failures.
Actual behavior
Steps to reproduce the behavior
Run
sbt
with JDK 9, e.g.: