This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new ce8dd7cb7c Cleanups for EL and JSP
ce8dd7cb7c is described below

commit ce8dd7cb7c8e6e27f735c1d83f964abe3ca2bea4
Author: remm <r...@apache.org>
AuthorDate: Thu Mar 20 22:10:45 2025 +0100

    Cleanups for EL and JSP
---
 java/org/apache/el/MethodExpressionImpl.java       |  2 +-
 java/org/apache/el/lang/ELSupport.java             |  4 ++--
 java/org/apache/el/parser/AstValue.java            |  9 ++++++---
 java/org/apache/el/util/ExceptionUtils.java        |  6 +++---
 java/org/apache/el/util/ReflectionUtil.java        |  3 +--
 java/org/apache/jasper/EmbeddedServletOptions.java |  2 +-
 java/org/apache/jasper/JspCompilationContext.java  |  4 ++--
 java/org/apache/jasper/compiler/Compiler.java      | 23 +++++++++++-----------
 java/org/apache/jasper/compiler/ELNode.java        |  2 +-
 .../apache/jasper/compiler/ErrorDispatcher.java    |  2 +-
 java/org/apache/jasper/compiler/Generator.java     | 10 +++++-----
 .../apache/jasper/compiler/JspDocumentParser.java  |  8 ++++----
 java/org/apache/jasper/compiler/JspReader.java     |  4 ++--
 .../apache/jasper/compiler/JspRuntimeContext.java  |  6 +++---
 java/org/apache/jasper/compiler/Mark.java          |  2 +-
 java/org/apache/jasper/compiler/Node.java          |  6 +++---
 java/org/apache/jasper/compiler/PageDataImpl.java  |  2 +-
 java/org/apache/jasper/compiler/PageInfo.java      |  2 +-
 java/org/apache/jasper/compiler/Parser.java        |  7 +++----
 .../apache/jasper/compiler/ParserController.java   |  4 ++--
 java/org/apache/jasper/compiler/SmapStratum.java   |  2 +-
 .../jasper/compiler/StringInterpreterFactory.java  |  2 +-
 .../apache/jasper/compiler/TagFileProcessor.java   |  4 ++--
 java/org/apache/jasper/compiler/TldCache.java      |  2 +-
 java/org/apache/jasper/compiler/Validator.java     |  4 ++--
 .../compiler/tagplugin/TagPluginContext.java       |  6 +++---
 java/org/apache/jasper/el/JasperELResolver.java    |  2 +-
 .../org/apache/jasper/runtime/BodyContentImpl.java |  6 +++---
 java/org/apache/jasper/runtime/JspWriterImpl.java  |  6 +++---
 .../apache/jasper/servlet/JasperInitializer.java   |  2 +-
 .../apache/jasper/servlet/JspCServletContext.java  |  6 +-----
 java/org/apache/jasper/servlet/JspServlet.java     |  4 ++--
 .../apache/jasper/servlet/JspServletWrapper.java   | 15 +++++++-------
 .../jasper/tagplugins/jstl/core/ForEach.java       |  2 +-
 .../apache/jasper/tagplugins/jstl/core/Param.java  |  2 +-
 .../apache/jasper/tagplugins/jstl/core/Set.java    |  2 +-
 .../apache/jasper/tagplugins/jstl/core/When.java   |  2 +-
 37 files changed, 87 insertions(+), 90 deletions(-)

diff --git a/java/org/apache/el/MethodExpressionImpl.java 
b/java/org/apache/el/MethodExpressionImpl.java
index ebb0e0bc0e..f0e8c0658d 100644
--- a/java/org/apache/el/MethodExpressionImpl.java
+++ b/java/org/apache/el/MethodExpressionImpl.java
@@ -52,7 +52,7 @@ import org.apache.el.util.ReflectionUtil;
  * provides the <code>base</code> object on which the method appears. If the 
<code>base</code> object is null, a
  * <code>NullPointerException</code> must be thrown. At the last resolution, 
the final <code>property</code> is then
  * coerced to a <code>String</code>, which provides the name of the method to 
