[Git][java-team/libsejda-io-java][master] 6 commits: Fix watch file.

Markus Koschany gitlab at salsa.debian.org
Sat Dec 22 11:19:45 GMT 2018


Markus Koschany pushed to branch master at Debian Java Maintainers / libsejda-io-java


Commits:
f948e912 by Markus Koschany at 2018-12-22T10:37:12Z
Fix watch file.

- - - - -
98ad5ea9 by Markus Koschany at 2018-12-22T10:37:23Z
New upstream version 1.1.4
- - - - -
e12e2d44 by Markus Koschany at 2018-12-22T10:37:27Z
Update upstream source from tag 'upstream/1.1.4'

Update to upstream version '1.1.4'
with Debian dir d1acd59a4af75968f96f71bf7c4646df7d4c5951
- - - - -
8c35f611 by Markus Koschany at 2018-12-22T10:37:59Z
Switch to compat level 11.

- - - - -
85eb6241 by Markus Koschany at 2018-12-22T10:38:10Z
Declare compliance with Debian Policy 4.2.1.

- - - - -
7aecf19b by Markus Koschany at 2018-12-22T11:16:53Z
Update changelog

- - - - -


9 changed files:

- .travis.yml
- debian/changelog
- debian/compat
- debian/control
- debian/watch
- pom.xml
- src/main/java/org/sejda/io/MemoryMappedSeekableSource.java
- src/main/java/org/sejda/io/SeekableSource.java
- src/main/java/org/sejda/util/IOUtils.java


Changes:

=====================================
.travis.yml
=====================================
@@ -2,3 +2,6 @@ language: java
 sudo: false
 jdk:
   - oraclejdk8
