You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2010/06/07 17:41:40 UTC

svn commit: r952276 - in /tomcat/tc5.5.x/trunk: STATUS.txt connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java container/webapps/docs/changelog.xml

Author: kkolinko
Date: Mon Jun  7 15:41:40 2010
New Revision: 952276

URL: http://svn.apache.org/viewvc?rev=952276&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49398
Fixes behaviour of ByteChunk.indexOf(String..) when the string argument is of length 1.

Modified:
    tomcat/tc5.5.x/trunk/STATUS.txt
    tomcat/tc5.5.x/trunk/connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java
    tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml

Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=952276&r1=952275&r2=952276&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Mon Jun  7 15:41:40 2010
@@ -54,11 +54,6 @@ PATCHES PROPOSED TO BACKPORT:
               http://svn.apache.org/viewvc?view=revision&revision=749019
   -1:
 
-* Fix ByteChunk.indexOf(String, ...) when the string is of length 1
-  http://svn.apache.org/viewvc?rev=945231&view=rev
-  +1: kkolinko, markt, rjung
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48843#c8
   Prevent possible deadlocks in AprEndpoint.Poller and AprEndpoint.Sendfile,
   caused by missing Object.notify() wakeup,

Modified: tomcat/tc5.5.x/trunk/connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=952276&r1=952275&r2=952276&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java (original)
+++ tomcat/tc5.5.x/trunk/connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java Mon Jun  7 15:41:40 2010
@@ -679,15 +679,16 @@ public final class ByteChunk implements 
         // Look for first char 
         int srcEnd = srcOff + srcLen;
         
+        mainLoop:
         for( int i=myOff+start; i <= (end - srcLen); i++ ) {
             if( buff[i] != first ) continue;
             // found first char, now look for a match
             int myPos=i+1;
             for( int srcPos=srcOff + 1; srcPos< srcEnd; ) {
                 if( buff[myPos++] != src.charAt( srcPos++ ))
-                    break;
-                if( srcPos==srcEnd ) return i-start; // found it
+                    continue mainLoop;
             }
+            return i-start; // found it
         }
         return -1;
     }

Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=952276&r1=952275&r2=952276&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Mon Jun  7 15:41:40 2010
@@ -81,6 +81,10 @@
         TLD cache file ("tldCache.ser"). (kkolinko)
       </update>
       <fix>
+        <bug>49398</bug>: ByteChunk.indexOf(String, int, int, int) could not
+        find a string of length 1. (kkolinko)
+      </fix>
+      <fix>
         Ensure all required i18n messages are present for the APR/native
         Listener. (kkolinko)
       </fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org