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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d9df9b  [VFS-753] NumberFormatException in SftpFileSystem::getUId.
6d9df9b is described below

commit 6d9df9be841107e42e7f6e3ee1c044716fd914cf
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Wed Feb 5 10:37:22 2020 -0500

    [VFS-753] NumberFormatException in SftpFileSystem::getUId.
---
 .../java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java | 7 ++++++-
 src/changes/changes.xml                                            | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
index 7a01743..ae64f4d 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
@@ -278,7 +278,12 @@ public class SftpFileSystem extends AbstractFileSystem {
                         throw new FileSystemException(
                                 "Could not get the user id of the current user 
(error code: " + code + ")");
                     }
-                    uid = Integer.parseInt(output.toString().trim());
+                    final String uidString = output.toString().trim();
+                    try {
+                        uid = Integer.parseInt(uidString);
+                    } catch (NumberFormatException e) {
+                        LOG.debug("Cannot convert UID to integer: '" + 
uidString + "'", e);
+                    }
                 }
             }
         }
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 71b6981..9965a3e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -45,11 +45,16 @@ The <action> type attribute can be add,update,fix,remove.
   </properties>
 
   <body>
-    <release version="2.6.0" date="2020-06-01" description="New features and 
bug fix release.">
+    <release version="2.6.1" date="2020-MM-DD" description="Maintenance 
release.">
 <!--       <action issue="VFS-443" dev="ggregory" type="update" 
due-to="nickallen"> -->
 <!--        [Local] Need an easy way to convert from a FileObject to a File. 
-->
 <!--       </action> -->
 <!-- START Might need to be moved to the next version -->
+      <action issue="VFS-753" dev="ggregory" due-to="John Webb, Gary Gregory" 
type="fix">
+        NumberFormatException in SftpFileSystem::getUId.
+      </action>
+    </release>
+    <release version="2.6.0" date="2020-06-01" description="New features and 
bug fix release.">
       <action dev="ggregory" due-to="Eitan Adler" type="fix">
         Clean up tests and simplify assertions #76.
       </action>

Reply via email to