Remove a few lines of redundant code
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 26 May 2009 16:08:26 +0000 (16:08 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 26 May 2009 16:08:26 +0000 (16:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@778784 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/naming/resources/FileDirContext.java
java/org/apache/naming/resources/ResourceAttributes.java

index f42c367..ca03de2 100644 (file)
@@ -819,12 +819,11 @@ public class FileDirContext extends BaseDirContext {
                 if (fileAbsPath.endsWith("."))
                     fileAbsPath = fileAbsPath + "/";
                 String absPath = normalize(fileAbsPath);
-                if (canPath != null)
-                    canPath = normalize(canPath);
+                canPath = normalize(canPath);
                 if ((absoluteBase.length() < absPath.length())
                     && (absoluteBase.length() < canPath.length())) {
                     absPath = absPath.substring(absoluteBase.length() + 1);
-                    if ((canPath == null) || (absPath == null))
+                    if (absPath == null)
                         return null;
                     if (absPath.equals(""))
                         absPath = "/";
index c053bfa..93cac16 100644 (file)
@@ -688,8 +688,6 @@ public class ResourceAttributes implements Attributes {
         if (result == null) {
             if (collection)
                 result = COLLECTION_TYPE;
-            else
-                result = null;
         }
         return result;
     }