+notifications:
+  email:
+    - info at sejda.org


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libsejda-io-java (1.1.4-1) unstable; urgency=medium
+
+  * New upstream version 1.1.4
+  * Switch to compat level 11.
+  * Declare compliance with Debian Policy 4.2.1.
+
+ -- Markus Koschany <apo at debian.org>  Sat, 22 Dec 2018 12:16:31 +0100
+
 libsejda-io-java (1.1.3-2) unstable; urgency=medium
 
   * libsejda-io-java.poms: Remove --has-package-version flag. (Closes: #874494)


=====================================
debian/compat
=====================================
@@ -1 +1 @@
-10
+11


=====================================
debian/control
=====================================
@@ -5,12 +5,12 @@ Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.or
 Uploaders:
  Markus Koschany <apo at debian.org>
 Build-Depends:
- debhelper (>= 10),
+ debhelper (>= 11),
  default-jdk,
  libcommons-io-java,
  libslf4j-java (>= 1.7.21),
  maven-debian-helper (>= 2.1)
-Standards-Version: 4.0.0
+Standards-Version: 4.2.1
 Vcs-Git: https://anonscm.debian.org/git/pkg-java/libsejda-io-java.git
 Vcs-Browser: https://anonscm.debian.org/git/pkg-java/libsejda-io-java.git
 Homepage: http://www.sejda.org


=====================================
debian/watch
=====================================
@@ -1,4 +1,4 @@
 version=4
-opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/sejda-io-$1\.tar\.gzi/,\
+opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/sejda-io-$1\.tar\.gz/,\
 uversionmangle=s/_/./g;s/\.RELEASE// \
   https://github.com/torakiki/sejda-io/tags .*/v?(\d\S+)\.tar\.gz


=====================================
pom.xml
=====================================
@@ -5,7 +5,7 @@
 	<artifactId>sejda-io</artifactId>
 	<packaging>jar</packaging>
 	<name>sejda-io</name>
-	<version>1.1.3.RELEASE</version>
+	<version>1.1.4</version>
 
 	<description>An Input/Output layer built on top of Java standard io and nio packages</description>
 	<url>http://www.sejda.org</url>
@@ -37,7 +37,7 @@
 		<connection>scm:git:git at github.com:torakiki/sejda-io.git</connection>
 		<developerConnection>scm:git:git at github.com:torakiki/sejda-io.git</developerConnection>
 		<url>scm:git:git at github.com:torakiki/sejda-io.git</url>
-		<tag>v1.1.3.RELEASE</tag>
+		<tag>v1.1.4</tag>
 	</scm>
 
 	<developers>
@@ -85,7 +85,7 @@
 					<plugin>
 						<groupId>org.apache.maven.plugins</groupId>
 						<artifactId>maven-release-plugin</artifactId>
-						<version>2.5.2</version>
+						<version>2.5.3</version>
 						<configuration>
 							<tagNameFormat>v@{project.version}</tagNameFormat>
 							<preparationGoals>clean install</preparationGoals>
@@ -115,7 +115,7 @@
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-compiler-plugin</artifactId>
-				<version>3.3</version>
+				<version>3.8.0</version>
 				<configuration>
 					<source>1.8</source>
 					<target>1.8</target>
@@ -126,12 +126,19 @@
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-jar-plugin</artifactId>
-				<version>2.6</version>
+				<version>3.1.0</version>
+				<configuration>
+					<archive>
+						<manifestEntries>
+							<Automatic-Module-Name>org.sejda.io</Automatic-Module-Name>
+						</manifestEntries>
+					</archive>
+				</configuration>
 			</plugin>
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-source-plugin</artifactId>
-				<version>2.4</version>
+				<version>3.0.1</version>
 				<executions>
 					<execution>
 						<id>attach-sources</id>
@@ -147,17 +154,17 @@
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
-			<version>1.7.21</version>
+			<version>1.7.25</version>
 		</dependency>
 		<dependency>
 			<groupId>commons-io</groupId>
 			<artifactId>commons-io</artifactId>
-			<version>2.5</version>
+			<version>2.6</version>
 		</dependency>
 		<dependency>
 			<groupId>ch.qos.logback</groupId>
 			<artifactId>logback-classic</artifactId>
-			<version>1.1.7</version>
+			<version>1.2.3</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>


=====================================
src/main/java/org/sejda/io/MemoryMappedSeekableSource.java
=====================================
@@ -27,6 +27,8 @@ import java.nio.channels.FileChannel;
 import java.nio.channels.FileChannel.MapMode;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
+import java.util.function.Consumer;
 
 import org.sejda.util.IOUtils;
 import org.slf4j.Logger;
@@ -49,6 +51,7 @@ public class MemoryMappedSeekableSource extends BaseSeekableSource {
     private long size;
     private ThreadBoundCopiesSupplier<MemoryMappedSeekableSource> localCopiesSupplier = new ThreadBoundCopiesSupplier<>(
             () -> new MemoryMappedSeekableSource(this));
+    private Consumer<? super ByteBuffer> unmapper = IOUtils::unmap;
 
     public MemoryMappedSeekableSource(File file) throws IOException {
         super(ofNullable(file).map(File::getAbsolutePath).orElseThrow(() -> {
@@ -74,6 +77,8 @@ public class MemoryMappedSeekableSource extends BaseSeekableSource {
         for (ByteBuffer page : parent.pages) {
             this.pages.add(page.duplicate());
         }
+        // unmap doesn't work on duplicate, see Unsafe#invokeCleaner
+        this.unmapper = null;
     }
 
     @Override
@@ -146,7 +151,7 @@ public class MemoryMappedSeekableSource extends BaseSeekableSource {
     public void close() throws IOException {
         super.close();
         IOUtils.close(localCopiesSupplier);
-        pages.stream().forEach(IOUtils::unmap);
+        Optional.ofNullable(unmapper).ifPresent(m -> pages.stream().forEach(m));
         pages.clear();
     }
 


=====================================
src/main/java/org/sejda/io/SeekableSource.java
=====================================
@@ -39,7 +39,7 @@ public interface SeekableSource extends ReadableByteChannel {
 
     /**
      * Sets the source position. Setting the position to a value that is greater than the source's size is legal but does not change the size of the source. A later attempt to read
-     * bytes at such a position will immediately
+     * bytes at such a position will immediately return an end-of-file indication.
      * 
      * @param position
      *            a non-negative long for the new position


=====================================
src/main/java/org/sejda/util/IOUtils.java
=====================================
@@ -54,8 +54,8 @@ public final class IOUtils {
     private static final Optional<Consumer<ByteBuffer>> UNMAPPER;
 
     static {
-        UNMAPPER = Optional
-                .ofNullable(AccessController.doPrivileged((PrivilegedAction<Consumer<ByteBuffer>>) IOUtils::unmapper));
+        UNMAPPER = Optional.ofNullable(
+                AccessController.doPrivileged((PrivilegedAction<Consumer<ByteBuffer>>) IOUtils::unmapper));
     }
 
     private IOUtils() {
@@ -110,13 +110,11 @@ public final class IOUtils {
      * @param buf
      */
     public static void unmap(ByteBuffer buf) {
-        UNMAPPER.ifPresent(u -> {
-            try {
-                u.accept(buf);
-            } catch (Exception e) {
-                LOG.error("Unable to unmap ByteBuffer.", e);
-            }
-        });
+        try {
+            UNMAPPER.ifPresent(u -> u.accept(buf));
+        } catch (Exception e) {
+            LOG.error("Unable to unmap ByteBuffer.", e);
+        }
     }
 
     /**
@@ -157,9 +155,8 @@ public final class IOUtils {
                  * needs ELSE } }
                  */
                 final MethodHandle cleanMethod = lookup.findVirtual(cleanerClass, "clean", methodType(void.class));
-                final MethodHandle nonNullTest = lookup
-                        .findStatic(Objects.class, "nonNull", methodType(boolean.class, Object.class))
-                        .asType(methodType(boolean.class, cleanerClass));
+                final MethodHandle nonNullTest = lookup.findStatic(Objects.class, "nonNull",
+                        methodType(boolean.class, Object.class)).asType(methodType(boolean.class, cleanerClass));
                 final MethodHandle noop = dropArguments(constant(Void.class, null).asType(methodType(void.class)), 0,
                         cleanerClass);
                 final MethodHandle unmapper = filterReturnValue(directBufferCleanerMethod,



View it on GitLab: https://salsa.debian.org/java-team/libsejda-io-java/compare/ef38b1849ce005a454d7ee3fecce6c3471c88c10...7aecf19b3b00bc1f51633e2b8f004033f8c4ac93

-- 
View it on GitLab: https://salsa.debian.org/java-team/libsejda-io-java/compare/ef38b1849ce005a454d7ee3fecce6c3471c88c10...7aecf19b3b00bc1f51633e2b8f004033f8c4ac93
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/20181222/6c47bda1/attachment.html>


More information about the pkg-java-commits mailing list