From b3b311c7ed44aa8ecce524922f4f0eed3d3f7472 Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Tue, 28 Jun 2022 13:42:58 +0200 Subject: [PATCH 1/5] Make the compiled package runnable on Java 7 or later Should fix https://github.com/kaitai-io/kaitai_struct_java_runtime/issues/34 --- pom.xml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 9819009..43e1b9e 100644 --- a/pom.xml +++ b/pom.xml @@ -40,10 +40,29 @@ UTF-8 + 1.7 + 1.7 + + + jdk9 + + [1.9,) + + + 7 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + org.apache.maven.plugins maven-source-plugin @@ -111,15 +130,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 6 - 6 - - From 3b8d66ecc96b6553d99c6ae035b8751439f93b5e Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Tue, 28 Jun 2022 18:31:58 +0200 Subject: [PATCH 2/5] Fix Javadoc error on JDK 17 (move @implNote before

) --- src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java b/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java index 5115bfe..850feb9 100644 --- a/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java +++ b/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java @@ -106,8 +106,9 @@ public ByteBuffer asRoBuffer() { /** * Closes the stream safely. If there was an open file associated with it, closes that file. * For streams that were reading from in-memory array, does nothing. + * @implNote *

- * @implNote Unfortunately, there is no simple way to close memory-mapped ByteBuffer in + * Unfortunately, there is no simple way to close memory-mapped ByteBuffer in * Java and unmap underlying file. As {@link MappedByteBuffer} documentation suggests, * "mapped byte buffer and the file mapping that it represents remain valid until the * buffer itself is garbage-collected". Thus, the best we can do is to delete all From 1e6d665e41ca06b0ec279e7b3506322dd096203c Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Tue, 28 Jun 2022 14:20:44 +0200 Subject: [PATCH 3/5] ByteBufferKaitaiStream: text URL to link (in Javadoc) --- src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java b/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java index 850feb9..0f5f06f 100644 --- a/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java +++ b/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java @@ -129,7 +129,7 @@ public ByteBuffer asRoBuffer() { *

*

* For more examples and suggestions, see: - * https://stackoverflow.com/questions/2972986/how-to-unmap-a-file-from-memory-mapped-using-filechannel-in-java + * How to unmap a file from memory mapped using FileChannel in java? *

* @throws IOException if FileChannel can't be closed */ From b5ef30b6a92d6624951541ee236b5d51ab8d837a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Pu=C4=8Dil?= Date: Tue, 28 Jun 2022 17:45:09 +0200 Subject: [PATCH 4/5] ByteBufferKaitaiStream: shorten the link to Stack Overflow Co-authored-by: dgelessus --- src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java b/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java index 0f5f06f..32f3ea1 100644 --- a/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java +++ b/src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java @@ -129,7 +129,7 @@ public ByteBuffer asRoBuffer() { *

*

* For more examples and suggestions, see: - * How to unmap a file from memory mapped using FileChannel in java? + * How to unmap a file from memory mapped using FileChannel in java? *

* @throws IOException if FileChannel can't be closed */ From 4111120a0cbd672fb5d93794fb2c5c0644090a81 Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Fri, 1 Jul 2022 20:04:18 +0200 Subject: [PATCH 5/5] Update maven-javadoc-plugin to 3.2.0 (last to support Java 7) Fixes a java.lang.ExceptionInInitializerError on Java 17 when running `mvn package`, see https://github.com/kaitai-io/kaitai_struct_java_runtime/pull/38#issuecomment-1172580919 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 43e1b9e..b246cf4 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.2.0 attach-javadocs