This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit eb97896caa67e84aea11f00509e7f7dfc7dc8049 Author: opencode <[email protected]> AuthorDate: Thu Nov 5 23:52:47 2026 +0100 Fix javadoc warnings Restore the private field comments in PoolProperties, document the DataSourceFactory property-name constants, split the shared Constants comments so each field has its own, and give BaseNamingResourceMBean an explicit documented constructor. ant javadoc now completes with no warnings. --- .../catalina/mbeans/BaseNamingResourceMBean.java | 7 ++++ java/org/apache/tomcat/util/net/Constants.java | 13 +++++- .../apache/tomcat/jdbc/pool/DataSourceFactory.java | 48 ++++++++++++++++++++++ .../apache/tomcat/jdbc/pool/PoolProperties.java | 48 ++++++++++++++++++++++ 4 files changed, 114 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/mbeans/BaseNamingResourceMBean.java b/java/org/apache/catalina/mbeans/BaseNamingResourceMBean.java index 16320e743a..a5d384881c 100644 --- a/java/org/apache/catalina/mbeans/BaseNamingResourceMBean.java +++ b/java/org/apache/catalina/mbeans/BaseNamingResourceMBean.java @@ -29,6 +29,13 @@ import org.apache.tomcat.util.res.StringManager; */ public abstract class BaseNamingResourceMBean<T> extends BaseCatalinaMBean<T> { + /** + * Creates a naming resource MBean. + */ + public BaseNamingResourceMBean() { + // NOOP + } + private static final StringManager sm = StringManager.getManager(BaseNamingResourceMBean.class); diff --git a/java/org/apache/tomcat/util/net/Constants.java b/java/org/apache/tomcat/util/net/Constants.java index 28fb7140f4..46f86db270 100644 --- a/java/org/apache/tomcat/util/net/Constants.java +++ b/java/org/apache/tomcat/util/net/Constants.java @@ -69,9 +69,12 @@ public class Constants { public static final String SSL_PROTO_SSLv2Hello = "SSLv2Hello"; /** - * EKU OIDs. + * Server authentication EKU OID. */ public static final String SERVER_AUTH_EXTENDED_KEY_USAGE_OID = "1.3.6.1.5.5.7.3.1"; + /** + * Any extended key usage OID. + */ public static final String ANY_EXTENDED_KEY_USAGE_OID = "2.5.29.37.0"; /** @@ -80,10 +83,16 @@ public class Constants { public static final String SUNMSCAPI_PROVIDER_NAME = "SunMSCAPI"; /** - * Windows-MY key store types. + * Windows-MY key store type. */ public static final String WINDOWS_MY_KEYSTORE_TYPE = "WINDOWS-MY"; + /** + * Windows-MY key store type for the current user. + */ public static final String WINDOWS_MY_CURRENTUSER_KEYSTORE_TYPE = "WINDOWS-MY-CURRENTUSER"; + /** + * Windows-MY key store type for the local machine. + */ public static final String WINDOWS_MY_LOCALMACHINE_KEYSTORE_TYPE = "WINDOWS-MY-LOCALMACHINE"; /** diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java index 4e49ababd0..02c2f2cedd 100644 --- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java +++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java @@ -70,94 +70,139 @@ public class DataSourceFactory implements ObjectFactory { private static final Log log = LogFactory.getLog(DataSourceFactory.class); + /** The {@code defaultAutoCommit} property name. */ protected static final String PROP_DEFAULTAUTOCOMMIT = "defaultAutoCommit"; + /** The {@code defaultReadOnly} property name. */ protected static final String PROP_DEFAULTREADONLY = "defaultReadOnly"; + /** The {@code defaultTransactionIsolation} property name. */ protected static final String PROP_DEFAULTTRANSACTIONISOLATION = "defaultTransactionIsolation"; + /** The {@code defaultCatalog} property name. */ protected static final String PROP_DEFAULTCATALOG = "defaultCatalog"; + /** The {@code driverClassName} property name. */ protected static final String PROP_DRIVERCLASSNAME = "driverClassName"; + /** The {@code password} property name. */ protected static final String PROP_PASSWORD = "password"; + /** The {@code url} property name. */ protected static final String PROP_URL = "url"; + /** The {@code username} property name. */ protected static final String PROP_USERNAME = "username"; + /** The {@code maxActive} property name. */ protected static final String PROP_MAXACTIVE = "maxActive"; + /** The {@code maxIdle} property name. */ protected static final String PROP_MAXIDLE = "maxIdle"; + /** The {@code minIdle} property name. */ protected static final String PROP_MINIDLE = "minIdle"; + /** The {@code initialSize} property name. */ protected static final String PROP_INITIALSIZE = "initialSize"; + /** The {@code maxWait} property name. */ protected static final String PROP_MAXWAIT = "maxWait"; + /** The {@code maxAge} property name. */ protected static final String PROP_MAXAGE = "maxAge"; + /** The {@code testOnBorrow} property name. */ protected static final String PROP_TESTONBORROW = "testOnBorrow"; + /** The {@code testOnReturn} property name. */ protected static final String PROP_TESTONRETURN = "testOnReturn"; + /** The {@code testWhileIdle} property name. */ protected static final String PROP_TESTWHILEIDLE = "testWhileIdle"; + /** The {@code testOnConnect} property name. */ protected static final String PROP_TESTONCONNECT = "testOnConnect"; + /** The {@code validationQuery} property name. */ protected static final String PROP_VALIDATIONQUERY = "validationQuery"; + /** The {@code validationQueryTimeout} property name. */ protected static final String PROP_VALIDATIONQUERY_TIMEOUT = "validationQueryTimeout"; + /** The {@code validatorClassName} property name. */ protected static final String PROP_VALIDATOR_CLASS_NAME = "validatorClassName"; + /** The {@code numTestsPerEvictionRun} property name. */ protected static final String PROP_NUMTESTSPEREVICTIONRUN = "numTestsPerEvictionRun"; + /** The {@code timeBetweenEvictionRunsMillis} property name. */ protected static final String PROP_TIMEBETWEENEVICTIONRUNSMILLIS = "timeBetweenEvictionRunsMillis"; + /** The {@code minEvictableIdleTimeMillis} property name. */ protected static final String PROP_MINEVICTABLEIDLETIMEMILLIS = "minEvictableIdleTimeMillis"; + /** The {@code accessToUnderlyingConnectionAllowed} property name. */ protected static final String PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED = "accessToUnderlyingConnectionAllowed"; + /** The {@code removeAbandoned} property name. */ protected static final String PROP_REMOVEABANDONED = "removeAbandoned"; + /** The {@code removeAbandonedTimeout} property name. */ protected static final String PROP_REMOVEABANDONEDTIMEOUT = "removeAbandonedTimeout"; + /** The {@code logAbandoned} property name. */ protected static final String PROP_LOGABANDONED = "logAbandoned"; + /** The {@code abandonWhenPercentageFull} property name. */ protected static final String PROP_ABANDONWHENPERCENTAGEFULL = "abandonWhenPercentageFull"; + /** The {@code poolPreparedStatements} property name. */ protected static final String PROP_POOLPREPAREDSTATEMENTS = "poolPreparedStatements"; + /** The {@code maxOpenPreparedStatements} property name. */ protected static final String PROP_MAXOPENPREPAREDSTATEMENTS = "maxOpenPreparedStatements"; + /** The {@code connectionProperties} property name. */ protected static final String PROP_CONNECTIONPROPERTIES = "connectionProperties"; + /** The {@code initSQL} property name. */ protected static final String PROP_INITSQL = "initSQL"; + /** The {@code jdbcInterceptors} property name. */ protected static final String PROP_INTERCEPTORS = "jdbcInterceptors"; + /** The {@code validationInterval} property name. */ protected static final String PROP_VALIDATIONINTERVAL = "validationInterval"; + /** The {@code jmxEnabled} property name. */ protected static final String PROP_JMX_ENABLED = "jmxEnabled"; + /** The {@code fairQueue} property name. */ protected static final String PROP_FAIR_QUEUE = "fairQueue"; + /** The {@code useEquals} property name. */ protected static final String PROP_USE_EQUALS = "useEquals"; + /** The {@code useLock} property name. */ protected static final String PROP_USE_LOCK = "useLock"; + /** The {@code dataSource} property name. */ protected static final String PROP_DATASOURCE = "dataSource"; + /** The {@code dataSourceJNDI} property name. */ protected static final String PROP_DATASOURCE_JNDI = "dataSourceJNDI"; + /** The {@code suspectTimeout} property name. */ protected static final String PROP_SUSPECT_TIMEOUT = "suspectTimeout"; + /** The {@code alternateUsernameAllowed} property name. */ protected static final String PROP_ALTERNATE_USERNAME_ALLOWED = "alternateUsernameAllowed"; + /** The {@code commitOnReturn} property name. */ protected static final String PROP_COMMITONRETURN = "commitOnReturn"; + /** The {@code rollbackOnReturn} property name. */ protected static final String PROP_ROLLBACKONRETURN = "rollbackOnReturn"; /** @@ -166,10 +211,13 @@ public class DataSourceFactory implements ObjectFactory { */ protected static final String PROP_USEDISPOSABLECONNECTIONFACADE = "useDisposableConnectionFacade"; + /** The {@code logValidationErrors} property name. */ protected static final String PROP_LOGVALIDATIONERRORS = "logValidationErrors"; + /** The {@code propagateInterruptState} property name. */ protected static final String PROP_PROPAGATEINTERRUPTSTATE = "propagateInterruptState"; + /** The {@code ignoreExceptionOnPreLoad} property name. */ protected static final String PROP_IGNOREEXCEPTIONONPRELOAD = "ignoreExceptionOnPreLoad"; /** diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java index 8acabf67b0..dc0f8082fd 100644 --- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java +++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java @@ -74,18 +74,29 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl * Counter for tracking the number of pools created. */ protected static final AtomicInteger poolCounter = new AtomicInteger(0); + /** Database-specific properties. */ private volatile Properties dbProperties = new Properties(); + /** The JDBC connection URL. */ private volatile String url = null; + /** The JDBC driver class name. */ private volatile String driverClassName = null; + /** The default auto-commit setting for connections. */ private volatile Boolean defaultAutoCommit = null; + /** The default read-only setting for connections. */ private volatile Boolean defaultReadOnly = null; + /** The default transaction isolation level. */ private volatile int defaultTransactionIsolation = DataSourceFactory.UNKNOWN_TRANSACTIONISOLATION; + /** The default catalog for connections. */ private volatile String defaultCatalog = null; + /** Additional connection properties. */ private volatile String connectionProperties; /** Keys the last parse of {@link #connectionProperties} contributed to {@link #dbProperties}. */ private volatile Set<String> connectionPropertyKeys = Collections.emptySet(); + /** The initial number of connections in the pool. */ private volatile int initialSize = 10; + /** The maximum number of active connections. */ private volatile int maxActive = DEFAULT_MAX_ACTIVE; + /** The maximum number of idle connections. */ private volatile int maxIdle = maxActive; /** * The minimum number of idle connections, initialized once from @@ -93,20 +104,35 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl * {@code initialSize} does not move it. */ private volatile int minIdle = initialSize; + /** The maximum wait time in milliseconds for a connection. */ private volatile int maxWait = 30000; + /** The SQL query used for validation. */ private volatile String validationQuery; + /** The validation query timeout in seconds. */ private volatile int validationQueryTimeout = -1; + /** The fully qualified class name of the validator. */ private volatile String validatorClassName; + /** The validator instance. */ private transient volatile Validator validator; + /** Whether to validate connections on borrow. */ private volatile boolean testOnBorrow = false; + /** Whether to validate connections on return. */ private volatile boolean testOnReturn = false; + /** Whether to validate idle connections. */ private volatile boolean testWhileIdle = false; + /** The time between eviction runs in milliseconds. */ private volatile int timeBetweenEvictionRunsMillis = 5000; + /** The number of connections to test per eviction run. */ private volatile int numTestsPerEvictionRun; + /** The minimum idle time before a connection is eligible for eviction. */ private volatile int minEvictableIdleTimeMillis = 60000; + /** Whether to allow access to the underlying connection. */ private volatile boolean accessToUnderlyingConnectionAllowed = true; + /** Whether to remove abandoned connections. */ private volatile boolean removeAbandoned = false; + /** The timeout in seconds for abandoned connection removal. */ private volatile int removeAbandonedTimeout = 60; + /** Whether to log abandoned connections. */ private volatile boolean logAbandoned = false; /** * The pool name. This default is the fallback for a pool nobody named: a @@ -119,24 +145,43 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl * is not in the name any more. */ private volatile String name = "Tomcat Connection Pool[" + (poolCounter.addAndGet(1)) + "]"; + /** The database password. */ private volatile String password; + /** The database username. */ private volatile String username; + /** The validation interval in milliseconds. */ private volatile long validationInterval = 3000; + /** Whether JMX registration is enabled. */ private volatile boolean jmxEnabled = true; + /** The SQL to execute on connection creation. */ private volatile String initSQL; + /** Whether to validate connections on creation. */ private volatile boolean testOnConnect = false; + /** The JDBC interceptors configuration. */ private volatile String jdbcInterceptors = null; + /** Whether to use a fair queue for connection requests. */ private volatile boolean fairQueue = true; + /** Whether to use equals for object comparison. */ private volatile boolean useEquals = true; + /** The percentage threshold for abandoning connections. */ private volatile int abandonWhenPercentageFull = 0; + /** The maximum age of a connection in milliseconds. */ private volatile long maxAge = 0; + /** Whether to use locking for thread safety. */ private volatile boolean useLock = false; + /** The interceptor definitions. */ private volatile InterceptorDefinition[] interceptors = null; + /** The suspect timeout in seconds. */ private volatile int suspectTimeout = 0; + /** The underlying data source. */ private volatile Object dataSource = null; + /** The JNDI name of the data source. */ private volatile String dataSourceJNDI = null; + /** Whether alternate usernames are allowed. */ private volatile boolean alternateUsernameAllowed = false; + /** Whether to commit on connection return. */ private volatile boolean commitOnReturn = false; + /** Whether to rollback on connection return. */ private volatile boolean rollbackOnReturn = false; /** * Whether to use a disposable connection facade. @@ -145,8 +190,11 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl */ @Deprecated private volatile boolean useDisposableConnectionFacade = true; + /** Whether to log validation errors. */ private volatile boolean logValidationErrors = false; + /** Whether to propagate interrupt state. */ private volatile boolean propagateInterruptState = false; + /** Whether to ignore exceptions during pre-load. */ private volatile boolean ignoreExceptionOnPreLoad = false; /** * Whether to use a statement facade. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
