tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime JspContextWrapper.java
Date Tue, 03 Dec 2002 23:17:48 GMT
luehe       2002/12/03 15:17:48

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
               jasper2/src/share/org/apache/jasper/runtime
                        JspContextWrapper.java
  Log:
  Performance improvement:
  Pass ArrayList (instead of Vector) of scripting variables to
  JSP Context Wrapper constructor: ArrayList is not synchronized.
  
  Revision  Changes    Path
  1.134     +12 -12    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- Generator.java	28 Nov 2002 04:18:08 -0000	1.133
  +++ Generator.java	3 Dec 2002 23:17:48 -0000	1.134
  @@ -3043,9 +3043,9 @@
           out.pushIndent();
           out.printil("super.setJspContext(ctx);");
   	TagVariableInfo[] tagVars = tagInfo.getTagVariableInfos();
  -	out.printil("java.util.Vector _jspx_nested = null;");
  -	out.printil("java.util.Vector _jspx_at_begin = null;");
  -	out.printil("java.util.Vector _jspx_at_end = null;");
  +	out.printil("java.util.ArrayList _jspx_nested = null;");
  +	out.printil("java.util.ArrayList _jspx_at_begin = null;");
  +	out.printil("java.util.ArrayList _jspx_at_end = null;");
   
   	for (int i=0; i<tagVars.length; i++) {
   
  @@ -3053,25 +3053,25 @@
   	    case VariableInfo.NESTED:
   		out.printil("if (_jspx_nested == null)");
   		out.pushIndent();
  -		out.printil("_jspx_nested = new java.util.Vector();");
  +		out.printil("_jspx_nested = new java.util.ArrayList();");
   		out.popIndent();
  -		out.printin("_jspx_nested.addElement(");
  +		out.printin("_jspx_nested.add(");
   		break;
   
   	    case VariableInfo.AT_BEGIN:
   		out.printil("if (_jspx_at_begin == null)");
   		out.pushIndent();
  -		out.printil("_jspx_at_begin = new java.util.Vector();");
  +		out.printil("_jspx_at_begin = new java.util.ArrayList();");
   		out.popIndent();
  -		out.printin("_jspx_at_begin.addElement(");
  +		out.printin("_jspx_at_begin.add(");
   		break;
   
   	    case VariableInfo.AT_END:
   		out.printil("if (_jspx_at_end == null)");
   		out.pushIndent();
  -		out.printil("_jspx_at_end = new java.util.Vector();");
  +		out.printil("_jspx_at_end = new java.util.ArrayList();");
   		out.popIndent();
  -		out.printin("_jspx_at_end.addElement(");
  +		out.printin("_jspx_at_end.add(");
   		break;
   	    } // switch
   	    
  
  
  
  1.9       +12 -12    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspContextWrapper.java
  
  Index: JspContextWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspContextWrapper.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JspContextWrapper.java	13 Nov 2002 17:40:41 -0000	1.8
  +++ JspContextWrapper.java	3 Dec 2002 23:17:48 -0000	1.9
  @@ -66,7 +66,7 @@
   
   import java.util.Enumeration;
   import java.util.Hashtable;
  -import java.util.Vector;
  +import java.util.ArrayList;
   import java.util.Iterator;
   
   import javax.servlet.Servlet;
  @@ -106,19 +106,19 @@
   
       private transient Hashtable	pageAttributes;
   
  -    // Vector of NESTED scripting variables
  -    private Vector nestedVars;
  +    // ArrayList of NESTED scripting variables
  +    private ArrayList nestedVars;
   
  -    // Vector of AT_BEGIN scripting variables
  -    private Vector atBeginVars;
  +    // ArrayList of AT_BEGIN scripting variables
  +    private ArrayList atBeginVars;
   
  -    // Vector of AT_END scripting variables
  -    private Vector atEndVars;
  +    // ArrayList of AT_END scripting variables
  +    private ArrayList atEndVars;
   
       private Hashtable originalNestedVars;
   
  -    public JspContextWrapper(JspContext jspContext, Vector nestedVars,
  -			     Vector atBeginVars, Vector atEndVars) {
  +    public JspContextWrapper(JspContext jspContext, ArrayList nestedVars,
  +			     ArrayList atBeginVars, ArrayList atEndVars) {
           this.invokingJspCtxt = (PageContext) jspContext;
   	this.nestedVars = nestedVars;
   	this.atBeginVars = atBeginVars;
  
  
  

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


Mime
View raw message