incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r907968 - /sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/ReferenceParser.java
Date Tue, 09 Feb 2010 08:40:55 GMT
Author: cziegeler
Date: Tue Feb  9 08:40:54 2010
New Revision: 907968

URL: http://svn.apache.org/viewvc?rev=907968&view=rev
Log:
Make parse method match its javadoc

Modified:
    sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/ReferenceParser.java

Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/ReferenceParser.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/ReferenceParser.java?rev=907968&r1=907967&r2=907968&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/ReferenceParser.java
(original)
+++ sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/ReferenceParser.java
Tue Feb  9 08:40:54 2010
@@ -43,17 +43,19 @@
      * @throws RepositoryException
      */
     public Node parse(String value) throws RepositoryException {
-        boolean valueIsNodePath = false;
         try {
             if (session.itemExists(value)) {
-                valueIsNodePath = true;
+                return (Node) session.getItem(value);
             }
-        } catch (RepositoryException e) {}
-        if (valueIsNodePath) {
-            return (Node) session.getItem(value);
-        } else {
+        } catch (RepositoryException ignore) {
+            // we ignore this
+        }
+        try {
             return session.getNodeByUUID(value);
+        } catch (RepositoryException ignore) {
+            // we ignore this
         }
+        return null;
     }
 
     /**



Mime
View raw message