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

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2fe41cb2a278121248033a3ce2ad04615414d6b6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Nov 22 22:21:05 2024 +0000

    Prepare to apply standard formatting
---
 java/org/apache/jasper/compiler/AttributeParser.java | 20 ++++++++++++--------
 .../apache/jasper/compiler/ELInterpreterFactory.java |  3 +--
 java/org/apache/jasper/compiler/ELNode.java          |  6 +++---
 .../org/apache/jasper/compiler/EncodingDetector.java | 12 ++++--------
 java/org/apache/jasper/compiler/ErrorDispatcher.java | 17 +++++++----------
 5 files changed, 27 insertions(+), 31 deletions(-)

diff --git a/java/org/apache/jasper/compiler/AttributeParser.java 
b/java/org/apache/jasper/compiler/AttributeParser.java
index bcb8bc3272..50528dd0fc 100644
--- a/java/org/apache/jasper/compiler/AttributeParser.java
+++ b/java/org/apache/jasper/compiler/AttributeParser.java
@@ -117,6 +117,8 @@ public class AttributeParser {
     }
 
     /*
+     * @formatter:off
+     *
      * This method gets the next unquoted character and looks for
      * - literals that need to be converted for EL processing
      *   \ -> type{'\\'}
@@ -125,8 +127,9 @@ public class AttributeParser {
      * - start of EL
      *   ${
      *   #{
-     * Note all the examples above *do not* include the escaping required to 
use
-     * the values in Java code.
+     * Note all the examples above *do not* include the escaping required to 
use the values in Java code.
+     *
+     * @formatter:on
      */
     private void parseLiteral() {
         boolean foundEL = false;
@@ -225,8 +228,9 @@ public class AttributeParser {
     }
 
     /*
-     * Returns the next unquoted character and sets the lastChEscaped flag to
-     * indicate if it was quoted/escaped or not.
+     * @formatter:off
+     *
+     * Returns the next unquoted character and sets the lastChEscaped flag to 
indicate if it was quoted/escaped or not.
      * &apos; is always unquoted to '
      * &quot; is always unquoted to "
      * \" is always unquoted to "
@@ -236,6 +240,8 @@ public class AttributeParser {
      * \# is unquoted to # if EL is not being ignored
      * <\% is always unquoted to <%
      * %\> is always unquoted to %>
+     *
+     * @formatter:on
      */
     private char nextChar() {
         lastChEscaped = false;
@@ -271,16 +277,14 @@ public class AttributeParser {
         } else if (ch == '<' && (i + 2 < size) && input.charAt(i + 1) == '\\' 
&&
                 input.charAt(i + 2) == '%') {
             // Note this is a hack since nextChar only returns a single char
-            // It is safe since <% does not require special treatment for EL
-            // or for literals
+            // It is safe since <% does not require special treatment for EL 
or for literals
             result.append('<');
             i+=3;
             return '%';
         } else if (ch == '%' && i + 2 < size && input.charAt(i + 1) == '\\' &&
                 input.charAt(i + 2) == '>') {
             // Note this is a hack since nextChar only returns a single char
-            // It is safe since %> does not require special treatment for EL
-            // or for literals
+            // It is safe since %> does not require special treatment for EL 
or for literals
             result.append('%');
             i+=3;
             return '>';
diff --git a/java/org/apache/jasper/compiler/ELInterpreterFactory.java 
b/java/org/apache/jasper/compiler/ELInterpreterFactory.java
index efadcab956..30369bc79c 100644
--- a/java/org/apache/jasper/compiler/ELInterpreterFactory.java
+++ b/java/org/apache/jasper/compiler/ELInterpreterFactory.java
@@ -53,8 +53,7 @@ public class ELInterpreterFactory {
         ELInterpreter result = null;
 
         // Search for an implementation
-        // 1. ServletContext attribute (set by application or cached by a
-        //    previous call to this method).
+        // 1. ServletContext attribute (set by application or cached by a 
previous call to this method).
         Object attribute = context.getAttribute(EL_INTERPRETER_CLASS_NAME);
         if (attribute instanceof ELInterpreter) {
             return (ELInterpreter) attribute;
diff --git a/java/org/apache/jasper/compiler/ELNode.java 
b/java/org/apache/jasper/compiler/ELNode.java
index 0c99ce3bd5..9fe4e00216 100644
--- a/java/org/apache/jasper/compiler/ELNode.java
+++ b/java/org/apache/jasper/compiler/ELNode.java
@@ -25,7 +25,7 @@ import jakarta.servlet.jsp.tagext.FunctionInfo;
 import org.apache.jasper.JasperException;
 
 /**
- * This class defines internal representation for an EL Expression
+ * This class defines internal representation for an EL Expression.
  *
  * It currently only defines functions.  It can be expanded to define
  * all the components of an EL expression, if need to.
@@ -88,7 +88,7 @@ abstract class ELNode {
 
     /**
      * Represents anything in EL expression, other than functions, including
-     * function arguments etc
+     * function arguments etc.
      */
     public static class ELText extends ELNode {
 
@@ -109,7 +109,7 @@ abstract class ELNode {
     }
 
     /**
-     * Represents a function
+     * Represents a function.
      * Currently only include the prefix and function name, but not its
      * arguments.
      */
diff --git a/java/org/apache/jasper/compiler/EncodingDetector.java 
b/java/org/apache/jasper/compiler/EncodingDetector.java
index fb7795ca16..c9f53ea77e 100644
--- a/java/org/apache/jasper/compiler/EncodingDetector.java
+++ b/java/org/apache/jasper/compiler/EncodingDetector.java
@@ -57,8 +57,7 @@ class EncodingDetector {
 
         BomResult bomResult = processBom(bis);
 
-        // Reset the stream back to the start to allow the XML prolog detection
-        // to work. Skip any BoM we discovered.
+        // Reset the stream back to the start to allow the XML prolog 
detection to work. Skip any BoM we discovered.
         bis.reset();
         for (int i = 0; i < bomResult.skip; i++) {
             bis.read();
@@ -104,8 +103,7 @@ class EncodingDetector {
 
 
     private BomResult processBom(InputStream stream) {
-        // Read first four bytes (or as many are available) and determine
-        // encoding
+        // Read first four bytes (or as many are available) and determine 
encoding
         try {
             final byte[] b4 = new byte[4];
             int count = 0;
@@ -145,8 +143,7 @@ class EncodingDetector {
             return new BomResult("UTF-16LE", 2);
         }
 
-        // default to UTF-8 if we don't have enough bytes to make a
-        // good determination of the encoding
+        // default to UTF-8 if we don't have enough bytes to make a good 
determination of the encoding
         if (count < 3) {
             return new BomResult("UTF-8", 0);
         }
@@ -157,8 +154,7 @@ class EncodingDetector {
             return new BomResult("UTF-8", 3);
         }
 
-        // default to UTF-8 if we don't have enough bytes to make a
-        // good determination of the encoding
+        // default to UTF-8 if we don't have enough bytes to make a good 
determination of the encoding
         if (count < 4) {
             return new BomResult("UTF-8", 0);
         }
diff --git a/java/org/apache/jasper/compiler/ErrorDispatcher.java 
b/java/org/apache/jasper/compiler/ErrorDispatcher.java
index 6d3abfdf61..50aa63991e 100644
--- a/java/org/apache/jasper/compiler/ErrorDispatcher.java
+++ b/java/org/apache/jasper/compiler/ErrorDispatcher.java
@@ -31,10 +31,10 @@ import org.xml.sax.SAXException;
 /**
  * Class responsible for dispatching JSP parse and javac compilation errors
  * to the configured error handler.
- *
+ * <p>
  * This class is also responsible for localizing any error codes before they
  * are passed on to the configured error handler.
- *
+ * <p>
  * In the case of a Java compilation error, the compiler error message is
  * parsed into an array of JavacErrorDetail instances, which is passed on to
  * the configured error handler.
@@ -230,9 +230,6 @@ public class ErrorDispatcher {
     }
 
 
-    //*********************************************************************
-    // Private utility methods
-
     /**
      * Dispatches the given JSP parse error to the configured error handler.
      *
@@ -279,8 +276,7 @@ public class ErrorDispatcher {
                     file = where.getFile();
                 }
             } else {
-                // Get the context-relative resource path, so as to not
-                // disclose any local filesystem details
+                // Get the context-relative resource path, so as to not 
disclose any local file system details
                 file = where.getFile();
             }
             line = where.getLineNumber();
@@ -305,7 +301,7 @@ public class ErrorDispatcher {
     /**
      * Parses the given Java compilation error message, which may contain one
      * or more compilation errors, into an array of JavacErrorDetail instances.
-     *
+     * <p>
      * Each JavacErrorDetail instance contains the information about a single
      * compilation error.
      *
@@ -342,6 +338,7 @@ public class ErrorDispatcher {
             /*
              * Error line number is delimited by set of colons.
              * Ignore colon following drive letter on Windows (fromIndex = 2).
+             *
              * XXX Handle deprecation warnings that don't have line info
              */
             int beginColon = line.indexOf(':', 2);
@@ -422,8 +419,7 @@ public class ErrorDispatcher {
         page.visit(errVisitor);
         Node errNode = errVisitor.getJspSourceNode();
         if ((errNode != null) && (errNode.getStart() != null)) {
-            // If this is a scriplet node then there is a one to one mapping
-            // between JSP lines and Java lines
+            // If this is a scriplet node then there is a one to one mapping 
between JSP lines and Java lines
             if (errVisitor.getJspSourceNode() instanceof Node.Scriptlet ||
                     errVisitor.getJspSourceNode() instanceof Node.Declaration) 
{
                 javacError = new JavacErrorDetail(
@@ -455,6 +451,7 @@ public class ErrorDispatcher {
              * generated for the scriptlet, and therefore cannot be
              * mapped to the start line number of the scriptlet in the
              * JSP page.
+             *
              * Include just the javac error info in the error detail.
              */
             javacError = new JavacErrorDetail(


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

Reply via email to