You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2017/01/06 16:50:50 UTC

svn commit: r1777647 - in /tomcat/trunk: java/org/apache/jasper/compiler/Generator.java webapps/docs/changelog.xml

Author: remm
Date: Fri Jan  6 16:50:50 2017
New Revision: 1777647

URL: http://svn.apache.org/viewvc?rev=1777647&view=rev
Log:
Revert try/finally for simple tags.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=1777647&r1=1777646&r2=1777647&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Fri Jan  6 16:50:50 2017
@@ -2659,9 +2659,6 @@ class Generator {
             String tagHandlerClassName = tagHandlerClass.getCanonicalName();
             writeNewInstance(tagHandlerVar, tagHandlerClassName);
 
-            out.printil("try {");
-            out.pushIndent();
-
             generateSetters(n, tagHandlerVar, handlerInfo, true);
 
             // JspIdConsumer (after context has been set)
@@ -2713,16 +2710,9 @@ class Generator {
             declareScriptingVars(n, VariableInfo.AT_END);
             syncScriptingVars(n, VariableInfo.AT_END);
 
-            out.popIndent();
-            out.printil("} finally {");
-            out.pushIndent();
-
             // Resource injection
             writeDestroyInstance(tagHandlerVar);
 
-            out.popIndent();
-            out.printil("}");
-
             n.setEndJavaLine(out.getJavaLine());
         }
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1777647&r1=1777646&r2=1777647&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Jan  6 16:50:50 2017
@@ -51,6 +51,9 @@
         <bug>60497</bug>: Follow up fix using a better variable name for the
         tag reuse flag. (remm)
       </fix>
+      <fix>
+        Revert use of try/finally for simple tags. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="WebSocket">



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


Re: svn commit: r1777647 - in /tomcat/trunk: java/org/apache/jasper/compiler/Generator.java webapps/docs/changelog.xml

Posted by Rémy Maucherat <re...@apache.org>.
2017-01-06 17:55 GMT+01:00 Violeta Georgieva <mi...@gmail.com>:

> 2017-01-06 18:50 GMT+02:00 <re...@apache.org>:
> >
> > Author: remm
> > Date: Fri Jan  6 16:50:50 2017
> > New Revision: 1777647
> >
> > URL: http://svn.apache.org/viewvc?rev=1777647&view=rev
> > Log:
> > Revert try/finally for simple tags.
>
> I just succeeded to extract a test case.
> Can you look at the patch below and give me your feedback?
>

I thought it was better to revert it for now. It's possible this can work,
but not sure.

Rémy

>
>
>
> Index: java/org/apache/jasper/compiler/Generator.java
> ===================================================================
> --- java/org/apache/jasper/compiler/Generator.java (revision 1777614)
> +++ java/org/apache/jasper/compiler/Generator.java (working copy)
> @@ -2655,6 +2655,8 @@
>              // Declare AT_BEGIN scripting variables
>              declareScriptingVars(n, VariableInfo.AT_BEGIN);
>              saveScriptingVars(n, VariableInfo.AT_BEGIN);
> +            // Declare AT_END scripting variables
> +            declareScriptingVars(n, VariableInfo.AT_END);
>
>              String tagHandlerClassName =
> tagHandlerClass.getCanonicalName();
>              writeNewInstance(tagHandlerVar, tagHandlerClassName);
> @@ -2709,8 +2711,7 @@
>              // Synchronize AT_BEGIN scripting variables
>              syncScriptingVars(n, VariableInfo.AT_BEGIN);
>
> -            // Declare and synchronize AT_END scripting variables
> -            declareScriptingVars(n, VariableInfo.AT_END);
> +            // Synchronize AT_END scripting variables
>              syncScriptingVars(n, VariableInfo.AT_END);
>
>              out.popIndent();
> Index: test/webapp/bug48nnn/bug48616b.jsp
> ===================================================================
> --- test/webapp/bug48nnn/bug48616b.jsp (revision 1777614)
> +++ test/webapp/bug48nnn/bug48616b.jsp (working copy)
> @@ -26,3 +26,6 @@
>      <bugs:Bug48616b />
>    </bugs:Bug46816a>
>  </tags:bug42390>
> +<%
> +  out.println(X);
> +%>
> \ No newline at end of file
> Index: test/webapp/WEB-INF/tags/bug42390.tag
> ===================================================================
> --- test/webapp/WEB-INF/tags/bug42390.tag (revision 1777614)
> +++ test/webapp/WEB-INF/tags/bug42390.tag (working copy)
> @@ -14,5 +14,5 @@
>    See the License for the specific language governing permissions and
>    limitations under the License.
>  --%>
> -<%@ variable name-given="X" scope="AT_BEGIN" %>
> +<%@ variable name-given="X" scope="AT_END" %>
>  <jsp:doBody/>
> \ No newline at end of file
>

Re: svn commit: r1777647 - in /tomcat/trunk: java/org/apache/jasper/compiler/Generator.java webapps/docs/changelog.xml

Posted by Violeta Georgieva <mi...@gmail.com>.
2017-01-06 18:50 GMT+02:00 <re...@apache.org>:
>
> Author: remm
> Date: Fri Jan  6 16:50:50 2017
> New Revision: 1777647
>
> URL: http://svn.apache.org/viewvc?rev=1777647&view=rev
> Log:
> Revert try/finally for simple tags.

I just succeeded to extract a test case.
Can you look at the patch below and give me your feedback?



Index: java/org/apache/jasper/compiler/Generator.java
===================================================================
--- java/org/apache/jasper/compiler/Generator.java (revision 1777614)
+++ java/org/apache/jasper/compiler/Generator.java (working copy)
@@ -2655,6 +2655,8 @@
             // Declare AT_BEGIN scripting variables
             declareScriptingVars(n, VariableInfo.AT_BEGIN);
             saveScriptingVars(n, VariableInfo.AT_BEGIN);
+            // Declare AT_END scripting variables
+            declareScriptingVars(n, VariableInfo.AT_END);

             String tagHandlerClassName =
tagHandlerClass.getCanonicalName();
             writeNewInstance(tagHandlerVar, tagHandlerClassName);
@@ -2709,8 +2711,7 @@
             // Synchronize AT_BEGIN scripting variables
             syncScriptingVars(n, VariableInfo.AT_BEGIN);

-            // Declare and synchronize AT_END scripting variables
-            declareScriptingVars(n, VariableInfo.AT_END);
+            // Synchronize AT_END scripting variables
             syncScriptingVars(n, VariableInfo.AT_END);

             out.popIndent();
Index: test/webapp/bug48nnn/bug48616b.jsp
===================================================================
--- test/webapp/bug48nnn/bug48616b.jsp (revision 1777614)
+++ test/webapp/bug48nnn/bug48616b.jsp (working copy)
@@ -26,3 +26,6 @@
     <bugs:Bug48616b />
   </bugs:Bug46816a>
 </tags:bug42390>
+<%
+  out.println(X);
+%>
\ No newline at end of file
Index: test/webapp/WEB-INF/tags/bug42390.tag
===================================================================
--- test/webapp/WEB-INF/tags/bug42390.tag (revision 1777614)
+++ test/webapp/WEB-INF/tags/bug42390.tag (working copy)
@@ -14,5 +14,5 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --%>
-<%@ variable name-given="X" scope="AT_BEGIN" %>
+<%@ variable name-given="X" scope="AT_END" %>
 <jsp:doBody/>
\ No newline at end of file