forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r722846 - /forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/AXIOMXPathCreate.java
Date Wed, 03 Dec 2008 11:55:18 GMT
Author: thorsten
Date: Wed Dec  3 03:55:17 2008
New Revision: 722846

URL: http://svn.apache.org/viewvc?rev=722846&view=rev
Log:
if we do not find a / we will break to not produce a StringIndexOutOfBoundsException

Modified:
    forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/AXIOMXPathCreate.java

Modified: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/AXIOMXPathCreate.java
URL: http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/AXIOMXPathCreate.java?rev=722846&r1=722845&r2=722846&view=diff
==============================================================================
--- forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/AXIOMXPathCreate.java
(original)
+++ forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/AXIOMXPathCreate.java
Wed Dec  3 03:55:17 2008
@@ -81,6 +81,10 @@
       xpathNode = xpath.selectSingleNode(root);
       if (xpathNode == null) {
         int endIndex = path.lastIndexOf("/");
+        if(endIndex<0){
+          // we need to break here if we do not want to provoke a StringIndexOutOfBoundsException
+          break;
+        }
         rest = path.substring(endIndex + 1) + "/" + rest;
         path = path.substring(0, endIndex);
       } else if (xpathNode != null) {



Mime
View raw message