Author: pete
Date: Mon Nov 29 18:22:53 2010
New Revision: 1040217

URL: http://svn.apache.org/viewvc?rev=1040217&view=rev
Log:
minor improvements on AjaxRequestTarget

Modified:
    
wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java?rev=1040217&r1=1040216&r2=1040217&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java 
(original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java 
Mon Nov 29 18:22:53 2010
@@ -806,8 +806,7 @@ public class AjaxRequestTarget implement
                 * but this improvement will only work if we write first and 
encode later instead of working
                 * on fragments sent to write
                 */
-               // TODO: Would be nice not to have to call tostring here
-               return str.toString().indexOf(']') >= 0;
+               return Strings.indexOf(str, ']') >= 0;
        }
 
        /**
@@ -818,8 +817,7 @@ public class AjaxRequestTarget implement
         * @param component
         *            component to render
         */
-       private void respondComponent(final Response response, final String 
markupId,
-               final Component component)
+       private void respondComponent(final Response response, final String 
markupId, final Component component)
        {
                if (component.getRenderBodyOnly() == true)
                {
@@ -832,7 +830,6 @@ public class AjaxRequestTarget implement
 
                // substitute our encoding response for the real one so we can 
capture
                // component's markup in a manner safe for transport inside 
CDATA block
-               final Response originalResponse = response; // TODO no 
substitution, so what is this for?
                encodingBodyResponse.reset();
                RequestCycle.get().setResponse(encodingBodyResponse);
 
@@ -871,7 +868,7 @@ public class AjaxRequestTarget implement
                                // ignore this one could be a result off.
                        }
                        // Restore original response
-                       RequestCycle.get().setResponse(originalResponse);
+                       RequestCycle.get().setResponse(response);
                        encodingBodyResponse.reset();
                        throw e;
                }
@@ -882,7 +879,7 @@ public class AjaxRequestTarget implement
                }
                catch (RuntimeException e)
                {
-                       RequestCycle.get().setResponse(originalResponse);
+                       RequestCycle.get().setResponse(response);
                        encodingBodyResponse.reset();
                        throw e;
                }
@@ -890,7 +887,7 @@ public class AjaxRequestTarget implement
                page.endComponentRender(component);
 
                // Restore original response
-               RequestCycle.get().setResponse(originalResponse);
+               RequestCycle.get().setResponse(response);
 
                response.write("<component id=\"");
                response.write(markupId);


Reply via email to