You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2009/08/14 23:02:36 UTC

svn commit: r804373 [6/19] - in /struts/sandbox/trunk/struts2-jsp-plugin: ./ src/main/java/org/apache/struts2/ src/main/java/org/apache/struts2/jasper/ src/main/java/org/apache/struts2/jasper/compiler/ src/main/java/org/apache/struts2/jasper/compiler/t...

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Mark.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Mark.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Mark.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Mark.java Fri Aug 14 21:02:33 2009
@@ -23,7 +23,7 @@
 import java.util.Stack;
 
 /**
- * Mark represents a point in the JSP input. 
+ * Mark represents a point in the JSP input.
  *
  * @author Anil K. Vijendran
  */
@@ -61,11 +61,11 @@
     /**
      * Constructor
      *
-     * @param reader JspReader this mark belongs to
-     * @param inStream current stream for this mark
-     * @param fileId id of requested jsp file
-     * @param name JSP file name
-     * @param inBaseDir base directory of requested jsp file
+     * @param reader     JspReader this mark belongs to
+     * @param inStream   current stream for this mark
+     * @param fileId     id of requested jsp file
+     * @param name       JSP file name
+     * @param inBaseDir  base directory of requested jsp file
      * @param inEncoding encoding of current file
      */
     Mark(JspReader reader, char[] inStream, int fileId, String name,
@@ -103,15 +103,15 @@
 
         // clone includeStack without cloning contents
         includeStack = new Stack();
-        for ( int i=0; i < other.includeStack.size(); i++ ) {
-            includeStack.addElement( other.includeStack.elementAt(i) );
+        for (int i = 0; i < other.includeStack.size(); i++) {
+            includeStack.addElement(other.includeStack.elementAt(i));
         }
     }
 
 
     /**
      * Constructor
-     */    
+     */
     Mark(JspCompilationContext ctxt, String filename, int line, int col) {
 
         this.reader = null;
@@ -132,18 +132,17 @@
      * Sets this mark's state to a new stream.
      * It will store the current stream in it's includeStack.
      *
-     * @param inStream new stream for mark
-     * @param inFileId id of new file from which stream comes from
-     * @param inBaseDir directory of file
+     * @param inStream   new stream for mark
+     * @param inFileId   id of new file from which stream comes from
+     * @param inBaseDir  directory of file
      * @param inEncoding encoding of new file
      */
     public void pushStream(char[] inStream, int inFileId, String name,
-                           String inBaseDir, String inEncoding) 
-    {
+                           String inBaseDir, String inEncoding) {
         // store current state in stack
         includeStack.push(new IncludeState(cursor, line, col, fileId,
-                                           fileName, baseDir, 
-					   encoding, stream) );
+                fileName, baseDir,
+                encoding, stream));
 
         // set new variables
         cursor = 0;
@@ -159,17 +158,18 @@
 
     /**
      * Restores this mark's state to a previously stored stream.
+     *
      * @return The previous Mark instance when the stream was pushed, or null
-     * if there is no previous stream
+     *         if there is no previous stream
      */
     public Mark popStream() {
         // make sure we have something to pop
-        if ( includeStack.size() <= 0 ) {
+        if (includeStack.size() <= 0) {
             return null;
         }
 
         // get previous state in stack
-        IncludeState state = (IncludeState) includeStack.pop( );
+        IncludeState state = (IncludeState) includeStack.pop();
 
         // set new variables
         cursor = state.cursor;
@@ -202,7 +202,7 @@
     }
 
     public String toString() {
-	return getFile()+"("+line+","+col+")";
+        return getFile() + "(" + line + "," + col + ")";
     }
 
     public String getFile() {
@@ -213,30 +213,29 @@
      * Gets the URL of the resource with which this Mark is associated
      *
      * @return URL of the resource with which this Mark is associated
-     *
-     * @exception MalformedURLException if the resource pathname is incorrect
+     * @throws MalformedURLException if the resource pathname is incorrect
      */
     public URL getURL() throws MalformedURLException {
         return ctxt.getResource(getFile());
     }
 
     public String toShortString() {
-        return "("+line+","+col+")";
+        return "(" + line + "," + col + ")";
     }
 
     public boolean equals(Object other) {
-	if (other instanceof Mark) {
-	    Mark m = (Mark) other;
-	    return this.reader == m.reader && this.fileId == m.fileId 
-		&& this.cursor == m.cursor && this.line == m.line 
-		&& this.col == m.col;
-	} 
-	return false;
+        if (other instanceof Mark) {
+            Mark m = (Mark) other;
+            return this.reader == m.reader && this.fileId == m.fileId
+                    && this.cursor == m.cursor && this.line == m.line
+                    && this.col == m.col;
+        }
+        return false;
     }
 
     /**
      * @return true if this Mark is greather than the <code>other</code>
-     * Mark, false otherwise.
+     *         Mark, false otherwise.
      */
     public boolean isGreater(Mark other) {
 
@@ -265,7 +264,7 @@
         String encoding;
         char[] stream = null;
 
-        IncludeState(int inCursor, int inLine, int inCol, int inFileId, 
+        IncludeState(int inCursor, int inLine, int inCol, int inFileId,
                      String name, String inBaseDir, String inEncoding,
                      char[] inStream) {
             cursor = inCursor;

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Node.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Node.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Node.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Node.java Fri Aug 14 21:02:33 2009
@@ -40,8 +40,8 @@
 
 abstract class Node implements TagConstants {
 
-    private static final VariableInfo[] ZERO_VARIABLE_INFO = { };
-    
+    private static final VariableInfo[] ZERO_VARIABLE_INFO = {};
+
     protected Attributes attrs;
 
     // xmlns attributes that represent tag libraries (only in XML syntax)
@@ -82,7 +82,7 @@
     /**
      * Constructor.
      *
-     * @param start The location of the jsp page
+     * @param start  The location of the jsp page
      * @param parent The enclosing node
      */
     public Node(Mark start, Node parent) {
@@ -94,10 +94,10 @@
     /**
      * Constructor.
      *
-     * @param qName The action's qualified name
+     * @param qName     The action's qualified name
      * @param localName The action's local name
-     * @param start The location of the jsp page
-     * @param parent The enclosing node
+     * @param start     The location of the jsp page
+     * @param parent    The enclosing node
      */
     public Node(String qName, String localName, Mark start, Node parent) {
         this.qName = qName;
@@ -110,11 +110,11 @@
     /**
      * Constructor for Nodes parsed from standard syntax.
      *
-     * @param qName The action's qualified name
+     * @param qName     The action's qualified name
      * @param localName The action's local name
-     * @param attrs The attributes for this node
-     * @param start The location of the jsp page
-     * @param parent The enclosing node
+     * @param attrs     The attributes for this node
+     * @param start     The location of the jsp page
+     * @param parent    The enclosing node
      */
     public Node(String qName, String localName, Attributes attrs, Mark start,
                 Node parent) {
@@ -129,16 +129,16 @@
     /**
      * Constructor for Nodes parsed from XML syntax.
      *
-     * @param qName The action's qualified name
-     * @param localName The action's local name
-     * @param attrs The action's attributes whose name does not start with
-     * xmlns
+     * @param qName               The action's qualified name
+     * @param localName           The action's local name
+     * @param attrs               The action's attributes whose name does not start with
+     *                            xmlns
      * @param nonTaglibXmlnsAttrs The action's xmlns attributes that do not
-     * represent tag libraries
-     * @param taglibAttrs The action's xmlns attributes that represent tag
-     * libraries
-     * @param start The location of the jsp page
-     * @param parent The enclosing node
+     *                            represent tag libraries
+     * @param taglibAttrs         The action's xmlns attributes that represent tag
+     *                            libraries
+     * @param start               The location of the jsp page
+     * @param parent              The enclosing node
      */
     public Node(String qName, String localName, Attributes attrs,
                 Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs,
@@ -219,7 +219,7 @@
 
     /**
      * Get the attribute that is non request time expression, either
-     * from the attribute of the node, or from a jsp:attrbute 
+     * from the attribute of the node, or from a jsp:attrbute
      */
     public String getTextAttribute(String name) {
 
@@ -240,18 +240,18 @@
      * Searches all subnodes of this node for jsp:attribute standard
      * actions with the given name, and returns the NamedAttribute node
      * of the matching named attribute, nor null if no such node is found.
-     * <p>
+     * <p/>
      * This should always be called and only be called for nodes that
      * accept dynamic runtime attribute expressions.
      */
-    public NamedAttribute getNamedAttributeNode( String name ) {
+    public NamedAttribute getNamedAttributeNode(String name) {
         NamedAttribute result = null;
-        
+
         // Look for the attribute in NamedAttribute children
         Nodes nodes = getNamedAttributeNodes();
         int numChildNodes = nodes.size();
-        for( int i = 0; i < numChildNodes; i++ ) {
-            NamedAttribute na = (NamedAttribute)nodes.getNode( i );
+        for (int i = 0; i < numChildNodes; i++) {
+            NamedAttribute na = (NamedAttribute) nodes.getNode(i);
             boolean found = false;
             int index = name.indexOf(':');
             if (index != -1) {
@@ -265,7 +265,7 @@
                 break;
             }
         }
-        
+
         return result;
     }
 
@@ -274,7 +274,7 @@
      * actions, and returns that set of nodes as a Node.Nodes object.
      *
      * @return Possibly empty Node.Nodes object containing any jsp:attribute
-     * subnodes of this Node
+     *         subnodes of this Node
      */
     public Node.Nodes getNamedAttributeNodes() {
 
@@ -283,17 +283,16 @@
         }
 
         Node.Nodes result = new Node.Nodes();
-        
+
         // Look for the attribute in NamedAttribute children
         Nodes nodes = getBody();
-        if( nodes != null ) {
+        if (nodes != null) {
             int numChildNodes = nodes.size();
-            for( int i = 0; i < numChildNodes; i++ ) {
-                Node n = nodes.getNode( i );
-                if( n instanceof NamedAttribute ) {
-                    result.add( n );
-                }
-                else if (! (n instanceof Comment)) {
+            for (int i = 0; i < numChildNodes; i++) {
+                Node n = nodes.getNode(i);
+                if (n instanceof NamedAttribute) {
+                    result.add(n);
+                } else if (!(n instanceof Comment)) {
                     // Nothing can come before jsp:attribute, and only
                     // jsp:body can come after it.
                     break;
@@ -304,7 +303,7 @@
         namedAttributeNodes = result;
         return result;
     }
-    
+
     public Nodes getBody() {
         return body;
     }
@@ -364,6 +363,7 @@
     /**
      * Selects and invokes a method in the visitor class based on the node
      * type.  This is abstract and should be overrode by the extending classes.
+     *
      * @param v The visitor class
      */
     abstract void accept(Visitor v) throws JasperException;
@@ -375,6 +375,7 @@
     /*
      * Adds this Node to the body of the given parent.
      */
+
     private void addToParent(Node parent) {
         if (parent != null) {
             this.parent = parent;
@@ -391,7 +392,7 @@
     /*********************************************************************
      * Child classes
      */
-    
+
     /**
      * Represents the root of a Jsp page or Jsp document
      */
@@ -402,7 +403,7 @@
 
         // Source encoding of the page containing this Root
         private String pageEnc;
-        
+
         // Page encoding specified in JSP config element
         private String jspConfigPageEnc;
 
@@ -481,7 +482,7 @@
         public boolean isDefaultPageEncoding() {
             return isDefaultPageEncoding;
         }
-        
+
         public void setIsEncodingSpecifiedInProlog(boolean isSpecified) {
             isEncodingSpecifiedInProlog = isSpecified;
         }
@@ -492,13 +493,13 @@
 
         /**
          * @return The enclosing root to this Root. Usually represents the
-         * page that includes this one.
+         *         page that includes this one.
          */
         public Root getParentRoot() {
             return parentRoot;
         }
     }
-    
+
     /**
      * Represents the root of a Jsp document (XML syntax)
      */
@@ -508,7 +509,7 @@
                        Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs,
                        Mark start, Node parent) {
             super(qName, ROOT_ACTION, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -531,7 +532,7 @@
                              Attributes nonTaglibXmlnsAttrs,
                              Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, PAGE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
             imports = new Vector();
         }
 
@@ -543,6 +544,7 @@
          * Parses the comma-separated list of class or package names in the
          * given attribute value and adds each component to this
          * PageDirective's vector of imported classes and packages.
+         *
          * @param value A comma-separated string of imports.
          */
         public void addImport(String value) {
@@ -572,7 +574,7 @@
 
         public IncludeDirective(Attributes attrs, Mark start, Node parent) {
             this(JSP_INCLUDE_DIRECTIVE_ACTION, attrs, null, null, start,
-                 parent);
+                    parent);
         }
 
         public IncludeDirective(String qName, Attributes attrs,
@@ -580,7 +582,7 @@
                                 Attributes taglibAttrs, Mark start,
                                 Node parent) {
             super(qName, INCLUDE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -595,7 +597,7 @@
 
         public TaglibDirective(Attributes attrs, Mark start, Node parent) {
             super(JSP_TAGLIB_DIRECTIVE_ACTION, TAGLIB_DIRECTIVE_ACTION, attrs,
-                  start, parent);
+                    start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -617,18 +619,19 @@
                             Attributes nonTaglibXmlnsAttrs,
                             Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, TAG_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
             imports = new Vector();
         }
 
         public void accept(Visitor v) throws JasperException {
             v.visit(this);
         }
- 
+
         /**
          * Parses the comma-separated list of class or package names in the
          * given attribute value and adds each component to this
          * PageDirective's vector of imported classes and packages.
+         *
          * @param value A comma-separated string of imports.
          */
         public void addImport(String value) {
@@ -645,7 +648,7 @@
                 imports.add(value.substring(start).trim());
             }
         }
- 
+
         public List getImports() {
             return imports;
         }
@@ -658,7 +661,7 @@
 
         public AttributeDirective(Attributes attrs, Mark start, Node parent) {
             this(JSP_ATTRIBUTE_DIRECTIVE_ACTION, attrs, null, null, start,
-                 parent);
+                    parent);
         }
 
         public AttributeDirective(String qName, Attributes attrs,
@@ -666,7 +669,7 @@
                                   Attributes taglibAttrs, Mark start,
                                   Node parent) {
             super(qName, ATTRIBUTE_DIRECTIVE_ACTION, attrs,
-                  nonTaglibXmlnsAttrs, taglibAttrs, start, parent);
+                    nonTaglibXmlnsAttrs, taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -681,7 +684,7 @@
 
         public VariableDirective(Attributes attrs, Mark start, Node parent) {
             this(JSP_VARIABLE_DIRECTIVE_ACTION, attrs, null, null, start,
-                 parent);
+                    parent);
         }
 
         public VariableDirective(String qName, Attributes attrs,
@@ -689,7 +692,7 @@
                                  Attributes taglibAttrs,
                                  Mark start, Node parent) {
             super(qName, VARIABLE_DIRECTIVE_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -710,7 +713,7 @@
                             Attributes nonTaglibXmlnsAttrs,
                             Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, INVOKE_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -731,7 +734,7 @@
                             Attributes nonTaglibXmlnsAttrs,
                             Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, DOBODY_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -769,7 +772,7 @@
                                 Attributes taglibAttrs, Mark start,
                                 Node parent) {
             super(qName, localName, null, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
         }
 
         /**
@@ -777,13 +780,14 @@
          * was stored as a String in the "text" field, whereas when this node
          * was created from a JSP document, its text was stored as one or more
          * TemplateText nodes in its body. This method handles either case.
+         *
          * @return The text string
          */
         public String getText() {
             String ret = text;
             if ((ret == null) && (body != null)) {
                 StringBuffer buf = new StringBuffer();
-                for (int i=0; i<body.size(); i++) {
+                for (int i = 0; i < body.size(); i++) {
                     buf.append(body.getNode(i).getText());
                 }
                 ret = buf.toString();
@@ -811,14 +815,14 @@
 
         public Declaration(String text, Mark start, Node parent) {
             super(JSP_DECLARATION_ACTION, DECLARATION_ACTION, text, start,
-                  parent);
+                    parent);
         }
 
         public Declaration(String qName, Attributes nonTaglibXmlnsAttrs,
                            Attributes taglibAttrs, Mark start,
                            Node parent) {
             super(qName, DECLARATION_ACTION, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -834,14 +838,14 @@
 
         public Expression(String text, Mark start, Node parent) {
             super(JSP_EXPRESSION_ACTION, EXPRESSION_ACTION, text, start,
-                  parent);
+                    parent);
         }
 
         public Expression(String qName, Attributes nonTaglibXmlnsAttrs,
                           Attributes taglibAttrs, Mark start,
                           Node parent) {
             super(qName, EXPRESSION_ACTION, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -862,7 +866,7 @@
                          Attributes taglibAttrs, Mark start,
                          Node parent) {
             super(qName, SCRIPTLET_ACTION, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -910,7 +914,7 @@
                            Attributes nonTaglibXmlnsAttrs,
                            Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, PARAM_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -940,7 +944,7 @@
                             Attributes taglibAttrs,
                             Mark start, Node parent) {
             super(qName, PARAMS_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -962,7 +966,7 @@
                               Attributes taglibAttrs, Mark start,
                               Node parent) {
             super(qName, FALLBACK_ACTION, null, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -985,7 +989,7 @@
                              Attributes nonTaglibXmlnsAttrs,
                              Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, INCLUDE_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1016,7 +1020,7 @@
                              Attributes nonTaglibXmlnsAttrs,
                              Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, FORWARD_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1045,7 +1049,7 @@
                            Attributes nonTaglibXmlnsAttrs,
                            Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, GET_PROPERTY_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start,  parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1068,7 +1072,7 @@
                            Attributes nonTaglibXmlnsAttrs,
                            Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, SET_PROPERTY_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1099,7 +1103,7 @@
                        Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs,
                        Mark start, Node parent) {
             super(qName, USE_BEAN_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1122,7 +1126,7 @@
 
         private JspAttribute width;
         private JspAttribute height;
-        
+
         public PlugIn(Attributes attrs, Mark start, Node parent) {
             this(JSP_PLUGIN_ACTION, attrs, null, null, start, parent);
         }
@@ -1131,7 +1135,7 @@
                       Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs,
                       Mark start, Node parent) {
             super(qName, PLUGIN_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1168,7 +1172,7 @@
                                 Attributes taglibAttrs,
                                 Mark start, Node parent) {
             super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1183,7 +1187,7 @@
             return jspAttrs;
         }
     }
-    
+
     /**
      * Represents a <jsp:element>.
      */
@@ -1200,7 +1204,7 @@
                           Attributes nonTaglibXmlnsAttrs,
                           Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, ELEMENT_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1240,7 +1244,7 @@
                          Attributes taglibAttrs,
                          Mark start, Node parent) {
             super(qName, OUTPUT_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
+                    taglibAttrs, start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1250,12 +1254,12 @@
 
     /**
      * Collected information about child elements.  Used by nodes like
-     * CustomTag, JspBody, and NamedAttribute.  The information is 
+     * CustomTag, JspBody, and NamedAttribute.  The information is
      * set in the Collector.
      */
     public static class ChildInfo {
         private boolean scriptless;        // true if the tag and its body
-                                        // contain no scripting elements.
+        // contain no scripting elements.
         private boolean hasUseBean;
         private boolean hasIncludeAction;
         private boolean hasParamAction;
@@ -1301,7 +1305,7 @@
         public boolean hasSetProperty() {
             return hasSetProperty;
         }
-        
+
         public void setHasScriptingVars(boolean s) {
             hasScriptingVars = s;
         }
@@ -1357,7 +1361,7 @@
                          String uri, Attributes attrs, Mark start, Node parent,
                          TagInfo tagInfo, Class tagHandlerClass) {
             this(qName, prefix, localName, uri, attrs, null, null, start,
-                 parent, tagInfo, tagHandlerClass);
+                    parent, tagInfo, tagHandlerClass);
         }
 
         /*
@@ -1370,7 +1374,7 @@
                          Mark start, Node parent, TagInfo tagInfo,
                          Class tagHandlerClass) {
             super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
 
             this.uri = uri;
             this.prefix = prefix;
@@ -1379,16 +1383,16 @@
             this.customNestingLevel = makeCustomNestingLevel();
             this.childInfo = new ChildInfo();
 
-            this.implementsIterationTag = 
-                IterationTag.class.isAssignableFrom(tagHandlerClass);
+            this.implementsIterationTag =
+                    IterationTag.class.isAssignableFrom(tagHandlerClass);
             this.implementsBodyTag =
-                BodyTag.class.isAssignableFrom(tagHandlerClass);
-            this.implementsTryCatchFinally = 
-                TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
-            this.implementsSimpleTag = 
-                SimpleTag.class.isAssignableFrom(tagHandlerClass);
-            this.implementsDynamicAttributes = 
-                DynamicAttributes.class.isAssignableFrom(tagHandlerClass);
+                    BodyTag.class.isAssignableFrom(tagHandlerClass);
+            this.implementsTryCatchFinally =
+                    TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
+            this.implementsSimpleTag =
+                    SimpleTag.class.isAssignableFrom(tagHandlerClass);
+            this.implementsDynamicAttributes =
+                    DynamicAttributes.class.isAssignableFrom(tagHandlerClass);
         }
 
         /*
@@ -1398,7 +1402,7 @@
                          String uri, Attributes attrs, Mark start, Node parent,
                          TagFileInfo tagFileInfo) {
             this(qName, prefix, localName, uri, attrs, null, null, start,
-                 parent, tagFileInfo);
+                    parent, tagFileInfo);
         }
 
         /*
@@ -1411,7 +1415,7 @@
                          Mark start, Node parent, TagFileInfo tagFileInfo) {
 
             super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
 
             this.uri = uri;
             this.prefix = prefix;
@@ -1452,11 +1456,11 @@
         public JspAttribute[] getJspAttributes() {
             return jspAttrs;
         }
-        
+
         public ChildInfo getChildInfo() {
             return childInfo;
         }
-        
+
         public void setTagData(TagData tagData) {
             this.tagData = tagData;
             this.varInfos = tagInfo.getVariableInfo(tagData);
@@ -1523,8 +1527,8 @@
 
         public TagVariableInfo[] getTagVariableInfos() {
             return tagInfo.getTagVariableInfos();
-         }
- 
+        }
+
         public VariableInfo[] getVariableInfos() {
             return varInfos;
         }
@@ -1547,15 +1551,15 @@
 
         public void setScriptingVars(Vector vec, int scope) {
             switch (scope) {
-            case VariableInfo.AT_BEGIN:
-                this.atBeginScriptingVars = vec;
-                break;
-            case VariableInfo.AT_END:
-                this.atEndScriptingVars = vec;
-                break;
-            case VariableInfo.NESTED:
-                this.nestedScriptingVars = vec;
-                break;
+                case VariableInfo.AT_BEGIN:
+                    this.atBeginScriptingVars = vec;
+                    break;
+                case VariableInfo.AT_END:
+                    this.atEndScriptingVars = vec;
+                    break;
+                case VariableInfo.NESTED:
+                    this.nestedScriptingVars = vec;
+                    break;
             }
         }
 
@@ -1567,15 +1571,15 @@
             Vector vec = null;
 
             switch (scope) {
-            case VariableInfo.AT_BEGIN:
-                vec = this.atBeginScriptingVars;
-                break;
-            case VariableInfo.AT_END:
-                vec = this.atEndScriptingVars;
-                break;
-            case VariableInfo.NESTED:
-                vec = this.nestedScriptingVars;
-                break;
+                case VariableInfo.AT_BEGIN:
+                    vec = this.atBeginScriptingVars;
+                    break;
+                case VariableInfo.AT_END:
+                    vec = this.atEndScriptingVars;
+                    break;
+                case VariableInfo.NESTED:
+                    vec = this.nestedScriptingVars;
+                    break;
             }
 
             return vec;
@@ -1593,18 +1597,18 @@
          * Checks to see if the attribute of the given name is of type
          * JspFragment.
          */
-        public boolean checkIfAttributeIsJspFragment( String name ) {
+        public boolean checkIfAttributeIsJspFragment(String name) {
             boolean result = false;
 
             TagAttributeInfo[] attributes = tagInfo.getAttributes();
             for (int i = 0; i < attributes.length; i++) {
                 if (attributes[i].getName().equals(name) &&
-                            attributes[i].isFragment()) {
+                        attributes[i].isFragment()) {
                     result = true;
                     break;
                 }
             }
-            
+
             return result;
         }
 
@@ -1631,7 +1635,7 @@
         public Nodes getAtSTag() {
             return atSTag;
         }
-        
+
         public void setAtETag(Nodes eTag) {
             atETag = eTag;
         }
@@ -1639,30 +1643,30 @@
         public Nodes getAtETag() {
             return atETag;
         }
-        
+
         /*
-         * Computes this custom tag's custom nesting level, which corresponds
-         * to the number of times this custom tag is nested inside itself.
-         *
-         * Example:
-         * 
-         *  <g:h>
-         *    <a:b> -- nesting level 0
-         *      <c:d>
-         *        <e:f>
-         *          <a:b> -- nesting level 1
-         *            <a:b> -- nesting level 2
-         *            </a:b>
-         *          </a:b>
-         *          <a:b> -- nesting level 1
-         *          </a:b>
-         *        </e:f>
-         *      </c:d>
-         *    </a:b>
-         *  </g:h>
-         * 
-         * @return Custom tag's nesting level
-         */
+        * Computes this custom tag's custom nesting level, which corresponds
+        * to the number of times this custom tag is nested inside itself.
+        *
+        * Example:
+        *
+        *  <g:h>
+        *    <a:b> -- nesting level 0
+        *      <c:d>
+        *        <e:f>
+        *          <a:b> -- nesting level 1
+        *            <a:b> -- nesting level 2
+        *            </a:b>
+        *          </a:b>
+        *          <a:b> -- nesting level 1
+        *          </a:b>
+        *        </e:f>
+        *      </c:d>
+        *    </a:b>
+        *  </g:h>
+        *
+        * @return Custom tag's nesting level
+        */
         private int makeCustomNestingLevel() {
             int n = 0;
             Node p = parent;
@@ -1679,33 +1683,33 @@
         /**
          * Returns true if this custom action has an empty body, and false
          * otherwise.
-         *
-         * A custom action is considered to have an empty body if the 
+         * <p/>
+         * A custom action is considered to have an empty body if the
          * following holds true:
          * - getBody() returns null, or
          * - all immediate children are jsp:attribute actions, or
          * - the action's jsp:body is empty.
          */
-         public boolean hasEmptyBody() {
-             boolean hasEmptyBody = true;
-             Nodes nodes = getBody();
-             if (nodes != null) {
-                 int numChildNodes = nodes.size();
-                 for (int i=0; i<numChildNodes; i++) {
-                     Node n = nodes.getNode(i);
-                     if (!(n instanceof NamedAttribute)) {
-                         if (n instanceof JspBody) {
-                             hasEmptyBody = (n.getBody() == null);
-                         } else {
-                             hasEmptyBody = false;
-                         }
-                         break;
-                     }
-                 }
-             }
+        public boolean hasEmptyBody() {
+            boolean hasEmptyBody = true;
+            Nodes nodes = getBody();
+            if (nodes != null) {
+                int numChildNodes = nodes.size();
+                for (int i = 0; i < numChildNodes; i++) {
+                    Node n = nodes.getNode(i);
+                    if (!(n instanceof NamedAttribute)) {
+                        if (n instanceof JspBody) {
+                            hasEmptyBody = (n.getBody() == null);
+                        } else {
+                            hasEmptyBody = false;
+                        }
+                        break;
+                    }
+                }
+            }
 
-             return hasEmptyBody;
-         }
+            return hasEmptyBody;
+        }
     }
 
     /**
@@ -1743,7 +1747,7 @@
         public JspText(String qName, Attributes nonTaglibXmlnsAttrs,
                        Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, TEXT_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
         }
 
         public void accept(Visitor v) throws JasperException {
@@ -1761,7 +1765,7 @@
 
         // True if this node is to be trimmed, or false otherwise
         private boolean trim = true;
-        
+
         private ChildInfo childInfo;
         private String name;
         private String localName;
@@ -1777,8 +1781,8 @@
                               Mark start, Node parent) {
 
             super(qName, ATTRIBUTE_ACTION, attrs, nonTaglibXmlnsAttrs,
-                  taglibAttrs, start, parent);
-            if( "false".equals( this.getAttributeValue( "trim" ) ) ) {
+                    taglibAttrs, start, parent);
+            if ("false".equals(this.getAttributeValue("trim"))) {
                 // (if null or true, leave default of true)
                 trim = false;
             }
@@ -1790,7 +1794,7 @@
                 int index = name.indexOf(':');
                 if (index != -1) {
                     prefix = name.substring(0, index);
-                    localName = name.substring(index+1);
+                    localName = name.substring(index + 1);
                 }
             }
         }
@@ -1810,7 +1814,7 @@
         public String getPrefix() {
             return this.prefix;
         }
-        
+
         public ChildInfo getChildInfo() {
             return this.childInfo;
         }
@@ -1821,7 +1825,7 @@
 
         /**
          * @return A unique temporary variable name to store the result in.
-         *      (this probably could go elsewhere, but it's convenient here)
+         *         (this probably could go elsewhere, but it's convenient here)
          */
         public String getTemporaryVariableName() {
             if (temporaryVariableName == null) {
@@ -1839,10 +1843,11 @@
 
             class AttributeVisitor extends Visitor {
                 String attrValue = null;
+
                 public void visit(TemplateText txt) {
                     attrValue = new String(txt.getText());
                 }
-                
+
                 public String getAttrValue() {
                     return attrValue;
                 }
@@ -1860,7 +1865,7 @@
                 }
                 text = attributeVisitor.getAttrValue();
             }
-            
+
             return text;
         }
     }
@@ -1879,7 +1884,7 @@
         public JspBody(String qName, Attributes nonTaglibXmlnsAttrs,
                        Attributes taglibAttrs, Mark start, Node parent) {
             super(qName, BODY_ACTION, null, nonTaglibXmlnsAttrs, taglibAttrs,
-                  start, parent);
+                    start, parent);
             this.childInfo = new ChildInfo();
         }
 
@@ -1927,7 +1932,7 @@
          */
         public void rtrim() {
             int index = text.length();
-            while( (index > 0) && (text.charAt(index-1) <= ' ') ) {
+            while ((index > 0) && (text.charAt(index - 1) <= ' ')) {
                 index--;
             }
             text = text.substring(0, index);
@@ -1938,7 +1943,7 @@
          */
         public boolean isAllSpace() {
             boolean isAllSpace = true;
-            for (int i=0; i<text.length(); i++) {
+            for (int i = 0; i < text.length(); i++) {
                 if (!Character.isWhitespace(text.charAt(i))) {
                     isAllSpace = false;
                     break;
@@ -1949,9 +1954,10 @@
 
         /**
          * Add a source to Java line mapping
+         *
          * @param srcLine The postion of the source line, relative to the line
-         *        at the start of this node.  The corresponding java line is
-         *        assumed to be consecutive, i.e. one more than the last.
+         *                at the start of this node.  The corresponding java line is
+         *                assumed to be consecutive, i.e. one more than the last.
          */
         public void addSmap(int srcLine) {
             if (extraSmap == null) {
@@ -1971,7 +1977,7 @@
 
     /**
      * Represents attributes that can be request time expressions.
-     *
+     * <p/>
      * Can either be a plain attribute, an attribute that represents a
      * request time expression value, or a named attribute (specified using
      * the jsp:attribute standard action).
@@ -1993,7 +1999,7 @@
         private NamedAttribute namedAttributeNode;
 
         JspAttribute(String qName, String uri, String localName, String value,
-                     boolean expr, ELNode.Nodes el, boolean dyn ) {
+                     boolean expr, ELNode.Nodes el, boolean dyn) {
             this.qName = qName;
             this.uri = uri;
             this.localName = localName;
@@ -2022,22 +2028,22 @@
         }
 
         /**
-          * @return The name of the attribute
+         * @return The name of the attribute
          */
         public String getName() {
             return qName;
         }
 
         /**
-          * @return The local name of the attribute
+         * @return The local name of the attribute
          */
         public String getLocalName() {
             return localName;
         }
 
         /**
-          * @return The namespace of the attribute, or null if in the default
-         * namespace
+         * @return The namespace of the attribute, or null if in the default
+         *         namespace
          */
         public String getURI() {
             return uri;
@@ -2048,7 +2054,7 @@
          *
          * @return the value for the attribute, or the expression string
          *         (stripped of "<%=", "%>", "%=", or "%"
-         *          but containing "${" and "}" for EL expressions)
+         *         but containing "${" and "}" for EL expressions)
          */
         public String getValue() {
             return value;
@@ -2078,10 +2084,8 @@
         }
 
         /**
-         * @return true if the value represents an expression that should
-         * be fed to the expression interpreter
          * @return false for string literals or rtexprvalues that should
-         * not be interpreted or reevaluated
+         *         not be interpreted or reevaluated
          */
         public boolean isELInterpreterInput() {
             return el != null;
@@ -2089,7 +2093,7 @@
 
         /**
          * @return true if the value is a string literal known at translation
-         * time.
+         *         time.
          */
         public boolean isLiteral() {
             return !expression && (el != null) && !namedAttribute;
@@ -2129,6 +2133,7 @@
 
         /**
          * Appends a node to the list
+         *
          * @param n The node to add
          */
         public void add(Node n) {
@@ -2138,6 +2143,7 @@
 
         /**
          * Removes the given node from the list.
+         *
          * @param n The node to be removed
          */
         public void remove(Node n) {
@@ -2146,6 +2152,7 @@
 
         /**
          * Visit the nodes in the list with the supplied visitor
+         *
          * @param v The visitor used
          */
         public void visit(Visitor v) throws JasperException {
@@ -2168,7 +2175,7 @@
             }
             return n;
         }
-        
+
         public Node.Root getRoot() {
             return root;
         }

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java Fri Aug 14 21:02:33 2009
@@ -30,16 +30,16 @@
 /**
  * An implementation of <tt>javax.servlet.jsp.tagext.PageData</tt> which
  * builds the XML view of a given page.
- *
+ * <p/>
  * The XML view is built in two passes:
- *
+ * <p/>
  * During the first pass, the FirstPassVisitor collects the attributes of the
  * top-level jsp:root and those of the jsp:root elements of any included
  * pages, and adds them to the jsp:root element of the XML view.
  * In addition, any taglib directives are converted into xmlns: attributes and
  * added to the jsp:root element of the XML view.
  * This pass ignores any nodes other than JspRoot and TaglibDirective.
- *
+ * <p/>
  * During the second pass, the SecondPassVisitor produces the XML view, using
  * the combined jsp:root attributes determined in the first pass and any
  * remaining pages nodes (this pass ignores any JspRoot and TaglibDirective
@@ -62,18 +62,18 @@
      * @param page the page nodes from which to generate the XML view
      */
     public PageDataImpl(Node.Nodes page, Compiler compiler)
-                throws JasperException {
+            throws JasperException {
 
         // First pass
         FirstPassVisitor firstPass = new FirstPassVisitor(page.getRoot(),
-                                                          compiler.getPageInfo());
+                compiler.getPageInfo());
         page.visit(firstPass);
 
         // Second pass
         buf = new StringBuffer();
         SecondPassVisitor secondPass
-            = new SecondPassVisitor(page.getRoot(), buf, compiler,
-                                    firstPass.getJspIdPrefix());
+                = new SecondPassVisitor(page.getRoot(), buf, compiler,
+                firstPass.getJspIdPrefix());
         page.visit(secondPass);
     }
 
@@ -103,7 +103,7 @@
      * attributes and adds them to the jsp:root element of the XML view.
      */
     static class FirstPassVisitor
-                extends Node.Visitor implements TagConstants {
+            extends Node.Visitor implements TagConstants {
 
         private Node.Root root;
         private AttributesImpl rootAttrs;
@@ -120,7 +120,7 @@
             this.pageInfo = pageInfo;
             this.rootAttrs = new AttributesImpl();
             this.rootAttrs.addAttribute("", "", "version", "CDATA",
-                                        JSP_VERSION);
+                    JSP_VERSION);
             this.jspIdPrefix = "jsp";
         }
 
@@ -136,7 +136,7 @@
                  */
                 if (!JSP_URI.equals(rootAttrs.getValue("xmlns:jsp"))) {
                     rootAttrs.addAttribute("", "", "xmlns:jsp", "CDATA",
-                                           JSP_URI);
+                            JSP_URI);
                 }
 
                 if (pageInfo.isJspPrefixHijacked()) {
@@ -153,7 +153,7 @@
                         jspIdPrefix += "jsp";
                     }
                     rootAttrs.addAttribute("", "", "xmlns:" + jspIdPrefix,
-                                           "CDATA", JSP_URI);
+                            "CDATA", JSP_URI);
                 }
 
                 root.setAttributes(rootAttrs);
@@ -189,11 +189,11 @@
                             location = URN_JSPTLD + location;
                         }
                         rootAttrs.addAttribute("", "", qName, "CDATA",
-                                               location);
+                                location);
                     } else {
                         location = attrs.getValue("tagdir");
                         rootAttrs.addAttribute("", "", qName, "CDATA",
-                                               URN_JSPTAGDIR + location);
+                                URN_JSPTAGDIR + location);
                     }
                 }
             }
@@ -207,19 +207,19 @@
             if (attrs != null) {
                 int len = attrs.getLength();
 
-                for (int i=0; i<len; i++) {
+                for (int i = 0; i < len; i++) {
                     String qName = attrs.getQName(i);
                     if ("version".equals(qName)) {
                         continue;
                     }
 
                     // Bugzilla 35252: http://issues.apache.org/bugzilla/show_bug.cgi?id=35252
-                    if(rootAttrs.getIndex(qName) == -1) {
+                    if (rootAttrs.getIndex(qName) == -1) {
                         rootAttrs.addAttribute(attrs.getURI(i),
-                                               attrs.getLocalName(i),
-                                               qName,
-                                               attrs.getType(i),
-                                               attrs.getValue(i));
+                                attrs.getLocalName(i),
+                                qName,
+                                attrs.getType(i),
+                                attrs.getValue(i));
                     }
                 }
             }
@@ -232,7 +232,7 @@
      * each element a unique jsp:id attribute.
      */
     static class SecondPassVisitor extends Node.Visitor
-                implements TagConstants {
+            implements TagConstants {
 
         private Node.Root root;
         private StringBuffer buf;
@@ -331,7 +331,7 @@
         public void visit(Node.IncludeAction n) throws JasperException {
             appendTag(n);
         }
-    
+
         public void visit(Node.ForwardAction n) throws JasperException {
             appendTag(n);
         }
@@ -359,7 +359,7 @@
         public void visit(Node.UseBean n) throws JasperException {
             appendTag(n);
         }
-        
+
         public void visit(Node.PlugIn n) throws JasperException {
             appendTag(n);
         }
@@ -367,7 +367,7 @@
         public void visit(Node.NamedAttribute n) throws JasperException {
             appendTag(n);
         }
-        
+
         public void visit(Node.JspBody n) throws JasperException {
             appendTag(n);
         }
@@ -407,7 +407,7 @@
         public void visit(Node.VariableDirective n) throws JasperException {
             appendTag(n);
         }
-        
+
         public void visit(Node.TemplateText n) throws JasperException {
             /*
              * If the template text came from a JSP page written in JSP syntax,
@@ -441,7 +441,7 @@
             buf.append(jspId++).append("\"\n");
 
             if (ROOT_ACTION.equals(n.getLocalName()) || body != null
-                        || text != null) {
+                    || text != null) {
                 buf.append(">\n");
                 if (ROOT_ACTION.equals(n.getLocalName())) {
                     if (compiler.getCompilationContext().isTagFile()) {
@@ -479,7 +479,7 @@
             boolean append = false;
             Attributes attrs = n.getAttributes();
             int len = (attrs == null) ? 0 : attrs.getLength();
-            for (int i=0; i<len; i++) {
+            for (int i = 0; i < len; i++) {
                 String attrName = attrs.getQName(i);
                 if (!"pageEncoding".equals(attrName)
                         && !"contentType".equals(attrName)) {
@@ -499,7 +499,7 @@
             buf.append(jspId++).append("\"\n");
 
             // append remaining attributes
-            for (int i=0; i<len; i++) {
+            for (int i = 0; i < len; i++) {
                 String attrName = attrs.getQName(i);
                 if ("import".equals(attrName) || "contentType".equals(attrName)
                         || "pageEncoding".equals(attrName)) {
@@ -553,7 +553,7 @@
             buf.append("  ").append("pageEncoding").append("=\"UTF-8\"\n");
             buf.append("  ").append("contentType").append("=\"");
             buf.append(compiler.getPageInfo().getContentType()).append("\"\n");
-            buf.append("/>\n");            
+            buf.append("/>\n");
         }
 
         /*
@@ -570,7 +570,7 @@
             boolean append = false;
             Attributes attrs = n.getAttributes();
             int len = (attrs == null) ? 0 : attrs.getLength();
-            for (int i=0; i<len; i++) {
+            for (int i = 0; i < len; i++) {
                 String attrName = attrs.getQName(i);
                 if (!"pageEncoding".equals(attrName)) {
                     append = true;
@@ -596,7 +596,7 @@
             buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
             buf.append(jspId++).append("\"\n");
             buf.append("  ").append("pageEncoding").append("=\"UTF-8\"\n");
-            buf.append("/>\n");            
+            buf.append("/>\n");
         }
 
         private void appendText(String text, boolean createJspTextElement) {
@@ -616,11 +616,11 @@
                 appendCDATA(text);
             }
         }
-        
+
         /*
-         * Appends the given text as a CDATA section to the XML view, unless
-         * the text has already been marked as CDATA.
-         */
+        * Appends the given text as a CDATA section to the XML view, unless
+        * the text has already been marked as CDATA.
+        */
         private void appendCDATA(String text) {
             buf.append(CDATA_START_SECTION);
             buf.append(escapeCDATA(text));
@@ -632,14 +632,14 @@
          * within the given text, so it can be included in a CDATA section.
          */
         private String escapeCDATA(String text) {
-            if( text==null ) return "";
+            if (text == null) return "";
             int len = text.length();
             CharArrayWriter result = new CharArrayWriter(len);
-            for (int i=0; i<len; i++) {
-                if (((i+2) < len)
+            for (int i = 0; i < len; i++) {
+                if (((i + 2) < len)
                         && (text.charAt(i) == ']')
-                        && (text.charAt(i+1) == ']')
-                        && (text.charAt(i+2) == '>')) {
+                        && (text.charAt(i + 1) == ']')
+                        && (text.charAt(i + 2) == '>')) {
                     // match found
                     result.write(']');
                     result.write(']');
@@ -665,7 +665,7 @@
              */
             Attributes attrs = n.getTaglibAttributes();
             int len = (attrs == null) ? 0 : attrs.getLength();
-            for (int i=0; i<len; i++) {
+            for (int i = 0; i < len; i++) {
                 String name = attrs.getQName(i);
                 String value = attrs.getValue(i);
                 buf.append("  ").append(name).append("=\"").append(value).append("\"\n");
@@ -677,7 +677,7 @@
             attrs = n.getNonTaglibXmlnsAttributes();
             len = (attrs == null) ? 0 : attrs.getLength();
             boolean defaultNSSeen = false;
-            for (int i=0; i<len; i++) {
+            for (int i = 0; i < len; i++) {
                 String name = attrs.getQName(i);
                 String value = attrs.getValue(i);
                 buf.append("  ").append(name).append("=\"").append(value).append("\"\n");
@@ -693,7 +693,7 @@
              */
             attrs = n.getAttributes();
             len = (attrs == null) ? 0 : attrs.getLength();
-            for (int i=0; i<len; i++) {
+            for (int i = 0; i < len; i++) {
                 String name = attrs.getQName(i);
                 String value = attrs.getValue(i);
                 buf.append("  ").append(name).append("=\"");

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageInfo.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageInfo.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageInfo.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageInfo.java Fri Aug 14 21:02:33 2009
@@ -47,7 +47,7 @@
     private String session;
     private boolean isSession = true;
     private String bufferValue;
-    private int buffer = 8*1024;    // XXX confirm
+    private int buffer = 8 * 1024;    // XXX confirm
     private String autoFlush;
     private boolean isAutoFlush = true;
     private String isThreadSafeValue;
@@ -93,13 +93,14 @@
         this.prefixes = new HashSet();
 
         // Enter standard imports
-        for(int i = 0; i < Constants.STANDARD_IMPORTS.length; i++)
+        for (int i = 0; i < Constants.STANDARD_IMPORTS.length; i++)
             imports.add(Constants.STANDARD_IMPORTS[i]);
     }
 
     /**
      * Check if the plugin ID has been previously declared.  Make a not
      * that this Id is now declared.
+     *
      * @return true if Id has been declared.
      */
     public boolean isPluginDeclared(String id) {
@@ -127,7 +128,7 @@
 
     public void addDependant(String d) {
         if (!dependants.contains(d) && !jspFile.equals(d))
-                dependants.add(d);
+            dependants.add(d);
     }
 
     public List getDependants() {
@@ -348,9 +349,10 @@
     /*
      * language
      */
+
     public void setLanguage(String value, Node n, ErrorDispatcher err,
-                boolean pagedir)
-        throws JasperException {
+                            boolean pagedir)
+            throws JasperException {
 
         if (!"java".equalsIgnoreCase(value)) {
             if (pagedir)
@@ -391,12 +393,11 @@
      * Gets the value of the 'extends' page directive attribute.
      *
      * @param useDefault TRUE if the default
-     * (org.apache.jasper.runtime.HttpJspBase) should be returned if this
-     * attribute has not been set, FALSE otherwise
-     *
+     *                   (org.apache.jasper.runtime.HttpJspBase) should be returned if this
+     *                   attribute has not been set, FALSE otherwise
      * @return The value of the 'extends' page directive attribute, or the
-     * default (org.apache.jasper.runtime.HttpJspBase) if this attribute has
-     * not been set and useDefault is TRUE
+     *         default (org.apache.jasper.runtime.HttpJspBase) if this attribute has
+     *         not been set and useDefault is TRUE
      */
     public String getExtends(boolean useDefault) {
         return (xtends == null && useDefault ? defaultExtends : xtends);
@@ -406,8 +407,8 @@
      * Gets the value of the 'extends' page directive attribute.
      *
      * @return The value of the 'extends' page directive attribute, or the
-     * default (org.apache.jasper.runtime.HttpJspBase) if this attribute has
-     * not been set
+     *         default (org.apache.jasper.runtime.HttpJspBase) if this attribute has
+     *         not been set
      */
     public String getExtends() {
         return getExtends(true);
@@ -430,7 +431,7 @@
      * buffer
      */
     public void setBufferValue(String value, Node n, ErrorDispatcher err)
-        throws JasperException {
+            throws JasperException {
 
         if ("none".equalsIgnoreCase(value))
             buffer = 0;
@@ -438,7 +439,7 @@
             if (value == null || !value.endsWith("kb"))
                 err.jspError(n, "jsp.error.page.invalid.buffer");
             try {
-                Integer k = new Integer(value.substring(0, value.length()-2));
+                Integer k = new Integer(value.substring(0, value.length() - 2));
                 buffer = k.intValue() * 1024;
             } catch (NumberFormatException e) {
                 err.jspError(n, "jsp.error.page.invalid.buffer");
@@ -461,7 +462,7 @@
      * session
      */
     public void setSession(String value, Node n, ErrorDispatcher err)
-        throws JasperException {
+            throws JasperException {
 
         if ("true".equalsIgnoreCase(value))
             isSession = true;
@@ -486,7 +487,7 @@
      * autoFlush
      */
     public void setAutoFlush(String value, Node n, ErrorDispatcher err)
-        throws JasperException {
+            throws JasperException {
 
         if ("true".equalsIgnoreCase(value))
             isAutoFlush = true;
@@ -511,7 +512,7 @@
      * isThreadSafe
      */
     public void setIsThreadSafe(String value, Node n, ErrorDispatcher err)
-        throws JasperException {
+            throws JasperException {
 
         if ("true".equalsIgnoreCase(value))
             isThreadSafe = true;
@@ -560,7 +561,7 @@
      * isErrorPage
      */
     public void setIsErrorPage(String value, Node n, ErrorDispatcher err)
-        throws JasperException {
+            throws JasperException {
 
         if ("true".equalsIgnoreCase(value))
             isErrorPage = true;
@@ -585,8 +586,8 @@
      * isELIgnored
      */
     public void setIsELIgnored(String value, Node n, ErrorDispatcher err,
-                   boolean pagedir)
-        throws JasperException {
+                               boolean pagedir)
+            throws JasperException {
 
         if ("true".equalsIgnoreCase(value))
             isELIgnored = true;