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


The following commit(s) were added to refs/heads/main by this push:
     new 36ea09c7fc Start to add CheckStyle validation of Javadoc
36ea09c7fc is described below

commit 36ea09c7fc1912239bd7e61115b5020d9dda9977
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jan 12 12:40:48 2023 +0000

    Start to add CheckStyle validation of Javadoc
---
 .../apache/catalina/authenticator/Constants.java   | 27 +++++++++-------------
 .../apache/catalina/ha/session/DeltaRequest.java   | 14 +++++------
 .../apache/catalina/session/StandardSession.java   |  2 +-
 .../tribes/transport/nio/NioReplicationTask.java   |  4 ++--
 java/org/apache/catalina/util/Strftime.java        |  2 +-
 .../catalina/valves/rewrite/RewriteRule.java       |  4 ++--
 java/org/apache/jasper/JspCompilationContext.java  |  6 ++---
 java/org/apache/jasper/compiler/Node.java          |  7 ------
 .../apache/jasper/servlet/JasperInitializer.java   |  2 +-
 .../tomcat/util/bcel/classfile/ClassParser.java    |  7 +++---
 .../apache/tomcat/util/codec/binary/Base64.java    |  2 +-
 java/org/apache/tomcat/util/compat/JreVendor.java  |  2 +-
 java/org/apache/tomcat/util/http/MimeHeaders.java  |  2 +-
 .../apache/tomcat/jdbc/test/DefaultTestCase.java   |  2 +-
 res/checkstyle/checkstyle.xml                      |  3 +++
 15 files changed, 37 insertions(+), 49 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/Constants.java 
b/java/org/apache/catalina/authenticator/Constants.java
index 1bb5809d79..bb59fd93f7 100644
--- a/java/org/apache/catalina/authenticator/Constants.java
+++ b/java/org/apache/catalina/authenticator/Constants.java
@@ -58,31 +58,26 @@ public class Constants {
 
 
     /**
-     * If the <code>cache</code> property of our authenticator is set, and
-     * the current request is part of a session, authentication information
-     * will be cached to avoid the need for repeated calls to
-     * <code>Realm.authenticate()</code>, under the following keys:
-     */
-
-    /**
-     * The notes key for the password used to authenticate this user.
+     * If the <code>cache</code> property of the authenticator is set, and the
+     * current request is part of a session, the password used to authenticate
+     * this user will be cached under this key to avoid the need for repeated
+     * calls to <code>Realm.authenticate()</code>.
      */
     public static final String SESS_PASSWORD_NOTE = 
"org.apache.catalina.session.PASSWORD";
 
     /**
-     * The notes key for the username used to authenticate this user.
+     * If the <code>cache</code> property of the authenticator is set, and the
+     * current request is part of a session, the user name used to authenticate
+     * this user will be cached under this key to avoid the need for repeated
+     * calls to <code>Realm.authenticate()</code>.
      */
     public static final String SESS_USERNAME_NOTE = 
"org.apache.catalina.session.USERNAME";
 
 
     /**
-     * The following note keys are used during form login processing to
-     * cache required information prior to the completion of authentication.
-     */
-
-    /**
-     * The original request information, to which the user will be
-     * redirected if authentication succeeds.
+     * The original request information, to which the user will be redirected 
if
+     * authentication succeeds, is cached in the notes under this key during 
the
+     * authentication process.
      */
     public static final String FORM_REQUEST_NOTE = 
"org.apache.catalina.authenticator.REQUEST";
 }
diff --git a/java/org/apache/catalina/ha/session/DeltaRequest.java 
b/java/org/apache/catalina/ha/session/DeltaRequest.java
index 1f5b481818..57154a8e3c 100644
--- a/java/org/apache/catalina/ha/session/DeltaRequest.java
+++ b/java/org/apache/catalina/ha/session/DeltaRequest.java
@@ -16,13 +16,6 @@
  */
 package org.apache.catalina.ha.session;
 
-/**
- * This class is used to track the series of actions that happens when
- * a request is executed. These actions will then translate into invocations 
of methods
- * on the actual session.
- * This class is NOT thread safe. One DeltaRequest per session
- */
-
 import java.io.ByteArrayOutputStream;
 import java.io.Externalizable;
 import java.io.IOException;
@@ -37,7 +30,12 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
 
