Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 69847 invoked from network); 9 Dec 2002 17:41:43 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Dec 2002 17:41:42 -0000 Received: (qmail 2778 invoked by uid 97); 9 Dec 2002 17:42:45 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 2757 invoked by uid 97); 9 Dec 2002 17:42:44 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 2738 invoked by uid 50); 9 Dec 2002 17:42:43 -0000 Date: 9 Dec 2002 17:42:43 -0000 Message-ID: <20021209174243.2737.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 15105] - pushBody()/popBody() error on tomcat 4.1.12 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15105 pushBody()/popBody() error on tomcat 4.1.12 iblesa@tissat.es changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WORKSFORME | ------- Additional Comments From iblesa@tissat.es 2002-12-09 17:42 ------- Lets verify all together the code :D On the file PageContentImpl.java we have the two methods public BodyContent pushBody() { depth++; if (depth >= outs.length) { BodyContent[] newOuts = new BodyContentImpl[depth + 1]; for (int i = 0; i < outs.length; i++) { newOuts[i] = outs[i]; } newOuts[depth] = new BodyContentImpl(out); outs = newOuts; } out = outs[depth]; return outs[depth]; } public JspWriter popBody() { depth--; if (depth >= 0) { out = outs[depth]; } else { out = baseOut; } return out; } As we can see on the code if we make two calls to pushBody(), then the array outs will have two body outs A and B. If we make a popBody, then depth will be decremented, but the B object is not removed from the outs array, then if I make another pushBody() (this should create a new out object C, this is not done), the outs array will have again two objects, but the second object will not be a new one, it will be the previous B object. Then what will be in the second element will be the new content plus previous content from B object,that is, the new content will be appended. Is not this the way it should work ? That is, create a new object when we make a pushBody() OR clear the old object when we make a popBody(). -- To unsubscribe, e-mail: For additional commands, e-mail: