You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2008/07/05 20:46:40 UTC
svn commit: r674224 - in
/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress:
ArchiverFactory.java CompressorFactory.java
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");
}