tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r893640 - /tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
Date Wed, 23 Dec 2009 22:20:59 GMT
Author: markt
Date: Wed Dec 23 22:20:59 2009
New Revision: 893640

URL: http://svn.apache.org/viewvc?rev=893640&view=rev
Log:
JSP 2.2 - Update to JSP.5.1 - Sync only required for session and application scope

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java

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=893640&r1=893639&r2=893640&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Wed Dec 23 22:20:59 2009
@@ -1343,12 +1343,13 @@
                 }
             }
 
+            // JSP.5.1, Sematics, para 1 - lock not required for request or
+            // page scope
             String scopename = "PageContext.PAGE_SCOPE"; // Default to page
-            String lock = "_jspx_page_context";
+            String lock = null;
 
             if ("request".equals(scope)) {
                 scopename = "PageContext.REQUEST_SCOPE";
-                lock = "request";
             } else if ("session".equals(scope)) {
                 scopename = "PageContext.SESSION_SCOPE";
                 lock = "session";
@@ -1365,11 +1366,13 @@
             out.print(name);
             out.println(" = null;");
 
-            // Lock while getting or creating bean
-            out.printin("synchronized (");
-            out.print(lock);
-            out.println(") {");
-            out.pushIndent();
+            // Lock (if required) while getting or creating bean
+            if (lock != null) {
+                out.printin("synchronized (");
+                out.print(lock);
+                out.println(") {");
+                out.pushIndent();
+            }
 
             // Locate bean from context
             out.printin(name);
@@ -1472,8 +1475,10 @@
             out.printil("}");
 
             // End of lock block
-            out.popIndent();
-            out.printil("}");
+            if (lock != null) {
+                out.popIndent();
+                out.printil("}");
+            }
 
             n.setEndJavaLine(out.getJavaLine());
         }



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


Mime
View raw message