commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1529672 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java
Date Sun, 06 Oct 2013 20:02:43 GMT
Author: bodewig
Date: Sun Oct  6 20:02:43 2013
New Revision: 1529672

URL: http://svn.apache.org/r1529672
Log:
avoid NullPointerExceptions if Date is null

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java?rev=1529672&r1=1529671&r2=1529672&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java
Sun Oct  6 20:02:43 2013
@@ -113,7 +113,9 @@ public class SevenZArchiveEntry implemen
     
     public void setCreationDate(Date creationDate) {
         hasCreationDate = creationDate != null;
-        this.creationDate = javaTimeToNtfsTime(creationDate);
+        if (hasCreationDate) {
+            this.creationDate = javaTimeToNtfsTime(creationDate);
+        }
     }
 
     public boolean getHasLastModifiedDate() {
@@ -139,7 +141,9 @@ public class SevenZArchiveEntry implemen
     
     public void setLastModifiedDate(Date lastModifiedDate) {
         hasLastModifiedDate = lastModifiedDate != null;
-        this.lastModifiedDate = javaTimeToNtfsTime(lastModifiedDate);
+        if (hasLastModifiedDate) {
+            this.lastModifiedDate = javaTimeToNtfsTime(lastModifiedDate);
+        }
     }
     
     public boolean getHasAccessDate() {
@@ -165,7 +169,9 @@ public class SevenZArchiveEntry implemen
     
     public void setAccessDate(Date accessDate) {
         hasAccessDate = accessDate != null;
-        this.accessDate = javaTimeToNtfsTime(accessDate);
+        if (hasAccessDate) {
+            this.accessDate = javaTimeToNtfsTime(accessDate);
+        }
     }
 
     public boolean getHasWindowsAttributes() {



Mime
View raw message