[Git][java-team/lz4-java][upstream] New upstream version 1.6.0

Emmanuel Bourg gitlab at salsa.debian.org
Mon Feb 8 21:00:32 GMT 2021



Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / lz4-java


Commits:
7f42d4fd by Emmanuel Bourg at 2020-01-27T16:42:58+01:00
New upstream version 1.6.0
- - - - -


7 changed files:

- .travis.yml
- CHANGES.md
- README.md
- build.xml
- ivy.xml
- src/java/net/jpountz/lz4/LZ4Factory.java
- src/java/net/jpountz/lz4/LZ4FastDecompressor.java


Changes:

=====================================
.travis.yml
=====================================
@@ -1,16 +1,18 @@
 dist: trusty
 sudo: required
 language: java
-jkd:
-  - openjdk7
+jdk:
+  - openjdk8
 install:
-  - wget https://github.com/lz4/lz4/archive/v1.7.5.tar.gz
-  - tar -xzvf v1.7.5.tar.gz
-  - pushd lz4-1.7.5 && make && sudo make install && popd
-  - ant ivy-bootstrap
-  - ant init
+  - wget https://github.com/lz4/lz4/archive/v1.9.1.tar.gz
+  - tar xzvf v1.9.1.tar.gz
+  - pushd lz4-1.9.1 && make && sudo make install && popd
+  - wget http://apache.osuosl.org/ant/binaries/apache-ant-1.10.6-bin.tar.gz
+  - tar xvzf apache-ant-1.10.6-bin.tar.gz
+  - ./apache-ant-1.10.6/bin/ant ivy-bootstrap
+  - ./apache-ant-1.10.6/bin/ant init
 script:
-  - ant dist
-  - ant test
-  - ant clean
-  - ant test-skip-jni
+  - ./apache-ant-1.10.6/bin/ant dist
+  - ./apache-ant-1.10.6/bin/ant test
+  - ./apache-ant-1.10.6/bin/ant clean
+  - ./apache-ant-1.10.6/bin/ant test-skip-jni


=====================================
CHANGES.md
=====================================
@@ -1,5 +1,24 @@
 # Change log
 
