cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r396210 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java
Date Sun, 23 Apr 2006 03:19:05 GMT
Author: antonio
Date: Sat Apr 22 20:19:02 2006
New Revision: 396210

URL: http://svn.apache.org/viewcvs?rev=396210&view=rev
Log:
Simpler code.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java?rev=396210&r1=396209&r2=396210&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java
Sat Apr 22 20:19:02 2006
@@ -171,12 +171,14 @@
         String urlstring = name;
         String filename = extractFilename(urlstring);
         int minLen = calculateMinLen(name);
-        if (!filename.equals("")) {
+        if (filename.length() > 0) {
             urlstring = shortenURI(urlstring, minLen);
         }
 
         String result = locateResource(urlstring, filename, minLen);
-        result = (result == null? result : result + filename);
+        if (result != null) {
+            result += filename;
+        }
         if (this.getLogger().isDebugEnabled())
             this.getLogger().debug(
                 "located " + name + " @ " + result);
@@ -202,7 +204,7 @@
         String urlstring = name;
         String filename = extractFilename(urlstring);
         int minLen = calculateMinLen(name);
-        if (!filename.equals("")) {
+        if (filename.length() > 0) {
             urlstring = shortenURI(urlstring, minLen);
         }
 
@@ -219,5 +221,4 @@
         }
         return (uris == null ? null : uris.toArray());
     }
-
 }



Mime
View raw message