[Git][java-team/lz4-java][master] Fixed the backward compatibility with Java 8
Emmanuel Bourg
gitlab at salsa.debian.org
Mon Oct 14 10:44:23 BST 2019
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / lz4-java
Commits:
49d69366 by Emmanuel Bourg at 2019-10-14T09:35:49Z
Fixed the backward compatibility with Java 8
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/java8-compatibility.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+lz4-java (1.5.1-2) unstable; urgency=medium
+
+ * Team upload.
+ * Fixed the backward compatibility with Java 8
+
+ -- Emmanuel Bourg <ebourg at apache.org> Mon, 14 Oct 2019 11:35:29 +0200
+
lz4-java (1.5.1-1) unstable; urgency=medium
* Initial release (Closes: #934700)
=====================================
debian/patches/java8-compatibility.patch
=====================================
@@ -0,0 +1,80 @@
+Description: Preserves the backward compatibility with Java 8
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/src/java/net/jpountz/lz4/LZ4FrameOutputStream.java
++++ b/src/java/net/jpountz/lz4/LZ4FrameOutputStream.java
+@@ -225,7 +225,7 @@
+ intLEBuffer.putInt(0, checksum.hash(bufferToWrite, 0, compressedLength, 0));
+ out.write(intLEBuffer.array());
+ }
+- buffer.rewind();
++ ((java.nio.Buffer) buffer).rewind();
+ }
+
+ /**
+--- a/src/java/net/jpountz/lz4/LZ4FrameInputStream.java
++++ b/src/java/net/jpountz/lz4/LZ4FrameInputStream.java
+@@ -133,7 +133,7 @@
+ * @throws IOException
+ */
+ private void readHeader() throws IOException {
+- headerBuffer.rewind();
++ ((java.nio.Buffer) headerBuffer).rewind();
+
+ final int flgRead = in.read();
+ if (flgRead < 0) {
+@@ -174,7 +174,7 @@
+ compressedBuffer = new byte[maxBlockSize]; // Reused during different compressions
+ rawBuffer = new byte[maxBlockSize];
+ buffer = ByteBuffer.wrap(rawBuffer);
+- buffer.limit(0);
++ ((java.nio.Buffer) buffer).limit(0);
+ }
+
+ private final ByteBuffer readNumberBuff = ByteBuffer.allocate(LZ4FrameOutputStream.LONG_BYTES).order(ByteOrder.LITTLE_ENDIAN);
+@@ -270,8 +270,8 @@
+ frameInfo.updateStreamHash(rawBuffer, 0, currentBufferSize);
+ }
+ totalContentSize += currentBufferSize;
+- buffer.limit(currentBufferSize);
+- buffer.rewind();
++ ((java.nio.Buffer) buffer).limit(currentBufferSize);
++ ((java.nio.Buffer) buffer).rewind();
+ }
+
+ @Override
+@@ -319,7 +319,7 @@
+ readBlock();
+ }
+ n = Math.min(n, buffer.remaining());
+- buffer.position(buffer.position() + (int)n);
++ ((java.nio.Buffer) buffer).position(buffer.position() + (int)n);
+ return n;
+ }
+
+--- a/src/java/net/jpountz/lz4/LZ4DecompressorWithLength.java
++++ b/src/java/net/jpountz/lz4/LZ4DecompressorWithLength.java
+@@ -143,8 +143,8 @@
+ public void decompress(ByteBuffer src, ByteBuffer dest) {
+ final int destLen = getDecompressedLength(src, src.position());
+ final int read = decompressor.decompress(src, src.position() + 4, dest, dest.position(), destLen);
+- src.position(src.position() + 4 + read);
+- dest.position(dest.position() + destLen);
++ ((java.nio.Buffer) src).position(src.position() + 4 + read);
++ ((java.nio.Buffer) dest).position(dest.position() + destLen);
+ }
+
+ /** Decompresses <code>src[srcOff:]</code> into <code>dest[destOff:]</code>
+--- a/src/java/net/jpountz/lz4/LZ4CompressorWithLength.java
++++ b/src/java/net/jpountz/lz4/LZ4CompressorWithLength.java
+@@ -166,8 +166,8 @@
+ */
+ public void compress(ByteBuffer src, ByteBuffer dest) {
+ final int compressedLength = compress(src, src.position(), src.remaining(), dest, dest.position(), dest.remaining());
+- src.position(src.limit());
+- dest.position(dest.position() + compressedLength);
++ ((java.nio.Buffer) src).position(src.limit());
++ ((java.nio.Buffer) dest).position(dest.position() + compressedLength);
+ }
+
+ /**
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ replace-javah.patch
ivyversioncorrection.patch
mvel-broken-includes-workaround.patch
unbundle-native-library.patch
+java8-compatibility.patch
View it on GitLab: https://salsa.debian.org/java-team/lz4-java/commit/49d693661c2d326af49a154cd2bded92c63c907f
--
View it on GitLab: https://salsa.debian.org/java-team/lz4-java/commit/49d693661c2d326af49a154cd2bded92c63c907f
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20191014/fd993fcc/attachment.html>
More information about the pkg-java-commits
mailing list