+## 1.6.0
+
+- Upgraded LZ4 to 1.9.1. Updated the JNI bindings,
+  except for the one for Linux/i386.
+  Decompression speed is improved on amd64.
+
+- Deprecated use of LZ4FastDecompressor of a native instance
+  because the corresponding C API function is deprecated.
+  See [the release note of LZ4 1.9.0](https://github.com/lz4/lz4/releases/tag/v1.9.0) for details.
+  Updated javadoc accordingly.
+
+- [#134](https://github.com/lz4/lz4-java/issues/134)
+  [#137](https://github.com/lz4/lz4-java/issues/137)
+  Changed the module name from org.lz4.lz4-java to org.lz4.java
+  to avoid using - in the module name. (severn-everett, Oliver Eikemeier, Rei Odaira)
+
+- Enabled build with Java 11. Note that the distribution is still
+  built with Java 7. (Rei Odaira)
+
 ## 1.5.1
 
 - [#135](https://github.com/lz4/lz4-java/issues/135)


=====================================
README.md
=====================================
@@ -43,7 +43,7 @@ Have a look at LZ4Factory for more information.
    especially if CPU endianness differs, but the compressed streams can be
    safely decompressed by any decompressor implementation on any platform.
 
-## Example
+## Examples
 
 ```java
 LZ4Factory factory = LZ4Factory.fastestInstance();
@@ -71,6 +71,20 @@ int decompressedLength2 = decompressor2.decompress(compressed, 0, compressedLeng
 // decompressedLength == decompressedLength2
 ```
 
+```java
+byte[] data = "12345345234572".getBytes("UTF-8");
+final int decompressedLength = data.length;
+
+LZ4FrameOutputStream outStream = new LZ4FrameOutputStream(new FileOutputStream(new File("test.lz4")));
+outStream.write(data);
+outStream.close();
+
+byte[] restored = new byte[decompressedLength];
+LZ4FrameInputStream inStream = new LZ4FrameInputStream(new FileInputStream(new File("test.lz4")));
+inStream.read(restored);
+inStream.close();
+```
+
 # xxhash Java
 
 xxhash hashing for Java, based on Yann Collet's work available at https://github.com/Cyan4973/xxHash (old version
@@ -119,8 +133,8 @@ You can download released artifacts from [Maven Central](https://search.maven.or
 
 # Documentation
 
- - [lz4](https://lz4.github.io/lz4-java/1.5.1/docs/net/jpountz/lz4/package-summary.html)
- - [xxhash](https://lz4.github.io/lz4-java/1.5.1/docs/net/jpountz/xxhash/package-summary.html)
+ - [lz4](https://lz4.github.io/lz4-java/1.6.0/docs/net/jpountz/lz4/package-summary.html)
+ - [xxhash](https://lz4.github.io/lz4-java/1.6.0/docs/net/jpountz/xxhash/package-summary.html)
  - [changelog](https://github.com/lz4/lz4-java/blob/master/CHANGES.md)
 
 # Performance
@@ -130,8 +144,8 @@ hashing performance can depend a lot on the input (there are lies, damn lies
 and benchmarks), here are some benchmarks that try to give a sense of the
 speed at which they compress/decompress/hash bytes.
 
- - [lz4 compression](https://lz4.github.io/lz4-java/1.5.1/lz4-compression-benchmark/)
- - [lz4 decompression](https://lz4.github.io/lz4-java/1.5.1/lz4-decompression-benchmark/)
+ - [lz4 compression](https://lz4.github.io/lz4-java/1.6.0/lz4-compression-benchmark/)
+ - [lz4 decompression](https://lz4.github.io/lz4-java/1.6.0/lz4-decompression-benchmark/)
  - [xxhash hashing](https://lz4.github.io/lz4-java/1.3.0/xxhash-benchmark/)
 
 # Build


=====================================
build.xml
=====================================
@@ -42,6 +42,10 @@
    <os family="mac"/>
   </condition>
 
+  <condition property="java10+">
+    <javaversion atleast="10"/>
+  </condition>
+
   <target name="clean" description="clean working copy">
     <delete dir="${build}" />
     <delete dir="${dist}" />
@@ -128,7 +132,8 @@
       target="${javac.target}"
       encoding="UTF-8"
       debug="true"
-      destdir="${build}/classes"/>
+      destdir="${build}/classes"
+      nativeHeaderDir="${build}/jni-headers"/>
     <mkdir dir="${build}/unsafe-classes" />
     <javac
       includeAntRuntime="false"
@@ -155,7 +160,16 @@
     </javac>
   </target>
 
-  <target name="generate-headers" depends="compile-java" unless="${skip.jni}">
+  <target name="check-skip-jni-or-java10+">
+    <condition property="skip.jni.or.java10+">
+      <or>
+        <istrue value="${skip.jni}"/>
+        <istrue value="${java10+}"/>
+      </or>
+    </condition>
+  </target>
+
+  <target name="generate-headers" depends="compile-java,check-skip-jni-or-java10+" unless="${skip.jni.or.java10+}">
     <mkdir dir="${build}/jni-headers" />
     <javah
       destDir="${build}/jni-headers">
@@ -321,7 +335,7 @@
       <fileset dir="${build}/generated-classes" />
       <fileset dir="${build}/jni" erroronmissingdir="false" />
       <manifest>
-	<attribute name="Automatic-Module-Name" value="org.lz4.lz4-java"/>
+	<attribute name="Automatic-Module-Name" value="org.lz4.java"/>
       </manifest>
     </jar>
   </target>


=====================================
ivy.xml
=====================================
@@ -13,7 +13,7 @@
 -->
 
 <ivy-module version="2.0">
-  <info organisation="org.lz4" module="lz4-java" revision="1.5-SNAPSHOT" />
+  <info organisation="org.lz4" module="lz4-java" revision="1.6-SNAPSHOT" />
 
   <configurations defaultconfmapping="default->default">
     <conf name="default" />
@@ -21,6 +21,6 @@
   </configurations>
 
   <dependencies>
-    <dependency org="com.carrotsearch.randomizedtesting" name="junit4-ant" rev="2.5.3" transitive="true" conf="test->*,!sources,!javadoc" />
+    <dependency org="com.carrotsearch.randomizedtesting" name="junit4-ant" rev="2.7.3" transitive="true" conf="test->*,!sources,!javadoc" />
   </dependencies>
 </ivy-module>


=====================================
src/java/net/jpountz/lz4/LZ4Factory.java
=====================================
@@ -29,7 +29,7 @@ import static net.jpountz.lz4.LZ4Constants.MAX_COMPRESSION_LEVEL;
  * <p>
  * This class has 3 instances<ul>
  * <li>a {@link #nativeInstance() native} instance which is a JNI binding to
- * <a href="http://code.google.com/p/lz4/">the original LZ4 C implementation</a>.
+ * <a href="https://github.com/lz4/lz4">the original LZ4 C implementation</a>.
  * <li>a {@link #safeInstance() safe Java} instance which is a pure Java port
  * of the original C library,</li>
  * <li>an {@link #unsafeInstance() unsafe Java} instance which is a Java port
@@ -74,6 +74,13 @@ public final class LZ4Factory {
    * either not use this instance in webapps or to put this library in the lib
    * directory of your servlet container so that it is loaded by the system
    * class loader.
+   * <li>From lz4-java version 1.6.0, a {@link LZ4FastDecompressor} instance
+   * returned by {@link #fastDecompressor()} of this instance is SLOWER
+   * than a {@link LZ4SafeDecompressor} instance returned by
+   * {@link #safeDecompressor()}, due to a change in the original LZ4
+   * C implementation. The corresponding C API function is deprecated.
+   * Hence use of {@link #fastDecompressor()} is deprecated
+   * for this instance.
    * </ol>
    *
    * @return a {@link LZ4Factory} instance that returns compressors and
@@ -257,8 +264,11 @@ public final class LZ4Factory {
 
   /**
    * Returns a {@link LZ4FastDecompressor} instance.
+   * Use of this method is deprecated for the {@link #nativeInstance() native instance}.
    *
    * @return a {@link LZ4FastDecompressor} instance
+   *
+   * @see #nativeInstance()
    */
   public LZ4FastDecompressor fastDecompressor() {
     return fastDecompressor;


=====================================
src/java/net/jpountz/lz4/LZ4FastDecompressor.java
=====================================
@@ -21,7 +21,14 @@ import java.nio.ByteBuffer;
  * Use {@link LZ4SafeDecompressor} if you only know the size of the
  * compressed stream.
  * <p>
+ * From lz4-java 1.6.0, it is deprecated to use a JNI-binding instance
+ * of this class; i.e., an instasnce returned by
+ * {@link LZ4Factory#fastDecompressor()} of {@link LZ4Factory#nativeInstance()}.
+ * Please see {@link LZ4Factory#nativeInstance()} for details.
+ * <p>
  * Instances of this class are thread-safe.
+ *
+ * @see LZ4Factory#nativeInstance()
  */
 public abstract class LZ4FastDecompressor implements LZ4Decompressor {
 



View it on GitLab: https://salsa.debian.org/java-team/lz4-java/-/commit/7f42d4fdfb3d99fa71a0734cd5ec33fc84aa117b

-- 
View it on GitLab: https://salsa.debian.org/java-team/lz4-java/-/commit/7f42d4fdfb3d99fa71a0734cd5ec33fc84aa117b
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/20210208/1d40264c/attachment.html>


More information about the pkg-java-commits mailing list