This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git


The following commit(s) were added to refs/heads/master by this push:
     new 4baec84f CURATOR-642 Upgrade Guava from 27.0.1 to 31.1 (#420)
4baec84f is described below

commit 4baec84f89b4e965460895ac666e7b06a0b9a10b
Author: exceptionfactory <exceptionfact...@apache.org>
AuthorDate: Tue Jul 12 20:38:16 2022 -0500

    CURATOR-642 Upgrade Guava from 27.0.1 to 31.1 (#420)
---
 .../main/java/org/apache/curator/test/DirectoryUtils.java    | 12 ++++++++++++
 .../src/main/java/org/apache/curator/test/InstanceSpec.java  |  3 +--
 pom.xml                                                      |  2 +-
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git 
a/curator-test/src/main/java/org/apache/curator/test/DirectoryUtils.java 
b/curator-test/src/main/java/org/apache/curator/test/DirectoryUtils.java
index 134aa5fb..8c4c8d88 100644
--- a/curator-test/src/main/java/org/apache/curator/test/DirectoryUtils.java
+++ b/curator-test/src/main/java/org/apache/curator/test/DirectoryUtils.java
@@ -23,6 +23,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
 
 // copied from Google Guava as these methods are now deprecated
 // NOTE: removed the line of code documented: Symbolic links will have 
different canonical and absolute paths
@@ -31,6 +34,15 @@ public class DirectoryUtils
 {
     private static final Logger log = 
LoggerFactory.getLogger(DirectoryUtils.class);
 
+    public static File createTempDirectory() {
+        try {
+            final Path tempDirectory = 
Files.createTempDirectory(DirectoryUtils.class.getSimpleName());
+            return tempDirectory.toFile();
+        } catch (final IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
     public static void deleteRecursively(File file) throws IOException
     {
         if (file.isDirectory()) {
diff --git 
a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java 
b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java
index 8948f4d3..b1d80e6d 100644
--- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java
+++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java
@@ -19,7 +19,6 @@
 
 package org.apache.curator.test;
 
-import com.google.common.io.Files;
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
@@ -169,7 +168,7 @@ public class InstanceSpec
      */
     public InstanceSpec(File dataDirectory, int port, int electionPort, int 
quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int 
maxClientCnxns, Map<String,Object> customProperties,String hostname)
     {
-        this.dataDirectory = (dataDirectory != null) ? dataDirectory : 
Files.createTempDir();
+        this.dataDirectory = (dataDirectory != null) ? dataDirectory : 
DirectoryUtils.createTempDirectory();
         this.port = (port >= 0) ? port : getRandomPort();
         this.electionPort = (electionPort >= 0) ? electionPort : 
getRandomPort();
         this.quorumPort = (quorumPort >= 0) ? quorumPort : getRandomPort();
diff --git a/pom.xml b/pom.xml
index 041885b0..60465cac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@
         <scannotation-version>1.0.2</scannotation-version>
         <!-- resteasy-jaxrs dependency cannot be higher than 2.x for 
compatibility with Jersey 1.x -->
         <resteasy-jaxrs-version>2.3.5.Final</resteasy-jaxrs-version>
-        <guava-version>27.0.1-jre</guava-version>
+        <guava-version>31.1-jre</guava-version>
         <guava-listenablefuture-version>1.0</guava-listenablefuture-version>
         <guava-failureaccess-version>1.0.1</guava-failureaccess-version>
         <junit-version>5.6.2</junit-version>

Reply via email to