commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r431907 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/FileObjectUtils.java
Date Wed, 16 Aug 2006 14:20:45 GMT
Author: imario
Date: Wed Aug 16 07:20:42 2006
New Revision: 431907

URL: http://svn.apache.org/viewvc?rev=431907&view=rev
Log:
return null if searchObject is null

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/FileObjectUtils.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/FileObjectUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/FileObjectUtils.java?rev=431907&r1=431906&r2=431907&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/FileObjectUtils.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/FileObjectUtils.java
Wed Aug 16 07:20:42 2006
@@ -46,12 +46,16 @@
 		{
 			return (AbstractFileObject) searchObject;
 		}
-		
+        if (searchObject == null)
+        {
+            return null;
+        }
+
         throw new FileSystemException("vfs.util/find-abstract-file-object.error", fileObject==null?"null":fileObject.getClass().getName());
 	}
 
 	/**
-	 * check if the given FileObject is instance of given class argument 
+	 * check if the given FileObject is instance of given class argument
 	 */
 	public static boolean isInstanceOf(final FileObject fileObject, final Class wantedClass)
throws FileSystemException
 	{
@@ -62,15 +66,15 @@
 			{
 				return true;
 			}
-			
+
 			searchObject = ((DecoratedFileObject) searchObject).getDecoratedFileObject();
 		}
-		
+
 		if (wantedClass.isInstance(searchObject))
 		{
 			return true;
 		}
-		
+
 		return false;
 	}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message