be found. A method matching the name and
- * expected parameters provided at parse time is found and it is either 
queried or invoked (depending on the method
+ * expected parameters provided at parse time is found, and it is either 
queried or invoked (depending on the method
  * called on this <code>MethodExpression</code>).
  * </p>
  * <p>
diff --git a/java/org/apache/el/lang/ELSupport.java 
b/java/org/apache/el/lang/ELSupport.java
index 61167eb527..8e90bac3f3 100644
--- a/java/org/apache/el/lang/ELSupport.java
+++ b/java/org/apache/el/lang/ELSupport.java
@@ -185,8 +185,8 @@ public class ELSupport {
     }
 
     /*
-     * Going to have to have some casts /raw types somewhere so doing it here 
keeps them all in one place. There might
-     * be a neater / better solution but I couldn't find it.
+     * Going to have some casts /raw types somewhere so doing it here keeps 
them all in one place. There might
+     * be a neater / better solution, but I couldn't find it.
      */
     @SuppressWarnings("unchecked")
     public static Enum<?> coerceToEnum(final ELContext ctx, final Object obj,
diff --git a/java/org/apache/el/parser/AstValue.java 
b/java/org/apache/el/parser/AstValue.java
index 66e16a4112..bbbdb713f3 100644
--- a/java/org/apache/el/parser/AstValue.java
+++ b/java/org/apache/el/parser/AstValue.java
@@ -97,7 +97,8 @@ public final class AstValue extends SimpleNode {
                 i += 2;
 
                 if (property == null) {
-                    throw new 
PropertyNotFoundException(MessageFactory.get("error.unreachable.property", 
property));
+                    throw new PropertyNotFoundException(
+                            MessageFactory.get("error.unreachable.property", 
this.children[i].getImage()));
                 }
             } else if (i + 1 < propCount) {
                 // Object with property not at end of expression
@@ -113,11 +114,13 @@ public final class AstValue extends SimpleNode {
                 i++;
 
                 if (property == null) {
-                    throw new 
PropertyNotFoundException(MessageFactory.get("error.unreachable.property", 
property));
+                    throw new PropertyNotFoundException(
+                            MessageFactory.get("error.unreachable.property", 
this.children[i].getImage()));
                 }
             }
             if (base == null) {
-                throw new 
PropertyNotFoundException(MessageFactory.get("error.unreachable.property", 
property));
+                throw new PropertyNotFoundException(
+                        MessageFactory.get("error.unreachable.property", 
this.children[i].getImage()));
             }
         }
 
diff --git a/java/org/apache/el/util/ExceptionUtils.java 
b/java/org/apache/el/util/ExceptionUtils.java
index 798fd36a40..2314b1a547 100644
--- a/java/org/apache/el/util/ExceptionUtils.java
+++ b/java/org/apache/el/util/ExceptionUtils.java
@@ -17,7 +17,7 @@
 package org.apache.el.util;
 
 /**
- * Utilities for handling Throwables and Exceptions.
+ * Utilities for handling Throwable and Exceptions.
  */
 /*
  * Copied from o.a.t.u.ExceptionUtils
@@ -45,8 +45,8 @@ public class ExceptionUtils {
 
 
     /**
-     * NO-OP method provided to enable simple pre-loading of this class. Since 
the class is used extensively in error
-     * handling, it is prudent to pre-load it to avoid any failure to load 
this class masking the true problem during
+     * NO-OP method provided to enable simple preloading of this class. Since 
the class is used extensively in error
+     * handling, it is prudent to preload it to avoid any failure to load this 
class masking the true problem during
      * error handling.
      */
     public static void preload() {
diff --git a/java/org/apache/el/util/ReflectionUtil.java 
b/java/org/apache/el/util/ReflectionUtil.java
index baf32a1fef..6f662f30e8 100644
--- a/java/org/apache/el/util/ReflectionUtil.java
+++ b/java/org/apache/el/util/ReflectionUtil.java
@@ -427,8 +427,7 @@ public class ReflectionUtil {
      * This class duplicates code in javax.el.Util. When making changes keep 
the code in sync.
      */
     private static boolean isCoercibleFrom(EvaluationContext ctx, Object src, 
Class<?> target) {
-        // TODO: This isn't pretty but it works. Significant refactoring would
-        // be required to avoid the exception.
+        // TODO: This isn't pretty but it works. Significant refactoring would 
be required to avoid the exception.
         try {
             ELSupport.coerceToType(ctx, src, target);
         } catch (ELException e) {
diff --git a/java/org/apache/jasper/EmbeddedServletOptions.java 
b/java/org/apache/jasper/EmbeddedServletOptions.java
index e82732383d..650edcf2ee 100644
--- a/java/org/apache/jasper/EmbeddedServletOptions.java
+++ b/java/org/apache/jasper/EmbeddedServletOptions.java
@@ -713,7 +713,7 @@ public final class EmbeddedServletOptions implements 
Options {
         // web-application.
         tldCache = TldCache.getInstance(context);
 
-        // Setup the jsp config info for this web app.
+        // Set up the jsp config info for this web app.
         jspConfig = new JspConfig(context);
 
         // Create a Tag plugin instance
diff --git a/java/org/apache/jasper/JspCompilationContext.java 
b/java/org/apache/jasper/JspCompilationContext.java
index bf04a4b9df..216194d7e7 100644
--- a/java/org/apache/jasper/JspCompilationContext.java
+++ b/java/org/apache/jasper/JspCompilationContext.java
@@ -43,7 +43,7 @@ import org.apache.tomcat.Jar;
 import org.apache.tomcat.util.descriptor.tld.TldResourcePath;
 
 /**
- * A place holder for various things that are used through out the JSP engine. 
This is a per-request/per-context data
+ * A placeholder for various things that are used throughout the JSP engine. 
This is a per-request/per-context data
  * structure. Some of the instance variables are set at different points. Most 
of the path-related stuff is here -
  * mangling names, versions, dirs, loading resources and dealing with uris.
  *
@@ -187,7 +187,7 @@ public class JspCompilationContext {
 
     /**
      * The output directory to generate code into. The output directory is 
make up of the scratch directory, which is
-     * provide in Options, plus the directory derived from the package name.
+     * provided in Options, plus the directory derived from the package name.
      *
      * @return the output directory in which the generated sources are placed
      */
diff --git a/java/org/apache/jasper/compiler/Compiler.java 
b/java/org/apache/jasper/compiler/Compiler.java
index e3ef2d3b69..806a8bc424 100644
--- a/java/org/apache/jasper/compiler/Compiler.java
+++ b/java/org/apache/jasper/compiler/Compiler.java
@@ -108,9 +108,10 @@ public abstract class Compiler {
      */
     protected Map<String,SmapStratum> generateJava() throws Exception {
 
-        long t1, t2, t3, t4;
-
-        t1 = t2 = t3 = t4 = 0;
+        long t1 = 0;
+        long t2 = 0;
+        long t3 = 0;
+        long t4;
 
         if (log.isDebugEnabled()) {
             t1 = System.currentTimeMillis();
@@ -242,9 +243,9 @@ public abstract class Compiler {
                 Generator.generate(writer, this, pageNodes);
             }
 
-            // The writer is only used during the compile, dereference
+            // The writer is only used during compile, dereference
             // it in the JspCompilationContext when done to allow it
-            // to be GC'd and save memory.
+            // to be GCed and save memory.
             ctxt.setWriter(null);
 
             if (log.isTraceEnabled()) {
@@ -274,7 +275,7 @@ public abstract class Compiler {
             ctxt.getRuntimeContext().getSmaps().putAll(smaps);
         }
 
-        // If any proto type .java and .class files was generated,
+        // If any prototype .java and .class files was generated,
         // the prototype .java may have been replaced by the current
         // compilation (if the tag file is self referencing), but the
         // .class file need to be removed, to make sure that javac would
@@ -286,7 +287,7 @@ public abstract class Compiler {
 
     private ServletWriter setupContextWriter(String javaFileName) throws 
FileNotFoundException, JasperException {
         ServletWriter writer;
-        // Setup the ServletWriter
+        // Set up the ServletWriter
         String javaEncoding = ctxt.getOptions().getJavaEncoding();
         OutputStreamWriter osw = null;
 
@@ -330,7 +331,7 @@ public abstract class Compiler {
     }
 
     /**
-     * Compile the jsp file from the current engine context. As an side- 
effect, tag files that are referenced by this
+     * Compile the jsp file from the current engine context. As a side effect, 
tag files that are referenced by this
      * page are also compiled.
      *
      * @param compileClass If true, generate both .java and .class file If 
false, generate only .java file
@@ -344,7 +345,7 @@ public abstract class Compiler {
     }
 
     /**
-     * Compile the jsp file from the current engine context. As an side- 
effect, tag files that are referenced by this
+     * Compile the jsp file from the current engine context. As a side effect, 
tag files that are referenced by this
      * page are also compiled.
      *
      * @param compileClass If true, generate both .java and .class file If 
false, generate only .java file
@@ -387,7 +388,7 @@ public abstract class Compiler {
             }
             // Make sure these object which are only used during the
             // generation and compilation of the JSP page get
-            // dereferenced so that they can be GC'd and reduce the
+            // dereferenced so that they can be GCed and reduce the
             // memory footprint.
             tfp = null;
             errDispatcher = null;
@@ -414,7 +415,7 @@ public abstract class Compiler {
     /**
      * Determine if a compilation is necessary by checking the time stamp of 
the JSP page with that of the corresponding
      * .class or .java file. If the page has dependencies, the check is also 
extended to its dependents, and so on. This
-     * method can by overridden by a subclasses of Compiler.
+     * method can be overridden by a subclasses of Compiler.
      *
      * @param checkClass If true, check against .class file, if false, check 
against .java file.
      *
diff --git a/java/org/apache/jasper/compiler/ELNode.java 
b/java/org/apache/jasper/compiler/ELNode.java
index 9012a8fec5..2e0131d8d0 100644
--- a/java/org/apache/jasper/compiler/ELNode.java
+++ b/java/org/apache/jasper/compiler/ELNode.java
@@ -31,7 +31,7 @@ import org.apache.jasper.JasperException;
  * @author Kin-man Chung
  */
 
-abstract class ELNode {
+public abstract class ELNode {
 
     public abstract void accept(Visitor v) throws JasperException;
 
diff --git a/java/org/apache/jasper/compiler/ErrorDispatcher.java 
b/java/org/apache/jasper/compiler/ErrorDispatcher.java
index 436ae5354a..16ec6b76dd 100644
--- a/java/org/apache/jasper/compiler/ErrorDispatcher.java
+++ b/java/org/apache/jasper/compiler/ErrorDispatcher.java
@@ -250,7 +250,7 @@ public class ErrorDispatcher {
                     file = where.getFile();
                 }
             } else {
-                // Get the context-relative resource path, so as to not 
disclose any local file system details
+                // Get the context-relative resource path, to avoid disclosing 
any local file system details
                 file = where.getFile();
             }
             line = where.getLineNumber();
diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index afaee44bbf..b854cc86b1 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2659,7 +2659,7 @@ class Generator {
                 // JspFragment, because a fragment is always scriptless.
                 // Thus, there is no need to save/ restore/ sync them.
                 // Note, that JspContextWrapper.syncFoo() methods will take
-                // care of saving/ restoring/ sync'ing of JspContext 
attributes.
+                // care of saving/ restoring/ syncing of JspContext attributes.
                 return;
             }
 
@@ -2731,7 +2731,7 @@ class Generator {
                 // JspFragment, because a fragment is always scriptless.
                 // Thus, there is no need to save/ restore/ sync them.
                 // Note, that JspContextWrapper.syncFoo() methods will take
-                // care of saving/ restoring/ sync'ing of JspContext 
attributes.
+                // care of saving/ restoring/ syncing of JspContext attributes.
                 return;
             }
 
@@ -2797,7 +2797,7 @@ class Generator {
                 // JspFragment, because a fragment is always scriptless.
                 // Thus, there is no need to save/ restore/ sync them.
                 // Note, that JspContextWrapper.syncFoo() methods will take
-                // care of saving/ restoring/ sync'ing of JspContext 
attributes.
+                // care of saving/ restoring/ syncing of JspContext attributes.
                 return;
             }
 
@@ -3191,7 +3191,7 @@ class Generator {
             fragmentHelperClass.closeFragment(fragment, methodNesting);
             // XXX - Need to change pageContext to jspContext if
             // we're not in a place where pageContext is defined (e.g.
-            // in a fragment or in a tag file.
+            // in a fragment or in a tag file).
             out.print("new " + fragmentHelperClass.getClassName() + "( " + 
fragment.getId() + ", _jspx_page_context, " +
                     tagHandlerVar + ", " + pushBodyCountVar + ")");
         }
@@ -3933,7 +3933,7 @@ class Generator {
         /*
          * For a CustomTag, the codes that are generated at the beginning of 
the tag may not be in the same buffer as
          * those for the body of the tag. Two fields are used here to keep 
this straight. For codes that do not
-         * corresponds to any JSP lines, they should be null.
+         * correspond to any JSP lines, they should be null.
          */
         private final Node node;
 
diff --git a/java/org/apache/jasper/compiler/JspDocumentParser.java 
b/java/org/apache/jasper/compiler/JspDocumentParser.java
index c94ce1f18e..ab1b23e914 100644
--- a/java/org/apache/jasper/compiler/JspDocumentParser.java
+++ b/java/org/apache/jasper/compiler/JspDocumentParser.java
@@ -362,7 +362,7 @@ class JspDocumentParser extends DefaultHandler2 implements 
TagConstants {
      *
      * The SAX does not call this method with all of the template text, but 
may invoke this method with chunks of it.
      * This is a problem when we try to determine if the text contains only 
whitespaces, or when we are looking for an
-     * EL expression string. Therefore it is necessary to buffer and 
concatenate the chunks and process the concatenated
+     * EL expression string. Therefore, it is necessary to buffer and 
concatenate the chunks and process the concatenated
      * text later (at beginTag and endTag)
      *
      * @param buf The characters
@@ -533,12 +533,12 @@ class JspDocumentParser extends DefaultHandler2 
implements TagConstants {
                     continue;
                 }
                 // Ignore any whitespace (including spaces, carriage returns,
-                // line feeds, and tabs, that appear at the beginning and at
+                // line feeds, and tabs) that appear at the beginning and at
                 // the end of the body of the <jsp:attribute> action, if the
                 // action's 'trim' attribute is set to TRUE (default).
                 // In addition, any textual nodes in the <jsp:attribute> that
-                // have only white space are dropped from the document, with
-                // the exception of leading and trailing white-space-only
+                // have only white space are dropped from the document,
+                // except for leading and trailing white-space-only
                 // textual nodes in a <jsp:attribute> whose 'trim' attribute
                 // is set to FALSE, which must be kept verbatim.
                 if (i == 0) {
diff --git a/java/org/apache/jasper/compiler/JspReader.java 
b/java/org/apache/jasper/compiler/JspReader.java
index 95e20ad5c5..c5ad96aab0 100644
--- a/java/org/apache/jasper/compiler/JspReader.java
+++ b/java/org/apache/jasper/compiler/JspReader.java
@@ -30,7 +30,7 @@ import org.apache.tomcat.Jar;
 
 /**
  * JspReader is an input buffer for the JSP parser. It should allow unlimited 
lookahead and pushback. It also has a
- * bunch of parsing utility methods for understanding htmlesque thingies.
+ * bunch of parsing utility methods for understanding html style content.
  *
  * @author Anil K. Vijendran
  * @author Anselm Baird-Smith
@@ -599,7 +599,7 @@ class JspReader {
 
     /**
      * Parse utils - Is current character a token delimiter ? Delimiters are 
currently defined to be =, &gt;, &lt;, ",
-     * and ' or any any space character as defined by <code>isSpace</code>.
+     * and ' or any space character as defined by <code>isSpace</code>.
      *
      * @return A boolean.
      */
diff --git a/java/org/apache/jasper/compiler/JspRuntimeContext.java 
b/java/org/apache/jasper/compiler/JspRuntimeContext.java
index 023a494f0c..1ca331cc23 100644
--- a/java/org/apache/jasper/compiler/JspRuntimeContext.java
+++ b/java/org/apache/jasper/compiler/JspRuntimeContext.java
@@ -338,7 +338,7 @@ public final class JspRuntimeContext {
 
 
     /**
-     * Method used by background thread to check the JSP dependencies 
registered with this class for JSP's.
+     * Method used by background thread to check the JSP dependencies 
registered with this class for JSPs.
      */
     public void checkCompile() {
 
@@ -387,7 +387,7 @@ public final class JspRuntimeContext {
             try {
                 if (jsw.isTagFile()) {
                     // Although this is a public method, all other paths to 
this
-                    // method use this sync and it is required to prevent race
+                    // method use this sync, and it is required to prevent race
                     // conditions during the reload.
                     synchronized (this) {
                         jsw.loadTagFile();
@@ -554,7 +554,7 @@ public final class JspRuntimeContext {
 
 
     /**
-     * Method used by background thread to check if any JSP's should be 
unloaded.
+     * Method used by background thread to check if any JSPs should be 
unloaded.
      */
     public void checkUnload() {
 
diff --git a/java/org/apache/jasper/compiler/Mark.java 
b/java/org/apache/jasper/compiler/Mark.java
index a53cd7bb03..1ed7069104 100644
--- a/java/org/apache/jasper/compiler/Mark.java
+++ b/java/org/apache/jasper/compiler/Mark.java
@@ -26,7 +26,7 @@ import org.apache.jasper.JspCompilationContext;
  *
  * @author Anil K. Vijendran
  */
-final class Mark {
+public final class Mark {
 
     // position within current stream
     int cursor, line, col;
diff --git a/java/org/apache/jasper/compiler/Node.java 
b/java/org/apache/jasper/compiler/Node.java
index a2c2296d16..fb79e6916b 100644
--- a/java/org/apache/jasper/compiler/Node.java
+++ b/java/org/apache/jasper/compiler/Node.java
@@ -50,7 +50,7 @@ import org.xml.sax.Attributes;
  * @author Mark Roth
  */
 
-abstract class Node implements TagConstants {
+public abstract class Node implements TagConstants {
 
     private static final VariableInfo[] ZERO_VARIABLE_INFO = {};
 
@@ -347,7 +347,7 @@ abstract class Node implements TagConstants {
     }
 
     /**
-     * Selects and invokes a method in the visitor class based on the node 
type. This is abstract and should be overrode
+     * Selects and invokes a method in the visitor class based on the node 
type. This is abstract and should be overridden
      * by the extending classes.
      *
      * @param v The visitor class
@@ -2278,7 +2278,7 @@ abstract class Node implements TagConstants {
 
         /**
          * This method provides a place to put actions that are common to all 
nodes. Override this in the child visitor
-         * class if need to.
+         * class if needed.
          *
          * @param n The node to visit
          */
diff --git a/java/org/apache/jasper/compiler/PageDataImpl.java 
b/java/org/apache/jasper/compiler/PageDataImpl.java
index 5019e2afe6..e4fdc74f7e 100644
--- a/java/org/apache/jasper/compiler/PageDataImpl.java
+++ b/java/org/apache/jasper/compiler/PageDataImpl.java
@@ -77,7 +77,7 @@ class PageDataImpl extends PageData implements TagConstants {
     }
 
     /*
-     * First-pass Visitor for JspRoot nodes (representing jsp:root elements) 
and TablibDirective nodes, ignoring any
+     * First-pass Visitor for JspRoot nodes (representing jsp:root elements) 
and TaglibDirective nodes, ignoring any
      * other nodes.
      *
      * The purpose of this Visitor is to collect the attributes of the 
top-level jsp:root and those of the jsp:root
diff --git a/java/org/apache/jasper/compiler/PageInfo.java 
b/java/org/apache/jasper/compiler/PageInfo.java
index d409291774..f053057f3b 100644
--- a/java/org/apache/jasper/compiler/PageInfo.java
+++ b/java/org/apache/jasper/compiler/PageInfo.java
@@ -38,7 +38,7 @@ import org.apache.jasper.JasperException;
  * @author Kin-man Chung
  */
 
-class PageInfo {
+public class PageInfo {
 
     private final List<String> imports;
     private final Map<String,Long> dependants;
diff --git a/java/org/apache/jasper/compiler/Parser.java 
b/java/org/apache/jasper/compiler/Parser.java
index f308f0df25..2fe2bf7efc 100644
--- a/java/org/apache/jasper/compiler/Parser.java
+++ b/java/org/apache/jasper/compiler/Parser.java
@@ -569,7 +569,7 @@ class Parser implements TagConstants {
     }
 
     /*
-     * Parses a attribute directive with the following syntax: 
AttributeDirective ::= ( S Attribute)*
+     * Parses an attribute directive with the following syntax: 
AttributeDirective ::= ( S Attribute)*
      */
     private void parseAttributeDirective(Node parent) throws JasperException {
         Attributes attrs = parseAttributes();
@@ -965,8 +965,7 @@ class Parser implements TagConstants {
         boolean result = false;
 
         if (reader.matchesOptionalSpacesFollowedBy("<jsp:attribute")) {
-            // May be an EmptyBody, depending on whether
-            // There's a "<jsp:body" before the ETag
+            // It may be an EmptyBody, depending on whether there's a 
"<jsp:body" before the ETag
 
             // First, parse <jsp:attribute> elements:
             parseNamedAttributes(parent);
@@ -1193,7 +1192,7 @@ class Parser implements TagConstants {
         // 'CustomActionJSPContent', or 'CustomActionScriptlessContent'.
         // depending on body-content in TLD.
 
-        // Looking for a body, it still can be empty; but if there is a
+        // Looking for a body, it still can be empty; but if there is
         // a tag body, its syntax would be dependent on the type of
         // body content declared in the TLD.
         String bc;
diff --git a/java/org/apache/jasper/compiler/ParserController.java 
b/java/org/apache/jasper/compiler/ParserController.java
index 6fefdbcfdc..5f90f621b5 100644
--- a/java/org/apache/jasper/compiler/ParserController.java
+++ b/java/org/apache/jasper/compiler/ParserController.java
@@ -40,7 +40,7 @@ import org.xml.sax.Attributes;
  * @author Pierre Delisle
  * @author Jan Luehe
  */
-class ParserController implements TagConstants {
+public class ParserController implements TagConstants {
 
     private static final String CHARSET = "charset=";
     private static final String TAGS_IN_JAR_LOCATION = "/META-INF/tags/";
@@ -197,7 +197,7 @@ class ParserController implements TagConstants {
             /*
              * An included file is being parsed that was included from the 
standard location for tag files in JAR but
              * tries to escape that location to either somewhere in the JAR 
not under the standard location or outside
-             * of the JAR. Neither of these are permitted.
+             * the JAR. Neither of these are permitted.
              */
             err.jspError("jsp.error.invalid.includeInTagFileJar", inFileName, 
jar.getJarFileURL().toString());
         }
diff --git a/java/org/apache/jasper/compiler/SmapStratum.java 
b/java/org/apache/jasper/compiler/SmapStratum.java
index 8eab419f9e..6adcf1d1c3 100644
--- a/java/org/apache/jasper/compiler/SmapStratum.java
+++ b/java/org/apache/jasper/compiler/SmapStratum.java
@@ -30,7 +30,7 @@ public class SmapStratum {
     /**
      * Represents a single LineSection in an SMAP, associated with a 
particular stratum.
      */
-    static class LineInfo {
+    public static class LineInfo {
         private int inputStartLine = -1;
         private int outputStartLine = -1;
         private int lineFileID = 0;
diff --git a/java/org/apache/jasper/compiler/StringInterpreterFactory.java 
b/java/org/apache/jasper/compiler/StringInterpreterFactory.java
index 3496c65c40..87b9cebb04 100644
--- a/java/org/apache/jasper/compiler/StringInterpreterFactory.java
+++ b/java/org/apache/jasper/compiler/StringInterpreterFactory.java
@@ -153,7 +153,7 @@ public class StringInterpreterFactory {
 
 
         /**
-         * Intended to be used by sub-classes that don't need/want to 
re-implement the logic in
+         * Intended to be used by subclasses that don't need/want to 
re-implement the logic in
          * {@link #convertString(Class, String, String, Class, boolean)}.
          *
          * @param c                unused
diff --git a/java/org/apache/jasper/compiler/TagFileProcessor.java 
b/java/org/apache/jasper/compiler/TagFileProcessor.java
index 0767521162..343b2cf725 100644
--- a/java/org/apache/jasper/compiler/TagFileProcessor.java
+++ b/java/org/apache/jasper/compiler/TagFileProcessor.java
@@ -46,7 +46,7 @@ import org.apache.tomcat.util.descriptor.tld.TldResourcePath;
  * @author Kin-man Chung
  */
 
-class TagFileProcessor {
+public class TagFileProcessor {
 
     private List<Compiler> tempVector;
 
@@ -624,7 +624,7 @@ class TagFileProcessor {
     /**
      * Removed the java and class files for the tag prototype generated from 
the current compilation.
      *
-     * @param classFileName If non-null, remove only the class file with with 
this name.
+     * @param classFileName If non-null, remove only the class file with this 
name.
      */
     public void removeProtoTypeFiles(String classFileName) {
         for (Compiler c : tempVector) {
diff --git a/java/org/apache/jasper/compiler/TldCache.java 
b/java/org/apache/jasper/compiler/TldCache.java
index 869173d598..88b2ae7ebf 100644
--- a/java/org/apache/jasper/compiler/TldCache.java
+++ b/java/org/apache/jasper/compiler/TldCache.java
@@ -35,7 +35,7 @@ import org.xml.sax.SAXException;
 
 /**
  * This class caches parsed instances of TLD files to remove the need for the 
same TLD to be parsed for each JSP that
- * references it. It does not protect against multiple threads processing the 
same, new TLD but it does ensure that each
+ * references it. It does not protect against multiple threads processing the 
same new TLD, but it does ensure that each
  * all threads will use the same TLD object after parsing.
  */
 public class TldCache {
diff --git a/java/org/apache/jasper/compiler/Validator.java 
b/java/org/apache/jasper/compiler/Validator.java
index fab75f5861..2eda33d269 100644
--- a/java/org/apache/jasper/compiler/Validator.java
+++ b/java/org/apache/jasper/compiler/Validator.java
@@ -1176,10 +1176,10 @@ class Validator {
         /**
          * Preprocess attributes that can be expressions. Expression 
delimiters are stripped.
          * <p>
-         * If value is null, checks if there are any NamedAttribute 
subelements in the tree node, and if so, constructs
+         * If value is null, checks if there are any NamedAttribute sub 
elements in the tree node, and if so, constructs
          * a JspAttribute out of a child NamedAttribute node.
          *
-         * @param el EL expression, if already parsed by the caller (so that 
we can skip re-parsing it)
+         * @param el EL expression, if already parsed by the caller (so that 
we can skip reparsing it)
          */
         private Node.JspAttribute getJspAttribute(TagAttributeInfo tai, String 
qName, String uri, String localName,
                 String value, Node n, ELNode.Nodes el, boolean dynamic) throws 
JasperException {
diff --git a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java 
b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
index 7f6ad2c098..38d9383a57 100644
--- a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
+++ b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
@@ -81,7 +81,7 @@ public interface TagPluginContext {
     String getConstantAttribute(String attribute);
 
     /**
-     * Generate codes to evaluate value of a attribute in the custom tag The 
codes is a Java expression. NOTE: Currently
+     * Generate codes to evaluate value of an attribute in the custom tag The 
codes is a Java expression. NOTE: Currently
      * cannot handle attributes that are fragments.
      *
      * @param attribute The specified attribute
@@ -101,10 +101,10 @@ public interface TagPluginContext {
 
     /**
      * Get the PluginContext for the parent of this custom tag. NOTE: The 
operations available for PluginContext so
-     * obtained is limited to getPluginAttribute and setPluginAttribute, and 
queries (e.g. isScriptless(). There should
+     * obtained is limited to getPluginAttribute and setPluginAttribute, and 
queries (e.g. isScriptless()). There should
      * be no calls to generate*().
      *
-     * @return The pluginContext for the parent node. null if the parent is 
not a custom tag, or if the pluginContext if
+     * @return The pluginContext for the parent node. null if the parent is 
not a custom tag, or if the pluginContext is
      *             not available (because useTagPlugin is false, e.g).
      */
     TagPluginContext getParentContext();
diff --git a/java/org/apache/jasper/el/JasperELResolver.java 
b/java/org/apache/jasper/el/JasperELResolver.java
index 3f41faa0ff..fc5c8fd1b5 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -102,7 +102,7 @@ public class JasperELResolver extends CompositeELResolver {
             // call implicit and app resolvers
             int index = 1 /* implicit */ + appResolversSize;
             for (int i = 0; i < index; i++) {
-                result = resolvers[i].getValue(context, base, property);
+                result = resolvers[i].getValue(context, null, property);
                 if (context.isPropertyResolved()) {
                     return result;
                 }
diff --git a/java/org/apache/jasper/runtime/BodyContentImpl.java 
b/java/org/apache/jasper/runtime/BodyContentImpl.java
index c7a7aa5f19..476e864192 100644
--- a/java/org/apache/jasper/runtime/BodyContentImpl.java
+++ b/java/org/apache/jasper/runtime/BodyContentImpl.java
@@ -30,8 +30,8 @@ import org.apache.jasper.Constants;
 import org.apache.jasper.compiler.Localizer;
 
 /**
- * Write text to a character-output stream, buffering characters so as to 
provide for the efficient writing of single
- * characters, arrays, and strings. Provide support for discarding for the 
output that has been buffered.
+ * Write text to a character-output stream, buffering characters to provide 
efficient writing of single
+ * characters, arrays, and strings. Provide support for discarding the output 
that has been buffered.
  *
  * @author Rajiv Mordani
  * @author Jan Luehe
@@ -365,7 +365,7 @@ public class BodyContentImpl extends BodyContent {
     public void writeOut(Writer out) throws IOException {
         if (writer == null) {
             out.write(cb, 0, nextChar);
-            // Flush not called as the writer passed could be a BodyContent and
+            // Flush not called as the writer passed could be a BodyContent, 
and
             // it doesn't allow to flush.
         }
     }
diff --git a/java/org/apache/jasper/runtime/JspWriterImpl.java 
b/java/org/apache/jasper/runtime/JspWriterImpl.java
index 9b34ac7023..37c2f78911 100644
--- a/java/org/apache/jasper/runtime/JspWriterImpl.java
+++ b/java/org/apache/jasper/runtime/JspWriterImpl.java
@@ -27,8 +27,8 @@ import org.apache.jasper.Constants;
 import org.apache.jasper.compiler.Localizer;
 
 /**
- * Write text to a character-output stream, buffering characters so as to 
provide for the efficient writing of single
- * characters, arrays, and strings. Provide support for discarding for the 
output that has been buffered. This needs
+ * Write text to a character-output stream, buffering characters to provide 
efficient writing of single
+ * characters, arrays, and strings. Provide support for discarding the output 
that has been buffered. This needs
  * revisiting when the buffering problems in the JSP spec are fixed -akv
  *
  * @author Anil K. Vijendran
@@ -202,7 +202,7 @@ public class JspWriterImpl extends JspWriter {
     }
 
     /**
-     * Our own little min method, to avoid loading java.lang.Math if we've run 
out of file descriptors and we're trying
+     * Our own little min method, to avoid loading java.lang.Math if we've run 
out of file descriptors, and we're trying
      * to print a stack trace.
      */
     private static int min(int a, int b) {
diff --git a/java/org/apache/jasper/servlet/JasperInitializer.java 
b/java/org/apache/jasper/servlet/JasperInitializer.java
index 08999433bb..97844918d3 100644
--- a/java/org/apache/jasper/servlet/JasperInitializer.java
+++ b/java/org/apache/jasper/servlet/JasperInitializer.java
@@ -61,7 +61,7 @@ public class JasperInitializer implements 
ServletContainerInitializer {
             log.debug(Localizer.getMessage(MSG + ".onStartup", 
context.getServletContextName()));
         }
 
-        // Setup a simple default Instance Manager
+        // Set up a simple default Instance Manager
         if (context.getAttribute(InstanceManager.class.getName()) == null) {
             context.setAttribute(InstanceManager.class.getName(), new 
SimpleInstanceManager());
         }
diff --git a/java/org/apache/jasper/servlet/JspCServletContext.java 
b/java/org/apache/jasper/servlet/JspCServletContext.java
index b92f40e981..5332ceb37f 100644
--- a/java/org/apache/jasper/servlet/JspCServletContext.java
+++ b/java/org/apache/jasper/servlet/JspCServletContext.java
@@ -188,11 +188,7 @@ public class JspCServletContext implements ServletContext {
         List<URL> resourceJars = new ArrayList<>();
         // Build list of potential resource JARs. Use same ordering as 
ContextConfig
         Set<WebXml> resourceFragments = new LinkedHashSet<>(orderedFragments);
-        for (WebXml fragment : fragments) {
-            if (!resourceFragments.contains(fragment)) {
-                resourceFragments.add(fragment);
-            }
-        }
+        resourceFragments.addAll(fragments);
 
         for (WebXml resourceFragment : resourceFragments) {
             try (Jar jar = JarFactory.newInstance(resourceFragment.getURL())) {
diff --git a/java/org/apache/jasper/servlet/JspServlet.java 
b/java/org/apache/jasper/servlet/JspServlet.java
index 1b9d7c8688..3adc6d1c46 100644
--- a/java/org/apache/jasper/servlet/JspServlet.java
+++ b/java/org/apache/jasper/servlet/JspServlet.java
@@ -45,8 +45,8 @@ import org.apache.tomcat.PeriodicEventListener;
 import org.apache.tomcat.util.security.Escape;
 
 /**
- * The JSP engine (a.k.a Jasper). The servlet container is responsible for 
providing a URLClassLoader for the web
- * application context Jasper is being used in. Jasper will try get the Tomcat 
ServletContext attribute for its
+ * The Jasper JSP engine. The servlet container is responsible for providing a 
URLClassLoader for the web
+ * application context Jasper is being used in. Jasper will try to get the 
Tomcat ServletContext attribute for its
  * ServletContext class loader, if that fails, it uses the parent class 
loader. In either case, it must be a
  * URLClassLoader.
  *
diff --git a/java/org/apache/jasper/servlet/JspServletWrapper.java 
b/java/org/apache/jasper/servlet/JspServletWrapper.java
index 076426f2c9..4b1cba65c7 100644
--- a/java/org/apache/jasper/servlet/JspServletWrapper.java
+++ b/java/org/apache/jasper/servlet/JspServletWrapper.java
@@ -50,8 +50,8 @@ import org.apache.tomcat.InstanceManager;
 import org.apache.tomcat.Jar;
 
 /**
- * The JSP engine (a.k.a Jasper). The servlet container is responsible for 
providing a URLClassLoader for the web
- * application context Jasper is being used in. Jasper will try get the Tomcat 
ServletContext attribute for its
+ * The Jasper JSP engine. The servlet container is responsible for providing a 
URLClassLoader for the web
+ * application context Jasper is being used in. Jasper will try to get the 
Tomcat ServletContext attribute for its
  * ServletContext class loader, if that fails, it uses the parent class 
loader. In either case, it must be a
  * URLClassLoader.
  *
@@ -84,8 +84,8 @@ public class JspServletWrapper {
     private final ServletConfig config;
     private final Options options;
     /*
-     * The servlet / tag file needs a compilation check on first access. Use a 
separate flag (rather then theServlet ==
-     * null / tagHandlerClass == null as it avoids the potentially expensive 
isOutDated() calls in ctxt.compile() if
+     * The servlet / tag file needs a compilation check on first access. Use a 
separate flag (rather than theServlet ==
+     * null / tagHandlerClass == null) as it avoids the potentially expensive 
isOutDated() calls in ctxt.compile() if
      * there are multiple concurrent requests for the servlet / tag before the 
class has been loaded.
      */
     private volatile boolean mustCompile = true;
@@ -276,7 +276,7 @@ public class JspServletWrapper {
 
     /**
      * Compile and load a prototype for the Tag file. This is needed when 
compiling tag files with circular
-     * dependencies. A prototype (skeleton) with no dependencies on other 
other tag files is generated and compiled.
+     * dependencies. A prototype (skeleton) with no dependencies on other tag 
files is generated and compiled.
      *
      * @return the loaded class
      *
@@ -524,8 +524,7 @@ public class JspServletWrapper {
      * Attempts to construct a JasperException that contains helpful 
information about what went wrong. Uses the JSP
      * compiler system to translate the line number in the generated servlet 
that originated the exception to a line
      * number in the JSP. Then constructs an exception containing that 
information, and a snippet of the JSP to help
-     * debugging. Please see 
https://bz.apache.org/bugzilla/show_bug.cgi?id=37062 and 
http://www.tfenne.com/jasper/ for
-     * more details.
+     * debugging. Please see <a 
href="https://bz.apache.org/bugzilla/show_bug.cgi?id=37062";>BZ 37062</a> for 
more details.
      * </p>
      *
      * @param ex the exception that was the cause of the problem.
@@ -560,7 +559,7 @@ public class JspServletWrapper {
 
             if (smap == null) {
                 // If we couldn't find a frame in the stack trace corresponding
-                // to the generated servlet class or we don't have a copy of 
the
+                // to the generated servlet class, or we don't have a copy of 
the
                 // smap to hand, we can't really add anything
                 return new JasperException(ex);
             }
diff --git a/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java 
b/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
index b3d318f034..7a6634153d 100644
--- a/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
+++ b/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
@@ -71,7 +71,7 @@ public final class ForEach implements TagPlugin {
     }
 
     /**
-     * Generate codes for Collections The pseudo code is:
+     * Generate codes for Collections The pseudocode is:
      */
     private void doCollection(TagPluginContext ctxt) {
 
diff --git a/java/org/apache/jasper/tagplugins/jstl/core/Param.java 
b/java/org/apache/jasper/tagplugins/jstl/core/Param.java
index d182cf118c..e9028b7c21 100644
--- a/java/org/apache/jasper/tagplugins/jstl/core/Param.java
+++ b/java/org/apache/jasper/tagplugins/jstl/core/Param.java
@@ -33,7 +33,7 @@ public class Param implements TagPlugin {
         String encName = ctxt.getTemporaryVariableName();
         String index = ctxt.getTemporaryVariableName();
 
-        // if the param tag has no parents, throw a exception
+        // if the param tag has no parents, throw an exception
         TagPluginContext parent = ctxt.getParentContext();
         if (parent == null) {
             ctxt.generateJavaSource(
diff --git a/java/org/apache/jasper/tagplugins/jstl/core/Set.java 
b/java/org/apache/jasper/tagplugins/jstl/core/Set.java
index ba3ddff6d0..465edf445b 100644
--- a/java/org/apache/jasper/tagplugins/jstl/core/Set.java
+++ b/java/org/apache/jasper/tagplugins/jstl/core/Set.java
@@ -63,7 +63,7 @@ public class Set implements TagPlugin {
         // get the iScope according to the strScope
         iScope = Util.getScope(strScope);
 
-        String jspCtxt = null;
+        String jspCtxt;
         if (ctxt.isTagFile()) {
             jspCtxt = "this.getJspContext()";
         } else {
diff --git a/java/org/apache/jasper/tagplugins/jstl/core/When.java 
b/java/org/apache/jasper/tagplugins/jstl/core/When.java
index b6568003e7..5bc75db74a 100644
--- a/java/org/apache/jasper/tagplugins/jstl/core/When.java
+++ b/java/org/apache/jasper/tagplugins/jstl/core/When.java
@@ -42,7 +42,7 @@ public final class When implements TagPlugin {
         ctxt.generateBody();
 
         // We don't generate the closing "}" for the "if" here because there
-        // may be whitespaces in between <c:when>'s. Instead we delay
+        // may be whitespaces in between <c:when>'s. Instead, we delay
         // generating it until the next <c:when> or <c:otherwise> or
         // <c:choose>
     }


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


Reply via email to