Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 14526 invoked from network); 21 Aug 2002 21:51:33 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 21 Aug 2002 21:51:33 -0000 Received: (qmail 438 invoked by uid 97); 21 Aug 2002 21:51:59 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 422 invoked by uid 97); 21 Aug 2002 21:51:58 -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 410 invoked by uid 98); 21 Aug 2002 21:51:57 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Subject: [patch] jakarta-servletapi-5: Bugfix for 11884 From: Mark Roth To: tomcat-dev@jakarta.apache.org Cc: Kin-Man Chung Content-Type: multipart/mixed; boundary="=-uagGpU8l/ax7koOJrW8F" X-Mailer: Ximian Evolution 1.0.8 Date: 21 Aug 2002 17:50:15 -0400 Message-Id: <1029966615.7914.33.camel@markroth-pc> Mime-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --=-uagGpU8l/ax7koOJrW8F Content-Type: text/plain Content-Transfer-Encoding: 7bit Attached is a bugfix for 11884: getParent in a SimpleTag implementation returns a Tag. TagAdapter now works as per the spec. Files modified: jsr152/src/share/javax/servlet/jsp/tagext/TagAdapter.java -- Mark Roth, Java Software Co-Specification Lead for JSP 2.0 Sun Microsystems, Inc. --=-uagGpU8l/ax7koOJrW8F Content-Disposition: attachment; filename=jakarta-servletapi-5-bugfix-11884.patch.txt Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; name=jakarta-servletapi-5-bugfix-11884.patch.txt; charset=ISO-8859-1 Index: jsr152/src/share/javax/servlet/jsp/tagext/TagAdapter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvspublic/jakarta-servletapi-5/jsr152/src/share/javax/servl= et/jsp/tagext/TagAdapter.java,v retrieving revision 1.2 diff -u -r1.2 TagAdapter.java --- jsr152/src/share/javax/servlet/jsp/tagext/TagAdapter.java 19 Aug 2002 1= 6:29:51 -0000 1.2 +++ jsr152/src/share/javax/servlet/jsp/tagext/TagAdapter.java 21 Aug 2002 2= 1:46:59 -0000 @@ -77,15 +77,22 @@ { /** The simple tag that's being adapted */ private SimpleTag simpleTagAdaptee; + + /** The parent, of this tag, converted (if necessary) to be of type Ta= g */ + private Tag cachedParent; =20 /** - * Creates a new TagAdapter that wraps the given SimeplTag and=20 + * Creates a new TagAdapter that wraps the given SimpleTag and=20 * returns the parent tag when getParent() is called. * * @param adaptee The SimpleTag being adapted as a Tag. */ public TagAdapter( SimpleTag adaptee ) { - this.simpleTagAdaptee =3D simpleTagAdaptee; + if( adaptee =3D=3D null ) { + // Cannot wrap a null adaptee. + throw new IllegalArgumentException(); + } + this.simpleTagAdaptee =3D adaptee; } =20 /** @@ -122,9 +129,18 @@ * @return The parent of the tag being adapted. */ public Tag getParent() { - // Note the parent tag must be an instance of Tag (either a=20 - // direct instance or a wrapped instance). - return (Tag)simpleTagAdaptee.getParent(); + if( this.cachedParent =3D=3D null ) { + JspTag parent =3D simpleTagAdaptee.getParent(); + if( parent instanceof Tag ) { + this.cachedParent =3D (Tag)parent; + } + else { + // Must be SimpleTag - no other types defined. + this.cachedParent =3D new TagAdapter( (SimpleTag)parent ); + } + } + + return this.cachedParent; } =20 /** --=-uagGpU8l/ax7koOJrW8F Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: --=-uagGpU8l/ax7koOJrW8F--