[jboss-cvs] JBossAS SVN: r80738 - projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/cache.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Nov 10 06:43:07 EST 2008


Author: alesj
Date: 2008-11-10 06:43:07 -0500 (Mon, 10 Nov 2008)
New Revision: 80738

Modified:
   projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/cache/AbstractVFSCache.java
Log:
Add null checks.

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/cache/AbstractVFSCache.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/cache/AbstractVFSCache.java	2008-11-10 11:18:10 UTC (rev 80737)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/cache/AbstractVFSCache.java	2008-11-10 11:43:07 UTC (rev 80738)
@@ -60,6 +60,9 @@
 
    public VirtualFile getFile(URI uri) throws IOException
    {
+      if (uri == null)
+         throw new IllegalArgumentException("Null uri.");
+
       check();
 
       VFSContext context = findContext(uri);
@@ -68,6 +71,9 @@
          VirtualFileHandler root = context.getRoot();
          String relativePath = getRelativePath(context, uri);
          VirtualFileHandler child = root.getChild(relativePath);
+         if (child == null)
+            throw new IOException("Cannot find child, root=" + root + ", relativePath=" + relativePath);
+         
          return child.getVirtualFile();
       }
       return null;
@@ -89,6 +95,9 @@
 
    public VirtualFile getFile(URL url) throws IOException
    {
+      if (url == null)
+         throw new IllegalArgumentException("Null url.");
+
       check();
 
       try




More information about the jboss-cvs-commits mailing list