commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r674224 - in /commons/sandbox/compress/trunk/src/java/org/apache/commons/compress: ArchiverFactory.java CompressorFactory.java
Date Sat, 05 Jul 2008 18:46:40 GMT
Author: bayard
Date: Sat Jul  5 11:46:40 2008
New Revision: 674224

URL: http://svn.apache.org/viewvc?rev=674224&view=rev
Log:
I believe the && here should be an ||, else it will throw an NPE and allow directories
to be unarchived

Modified:
    commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/ArchiverFactory.java
    commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/CompressorFactory.java

Modified: commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/ArchiverFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/ArchiverFactory.java?rev=674224&r1=674223&r2=674224&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/ArchiverFactory.java
(original)
+++ commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/ArchiverFactory.java
Sat Jul  5 11:46:40 2008
@@ -124,7 +124,7 @@
 	 */
 	public static Archive getInstance(File file) 
 		throws ArchiveException {
-		if(file == null && !file.isFile()) {
+		if(file == null || !file.isFile()) {
 			throw new ArchiveException("ArchiverFactory could not create instance for this file");
 		}
 		

Modified: commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/CompressorFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/CompressorFactory.java?rev=674224&r1=674223&r2=674224&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/CompressorFactory.java
(original)
+++ commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/CompressorFactory.java
Sat Jul  5 11:46:40 2008
@@ -135,7 +135,7 @@
 	 */
 	public static Compressor getInstance(File file) 
 		throws CompressException {
-		if(file == null && !file.isFile()) {
+		if(file == null || !file.isFile()) {
 			throw new CompressException("CompressorFactory could not create instance for this file");
 		}
 		



Mime
View raw message