You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2007/06/20 23:19:46 UTC

svn commit: r549238 - in /tapestry/tapestry4/trunk/tapestry-framework/src: java/org/apache/tapestry/AbstractComponent.java java/org/apache/tapestry/components/Any.java scripts/TestLibrary.xml scripts/TestLocalization.xml

Author: jkuhnert
Date: Wed Jun 20 14:19:45 2007
New Revision: 549238

URL: http://svn.apache.org/viewvc?view=rev&rev=549238
Log:
Fixes TAPESTRY-1592.  New Any component render logic was rendering empty tags on blocks where they shouldn't have.  Just made them open blocks as that should have no ill effects either way.

Modified:
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java
    tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLibrary.xml
    tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLocalization.xml

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java?view=diff&rev=549238&r1=549237&r2=549238
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractComponent.java Wed Jun 20 14:19:45 2007
@@ -310,7 +310,9 @@
      * Renders the (unique) id attribute for this component. 
      * 
      * @param writer
+     *          The writer to render attribute in.
      * @param cycle
+     *          The current request.
      */
     protected void renderIdAttribute(IMarkupWriter writer, IRequestCycle cycle)
     {

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java?view=diff&rev=549238&r1=549237&r2=549238
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Any.java Wed Jun 20 14:19:45 2007
@@ -21,7 +21,6 @@
 /**
  * A component that can substitute for any HTML element. [<a
  * href="../../../../../ComponentReference/Any.html">Component Reference</a>]
- * 
  */
 
 public abstract class Any extends AbstractComponent
@@ -34,23 +33,20 @@
         
         if (!rewinding)
         {
-            if (getBodyCount() > 0 || "script".equals(element))
-                writer.begin(element);
-            else
-                writer.beginEmpty(element);
+            writer.begin(element);
             
             renderInformalParameters(writer, cycle);
+            
             if (getId() != null && !isParameterBound("id"))
                 renderIdAttribute(writer, cycle);
         }
         
         renderBody(writer, cycle);
         
-        if (!rewinding && (getBodyCount() > 0 || "script".equals(element)))
+        if (!rewinding)
         {
             writer.end();
         }
-
     }
 
     public abstract String getElement();

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLibrary.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLibrary.xml?view=diff&rev=549238&r1=549237&r2=549238
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLibrary.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLibrary.xml Wed Jun 20 14:19:45 2007
@@ -73,7 +73,8 @@
 			 I started doing lots of little tiny contexts, so the tests
 			 wouldn't interfere with each other.  -->
 			 
-		<match>foo</match>
+        <match>foo</match>
+        <match>/foo</match>
 		
 		<match>/body</match>
 		<match>/html</match>		

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLocalization.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLocalization.xml?view=diff&rev=549238&r1=549237&r2=549238
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLocalization.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestLocalization.xml Wed Jun 20 14:19:45 2007
@@ -36,7 +36,7 @@
 		
 		<assert-output name="English Foo-Bar">
 <![CDATA[
-<foo bar="Totally Screwed!" id="Any" />
+<foo bar="Totally Screwed!" id="Any"></foo>
 ]]>	
 		</assert-output>
 	</request>		
@@ -53,7 +53,7 @@
 		
 		<assert-output name="French Foo-Bar">
 <![CDATA[
-<foo bar="Merde!" id="Any" />
+<foo bar="Merde!" id="Any"></foo>
 ]]>	
 		</assert-output>