-
+/**
+ * This class is used to track the series of actions that happens when
+ * a request is executed. These actions will then translate into invocations 
of methods
+ * on the actual session.
+ * This class is NOT thread safe. One DeltaRequest per session
+ */
 public class DeltaRequest implements Externalizable {
 
     public static final Log log = LogFactory.getLog(DeltaRequest.class);
diff --git a/java/org/apache/catalina/session/StandardSession.java 
b/java/org/apache/catalina/session/StandardSession.java
index bd06046419..b94a0ed4bd 100644
--- a/java/org/apache/catalina/session/StandardSession.java
+++ b/java/org/apache/catalina/session/StandardSession.java
@@ -687,7 +687,7 @@ public class StandardSession implements HttpSession, 
Session, Serializable {
 
         isNew = false;
 
-        /**
+        /*
          * The servlet spec mandates to ignore request handling time
          * in lastAccessedTime.
          */
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java 
b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
index b9f7148ba0..f342370b48 100644
--- a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
+++ b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
@@ -209,7 +209,7 @@ public class NioReplicationTask extends AbstractRxTask {
         registerForRead(key,reader);//register to read new data, before we 
send it off to avoid dead locks
 
         for (ChannelMessage msg : msgs) {
-            /**
+            /*
              * Use send ack here if you want to ack the request to the remote
              * server before completing the request
              * This is considered an asynchronous request
@@ -226,7 +226,7 @@ public class NioReplicationTask extends AbstractRxTask {
                 }
                 //process the message
                 getCallback().messageDataReceived(msg);
-                /**
+                /*
                  * Use send ack here if you want the request to complete on 
this
                  * server before sending the ack to the remote server
                  * This is considered a synchronized request
diff --git a/java/org/apache/catalina/util/Strftime.java 
b/java/org/apache/catalina/util/Strftime.java
index 82d8dc5712..e54d2a6b64 100644
--- a/java/org/apache/catalina/util/Strftime.java
+++ b/java/org/apache/catalina/util/Strftime.java
@@ -44,7 +44,7 @@ public class Strftime {
     protected static final Properties translate;
     protected final SimpleDateFormat simpleDateFormat;
 
-    /**
+    /*
      * Initialize our pattern translation
      */
     static {
diff --git a/java/org/apache/catalina/valves/rewrite/RewriteRule.java 
b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
index 71b6faa356..e4466d525b 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteRule.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
@@ -272,11 +272,11 @@ public class RewriteRule {
      */
     protected boolean nosubreq = false;
 
-    /**
+    /*
      *  Note: No proxy
      */
 
-    /**
+    /*
      * Note: No passthrough
      */
 
diff --git a/java/org/apache/jasper/JspCompilationContext.java 
b/java/org/apache/jasper/JspCompilationContext.java
index 69381ac7c6..9876c56f93 100644
--- a/java/org/apache/jasper/JspCompilationContext.java
+++ b/java/org/apache/jasper/JspCompilationContext.java
@@ -140,7 +140,7 @@ public class JspCompilationContext {
 
     /* ==================== Methods to override ==================== */
 
-    /** ---------- Class path and loader ---------- */
+    // ---------- Class path and loader ----------
 
     /**
      * @return the classpath that is passed off to the Java compiler.
@@ -189,7 +189,7 @@ public class JspCompilationContext {
     }
 
 
-    /** ---------- Input/Output  ---------- */
+    // ---------- Input/Output  ----------
 
     /**
      * The output directory to generate code into.  The output directory
@@ -257,7 +257,7 @@ public class JspCompilationContext {
         return jspCompiler;
     }
 
-    /** ---------- Access resources in the webapp ---------- */
+    // ---------- Access resources in the webapp ----------
 
     /**
      * Get the full value of a URI relative to this compilations context
diff --git a/java/org/apache/jasper/compiler/Node.java 
b/java/org/apache/jasper/compiler/Node.java
index d138b55f5b..b80221d4c4 100644
--- a/java/org/apache/jasper/compiler/Node.java
+++ b/java/org/apache/jasper/compiler/Node.java
@@ -397,9 +397,6 @@ abstract class Node implements TagConstants {
         }
     }
 
-    
/***************************************************************************
-     * Child classes
-     */
 
     /**
      * Represents the root of a Jsp page or Jsp document
@@ -2012,10 +2009,6 @@ abstract class Node implements TagConstants {
         }
     }
 
-    
/***************************************************************************
-     * Auxiliary classes used in Node
-     */
-
     /**
      * Represents attributes that can be request time expressions.
      *
diff --git a/java/org/apache/jasper/servlet/JasperInitializer.java 
b/java/org/apache/jasper/servlet/JasperInitializer.java
index c23d74e5ee..f444040ffa 100644
--- a/java/org/apache/jasper/servlet/JasperInitializer.java
+++ b/java/org/apache/jasper/servlet/JasperInitializer.java
@@ -43,7 +43,7 @@ public class JasperInitializer implements 
ServletContainerInitializer {
     private static final String MSG = 
"org.apache.jasper.servlet.JasperInitializer";
     private final Log log = LogFactory.getLog(JasperInitializer.class); // 
must not be static
 
-    /**
+    /*
      * Preload classes required at runtime by a JSP servlet so that
      * we don't get a defineClassInPackage security exception.
      */
diff --git a/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java 
b/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
index 8783fe9233..aec7c7b444 100644
--- a/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
+++ b/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
@@ -69,19 +69,19 @@ public final class ClassParser {
      * @throws ClassFormatException if a class is malformed or cannot be 
interpreted as a class file
      */
     public JavaClass parse() throws IOException, ClassFormatException {
-        /****************** Read headers ********************************/
+        //****************** Read headers ********************************
         // Check magic tag of class file
         readID();
         // Get compiler version
         readVersion();
-        /****************** Read constant pool and related **************/
+        //***************** Read constant pool and related **************
         // Read constant pool entries
         readConstantPool();
         // Get class information
         readClassInfo();
         // Get interface information, i.e., implemented interfaces
         readInterfaces();
-        /****************** Read class fields and methods ***************/
+        //***************** Read class fields and methods ***************
         // Read class fields, i.e., the variables of the class
         readFields();
         // Read class methods, i.e., the functions in the class
@@ -198,7 +198,6 @@ public final class ClassParser {
     }
 
 
-    /******************** Private utility methods **********************/
     /**
      * Checks whether the header of the file is ok. Of course, this has to be 
the first action on successive file reads.
      *
diff --git a/java/org/apache/tomcat/util/codec/binary/Base64.java 
b/java/org/apache/tomcat/util/codec/binary/Base64.java
index b8a79fa8d6..dc11167a16 100644
--- a/java/org/apache/tomcat/util/codec/binary/Base64.java
+++ b/java/org/apache/tomcat/util/codec/binary/Base64.java
@@ -121,7 +121,7 @@ public class Base64 extends BaseNCodec {
                 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51                     
 // 70-7a p-z
         };
 
-    /**
+    /*
      * Base64 uses 6-bit fields.
      */
     /** Mask used to extract 6 bits, used when encoding */
diff --git a/java/org/apache/tomcat/util/compat/JreVendor.java 
b/java/org/apache/tomcat/util/compat/JreVendor.java
index 25f5c1c294..caa0823ea8 100644
--- a/java/org/apache/tomcat/util/compat/JreVendor.java
+++ b/java/org/apache/tomcat/util/compat/JreVendor.java
@@ -21,7 +21,7 @@ import java.util.Locale;
 public class JreVendor {
 
     static {
-        /**
+        /*
          * There are a few places where Tomcat either accesses JVM internals
          * (e.g. the memory leak protection) or where feature support varies
          * between JVMs (e.g. SPNEGO). These flags exist to enable Tomcat to
diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index 263a1d0f15..ae94960489 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -24,7 +24,7 @@ import java.util.Enumeration;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.res.StringManager;
 
-/**
+/*
  * This class is used to contain standard internet message headers,
  * used for SMTP (RFC822) and HTTP (RFC2068) messages as well as for
  * MIME (RFC 2045) applications such as transferring typed data and
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java
index ca562ad3c5..2cac5e8324 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/DefaultTestCase.java
@@ -140,7 +140,7 @@ public abstract class DefaultTestCase {
 //        
c3p0.setDriverClass(datasource.getPoolProperties().getDriverClassName());
 //        this.c3p0Datasource = c3p0;
 
-      /**
+      /*
         acquireIncrement
         acquireRetryAttempts
         acquireRetryDelay
diff --git a/res/checkstyle/checkstyle.xml b/res/checkstyle/checkstyle.xml
index ed16bc3fd6..dffad923a9 100644
--- a/res/checkstyle/checkstyle.xml
+++ b/res/checkstyle/checkstyle.xml
@@ -77,6 +77,9 @@
     <module name="RedundantImport"/>
     <module name="UnusedImports"/>
 
+    <!-- Javadoc Comments -->
+    <module name="InvalidJavadocPosition"/>
+
     <!-- Miscellaneous -->
     <!-- ~5500 errors
     <module name="Indentation">


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

Reply via email to