This is an automated email from the ASF dual-hosted git repository.
nkalmar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 8148f96 ZOOKEEPER-3739: Remove unsupported com.sun API
8148f96 is described below
commit 8148f966947d3ecf3db0b756d93c9ffa88174af9
Author: Christopher Tubbs <[email protected]>
AuthorDate: Fri Mar 20 11:00:13 2020 +0100
ZOOKEEPER-3739: Remove unsupported com.sun API
Remove unsupported use of com.sun.nio.file.SensitivityWatchEventModifier
to better support builds against newer JDKs.
Also update build tooling to use strict JDK release compatibility when
building with newer JDKs by adding profiles which automatically activate
the correct compiler flag when the newer JDK is detected when building
with Maven or Eclipse.
Author: Christopher Tubbs <[email protected]>
Reviewers: Enrico Olivelli <[email protected]>, Norbert Kalmar
<[email protected]>
Closes #1269 from ctubbsii/ZK-3739
---
pom.xml | 22 +++++++++++++++++++++-
.../apache/zookeeper/common/FileChangeWatcher.java | 3 +--
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4d972a6..041b415 100755
--- a/pom.xml
+++ b/pom.xml
@@ -307,6 +307,26 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>m2e</id>
+ <activation>
+ <property>
+ <name>m2e.version</name>
+ </property>
+ </activation>
+ <properties>
+ <maven.compiler.release>8</maven.compiler.release>
+ </properties>
+ </profile>
+ <profile>
+ <id>jdk-release-flag</id>
+ <activation>
+ <jdk>[9,)</jdk>
+ </activation>
+ <properties>
+ <maven.compiler.release>8</maven.compiler.release>
+ </properties>
+ </profile>
</profiles>
<properties>
@@ -529,7 +549,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
+ <version>3.8.1</version>
<configuration>
<showWarnings>true</showWarnings>
<compilerArgs>
diff --git
a/zookeeper-server/src/main/java/org/apache/zookeeper/common/FileChangeWatcher.java
b/zookeeper-server/src/main/java/org/apache/zookeeper/common/FileChangeWatcher.java
index 5410c89..274e212 100644
---
a/zookeeper-server/src/main/java/org/apache/zookeeper/common/FileChangeWatcher.java
+++
b/zookeeper-server/src/main/java/org/apache/zookeeper/common/FileChangeWatcher.java
@@ -18,7 +18,6 @@
package org.apache.zookeeper.common;
-import com.sun.nio.file.SensitivityWatchEventModifier;
import java.io.IOException;
import java.nio.file.ClosedWatchServiceException;
import java.nio.file.FileSystem;
@@ -72,7 +71,7 @@ public final class FileChangeWatcher {
LOG.debug("Registering with watch service: {}", dirPath);
- dirPath.register(watchService, new
WatchEvent.Kind<?>[]{StandardWatchEventKinds.ENTRY_CREATE,
StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY,
StandardWatchEventKinds.OVERFLOW}, SensitivityWatchEventModifier.HIGH);
+ dirPath.register(watchService, new
WatchEvent.Kind<?>[]{StandardWatchEventKinds.ENTRY_CREATE,
StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY,
StandardWatchEventKinds.OVERFLOW});
state = State.NEW;
this.watcherThread = new WatcherThread(watchService, callback);
this.watcherThread.setDaemon(true);