commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1084935 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java
Date Thu, 24 Mar 2011 12:45:38 GMT
Author: sebb
Date: Thu Mar 24 12:45:38 2011
New Revision: 1084935

URL: http://svn.apache.org/viewvc?rev=1084935&view=rev
Log:
Ensure we can distinguish which fields have been initialised

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java?rev=1084935&r1=1084934&r2=1084935&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java Thu Mar
24 12:45:38 2011
@@ -72,8 +72,10 @@ public class FTPFile implements Serializ
         _permissions = new boolean[3][3];
         _rawListing = null;
         _type = UNKNOWN_TYPE;
-        _hardLinkCount = 0;
-        _size = 0;
+        // init these to values that do not occur in listings
+        // so can distinguish which fields are unset
+        _hardLinkCount = 0; // 0 is invalid as a link count
+        _size = -1; // 0 is valid, so use -1
         _user = "";
         _group = "";
         _date = null;



Mime
View raw message