diff --git a/shared/src/main/scala/io/kaitai/struct/languages/JavaCompiler.scala b/shared/src/main/scala/io/kaitai/struct/languages/JavaCompiler.scala index 503fa8b68..cb9dc4d5e 100644 --- a/shared/src/main/scala/io/kaitai/struct/languages/JavaCompiler.scala +++ b/shared/src/main/scala/io/kaitai/struct/languages/JavaCompiler.scala @@ -430,7 +430,7 @@ class JavaCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig) override def allocateIOFixed(varName: Identifier, size: String): String = { val ioName = idToStr(IoStorageIdentifier(varName)) - out.puts(s"$kstreamName $ioName = new ByteBufferKaitaiStream($size);") + out.puts(s"final $kstreamName $ioName = new ByteBufferKaitaiStream($size);") ioName }