You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/05/07 12:19:24 UTC
(tomcat) branch main updated: Remove files added by accident
This is an automated email from the ASF dual-hosted git repository.
rmaucher 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 c82605530a Remove files added by accident
c82605530a is described below
commit c82605530a1ff3a76733d2a5720dd8bbd8b6e8ae
Author: remm <re...@apache.org>
AuthorDate: Thu May 7 14:19:12 2026 +0200
Remove files added by accident
---
java/org/apache/tomcat/util/net/BioChannel.java | 288 -
java/org/apache/tomcat/util/net/BioEndpoint.java | 1009 --
javadoc_deprecated3.patch | 14490 ---------------------
test/webapp/index2.html.en | 24 -
test/webapp/index2.html.fr | 24 -
5 files changed, 15835 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/BioChannel.java b/java/org/apache/tomcat/util/net/BioChannel.java
deleted file mode 100644
index b3f36c79a3..0000000000
--- a/java/org/apache/tomcat/util/net/BioChannel.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tomcat.util.net;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.nio.channels.ByteChannel;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.GatheringByteChannel;
-import java.nio.channels.ScatteringByteChannel;
-
-import org.apache.tomcat.util.net.BioEndpoint.BioSocketWrapper;
-import org.apache.tomcat.util.res.StringManager;
-
-/**
- * Base class for a SocketChannel wrapper used by the endpoint.
- * This way, logic for an SSL socket channel remains the same as for
- * a non SSL, making sure we don't need to code for any exception cases.
- */
-public class BioChannel implements ByteChannel, ScatteringByteChannel, GatheringByteChannel {
-
- protected static final StringManager sm = StringManager.getManager(BioChannel.class);
-
- protected static final ByteBuffer emptyBuf = ByteBuffer.allocate(0);
-
- protected final SocketBufferHandler bufHandler;
- protected Socket sc = null;
- protected BioSocketWrapper socketWrapper = null;
-
- public BioChannel(SocketBufferHandler bufHandler) {
- this.bufHandler = bufHandler;
- }
-
- /**
- * Reset the channel
- *
- * @param socket the socket
- * @param socketWrapper the socket wrapper
- * @throws IOException If a problem was encountered resetting the channel
- */
- public void reset(Socket socket, BioSocketWrapper socketWrapper) throws IOException {
- this.sc = socket;
- this.socketWrapper = socketWrapper;
- bufHandler.reset();
- }
-
- /**
- * @return the socketWrapper
- */
- BioSocketWrapper getSocketWrapper() {
- return socketWrapper;
- }
-
- /**
- * Free the channel memory
- */
- public void free() {
- bufHandler.free();
- }
-
- /**
- * Closes this channel.
- *
- * @throws IOException If an I/O error occurs
- */
- @Override
- public void close() throws IOException {
- sc.close();
- }
-
- /**
- * Close the connection.
- *
- * @param force Should the underlying socket be forcibly closed?
- * @throws IOException If closing the secure channel fails.
- */
- public void close(boolean force) throws IOException {
- if (isOpen() || force) {
- close();
- }
- }
-
- /**
- * Tells whether or not this channel is open.
- *
- * @return <code>true</code> if, and only if, this channel is open
- */
- @Override
- public boolean isOpen() {
- return !sc.isClosed();
- }
-
- /**
- * Writes a sequence of bytes to this channel from the given buffer.
- *
- * @param src The buffer from which bytes are to be retrieved
- * @return The number of bytes written, possibly zero
- * @throws IOException If some other I/O error occurs
- */
- @Override
- public int write(ByteBuffer src) throws IOException {
- checkInterruptStatus();
- if (!src.hasRemaining()) {
- // Nothing left to write
- return 0;
- }
- int len = src.remaining();
- sc.getOutputStream().write(src.array(), src.position(), src.remaining());
- return len;
- }
-
- @Override
- public long write(ByteBuffer[] srcs) throws IOException {
- return write(srcs, 0, srcs.length);
- }
-
- @Override
- public long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException {
- checkInterruptStatus();
- long n = 0;
- for (int i = 0; i < length; i++) {
- n += write(srcs[i + offset]);
- }
- return n;
- }
-
- /**
- * Reads a sequence of bytes from this channel into the given buffer.
- *
- * @param dst The buffer into which bytes are to be transferred
- * @return The number of bytes read, possibly zero, or <code>-1</code> if
- * the channel has reached end-of-stream
- * @throws IOException If some other I/O error occurs
- */
- @Override
- public int read(ByteBuffer dst) throws IOException {
- return sc.getInputStream().read(dst.array(), dst.position(), dst.remaining());
- }
-
- @Override
- public long read(ByteBuffer[] dsts) throws IOException {
- return read(dsts, 0, dsts.length);
- }
-
- @Override
- public long read(ByteBuffer[] dsts, int offset, int length)
- throws IOException {
- // TODO
- return read(dsts[offset]);
- }
-
- public SocketBufferHandler getBufHandler() {
- return bufHandler;
- }
-
- public Socket getIOChannel() {
- return sc;
- }
-
- public boolean isClosing() {
- return false;
- }
-
- public boolean isHandshakeComplete() {
- return true;
- }
-
- /**
- * Performs SSL handshake hence is a no-op for the non-secure
- * implementation.
- *
- * @param read Unused in non-secure implementation
- * @param write Unused in non-secure implementation
- * @return Always returns zero
- * @throws IOException Never for non-secure channel
- */
- public int handshake(boolean read, boolean write) throws IOException {
- return 0;
- }
-
- @Override
- public String toString() {
- return super.toString() + ":" + sc;
- }
-
- public int getOutboundRemaining() {
- return 0;
- }
-
- /**
- * Return true if the buffer wrote data. NO-OP for non-secure channel.
- *
- * @return Always returns {@code false} for non-secure channel
- * @throws IOException Never for non-secure channel
- */
- public boolean flushOutbound() throws IOException {
- return false;
- }
-
- /**
- * This method should be used to check the interrupt status before
- * attempting a write.
- *
- * If a thread has been interrupted and the interrupt has not been cleared
- * then an attempt to write to the socket will fail. When this happens the
- * socket is removed from the poller without the socket being selected. This
- * results in a connection limit leak for NIO as the endpoint expects the
- * socket to be selected even in error conditions.
- *
- * @throws IOException If the current thread was interrupted
- */
- protected void checkInterruptStatus() throws IOException {
- if (Thread.interrupted()) {
- throw new IOException(sm.getString("channel.nio.interrupted"));
- }
- }
-
- private ApplicationBufferHandler appReadBufHandler;
- public void setAppReadBufHandler(ApplicationBufferHandler handler) {
- this.appReadBufHandler = handler;
- }
- protected ApplicationBufferHandler getAppReadBufHandler() {
- return appReadBufHandler;
- }
-
- static final BioChannel CLOSED_BIO_CHANNEL = new BioChannel(SocketBufferHandler.EMPTY) {
- @Override
- public void close() throws IOException {
- }
- @Override
- public boolean isOpen() {
- return false;
- }
- @Override
- public void reset(Socket socket, BioSocketWrapper socketWrapper) throws IOException {
- }
- @Override
- public void free() {
- }
- @Override
- protected ApplicationBufferHandler getAppReadBufHandler() {
- return ApplicationBufferHandler.EMPTY;
- }
- @Override
- public void setAppReadBufHandler(ApplicationBufferHandler handler) {
- }
- @Override
- public int read(ByteBuffer dst) throws IOException {
- return -1;
- }
- @Override
- public long read(ByteBuffer[] dsts, int offset, int length)
- throws IOException {
- return -1L;
- }
- @Override
- public int write(ByteBuffer src) throws IOException {
- checkInterruptStatus();
- throw new ClosedChannelException();
- }
- @Override
- public long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException {
- throw new ClosedChannelException();
- }
- @Override
- public String toString() {
- return "Closed NioChannel";
- }
- };
-
-}
diff --git a/java/org/apache/tomcat/util/net/BioEndpoint.java b/java/org/apache/tomcat/util/net/BioEndpoint.java
deleted file mode 100644
index b9cab56ab1..0000000000
--- a/java/org/apache/tomcat/util/net/BioEndpoint.java
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tomcat.util.net;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.SocketTimeoutException;
-import java.nio.ByteBuffer;
-import java.nio.channels.CancelledKeyException;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.CompletionHandler;
-import java.nio.channels.FileChannel;
-import java.nio.channels.SelectionKey;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.juli.logging.Log;
-import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.ExceptionUtils;
-import org.apache.tomcat.util.collections.SynchronizedStack;
-import org.apache.tomcat.util.compat.JrePlatform;
-import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
-
-/**
- * BIO endpoint.
- */
-public class BioEndpoint extends AbstractEndpoint<BioChannel,Socket> {
-
-
- // -------------------------------------------------------------- Constants
-
-
- private static final Log log = LogFactory.getLog(BioEndpoint.class);
- private static final Log logCertificate = LogFactory.getLog(BioEndpoint.class.getName() + ".certificate");
- private static final Log logHandshake = LogFactory.getLog(BioEndpoint.class.getName() + ".handshake");
-
-
- // ----------------------------------------------------------------- Fields
-
- /**
- * Server socket "pointer".
- */
- private volatile ServerSocket serverSock = null;
-
- /**
- * Stop latch used to wait for poller stop
- */
- private volatile CountDownLatch stopLatch = null;
-
- /**
- * Bytebuffer cache, each channel holds a set of buffers (two, except for SSL holds four)
- */
- private SynchronizedStack<BioChannel> bioChannels;
-
- private SocketAddress previousAcceptedSocketRemoteAddress = null;
- private long previousAcceptedSocketNanoTime = 0;
-
-
- // ------------------------------------------------------------- Properties
-
-
- /**
- * Priority of the poller thread.
- */
- private int pollerThreadPriority = Thread.NORM_PRIORITY;
- public void setPollerThreadPriority(int pollerThreadPriority) { this.pollerThreadPriority = pollerThreadPriority; }
- public int getPollerThreadPriority() { return pollerThreadPriority; }
-
-
- private long selectorTimeout = 1000;
- public void setSelectorTimeout(long timeout) { this.selectorTimeout = timeout;}
- public long getSelectorTimeout() { return this.selectorTimeout; }
-
-
- // --------------------------------------------------------- Public Methods
-
- /**
- * Number of keep-alive sockets.
- *
- * @return The number of sockets currently in the keep-alive state waiting
- * for the next request to be received on the socket
- */
- public int getKeepAliveCount() {
- // TODO
- return 0;
- }
-
-
- // ----------------------------------------------- Public Lifecycle Methods
-
- /**
- * Initialize the endpoint.
- */
- @Override
- public void bind() throws Exception {
- initServerSocket();
-
- setStopLatch(new CountDownLatch(1));
-
- // Initialize SSL if needed
- initialiseSsl();
- }
-
- // Separated out to make it easier for folks that extend BioEndpoint to
- // implement custom [server]sockets
- protected void initServerSocket() throws Exception {
- serverSock = new ServerSocket();
- socketProperties.setProperties(serverSock);
- InetSocketAddress addr = new InetSocketAddress(getAddress(), getPortWithOffset());
- serverSock.bind(addr, getAcceptCount());
- }
-
-
- /**
- * Start the NIO endpoint, creating acceptor, poller threads.
- */
- @Override
- public void startInternal() throws Exception {
-
- if (!running) {
- running = true;
- paused = false;
-
- if (socketProperties.getProcessorCache() != 0) {
- processorCache = new SynchronizedStack<>(SynchronizedStack.DEFAULT_SIZE,
- socketProperties.getProcessorCache());
- }
- int actualBufferPool =
- socketProperties.getActualBufferPool(isSSLEnabled() ? getSniParseLimit() * 2 : 0);
- if (actualBufferPool != 0) {
- bioChannels = new SynchronizedStack<>(SynchronizedStack.DEFAULT_SIZE,
- actualBufferPool);
- }
-
- // Create worker collection
- if (getExecutor() == null) {
- createExecutor();
- }
-
- initializeConnectionLatch();
-
- startAcceptorThread();
- }
- }
-
-
- /**
- * Stop the endpoint. This will cause all processing threads to stop.
- */
- @Override
- public void stopInternal() {
- if (!paused) {
- pause();
- }
- if (running) {
- running = false;
- /*
- * Need to wait for the acceptor to unlock but not too long. 100ms plus twice the unlock timeout should be
- * plenty of time for the acceptor to unlock without being an excessively long wait if the unlock fails.
- */
- int acceptorWaitMilliSeconds = 100 + 2 * getSocketProperties().getUnlockTimeout();
- acceptor.stopMillis(acceptorWaitMilliSeconds);
- try {
- if (!getStopLatch().await(selectorTimeout + 100, TimeUnit.MILLISECONDS)) {
- log.warn(sm.getString("endpoint.nio.stopLatchAwaitFail"));
- }
- } catch (InterruptedException e) {
- log.warn(sm.getString("endpoint.nio.stopLatchAwaitInterrupted"), e);
- }
- shutdownExecutor();
- if (bioChannels != null) {
- BioChannel socket;
- while ((socket = bioChannels.pop()) != null) {
- socket.free();
- }
- bioChannels = null;
- }
- if (processorCache != null) {
- processorCache.clear();
- processorCache = null;
- }
- }
- }
-
-
- /**
- * Deallocate NIO memory pools, and close server socket.
- */
- @Override
- public void unbind() throws Exception {
- if (log.isTraceEnabled()) {
- log.trace("Destroy initiated for " +
- new InetSocketAddress(getAddress(),getPortWithOffset()));
- }
- if (running) {
- stop();
- }
- try {
- doCloseServerSocket();
- } catch (IOException ioe) {
- getLog().warn(sm.getString("endpoint.serverSocket.closeFailed", getName()), ioe);
- }
- destroySsl();
- super.unbind();
- if (getHandler() != null ) {
- getHandler().recycle();
- }
- if (log.isTraceEnabled()) {
- log.trace("Destroy completed for " +
- new InetSocketAddress(getAddress(), getPortWithOffset()));
- }
- }
-
-
- @Override
- protected void doCloseServerSocket() throws IOException {
- serverSock.close();
- serverSock = null;
- }
-
-
- // ------------------------------------------------------ Protected Methods
-
-
- @Override
- protected final InetSocketAddress getLocalAddress() throws IOException {
- if (serverSock == null) {
- return null;
- }
- SocketAddress sa = serverSock.getLocalSocketAddress();
- if (sa instanceof InetSocketAddress) {
- return (InetSocketAddress) sa;
- }
- return null;
- }
-
-
- protected SynchronizedStack<BioChannel> getBioChannels() {
- return bioChannels;
- }
-
-
- protected CountDownLatch getStopLatch() {
- return stopLatch;
- }
-
-
- protected void setStopLatch(CountDownLatch stopLatch) {
- this.stopLatch = stopLatch;
- }
-
-
- /**
- * Process the specified connection.
- * @param socket The socket channel
- * @return <code>true</code> if the socket was correctly configured
- * and processing may continue, <code>false</code> if the socket needs to be
- * close immediately
- */
- @Override
- protected boolean setSocketOptions(Socket socket) {
- BioSocketWrapper socketWrapper = null;
- try {
- // Allocate channel and wrapper
- BioChannel channel = null;
- if (bioChannels != null) {
- channel = bioChannels.pop();
- }
- if (channel == null) {
- SocketBufferHandler bufhandler = new SocketBufferHandler(
- socketProperties.getAppReadBufSize(),
- socketProperties.getAppWriteBufSize(),
- socketProperties.getDirectBuffer());
- channel = createChannel(bufhandler);
- }
- BioSocketWrapper newWrapper = new BioSocketWrapper(channel, this);
- channel.reset(socket, newWrapper);
- connections.put(socket, newWrapper);
- socketWrapper = newWrapper;
-
- // Set socket properties
- // Disable blocking, polling will be used
- socketProperties.setProperties(socket);
-
- socketWrapper.setReadTimeout(getConnectionTimeout());
- socketWrapper.setWriteTimeout(getConnectionTimeout());
- socketWrapper.setKeepAliveLeft(BioEndpoint.this.getMaxKeepAliveRequests());
- // TODO: Start reading
- return true;
- } catch (Throwable t) {
- ExceptionUtils.handleThrowable(t);
- try {
- log.error(sm.getString("endpoint.socketOptionsError"), t);
- } catch (Throwable tt) {
- ExceptionUtils.handleThrowable(tt);
- }
- if (socketWrapper == null) {
- destroySocket(socket);
- }
- }
- // Tell to close the socket if needed
- return false;
- }
-
-
- @Override
- protected void destroySocket(Socket socket) {
- countDownConnection();
- try {
- socket.close();
- } catch (IOException ioe) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("endpoint.err.close"), ioe);
- }
- }
- }
-
-
- @Override
- protected Socket serverSocketAccept() throws Exception {
- Socket result = serverSock.accept();
-
- // Bug does not affect Windows platform and Unix Domain Socket. Skip the check.
- if (!JrePlatform.IS_WINDOWS) {
- SocketAddress currentRemoteAddress = result.getRemoteSocketAddress();
- long currentNanoTime = System.nanoTime();
- if (currentRemoteAddress.equals(previousAcceptedSocketRemoteAddress) &&
- currentNanoTime - previousAcceptedSocketNanoTime < 1000) {
- throw new IOException(sm.getString("endpoint.err.duplicateAccept"));
- }
- previousAcceptedSocketRemoteAddress = currentRemoteAddress;
- previousAcceptedSocketNanoTime = currentNanoTime;
- }
-
- return result;
- }
-
-
- @Override
- protected Log getLog() {
- return log;
- }
-
-
- @Override
- protected Log getLogCertificate() {
- return logCertificate;
- }
-
-
- @Override
- protected SocketProcessorBase<BioChannel> createSocketProcessor(
- SocketWrapperBase<BioChannel> socketWrapper, SocketEvent event) {
- return new SocketProcessor(socketWrapper, event);
- }
-
- protected BioChannel createChannel(SocketBufferHandler buffer) {
- /*if (isSSLEnabled()) {
- return new SecureBioChannel(buffer, this);
- }*/
- // TODO TLS support
- return new BioChannel(buffer);
- }
-
- // --------------------------------------------------- Socket Wrapper Class
-
- public static class BioSocketWrapper extends SocketWrapperBase<BioChannel> {
-
- private final SynchronizedStack<BioChannel> bioChannels;
-
- private int interestOps = 0;
- private volatile SendfileData sendfileData = null;
- private volatile long lastRead = System.currentTimeMillis();
- private volatile long lastWrite = lastRead;
-
- private final Object readLock;
- private volatile boolean readNonBlocking = false;
- private final Object writeLock;
- private volatile boolean writeNonBlocking = false;
-
- public BioSocketWrapper(BioChannel channel, BioEndpoint endpoint) {
- super(channel, endpoint);
- bioChannels = endpoint.getBioChannels();
- socketBufferHandler = channel.getBufHandler();
- readLock = (readPending == null) ? new Object() : readPending;
- writeLock = (writePending == null) ? new Object() : writePending;
- }
-
- public int interestOps() { return interestOps; }
- public int interestOps(int ops) { this.interestOps = ops; return ops; }
- public boolean interestOpsHas(int targetOp) {
- return (this.interestOps() & targetOp) == targetOp;
- }
-
- public void setSendfileData(SendfileData sf) { this.sendfileData = sf;}
- public SendfileData getSendfileData() { return this.sendfileData; }
-
- public void updateLastWrite() { lastWrite = System.currentTimeMillis(); }
- public long getLastWrite() { return lastWrite; }
- public void updateLastRead() { lastRead = System.currentTimeMillis(); }
- public long getLastRead() { return lastRead; }
-
- @Override
- public boolean needSemaphores() {
- return true;
- }
-
- @Override
- public boolean isReadyForRead() throws IOException {
- socketBufferHandler.configureReadBufferForRead();
-
- if (socketBufferHandler.getReadBuffer().remaining() > 0) {
- return true;
- }
-
- fillReadBuffer(false);
-
- boolean isReady = socketBufferHandler.getReadBuffer().position() > 0;
- return isReady;
- }
-
-
- @Override
- public int read(boolean block, byte[] b, int off, int len) throws IOException {
- int nRead = populateReadBuffer(b, off, len);
- if (nRead > 0) {
- return nRead;
- /*
- * Since more bytes may have arrived since the buffer was last
- * filled, it is an option at this point to perform a
- * non-blocking read. However correctly handling the case if
- * that read returns end of stream adds complexity. Therefore,
- * at the moment, the preference is for simplicity.
- */
- }
-
- // Fill the read buffer as best we can.
- nRead = fillReadBuffer(block);
- updateLastRead();
-
- // Fill as much of the remaining byte array as possible with the
- // data that was just read
- if (nRead > 0) {
- socketBufferHandler.configureReadBufferForRead();
- nRead = Math.min(nRead, len);
- socketBufferHandler.getReadBuffer().get(b, off, nRead);
- }
- return nRead;
- }
-
-
- @Override
- public int read(boolean block, ByteBuffer to) throws IOException {
- int nRead = populateReadBuffer(to);
- if (nRead > 0) {
- return nRead;
- /*
- * Since more bytes may have arrived since the buffer was last
- * filled, it is an option at this point to perform a
- * non-blocking read. However correctly handling the case if
- * that read returns end of stream adds complexity. Therefore,
- * at the moment, the preference is for simplicity.
- */
- }
-
- // The socket read buffer capacity is socket.appReadBufSize
- int limit = socketBufferHandler.getReadBuffer().capacity();
- if (to.remaining() >= limit) {
- to.limit(to.position() + limit);
- nRead = fillReadBuffer(block, to);
- if (log.isTraceEnabled()) {
- log.trace("Socket: [" + this + "], Read direct from socket: [" + nRead + "]");
- }
- updateLastRead();
- } else {
- // Fill the read buffer as best we can.
- nRead = fillReadBuffer(block);
- if (log.isTraceEnabled()) {
- log.trace("Socket: [" + this + "], Read into buffer: [" + nRead + "]");
- }
- updateLastRead();
-
- // Fill as much of the remaining byte array as possible with the
- // data that was just read
- if (nRead > 0) {
- nRead = populateReadBuffer(to);
- }
- }
- return nRead;
- }
-
-
- @Override
- protected void doClose() {
- if (log.isTraceEnabled()) {
- log.trace("Calling [" + getEndpoint() + "].closeSocket([" + this + "])");
- }
- try {
- getEndpoint().connections.remove(getSocket().getIOChannel());
- if (getSocket().isOpen()) {
- getSocket().close(true);
- }
- if (getEndpoint().running) {
- if (bioChannels == null || !bioChannels.push(getSocket())) {
- getSocket().free();
- }
- }
- } catch (Throwable e) {
- ExceptionUtils.handleThrowable(e);
- if (log.isDebugEnabled()) {
- log.error(sm.getString("endpoint.debug.channelCloseFail"), e);
- }
- } finally {
- socketBufferHandler = SocketBufferHandler.EMPTY;
- nonBlockingWriteBuffer.clear();
- reset(BioChannel.CLOSED_BIO_CHANNEL);
- }
- try {
- SendfileData data = getSendfileData();
- if (data != null && data.fchannel != null && data.fchannel.isOpen()) {
- data.fchannel.close();
- }
- } catch (Throwable e) {
- ExceptionUtils.handleThrowable(e);
- if (log.isDebugEnabled()) {
- log.error(sm.getString("endpoint.sendfile.closeError"), e);
- }
- }
- }
-
- private int fillReadBuffer(boolean block) throws IOException {
- socketBufferHandler.configureReadBufferForWrite();
- return fillReadBuffer(block, socketBufferHandler.getReadBuffer());
- }
-
-
- private int fillReadBuffer(boolean block, ByteBuffer buffer) throws IOException {
- int n = 0;
- if (getSocket() == BioChannel.CLOSED_BIO_CHANNEL) {
- throw new ClosedChannelException();
- }
- if (block) {
- // TODO: Timeout ? long timeout = getReadTimeout();
- n = getSocket().read(buffer);
- if (n < 0) {
- throw new EOFException();
- }
- } else {
- registerReadInterest();
- }
- return n;
- }
-
-
- @Override
- protected boolean flushNonBlocking() throws IOException {
- boolean dataLeft = socketOrNetworkBufferHasDataLeft();
-
- // Write to the socket, if there is anything to write
- if (dataLeft) {
- doWrite(false);
- dataLeft = socketOrNetworkBufferHasDataLeft();
- }
-
- if (!dataLeft && !nonBlockingWriteBuffer.isEmpty()) {
- dataLeft = nonBlockingWriteBuffer.write(this, false);
-
- if (!dataLeft && socketOrNetworkBufferHasDataLeft()) {
- doWrite(false);
- dataLeft = socketOrNetworkBufferHasDataLeft();
- }
- }
-
- return dataLeft;
- }
-
-
- /*
- * https://bz.apache.org/bugzilla/show_bug.cgi?id=66076
- *
- * When using TLS an additional buffer is used for the encrypted data
- * before it is written to the network. It is possible for this network
- * output buffer to contain data while the socket write buffer is empty.
- *
- * For NIO with non-blocking I/O, this case is handling by ensuring that
- * flush only returns false (i.e. no data left to flush) if all buffers
- * are empty.
- */
- private boolean socketOrNetworkBufferHasDataLeft() {
- return !socketBufferHandler.isWriteBufferEmpty() || getSocket().getOutboundRemaining() > 0;
- }
-
-
- @Override
- protected void doWrite(boolean block, ByteBuffer buffer) throws IOException {
- int n = 0;
- if (getSocket() == BioChannel.CLOSED_BIO_CHANNEL) {
- throw new ClosedChannelException();
- }
- if (block) {
- if (previousIOException != null) {
- /*
- * Socket has previously timed out.
- *
- * Blocking writes assume that buffer is always fully
- * written so there is no code checking for incomplete
- * writes, retaining the unwritten data and attempting to
- * write it as part of a subsequent write call.
- *
- * Because of the above, when a timeout is triggered we need
- * to skip subsequent attempts to write as otherwise it will
- * appear to the client as if some data was dropped just
- * before the connection is lost. It is better if the client
- * just sees the dropped connection.
- */
- throw new IOException(previousIOException);
- }
- long timeout = getWriteTimeout();
- long startNanos = 0;
- do {
- if (startNanos > 0) {
- long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
- if (elapsedMillis == 0) {
- elapsedMillis = 1;
- }
- timeout -= elapsedMillis;
- if (timeout <= 0) {
- previousIOException = new SocketTimeoutException();
- throw previousIOException;
- }
- }
- n = getSocket().write(buffer);
- } while (buffer.hasRemaining() || getSocket().getOutboundRemaining() > 0);
- } else {
- registerWriteInterest();
- }
- updateLastWrite();
- }
-
-
- @Override
- public void registerReadInterest() {
- if (log.isTraceEnabled()) {
- log.trace(sm.getString("endpoint.debug.registerRead", this));
- }
- // TODO: start async blocking read operation
- }
-
-
- @Override
- public void registerWriteInterest() {
- if (log.isTraceEnabled()) {
- log.trace(sm.getString("endpoint.debug.registerWrite", this));
- }
- // TODO: start async blocking write operation
- }
-
-
- @Override
- public SendfileDataBase createSendfileData(String filename, long pos, long length) {
- return new SendfileData(filename, pos, length);
- }
-
-
- @Override
- public SendfileState processSendfile(SendfileDataBase sendfileData) {
- setSendfileData((SendfileData) sendfileData);
- // TODO: start async blocking sendfile operation
- return SendfileState.ERROR;
- }
-
-
- @Override
- protected void populateRemoteAddr() {
- Socket sc = getSocket().getIOChannel();
- if (sc != null) {
- InetAddress inetAddr = sc.getInetAddress();
- if (inetAddr != null) {
- remoteAddr = inetAddr.getHostAddress();
- }
- }
- }
-
-
- @Override
- protected void populateRemoteHost() {
- Socket sc = getSocket().getIOChannel();
- if (sc != null) {
- InetAddress inetAddr = sc.getInetAddress();
- if (inetAddr != null) {
- remoteHost = inetAddr.getHostName();
- if (remoteAddr == null) {
- remoteAddr = inetAddr.getHostAddress();
- }
- }
- }
- }
-
-
- @Override
- protected void populateRemotePort() {
- Socket sc = getSocket().getIOChannel();
- if (sc != null) {
- remotePort = sc.getPort();
- }
- }
-
-
- @Override
- protected void populateLocalName() {
- Socket sc = getSocket().getIOChannel();
- if (sc != null) {
- InetAddress inetAddr = sc.getLocalAddress();
- if (inetAddr != null) {
- localName = inetAddr.getHostName();
- }
- }
- }
-
-
- @Override
- protected void populateLocalAddr() {
- Socket sc = getSocket().getIOChannel();
- if (sc != null) {
- InetAddress inetAddr = sc.getLocalAddress();
- if (inetAddr != null) {
- localAddr = inetAddr.getHostAddress();
- }
- }
- }
-
-
- @Override
- protected void populateLocalPort() {
- Socket sc = getSocket().getIOChannel();
- if (sc != null) {
- localPort = sc.getLocalPort();
- }
- }
-
-
- @Override
- public SSLSupport getSslSupport() {
- // TODO
- return null;
- }
-
-
- @Override
- public void doClientAuth(SSLSupport sslSupport) throws IOException {
- // TODO
- /*SecureNioChannel sslChannel = (SecureNioChannel) getSocket();
- SSLEngine engine = sslChannel.getSslEngine();
- if (!engine.getNeedClientAuth()) {
- // Need to re-negotiate SSL connection
- engine.setNeedClientAuth(true);
- sslChannel.rehandshake(getEndpoint().getConnectionTimeout());
- ((JSSESupport) sslSupport).setSession(engine.getSession());
- }*/
- }
-
-
- @Override
- public void setAppReadBufHandler(ApplicationBufferHandler handler) {
- getSocket().setAppReadBufHandler(handler);
- }
-
- @Override
- protected <A> OperationState<A> newOperationState(boolean read,
- ByteBuffer[] buffers, int offset, int length,
- BlockingMode block, long timeout, TimeUnit unit, A attachment,
- CompletionCheck check, CompletionHandler<Long, ? super A> handler,
- Semaphore semaphore, VectoredIOCompletionHandler<A> completion) {
- return new BioOperationState<>(read, buffers, offset, length, block,
- timeout, unit, attachment, check, handler, semaphore, completion);
- }
-
- private class BioOperationState<A> extends OperationState<A> {
- private volatile boolean inline = true;
- private BioOperationState(boolean read, ByteBuffer[] buffers, int offset, int length,
- BlockingMode block, long timeout, TimeUnit unit, A attachment, CompletionCheck check,
- CompletionHandler<Long, ? super A> handler, Semaphore semaphore,
- VectoredIOCompletionHandler<A> completion) {
- super(read, buffers, offset, length, block,
- timeout, unit, attachment, check, handler, semaphore, completion);
- }
-
- @Override
- protected boolean isInline() {
- return inline;
- }
-
- @Override
- protected boolean hasOutboundRemaining() {
- return getSocket().getOutboundRemaining() > 0;
- }
-
- @Override
- public void run() {
- // Perform the IO operation
- // Called from the poller to continue the IO operation
- long nBytes = 0;
- if (getError() == null) {
- try {
- synchronized (this) {
- if (!completionDone) {
- // This filters out same notification until processing
- // of the current one is done
- if (log.isTraceEnabled()) {
- log.trace("Skip concurrent " + (read ? "read" : "write") + " notification");
- }
- return;
- }
- if (read) {
- // Read from main buffer first
- if (!socketBufferHandler.isReadBufferEmpty()) {
- // There is still data inside the main read buffer, it needs to be read first
- socketBufferHandler.configureReadBufferForRead();
- for (int i = 0; i < length && !socketBufferHandler.isReadBufferEmpty(); i++) {
- nBytes += transfer(socketBufferHandler.getReadBuffer(), buffers[offset + i]);
- }
- }
- if (nBytes == 0) {
- nBytes = getSocket().read(buffers, offset, length);
- updateLastRead();
- }
- } else {
- boolean doWrite = true;
- // Write from main buffer first
- if (socketOrNetworkBufferHasDataLeft()) {
- // There is still data inside the main write buffer, it needs to be written first
- socketBufferHandler.configureWriteBufferForRead();
- do {
- nBytes = getSocket().write(socketBufferHandler.getWriteBuffer());
- } while (socketOrNetworkBufferHasDataLeft() && nBytes > 0);
- if (socketOrNetworkBufferHasDataLeft()) {
- doWrite = false;
- }
- // Preserve a negative value since it is an error
- if (nBytes > 0) {
- nBytes = 0;
- }
- }
- if (doWrite) {
- long n = 0;
- do {
- n = getSocket().write(buffers, offset, length);
- if (n == -1) {
- nBytes = n;
- } else {
- nBytes += n;
- }
- } while (n > 0);
- updateLastWrite();
- }
- }
- if (nBytes != 0 || (!buffersArrayHasRemaining(buffers, offset, length) &&
- (read || !socketOrNetworkBufferHasDataLeft()))) {
- completionDone = false;
- }
- }
- } catch (IOException e) {
- setError(e);
- }
- }
- if (nBytes > 0 || (nBytes == 0 && !buffersArrayHasRemaining(buffers, offset, length) &&
- (read || !socketOrNetworkBufferHasDataLeft()))) {
- // The bytes processed are only updated in the completion handler
- completion.completed(Long.valueOf(nBytes), this);
- } else if (nBytes < 0 || getError() != null) {
- IOException error = getError();
- if (error == null) {
- error = new EOFException();
- }
- completion.failed(error, this);
- } else {
- // As soon as the operation uses the poller, it is no longer inline
- inline = false;
- if (read) {
- registerReadInterest();
- } else {
- registerWriteInterest();
- }
- }
- }
- }
- }
-
-
- // ---------------------------------------------- SocketProcessor Inner Class
-
- /**
- * This class is the equivalent of the Worker, but will simply use in an
- * external Executor thread pool.
- */
- protected class SocketProcessor extends SocketProcessorBase<BioChannel> {
-
- public SocketProcessor(SocketWrapperBase<BioChannel> socketWrapper, SocketEvent event) {
- super(socketWrapper, event);
- }
-
- @Override
- protected void doRun() {
-
- try {
- int handshake = -1;
- try {
- if (socketWrapper.getSocket().isHandshakeComplete()) {
- // No TLS handshaking required. Let the handler
- // process this socket / event combination.
- handshake = 0;
- } else if (event == SocketEvent.STOP || event == SocketEvent.DISCONNECT ||
- event == SocketEvent.ERROR) {
- // Unable to complete the TLS handshake. Treat it as
- // if the handshake failed.
- handshake = -1;
- } else {
- handshake = socketWrapper.getSocket().handshake(event == SocketEvent.OPEN_READ, event == SocketEvent.OPEN_WRITE);
- // The handshake process reads/writes from/to the
- // socket. status may therefore be OPEN_WRITE once
- // the handshake completes. However, the handshake
- // happens when the socket is opened so the status
- // must always be OPEN_READ after it completes. It
- // is OK to always set this as it is only used if
- // the handshake completes.
- event = SocketEvent.OPEN_READ;
- }
- } catch (IOException x) {
- handshake = -1;
- if (logHandshake.isDebugEnabled()) {
- logHandshake.debug(sm.getString("endpoint.err.handshake",
- socketWrapper.getRemoteAddr(), Integer.toString(socketWrapper.getRemotePort())), x);
- }
- } catch (CancelledKeyException ckx) {
- handshake = -1;
- }
- if (handshake == 0) {
- SocketState state = SocketState.OPEN;
- // Process the request from this socket
- if (event == null) {
- state = getHandler().process(socketWrapper, SocketEvent.OPEN_READ);
- } else {
- state = getHandler().process(socketWrapper, event);
- }
- if (state == SocketState.CLOSED) {
- socketWrapper.close();
- }
- } else if (handshake == -1 ) {
- getHandler().process(socketWrapper, SocketEvent.CONNECT_FAIL);
- socketWrapper.close();
- } else if (handshake == SelectionKey.OP_READ){
- socketWrapper.registerReadInterest();
- } else if (handshake == SelectionKey.OP_WRITE){
- socketWrapper.registerWriteInterest();
- }
- } catch (CancelledKeyException cx) {
- socketWrapper.close();
- } catch (VirtualMachineError vme) {
- ExceptionUtils.handleThrowable(vme);
- } catch (Throwable t) {
- log.error(sm.getString("endpoint.processing.fail"), t);
- socketWrapper.close();
- } finally {
- socketWrapper = null;
- event = null;
- //return to cache
- if (running && processorCache != null) {
- processorCache.push(this);
- }
- }
- }
-
- }
-
-
- // ----------------------------------------------- SendfileData Inner Class
-
- /**
- * SendfileData class.
- */
- public static class SendfileData extends SendfileDataBase {
-
- public SendfileData(String filename, long pos, long length) {
- super(filename, pos, length);
- }
-
- protected volatile FileChannel fchannel;
- }
-}
diff --git a/javadoc_deprecated3.patch b/javadoc_deprecated3.patch
deleted file mode 100644
index 4b06ee0b92..0000000000
--- a/javadoc_deprecated3.patch
+++ /dev/null
@@ -1,14490 +0,0 @@
-diff --git a/java/org/apache/catalina/ThreadBindingListener.java b/java/org/apache/catalina/ThreadBindingListener.java
-index 68da5684b8..64256e008a 100644
---- a/java/org/apache/catalina/ThreadBindingListener.java
-+++ b/java/org/apache/catalina/ThreadBindingListener.java
-@@ -23,8 +23,16 @@ package org.apache.catalina;
- */
- public interface ThreadBindingListener {
-
-+ /**
-+ * Binds the current thread to the application context by setting
-+ * up the naming context and context class loader.
-+ */
- void bind();
-
-+ /**
-+ * Unbinds the current thread from the application context by clearing
-+ * the naming context and context class loader.
-+ */
- void unbind();
-
- }
-diff --git a/java/org/apache/catalina/TrackedWebResource.java b/java/org/apache/catalina/TrackedWebResource.java
-index 1548e8c9c1..d9e0731ab3 100644
---- a/java/org/apache/catalina/TrackedWebResource.java
-+++ b/java/org/apache/catalina/TrackedWebResource.java
-@@ -18,8 +18,21 @@ package org.apache.catalina;
-
- import java.io.Closeable;
-
-+/**
-+ * Represents a web resource that tracks its creation source for leak detection.
-+ */
- public interface TrackedWebResource extends Closeable {
-+ /**
-+ * Returns the stack trace of the code that created this resource.
-+ *
-+ * @return the creation stack trace
-+ */
- Exception getCreatedBy();
-
-+ /**
-+ * Returns the name of this resource.
-+ *
-+ * @return the resource name
-+ */
- String getName();
- }
-diff --git a/java/org/apache/catalina/Valve.java b/java/org/apache/catalina/Valve.java
-index 5007cb8bb5..5099a1db5b 100644
---- a/java/org/apache/catalina/Valve.java
-+++ b/java/org/apache/catalina/Valve.java
-@@ -109,5 +109,10 @@ public interface Valve {
- void invoke(Request request, Response response) throws IOException, ServletException;
-
-
-+ /**
-+ * Returns whether this Valve supports Servlet 3+ async requests.
-+ *
-+ * @return {@code true} if async is supported, {@code false} otherwise
-+ */
- boolean isAsyncSupported();
- }
-diff --git a/java/org/apache/catalina/WebResourceRoot.java b/java/org/apache/catalina/WebResourceRoot.java
-index a644cde8c4..3ce8795b2c 100644
---- a/java/org/apache/catalina/WebResourceRoot.java
-+++ b/java/org/apache/catalina/WebResourceRoot.java
-@@ -449,30 +449,79 @@ public interface WebResourceRoot extends Lifecycle {
- return false;
- }
-
-+ /**
-+ * Types of resource sets in a WebResourceRoot.
-+ */
- enum ResourceSetType {
-+ /**
-+ * Pre resource set - processed first.
-+ */
- PRE,
-+ /**
-+ * Resource JAR set.
-+ */
- RESOURCE_JAR,
-+ /**
-+ * Post resource set - processed last.
-+ */
- POST,
-+ /**
-+ * Classes JAR set.
-+ */
- CLASSES_JAR
- }
-
-+ /**
-+ * Strategies for archive indexing.
-+ */
- enum ArchiveIndexStrategy {
-+ /**
-+ * Simple strategy - no bloom filter, no retention.
-+ */
- SIMPLE(false, false),
-+ /**
-+ * Bloom filter strategy with retention.
-+ */
- BLOOM(true, true),
-+ /**
-+ * Bloom filter strategy without retention.
-+ */
- PURGED(true, false);
-
-+ /**
-+ * Whether this strategy uses a bloom filter.
-+ */
- private final boolean usesBloom;
-+ /**
-+ * Whether this strategy retains the index.
-+ */
- private final boolean retain;
-
-+ /**
-+ * Constructs a new ArchiveIndexStrategy.
-+ *
-+ * @param usesBloom Whether this strategy uses a bloom filter
-+ * @param retain Whether this strategy retains the index
-+ */
- ArchiveIndexStrategy(boolean usesBloom, boolean retain) {
- this.usesBloom = usesBloom;
- this.retain = retain;
- }
-
-+ /**
-+ * Returns whether this strategy uses a bloom filter.
-+ *
-+ * @return {@code true} if bloom filter is used
-+ */
- public boolean getUsesBloom() {
- return usesBloom;
- }
-
-+ /**
-+ * Returns whether this strategy retains the index.
-+ *
-+ * @return {@code true} if index is retained
-+ */
- public boolean getRetain() {
- return retain;
- }
-diff --git a/java/org/apache/catalina/Wrapper.java b/java/org/apache/catalina/Wrapper.java
-index b529a1957c..aadb824dd9 100644
---- a/java/org/apache/catalina/Wrapper.java
-+++ b/java/org/apache/catalina/Wrapper.java
-@@ -53,10 +53,12 @@ public interface Wrapper extends Container {
-
-
- /**
-- * @return the available date/time for this servlet, in milliseconds since the epoch. If this date/time is in the
-- * future, any request for this servlet will return an SC_SERVICE_UNAVAILABLE error. If it is zero, the
-- * servlet is currently available. A value equal to Long.MAX_VALUE is considered to mean that
-- * unavailability is permanent.
-+ * Returns the available date/time for this servlet, in milliseconds since the epoch. If this date/time is in the
-+ * future, any request for this servlet will return an SC_SERVICE_UNAVAILABLE error. If it is zero, the
-+ * servlet is currently available. A value equal to Long.MAX_VALUE is considered to mean that
-+ * unavailability is permanent.
-+ *
-+ * @return the available date/time in milliseconds since the epoch
- */
- long getAvailable();
-
-@@ -72,7 +74,9 @@ public interface Wrapper extends Container {
-
-
- /**
-- * @return the load-on-startup order value (negative value means load on first call).
-+ * Returns the load-on-startup order value (negative value means load on first call).
-+ *
-+ * @return the load-on-startup order value
- */
- int getLoadOnStartup();
-
-@@ -86,7 +90,9 @@ public interface Wrapper extends Container {
-
-
- /**
-- * @return the run-as identity for this servlet.
-+ * Returns the run-as identity for this servlet.
-+ *
-+ * @return the run-as identity
- */
- String getRunAs();
-
-@@ -100,7 +106,9 @@ public interface Wrapper extends Container {
-
-
- /**
-- * @return the fully qualified servlet class name for this servlet.
-+ * Returns the fully qualified servlet class name for this servlet.
-+ *
-+ * @return the servlet class name
- */
- String getServletClass();
-
-@@ -124,14 +132,19 @@ public interface Wrapper extends Container {
- String[] getServletMethods() throws ServletException;
-
-
-- /**
-- * @return <code>true</code> if this Servlet is currently unavailable.
-+ /**
-+ * Returns whether this Servlet is currently unavailable.
-+ *
-+ * @return <code>true</code> if this Servlet is currently unavailable
- */
- boolean isUnavailable();
-
-
-+
- /**
-- * @return the associated Servlet instance.
-+ * Returns the associated Servlet instance.
-+ *
-+ * @return the associated Servlet instance
- */
- Servlet getServlet();
-
-@@ -195,37 +208,45 @@ public interface Wrapper extends Container {
-
-
- /**
-- * @return the value for the specified initialization parameter name, if any; otherwise return <code>null</code>.
-+ * Returns the value for the specified initialization parameter name, if any; otherwise return <code>null</code>.
- *
- * @param name Name of the requested initialization parameter
-+ * @return the initialization parameter value
- */
- String findInitParameter(String name);
-
-
- /**
-- * @return the names of all defined initialization parameters for this servlet.
-+ * Returns the names of all defined initialization parameters for this servlet.
-+ *
-+ * @return the initialization parameter names
- */
- String[] findInitParameters();
-
-
- /**
-- * @return the mappings associated with this wrapper.
-+ * Returns the mappings associated with this wrapper.
-+ *
-+ * @return the URL mappings
- */
- String[] findMappings();
-
-
- /**
-- * @return the security role link for the specified security role reference name, if any; otherwise return
-- * <code>null</code>.
-+ * Returns the security role link for the specified security role reference name, if any; otherwise return
-+ * <code>null</code>.
- *
- * @param name Security role reference used within this servlet
-+ * @return the security role link
- */
- String findSecurityReference(String name);
-
-
- /**
-+ * Finds all security role references associated with this servlet.
-+ *
- * @return the array of security role reference names associated with this servlet, if any; otherwise return a
-- * zero-length array.
-+ * zero-length array
- */
- String[] findSecurityReferences();
-
-@@ -291,8 +312,10 @@ public interface Wrapper extends Container {
-
-
- /**
-+ * Returns the multipart configuration for the associated Servlet.
-+ *
- * @return the multipart configuration for the associated Servlet. If no multipart configuration has been defined,
-- * then <code>null</code> will be returned.
-+ * then <code>null</code> will be returned
- */
- MultipartConfigElement getMultipartConfigElement();
-
-diff --git a/java/org/apache/catalina/ant/StartTask.java b/java/org/apache/catalina/ant/StartTask.java
-index fd23916139..8f6fd5f05b 100644
---- a/java/org/apache/catalina/ant/StartTask.java
-+++ b/java/org/apache/catalina/ant/StartTask.java
-@@ -27,6 +27,12 @@ import org.apache.tools.ant.BuildException;
- */
- public class StartTask extends AbstractCatalinaCommandTask {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StartTask() {
-+ }
-+
- /**
- * Execute the requested operation.
- *
-diff --git a/java/org/apache/catalina/ant/StopTask.java b/java/org/apache/catalina/ant/StopTask.java
-index 7dcb910dfc..9381235c90 100644
---- a/java/org/apache/catalina/ant/StopTask.java
-+++ b/java/org/apache/catalina/ant/StopTask.java
-@@ -27,6 +27,12 @@ import org.apache.tools.ant.BuildException;
- */
- public class StopTask extends AbstractCatalinaCommandTask {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StopTask() {
-+ }
-+
- /**
- * Execute the requested operation.
- *
-diff --git a/java/org/apache/catalina/ant/ThreaddumpTask.java b/java/org/apache/catalina/ant/ThreaddumpTask.java
-index cef554fefe..7bc8f5275c 100644
---- a/java/org/apache/catalina/ant/ThreaddumpTask.java
-+++ b/java/org/apache/catalina/ant/ThreaddumpTask.java
-@@ -25,6 +25,12 @@ import org.apache.tools.ant.BuildException;
- */
- public class ThreaddumpTask extends AbstractCatalinaTask {
-
-+ /**
-+ * Constructs a new ThreaddumpTask.
-+ */
-+ public ThreaddumpTask() {
-+ }
-+
- // Public Methods
-
- /**
-diff --git a/java/org/apache/catalina/ant/UndeployTask.java b/java/org/apache/catalina/ant/UndeployTask.java
-index 267ed8f8b0..4bda614dd1 100644
---- a/java/org/apache/catalina/ant/UndeployTask.java
-+++ b/java/org/apache/catalina/ant/UndeployTask.java
-@@ -27,6 +27,12 @@ import org.apache.tools.ant.BuildException;
- */
- public class UndeployTask extends AbstractCatalinaCommandTask {
-
-+ /**
-+ * Constructs a new UndeployTask.
-+ */
-+ public UndeployTask() {
-+ }
-+
- /**
- * Execute the requested operation.
- *
-diff --git a/java/org/apache/catalina/ant/ValidatorTask.java b/java/org/apache/catalina/ant/ValidatorTask.java
-index 4ba3ada767..9dac71e3c3 100644
---- a/java/org/apache/catalina/ant/ValidatorTask.java
-+++ b/java/org/apache/catalina/ant/ValidatorTask.java
-@@ -35,6 +35,12 @@ import org.xml.sax.InputSource;
- */
- public class ValidatorTask extends BaseRedirectorHelperTask {
-
-+ /**
-+ * Constructs a new ValidatorTask.
-+ */
-+ public ValidatorTask() {
-+ }
-+
-
- // ----------------------------------------------------- Instance Variables
-
-@@ -47,10 +53,20 @@ public class ValidatorTask extends BaseRedirectorHelperTask {
- */
- protected String path = null;
-
-+ /**
-+ * Returns the path to the webapp directory.
-+ *
-+ * @return the path
-+ */
- public String getPath() {
- return this.path;
- }
-
-+ /**
-+ * Sets the path to the webapp directory.
-+ *
-+ * @param path The path to the webapp directory
-+ */
- public void setPath(String path) {
- this.path = path;
- }
-diff --git a/java/org/apache/catalina/ant/VminfoTask.java b/java/org/apache/catalina/ant/VminfoTask.java
-index 6fccbc9e90..48df3d2c0c 100644
---- a/java/org/apache/catalina/ant/VminfoTask.java
-+++ b/java/org/apache/catalina/ant/VminfoTask.java
-@@ -25,6 +25,12 @@ import org.apache.tools.ant.BuildException;
- */
- public class VminfoTask extends AbstractCatalinaTask {
-
-+ /**
-+ * Constructs a new VminfoTask.
-+ */
-+ public VminfoTask() {
-+ }
-+
- // Public Methods
-
- /**
-diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java
-index 6957af4942..4ee987057f 100644
---- a/java/org/apache/catalina/core/StandardContext.java
-+++ b/java/org/apache/catalina/core/StandardContext.java
-@@ -753,6 +753,9 @@ public class StandardContext extends ContainerBase implements Context, Notificat
-
- private Boolean failCtxIfServletStartFails;
-
-+ /**
-+ * Default no-op naming listener used when no custom ThreadBindingListener is configured.
-+ */
- protected static final ThreadBindingListener DEFAULT_NAMING_LISTENER = (new ThreadBindingListener() {
- @Override
- public void bind() {
-@@ -762,6 +765,9 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- public void unbind() {
- }
- });
-+ /**
-+ * Listener for thread binding operations during naming context management.
-+ */
- protected ThreadBindingListener threadBindingListener = DEFAULT_NAMING_LISTENER;
-
- private final Object namingToken = new Object();
-@@ -843,11 +849,21 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Returns the size of the cache for not-found class resources.
-+ *
-+ * @return The cache size
-+ */
- public int getNotFoundClassResourceCacheSize() {
- return notFoundClassResourceCacheSize;
- }
-
-
-+ /**
-+ * Sets the size of the cache for not-found class resources.
-+ *
-+ * @param notFoundClassResourceCacheSize The cache size
-+ */
- public void setNotFoundClassResourceCacheSize(int notFoundClassResourceCacheSize) {
- this.notFoundClassResourceCacheSize = notFoundClassResourceCacheSize;
- }
-@@ -877,6 +893,11 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Returns the number of in-progress async requests.
-+ *
-+ * @return The count of in-progress async requests
-+ */
- public long getInProgressAsyncCount() {
- return inProgressAsyncCount.get();
- }
-@@ -1638,6 +1659,11 @@ public class StandardContext extends ContainerBase implements Context, Notificat
-
- }
-
-+ /**
-+ * Returns the location of the default context XML.
-+ *
-+ * @return The default context XML location
-+ */
- public String getDefaultContextXml() {
- return defaultContextXml;
- }
-@@ -1652,6 +1678,11 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- this.defaultContextXml = defaultContextXml;
- }
-
-+ /**
-+ * Returns the location of the default web XML.
-+ *
-+ * @return The default web XML location
-+ */
- public String getDefaultWebXml() {
- return defaultWebXml;
- }
-@@ -1675,14 +1706,29 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- return startupTime;
- }
-
-+ /**
-+ * Sets the time (in milliseconds) it took to start this context.
-+ *
-+ * @param startupTime Time (in milliseconds) it took to start this context.
-+ */
- public void setStartupTime(long startupTime) {
- this.startupTime = startupTime;
- }
-
-+ /**
-+ * Gets the time (in milliseconds) spent scanning TLDs during startup.
-+ *
-+ * @return Time (in milliseconds) spent scanning TLDs.
-+ */
- public long getTldScanTime() {
- return tldScanTime;
- }
-
-+ /**
-+ * Sets the time (in milliseconds) spent scanning TLDs during startup.
-+ *
-+ * @param tldScanTime Time (in milliseconds) spent scanning TLDs.
-+ */
- public void setTldScanTime(long tldScanTime) {
- this.tldScanTime = tldScanTime;
- }
-@@ -1760,18 +1806,38 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Returns the J2EE Application ObjectName this module belongs to.
-+ *
-+ * @return The J2EE Application ObjectName
-+ */
- public String getJ2EEApplication() {
- return j2EEApplication;
- }
-
-+ /**
-+ * Sets the J2EE Application ObjectName this module belongs to.
-+ *
-+ * @param j2EEApplication The J2EE Application ObjectName
-+ */
- public void setJ2EEApplication(String j2EEApplication) {
- this.j2EEApplication = j2EEApplication;
- }
-
-+ /**
-+ * Returns the J2EE Server ObjectName this module is deployed on.
-+ *
-+ * @return The J2EE Server ObjectName
-+ */
- public String getJ2EEServer() {
- return j2EEServer;
- }
-
-+ /**
-+ * Sets the J2EE Server ObjectName this module is deployed on.
-+ *
-+ * @param j2EEServer The J2EE Server ObjectName
-+ */
- public void setJ2EEServer(String j2EEServer) {
- this.j2EEServer = j2EEServer;
- }
-@@ -2494,11 +2560,21 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Returns whether RMI targets should be cleared during stop to prevent memory leaks.
-+ *
-+ * @return True if RMI targets should be cleared
-+ */
- public boolean getClearReferencesRmiTargets() {
- return this.clearReferencesRmiTargets;
- }
-
-
-+ /**
-+ * Sets whether RMI targets should be cleared during stop to prevent memory leaks.
-+ *
-+ * @param clearReferencesRmiTargets True to clear RMI targets
-+ */
- public void setClearReferencesRmiTargets(boolean clearReferencesRmiTargets) {
- boolean oldClearReferencesRmiTargets = this.clearReferencesRmiTargets;
- this.clearReferencesRmiTargets = clearReferencesRmiTargets;
-@@ -2576,10 +2652,20 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Returns whether threads should be renewed when stopping the context.
-+ *
-+ * @return True if threads should be renewed
-+ */
- public boolean getRenewThreadsWhenStoppingContext() {
- return this.renewThreadsWhenStoppingContext;
- }
-
-+ /**
-+ * Sets whether threads should be renewed when stopping the context.
-+ *
-+ * @param renewThreadsWhenStoppingContext True to renew threads
-+ */
- public void setRenewThreadsWhenStoppingContext(boolean renewThreadsWhenStoppingContext) {
- boolean oldRenewThreadsWhenStoppingContext = this.renewThreadsWhenStoppingContext;
- this.renewThreadsWhenStoppingContext = renewThreadsWhenStoppingContext;
-@@ -2588,11 +2674,21 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Returns whether ThreadLocal references should be cleared during stop to prevent memory leaks.
-+ *
-+ * @return True if ThreadLocal references should be cleared
-+ */
- public boolean getClearReferencesThreadLocals() {
- return clearReferencesThreadLocals;
- }
-
-
-+ /**
-+ * Sets whether ThreadLocal references should be cleared during stop to prevent memory leaks.
-+ *
-+ * @param clearReferencesThreadLocals True to clear ThreadLocal references
-+ */
- public void setClearReferencesThreadLocals(boolean clearReferencesThreadLocals) {
- boolean oldClearReferencesThreadLocals = this.clearReferencesThreadLocals;
- this.clearReferencesThreadLocals = clearReferencesThreadLocals;
-@@ -2601,20 +2697,40 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Returns whether memory leak checks should be skipped on JVM shutdown.
-+ *
-+ * @return True if memory leak checks should be skipped
-+ */
- public boolean getSkipMemoryLeakChecksOnJvmShutdown() {
- return skipMemoryLeakChecksOnJvmShutdown;
- }
-
-
-+ /**
-+ * Sets whether memory leak checks should be skipped on JVM shutdown.
-+ *
-+ * @param skipMemoryLeakChecksOnJvmShutdown True to skip memory leak checks
-+ */
- public void setSkipMemoryLeakChecksOnJvmShutdown(boolean skipMemoryLeakChecksOnJvmShutdown) {
- this.skipMemoryLeakChecksOnJvmShutdown = skipMemoryLeakChecksOnJvmShutdown;
- }
-
-
-+ /**
-+ * Returns whether the context should fail if a servlet fails to start.
-+ *
-+ * @return True if the context should fail, false otherwise, or null to inherit from parent
-+ */
- public Boolean getFailCtxIfServletStartFails() {
- return failCtxIfServletStartFails;
- }
-
-+ /**
-+ * Sets whether the context should fail if a servlet fails to start.
-+ *
-+ * @param failCtxIfServletStartFails True to fail the context, false to continue, or null to inherit
-+ */
- public void setFailCtxIfServletStartFails(Boolean failCtxIfServletStartFails) {
- Boolean oldFailCtxIfServletStartFails = this.failCtxIfServletStartFails;
- this.failCtxIfServletStartFails = failCtxIfServletStartFails;
-@@ -2622,6 +2738,11 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- failCtxIfServletStartFails);
- }
-
-+ /**
-+ * Returns the computed value of failCtxIfServletStartFails, inheriting from parent Host if not explicitly set.
-+ *
-+ * @return True if the context should fail when a servlet start fails
-+ */
- protected boolean getComputedFailCtxIfServletStartFails() {
- if (failCtxIfServletStartFails != null) {
- return failCtxIfServletStartFails.booleanValue();
-@@ -3760,6 +3881,12 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- }
-
-
-+ /**
-+ * Checks whether the given servlet was dynamically created by this context.
-+ *
-+ * @param servlet The servlet to check
-+ * @return True if the servlet was dynamically created
-+ */
- public boolean wasCreatedDynamicServlet(Servlet servlet) {
- return createdServlets.contains(servlet);
- }
-@@ -5549,10 +5676,21 @@ public class StandardContext extends ContainerBase implements Context, Notificat
- */
- private String server = null;
-
-+ /**
-+ * Returns the J2EE Server ObjectName this module is deployed on.
-+ *
-+ * @return The server ObjectName
-+ */
- public String getServer() {
- return server;
- }
-
-+ /**
-+ * Sets the J2EE Server ObjectName this module is deployed on.
-+ *
-+ * @param server The server ObjectName
-+ * @return The previous server value
-+ */
- public String setServer(String server) {
- return this.server = server;
- }
-diff --git a/java/org/apache/catalina/core/StandardEngine.java b/java/org/apache/catalina/core/StandardEngine.java
-index 14ed3fdb56..506e4e0386 100644
---- a/java/org/apache/catalina/core/StandardEngine.java
-+++ b/java/org/apache/catalina/core/StandardEngine.java
-@@ -322,8 +322,17 @@ public class StandardEngine extends ContainerBase implements Engine {
-
-
- // ----------------------------------------------------------- Inner classes
-+ /**
-+ * No-op implementation of AccessLog used as a placeholder when access logging is not configured.
-+ */
- protected static final class NoopAccessLog implements AccessLog {
-
-+ /**
-+ * Default constructor for no-op access log.
-+ */
-+ public NoopAccessLog() {
-+ }
-+
- @Override
- public void log(Request request, Response response, long time) {
- // NOOP
-@@ -342,6 +351,9 @@ public class StandardEngine extends ContainerBase implements Engine {
- }
- }
-
-+ /**
-+ * Listener that manages access log configuration for engine, host, and context lifecycle events.
-+ */
- protected static final class AccessLogListener
- implements PropertyChangeListener, LifecycleListener, ContainerListener {
-
-@@ -350,12 +362,22 @@ public class StandardEngine extends ContainerBase implements Engine {
- private final Context context;
- private volatile boolean disabled = false;
-
-+ /**
-+ * Creates a new AccessLogListener for the given engine, host, and context.
-+ *
-+ * @param engine The engine to monitor
-+ * @param host The host to monitor, or null
-+ * @param context The context to monitor, or null
-+ */
- public AccessLogListener(StandardEngine engine, Host host, Context context) {
- this.engine = engine;
- this.host = host;
- this.context = context;
- }
-
-+ /**
-+ * Installs this listener on the configured engine, host, and context.
-+ */
- public void install() {
- engine.addPropertyChangeListener(this);
- if (host != null) {
-diff --git a/java/org/apache/catalina/core/StandardHost.java b/java/org/apache/catalina/core/StandardHost.java
-index ddb16abec1..02a162debf 100644
---- a/java/org/apache/catalina/core/StandardHost.java
-+++ b/java/org/apache/catalina/core/StandardHost.java
-@@ -401,7 +401,9 @@ public class StandardHost extends ContainerBase implements Host {
-
-
- /**
-- * @return the Java class name of the Context implementation class for new web applications.
-+ * Returns the Java class name of the Context implementation class for new web applications.
-+ *
-+ * @return the Java class name of the Context implementation class
- */
- public String getContextClass() {
- return this.contextClass;
-@@ -444,7 +446,9 @@ public class StandardHost extends ContainerBase implements Host {
-
-
- /**
-- * @return <code>true</code> if XML context descriptors should be deployed.
-+ * Returns whether XML context descriptors should be deployed.
-+ *
-+ * @return <code>true</code> if XML context descriptors should be deployed
- */
- public boolean isDeployXML() {
- return deployXML;
-@@ -462,7 +466,9 @@ public class StandardHost extends ContainerBase implements Host {
-
-
- /**
-- * @return the copy XML config file flag for this component.
-+ * Returns the copy XML config file flag for this component.
-+ *
-+ * @return the copy XML config file flag
- */
- public boolean isCopyXML() {
- return this.copyXML;
-@@ -480,7 +486,9 @@ public class StandardHost extends ContainerBase implements Host {
-
-
- /**
-- * @return the Java class name of the error report valve class for new web applications.
-+ * Returns the Java class name of the error report valve class for new web applications.
-+ *
-+ * @return the Java class name of the error report valve class
- */
- public String getErrorReportValveClass() {
- return this.errorReportValveClass;
-@@ -524,7 +532,9 @@ public class StandardHost extends ContainerBase implements Host {
-
-
- /**
-- * @return <code>true</code> if WARs should be unpacked on deployment.
-+ * Returns whether WARs should be unpacked on deployment.
-+ *
-+ * @return <code>true</code> if WARs should be unpacked
- */
- public boolean isUnpackWARs() {
- return unpackWARs;
-@@ -542,7 +552,9 @@ public class StandardHost extends ContainerBase implements Host {
-
-
- /**
-- * @return host work directory base.
-+ * Returns the host work directory base.
-+ *
-+ * @return host work directory base
- */
- public String getWorkDir() {
- return workDir;
-@@ -592,7 +604,9 @@ public class StandardHost extends ContainerBase implements Host {
-
-
- /**
-- * @return <code>true</code> if a webapp start should fail if a Servlet startup fails
-+ * Returns whether a webapp start should fail if a Servlet startup fails.
-+ *
-+ * @return <code>true</code> if a webapp start should fail on servlet startup failure
- */
- public boolean isFailCtxIfServletStartFails() {
- return failCtxIfServletStartFails;
-@@ -783,7 +797,9 @@ public class StandardHost extends ContainerBase implements Host {
-
- // -------------------- JMX --------------------
- /**
-- * @return the MBean Names of the Valves associated with this Host
-+ * Returns the MBean Names of the Valves associated with this Host.
-+ *
-+ * @return the MBean Names of the Valves
- *
- * @exception Exception if an MBean cannot be created or registered
- */
-@@ -802,6 +818,11 @@ public class StandardHost extends ContainerBase implements Host {
- return mbeanNames;
- }
-
-+ /**
-+ * Returns the array of aliases for this host.
-+ *
-+ * @return the array of aliases
-+ */
- public String[] getAliases() {
- synchronized (aliasesLock) {
- return aliases;
-diff --git a/java/org/apache/catalina/core/StandardPipeline.java b/java/org/apache/catalina/core/StandardPipeline.java
-index fb9ad89d5d..f99ee35707 100644
---- a/java/org/apache/catalina/core/StandardPipeline.java
-+++ b/java/org/apache/catalina/core/StandardPipeline.java
-@@ -318,6 +318,11 @@ public class StandardPipeline extends LifecycleBase implements Pipeline {
-
- }
-
-+ /**
-+ * Return the JMX ObjectNames for all the Valves in this Pipeline.
-+ *
-+ * @return the array of JMX ObjectNames
-+ */
- public ObjectName[] getValveObjectNames() {
-
- List<ObjectName> valveList = new ArrayList<>();
-diff --git a/java/org/apache/catalina/core/StandardServer.java b/java/org/apache/catalina/core/StandardServer.java
-index 7cf61d6704..7d6442668c 100644
---- a/java/org/apache/catalina/core/StandardServer.java
-+++ b/java/org/apache/catalina/core/StandardServer.java
-@@ -432,6 +432,8 @@ public final class StandardServer extends LifecycleMBeanBase implements Server {
-
-
- /**
-+ * Return the period between two lifecycle events, in seconds.
-+ *
- * @return The period between two lifecycle events, in seconds
- */
- public int getPeriodicEventDelay() {
-@@ -479,6 +481,9 @@ public final class StandardServer extends LifecycleMBeanBase implements Server {
- support.firePropertyChange("service", null, service);
- }
-
-+ /**
-+ * Stop the await thread by closing the await socket and interrupting the thread.
-+ */
- public void stopAwait() {
- stopAwait = true;
- Thread t = awaitThread;
-@@ -662,6 +667,8 @@ public final class StandardServer extends LifecycleMBeanBase implements Server {
- }
-
- /**
-+ * Return the JMX ObjectNames for all configured services.
-+ *
- * @return the JMX service names.
- */
- public ObjectName[] getServiceNames() {
-diff --git a/java/org/apache/catalina/core/StandardService.java b/java/org/apache/catalina/core/StandardService.java
-index 386f195891..1829a83d09 100644
---- a/java/org/apache/catalina/core/StandardService.java
-+++ b/java/org/apache/catalina/core/StandardService.java
-@@ -50,6 +50,14 @@ import org.apache.tomcat.util.res.StringManager;
-
- public class StandardService extends LifecycleMBeanBase implements Service {
-
-+ /**
-+ * Construct a new {@link StandardService} instance with the default settings.
-+ */
-+ public StandardService() {
-+ super();
-+ }
-+
-+
- private static final Log log = LogFactory.getLog(StandardService.class);
- private static final StringManager sm = StringManager.getManager(StandardService.class);
-
-@@ -106,11 +114,21 @@ public class StandardService extends LifecycleMBeanBase implements Service {
-
- // ------------------------------------------------------------- Properties
-
-+ /**
-+ * Get the number of milliseconds to wait for all threads to finish during a graceful stop.
-+ *
-+ * @return the number of milliseconds to wait
-+ */
- public long getGracefulStopAwaitMillis() {
- return gracefulStopAwaitMillis;
- }
-
-
-+ /**
-+ * Set the number of milliseconds to wait for all threads to finish during a graceful stop.
-+ *
-+ * @param gracefulStopAwaitMillis the number of milliseconds to wait
-+ */
- public void setGracefulStopAwaitMillis(long gracefulStopAwaitMillis) {
- this.gracefulStopAwaitMillis = gracefulStopAwaitMillis;
- }
-@@ -225,6 +243,11 @@ public class StandardService extends LifecycleMBeanBase implements Service {
- }
-
-
-+ /**
-+ * Return the JMX ObjectNames for the connectors currently associated with this service.
-+ *
-+ * @return the JMX ObjectNames for the associated connectors
-+ */
- public ObjectName[] getConnectorNames() {
- Lock readLock = connectorsLock.readLock();
- readLock.lock();
-diff --git a/java/org/apache/catalina/core/StandardThreadExecutor.java b/java/org/apache/catalina/core/StandardThreadExecutor.java
-index 56cb84abc0..7b8c347c5d 100644
---- a/java/org/apache/catalina/core/StandardThreadExecutor.java
-+++ b/java/org/apache/catalina/core/StandardThreadExecutor.java
-@@ -35,8 +35,14 @@ import org.apache.tomcat.util.threads.TaskQueue;
- import org.apache.tomcat.util.threads.TaskThreadFactory;
- import org.apache.tomcat.util.threads.ThreadPoolExecutor;
-
-+/**
-+ * Standard implementation of an {@link Executor} based on a Java thread pool.
-+ */
- public class StandardThreadExecutor extends LifecycleMBeanBase implements Executor, ResizableExecutor {
-
-+ /**
-+ * StringManager for this package.
-+ */
- protected static final StringManager sm = StringManager.getManager(StandardThreadExecutor.class);
-
- // ---------------------------------------------- Properties
-@@ -94,6 +100,9 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- private TaskQueue taskqueue = null;
-
- // ---------------------------------------------- Constructors
-+ /**
-+ * Default constructor required for the Digester.
-+ */
- public StandardThreadExecutor() {
- // empty constructor for the digester
- }
-@@ -151,25 +160,48 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- }
- }
-
-+ /**
-+ * Notify the underlying executor that the associated context is stopping so that it can prepare for shutdown.
-+ */
- public void contextStopping() {
- if (executor != null) {
- executor.contextStopping();
- }
- }
-
-+ /**
-+ * Return the thread priority for new threads.
-+ *
-+ * @return the thread priority
-+ */
- public int getThreadPriority() {
- return threadPriority;
- }
-
-+ /**
-+ * Return whether threads are daemon threads.
-+ *
-+ * @return true if threads are daemon threads
-+ */
- public boolean isDaemon() {
-
- return daemon;
- }
-
-+ /**
-+ * Return the name prefix for new threads.
-+ *
-+ * @return the name prefix
-+ */
- public String getNamePrefix() {
- return namePrefix;
- }
-
-+ /**
-+ * Return the maximum idle time in milliseconds.
-+ *
-+ * @return the maximum idle time in milliseconds
-+ */
- public int getMaxIdleTime() {
- return maxIdleTime;
- }
-@@ -179,6 +211,11 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- return maxThreads;
- }
-
-+ /**
-+ * Return the minimum number of spare threads.
-+ *
-+ * @return the minimum spare threads
-+ */
- public int getMinSpareThreads() {
- return minSpareThreads;
- }
-@@ -188,18 +225,38 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- return name;
- }
-
-+ /**
-+ * Set the thread priority for new threads.
-+ *
-+ * @param threadPriority the thread priority
-+ */
- public void setThreadPriority(int threadPriority) {
- this.threadPriority = threadPriority;
- }
-
-+ /**
-+ * Set whether threads are daemon threads.
-+ *
-+ * @param daemon true for daemon threads
-+ */
- public void setDaemon(boolean daemon) {
- this.daemon = daemon;
- }
-
-+ /**
-+ * Set the name prefix for new threads.
-+ *
-+ * @param namePrefix the name prefix
-+ */
- public void setNamePrefix(String namePrefix) {
- this.namePrefix = namePrefix;
- }
-
-+ /**
-+ * Set the maximum idle time in milliseconds.
-+ *
-+ * @param maxIdleTime the maximum idle time
-+ */
- public void setMaxIdleTime(int maxIdleTime) {
- this.maxIdleTime = maxIdleTime;
- if (executor != null) {
-@@ -207,6 +264,11 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- }
- }
-
-+ /**
-+ * Set the maximum number of threads in the pool.
-+ *
-+ * @param maxThreads the maximum threads
-+ */
- public void setMaxThreads(int maxThreads) {
- this.maxThreads = maxThreads;
- if (executor != null) {
-@@ -214,6 +276,11 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- }
- }
-
-+ /**
-+ * Set the minimum number of spare threads.
-+ *
-+ * @param minSpareThreads the minimum spare threads
-+ */
- public void setMinSpareThreads(int minSpareThreads) {
- this.minSpareThreads = minSpareThreads;
- if (executor != null) {
-@@ -221,22 +288,47 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- }
- }
-
-+ /**
-+ * Set the name for this executor.
-+ *
-+ * @param name the executor name
-+ */
- public void setName(String name) {
- this.name = name;
- }
-
-+ /**
-+ * Set the maximum queue size.
-+ *
-+ * @param size the maximum queue size
-+ */
- public void setMaxQueueSize(int size) {
- this.maxQueueSize = size;
- }
-
-+ /**
-+ * Return the maximum number of elements that can queue up before tasks are rejected.
-+ *
-+ * @return the maximum queue size
-+ */
- public int getMaxQueueSize() {
- return maxQueueSize;
- }
-
-+ /**
-+ * Return the thread renewal delay in milliseconds.
-+ *
-+ * @return the thread renewal delay
-+ */
- public long getThreadRenewalDelay() {
- return threadRenewalDelay;
- }
-
-+ /**
-+ * Set the thread renewal delay in milliseconds.
-+ *
-+ * @param threadRenewalDelay the thread renewal delay
-+ */
- public void setThreadRenewalDelay(long threadRenewalDelay) {
- this.threadRenewalDelay = threadRenewalDelay;
- if (executor != null) {
-@@ -250,14 +342,29 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- return (executor != null) ? executor.getActiveCount() : 0;
- }
-
-+ /**
-+ * Return the approximate total number of tasks that have completed execution.
-+ *
-+ * @return the completed task count
-+ */
- public long getCompletedTaskCount() {
- return (executor != null) ? executor.getCompletedTaskCount() : 0;
- }
-
-+ /**
-+ * Return the core number of threads for the underlying thread pool.
-+ *
-+ * @return the core pool size
-+ */
- public int getCorePoolSize() {
- return (executor != null) ? executor.getCorePoolSize() : 0;
- }
-
-+ /**
-+ * Return the largest number of threads that have ever simultaneously been in the pool.
-+ *
-+ * @return the largest pool size
-+ */
- public int getLargestPoolSize() {
- return (executor != null) ? executor.getLargestPoolSize() : 0;
- }
-@@ -267,6 +374,11 @@ public class StandardThreadExecutor extends LifecycleMBeanBase implements Execut
- return (executor != null) ? executor.getPoolSize() : 0;
- }
-
-+ /**
-+ * Return the current queue size.
-+ *
-+ * @return the queue size, or -1 if not available
-+ */
- public int getQueueSize() {
- return (executor != null) ? executor.getQueue().size() : -1;
- }
-diff --git a/java/org/apache/catalina/core/StandardVirtualThreadExecutor.java b/java/org/apache/catalina/core/StandardVirtualThreadExecutor.java
-index b58d34335a..928b82784f 100644
---- a/java/org/apache/catalina/core/StandardVirtualThreadExecutor.java
-+++ b/java/org/apache/catalina/core/StandardVirtualThreadExecutor.java
-@@ -43,6 +43,17 @@ public class StandardVirtualThreadExecutor extends LifecycleMBeanBase implements
- private java.util.concurrent.ExecutorService executor;
- private String namePrefix = "tomcat-virt-";
-
-+ /**
-+ * Default constructor required for the Digester.
-+ */
-+ public StandardVirtualThreadExecutor() {
-+ }
-+
-+ /**
-+ * Set the name for this executor.
-+ *
-+ * @param name the executor name
-+ */
- public void setName(String name) {
- this.name = name;
- }
-@@ -52,10 +63,20 @@ public class StandardVirtualThreadExecutor extends LifecycleMBeanBase implements
- return name;
- }
-
-+ /**
-+ * Return the name prefix for virtual threads.
-+ *
-+ * @return the name prefix
-+ */
- public String getNamePrefix() {
- return namePrefix;
- }
-
-+ /**
-+ * Set the name prefix for virtual threads.
-+ *
-+ * @param namePrefix the name prefix
-+ */
- public void setNamePrefix(String namePrefix) {
- this.namePrefix = namePrefix;
- }
-diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java
-index 4d8230f8e0..2b904f7b5a 100644
---- a/java/org/apache/catalina/core/StandardWrapper.java
-+++ b/java/org/apache/catalina/core/StandardWrapper.java
-@@ -68,6 +68,9 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
-
- private final Log log = LogFactory.getLog(StandardWrapper.class); // must not be static
-
-+ /**
-+ * Default servlet methods supported by this wrapper.
-+ */
- protected static final String[] DEFAULT_SERVLET_METHODS = new String[] { "GET", "HEAD", "POST" };
-
- // ----------------------------------------------------------- Constructors
-@@ -197,7 +200,13 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
-
- // To support jmx attributes
- StandardWrapperValve swValve;
-+ /**
-+ * Time taken to load the servlet.
-+ */
- protected long loadTime = 0;
-+ /**
-+ * Time taken to load the servlet class.
-+ */
- protected int classLoadTime = 0;
-
- /**
-@@ -255,7 +264,9 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
-
-
- /**
-- * @return the number of active allocations of this servlet.
-+ * Returns the number of active allocations of this servlet.
-+ *
-+ * @return the number of active allocations of this servlet
- */
- public int getCountAllocated() {
- return this.countAllocated.get();
-@@ -305,6 +316,8 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
- }
-
- /**
-+ * Returns the load-on-startup value that was parsed.
-+ *
- * @return the load-on-startup value that was parsed
- */
- public String getLoadOnStartupString() {
-@@ -1014,14 +1027,29 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
- return getName();
- }
-
-+ /**
-+ * Returns the total processing time for all requests.
-+ *
-+ * @return the total processing time in milliseconds
-+ */
- public long getProcessingTime() {
- return swValve.getProcessingTime();
- }
-
-+ /**
-+ * Returns the maximum processing time for a single request.
-+ *
-+ * @return the maximum processing time in milliseconds
-+ */
- public long getMaxTime() {
- return swValve.getMaxTime();
- }
-
-+ /**
-+ * Returns the minimum processing time for a single request.
-+ *
-+ * @return the minimum processing time in milliseconds
-+ */
- public long getMinTime() {
- return swValve.getMinTime();
- }
-@@ -1052,10 +1080,20 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
- swValve.incrementErrorCount();
- }
-
-+ /**
-+ * Returns the time taken to load the servlet.
-+ *
-+ * @return the load time in milliseconds
-+ */
- public long getLoadTime() {
- return loadTime;
- }
-
-+ /**
-+ * Returns the time taken to load the servlet class.
-+ *
-+ * @return the class load time in milliseconds
-+ */
- public int getClassLoadTime() {
- return classLoadTime;
- }
-@@ -1096,6 +1134,13 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
- // -------------------------------------------------------- protected Methods
-
-
-+ /**
-+ * Recursively collects all declared methods from the given class and its superclasses,
-+ * stopping at HttpServlet.
-+ *
-+ * @param c the class to inspect
-+ * @return array of all declared methods, or null if c is HttpServlet
-+ */
- protected Method[] getAllDeclaredMethods(Class<?> c) {
-
- if (c.equals(jakarta.servlet.http.HttpServlet.class)) {
-@@ -1262,6 +1307,9 @@ public class StandardWrapper extends ContainerBase implements ServletConfig, Wra
- broadcaster.removeNotificationListener(listener, filter, object);
- }
-
-+ /**
-+ * Cache for notification info.
-+ */
- protected MBeanNotificationInfo[] notificationInfo;
-
- @Override
-diff --git a/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java b/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java
-index 92e5083921..bc86774b6c 100644
---- a/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java
-+++ b/java/org/apache/catalina/core/ThreadLocalLeakPreventionListener.java
-@@ -44,6 +44,12 @@ import org.apache.tomcat.util.threads.ThreadPoolExecutor;
- */
- public class ThreadLocalLeakPreventionListener extends FrameworkListener {
-
-+ /**
-+ * Constructs a new ThreadLocalLeakPreventionListener.
-+ */
-+ public ThreadLocalLeakPreventionListener() {
-+ }
-+
- private static final Log log = LogFactory.getLog(ThreadLocalLeakPreventionListener.class);
-
- private volatile boolean serverStopping = false;
-diff --git a/java/org/apache/catalina/ha/backend/TcpSender.java b/java/org/apache/catalina/ha/backend/TcpSender.java
-index 87fef47dc7..8fd7e6f7b4 100644
---- a/java/org/apache/catalina/ha/backend/TcpSender.java
-+++ b/java/org/apache/catalina/ha/backend/TcpSender.java
-@@ -33,11 +33,23 @@ import org.apache.tomcat.util.res.StringManager;
- /*
- * Sender to proxies using multicast socket.
- */
-+/**
-+ * TCP-based sender for sending heartbeat messages to proxy servers.
-+ */
- public class TcpSender implements Sender {
-
-+ /**
-+ * Constructs a new TcpSender.
-+ */
-+ public TcpSender() {
-+ }
-+
- private static final Log log = LogFactory.getLog(HeartbeatListener.class);
- private static final StringManager sm = StringManager.getManager(TcpSender.class);
-
-+ /**
-+ * The heartbeat listener configuration.
-+ */
- HeartbeatListener config = null;
-
- /**
-@@ -47,11 +59,18 @@ public class TcpSender implements Sender {
-
-
- /**
-- * Active connections.
-+ * Active socket connections to proxies.
- */
--
- protected Socket[] connections = null;
-+
-+ /**
-+ * Readers for active connections.
-+ */
- protected BufferedReader[] connectionReaders = null;
-+
-+ /**
-+ * Writers for active connections.
-+ */
- protected BufferedWriter[] connectionWriters = null;
-
-
-diff --git a/java/org/apache/catalina/ha/deploy/UndeployMessage.java b/java/org/apache/catalina/ha/deploy/UndeployMessage.java
-index 23f47f69eb..de1a8718f4 100644
---- a/java/org/apache/catalina/ha/deploy/UndeployMessage.java
-+++ b/java/org/apache/catalina/ha/deploy/UndeployMessage.java
-@@ -21,6 +21,9 @@ import java.io.Serial;
- import org.apache.catalina.ha.ClusterMessage;
- import org.apache.catalina.tribes.Member;
-
-+/**
-+ * Cluster message that indicates an application has been undeployed.
-+ */
- public class UndeployMessage implements ClusterMessage {
- @Serial
- private static final long serialVersionUID = 2L;
-@@ -30,6 +33,14 @@ public class UndeployMessage implements ClusterMessage {
- private final String uniqueId;
- private final String contextName;
-
-+ /**
-+ * Creates a new UndeployMessage.
-+ *
-+ * @param address the sender address
-+ * @param timestamp the message timestamp
-+ * @param uniqueId the unique message identifier
-+ * @param contextName the context being undeployed
-+ */
- public UndeployMessage(Member address, long timestamp, String uniqueId, String contextName) {
- this.address = address;
- this.timestamp = timestamp;
-@@ -62,6 +73,11 @@ public class UndeployMessage implements ClusterMessage {
- return uniqueId;
- }
-
-+ /**
-+ * Returns the name of the context being undeployed.
-+ *
-+ * @return the context name
-+ */
- public String getContextName() {
- return contextName;
- }
-diff --git a/java/org/apache/catalina/ha/deploy/WarWatcher.java b/java/org/apache/catalina/ha/deploy/WarWatcher.java
-index bf5539a072..6ac851168f 100644
---- a/java/org/apache/catalina/ha/deploy/WarWatcher.java
-+++ b/java/org/apache/catalina/ha/deploy/WarWatcher.java
-@@ -53,6 +53,12 @@ public class WarWatcher {
-
- /*--Constructor---------------------------------------------*/
-
-+ /**
-+ * Constructs a new WarWatcher.
-+ *
-+ * @param listener The listener to notify of changes
-+ * @param watchDir The directory to watch for WAR files
-+ */
- public WarWatcher(FileChangeListener listener, File watchDir) {
- this.listener = listener;
- this.watchDir = watchDir;
-@@ -132,6 +138,12 @@ public class WarWatcher {
- * File name filter for war files
- */
- protected static class WarFilter implements java.io.FilenameFilter {
-+ /**
-+ * Constructs a new WarFilter.
-+ */
-+ public WarFilter() {
-+ }
-+
- @Override
- public boolean accept(File path, String name) {
- if (name == null) {
-@@ -145,12 +157,26 @@ public class WarWatcher {
- * File information on existing WAR files
- */
- protected static class WarInfo {
-+ /**
-+ * The WAR file being tracked.
-+ */
- protected final File war;
-
-+ /**
-+ * The last time this file was checked.
-+ */
- protected long lastChecked;
-
-+ /**
-+ * The last known state of the file.
-+ */
- protected long lastState = 0;
-
-+ /**
-+ * Constructs a new WarInfo.
-+ *
-+ * @param war The WAR file to track
-+ */
- public WarInfo(File war) {
- this.war = war;
- this.lastChecked = war.lastModified();
-@@ -159,10 +185,20 @@ public class WarWatcher {
- }
- }
-
-+ /**
-+ * Returns whether the WAR file has been modified since last check.
-+ *
-+ * @return {@code true} if the file has been modified
-+ */
- public boolean modified() {
- return war.exists() && war.lastModified() > lastChecked;
- }
-
-+ /**
-+ * Returns whether the WAR file exists.
-+ *
-+ * @return {@code true} if the file exists
-+ */
- public boolean exists() {
- return war.exists();
- }
-@@ -193,6 +229,11 @@ public class WarWatcher {
- return result;
- }
-
-+ /**
-+ * Returns the WAR file.
-+ *
-+ * @return the WAR file
-+ */
- public File getWar() {
- return war;
- }
-@@ -211,6 +252,11 @@ public class WarWatcher {
- }
- }
-
-+ /**
-+ * Sets the last known state of the file.
-+ *
-+ * @param lastState The last state
-+ */
- protected void setLastState(int lastState) {
- this.lastState = lastState;
- }
-diff --git a/java/org/apache/catalina/loader/WebappClassLoader.java b/java/org/apache/catalina/loader/WebappClassLoader.java
-index 57eaf9e01e..c14edd6ebc 100644
---- a/java/org/apache/catalina/loader/WebappClassLoader.java
-+++ b/java/org/apache/catalina/loader/WebappClassLoader.java
-@@ -18,13 +18,23 @@ package org.apache.catalina.loader;
-
- import org.apache.catalina.LifecycleException;
-
-+/**
-+ * Standard web application class loader. Not parallel capable.
-+ */
- public class WebappClassLoader extends WebappClassLoaderBase {
-
-+ /**
-+ * Constructs a new WebappClassLoader.
-+ */
- public WebappClassLoader() {
- super();
- }
-
--
-+ /**
-+ * Constructs a new WebappClassLoader with the specified parent class loader.
-+ *
-+ * @param parent The parent class loader
-+ */
- public WebappClassLoader(ClassLoader parent) {
- super(parent);
- }
-diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
-index 502303b4b9..001fac24f0 100644
---- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
-+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
-@@ -321,11 +321,21 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
-
- // ------------------------------------------------------------- Properties
-
-+ /**
-+ * Sets the size of the cache for class resources that were not found.
-+ *
-+ * @param notFoundClassResourceCacheSize The cache size
-+ */
- public void setNotFoundClassResourceCacheSize(int notFoundClassResourceCacheSize) {
- notFoundClassResources.setLimit(notFoundClassResourceCacheSize);
- }
-
-
-+ /**
-+ * Returns the size of the cache for class resources that were not found.
-+ *
-+ * @return the cache size
-+ */
- public int getNotFoundClassResourceCacheSize() {
- return notFoundClassResources.getLimit();
- }
-@@ -380,11 +390,21 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
- }
-
-
-+ /**
-+ * Returns whether RMI target references should be cleared on reload.
-+ *
-+ * @return the clearReferencesRmiTargets flag
-+ */
- public boolean getClearReferencesRmiTargets() {
- return this.clearReferencesRmiTargets;
- }
-
-
-+ /**
-+ * Sets whether RMI target references should be cleared on reload.
-+ *
-+ * @param clearReferencesRmiTargets The new value
-+ */
- public void setClearReferencesRmiTargets(boolean clearReferencesRmiTargets) {
- this.clearReferencesRmiTargets = clearReferencesRmiTargets;
- }
-@@ -470,21 +490,41 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
- }
-
-
-+ /**
-+ * Returns whether ThreadLocal references should be cleared on reload.
-+ *
-+ * @return the clearReferencesThreadLocals flag
-+ */
- public boolean getClearReferencesThreadLocals() {
- return clearReferencesThreadLocals;
- }
-
-
-+ /**
-+ * Sets whether ThreadLocal references should be cleared on reload.
-+ *
-+ * @param clearReferencesThreadLocals The new value
-+ */
- public void setClearReferencesThreadLocals(boolean clearReferencesThreadLocals) {
- this.clearReferencesThreadLocals = clearReferencesThreadLocals;
- }
-
-
-+ /**
-+ * Returns whether memory leak checks should be skipped on JVM shutdown.
-+ *
-+ * @return the skipMemoryLeakChecksOnJvmShutdown flag
-+ */
- public boolean getSkipMemoryLeakChecksOnJvmShutdown() {
- return skipMemoryLeakChecksOnJvmShutdown;
- }
-
-
-+ /**
-+ * Sets whether memory leak checks should be skipped on JVM shutdown.
-+ *
-+ * @param skipMemoryLeakChecksOnJvmShutdown The new value
-+ */
- public void setSkipMemoryLeakChecksOnJvmShutdown(boolean skipMemoryLeakChecksOnJvmShutdown) {
- this.skipMemoryLeakChecksOnJvmShutdown = skipMemoryLeakChecksOnJvmShutdown;
- }
-@@ -522,6 +562,11 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
- }
- }
-
-+ /**
-+ * Copies the state of this class loader to another, excluding transformers.
-+ *
-+ * @param base The target class loader
-+ */
- protected void copyStateWithoutTransformers(WebappClassLoaderBase base) {
- base.resources = this.resources;
- base.delegate = this.delegate;
-@@ -618,6 +663,17 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
- // ---------------------------------------------------- ClassLoader Methods
-
-
-+ /**
-+ * Defines a class from byte array. Exposed for use by tests.
-+ *
-+ * @param name The class name
-+ * @param b The byte array
-+ * @param off The offset
-+ * @param len The length
-+ * @param protectionDomain The protection domain
-+ *
-+ * @return the defined class
-+ */
- // Note: exposed for use by tests
- protected final Class<?> doDefineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain) {
- return super.defineClass(name, b, off, len, protectionDomain);
-@@ -1198,6 +1254,13 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
- }
-
-
-+ /**
-+ * Checks that the class loader is in a valid state for class loading.
-+ *
-+ * @param className The class being loaded
-+ *
-+ * @throws ClassNotFoundException If the class loader is not in a valid state
-+ */
- protected void checkStateForClassLoading(String className) throws ClassNotFoundException {
- // It is not permitted to load new classes once the web application has
- // been stopped.
-@@ -1209,6 +1272,13 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
- }
-
-
-+ /**
-+ * Checks that the class loader is in a valid state for resource loading.
-+ *
-+ * @param resource The resource being loaded
-+ *
-+ * @throws IllegalStateException If the class loader is not in a valid state
-+ */
- protected void checkStateForResourceLoading(String resource) throws IllegalStateException {
- // It is not permitted to load resources once the web application has
- // been stopped.
-@@ -1350,10 +1420,22 @@ public abstract class WebappClassLoaderBase extends URLClassLoader
-
- // ------------------------------------------------------ Protected Methods
-
-+ /**
-+ * Returns the Java SE class loader.
-+ *
-+ * @return the Java SE class loader
-+ */
- protected ClassLoader getJavaseClassLoader() {
- return javaseClassLoader;
- }
-
-+ /**
-+ * Sets the Java SE class loader.
-+ *
-+ * @param classLoader The Java SE class loader
-+ *
-+ * @throws IllegalArgumentException If the class loader is null
-+ */
- protected void setJavaseClassLoader(ClassLoader classLoader) {
- if (classLoader == null) {
- throw new IllegalArgumentException(sm.getString("webappClassLoader.javaseClassLoaderNull"));
-diff --git a/java/org/apache/catalina/loader/WebappLoader.java b/java/org/apache/catalina/loader/WebappLoader.java
-index 680df31133..a973425676 100644
---- a/java/org/apache/catalina/loader/WebappLoader.java
-+++ b/java/org/apache/catalina/loader/WebappLoader.java
-@@ -56,6 +56,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class WebappLoader extends LifecycleMBeanBase implements Loader {
-
-+ /**
-+ * Constructs a new WebappLoader.
-+ */
-+ public WebappLoader() {
-+ }
-+
- private static final Log log = LogFactory.getLog(WebappLoader.class);
-
- // ----------------------------------------------------- Instance Variables
-@@ -157,6 +163,8 @@ public class WebappLoader extends LifecycleMBeanBase implements Loader {
-
-
- /**
-+ * Returns the Jakarta converter profile name.
-+ *
- * @return a non-null String if the loader will attempt to use the Jakarta converter. The String is the name of the
- * profile used for conversion.
- */
-@@ -179,7 +187,9 @@ public class WebappLoader extends LifecycleMBeanBase implements Loader {
-
-
- /**
-- * @return the ClassLoader class name.
-+ * Returns the ClassLoader class name.
-+ *
-+ * @return the ClassLoader class name
- */
- public String getLoaderClass() {
- return this.loaderClass;
-@@ -234,6 +244,11 @@ public class WebappLoader extends LifecycleMBeanBase implements Loader {
- }
-
-
-+ /**
-+ * Returns the loader repositories as an array of URLs.
-+ *
-+ * @return array of repository URLs
-+ */
- public String[] getLoaderRepositories() {
- if (classLoader == null) {
- return new String[0];
-@@ -246,6 +261,11 @@ public class WebappLoader extends LifecycleMBeanBase implements Loader {
- return result;
- }
-
-+ /**
-+ * Returns the loader repositories as a colon-separated string.
-+ *
-+ * @return colon-separated repository URLs
-+ */
- public String getLoaderRepositoriesString() {
- String[] repositories = getLoaderRepositories();
- StringBuilder sb = new StringBuilder();
-diff --git a/java/org/apache/catalina/manager/StatusManagerServlet.java b/java/org/apache/catalina/manager/StatusManagerServlet.java
-index 4ae4f38ad5..1d3623e029 100644
---- a/java/org/apache/catalina/manager/StatusManagerServlet.java
-+++ b/java/org/apache/catalina/manager/StatusManagerServlet.java
-@@ -48,6 +48,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class StatusManagerServlet extends HttpServlet implements NotificationListener {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StatusManagerServlet() {
-+ }
-+
- @Serial
- private static final long serialVersionUID = 1L;
-
-diff --git a/java/org/apache/catalina/manager/StatusTransformer.java b/java/org/apache/catalina/manager/StatusTransformer.java
-index 70fbedea0e..7cfbfa7403 100644
---- a/java/org/apache/catalina/manager/StatusTransformer.java
-+++ b/java/org/apache/catalina/manager/StatusTransformer.java
-@@ -43,8 +43,19 @@ import org.apache.tomcat.util.security.Escape;
- */
- public class StatusTransformer {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StatusTransformer() {
-+ }
-+
- // --------------------------------------------------------- Public Methods
-
-+ /**
-+ * Sets the response content type based on the output mode.
-+ * @param response the HTTP response
-+ * @param mode 0 for HTML, 1 for XML, 2 for JSON
-+ */
- public static void setContentType(HttpServletResponse response, int mode) {
- if (mode == 0) {
- response.setContentType("text/html;charset=" + Constants.CHARSET);
-@@ -105,6 +116,12 @@ public class StatusTransformer {
- }
-
-
-+ /**
-+ * Writes the page heading section.
-+ * @param writer the output writer
-+ * @param args formatting arguments
-+ * @param mode output mode (0=HTML)
-+ */
- public static void writePageHeading(PrintWriter writer, Object[] args, int mode) {
- if (mode == 0) {
- writer.print(MessageFormat.format(Constants.SERVER_HEADER_SECTION, args));
-@@ -112,6 +129,12 @@ public class StatusTransformer {
- }
-
-
-+ /**
-+ * Writes the server information row.
-+ * @param writer the output writer
-+ * @param args formatting arguments
-+ * @param mode output mode (0=HTML)
-+ */
- public static void writeServerInfo(PrintWriter writer, Object[] args, int mode) {
- if (mode == 0) {
- writer.print(MessageFormat.format(Constants.SERVER_ROW_SECTION, args));
-@@ -119,6 +142,11 @@ public class StatusTransformer {
- }
-
-
-+ /**
-+ * Writes the page footer.
-+ * @param writer the output writer
-+ * @param mode output mode (0=HTML, 1=XML, 2=JSON)
-+ */
- public static void writeFooter(PrintWriter writer, int mode) {
- if (mode == 0) {
- // HTML Tail Section
-diff --git a/java/org/apache/catalina/mapper/WrapperMappingInfo.java b/java/org/apache/catalina/mapper/WrapperMappingInfo.java
-index 37ba9acf32..ff53187ad2 100644
---- a/java/org/apache/catalina/mapper/WrapperMappingInfo.java
-+++ b/java/org/apache/catalina/mapper/WrapperMappingInfo.java
-@@ -26,20 +26,47 @@ import org.apache.catalina.Wrapper;
- * @param jspWildCard Is this a mapping for JSP files?
- * @param resourceOnly Is this a resource only mapping?
- */
--public record WrapperMappingInfo(String mapping, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly) {
-+public record WrapperMappingInfo(
-+ // @fmt:off
-+ String mapping, // The URL pattern
-+ Wrapper wrapper, // The wrapper for the Servlet
-+ boolean jspWildCard, // Is this a mapping for JSP files
-+ boolean resourceOnly // Is this a resource only mapping
-+ // @fmt:on
-+) {
-
-+ /**
-+ * Returns the URL pattern.
-+ *
-+ * @return the URL pattern
-+ */
- public String getMapping() {
- return mapping;
- }
-
-+ /**
-+ * Returns the wrapper for the Servlet.
-+ *
-+ * @return the wrapper
-+ */
- public Wrapper getWrapper() {
- return wrapper;
- }
-
-+ /**
-+ * Returns whether this is a mapping for JSP files.
-+ *
-+ * @return {@code true} if this is a JSP wildcard mapping
-+ */
- public boolean isJspWildCard() {
- return jspWildCard;
- }
-
-+ /**
-+ * Returns whether this is a resource only mapping.
-+ *
-+ * @return {@code true} if this is a resource only mapping
-+ */
- public boolean isResourceOnly() {
- return resourceOnly;
- }
-diff --git a/java/org/apache/catalina/mbeans/UserMBean.java b/java/org/apache/catalina/mbeans/UserMBean.java
-index 0f52efaa27..73853cdabd 100644
---- a/java/org/apache/catalina/mbeans/UserMBean.java
-+++ b/java/org/apache/catalina/mbeans/UserMBean.java
-@@ -38,6 +38,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class UserMBean extends BaseModelMBean {
-
-+ /**
-+ * Constructs a new UserMBean.
-+ */
-+ public UserMBean() {
-+ }
-+
- private static final StringManager sm = StringManager.getManager(UserMBean.class);
-
- // ----------------------------------------------------- Instance Variables
-@@ -58,7 +64,9 @@ public class UserMBean extends BaseModelMBean {
-
-
- /**
-- * @return the MBean Names of all groups this user is a member of.
-+ * Returns the MBean Names of all groups this user is a member of.
-+ *
-+ * @return the MBean Names of all groups this user is a member of
- */
- public String[] getGroups() {
-
-@@ -80,7 +88,9 @@ public class UserMBean extends BaseModelMBean {
-
-
- /**
-- * @return the MBean Names of all roles assigned to this user.
-+ * Returns the MBean Names of all roles assigned to this user.
-+ *
-+ * @return the MBean Names of all roles assigned to this user
- */
- public String[] getRoles() {
-
-diff --git a/java/org/apache/catalina/realm/UserDatabaseRealm.java b/java/org/apache/catalina/realm/UserDatabaseRealm.java
-index c6268af710..813a0559cb 100644
---- a/java/org/apache/catalina/realm/UserDatabaseRealm.java
-+++ b/java/org/apache/catalina/realm/UserDatabaseRealm.java
-@@ -44,6 +44,12 @@ import org.apache.tomcat.util.ExceptionUtils;
- */
- public class UserDatabaseRealm extends RealmBase {
-
-+ /**
-+ * Constructs a new UserDatabaseRealm.
-+ */
-+ public UserDatabaseRealm() {
-+ }
-+
- // ----------------------------------------------------- Instance Variables
-
- /**
-@@ -72,7 +78,9 @@ public class UserDatabaseRealm extends RealmBase {
- // ------------------------------------------------------------- Properties
-
- /**
-- * @return the global JNDI name of the <code>UserDatabase</code> resource we will be using.
-+ * Returns the global JNDI name of the <code>UserDatabase</code> resource we will be using.
-+ *
-+ * @return the global JNDI name of the <code>UserDatabase</code> resource we will be using
- */
- public String getResourceName() {
- return resourceName;
-@@ -90,6 +98,8 @@ public class UserDatabaseRealm extends RealmBase {
-
-
- /**
-+ * Returns whether a static principal disconnected from the database is used.
-+ *
- * @return the useStaticPrincipal flag
- */
- public boolean getUseStaticPrincipal() {
-@@ -160,6 +170,13 @@ public class UserDatabaseRealm extends RealmBase {
- }
-
-
-+ /**
-+ * Returns the roles associated with the given user, including roles from groups.
-+ *
-+ * @param user The user to get roles for
-+ *
-+ * @return Array of role names
-+ */
- public static String[] getRoles(User user) {
- Set<String> roles = new HashSet<>();
- Iterator<Role> uroles = user.getRoles();
-@@ -270,11 +287,21 @@ public class UserDatabaseRealm extends RealmBase {
- }
-
-
-+ /**
-+ * Principal implementation backed by a live {@link UserDatabase}. Roles are fetched from the database
-+ * on each call rather than cached at construction time.
-+ */
- public static final class UserDatabasePrincipal extends GenericPrincipal {
- @Serial
- private static final long serialVersionUID = 1L;
- private final transient UserDatabase database;
-
-+ /**
-+ * Constructs a new UserDatabasePrincipal.
-+ *
-+ * @param user The user
-+ * @param database The user database
-+ */
- public UserDatabasePrincipal(User user, UserDatabase database) {
- super(user.getName());
- this.database = database;
-diff --git a/java/org/apache/catalina/security/TLSCertificateReloadListener.java b/java/org/apache/catalina/security/TLSCertificateReloadListener.java
-index 6e321ebd05..e48d56276f 100644
---- a/java/org/apache/catalina/security/TLSCertificateReloadListener.java
-+++ b/java/org/apache/catalina/security/TLSCertificateReloadListener.java
-@@ -44,6 +44,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class TLSCertificateReloadListener implements LifecycleListener {
-
-+ /**
-+ * Constructs a new TLSCertificateReloadListener.
-+ */
-+ public TLSCertificateReloadListener() {
-+ }
-+
- private static final Log log = LogFactory.getLog(TLSCertificateReloadListener.class);
- private static final StringManager sm = StringManager.getManager(TLSCertificateReloadListener.class);
- private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
-diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java
-index a6ec28a85e..4ad86b815a 100644
---- a/java/org/apache/catalina/servlets/WebdavServlet.java
-+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
-@@ -182,6 +182,12 @@ import org.xml.sax.SAXException;
- */
- public class WebdavServlet extends DefaultServlet implements PeriodicEventListener {
-
-+ /**
-+ * Constructs a new WebdavServlet.
-+ */
-+ public WebdavServlet() {
-+ }
-+
- @Serial
- private static final long serialVersionUID = 1L;
-
-@@ -474,35 +480,45 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen
- }
-
- /**
-- * @return the updateType for this operation
-+ * Returns the update type for this operation.
-+ *
-+ * @return the updateType
- */
- public PropertyUpdateType getUpdateType() {
- return this.updateType;
- }
-
- /**
-- * @return the propertyNode the XML node that contains the property name (and value if SET)
-+ * Returns the XML node that contains the property name (and value if SET).
-+ *
-+ * @return the propertyNode
- */
- public Node getPropertyNode() {
- return this.propertyNode;
- }
-
- /**
-- * @return the statusCode to set as a result of the operation
-+ * Returns the status code to set as a result of the operation.
-+ *
-+ * @return the statusCode
- */
- public int getStatusCode() {
- return this.statusCode;
- }
-
- /**
-- * @param statusCode the statusCode to set as a result of the operation
-+ * Sets the status code as a result of the operation.
-+ *
-+ * @param statusCode the statusCode to set
- */
- public void setStatusCode(int statusCode) {
- this.statusCode = statusCode;
- }
-
- /**
-- * @return <code>true</code> if the property is protected
-+ * Returns whether the property is protected.
-+ *
-+ * @return {@code true} if the property is protected
- */
- public boolean getProtectedProperty() {
- return this.protectedProperty;
-@@ -513,8 +529,17 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen
- * Type of PROPFIND request.
- */
- public enum PropfindType {
-+ /**
-+ * Find by specific property.
-+ */
- FIND_BY_PROPERTY,
-+ /**
-+ * Find all properties.
-+ */
- FIND_ALL_PROP,
-+ /**
-+ * Find property names only.
-+ */
- FIND_PROPERTY_NAMES
- }
-
-@@ -523,7 +548,13 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen
- * Type of property update in a PROPPATCH.
- */
- public enum PropertyUpdateType {
-+ /**
-+ * Set a property.
-+ */
- SET,
-+ /**
-+ * Remove a property.
-+ */
- REMOVE
- }
-
-@@ -2922,6 +2953,12 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen
- */
- public static class MemoryPropertyStore implements PropertyStore {
-
-+ /**
-+ * Constructs a new MemoryPropertyStore.
-+ */
-+ public MemoryPropertyStore() {
-+ }
-+
- private final ConcurrentHashMap<String,ArrayList<Node>> deadProperties = new ConcurrentHashMap<>();
-
- @Override
-diff --git a/java/org/apache/catalina/session/StandardManager.java b/java/org/apache/catalina/session/StandardManager.java
-index 31de1d4a0c..bd64b6865e 100644
---- a/java/org/apache/catalina/session/StandardManager.java
-+++ b/java/org/apache/catalina/session/StandardManager.java
-@@ -50,6 +50,13 @@ import org.apache.tomcat.util.ExceptionUtils;
- */
- public class StandardManager extends ManagerBase {
-
-+ /**
-+ * Construct a new {@code StandardManager} instance.
-+ */
-+ public StandardManager() {
-+ // NO-OP
-+ }
-+
- private final Log log = LogFactory.getLog(StandardManager.class); // must not be static
-
- // ----------------------------------------------------- Instance Variables
-@@ -78,6 +85,8 @@ public class StandardManager extends ManagerBase {
-
-
- /**
-+ * Return the session persistence pathname, if any.
-+ *
- * @return The session persistence pathname, if any.
- */
- public String getPathname() {
-diff --git a/java/org/apache/catalina/session/StandardSessionAccessor.java b/java/org/apache/catalina/session/StandardSessionAccessor.java
-index 9ddc0f46a2..f9a1a7140e 100644
---- a/java/org/apache/catalina/session/StandardSessionAccessor.java
-+++ b/java/org/apache/catalina/session/StandardSessionAccessor.java
-@@ -28,6 +28,9 @@ import org.apache.juli.logging.LogFactory;
- import org.apache.tomcat.util.ExceptionUtils;
- import org.apache.tomcat.util.res.StringManager;
-
-+/**
-+ * Accessor for a StandardSession object.
-+ */
- public class StandardSessionAccessor implements HttpSession.Accessor {
-
- private static final Log log = LogFactory.getLog(StandardSessionAccessor.class);
-@@ -37,6 +40,12 @@ public class StandardSessionAccessor implements HttpSession.Accessor {
- private final String id;
-
-
-+ /**
-+ * Construct a new session accessor.
-+ *
-+ * @param manager The manager that owns the session
-+ * @param id The session identifier
-+ */
- public StandardSessionAccessor(Manager manager, String id) {
- if (manager == null) {
- throw new IllegalStateException(sm.getString("standardSessionAccessor.nullManager"));
-diff --git a/java/org/apache/catalina/session/StoreBase.java b/java/org/apache/catalina/session/StoreBase.java
-index 267fb3e9b8..ce853e19c9 100644
---- a/java/org/apache/catalina/session/StoreBase.java
-+++ b/java/org/apache/catalina/session/StoreBase.java
-@@ -38,6 +38,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public abstract class StoreBase extends LifecycleBase implements Store {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StoreBase() {
-+ }
-+
- // ----------------------------------------------------- Instance Variables
-
- /**
-diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java
-index 855416c191..97f130ace0 100644
---- a/java/org/apache/catalina/startup/Tomcat.java
-+++ b/java/org/apache/catalina/startup/Tomcat.java
-@@ -143,10 +143,24 @@ public class Tomcat {
- // so that configuration is not lost.
- private final Map<String,Logger> pinnedLoggers = new HashMap<>();
-
-+ /**
-+ * The embedded Server instance.
-+ */
- protected Server server;
-
-+ /**
-+ * The HTTP connector port.
-+ */
- protected int port = 8080;
-+
-+ /**
-+ * The default hostname.
-+ */
- protected String hostname = "localhost";
-+
-+ /**
-+ * The base directory for the embedded server.
-+ */
- protected String basedir;
-
- private final Map<String,String> userPass = new HashMap<>();
-@@ -155,6 +169,9 @@ public class Tomcat {
-
- private boolean addDefaultWebXmlToWebapp = true;
-
-+ /**
-+ * Constructs a new embedded Tomcat instance with default settings.
-+ */
- public Tomcat() {
- ExceptionUtils.preload();
- }
-@@ -550,6 +567,11 @@ public class Tomcat {
- }
- }
-
-+ /**
-+ * Returns the default Host for this embedded Tomcat instance.
-+ *
-+ * @return the default Host
-+ */
- public Host getHost() {
- Engine engine = getEngine();
- if (engine.findChildren().length > 0) {
-@@ -609,12 +631,12 @@ public class Tomcat {
- }
-
- /**
-+ * Adds a new context to the specified host.
-+ *
- * @param host The host in which the context will be deployed
-- * @param contextPath The context mapping to use, "" for root context.
-+ * @param contextPath The context mapping to use, "" for root context
- * @param dir Base directory for the context, for static files. Must exist, relative to the server home
-- *
- * @return the deployed context
-- *
- * @see #addContext(String, String)
- */
- public Context addContext(Host host, String contextPath, String dir) {
-@@ -622,8 +644,10 @@ public class Tomcat {
- }
-
- /**
-+ * Adds a new context to the specified host with the given context name.
-+ *
- * @param host The host in which the context will be deployed
-- * @param contextPath The context mapping to use, "" for root context.
-+ * @param contextPath The context mapping to use, "" for root context
- * @param contextName The context name
- * @param dir Base directory for the context, for static files. Must exist, relative to the server home
- *
-@@ -735,8 +759,10 @@ public class Tomcat {
- }
-
- /**
-+ * Returns a special path that disables the default web.xml.
-+ *
- * @return a pathname to pass to {@link ContextConfig#setDefaultWebXml(String)} when using
-- * {@link #getDefaultWebXmlListener()}.
-+ * {@link #getDefaultWebXmlListener()}
- */
- public String noDefaultWebXmlPath() {
- return Constants.NoDefaultWebXml;
-@@ -778,6 +804,9 @@ public class Tomcat {
- }
-
-
-+ /**
-+ * Initializes the base directory from system properties if not already set.
-+ */
- protected void initBaseDir() {
- String catalinaHome = System.getProperty(Globals.CATALINA_HOME_PROP);
- if (basedir == null) {
-@@ -1063,6 +1092,12 @@ public class Tomcat {
- */
- public static class FixContextListener implements LifecycleListener {
-
-+ /**
-+ * Constructs a new FixContextListener.
-+ */
-+ public FixContextListener() {
-+ }
-+
- @Override
- public void lifecycleEvent(LifecycleEvent event) {
- try {
-@@ -1092,6 +1127,12 @@ public class Tomcat {
- * programmatic configuration is lost. This listener sets the equivalent of conf/web.xml when the context starts.
- */
- public static class DefaultWebXmlListener implements LifecycleListener {
-+ /**
-+ * Constructs a new DefaultWebXmlListener.
-+ */
-+ public DefaultWebXmlListener() {
-+ }
-+
- @Override
- public void lifecycleEvent(LifecycleEvent event) {
- if (Lifecycle.BEFORE_START_EVENT.equals(event.getType())) {
-@@ -1108,6 +1149,11 @@ public class Tomcat {
- public static class ExistingStandardWrapper extends StandardWrapper {
- private final Servlet existing;
-
-+ /**
-+ * Wraps the given servlet.
-+ *
-+ * @param existing the servlet instance to wrap
-+ */
- public ExistingStandardWrapper(Servlet existing) {
- this.existing = existing;
- this.asyncSupported = hasAsync(existing);
-@@ -1153,6 +1199,13 @@ public class Tomcat {
- }
- }
-
-+ /**
-+ * Finds the web application configuration file (web.xml) for the given path.
-+ *
-+ * @param path the document base path
-+ * @param contextName the context name
-+ * @return the configuration file URL, or null if not found
-+ */
- protected URL getWebappConfigFile(String path, String contextName) {
- File docBase = new File(path);
- if (docBase.isDirectory()) {
-diff --git a/java/org/apache/catalina/startup/Tool.java b/java/org/apache/catalina/startup/Tool.java
-index 7b86ad0945..4eb1053657 100644
---- a/java/org/apache/catalina/startup/Tool.java
-+++ b/java/org/apache/catalina/startup/Tool.java
-@@ -63,6 +63,11 @@ import org.apache.juli.logging.LogFactory;
- */
- public final class Tool {
-
-+ /**
-+ * Constructs a new Tool. This utility class should not be instantiated.
-+ */
-+ public Tool() {
-+ }
-
- private static final Log log = LogFactory.getLog(Tool.class);
-
-diff --git a/java/org/apache/catalina/startup/UserConfig.java b/java/org/apache/catalina/startup/UserConfig.java
-index a44530dbd2..d7aaacee18 100644
---- a/java/org/apache/catalina/startup/UserConfig.java
-+++ b/java/org/apache/catalina/startup/UserConfig.java
-@@ -43,6 +43,11 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public final class UserConfig implements LifecycleListener {
-
-+ /**
-+ * Constructs a new UserConfig.
-+ */
-+ public UserConfig() {
-+ }
-
- private static final Log log = LogFactory.getLog(UserConfig.class);
-
-@@ -105,7 +110,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * @return the Context configuration class name.
-+ * Returns the Context configuration class name.
-+ *
-+ * @return the Context configuration class name
- */
- public String getConfigClass() {
- return this.configClass;
-@@ -113,9 +120,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * Set the Context configuration class name.
-+ * Sets the Context configuration class name.
- *
-- * @param configClass The new Context configuration class name.
-+ * @param configClass The new Context configuration class name
- */
- public void setConfigClass(String configClass) {
- this.configClass = configClass;
-@@ -123,7 +130,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * @return the Context implementation class name.
-+ * Returns the Context implementation class name.
-+ *
-+ * @return the Context implementation class name
- */
- public String getContextClass() {
- return this.contextClass;
-@@ -131,9 +140,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * Set the Context implementation class name.
-+ * Sets the Context implementation class name.
- *
-- * @param contextClass The new Context implementation class name.
-+ * @param contextClass The new Context implementation class name
- */
- public void setContextClass(String contextClass) {
- this.contextClass = contextClass;
-@@ -141,7 +150,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * @return the directory name for user web applications.
-+ * Returns the directory name for user web applications.
-+ *
-+ * @return the directory name
- */
- public String getDirectoryName() {
- return this.directoryName;
-@@ -149,7 +160,7 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * Set the directory name for user web applications.
-+ * Sets the directory name for user web applications.
- *
- * @param directoryName The new directory name
- */
-@@ -159,7 +170,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * @return the base directory containing user home directories.
-+ * Returns the base directory containing user home directories.
-+ *
-+ * @return the base directory
- */
- public String getHomeBase() {
- return this.homeBase;
-@@ -167,7 +180,7 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * Set the base directory containing user home directories.
-+ * Sets the base directory containing user home directories.
- *
- * @param homeBase The new base directory
- */
-@@ -177,7 +190,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * @return the user database class name for this component.
-+ * Returns the user database class name.
-+ *
-+ * @return the user database class name
- */
- public String getUserClass() {
- return this.userClass;
-@@ -185,7 +200,7 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * Set the user database class name for this component.
-+ * Sets the user database class name.
- *
- * @param userClass The user database class name
- */
-@@ -194,7 +209,9 @@ public final class UserConfig implements LifecycleListener {
- }
-
- /**
-- * @return the regular expression used to test for user who deployment is allowed.
-+ * Returns the regular expression that defines allowed users.
-+ *
-+ * @return the allow pattern, or null if all users are allowed
- */
- public String getAllow() {
- if (allow == null) {
-@@ -219,7 +236,9 @@ public final class UserConfig implements LifecycleListener {
-
-
- /**
-- * @return the regular expression used to test for user who deployment is denied.
-+ * Returns the regular expression that defines denied users.
-+ *
-+ * @return the deny pattern, or null if no users are denied
- */
- public String getDeny() {
- if (deny == null) {
-diff --git a/java/org/apache/catalina/startup/VersionLoggerListener.java b/java/org/apache/catalina/startup/VersionLoggerListener.java
-index 971baf3280..839b4b6363 100644
---- a/java/org/apache/catalina/startup/VersionLoggerListener.java
-+++ b/java/org/apache/catalina/startup/VersionLoggerListener.java
-@@ -38,6 +38,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class VersionLoggerListener implements LifecycleListener {
-
-+ /**
-+ * Constructs a new VersionLoggerListener.
-+ */
-+ public VersionLoggerListener() {
-+ }
-+
- private static final Log log = LogFactory.getLog(VersionLoggerListener.class);
-
- /**
-@@ -45,36 +51,74 @@ public class VersionLoggerListener implements LifecycleListener {
- */
- protected static final StringManager sm = StringManager.getManager(Constants.Package);
-
-+ /**
-+ * Whether to log JVM arguments.
-+ */
- private boolean logArgs = true;
-+ /**
-+ * Whether to log environment variables.
-+ */
- private boolean logEnv = false;
-+ /**
-+ * Whether to log system properties.
-+ */
- private boolean logProps = false;
-
--
-+ /**
-+ * Returns whether JVM arguments will be logged.
-+ *
-+ * @return {@code true} if JVM arguments will be logged
-+ */
- public boolean getLogArgs() {
- return logArgs;
- }
-
-
-+ /**
-+ * Sets whether JVM arguments will be logged.
-+ *
-+ * @param logArgs Whether to log JVM arguments
-+ */
- public void setLogArgs(boolean logArgs) {
- this.logArgs = logArgs;
- }
-
-
-+ /**
-+ * Returns whether environment variables will be logged.
-+ *
-+ * @return {@code true} if environment variables will be logged
-+ */
- public boolean getLogEnv() {
- return logEnv;
- }
-
-
-+ /**
-+ * Sets whether environment variables will be logged.
-+ *
-+ * @param logEnv Whether to log environment variables
-+ */
- public void setLogEnv(boolean logEnv) {
- this.logEnv = logEnv;
- }
-
-
-+ /**
-+ * Returns whether system properties will be logged.
-+ *
-+ * @return {@code true} if system properties will be logged
-+ */
- public boolean getLogProps() {
- return logProps;
- }
-
-
-+ /**
-+ * Sets whether system properties will be logged.
-+ *
-+ * @param logProps Whether to log system properties
-+ */
- public void setLogProps(boolean logProps) {
- this.logProps = logProps;
- }
-diff --git a/java/org/apache/catalina/startup/WebAnnotationSet.java b/java/org/apache/catalina/startup/WebAnnotationSet.java
-index f90b819e39..b8ee369aed 100644
---- a/java/org/apache/catalina/startup/WebAnnotationSet.java
-+++ b/java/org/apache/catalina/startup/WebAnnotationSet.java
-@@ -46,6 +46,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class WebAnnotationSet {
-
-+ /**
-+ * Constructs a new WebAnnotationSet.
-+ */
-+ public WebAnnotationSet() {
-+ }
-+
- private static final String SEPARATOR = "/";
- private static final String MAPPED_NAME_PROPERTY = "mappedName";
-
-@@ -194,6 +200,12 @@ public class WebAnnotationSet {
- }
-
-
-+ /**
-+ * Processes @Resource annotations on fields of the given class.
-+ *
-+ * @param context The context to add resources to
-+ * @param clazz The class to scan for field annotations
-+ */
- protected static void loadFieldsAnnotation(Context context, Class<?> clazz) {
- // Initialize the annotations
- for (Field field : clazz.getDeclaredFields()) {
-@@ -207,6 +219,12 @@ public class WebAnnotationSet {
- }
-
-
-+ /**
-+ * Processes @Resource annotations on methods of the given class.
-+ *
-+ * @param context The context to add resources to
-+ * @param clazz The class to scan for method annotations
-+ */
- protected static void loadMethodsAnnotation(Context context, Class<?> clazz) {
- // Initialize the annotations
- for (Method method : clazz.getDeclaredMethods()) {
-@@ -237,6 +255,14 @@ public class WebAnnotationSet {
- }
-
-
-+ /**
-+ * Processes a Resource annotation with default name and type.
-+ *
-+ * @param context The context to add resources to
-+ * @param annotation The annotation
-+ * @param defaultName The default resource name
-+ * @param defaultType The default resource type
-+ */
- protected static void addResource(Context context, Resource annotation, String defaultName, Class<?> defaultType) {
- String name = getName(annotation, defaultName);
- String type = getType(annotation, defaultType);
-diff --git a/java/org/apache/catalina/storeconfig/StandardContextSF.java b/java/org/apache/catalina/storeconfig/StandardContextSF.java
-index 34651364eb..c4302ce14c 100644
---- a/java/org/apache/catalina/storeconfig/StandardContextSF.java
-+++ b/java/org/apache/catalina/storeconfig/StandardContextSF.java
-@@ -58,6 +58,12 @@ public class StandardContextSF extends StoreFactoryBase {
-
- private static final Log log = LogFactory.getLog(StandardContextSF.class);
-
-+ /**
-+ * Constructs a new StandardContextSF instance for storing Context elements in server.xml.
-+ */
-+ public StandardContextSF() {
-+ }
-+
- /**
- * Store a Context as Separate file as configFile value from context exists. filename can be relative to
- * catalina.base.
-diff --git a/java/org/apache/catalina/storeconfig/StandardEngineSF.java b/java/org/apache/catalina/storeconfig/StandardEngineSF.java
-index dc83d09d2f..bd5d074491 100644
---- a/java/org/apache/catalina/storeconfig/StandardEngineSF.java
-+++ b/java/org/apache/catalina/storeconfig/StandardEngineSF.java
-@@ -33,6 +33,12 @@ import org.apache.catalina.ha.ClusterValve;
- */
- public class StandardEngineSF extends StoreFactoryBase {
-
-+ /**
-+ * Constructs a new StandardEngineSF instance for storing Engine elements in server.xml.
-+ */
-+ public StandardEngineSF() {
-+ }
-+
- /**
- * Store the specified Engine properties.
- * <p>
-diff --git a/java/org/apache/catalina/storeconfig/StandardHostSF.java b/java/org/apache/catalina/storeconfig/StandardHostSF.java
-index 671135fd76..0933da254a 100644
---- a/java/org/apache/catalina/storeconfig/StandardHostSF.java
-+++ b/java/org/apache/catalina/storeconfig/StandardHostSF.java
-@@ -33,6 +33,12 @@ import org.apache.catalina.ha.ClusterValve;
- */
- public class StandardHostSF extends StoreFactoryBase {
-
-+ /**
-+ * Constructs a new StandardHostSF instance for storing Host elements in server.xml.
-+ */
-+ public StandardHostSF() {
-+ }
-+
- /**
- * Store the specified Host properties and children (Listener,Alias,Realm,Valve,Cluster, Context)
- * <p>
-diff --git a/java/org/apache/catalina/storeconfig/StandardServerSF.java b/java/org/apache/catalina/storeconfig/StandardServerSF.java
-index fda872ab68..ed530d0638 100644
---- a/java/org/apache/catalina/storeconfig/StandardServerSF.java
-+++ b/java/org/apache/catalina/storeconfig/StandardServerSF.java
-@@ -28,6 +28,12 @@ import org.apache.catalina.deploy.NamingResourcesImpl;
- */
- public class StandardServerSF extends StoreFactoryBase {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StandardServerSF() {
-+ }
-+
- @Override
- public void store(PrintWriter aWriter, int indent, Object aServer) throws Exception {
- storeXMLHead(aWriter);
-diff --git a/java/org/apache/catalina/storeconfig/StandardServiceSF.java b/java/org/apache/catalina/storeconfig/StandardServiceSF.java
-index 95f556f887..4d295eaecd 100644
---- a/java/org/apache/catalina/storeconfig/StandardServiceSF.java
-+++ b/java/org/apache/catalina/storeconfig/StandardServiceSF.java
-@@ -29,6 +29,12 @@ import org.apache.catalina.core.StandardService;
- */
- public class StandardServiceSF extends StoreFactoryBase {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StandardServiceSF() {
-+ }
-+
- /**
- * Store the specified service element children.
- * <p>
-diff --git a/java/org/apache/catalina/storeconfig/StoreAppender.java b/java/org/apache/catalina/storeconfig/StoreAppender.java
-index ab9bf1b6e3..6f188184c5 100644
---- a/java/org/apache/catalina/storeconfig/StoreAppender.java
-+++ b/java/org/apache/catalina/storeconfig/StoreAppender.java
-@@ -32,6 +32,12 @@ import org.apache.tomcat.util.security.Escape;
- */
- public class StoreAppender {
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StoreAppender() {
-+ }
-+
- /**
- * The set of classes that represent persistable properties.
- */
-diff --git a/java/org/apache/catalina/storeconfig/StoreConfig.java b/java/org/apache/catalina/storeconfig/StoreConfig.java
-index 953cb6b192..3be20e19d3 100644
---- a/java/org/apache/catalina/storeconfig/StoreConfig.java
-+++ b/java/org/apache/catalina/storeconfig/StoreConfig.java
-@@ -39,8 +39,17 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class StoreConfig implements IStoreConfig {
- private static final Log log = LogFactory.getLog(StoreConfig.class);
-+ /**
-+ * String manager for this class.
-+ */
- protected static final StringManager sm = StringManager.getManager(Constants.Package);
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StoreConfig() {
-+ }
-+
- private String serverFilename = "conf/server.xml";
-
- private StoreRegistry registry;
-diff --git a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
-index a75d20a83a..7e98cb7974 100644
---- a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
-+++ b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
-@@ -37,6 +37,12 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class StoreConfigLifecycleListener implements LifecycleListener {
-
-+ /**
-+ * Constructs a new StoreConfigLifecycleListener with default settings.
-+ */
-+ public StoreConfigLifecycleListener() {
-+ }
-+
- private static final Log log = LogFactory.getLog(StoreConfigLifecycleListener.class);
- private static final StringManager sm = StringManager.getManager(StoreConfigLifecycleListener.class);
-
-@@ -117,6 +123,7 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
- }
-
- /**
-+ * Returns the store config instance.
- * @return the store config instance
- */
- public IStoreConfig getStoreConfig() {
-@@ -124,6 +131,7 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
- }
-
- /**
-+ * Sets the store config instance.
- * @param storeConfig The storeConfig to set.
- */
- public void setStoreConfig(IStoreConfig storeConfig) {
-@@ -131,6 +139,8 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
- }
-
- /**
-+ * Returns the fully qualified class name of the StoreConfig implementation.
-+ *
- * @return the main store config class name
- */
- public String getStoreConfigClass() {
-@@ -138,6 +148,8 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
- }
-
- /**
-+ * Sets the fully qualified class name of the StoreConfig implementation.
-+ *
- * @param storeConfigClass The storeConfigClass to set.
- */
- public void setStoreConfigClass(String storeConfigClass) {
-@@ -145,6 +157,8 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
- }
-
- /**
-+ * Returns the name of the StoreRegistry MBean.
-+ *
- * @return the store registry
- */
- public String getStoreRegistry() {
-@@ -152,6 +166,8 @@ public class StoreConfigLifecycleListener implements LifecycleListener {
- }
-
- /**
-+ * Sets the name of the StoreRegistry MBean.
-+ *
- * @param storeRegistry The storeRegistry to set.
- */
- public void setStoreRegistry(String storeRegistry) {
-diff --git a/java/org/apache/catalina/storeconfig/StoreContextAppender.java b/java/org/apache/catalina/storeconfig/StoreContextAppender.java
-index 94fe0471ad..74247f532e 100644
---- a/java/org/apache/catalina/storeconfig/StoreContextAppender.java
-+++ b/java/org/apache/catalina/storeconfig/StoreContextAppender.java
-@@ -30,6 +30,12 @@ import org.apache.catalina.core.StandardHost;
- */
- public class StoreContextAppender extends StoreAppender {
-
-+ /**
-+ * Constructs a new StoreContextAppender for handling StandardContext serialization.
-+ */
-+ public StoreContextAppender() {
-+ }
-+
- /**
- * {@inheritDoc} Adds special handling for <code>docBase</code>.
- */
-@@ -83,6 +89,13 @@ public class StoreContextAppender extends StoreAppender {
- return isPrint;
- }
-
-+ /**
-+ * Resolves the absolute canonical path of the application base directory
-+ * for the given host.
-+ *
-+ * @param host The StandardHost instance
-+ * @return The canonical File representing the appBase directory
-+ */
- protected File getAppBase(StandardHost host) {
-
- File appBase;
-@@ -99,6 +112,14 @@ public class StoreContextAppender extends StoreAppender {
-
- }
-
-+ /**
-+ * Resolves the absolute canonical path of the document base directory
-+ * for the given context.
-+ *
-+ * @param context The StandardContext instance
-+ * @param appBase The application base directory
-+ * @return The canonical File representing the docBase directory
-+ */
- protected File getDocBase(StandardContext context, File appBase) {
- File docBase;
- String contextDocBase = context.getOriginalDocBase();
-diff --git a/java/org/apache/catalina/storeconfig/StoreDescription.java b/java/org/apache/catalina/storeconfig/StoreDescription.java
-index f5378aa2e9..64c67b4913 100644
---- a/java/org/apache/catalina/storeconfig/StoreDescription.java
-+++ b/java/org/apache/catalina/storeconfig/StoreDescription.java
-@@ -54,6 +54,12 @@ import java.util.List;
- */
- public class StoreDescription {
-
-+ /**
-+ * Constructs a new StoreDescription with default settings.
-+ */
-+ public StoreDescription() {
-+ }
-+
- private String id;
-
- private String tag;
-@@ -87,153 +93,208 @@ public class StoreDescription {
- private boolean storeSeparate = false;
-
- /**
-- * @return Returns the external.
-+ * Indicates whether external (separate file) storage is allowed for this description.
-+ *
-+ * @return true if external storage is allowed
- */
- public boolean isExternalAllowed() {
- return externalAllowed;
- }
-
- /**
-- * @param external The external to set.
-+ * Sets whether external (separate file) storage is allowed for this description.
-+ *
-+ * @param external true if external storage is allowed
- */
- public void setExternalAllowed(boolean external) {
- this.externalAllowed = external;
- }
-
-+ /**
-+ * Indicates whether this description is restricted to external storage only.
-+ *
-+ * @return true if external storage is the only allowed option
-+ */
- public boolean isExternalOnly() {
- return externalOnly;
- }
-
-+ /**
-+ * Sets whether this description is restricted to external storage only.
-+ *
-+ * @param external true if external storage is the only allowed option
-+ */
- public void setExternalOnly(boolean external) {
- this.externalOnly = external;
- }
-
- /**
-- * @return Returns the standard.
-+ * Indicates whether this description represents a standard component.
-+ *
-+ * @return true if this is a standard component
- */
- public boolean isStandard() {
- return standard;
- }
-
- /**
-- * @param standard The standard to set.
-+ * Sets whether this description represents a standard component.
-+ *
-+ * @param standard true if this is a standard component
- */
- public void setStandard(boolean standard) {
- this.standard = standard;
- }
-
- /**
-- * @return Returns the backup.
-+ * Indicates whether a backup of the configuration should be created.
-+ *
-+ * @return true if backup is enabled
- */
- public boolean isBackup() {
- return backup;
- }
-
- /**
-- * @param backup The backup to set.
-+ * Sets whether a backup of the configuration should be created.
-+ *
-+ * @param backup true if backup is enabled
- */
- public void setBackup(boolean backup) {
- this.backup = backup;
- }
-
- /**
-- * @return Returns the myDefault.
-+ * Indicates whether this description represents a default component.
-+ *
-+ * @return true if this is a default component
- */
- public boolean isDefault() {
- return myDefault;
- }
-
- /**
-- * @param aDefault The myDefault to set.
-+ * Sets whether this description represents a default component.
-+ *
-+ * @param aDefault true if this is a default component
- */
- public void setDefault(boolean aDefault) {
- this.myDefault = aDefault;
- }
-
- /**
-- * @return Returns the storeFactory.
-+ * Returns the fully qualified class name of the StoreFactory implementation.
-+ *
-+ * @return the StoreFactory class name
- */
- public String getStoreFactoryClass() {
- return storeFactoryClass;
- }
-
- /**
-- * @param storeFactoryClass The storeFactory to set.
-+ * Sets the fully qualified class name of the StoreFactory implementation.
-+ *
-+ * @param storeFactoryClass the StoreFactory class name
- */
- public void setStoreFactoryClass(String storeFactoryClass) {
- this.storeFactoryClass = storeFactoryClass;
- }
-
- /**
-- * @return Returns the storeFactory.
-+ * Returns the StoreFactory instance used to create objects for this description.
-+ *
-+ * @return the StoreFactory instance
- */
- public IStoreFactory getStoreFactory() {
- return storeFactory;
- }
-
- /**
-- * @param storeFactory The storeFactory to set.
-+ * Sets the StoreFactory instance used to create objects for this description.
-+ *
-+ * @param storeFactory the StoreFactory instance
- */
- public void setStoreFactory(IStoreFactory storeFactory) {
- this.storeFactory = storeFactory;
- }
-
- /**
-- * @return Returns the storeWriterClass.
-+ * Returns the fully qualified class name of the StoreWriter implementation.
-+ *
-+ * @return the StoreWriter class name
- */
- public String getStoreWriterClass() {
- return storeWriterClass;
- }
-
- /**
-- * @param storeWriterClass The storeWriterClass to set.
-+ * Sets the fully qualified class name of the StoreWriter implementation.
-+ *
-+ * @param storeWriterClass the StoreWriter class name
- */
- public void setStoreWriterClass(String storeWriterClass) {
- this.storeWriterClass = storeWriterClass;
- }
-
- /**
-- * @return Returns the tagClass.
-+ * Returns the XML tag name for this description.
-+ *
-+ * @return the XML tag name
- */
- public String getTag() {
- return tag;
- }
-
- /**
-- * @param tag The tag to set.
-+ * Sets the XML tag name for this description.
-+ *
-+ * @param tag the XML tag name
- */
- public void setTag(String tag) {
- this.tag = tag;
- }
-
- /**
-- * @return Returns the tagClass.
-+ * Returns the fully qualified class name associated with this description's tag.
-+ *
-+ * @return the tag class name
- */
- public String getTagClass() {
- return tagClass;
- }
-
- /**
-- * @param tagClass The tagClass to set.
-+ * Sets the fully qualified class name associated with this description's tag.
-+ *
-+ * @param tagClass the tag class name
- */
- public void setTagClass(String tagClass) {
- this.tagClass = tagClass;
- }
-
- /**
-- * @return Returns the transientAttributes.
-+ * Returns the list of attribute names that should not be persisted.
-+ *
-+ * @return the list of transient attribute names
- */
- public List<String> getTransientAttributes() {
- return transientAttributes;
- }
-
- /**
-- * @param transientAttributes The transientAttributes to set.
-+ * Sets the list of attribute names that should not be persisted.
-+ *
-+ * @param transientAttributes the list of transient attribute names
- */
- public void setTransientAttributes(List<String> transientAttributes) {
- this.transientAttributes = transientAttributes;
- }
-
-+ /**
-+ * Adds an attribute name to the list of transient attributes that should not be persisted.
-+ *
-+ * @param attribute the attribute name to add
-+ */
- public void addTransientAttribute(String attribute) {
- if (transientAttributes == null) {
- transientAttributes = new ArrayList<>();
-@@ -241,6 +302,11 @@ public class StoreDescription {
- transientAttributes.add(attribute);
- }
-
-+ /**
-+ * Removes an attribute name from the list of transient attributes.
-+ *
-+ * @param attribute the attribute name to remove
-+ */
- public void removeTransientAttribute(String attribute) {
- if (transientAttributes != null) {
- transientAttributes.remove(attribute);
-@@ -248,19 +314,28 @@ public class StoreDescription {
- }
-
- /**
-- * @return Returns the transientChildren.
-+ * Returns the list of child class names that should not be persisted.
-+ *
-+ * @return the list of transient child class names
- */
- public List<String> getTransientChildren() {
- return transientChildren;
- }
-
- /**
-- * @param transientChildren The transientChildren to set.
-+ * Sets the list of child class names that should not be persisted.
-+ *
-+ * @param transientChildren the list of transient child class names
- */
- public void setTransientChildren(List<String> transientChildren) {
- this.transientChildren = transientChildren;
- }
-
-+ /**
-+ * Adds a child class name to the list of transient children that should not be persisted.
-+ *
-+ * @param classname the child class name to add
-+ */
- public void addTransientChild(String classname) {
- if (transientChildren == null) {
- transientChildren = new ArrayList<>();
-@@ -268,6 +343,11 @@ public class StoreDescription {
- transientChildren.add(classname);
- }
-
-+ /**
-+ * Removes a child class name from the list of transient children.
-+ *
-+ * @param classname the child class name to remove
-+ */
- public void removeTransientChild(String classname) {
- if (transientChildren != null) {
- transientChildren.remove(classname);
-@@ -316,46 +396,63 @@ public class StoreDescription {
- }
-
- /**
-- * @param id The id to set.
-+ * Sets the unique identifier for this description.
-+ *
-+ * @param id the unique identifier
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
-- * @return Returns the attributes.
-+ * Indicates whether the attributes of this component should be stored.
-+ *
-+ * @return true if attributes should be stored
- */
- public boolean isAttributes() {
- return attributes;
- }
-
- /**
-- * @param attributes The attributes to set.
-+ * Sets whether the attributes of this component should be stored.
-+ *
-+ * @param attributes true if attributes should be stored
- */
- public void setAttributes(boolean attributes) {
- this.attributes = attributes;
- }
-
- /**
-- * @return True if it's a separate store
-+ * Indicates whether this component should be stored in a separate file.
-+ *
-+ * @return true if it's a separate store
- */
- public boolean isStoreSeparate() {
- return storeSeparate;
- }
-
-+ /**
-+ * Sets whether this component should be stored in a separate file.
-+ *
-+ * @param storeSeparate true if it should be stored separately
-+ */
- public void setStoreSeparate(boolean storeSeparate) {
- this.storeSeparate = storeSeparate;
- }
-
- /**
-- * @return Returns the children.
-+ * Indicates whether child components should be stored.
-+ *
-+ * @return true if children should be stored
- */
- public boolean isChildren() {
- return children;
- }
-
- /**
-- * @param children The children to set.
-+ * Sets whether child components should be stored.
-+ *
-+ * @param children true if children should be stored
- */
- public void setChildren(boolean children) {
- this.children = children;
-diff --git a/java/org/apache/catalina/storeconfig/StoreFactoryBase.java b/java/org/apache/catalina/storeconfig/StoreFactoryBase.java
-index 17a6e47d2e..a3ec337d1f 100644
---- a/java/org/apache/catalina/storeconfig/StoreFactoryBase.java
-+++ b/java/org/apache/catalina/storeconfig/StoreFactoryBase.java
-@@ -27,6 +27,12 @@ import org.apache.tomcat.util.res.StringManager;
- * StoreFactory saves special elements. Output was generate with StoreAppenders.
- */
- public class StoreFactoryBase implements IStoreFactory {
-+ /**
-+ * Constructs a new StoreFactoryBase with default settings.
-+ */
-+ public StoreFactoryBase() {
-+ }
-+
- private static final Log log = LogFactory.getLog(StoreFactoryBase.class);
-
- private StoreRegistry registry;
-diff --git a/java/org/apache/catalina/storeconfig/StoreFileMover.java b/java/org/apache/catalina/storeconfig/StoreFileMover.java
-index 1e5e5dc775..f10ca01428 100644
---- a/java/org/apache/catalina/storeconfig/StoreFileMover.java
-+++ b/java/org/apache/catalina/storeconfig/StoreFileMover.java
-@@ -33,6 +33,9 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class StoreFileMover {
-
-+ /**
-+ * The string manager for this package.
-+ */
- protected static final StringManager sm = StringManager.getManager(Constants.Package);
-
- private String filename = "conf/server.xml";
-@@ -48,63 +51,81 @@ public class StoreFileMover {
- private File configSave;
-
- /**
-- * @return Returns the configNew.
-+ * Returns the File object representing the new configuration file.
-+ *
-+ * @return the new configuration file
- */
- public File getConfigNew() {
- return configNew;
- }
-
- /**
-- * @return Returns the configOld.
-+ * Returns the File object representing the old configuration file.
-+ *
-+ * @return the old configuration file
- */
- public File getConfigOld() {
- return configOld;
- }
-
- /**
-- * @return Returns the configSave.
-+ * Returns the File object representing the saved backup configuration file.
-+ *
-+ * @return the backup configuration file
- */
- public File getConfigSave() {
- return configSave;
- }
-
- /**
-- * @return Returns the basename.
-+ * Returns the base directory path for configuration files.
-+ *
-+ * @return the base directory path
- */
- public String getBasename() {
- return basename;
- }
-
- /**
-- * @param basename The basename to set.
-+ * Sets the base directory path for configuration files.
-+ *
-+ * @param basename the base directory path
- */
- public void setBasename(String basename) {
- this.basename = basename;
- }
-
- /**
-- * @return The file name
-+ * Returns the configuration file name.
-+ *
-+ * @return the configuration file name
- */
- public String getFilename() {
- return filename;
- }
-
- /**
-- * @param string The file name
-+ * Sets the configuration file name.
-+ *
-+ * @param string the configuration file name
- */
- public void setFilename(String string) {
- filename = string;
- }
-
- /**
-- * @return The encoding
-+ * Returns the character encoding used for configuration files.
-+ *
-+ * @return the character encoding
- */
- public String getEncoding() {
- return encoding;
- }
-
- /**
-- * @param string The encoding
-+ * Sets the character encoding used for configuration files.
-+ *
-+ * @param string the character encoding
- */
- public void setEncoding(String string) {
- encoding = string;
-diff --git a/java/org/apache/catalina/storeconfig/StoreLoader.java b/java/org/apache/catalina/storeconfig/StoreLoader.java
-index 61137e4f7b..1ccb0e22ef 100644
---- a/java/org/apache/catalina/storeconfig/StoreLoader.java
-+++ b/java/org/apache/catalina/storeconfig/StoreLoader.java
-@@ -66,6 +66,12 @@ import org.apache.tomcat.util.file.ConfigurationSource.Resource;
- */
- public class StoreLoader {
-
-+ /**
-+ * Constructs a new StoreLoader for parsing store registry XML descriptors.
-+ */
-+ public StoreLoader() {
-+ }
-+
- /**
- * The <code>Digester</code> instance used to parse registry descriptors.
- */
-@@ -76,14 +82,18 @@ public class StoreLoader {
- private URL registryResource;
-
- /**
-- * @return Returns the registry.
-+ * Returns the StoreRegistry instance loaded from the configuration.
-+ *
-+ * @return the StoreRegistry instance
- */
- public StoreRegistry getRegistry() {
- return registry;
- }
-
- /**
-- * @param registry The registry to set.
-+ * Sets the StoreRegistry instance to use.
-+ *
-+ * @param registry the StoreRegistry instance
- */
- public void setRegistry(StoreRegistry registry) {
- this.registry = registry;
-@@ -150,7 +160,9 @@ public class StoreLoader {
- }
-
- /**
-- * @return the registryResource.
-+ * Returns the URL of the registry resource that was loaded.
-+ *
-+ * @return the registry resource URL
- */
- public URL getRegistryResource() {
- return registryResource;
-diff --git a/java/org/apache/catalina/storeconfig/StoreRegistry.java b/java/org/apache/catalina/storeconfig/StoreRegistry.java
-index c17dd3817e..7389cf9ddf 100644
---- a/java/org/apache/catalina/storeconfig/StoreRegistry.java
-+++ b/java/org/apache/catalina/storeconfig/StoreRegistry.java
-@@ -49,6 +49,12 @@ import org.apache.tomcat.util.res.StringManager;
- * Central StoreRegistry for all server.xml elements
- */
- public class StoreRegistry {
-+ /**
-+ * Constructs a new StoreRegistry with default settings.
-+ */
-+ public StoreRegistry() {
-+ }
-+
- private static final Log log = LogFactory.getLog(StoreRegistry.class);
- private static final StringManager sm = StringManager.getManager(StoreRegistry.class);
-
-@@ -68,28 +74,36 @@ public class StoreRegistry {
- CredentialHandler.class, UpgradeProtocol.class, CookieProcessor.class };
-
- /**
-- * @return the name
-+ * Returns the name of this registry.
-+ *
-+ * @return the registry name
- */
- public String getName() {
- return name;
- }
-
- /**
-- * @param name The name to set.
-+ * Sets the name of this registry.
-+ *
-+ * @param name the registry name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
-- * @return the version
-+ * Returns the version of this registry.
-+ *
-+ * @return the registry version
- */
- public String getVersion() {
- return version;
- }
-
- /**
-- * @param version The version to set
-+ * Sets the version of this registry.
-+ *
-+ * @param version the registry version
- */
- public void setVersion(String version) {
- this.version = version;
-@@ -206,7 +220,9 @@ public class StoreRegistry {
- // Attributes
-
- /**
-- * @return the encoding
-+ * Returns the character encoding used when writing configuration files.
-+ *
-+ * @return the character encoding
- */
- public String getEncoding() {
- return encoding;
-diff --git a/java/org/apache/catalina/storeconfig/WatchedResourceSF.java b/java/org/apache/catalina/storeconfig/WatchedResourceSF.java
-index d5b4419ef2..a1c6849db9 100644
---- a/java/org/apache/catalina/storeconfig/WatchedResourceSF.java
-+++ b/java/org/apache/catalina/storeconfig/WatchedResourceSF.java
-@@ -22,7 +22,16 @@ import org.apache.catalina.core.StandardContext;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Store factory for watched resources in a StandardContext.
-+ */
- public class WatchedResourceSF extends StoreFactoryBase {
-+
-+ /**
-+ * Constructs a new WatchedResourceSF.
-+ */
-+ public WatchedResourceSF() {
-+ }
- private static final Log log = LogFactory.getLog(WatchedResourceSF.class);
-
- @Override
-diff --git a/java/org/apache/catalina/storeconfig/WebResourceRootSF.java b/java/org/apache/catalina/storeconfig/WebResourceRootSF.java
-index d42d972752..0c13db466b 100644
---- a/java/org/apache/catalina/storeconfig/WebResourceRootSF.java
-+++ b/java/org/apache/catalina/storeconfig/WebResourceRootSF.java
-@@ -26,6 +26,12 @@ import org.apache.catalina.WebResourceSet;
- */
- public class WebResourceRootSF extends StoreFactoryBase {
-
-+ /**
-+ * Constructs a new WebResourceRootSF.
-+ */
-+ public WebResourceRootSF() {
-+ }
-+
- /**
- * Store the specified Resources children.
- * <p>
-diff --git a/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java b/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java
-index c4eda69f12..856787f45f 100644
---- a/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java
-+++ b/java/org/apache/catalina/storeconfig/WrapperLifecycleSF.java
-@@ -22,7 +22,16 @@ import org.apache.catalina.core.StandardContext;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Store factory for wrapper lifecycle listeners.
-+ */
- public class WrapperLifecycleSF extends StoreFactoryBase {
-+
-+ /**
-+ * Constructs a new WrapperLifecycleSF.
-+ */
-+ public WrapperLifecycleSF() {
-+ }
- private static final Log log = LogFactory.getLog(WrapperLifecycleSF.class);
-
- @Override
-diff --git a/java/org/apache/catalina/storeconfig/WrapperListenerSF.java b/java/org/apache/catalina/storeconfig/WrapperListenerSF.java
-index 4323a2c1d8..5018caf466 100644
---- a/java/org/apache/catalina/storeconfig/WrapperListenerSF.java
-+++ b/java/org/apache/catalina/storeconfig/WrapperListenerSF.java
-@@ -22,7 +22,16 @@ import org.apache.catalina.core.StandardContext;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Store factory for wrapper listeners.
-+ */
- public class WrapperListenerSF extends StoreFactoryBase {
-+
-+ /**
-+ * Constructs a new WrapperListenerSF.
-+ */
-+ public WrapperListenerSF() {
-+ }
- private static final Log log = LogFactory.getLog(WrapperListenerSF.class);
-
- @Override
-diff --git a/java/org/apache/catalina/tribes/UniqueId.java b/java/org/apache/catalina/tribes/UniqueId.java
-index 78ffb59150..35ef5ec31b 100644
---- a/java/org/apache/catalina/tribes/UniqueId.java
-+++ b/java/org/apache/catalina/tribes/UniqueId.java
-@@ -28,16 +28,34 @@ public final class UniqueId implements Serializable {
- @Serial
- private static final long serialVersionUID = 1L;
-
-+ /**
-+ * The raw byte array containing the unique identifier.
-+ */
- final byte[] id;
-
-+ /**
-+ * Constructs a new UniqueId with a null identifier.
-+ */
- public UniqueId() {
- this(null);
- }
-
-+ /**
-+ * Constructs a new UniqueId from the given byte array.
-+ *
-+ * @param id the byte array containing the identifier
-+ */
- public UniqueId(byte[] id) {
- this.id = id;
- }
-
-+ /**
-+ * Constructs a new UniqueId from a portion of the given byte array.
-+ *
-+ * @param id the source byte array
-+ * @param offset the start offset
-+ * @param length the number of bytes
-+ */
- public UniqueId(byte[] id, int offset, int length) {
- this.id = new byte[length];
- System.arraycopy(id, offset, this.id, 0, length);
-@@ -69,6 +87,11 @@ public final class UniqueId implements Serializable {
- return result;
- }
-
-+ /**
-+ * Returns the raw bytes of this unique identifier.
-+ *
-+ * @return the byte array
-+ */
- public byte[] getBytes() {
- return id;
- }
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java b/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
-index 942ef08eb2..233bd3cfaf 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
-@@ -33,24 +33,49 @@ import org.apache.catalina.tribes.util.StringManager;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Channel interceptor that manages static membership for a cluster.
-+ */
- public class StaticMembershipInterceptor extends ChannelInterceptorBase implements StaticMembershipInterceptorMBean {
-
- private static final Log log = LogFactory.getLog(StaticMembershipInterceptor.class);
-+ /**
-+ * String manager for this class.
-+ */
- protected static final StringManager sm = StringManager.getManager(StaticMembershipInterceptor.class);
-
-+ /**
-+ * Payload sent when a member starts.
-+ */
- protected static final byte[] MEMBER_START = new byte[] { 76, 111, 99, 97, 108, 32, 83, 116, 97, 116, 105, 99, 77,
- 101, 109, 98, 101, 114, 32, 78, 111, 116, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 68, 97, 116, 97 };
-
-+ /**
-+ * Payload sent when a member shuts down.
-+ */
- protected static final byte[] MEMBER_STOP = new byte[] { 76, 111, 99, 97, 108, 32, 83, 116, 97, 116, 105, 99, 77,
- 101, 109, 98, 101, 114, 32, 83, 104, 117, 116, 100, 111, 119, 110, 32, 68, 97, 116, 97 };
-
-+ /**
-+ * List of static members configured for this interceptor.
-+ */
- protected final ArrayList<Member> members = new ArrayList<>();
-+ /**
-+ * The local member for this interceptor.
-+ */
- protected Member localMember = null;
-
-+ /**
-+ * Default constructor.
-+ */
- public StaticMembershipInterceptor() {
- super();
- }
-
-+ /**
-+ * Adds a static member to the membership list.
-+ * @param member the member to add
-+ */
- public void addStaticMember(Member member) {
- synchronized (members) {
- if (!members.contains(member)) {
-@@ -59,12 +84,20 @@ public class StaticMembershipInterceptor extends ChannelInterceptorBase implemen
- }
- }
-
-+ /**
-+ * Removes a static member from the membership list.
-+ * @param member the member to remove
-+ */
- public void removeStaticMember(Member member) {
- synchronized (members) {
- members.remove(member);
- }
- }
-
-+ /**
-+ * Sets the local member for this interceptor.
-+ * @param member the local member
-+ */
- public void setLocalMember(Member member) {
- this.localMember = member;
- localMember.setLocal(true);
-@@ -197,6 +230,10 @@ public class StaticMembershipInterceptor extends ChannelInterceptorBase implemen
- super.stop(svc);
- }
-
-+ /**
-+ * Sends a local member start message to the given members.
-+ * @param members the members to notify
-+ */
- protected void sendLocalMember(Member[] members) {
- try {
- sendMemberMessage(members, MEMBER_START);
-@@ -205,6 +242,10 @@ public class StaticMembershipInterceptor extends ChannelInterceptorBase implemen
- }
- }
-
-+ /**
-+ * Sends a shutdown message to the given members.
-+ * @param members the members to notify
-+ */
- protected void sendShutdown(Member[] members) {
- try {
- sendMemberMessage(members, MEMBER_STOP);
-@@ -213,6 +254,10 @@ public class StaticMembershipInterceptor extends ChannelInterceptorBase implemen
- }
- }
-
-+ /**
-+ * Returns the first (bottom-most) interceptor in the chain.
-+ * @return the first channel interceptor
-+ */
- protected ChannelInterceptor getfirstInterceptor() {
- ChannelInterceptor result;
- ChannelInterceptor now = this;
-@@ -223,6 +268,12 @@ public class StaticMembershipInterceptor extends ChannelInterceptorBase implemen
- return result;
- }
-
-+ /**
-+ * Sends a member message to the given members.
-+ * @param members the members to send to
-+ * @param message the message payload
-+ * @throws ChannelException if sending fails
-+ */
- protected void sendMemberMessage(Member[] members, byte[] message) throws ChannelException {
- if (members == null || members.length == 0) {
- return;
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptorMBean.java b/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptorMBean.java
-index 7c5d7c1792..1cfbb0d9d3 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptorMBean.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptorMBean.java
-@@ -18,9 +18,21 @@ package org.apache.catalina.tribes.group.interceptors;
-
- import org.apache.catalina.tribes.Member;
-
-+/**
-+ * MBean interface for the static membership interceptor.
-+ */
- public interface StaticMembershipInterceptorMBean {
-
-+ /**
-+ * Returns the option flag used for message sending.
-+ * @return the option flag
-+ */
- int getOptionFlag();
-
-+ /**
-+ * Returns the local member.
-+ * @param incAlive whether to increment the alive counter
-+ * @return the local member
-+ */
- Member getLocalMember(boolean incAlive);
- }
-\ No newline at end of file
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java b/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
-index 0623ecf663..5b90f0cbca 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
-@@ -42,42 +42,68 @@ import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
- /**
-- * The TcpFailureDetector is a useful interceptor that adds reliability to the membership layer.
-- * <p>
-- * If the network is busy, or the system is busy so that the membership receiver thread is not getting enough time to
-- * update its table, members can be "timed out" This failure detector will intercept the memberDisappeared
-- * message(unless its a true shutdown message) and connect to the member using TCP.
-- * <p>
-- * The TcpFailureDetector works in two ways:
-- * <ol>
-- * <li>It intercepts memberDisappeared events</li>
-- * <li>It catches send errors</li>
-- * </ol>
-+ * TCP-based failure detector for cluster membership.
- */
- public class TcpFailureDetector extends ChannelInterceptorBase implements TcpFailureDetectorMBean {
-
-+ /**
-+ * Constructs a new TcpFailureDetector.
-+ */
-+ public TcpFailureDetector() {
-+ }
-+
- private static final Log log = LogFactory.getLog(TcpFailureDetector.class);
-+ /**
-+ * The string manager for this package.
-+ */
- protected static final StringManager sm = StringManager.getManager(TcpFailureDetector.class);
-
-+ /**
-+ * Test payload sent during member liveness checks.
-+ */
- protected static final byte[] TCP_FAIL_DETECT = new byte[] { 79, -89, 115, 72, 121, -126, 67, -55, -97, 111, -119,
- -128, -95, 91, 7, 20, 125, -39, 82, 91, -21, -15, 67, -102, -73, 126, -66, -113, -127, 103, 30, -74, 55, 21,
- -66, -121, 69, 126, 76, -88, -65, 10, 77, 19, 83, 56, 21, 50, 85, -10, -108, -73, 58, -6, 64, 120, -111, 4,
- 125, -41, 114, -124, -64, -43 };
-
-+ /**
-+ * Connection timeout in milliseconds for member checks.
-+ */
- protected long connectTimeout = 1000;// 1 second default
-
-+ /**
-+ * Whether to perform TCP send tests during member checks.
-+ */
- protected boolean performSendTest = true;
-
-+ /**
-+ * Whether to perform TCP read tests during member checks.
-+ */
- protected boolean performReadTest = false;
-
-+ /**
-+ * Read test timeout in milliseconds.
-+ */
- protected long readTestTimeout = 5000;// 5 seconds
-
-+ /**
-+ * The membership tracker.
-+ */
- protected Membership membership = null;
-
-+ /**
-+ * Map of members suspected of being dead and their detection time.
-+ */
- protected final HashMap<Member,Long> removeSuspects = new HashMap<>();
-
-+ /**
-+ * Map of members suspected of rejoining and their detection time.
-+ */
- protected final HashMap<Member,Long> addSuspects = new HashMap<>();
-
-+ /**
-+ * Timeout in seconds for removing suspected dead members.
-+ */
- protected int removeSuspectsTimeout = 300; // 5 minutes
-
- @Override
-@@ -255,6 +281,9 @@ public class TcpFailureDetector extends ChannelInterceptorBase implements TcpFai
- }
- }
-
-+ /**
-+ * Performs a forced check of all cluster members.
-+ */
- protected void performForcedCheck() {
- // update all alive times
- Member[] members = super.getMembers();
-@@ -278,6 +307,9 @@ public class TcpFailureDetector extends ChannelInterceptorBase implements TcpFai
-
- }
-
-+ /**
-+ * Performs a basic check of suspected members.
-+ */
- protected void performBasicCheck() {
- // update all alive times
- Member[] members = super.getMembers();
-@@ -337,6 +369,9 @@ public class TcpFailureDetector extends ChannelInterceptorBase implements TcpFai
- }
- }
-
-+ /**
-+ * Initializes the membership tracker if not already set up.
-+ */
- protected synchronized void setupMembership() {
- if (membership == null) {
- membership = new Membership(super.getLocalMember(true));
-@@ -344,11 +379,29 @@ public class TcpFailureDetector extends ChannelInterceptorBase implements TcpFai
-
- }
-
-+ /**
-+ * Checks whether the given member is alive using the default test parameters.
-+ *
-+ * @param mbr the member to check
-+ * @return true if the member is alive
-+ */
- protected boolean memberAlive(Member mbr) {
- return memberAlive(mbr, TCP_FAIL_DETECT, performSendTest, performReadTest, readTestTimeout, connectTimeout,
- getOptionFlag());
- }
-
-+ /**
-+ * Checks whether the given member is alive using the specified test parameters.
-+ *
-+ * @param mbr the member to check
-+ * @param msgData the test message data
-+ * @param sendTest whether to perform a send test
-+ * @param readTest whether to perform a read test
-+ * @param readTimeout the read timeout in milliseconds
-+ * @param conTimeout the connection timeout in milliseconds
-+ * @param optionFlag the socket option flag
-+ * @return true if the member is alive
-+ */
- protected boolean memberAlive(Member mbr, byte[] msgData, boolean sendTest, boolean readTest, long readTimeout,
- long conTimeout, int optionFlag) {
- // could be a shutdown notification
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetectorMBean.java b/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetectorMBean.java
-index a31b75e819..cab5698db4 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetectorMBean.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetectorMBean.java
-@@ -16,31 +16,80 @@
- */
- package org.apache.catalina.tribes.group.interceptors;
-
-+/**
-+ * MBean interface for managing the TcpFailureDetector interceptor.
-+ */
- public interface TcpFailureDetectorMBean {
-
-+ /**
-+ * Returns the socket option flag used for member checks.
-+ * @return the option flag
-+ */
- int getOptionFlag();
-
-- // Attributes
-+ /**
-+ * Returns the connection timeout in milliseconds.
-+ * @return the connection timeout
-+ */
- long getConnectTimeout();
-
-+ /**
-+ * Returns whether send tests are performed.
-+ * @return true if send tests are enabled
-+ */
- boolean getPerformSendTest();
-
-+ /**
-+ * Returns whether read tests are performed.
-+ * @return true if read tests are enabled
-+ */
- boolean getPerformReadTest();
-
-+ /**
-+ * Returns the read test timeout in milliseconds.
-+ * @return the read test timeout
-+ */
- long getReadTestTimeout();
-
-+ /**
-+ * Returns the timeout for removing suspects.
-+ * @return the remove suspects timeout
-+ */
- int getRemoveSuspectsTimeout();
-
-+ /**
-+ * Sets whether read tests should be performed.
-+ * @param performReadTest true to enable read tests
-+ */
- void setPerformReadTest(boolean performReadTest);
-
-+ /**
-+ * Sets whether send tests should be performed.
-+ * @param performSendTest true to enable send tests
-+ */
- void setPerformSendTest(boolean performSendTest);
-
-+ /**
-+ * Sets the read test timeout in milliseconds.
-+ * @param readTestTimeout the timeout value
-+ */
- void setReadTestTimeout(long readTestTimeout);
-
-+ /**
-+ * Sets the connection timeout in milliseconds.
-+ * @param connectTimeout the timeout value
-+ */
- void setConnectTimeout(long connectTimeout);
-
-+ /**
-+ * Sets the timeout for removing suspects.
-+ * @param removeSuspectsTimeout the timeout value
-+ */
- void setRemoveSuspectsTimeout(int removeSuspectsTimeout);
-
-- // Operations
-+ /**
-+ * Checks the status of cluster members.
-+ * @param checkAll true to check all members, false to check only suspects
-+ */
- void checkMembers(boolean checkAll);
- }
-\ No newline at end of file
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java b/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
-index 4fa0fd41d8..62c24ce5a7 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
-@@ -32,29 +32,68 @@ import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
- /**
-- * Sends a ping to all members. Configure this interceptor with the TcpFailureDetector below it, and the
-- * TcpFailureDetector will act as the membership guide.
-+ * Sends periodic TCP pings to cluster members for health monitoring.
- */
--
- public class TcpPingInterceptor extends ChannelInterceptorBase implements TcpPingInterceptorMBean {
-
-+ /**
-+ * Constructs a new TcpPingInterceptor.
-+ */
-+ public TcpPingInterceptor() {
-+ }
-+
- private static final Log log = LogFactory.getLog(TcpPingInterceptor.class);
-+ /**
-+ * The string manager for this package.
-+ */
- protected static final StringManager sm = StringManager.getManager(TcpPingInterceptor.class);
-
-+ /**
-+ * Test payload sent during ping checks.
-+ */
- protected static final byte[] TCP_PING_DATA = new byte[] { 79, -89, 115, 72, 121, -33, 67, -55, -97, 111, -119,
- -128, -95, 91, 7, 20, 125, -39, 82, 91, -21, -33, 67, -102, -73, 126, -66, -113, -127, 103, 30, -74, 55, 21,
- -66, -121, 69, 33, 76, -88, -65, 10, 77, 19, 83, 56, 21, 50, 85, -10, -108, -73, 58, -33, 33, 120, -111, 4,
- 125, -41, 114, -124, -64, -43 };
-
-+ /**
-+ * Ping interval in milliseconds.
-+ */
- protected long interval = 1000; // 1 second
-
-+ /**
-+ * Whether to use a dedicated thread for pinging.
-+ */
- protected boolean useThread = false;
-+
-+ /**
-+ * Whether to ping only static members.
-+ */
- protected boolean staticOnly = false;
-+
-+ /**
-+ * Whether the ping thread is currently running.
-+ */
- protected volatile boolean running = true;
-+
-+ /**
-+ * The background ping thread.
-+ */
- protected PingThread thread = null;
-+
-+ /**
-+ * Counter for naming ping threads.
-+ */
- protected static final AtomicInteger cnt = new AtomicInteger(0);
-
-+ /**
-+ * Reference to the associated failure detector.
-+ */
- WeakReference<TcpFailureDetector> failureDetector = null;
-+
-+ /**
-+ * Reference to the static membership interceptor.
-+ */
- WeakReference<StaticMembershipInterceptor> staticMembers = null;
-
- @Override
-@@ -109,27 +148,45 @@ public class TcpPingInterceptor extends ChannelInterceptorBase implements TcpPin
- return interval;
- }
-
-+ /**
-+ * Sets the ping interval in milliseconds.
-+ *
-+ * @param interval the interval in milliseconds
-+ */
- public void setInterval(long interval) {
- this.interval = interval;
- }
-
-+ /**
-+ * Sets whether to use a dedicated thread for pinging.
-+ *
-+ * @param useThread true to use a dedicated thread
-+ */
- public void setUseThread(boolean useThread) {
- this.useThread = useThread;
- }
-
-+ /**
-+ * Sets whether to ping only static members.
-+ *
-+ * @param staticOnly true to ping only static members
-+ */
- public void setStaticOnly(boolean staticOnly) {
- this.staticOnly = staticOnly;
- }
-
-- @Override
-- public boolean getUseThread() {
-- return useThread;
-- }
--
-+ /**
-+ * Returns whether static-only mode is enabled.
-+ *
-+ * @return true if only static members are pinged
-+ */
- public boolean getStaticOnly() {
- return staticOnly;
- }
-
-+ /**
-+ * Sends a ping to cluster members.
-+ */
- protected void sendPing() {
- TcpFailureDetector tcpFailureDetector = failureDetector != null ? failureDetector.get() : null;
- if (tcpFailureDetector != null) {
-@@ -146,6 +203,11 @@ public class TcpPingInterceptor extends ChannelInterceptorBase implements TcpPin
- }
- }
-
-+ /**
-+ * Sends a ping message to the specified members.
-+ *
-+ * @param members the members to ping
-+ */
- protected void sendPingMessage(Member[] members) {
- if (members == null || members.length == 0) {
- return;
-@@ -180,7 +242,15 @@ public class TcpPingInterceptor extends ChannelInterceptorBase implements TcpPin
- }
- }// messageReceived
-
-+ /**
-+ * Background thread that sends periodic pings.
-+ */
- protected class PingThread extends Thread {
-+ /**
-+ * Constructs a new PingThread.
-+ */
-+ public PingThread() {
-+ }
- @Override
- public void run() {
- while (running) {
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptorMBean.java b/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptorMBean.java
-index dac051507c..ef0f8bf2db 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptorMBean.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptorMBean.java
-@@ -16,12 +16,30 @@
- */
- package org.apache.catalina.tribes.group.interceptors;
-
-+/**
-+ * MBean interface for managing the TcpPingInterceptor.
-+ */
- public interface TcpPingInterceptorMBean {
-
-+ /**
-+ * Returns the socket option flag used for ping messages.
-+ *
-+ * @return the option flag
-+ */
- int getOptionFlag();
-
-+ /**
-+ * Returns the ping interval in milliseconds.
-+ *
-+ * @return the ping interval
-+ */
- long getInterval();
-
-+ /**
-+ * Returns whether a dedicated ping thread is used.
-+ *
-+ * @return true if a dedicated thread is used
-+ */
- boolean getUseThread();
-
- }
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptor.java b/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptor.java
-index d8552e9db0..8ca8cac6ce 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptor.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptor.java
-@@ -31,9 +31,22 @@ import org.apache.catalina.tribes.util.StringManager;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Interceptor that measures and reports message throughput statistics.
-+ */
- public class ThroughputInterceptor extends ChannelInterceptorBase implements ThroughputInterceptorMBean {
-
-+ /**
-+ * Constructs a new ThroughputInterceptor.
-+ */
-+ public ThroughputInterceptor() {
-+ }
-+
- private static final Log log = LogFactory.getLog(ThroughputInterceptor.class);
-+
-+ /**
-+ * The string manager for this package.
-+ */
- protected static final StringManager sm = StringManager.getManager(ThroughputInterceptor.class);
-
- double mbTx = 0;
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptorMBean.java b/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptorMBean.java
-index e40b17732f..ee5d4cd2c3 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptorMBean.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/ThroughputInterceptorMBean.java
-@@ -18,37 +18,93 @@ package org.apache.catalina.tribes.group.interceptors;
-
- import java.util.concurrent.atomic.AtomicLong;
-
-+/**
-+ * MBean interface for managing the ThroughputInterceptor.
-+ */
- public interface ThroughputInterceptorMBean {
-
-+ /**
-+ * Returns the socket option flag.
-+ * @return the option flag
-+ */
- int getOptionFlag();
-
-- // Attributes
-+ /**
-+ * Returns the reporting interval in milliseconds.
-+ * @return the interval
-+ */
- int getInterval();
-
-+ /**
-+ * Sets the reporting interval in milliseconds.
-+ * @param interval the interval
-+ */
- void setInterval(int interval);
-
-- // stats
-+ /**
-+ * Returns the last message count.
-+ * @return the last count
-+ */
- double getLastCnt();
-
-+ /**
-+ * Returns the application-layer transmit rate in MB/s.
-+ * @return the MB/s rate
-+ */
- double getMbAppTx();
-
-+ /**
-+ * Returns the receive rate in MB/s.
-+ * @return the MB/s rate
-+ */
- double getMbRx();
-
-+ /**
-+ * Returns the transmit rate in MB/s.
-+ * @return the MB/s rate
-+ */
- double getMbTx();
-
-+ /**
-+ * Returns the received message count.
-+ * @return the count
-+ */
- AtomicLong getMsgRxCnt();
-
-+ /**
-+ * Returns the transmitted message count.
-+ * @return the count
-+ */
- AtomicLong getMsgTxCnt();
-
-+ /**
-+ * Returns the transmit error count.
-+ * @return the count
-+ */
- AtomicLong getMsgTxErr();
-
-+ /**
-+ * Returns the receive start timestamp.
-+ * @return the timestamp
-+ */
- long getRxStart();
-
-+ /**
-+ * Returns the last transmit time.
-+ * @return the time
-+ */
- double getTimeTx();
-
-+ /**
-+ * Returns the transmit start timestamp.
-+ * @return the timestamp
-+ */
- long getTxStart();
-
-- // Operations
-+ /**
-+ * Reports throughput statistics.
-+ * @param timeTx the transmit time
-+ */
- void report(double timeTx);
-
- }
-diff --git a/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java b/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
-index c91a503e8f..d91ad9022b 100644
---- a/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
-+++ b/java/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
-@@ -31,17 +31,40 @@ import org.apache.catalina.tribes.util.UUIDGenerator;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Two-phase commit interceptor that ensures reliable message delivery.
-+ */
- public class TwoPhaseCommitInterceptor extends ChannelInterceptorBase {
-
-+ /**
-+ * Constructs a new TwoPhaseCommitInterceptor.
-+ */
-+ public TwoPhaseCommitInterceptor() {
-+ }
-+
- private static final byte[] START_DATA =
- new byte[] { 113, 1, -58, 2, -34, -60, 75, -78, -101, -12, 32, -29, 32, 111, -40, 4 };
- private static final byte[] END_DATA =
- new byte[] { 54, -13, 90, 110, 47, -31, 75, -24, -81, -29, 36, 52, -58, 77, -110, 56 };
- private static final Log log = LogFactory.getLog(TwoPhaseCommitInterceptor.class);
-+ /**
-+ * The string manager for this package.
-+ */
- protected static final StringManager sm = StringManager.getManager(TwoPhaseCommitInterceptor.class);
-
-+ /**
-+ * Map of pending messages keyed by their unique ID.
-+ */
- protected final HashMap<UniqueId,MapEntry> messages = new HashMap<>();
-+
-+ /**
-+ * Message expiration time in milliseconds.
-+ */
- protected long expire = 1000 * 60; // one minute expiration
-+
-+ /**
-+ * Whether to deep clone messages before storage.
-+ */
- protected boolean deepclone = true;
-
- @Override
-@@ -100,18 +123,34 @@ public class TwoPhaseCommitInterceptor extends ChannelInterceptorBase {
- }
- }
-
-+ /**
-+ * Returns whether deep cloning is enabled.
-+ * @return true if deep cloning is enabled
-+ */
- public boolean getDeepclone() {
- return deepclone;
- }
-
-+ /**
-+ * Returns the message expiration time in milliseconds.
-+ * @return the expiration time
-+ */
- public long getExpire() {
- return expire;
- }
-
-+ /**
-+ * Sets whether deep cloning should be used.
-+ * @param deepclone true to enable deep cloning
-+ */
- public void setDeepclone(boolean deepclone) {
- this.deepclone = deepclone;
- }
-
-+ /**
-+ * Sets the message expiration time in milliseconds.
-+ * @param expire the expiration time
-+ */
- public void setExpire(long expire) {
- this.expire = expire;
- }
-@@ -136,7 +175,20 @@ public class TwoPhaseCommitInterceptor extends ChannelInterceptorBase {
- }
- }
-
-+ /**
-+ * Entry that holds a message, its ID, and the timestamp of arrival.
-+ *
-+ * @param msg the channel message
-+ * @param id the unique identifier
-+ * @param timestamp the arrival time
-+ */
- public record MapEntry(ChannelMessage msg, UniqueId id, long timestamp) {
-+ /**
-+ * Checks if this entry has expired.
-+ * @param now the current time
-+ * @param expiration the expiration period
-+ * @return true if expired
-+ */
- public boolean expired(long now, long expiration) {
- return (now - timestamp) > expiration;
- }
-diff --git a/java/org/apache/catalina/tribes/membership/StaticMember.java b/java/org/apache/catalina/tribes/membership/StaticMember.java
-index 67d28786fa..7df9845e02 100644
---- a/java/org/apache/catalina/tribes/membership/StaticMember.java
-+++ b/java/org/apache/catalina/tribes/membership/StaticMember.java
-@@ -20,20 +20,42 @@ import java.io.IOException;
-
- import org.apache.catalina.tribes.util.Arrays;
-
-+/**
-+ * Static member representation for cluster membership.
-+ */
- public class StaticMember extends MemberImpl {
-+ /**
-+ * Default constructor.
-+ */
- public StaticMember() {
- super();
- }
-
-+ /**
-+ * Creates a static member with the given host, port, and alive time.
-+ * @param host the host address
-+ * @param port the port number
-+ * @param aliveTime the time the member was last alive
-+ * @throws IOException if serialization fails
-+ */
- public StaticMember(String host, int port, long aliveTime) throws IOException {
- super(host, port, aliveTime);
- }
-
-+ /**
-+ * Creates a static member with the given host, port, alive time, and payload.
-+ * @param host the host address
-+ * @param port the port number
-+ * @param aliveTime the time the member was last alive
-+ * @param payload the member payload data
-+ * @throws IOException if serialization fails
-+ */
- public StaticMember(String host, int port, long aliveTime, byte[] payload) throws IOException {
- super(host, port, aliveTime, payload);
- }
-
- /**
-+ * Sets the host for this member.
- * @param host String, either in byte array string format, like {214,116,1,3} or as a regular hostname, 127.0.0.1 or
- * tomcat01.mydomain.com
- */
-@@ -54,6 +76,7 @@ public class StaticMember extends MemberImpl {
- }
-
- /**
-+ * Sets the domain for this member.
- * @param domain String, either in byte array string format, like {214,116,1,3} or as a regular string value like
- * 'mydomain'. The latter will be converted using ISO-8859-1 encoding
- */
-@@ -69,6 +92,7 @@ public class StaticMember extends MemberImpl {
- }
-
- /**
-+ * Sets the unique identifier for this member.
- * @param id String, must be in byte array string format, like {214,116,1,3} and exactly 16 bytes long
- */
- public void setUniqueId(String id) {
-diff --git a/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java b/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java
-index 465b8dd83c..01783eff8d 100644
---- a/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java
-+++ b/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java
-@@ -41,28 +41,82 @@ import org.apache.catalina.tribes.util.StringManager;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Provider that manages static membership for a cluster.
-+ */
- public class StaticMembershipProvider extends MembershipProviderBase
- implements RpcCallback, ChannelListener, Heartbeat {
-
-+ /**
-+ * String manager for this class.
-+ */
- protected static final StringManager sm = StringManager.getManager(StaticMembershipProvider.class);
- private static final Log log = LogFactory.getLog(StaticMembershipProvider.class);
-
-+ /**
-+ * The channel associated with this provider.
-+ */
- protected Channel channel;
-+ /**
-+ * RPC channel for sending messages.
-+ */
- protected RpcChannel rpcChannel;
-+ /**
-+ * Name of this membership group.
-+ */
- private String membershipName = null;
-+ /**
-+ * Byte array identifier for this membership group.
-+ */
- private byte[] membershipId = null;
-+ /**
-+ * List of static members for this cluster.
-+ */
- protected ArrayList<StaticMember> staticMembers;
-+ /**
-+ * Send options flag for channel messages.
-+ */
- protected int sendOptions = Channel.SEND_OPTIONS_ASYNCHRONOUS;
-+ /**
-+ * Time in milliseconds after which a member is considered expired.
-+ */
- protected long expirationTime = 5000;
-+ /**
-+ * Socket connection timeout in milliseconds.
-+ */
- protected int connectTimeout = 500;
-+ /**
-+ * RPC operation timeout in milliseconds.
-+ */
- protected long rpcTimeout = 3000;
-+ /**
-+ * Current start level bitmask.
-+ */
- protected int startLevel = 0;
- // for ping thread
-+ /**
-+ * Whether to use a background thread for pinging.
-+ */
- protected boolean useThread = false;
-+ /**
-+ * Interval between ping messages in milliseconds.
-+ */
- protected long pingInterval = 1000;
-+ /**
-+ * Whether the ping thread is currently running.
-+ */
- protected volatile boolean running = true;
-+ /**
-+ * Background ping thread instance.
-+ */
- protected PingThread thread = null;
-
-+ /**
-+ * Default constructor.
-+ */
-+ public StaticMembershipProvider() {
-+ }
-+
- @Override
- public void init(Properties properties) throws Exception {
- String expirationTimeStr = properties.getProperty("expirationTime");
-@@ -137,6 +191,11 @@ public class StaticMembershipProvider extends MembershipProviderBase
- return (startLevel == 0);
- }
-
-+ /**
-+ * Sends start messages to the given members.
-+ * @param members the members to notify
-+ * @throws ChannelException if sending fails
-+ */
- protected void startMembership(Member[] members) throws ChannelException {
- if (members.length == 0) {
- return;
-@@ -152,11 +211,20 @@ public class StaticMembershipProvider extends MembershipProviderBase
- }
- }
-
-+ /**
-+ * Sets up a member after it joins. Override for customization.
-+ * @param mbr the member to set up
-+ * @return the configured member
-+ */
- protected Member setupMember(Member mbr) {
- // no-op
- return mbr;
- }
-
-+ /**
-+ * Handles the addition of a new member to the cluster.
-+ * @param member the member that was added
-+ */
- protected void memberAdded(Member member) {
- Member mbr = setupMember(member);
- if (membership.memberAlive(mbr)) {
-@@ -174,6 +242,10 @@ public class StaticMembershipProvider extends MembershipProviderBase
- }
- }
-
-+ /**
-+ * Handles the disappearance of a member from the cluster.
-+ * @param member the member that disappeared
-+ */
- protected void memberDisappeared(Member member) {
- membership.removeMember(member);
- Runnable r = () -> {
-@@ -189,6 +261,10 @@ public class StaticMembershipProvider extends MembershipProviderBase
- executor.execute(r);
- }
-
-+ /**
-+ * Updates the alive status of a member.
-+ * @param member the member to update
-+ */
- protected void memberAlive(Member member) {
- if (!membership.contains(member)) {
- memberAdded(member);
-@@ -196,6 +272,10 @@ public class StaticMembershipProvider extends MembershipProviderBase
- membership.memberAlive(member);
- }
-
-+ /**
-+ * Sends stop messages to the given members.
-+ * @param members the members to notify
-+ */
- protected void stopMembership(Member[] members) {
- if (members.length == 0) {
- return;
-@@ -282,6 +362,10 @@ public class StaticMembershipProvider extends MembershipProviderBase
- }
- }
-
-+ /**
-+ * Sends ping messages to all static members and checks for expired members.
-+ * @throws ChannelException if pinging fails
-+ */
- protected void ping() throws ChannelException {
- // send ping
- Member[] members = getAliveMembers(staticMembers.toArray(new Member[0]));
-@@ -306,6 +390,9 @@ public class StaticMembershipProvider extends MembershipProviderBase
- checkExpired();
- }
-
-+ /**
-+ * Checks for and removes expired members.
-+ */
- protected void checkExpired() {
- Member[] expired = membership.expire(expirationTime);
- for (Member member : expired) {
-@@ -313,10 +400,18 @@ public class StaticMembershipProvider extends MembershipProviderBase
- }
- }
-
-+ /**
-+ * Sets the channel for this provider.
-+ * @param channel the channel
-+ */
- public void setChannel(Channel channel) {
- this.channel = channel;
- }
-
-+ /**
-+ * Sets the static members for this cluster.
-+ * @param staticMembers the list of static members
-+ */
- public void setStaticMembers(ArrayList<StaticMember> staticMembers) {
- this.staticMembers = staticMembers;
- }
-@@ -340,34 +435,68 @@ public class StaticMembershipProvider extends MembershipProviderBase
- // ------------------------------------------------------------------------------
- // member message to send to and from other memberships
- // ------------------------------------------------------------------------------
-+ /**
-+ * Message sent between membership providers to coordinate membership state.
-+ */
- public static class MemberMessage implements Serializable {
- @Serial
- private static final long serialVersionUID = 1L;
-+ /**
-+ * Message type for member start.
-+ */
- public static final int MSG_START = 1;
-+ /**
-+ * Message type for member stop.
-+ */
- public static final int MSG_STOP = 2;
-+ /**
-+ * Message type for member ping.
-+ */
- public static final int MSG_PING = 3;
- private final int msgtype;
- private final byte[] membershipId;
- private Member member;
-
-+ /**
-+ * Creates a new MemberMessage.
-+ * @param membershipId the membership group identifier
-+ * @param msgtype the message type
-+ * @param member the member associated with this message
-+ */
- public MemberMessage(byte[] membershipId, int msgtype, Member member) {
- this.membershipId = membershipId;
- this.msgtype = msgtype;
- this.member = member;
- }
-
-+ /**
-+ * Returns the message type.
-+ * @return the message type constant
-+ */
- public int getMsgtype() {
- return msgtype;
- }
-
-+ /**
-+ * Returns the membership group identifier.
-+ * @return the membership ID byte array
-+ */
- public byte[] getMembershipId() {
- return membershipId;
- }
-
-+ /**
-+ * Returns the member associated with this message.
-+ * @return the member
-+ */
- public Member getMember() {
- return member;
- }
-
-+ /**
-+ * Sets the member for this message.
-+ * @param local the member
-+ */
- public void setMember(Member local) {
- this.member = local;
- }
-@@ -378,6 +507,10 @@ public class StaticMembershipProvider extends MembershipProviderBase
- member + ']';
- }
-
-+ /**
-+ * Returns a human-readable description of the message type.
-+ * @return the type description string
-+ */
- protected String getTypeDesc() {
- return switch (msgtype) {
- case MSG_START -> "MSG_START";
-@@ -388,7 +521,16 @@ public class StaticMembershipProvider extends MembershipProviderBase
- }
- }
-
-+ /**
-+ * Background thread that periodically sends ping messages to cluster members.
-+ */
- protected class PingThread extends Thread {
-+ /**
-+ * Default constructor.
-+ */
-+ public PingThread() {
-+ }
-+
- @Override
- public void run() {
- while (running) {
-diff --git a/java/org/apache/catalina/tribes/membership/StaticMembershipService.java b/java/org/apache/catalina/tribes/membership/StaticMembershipService.java
-index c519a8d398..2eb1df86bf 100644
---- a/java/org/apache/catalina/tribes/membership/StaticMembershipService.java
-+++ b/java/org/apache/catalina/tribes/membership/StaticMembershipService.java
-@@ -31,11 +31,20 @@ import org.apache.catalina.tribes.util.StringManager;
- import org.apache.juli.logging.Log;
- import org.apache.juli.logging.LogFactory;
-
-+/**
-+ * Service that manages static membership for a cluster channel.
-+ */
- public class StaticMembershipService extends MembershipServiceBase implements StaticMembershipServiceMBean {
-
- private static final Log log = LogFactory.getLog(StaticMembershipService.class);
-+ /**
-+ * String manager for this class.
-+ */
- protected static final StringManager sm = StringManager.getManager(Constants.Package);
-
-+ /**
-+ * List of static members configured for this service.
-+ */
- protected final ArrayList<StaticMember> staticMembers = new ArrayList<>();
- private StaticMember localMember;
- private StaticMembershipProvider provider;
-@@ -45,6 +54,9 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- */
- private ObjectName oname = null;
-
-+ /**
-+ * Default constructor.
-+ */
- public StaticMembershipService() {
- // default values
- setDefaults(this.properties);
-@@ -69,6 +81,11 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- }
- }
-
-+ /**
-+ * Builds and configures the membership provider.
-+ * @return the configured membership provider
-+ * @throws Exception if initialization fails
-+ */
- protected StaticMembershipProvider buildMembershipProvider() throws Exception {
- StaticMembershipProvider provider = new StaticMembershipProvider();
- provider.setChannel(channel);
-@@ -135,18 +152,34 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- return provider;
- }
-
-+ /**
-+ * Returns the list of static members.
-+ * @return the static members list
-+ */
- public ArrayList<StaticMember> getStaticMembers() {
- return staticMembers;
- }
-
-+ /**
-+ * Adds a static member to the cluster.
-+ * @param member the member to add
-+ */
- public void addStaticMember(StaticMember member) {
- staticMembers.add(member);
- }
-
-+ /**
-+ * Removes a static member from the cluster.
-+ * @param member the member to remove
-+ */
- public void removeStaticMember(StaticMember member) {
- staticMembers.remove(member);
- }
-
-+ /**
-+ * Sets the local member for this service.
-+ * @param member the local member
-+ */
- public void setLocalMember(StaticMember member) {
- this.localMember = member;
- localMember.setLocal(true);
-@@ -158,6 +191,10 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- return Long.parseLong(expirationTime);
- }
-
-+ /**
-+ * Sets the member expiration time in milliseconds.
-+ * @param expirationTime the expiration time
-+ */
- public void setExpirationTime(long expirationTime) {
- properties.setProperty("expirationTime", String.valueOf(expirationTime));
- }
-@@ -168,6 +205,10 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- return Integer.parseInt(connectTimeout);
- }
-
-+ /**
-+ * Sets the connection timeout in milliseconds.
-+ * @param connectTimeout the connection timeout
-+ */
- public void setConnectTimeout(int connectTimeout) {
- properties.setProperty("connectTimeout", String.valueOf(connectTimeout));
- }
-@@ -178,6 +219,10 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- return Long.parseLong(rpcTimeout);
- }
-
-+ /**
-+ * Sets the RPC timeout in milliseconds.
-+ * @param rpcTimeout the RPC timeout
-+ */
- public void setRpcTimeout(long rpcTimeout) {
- properties.setProperty("rpcTimeout", String.valueOf(rpcTimeout));
- }
-@@ -188,6 +233,10 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- return Boolean.parseBoolean(useThread);
- }
-
-+ /**
-+ * Sets whether to use a background thread for pinging.
-+ * @param useThread true to use a background thread
-+ */
- public void setUseThread(boolean useThread) {
- properties.setProperty("useThread", String.valueOf(useThread));
- }
-@@ -198,6 +247,10 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- return Long.parseLong(pingInterval);
- }
-
-+ /**
-+ * Sets the ping interval in milliseconds.
-+ * @param pingInterval the ping interval
-+ */
- public void setPingInterval(long pingInterval) {
- properties.setProperty("pingInterval", String.valueOf(pingInterval));
- }
-@@ -208,6 +261,10 @@ public class StaticMembershipService extends MembershipServiceBase implements St
- this.properties = properties;
- }
-
-+ /**
-+ * Sets default property values.
-+ * @param properties the properties to configure
-+ */
- protected void setDefaults(Properties properties) {
- // default values
- if (properties.getProperty("expirationTime") == null) {
-diff --git a/java/org/apache/catalina/tribes/membership/StaticMembershipServiceMBean.java b/java/org/apache/catalina/tribes/membership/StaticMembershipServiceMBean.java
-index d6a2721f64..68cb01d73e 100644
---- a/java/org/apache/catalina/tribes/membership/StaticMembershipServiceMBean.java
-+++ b/java/org/apache/catalina/tribes/membership/StaticMembershipServiceMBean.java
-@@ -20,25 +20,65 @@ import java.util.Properties;
-
- import org.apache.catalina.tribes.Member;
-
-+/**
-+ * MBean interface for the static membership service.
-+ */
- public interface StaticMembershipServiceMBean {
-
- // Attributes
-+ /**
-+ * Returns the member expiration time in milliseconds.
-+ * @return the expiration time
-+ */
- long getExpirationTime();
-
-+ /**
-+ * Returns the connection timeout in milliseconds.
-+ * @return the connection timeout
-+ */
- int getConnectTimeout();
-
-+ /**
-+ * Returns the RPC timeout in milliseconds.
-+ * @return the RPC timeout
-+ */
- long getRpcTimeout();
-
-+ /**
-+ * Returns whether a background ping thread is in use.
-+ * @return true if a background thread is used
-+ */
- boolean getUseThread();
-
-+ /**
-+ * Returns the ping interval in milliseconds.
-+ * @return the ping interval
-+ */
- long getPingInterval();
-
- // Operation
-+ /**
-+ * Returns the configuration properties.
-+ * @return the properties
-+ */
- Properties getProperties();
-
-+ /**
-+ * Checks if there are any members in the cluster.
-+ * @return true if there are members
-+ */
- boolean hasMembers();
-
-+ /**
-+ * Returns the names of all cluster members.
-+ * @return array of member names
-+ */
- String[] getMembersByName();
-
-+ /**
-+ * Finds a member by name.
-+ * @param name the member name
-+ * @return the member, or null if not found
-+ */
- Member findMemberByName(String name);
- }
-diff --git a/java/org/apache/catalina/tribes/membership/cloud/StreamProvider.java b/java/org/apache/catalina/tribes/membership/cloud/StreamProvider.java
-index 9ef3637f2b..443117f00c 100644
---- a/java/org/apache/catalina/tribes/membership/cloud/StreamProvider.java
-+++ b/java/org/apache/catalina/tribes/membership/cloud/StreamProvider.java
-@@ -20,6 +20,9 @@ import java.io.IOException;
- import java.io.InputStream;
- import java.util.Map;
-
-+/**
-+ * Provides the ability to open input streams to remote URLs.
-+ */
- public interface StreamProvider {
- /**
- * Open stream to the specified URL.
-diff --git a/java/org/apache/catalina/tribes/membership/cloud/TokenStreamProvider.java b/java/org/apache/catalina/tribes/membership/cloud/TokenStreamProvider.java
-index 71a3dc01da..71c015e50b 100644
---- a/java/org/apache/catalina/tribes/membership/cloud/TokenStreamProvider.java
-+++ b/java/org/apache/catalina/tribes/membership/cloud/TokenStreamProvider.java
-@@ -24,12 +24,29 @@ import javax.net.ssl.SSLContext;
- import javax.net.ssl.SSLSocketFactory;
- import javax.net.ssl.TrustManager;
-
-+/**
-+ * Stream provider that authenticates using a bearer token.
-+ */
- public class TokenStreamProvider extends AbstractStreamProvider {
-
-+ /**
-+ * The bearer token for authentication.
-+ */
- private String token;
-+
-+ /**
-+ * The SSL socket factory.
-+ */
- private final SSLSocketFactory factory;
-
-
-+ /**
-+ * Creates a new TokenStreamProvider.
-+ *
-+ * @param token the bearer token
-+ * @param caCertFile the CA certificate file path
-+ * @throws Exception if initialization fails
-+ */
- TokenStreamProvider(String token, String caCertFile) throws Exception {
- this.token = token;
- TrustManager[] trustManagers = configureCaCert(caCertFile);
-@@ -45,6 +62,11 @@ public class TokenStreamProvider extends AbstractStreamProvider {
- }
-
-
-+ /**
-+ * Sets the bearer token for authentication.
-+ *
-+ * @param token the bearer token
-+ */
- protected void setToken(String token) {
- this.token = token;
- }
-diff --git a/java/org/apache/catalina/tribes/util/TcclThreadFactory.java b/java/org/apache/catalina/tribes/util/TcclThreadFactory.java
-index 9d52fc363c..4fc11585fc 100644
---- a/java/org/apache/catalina/tribes/util/TcclThreadFactory.java
-+++ b/java/org/apache/catalina/tribes/util/TcclThreadFactory.java
-@@ -32,10 +32,18 @@ public class TcclThreadFactory implements ThreadFactory {
- private final AtomicInteger threadNumber = new AtomicInteger(1);
- private final String namePrefix;
-
-+ /**
-+ * Creates a new TcclThreadFactory with an auto-generated name prefix.
-+ */
- public TcclThreadFactory() {
- this("pool-" + poolNumber.getAndIncrement() + "-thread-");
- }
-
-+ /**
-+ * Creates a new TcclThreadFactory with the specified name prefix.
-+ *
-+ * @param namePrefix the prefix for thread names
-+ */
- public TcclThreadFactory(String namePrefix) {
- group = Thread.currentThread().getThreadGroup();
- this.namePrefix = namePrefix;
-diff --git a/java/org/apache/catalina/tribes/util/UUIDGenerator.java b/java/org/apache/catalina/tribes/util/UUIDGenerator.java
-index 34df11b89c..c70047deb0 100644
---- a/java/org/apache/catalina/tribes/util/UUIDGenerator.java
-+++ b/java/org/apache/catalina/tribes/util/UUIDGenerator.java
-@@ -26,15 +26,42 @@ import org.apache.juli.logging.LogFactory;
- * Smple generation of a UUID.
- */
- public class UUIDGenerator {
-+ /**
-+ * Constructs a new UUIDGenerator.
-+ */
-+ public UUIDGenerator() {
-+ }
-+
- private static final Log log = LogFactory.getLog(UUIDGenerator.class);
-+ /**
-+ * StringManager for internationalized strings.
-+ */
- protected static final StringManager sm = StringManager.getManager("org.apache.catalina.tribes.util");
-
-+ /**
-+ * Length of a UUID in bytes.
-+ */
- public static final int UUID_LENGTH = 16;
-+ /**
-+ * UUID version.
-+ */
- public static final int UUID_VERSION = 4;
-+ /**
-+ * Number of bytes per integer.
-+ */
- public static final int BYTES_PER_INT = 4;
-+ /**
-+ * Number of bits per byte.
-+ */
- public static final int BITS_PER_BYTE = 8;
-
-+ /**
-+ * Secure random number generator.
-+ */
- protected static final SecureRandom secrand;
-+ /**
-+ * Standard random number generator.
-+ */
- protected static final Random rand = new Random();
-
- static {
-@@ -48,11 +75,29 @@ public class UUIDGenerator {
- }
- }
-
-+ /**
-+ * Generates a random UUID.
-+ *
-+ * @param secure Whether to use a secure random generator
-+ *
-+ * @return The generated UUID as a byte array
-+ */
- public static byte[] randomUUID(boolean secure) {
- byte[] result = new byte[UUID_LENGTH];
- return randomUUID(secure, result, 0);
- }
-
-+ /**
-+ * Generates a random UUID and stores it in the provided byte array.
-+ *
-+ * @param secure Whether to use a secure random generator
-+ * @param into The byte array to store the UUID
-+ * @param offset The offset in the byte array
-+ *
-+ * @return The byte array containing the UUID
-+ *
-+ * @throws ArrayIndexOutOfBoundsException If the byte array is too small
-+ */
- public static byte[] randomUUID(boolean secure, byte[] into, int offset) {
- if ((offset + UUID_LENGTH) > into.length) {
- throw new ArrayIndexOutOfBoundsException(
-diff --git a/java/org/apache/catalina/util/StandardSessionIdGenerator.java b/java/org/apache/catalina/util/StandardSessionIdGenerator.java
-index 767a47cae2..4fa1fa7627 100644
---- a/java/org/apache/catalina/util/StandardSessionIdGenerator.java
-+++ b/java/org/apache/catalina/util/StandardSessionIdGenerator.java
-@@ -16,8 +16,21 @@
- */
- package org.apache.catalina.util;
-
-+import org.apache.catalina.SessionIdGenerator;
-+
-+/**
-+ * Standard implementation of {@link SessionIdGenerator} that generates session
-+ * identifiers using a pool of {@link java.security.SecureRandom} instances.
-+ */
- public class StandardSessionIdGenerator extends SessionIdGeneratorBase {
-
-+ /**
-+ * Construct a new instance with default configuration.
-+ */
-+ public StandardSessionIdGenerator() {
-+ super();
-+ }
-+
- @Override
- public String generateSessionId(String route) {
-
-diff --git a/java/org/apache/catalina/util/Strftime.java b/java/org/apache/catalina/util/Strftime.java
-index 3a00548423..c1dd436670 100644
---- a/java/org/apache/catalina/util/Strftime.java
-+++ b/java/org/apache/catalina/util/Strftime.java
-@@ -36,7 +36,14 @@ import java.util.TimeZone;
- * </ul>
- */
- public class Strftime {
-+ /**
-+ * Mapping of strftime format specifiers to SimpleDateFormat equivalents.
-+ */
- protected static final Properties translate;
-+
-+ /**
-+ * The underlying SimpleDateFormat instance used for date formatting.
-+ */
- protected final SimpleDateFormat simpleDateFormat;
-
- /*
-@@ -199,6 +206,14 @@ public class Strftime {
- return buf.toString();
- }
-
-+ /**
-+ * Quotes a string literal for use in a SimpleDateFormat pattern if it is
-+ * not already inside quotes.
-+ *
-+ * @param str the string to quote
-+ * @param insideQuotes whether the current position is inside quotes
-+ * @return the quoted string
-+ */
- protected String quote(String str, boolean insideQuotes) {
- String retVal = str;
- if (!insideQuotes) {
-diff --git a/java/org/apache/catalina/util/StringUtil.java b/java/org/apache/catalina/util/StringUtil.java
-index 2a2497501e..db297ecc46 100644
---- a/java/org/apache/catalina/util/StringUtil.java
-+++ b/java/org/apache/catalina/util/StringUtil.java
-@@ -18,7 +18,16 @@ package org.apache.catalina.util;
-
- import java.util.regex.Pattern;
-
-+/**
-+ * Utility methods for string manipulation in Catalina.
-+ */
- public class StringUtil {
-+ /**
-+ * Constructs a new StringUtil. This utility class should not be instantiated.
-+ */
-+ public StringUtil() {
-+ }
-+
- /**
- * {@link Pattern} for a comma delimited string that support whitespace characters
- */
-diff --git a/java/org/apache/catalina/util/TLSUtil.java b/java/org/apache/catalina/util/TLSUtil.java
-index 99163a6b1d..99c0605d7a 100644
---- a/java/org/apache/catalina/util/TLSUtil.java
-+++ b/java/org/apache/catalina/util/TLSUtil.java
-@@ -19,8 +19,17 @@ package org.apache.catalina.util;
- import org.apache.catalina.Globals;
- import org.apache.tomcat.util.net.SSLSupport;
-
-+/**
-+ * Utility methods for TLS-related operations.
-+ */
- public class TLSUtil {
-
-+ /**
-+ * Constructs a new TLSUtil. This utility class should not be instantiated.
-+ */
-+ public TLSUtil() {
-+ }
-+
- /**
- * Determines if the named request attribute is used to pass information about the TLS configuration of the
- * connection to the application. Both the standard request attributes defined by the Servlet specification and
-diff --git a/java/org/apache/catalina/util/TimeBucketCounter.java b/java/org/apache/catalina/util/TimeBucketCounter.java
-index 157442e4cb..91e96aa150 100644
---- a/java/org/apache/catalina/util/TimeBucketCounter.java
-+++ b/java/org/apache/catalina/util/TimeBucketCounter.java
-@@ -30,6 +30,12 @@ public class TimeBucketCounter extends TimeBucketCounterBase {
- private final double ratio;
-
-
-+ /**
-+ * Constructs a new TimeBucketCounter.
-+ *
-+ * @param bucketDuration the bucket duration in seconds
-+ * @param executorService the executor service for maintenance tasks
-+ */
- public TimeBucketCounter(int bucketDuration, ScheduledExecutorService executorService) {
- super(getActualDuration(bucketDuration), executorService);
- this.numBits = determineShiftBitsOfDuration(bucketDuration);
-@@ -49,6 +55,11 @@ public class TimeBucketCounter extends TimeBucketCounterBase {
- }
-
-
-+ /**
-+ * Returns the number of bits used for bucket index calculation.
-+ *
-+ * @return the number of shift bits
-+ */
- public int getNumBits() {
- return numBits;
- }
-diff --git a/java/org/apache/catalina/util/TimeBucketCounterBase.java b/java/org/apache/catalina/util/TimeBucketCounterBase.java
-index 0251054bce..67c567d1e1 100644
---- a/java/org/apache/catalina/util/TimeBucketCounterBase.java
-+++ b/java/org/apache/catalina/util/TimeBucketCounterBase.java
-@@ -75,7 +75,9 @@ public abstract class TimeBucketCounterBase {
-
-
- /**
-- * @return bucketDuration in seconds
-+ * Returns the duration of each time bucket.
-+ *
-+ * @return the bucket duration in seconds
- */
- public int getBucketDuration() {
- return bucketDuration;
-diff --git a/java/org/apache/catalina/util/ToStringUtil.java b/java/org/apache/catalina/util/ToStringUtil.java
-index 485c607880..c3dd2579c0 100644
---- a/java/org/apache/catalina/util/ToStringUtil.java
-+++ b/java/org/apache/catalina/util/ToStringUtil.java
-@@ -30,16 +30,36 @@ public class ToStringUtil {
- }
-
-
-+ /**
-+ * Generates a toString representation for a Contained component.
-+ *
-+ * @param contained the component
-+ * @return the string representation
-+ */
- public static String toString(Contained contained) {
- return toString(contained, contained.getContainer());
- }
-
-
-+ /**
-+ * Generates a toString representation for an object with an associated container.
-+ *
-+ * @param obj the object
-+ * @param container the associated container
-+ * @return the string representation
-+ */
- public static String toString(Object obj, Container container) {
- return containedToString(obj, container, "Container");
- }
-
-
-+ /**
-+ * Generates a toString representation for an object with an associated manager.
-+ *
-+ * @param obj the object
-+ * @param manager the associated manager
-+ * @return the string representation
-+ */
- public static String toString(Object obj, Manager manager) {
- return containedToString(obj, manager, "Manager");
- }
-diff --git a/java/org/apache/catalina/util/TomcatCSS.java b/java/org/apache/catalina/util/TomcatCSS.java
-index 5f66d66396..b9139a37db 100644
---- a/java/org/apache/catalina/util/TomcatCSS.java
-+++ b/java/org/apache/catalina/util/TomcatCSS.java
-@@ -17,8 +17,20 @@
- package org.apache.catalina.util;
-
-
-+/**
-+ * Provides the default Tomcat CSS styles.
-+ */
- public class TomcatCSS {
-
-+ /**
-+ * Constructs a new TomcatCSS. This utility class should not be instantiated.
-+ */
-+ public TomcatCSS() {
-+ }
-+
-+ /**
-+ * The default CSS styles used by Tomcat error pages.
-+ */
- public static final String TOMCAT_CSS = "body {font-family:Tahoma,Arial,sans-serif;} " +
- "h1, h2, h3, b {color:white;background-color:#525D76;} " + "h1 {font-size:22px;} " +
- "h2 {font-size:16px;} " + "h3 {font-size:14px;} " + "p {font-size:12px;} " + "a {color:black;} " +
-diff --git a/java/org/apache/catalina/util/URLEncoder.java b/java/org/apache/catalina/util/URLEncoder.java
-index 1f031058f1..18d3ae74b0 100644
---- a/java/org/apache/catalina/util/URLEncoder.java
-+++ b/java/org/apache/catalina/util/URLEncoder.java
-@@ -33,7 +33,14 @@ public final class URLEncoder implements Cloneable {
- private static final char[] hexadecimal =
- { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
-+ /**
-+ * Pre-configured encoder for URI paths.
-+ */
- public static final URLEncoder DEFAULT = new URLEncoder();
-+
-+ /**
-+ * Pre-configured encoder for query strings.
-+ */
- public static final URLEncoder QUERY = new URLEncoder();
-
- static {
-@@ -99,6 +106,9 @@ public final class URLEncoder implements Cloneable {
- private boolean encodeSpaceAsPlus = false;
-
-
-+ /**
-+ * Constructs a new URLEncoder with alphanumeric characters as safe.
-+ */
- public URLEncoder() {
- this(new BitSet(256));
-
-@@ -119,16 +129,31 @@ public final class URLEncoder implements Cloneable {
- }
-
-
-+ /**
-+ * Marks the given character as safe (not requiring encoding).
-+ *
-+ * @param c the character
-+ */
- public void addSafeCharacter(char c) {
- safeCharacters.set(c);
- }
-
-
-+ /**
-+ * Removes the given character from the set of safe characters.
-+ *
-+ * @param c the character
-+ */
- public void removeSafeCharacter(char c) {
- safeCharacters.clear(c);
- }
-
-
-+ /**
-+ * Sets whether space characters should be encoded as '+' instead of '%20'.
-+ *
-+ * @param encodeSpaceAsPlus true to use '+' for spaces
-+ */
- public void setEncodeSpaceAsPlus(boolean encodeSpaceAsPlus) {
- this.encodeSpaceAsPlus = encodeSpaceAsPlus;
- }
-diff --git a/java/org/apache/catalina/valves/SSLValve.java b/java/org/apache/catalina/valves/SSLValve.java
-index 1a7440837e..6f075d21c4 100644
---- a/java/org/apache/catalina/valves/SSLValve.java
-+++ b/java/org/apache/catalina/valves/SSLValve.java
-@@ -181,11 +181,23 @@ public class SSLValve extends ValveBase {
- return sslCipherUserKeySizeHeader;
- }
-
-+ /**
-+ * Sets the header name used to retrieve the cipher key size.
-+ *
-+ * @param sslCipherUserKeySizeHeader The cipher key size header name
-+ */
- public void setSslCipherUserKeySizeHeader(String sslCipherUserKeySizeHeader) {
- this.sslCipherUserKeySizeHeader = sslCipherUserKeySizeHeader;
- }
-
-
-+ /**
-+ * Retrieves the value of the specified header from the request, handling null and "(null)" values.
-+ *
-+ * @param request The request object
-+ * @param header The header name to retrieve
-+ * @return The header value, or null if not present or equal to "(null)"
-+ */
- public String mygetHeader(Request request, String header) {
- String strcert0 = request.getHeader(header);
- if (strcert0 == null) {
-diff --git a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java
-index 15ed866e6b..9134fda5a8 100644
---- a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java
-+++ b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java
-@@ -93,6 +93,8 @@ public class StuckThreadDetectionValve extends ValveBase {
- }
-
- /**
-+ * Returns the current threshold in seconds for stuck thread detection.
-+ *
- * @see #setThreshold(int)
- *
- * @return The current threshold in seconds
-@@ -102,6 +104,11 @@ public class StuckThreadDetectionValve extends ValveBase {
- }
-
-
-+ /**
-+ * Returns the threshold in seconds before stuck threads are interrupted.
-+ *
-+ * @return the thread interruption threshold in seconds
-+ */
- public int getInterruptThreadThreshold() {
- return interruptThreadThreshold;
- }
-@@ -226,10 +233,20 @@ public class StuckThreadDetectionValve extends ValveBase {
- }
- }
-
-+ /**
-+ * Returns the number of threads currently detected as stuck.
-+ *
-+ * @return the number of stuck threads
-+ */
- public int getStuckThreadCount() {
- return stuckCount.get();
- }
-
-+ /**
-+ * Returns the IDs of all threads currently detected as stuck.
-+ *
-+ * @return array of stuck thread IDs
-+ */
- @SuppressWarnings("deprecation")
- public long[] getStuckThreadIds() {
- List<Long> idList = new ArrayList<>();
-@@ -246,6 +263,11 @@ public class StuckThreadDetectionValve extends ValveBase {
- return result;
- }
-
-+ /**
-+ * Returns the names of all threads currently detected as stuck.
-+ *
-+ * @return array of stuck thread names
-+ */
- public String[] getStuckThreadNames() {
- List<String> nameList = new ArrayList<>();
- for (MonitoredThread monitoredThread : activeThreads.values()) {
-@@ -256,6 +278,12 @@ public class StuckThreadDetectionValve extends ValveBase {
- return nameList.toArray(new String[0]);
- }
-
-+ /**
-+ * Returns the total number of threads that have been interrupted
-+ * due to being stuck.
-+ *
-+ * @return the count of interrupted threads
-+ */
- public long getInterruptedThreadsCount() {
- return interruptedThreadsCount.get();
- }
-diff --git a/java/org/apache/catalina/valves/ValveBase.java b/java/org/apache/catalina/valves/ValveBase.java
-index aa210b2f9b..f9c1a16d58 100644
---- a/java/org/apache/catalina/valves/ValveBase.java
-+++ b/java/org/apache/catalina/valves/ValveBase.java
-@@ -34,16 +34,27 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public abstract class ValveBase extends LifecycleMBeanBase implements Contained, Valve {
-
-+ /**
-+ * StringManager for internationalized strings.
-+ */
- protected static final StringManager sm = StringManager.getManager(ValveBase.class);
-
-
- // ------------------------------------------------------ Constructor
-
-+ /**
-+ * Constructs a new ValveBase with async support disabled.
-+ */
- public ValveBase() {
- this(false);
- }
-
-
-+ /**
-+ * Constructs a new ValveBase.
-+ *
-+ * @param asyncSupported Whether this valve supports async requests
-+ */
- public ValveBase(boolean asyncSupported) {
- this.asyncSupported = asyncSupported;
- }
-@@ -95,6 +106,11 @@ public abstract class ValveBase extends LifecycleMBeanBase implements Contained,
- }
-
-
-+ /**
-+ * Sets whether this valve supports Servlet 3+ async requests.
-+ *
-+ * @param asyncSupported Whether this valve supports async requests
-+ */
- public void setAsyncSupported(boolean asyncSupported) {
- this.asyncSupported = asyncSupported;
- }
-diff --git a/java/org/apache/catalina/valves/rewrite/Substitution.java b/java/org/apache/catalina/valves/rewrite/Substitution.java
-index b63f5588db..664df31c6f 100644
---- a/java/org/apache/catalina/valves/rewrite/Substitution.java
-+++ b/java/org/apache/catalina/valves/rewrite/Substitution.java
-@@ -24,15 +24,57 @@ import java.util.regex.Matcher;
- import org.apache.catalina.util.URLEncoder;
- import org.apache.tomcat.util.res.StringManager;
-
-+/**
-+ * Represents a URL substitution pattern for rewrite rules. Supports back-references
-+ * to rewrite rules and conditions, server variables, and map lookups.
-+ */
- public class Substitution {
-
-+ /**
-+ * Constructs a new Substitution.
-+ */
-+ public Substitution() {
-+ }
-+
-+ /**
-+ * The string manager for this package.
-+ */
- protected static final StringManager sm = StringManager.getManager(Substitution.class);
-
-+ /**
-+ * Abstract base class for individual substitution elements.
-+ */
- public abstract static class SubstitutionElement {
-+ /**
-+ * Constructs a new SubstitutionElement.
-+ */
-+ public SubstitutionElement() {
-+ }
-+
-+ /**
-+ * Evaluates this element against the given matchers and resolver.
-+ *
-+ * @param rule the rewrite rule matcher
-+ * @param cond the condition matcher
-+ * @param resolver the property resolver
-+ * @return the evaluated string
-+ */
- public abstract String evaluate(Matcher rule, Matcher cond, Resolver resolver);
- }
-
-+ /**
-+ * Substitution element that produces a static string value.
-+ */
- public static class StaticElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new StaticElement.
-+ */
-+ public StaticElement() {
-+ }
-+
-+ /**
-+ * The static string value.
-+ */
- public String value;
-
- @Override
-@@ -42,7 +84,19 @@ public class Substitution {
-
- }
-
-+ /**
-+ * Substitution element that produces a back-reference to a rewrite rule group.
-+ */
- public class RewriteRuleBackReferenceElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new RewriteRuleBackReferenceElement.
-+ */
-+ public RewriteRuleBackReferenceElement() {
-+ }
-+
-+ /**
-+ * The group number to reference.
-+ */
- public int n;
-
- @Override
-@@ -63,7 +117,19 @@ public class Substitution {
- }
- }
-
-+ /**
-+ * Substitution element that produces a back-reference to a rewrite condition group.
-+ */
- public static class RewriteCondBackReferenceElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new RewriteCondBackReferenceElement.
-+ */
-+ public RewriteCondBackReferenceElement() {
-+ }
-+
-+ /**
-+ * The group number to reference.
-+ */
- public int n;
-
- @Override
-@@ -72,7 +138,19 @@ public class Substitution {
- }
- }
-
-+ /**
-+ * Substitution element that resolves a server variable.
-+ */
- public static class ServerVariableElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new ServerVariableElement.
-+ */
-+ public ServerVariableElement() {
-+ }
-+
-+ /**
-+ * The server variable name to resolve.
-+ */
- public String key;
-
- @Override
-@@ -81,7 +159,19 @@ public class Substitution {
- }
- }
-
-+ /**
-+ * Substitution element that resolves an environment variable.
-+ */
- public static class ServerVariableEnvElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new ServerVariableEnvElement.
-+ */
-+ public ServerVariableEnvElement() {
-+ }
-+
-+ /**
-+ * The environment variable name to resolve.
-+ */
- public String key;
-
- @Override
-@@ -90,7 +180,19 @@ public class Substitution {
- }
- }
-
-+ /**
-+ * Substitution element that resolves an SSL variable.
-+ */
- public static class ServerVariableSslElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new ServerVariableSslElement.
-+ */
-+ public ServerVariableSslElement() {
-+ }
-+
-+ /**
-+ * The SSL variable name to resolve.
-+ */
- public String key;
-
- @Override
-@@ -99,7 +201,19 @@ public class Substitution {
- }
- }
-
-+ /**
-+ * Substitution element that resolves an HTTP header variable.
-+ */
- public static class ServerVariableHttpElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new ServerVariableHttpElement.
-+ */
-+ public ServerVariableHttpElement() {
-+ }
-+
-+ /**
-+ * The HTTP header name to resolve.
-+ */
- public String key;
-
- @Override
-@@ -108,9 +222,29 @@ public class Substitution {
- }
- }
-
-+ /**
-+ * Substitution element that performs a rewrite map lookup.
-+ */
- public class MapElement extends SubstitutionElement {
-+ /**
-+ * Constructs a new MapElement.
-+ */
-+ public MapElement() {
-+ }
-+
-+ /**
-+ * The rewrite map to use for lookup.
-+ */
- public RewriteMap map = null;
-+
-+ /**
-+ * The default value elements if map lookup fails.
-+ */
- public SubstitutionElement[] defaultValue = null;
-+
-+ /**
-+ * The key elements for the map lookup.
-+ */
- public SubstitutionElement[] key = null;
-
- @Override
-@@ -123,24 +257,53 @@ public class Substitution {
- }
- }
-
-+ /**
-+ * The parsed substitution elements.
-+ */
- protected SubstitutionElement[] elements = null;
-
-+ /**
-+ * The raw substitution string.
-+ */
- protected String sub = null;
-
-+ /**
-+ * Returns the raw substitution string.
-+ *
-+ * @return the substitution string
-+ */
- public String getSub() {
- return sub;
- }
-
-+ /**
-+ * Sets the raw substitution string to be parsed.
-+ *
-+ * @param sub the substitution string
-+ */
- public void setSub(String sub) {
- this.sub = sub;
- }
-
-+ /**
-+ * Whether to escape back references.
-+ */
- private boolean escapeBackReferences;
-
-+ /**
-+ * Sets whether back references should be URL-encoded.
-+ *
-+ * @param escapeBackReferences true to enable escaping
-+ */
- void setEscapeBackReferences(boolean escapeBackReferences) {
- this.escapeBackReferences = escapeBackReferences;
- }
-
-+ /**
-+ * Parses the substitution string into individual elements.
-+ *
-+ * @param maps the available rewrite maps
-+ */
- public void parse(Map<String,RewriteMap> maps) {
- this.elements = parseSubstitution(sub, maps);
- }
-diff --git a/java/org/apache/catalina/webresources/StandardRoot.java b/java/org/apache/catalina/webresources/StandardRoot.java
-index 8a88f20590..a90e95b40b 100644
---- a/java/org/apache/catalina/webresources/StandardRoot.java
-+++ b/java/org/apache/catalina/webresources/StandardRoot.java
-@@ -63,6 +63,10 @@ import org.apache.tomcat.util.res.StringManager;
- public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot {
-
- private static final Log log = LogFactory.getLog(StandardRoot.class);
-+
-+ /**
-+ * Provides localized error messages.
-+ */
- protected static final StringManager sm = StringManager.getManager(StandardRoot.class);
-
- private Context context;
-@@ -103,6 +107,11 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- // NO-OP
- }
-
-+ /**
-+ * Creates a new standard implementation of {@link WebResourceRoot} with the given context.
-+ *
-+ * @param context The context associated with this web resource root
-+ */
- public StandardRoot(Context context) {
- this.context = context;
- }
-@@ -203,6 +212,14 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- return getResource(path, true, false);
- }
-
-+ /**
-+ * Retrieve a web resource by path with configurable validation and class loader resource lookup.
-+ *
-+ * @param path The path of the resource to retrieve
-+ * @param validate Whether to validate and normalize the path
-+ * @param useClassLoaderResources Whether to search class loader resources
-+ * @return The web resource, or a non-existent resource if not found
-+ */
- protected WebResource getResource(String path, boolean validate, boolean useClassLoaderResources) {
- if (validate) {
- path = validate(path);
-@@ -262,6 +279,13 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- return result;
- }
-
-+ /**
-+ * Retrieve a web resource by path from all registered resource sets.
-+ *
-+ * @param path The path of the resource to retrieve
-+ * @param useClassLoaderResources Whether to search class loader resources
-+ * @return The web resource, or a non-existent resource if not found
-+ */
- protected final WebResource getResourceInternal(String path, boolean useClassLoaderResources) {
- WebResource result;
- WebResource virtual = null;
-@@ -309,6 +333,13 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- }
- }
-
-+ /**
-+ * Retrieve all web resources matching the given path from all registered resource sets.
-+ *
-+ * @param path The path of the resources to retrieve
-+ * @param useClassLoaderResources Whether to search class loader resources
-+ * @return Array of web resources found at the given path
-+ */
- protected WebResource[] getResourcesInternal(String path, boolean useClassLoaderResources) {
- List<WebResource> result = new ArrayList<>();
- for (List<WebResourceSet> list : allResources) {
-@@ -334,6 +365,13 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- return listResources(path, true);
- }
-
-+ /**
-+ * List all web resources at the given path.
-+ *
-+ * @param path The path to list resources for
-+ * @param validate Whether to validate and normalize the path
-+ * @return Array of web resources found at the given path
-+ */
- protected WebResource[] listResources(String path, boolean validate) {
- if (validate) {
- path = validate(path);
-@@ -436,10 +474,20 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- return postResources.toArray(new WebResourceSet[0]);
- }
-
-+ /**
-+ * Returns the class resource sets registered with this root.
-+ *
-+ * @return Array of class resource sets
-+ */
- protected WebResourceSet[] getClassResources() {
- return classResources.toArray(new WebResourceSet[0]);
- }
-
-+ /**
-+ * Adds a class resource set to this root.
-+ *
-+ * @param webResourceSet The resource set to add
-+ */
- protected void addClassResources(WebResourceSet webResourceSet) {
- webResourceSet.setRoot(this);
- classResources.add(webResourceSet);
-@@ -546,6 +594,11 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- return this.archiveIndexStrategy;
- }
-
-+ /**
-+ * Returns the list of currently tracked resources.
-+ *
-+ * @return List of tracked resource paths
-+ */
- public List<String> getTrackedResources() {
- List<String> result = new ArrayList<>(trackedResources.size());
- for (TrackedWebResource resource : trackedResources) {
-@@ -693,6 +746,10 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- }
- }
-
-+ /**
-+ * Registers the URL stream handler factory to support jar:war:file:/ URLs,
-+ * which are required for resource JARs in packed WAR files.
-+ */
- protected void registerURLStreamHandlerFactory() {
- if (!JreCompat.isGraalAvailable()) {
- // Ensure support for jar:war:file:/ URLs will be available (required
-@@ -731,6 +788,11 @@ public class StandardRoot extends LifecycleMBeanBase implements WebResourceRoot
- setState(LifecycleState.STARTING);
- }
-
-+ /**
-+ * Creates the main resource set based on the context's docBase.
-+ *
-+ * @return The main resource set for the web application
-+ */
- protected WebResourceSet createMainResourceSet() {
- String docBase = context.getDocBase();
-
-diff --git a/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java b/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java
-index a8d7ac4d60..e3a42150c2 100644
---- a/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java
-+++ b/java/org/apache/catalina/webresources/TomcatURLStreamHandlerFactory.java
-@@ -24,6 +24,9 @@ import java.util.concurrent.CopyOnWriteArrayList;
-
- import org.apache.catalina.webresources.war.Handler;
-
-+/**
-+ * Factory for URL stream handlers that supports the war and classpath protocols.
-+ */
- public class TomcatURLStreamHandlerFactory implements URLStreamHandlerFactory {
-
- private static final String WAR_PROTOCOL = "war";
-@@ -123,6 +126,11 @@ public class TomcatURLStreamHandlerFactory implements URLStreamHandlerFactory {
- }
-
-
-+ /**
-+ * Returns whether this factory has been registered as the global URL stream handler factory.
-+ *
-+ * @return true if registered
-+ */
- public boolean isRegistered() {
- return registered;
- }
-diff --git a/java/org/apache/catalina/webresources/VirtualResource.java b/java/org/apache/catalina/webresources/VirtualResource.java
-index 24a33e1e81..dce56c6ebc 100644
---- a/java/org/apache/catalina/webresources/VirtualResource.java
-+++ b/java/org/apache/catalina/webresources/VirtualResource.java
-@@ -18,10 +18,23 @@ package org.apache.catalina.webresources;
-
- import org.apache.catalina.WebResourceRoot;
-
-+/**
-+ * A virtual resource that represents a directory entry created on-the-fly.
-+ */
- public class VirtualResource extends EmptyResource {
-
-+ /**
-+ * The name of the virtual resource.
-+ */
- private final String name;
-
-+ /**
-+ * Constructs a new VirtualResource.
-+ *
-+ * @param root The root resource set
-+ * @param webAppPath The web application path
-+ * @param name The resource name
-+ */
- public VirtualResource(WebResourceRoot root, String webAppPath, String name) {
- super(root, webAppPath);
- this.name = name;
-diff --git a/java/org/apache/catalina/webresources/WarResource.java b/java/org/apache/catalina/webresources/WarResource.java
-index 4672a3923f..60f7afd811 100644
---- a/java/org/apache/catalina/webresources/WarResource.java
-+++ b/java/org/apache/catalina/webresources/WarResource.java
-@@ -30,6 +30,14 @@ public class WarResource extends AbstractSingleArchiveResource {
- private static final Log log = LogFactory.getLog(WarResource.class);
-
-
-+ /**
-+ * Constructs a new WarResource.
-+ *
-+ * @param archiveResourceSet The archive resource set
-+ * @param webAppPath The web application path
-+ * @param baseUrl The base URL
-+ * @param jarEntry The JAR entry
-+ */
- public WarResource(AbstractArchiveResourceSet archiveResourceSet, String webAppPath, String baseUrl,
- JarEntry jarEntry) {
- super(archiveResourceSet, webAppPath, "war:" + baseUrl + UriUtil.getWarSeparator(), jarEntry, baseUrl);
-diff --git a/java/org/apache/catalina/webresources/war/WarURLConnection.java b/java/org/apache/catalina/webresources/war/WarURLConnection.java
-index b84a6865df..c8eba532c2 100644
---- a/java/org/apache/catalina/webresources/war/WarURLConnection.java
-+++ b/java/org/apache/catalina/webresources/war/WarURLConnection.java
-@@ -25,11 +25,27 @@ import java.security.Permission;
- import org.apache.tomcat.util.buf.UriUtil;
-
-
-+/**
-+ * URL connection for WAR resources that wraps a JAR URL connection.
-+ */
- public class WarURLConnection extends URLConnection {
-
-+ /**
-+ * The wrapped JAR URL connection.
-+ */
- private final URLConnection wrappedJarUrlConnection;
-+ /**
-+ * Whether this connection has been established.
-+ */
- private boolean connected;
-
-+ /**
-+ * Constructs a new WarURLConnection.
-+ *
-+ * @param url The URL to connect to
-+ *
-+ * @throws IOException If an I/O error occurs
-+ */
- protected WarURLConnection(URL url) throws IOException {
- super(url);
- URL innerJarUrl = UriUtil.warToJar(url);
-diff --git a/java/org/apache/coyote/UpgradeProtocol.java b/java/org/apache/coyote/UpgradeProtocol.java
-index 0e98608fc3..2d79ebfd6e 100644
---- a/java/org/apache/coyote/UpgradeProtocol.java
-+++ b/java/org/apache/coyote/UpgradeProtocol.java
-@@ -20,6 +20,9 @@ import org.apache.coyote.http11.AbstractHttp11Protocol;
- import org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler;
- import org.apache.tomcat.util.net.SocketWrapperBase;
-
-+/**
-+ * Protocol handler for HTTP upgrade connections.
-+ */
- public interface UpgradeProtocol {
-
- /**
-diff --git a/java/org/apache/coyote/UpgradeToken.java b/java/org/apache/coyote/UpgradeToken.java
-index d034763c62..0cd59a80ae 100644
---- a/java/org/apache/coyote/UpgradeToken.java
-+++ b/java/org/apache/coyote/UpgradeToken.java
-@@ -33,18 +33,38 @@ import org.apache.tomcat.InstanceManager;
- public record UpgradeToken(HttpUpgradeHandler httpUpgradeHandler, ContextBind contextBind,
- InstanceManager instanceManager, String protocol) {
-
-+ /**
-+ * Returns the context binder for this upgrade.
-+ *
-+ * @return the context binder
-+ */
- public ContextBind getContextBind() {
- return contextBind;
- }
-
-+ /**
-+ * Returns the HTTP upgrade handler.
-+ *
-+ * @return the upgrade handler
-+ */
- public HttpUpgradeHandler getHttpUpgradeHandler() {
- return httpUpgradeHandler;
- }
-
-+ /**
-+ * Returns the instance manager for creating servlets and filters.
-+ *
-+ * @return the instance manager
-+ */
- public InstanceManager getInstanceManager() {
- return instanceManager;
- }
-
-+ /**
-+ * Returns the protocol name for the upgrade.
-+ *
-+ * @return the protocol name
-+ */
- public String getProtocol() {
- return protocol;
- }
-diff --git a/java/org/apache/coyote/http11/filters/VoidInputFilter.java b/java/org/apache/coyote/http11/filters/VoidInputFilter.java
-index 5cefed41e2..434e13cba1 100644
---- a/java/org/apache/coyote/http11/filters/VoidInputFilter.java
-+++ b/java/org/apache/coyote/http11/filters/VoidInputFilter.java
-@@ -30,10 +30,22 @@ import org.apache.tomcat.util.net.ApplicationBufferHandler;
- */
- public class VoidInputFilter implements InputFilter {
-
-+ /**
-+ * Constructs a new VoidInputFilter.
-+ */
-+ public VoidInputFilter() {
-+ }
-+
-
- // -------------------------------------------------------------- Constants
-
-+ /**
-+ * Name of the void encoding.
-+ */
- protected static final String ENCODING_NAME = "void";
-+ /**
-+ * ByteChunk representation of the void encoding name.
-+ */
- protected static final ByteChunk ENCODING = new ByteChunk();
-
-
-diff --git a/java/org/apache/coyote/http11/filters/VoidOutputFilter.java b/java/org/apache/coyote/http11/filters/VoidOutputFilter.java
-index f8d4b9d014..18b88e2232 100644
---- a/java/org/apache/coyote/http11/filters/VoidOutputFilter.java
-+++ b/java/org/apache/coyote/http11/filters/VoidOutputFilter.java
-@@ -28,6 +28,12 @@ import org.apache.coyote.http11.OutputFilter;
- */
- public class VoidOutputFilter implements OutputFilter {
-
-+ /**
-+ * Constructs a new VoidOutputFilter.
-+ */
-+ public VoidOutputFilter() {
-+ }
-+
- private HttpOutputBuffer buffer = null;
-
-
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeApplicationBufferHandler.java b/java/org/apache/coyote/http11/upgrade/UpgradeApplicationBufferHandler.java
-index 264f79bb50..3c3e25c94f 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeApplicationBufferHandler.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeApplicationBufferHandler.java
-@@ -26,6 +26,15 @@ import org.apache.tomcat.util.net.ApplicationBufferHandler;
- */
- public class UpgradeApplicationBufferHandler implements ApplicationBufferHandler {
-
-+ /**
-+ * Constructs a new UpgradeApplicationBufferHandler.
-+ */
-+ public UpgradeApplicationBufferHandler() {
-+ }
-+
-+ /**
-+ * The buffered request body data.
-+ */
- private ByteBuffer byteBuffer;
-
- @Override
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java b/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java
-index f05d30051b..5f216de39c 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java
-@@ -27,19 +27,53 @@ import org.apache.tomcat.util.modeler.BaseModelMBean;
- */
- public class UpgradeGroupInfo extends BaseModelMBean {
-
-+ /**
-+ * Constructs a new UpgradeGroupInfo.
-+ */
-+ public UpgradeGroupInfo() {
-+ }
-+
-+ /**
-+ * The set of active upgrade connections.
-+ */
- private final Set<UpgradeInfo> upgradeInfos = (new ConcurrentHashMap<UpgradeInfo,Boolean>()).keySet(Boolean.TRUE);
-
-+ /**
-+ * Bytes received from completed connections.
-+ */
- private final LongAdder deadBytesReceived = new LongAdder();
-+
-+ /**
-+ * Bytes sent to completed connections.
-+ */
- private final LongAdder deadBytesSent = new LongAdder();
-+
-+ /**
-+ * Messages received from completed connections.
-+ */
- private final LongAdder deadMsgsReceived = new LongAdder();
-+
-+ /**
-+ * Messages sent to completed connections.
-+ */
- private final LongAdder deadMsgsSent = new LongAdder();
-
-
-+ /**
-+ * Adds an active upgrade connection to this group.
-+ *
-+ * @param ui the upgrade connection
-+ */
- public void addUpgradeInfo(UpgradeInfo ui) {
- upgradeInfos.add(ui);
- }
-
-
-+ /**
-+ * Removes an upgrade connection from this group.
-+ *
-+ * @param ui the upgrade connection to remove
-+ */
- public void removeUpgradeInfo(UpgradeInfo ui) {
- if (ui != null) {
- deadBytesReceived.add(ui.getBytesReceived());
-@@ -52,6 +86,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- }
-
-
-+ /**
-+ * Returns the total bytes received across all connections.
-+ *
-+ * @return the total bytes received
-+ */
- public long getBytesReceived() {
- long bytes = deadBytesReceived.longValue();
- for (UpgradeInfo ui : upgradeInfos) {
-@@ -60,6 +99,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- return bytes;
- }
-
-+ /**
-+ * Resets the bytes received counter.
-+ *
-+ * @param bytesReceived the new value (ignored, used for MBean reset)
-+ */
- public void setBytesReceived(long bytesReceived) {
- deadBytesReceived.reset();
- if (bytesReceived != 0) {
-@@ -71,6 +115,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- }
-
-
-+ /**
-+ * Returns the total bytes sent across all connections.
-+ *
-+ * @return the total bytes sent
-+ */
- public long getBytesSent() {
- long bytes = deadBytesSent.longValue();
- for (UpgradeInfo ui : upgradeInfos) {
-@@ -79,6 +128,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- return bytes;
- }
-
-+ /**
-+ * Resets the bytes sent counter.
-+ *
-+ * @param bytesSent the new value (ignored, used for MBean reset)
-+ */
- public void setBytesSent(long bytesSent) {
- deadBytesSent.reset();
- if (bytesSent != 0) {
-@@ -90,6 +144,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- }
-
-
-+ /**
-+ * Returns the total messages received across all connections.
-+ *
-+ * @return the total messages received
-+ */
- public long getMsgsReceived() {
- long msgs = deadMsgsReceived.longValue();
- for (UpgradeInfo ui : upgradeInfos) {
-@@ -98,6 +157,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- return msgs;
- }
-
-+ /**
-+ * Resets the messages received counter.
-+ *
-+ * @param msgsReceived the new value (ignored, used for MBean reset)
-+ */
- public void setMsgsReceived(long msgsReceived) {
- deadMsgsReceived.reset();
- if (msgsReceived != 0) {
-@@ -109,6 +173,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- }
-
-
-+ /**
-+ * Returns the total messages sent across all connections.
-+ *
-+ * @return the total messages sent
-+ */
- public long getMsgsSent() {
- long msgs = deadMsgsSent.longValue();
- for (UpgradeInfo ui : upgradeInfos) {
-@@ -117,6 +186,11 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- return msgs;
- }
-
-+ /**
-+ * Resets the messages sent counter.
-+ *
-+ * @param msgsSent the new value (ignored, used for MBean reset)
-+ */
- public void setMsgsSent(long msgsSent) {
- deadMsgsSent.reset();
- if (msgsSent != 0) {
-@@ -128,6 +202,9 @@ public class UpgradeGroupInfo extends BaseModelMBean {
- }
-
-
-+ /**
-+ * Resets all counters to zero.
-+ */
- public void resetCounters() {
- setBytesReceived(0);
- setBytesSent(0);
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeInfo.java b/java/org/apache/coyote/http11/upgrade/UpgradeInfo.java
-index 8b6a99014c..5a92d7ed89 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeInfo.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeInfo.java
-@@ -25,18 +25,53 @@ import java.util.concurrent.atomic.LongAdder;
- */
- public class UpgradeInfo {
-
-+ /**
-+ * Constructs a new UpgradeInfo.
-+ */
-+ public UpgradeInfo() {
-+ }
-+
-+ /**
-+ * The parent group info for aggregated statistics.
-+ */
- private UpgradeGroupInfo groupInfo = null;
-+
-+ /**
-+ * Counter for bytes sent.
-+ */
- private final LongAdder bytesSent = new LongAdder();
-+
-+ /**
-+ * Counter for bytes received.
-+ */
- private final LongAdder bytesReceived = new LongAdder();
-+
-+ /**
-+ * Counter for messages sent.
-+ */
- private final LongAdder msgsSent = new LongAdder();
-+
-+ /**
-+ * Counter for messages received.
-+ */
- private final LongAdder msgsReceived = new LongAdder();
-
-
-+ /**
-+ * Returns the parent group info.
-+ *
-+ * @return the group info
-+ */
- public UpgradeGroupInfo getGlobalProcessor() {
- return groupInfo;
- }
-
-
-+ /**
-+ * Sets the parent group info.
-+ *
-+ * @param groupInfo the group info
-+ */
- public void setGroupInfo(UpgradeGroupInfo groupInfo) {
- if (groupInfo == null) {
- if (this.groupInfo != null) {
-@@ -50,10 +85,20 @@ public class UpgradeInfo {
- }
-
-
-+ /**
-+ * Returns the number of bytes sent.
-+ *
-+ * @return the bytes sent
-+ */
- public long getBytesSent() {
- return bytesSent.longValue();
- }
-
-+ /**
-+ * Resets the bytes sent counter.
-+ *
-+ * @param bytesSent the new value
-+ */
- public void setBytesSent(long bytesSent) {
- this.bytesSent.reset();
- if (bytesSent > 0) {
-@@ -61,15 +106,30 @@ public class UpgradeInfo {
- }
- }
-
-+ /**
-+ * Adds to the bytes sent counter.
-+ *
-+ * @param bytesSent the amount to add
-+ */
- public void addBytesSent(long bytesSent) {
- this.bytesSent.add(bytesSent);
- }
-
-
-+ /**
-+ * Returns the number of bytes received.
-+ *
-+ * @return the bytes received
-+ */
- public long getBytesReceived() {
- return bytesReceived.longValue();
- }
-
-+ /**
-+ * Resets the bytes received counter.
-+ *
-+ * @param bytesReceived the new value
-+ */
- public void setBytesReceived(long bytesReceived) {
- this.bytesReceived.reset();
- if (bytesReceived > 0) {
-@@ -77,15 +137,30 @@ public class UpgradeInfo {
- }
- }
-
-+ /**
-+ * Adds to the bytes received counter.
-+ *
-+ * @param bytesReceived the amount to add
-+ */
- public void addBytesReceived(long bytesReceived) {
- this.bytesReceived.add(bytesReceived);
- }
-
-
-+ /**
-+ * Returns the number of messages sent.
-+ *
-+ * @return the messages sent
-+ */
- public long getMsgsSent() {
- return msgsSent.longValue();
- }
-
-+ /**
-+ * Resets the messages sent counter.
-+ *
-+ * @param msgsSent the new value
-+ */
- public void setMsgsSent(long msgsSent) {
- this.msgsSent.reset();
- if (msgsSent > 0) {
-@@ -93,15 +168,30 @@ public class UpgradeInfo {
- }
- }
-
-+ /**
-+ * Adds to the messages sent counter.
-+ *
-+ * @param msgsSent the amount to add
-+ */
- public void addMsgsSent(long msgsSent) {
- this.msgsSent.add(msgsSent);
- }
-
-
-+ /**
-+ * Returns the number of messages received.
-+ *
-+ * @return the messages received
-+ */
- public long getMsgsReceived() {
- return msgsReceived.longValue();
- }
-
-+ /**
-+ * Resets the messages received counter.
-+ *
-+ * @param msgsReceived the new value
-+ */
- public void setMsgsReceived(long msgsReceived) {
- this.msgsReceived.reset();
- if (msgsReceived > 0) {
-@@ -109,6 +199,11 @@ public class UpgradeInfo {
- }
- }
-
-+ /**
-+ * Adds to the messages received counter.
-+ *
-+ * @param msgsReceived the amount to add
-+ */
- public void addMsgsReceived(long msgsReceived) {
- this.msgsReceived.add(msgsReceived);
- }
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeProcessorBase.java b/java/org/apache/coyote/http11/upgrade/UpgradeProcessorBase.java
-index 01923d73a0..b0ecddbc96 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeProcessorBase.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeProcessorBase.java
-@@ -27,12 +27,26 @@ import org.apache.coyote.UpgradeToken;
- import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
- import org.apache.tomcat.util.net.SocketWrapperBase;
-
-+/**
-+ * Base class for HTTP upgrade processors.
-+ */
- public abstract class UpgradeProcessorBase extends AbstractProcessorLight implements WebConnection {
-
-+ /**
-+ * Timeout value that disables timeout checking.
-+ */
- protected static final int INFINITE_TIMEOUT = -1;
-
-+ /**
-+ * The upgrade token containing handler and context information.
-+ */
- private final UpgradeToken upgradeToken;
-
-+ /**
-+ * Constructs a new UpgradeProcessorBase.
-+ *
-+ * @param upgradeToken the upgrade token
-+ */
- public UpgradeProcessorBase(UpgradeToken upgradeToken) {
- this.upgradeToken = upgradeToken;
- }
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeProcessorExternal.java b/java/org/apache/coyote/http11/upgrade/UpgradeProcessorExternal.java
-index 19520b8595..2bd9e14b3e 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeProcessorExternal.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeProcessorExternal.java
-@@ -30,15 +30,36 @@ import org.apache.tomcat.util.net.SocketEvent;
- import org.apache.tomcat.util.net.SocketWrapperBase;
- import org.apache.tomcat.util.res.StringManager;
-
-+/**
-+ * Upgrade processor for external (Servlet-based) upgrade handlers.
-+ */
- public class UpgradeProcessorExternal extends UpgradeProcessorBase {
-
- private static final Log log = LogFactory.getLog(UpgradeProcessorExternal.class);
- private static final StringManager sm = StringManager.getManager(UpgradeProcessorExternal.class);
-
-+ /**
-+ * The input stream for the upgraded connection.
-+ */
- private final UpgradeServletInputStream upgradeServletInputStream;
-+
-+ /**
-+ * The output stream for the upgraded connection.
-+ */
- private final UpgradeServletOutputStream upgradeServletOutputStream;
-+
-+ /**
-+ * Statistics for this upgraded connection.
-+ */
- private final UpgradeInfo upgradeInfo;
-
-+ /**
-+ * Constructs a new UpgradeProcessorExternal.
-+ *
-+ * @param wrapper the socket wrapper
-+ * @param upgradeToken the upgrade token
-+ * @param upgradeGroupInfo the group info for statistics
-+ */
- public UpgradeProcessorExternal(SocketWrapperBase<?> wrapper, UpgradeToken upgradeToken,
- UpgradeGroupInfo upgradeGroupInfo) {
- super(upgradeToken);
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeProcessorInternal.java b/java/org/apache/coyote/http11/upgrade/UpgradeProcessorInternal.java
-index 6b9829123f..97c0601d65 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeProcessorInternal.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeProcessorInternal.java
-@@ -29,12 +29,25 @@ import org.apache.tomcat.util.net.SSLSupport;
- import org.apache.tomcat.util.net.SocketEvent;
- import org.apache.tomcat.util.net.SocketWrapperBase;
-
-+/**
-+ * Upgrade processor for internal (Coyote-based) upgrade handlers.
-+ */
- public class UpgradeProcessorInternal extends UpgradeProcessorBase {
-
- private static final Log log = LogFactory.getLog(UpgradeProcessorInternal.class);
-
-+ /**
-+ * The internal upgrade handler.
-+ */
- private final InternalHttpUpgradeHandler internalHttpUpgradeHandler;
-
-+ /**
-+ * Constructs a new UpgradeProcessorInternal.
-+ *
-+ * @param wrapper the socket wrapper
-+ * @param upgradeToken the upgrade token
-+ * @param upgradeGroupInfo the group info for statistics
-+ */
- public UpgradeProcessorInternal(SocketWrapperBase<?> wrapper, UpgradeToken upgradeToken,
- UpgradeGroupInfo upgradeGroupInfo) {
- super(upgradeToken);
-@@ -85,6 +98,11 @@ public class UpgradeProcessorInternal extends UpgradeProcessorBase {
- }
-
-
-+ /**
-+ * Returns whether the internal handler has pending async I/O.
-+ *
-+ * @return true if there is async I/O
-+ */
- public boolean hasAsyncIO() {
- return internalHttpUpgradeHandler.hasAsyncIO();
- }
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java b/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java
-index dc44dc70e8..9ba06c1e7a 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java
-@@ -29,22 +29,58 @@ import org.apache.tomcat.util.net.DispatchType;
- import org.apache.tomcat.util.net.SocketWrapperBase;
- import org.apache.tomcat.util.res.StringManager;
-
-+/**
-+ * Input stream for an HTTP upgraded connection.
-+ */
- public class UpgradeServletInputStream extends ServletInputStream {
-
- private static final Log log = LogFactory.getLog(UpgradeServletInputStream.class);
- private static final StringManager sm = StringManager.getManager(UpgradeServletInputStream.class);
-
-+ /**
-+ * The processor handling this connection.
-+ */
- private final UpgradeProcessorBase processor;
-+
-+ /**
-+ * The underlying socket wrapper.
-+ */
- private final SocketWrapperBase<?> socketWrapper;
-+
-+ /**
-+ * Statistics for this connection.
-+ */
- private final UpgradeInfo upgradeInfo;
-
-+ /**
-+ * Whether the stream has been closed.
-+ */
- private volatile boolean closed = false;
-+
-+ /**
-+ * Whether end-of-file has been reached.
-+ */
- private volatile boolean eof = false;
-+
- // Start in blocking-mode
-+ /**
-+ * Whether data is ready to read.
-+ */
- private volatile Boolean ready = Boolean.TRUE;
-+
-+ /**
-+ * The async read listener.
-+ */
- private volatile ReadListener listener = null;
-
-
-+ /**
-+ * Constructs a new UpgradeServletInputStream.
-+ *
-+ * @param processor the processor
-+ * @param socketWrapper the socket wrapper
-+ * @param upgradeInfo the statistics object
-+ */
- public UpgradeServletInputStream(UpgradeProcessorBase processor, SocketWrapperBase<?> socketWrapper,
- UpgradeInfo upgradeInfo) {
- this.processor = processor;
-diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
-index ba898893ea..d302a97c25 100644
---- a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
-+++ b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
-@@ -29,17 +29,34 @@ import org.apache.tomcat.util.net.DispatchType;
- import org.apache.tomcat.util.net.SocketWrapperBase;
- import org.apache.tomcat.util.res.StringManager;
-
-+/**
-+ * Output stream for an HTTP upgraded connection.
-+ */
- public class UpgradeServletOutputStream extends ServletOutputStream {
-
- private static final Log log = LogFactory.getLog(UpgradeServletOutputStream.class);
- private static final StringManager sm = StringManager.getManager(UpgradeServletOutputStream.class);
-
-+ /**
-+ * The processor handling this connection.
-+ */
- private final UpgradeProcessorBase processor;
-+
-+ /**
-+ * The underlying socket wrapper.
-+ */
- private final SocketWrapperBase<?> socketWrapper;
-+
-+ /**
-+ * Statistics for this connection.
-+ */
- private final UpgradeInfo upgradeInfo;
-
- // Used to ensure that isReady() and onWritePossible() have a consistent
- // view of buffer and registered.
-+ /**
-+ * Lock for registered state.
-+ */
- private final Object registeredLock = new Object();
-
- // Used to ensure that only one thread writes to the socket at a time and
-@@ -47,19 +64,41 @@ public class UpgradeServletOutputStream extends ServletOutputStream {
- // write. Note it is not necessary to hold this lock when checking if buffer
- // contains data but, depending on how the result is used, some form of
- // synchronization may be required (see fireListenerLock for an example).
-+ /**
-+ * Lock for write operations.
-+ */
- private final Object writeLock = new Object();
-
-+ /**
-+ * Whether a flush is in progress.
-+ */
- private volatile boolean flushing = false;
-
-+ /**
-+ * Whether the stream has been closed.
-+ */
- private volatile boolean closed = false;
-
- // Start in blocking-mode
-+ /**
-+ * The async write listener.
-+ */
- private volatile WriteListener listener = null;
-
- // Guarded by registeredLock
-+ /**
-+ * Whether the write listener is registered.
-+ */
- private boolean registered = false;
-
-
-+ /**
-+ * Constructs a new UpgradeServletOutputStream.
-+ *
-+ * @param processor the processor
-+ * @param socketWrapper the socket wrapper
-+ * @param upgradeInfo the statistics object
-+ */
- public UpgradeServletOutputStream(UpgradeProcessorBase processor, SocketWrapperBase<?> socketWrapper,
- UpgradeInfo upgradeInfo) {
- this.processor = processor;
-diff --git a/java/org/apache/el/ValueExpressionImpl.java b/java/org/apache/el/ValueExpressionImpl.java
-index 2bcdf07641..78f3aa8f38 100644
---- a/java/org/apache/el/ValueExpressionImpl.java
-+++ b/java/org/apache/el/ValueExpressionImpl.java
-@@ -83,10 +83,22 @@ public final class ValueExpressionImpl extends ValueExpression implements Extern
-
- private transient Node node;
-
-+ /**
-+ * Constructs a new ValueExpressionImpl.
-+ */
- public ValueExpressionImpl() {
- super();
- }
-
-+ /**
-+ * Constructs a new ValueExpressionImpl.
-+ *
-+ * @param expr The expression string
-+ * @param node The AST node
-+ * @param fnMapper The function mapper
-+ * @param varMapper The variable mapper
-+ * @param expectedType The expected return type
-+ */
- public ValueExpressionImpl(String expr, Node node, FunctionMapper fnMapper, VariableMapper varMapper,
- Class<?> expectedType) {
- this.expr = expr;
-diff --git a/java/org/apache/el/ValueExpressionLiteral.java b/java/org/apache/el/ValueExpressionLiteral.java
-index 426a6e4892..616fe436db 100644
---- a/java/org/apache/el/ValueExpressionLiteral.java
-+++ b/java/org/apache/el/ValueExpressionLiteral.java
-@@ -30,6 +30,9 @@ import org.apache.el.util.MessageFactory;
- import org.apache.el.util.ReflectionUtil;
-
-
-+/**
-+ * A literal value expression that represents a constant value.
-+ */
- public final class ValueExpressionLiteral extends ValueExpression implements Externalizable {
-
- @Serial
-@@ -40,10 +43,19 @@ public final class ValueExpressionLiteral extends ValueExpression implements Ext
-
- private Class<?> expectedType;
-
-+ /**
-+ * Constructs a new ValueExpressionLiteral for deserialization.
-+ */
- public ValueExpressionLiteral() {
- super();
- }
-
-+ /**
-+ * Constructs a new ValueExpressionLiteral.
-+ *
-+ * @param value The literal value
-+ * @param expectedType The expected return type
-+ */
- public ValueExpressionLiteral(Object value, Class<?> expectedType) {
- this.value = value;
- this.expectedType = expectedType;
-@@ -102,6 +114,13 @@ public final class ValueExpressionLiteral extends ValueExpression implements Ext
- return (obj instanceof ValueExpressionLiteral && this.equals((ValueExpressionLiteral) obj));
- }
-
-+ /**
-+ * Compares this literal value expression with another for equality.
-+ *
-+ * @param ve The other literal value expression
-+ *
-+ * @return {@code true} if the values are equal, {@code false} otherwise
-+ */
- public boolean equals(ValueExpressionLiteral ve) {
- return (ve != null &&
- (this.value != null && ve.value != null && (this.value == ve.value || this.value.equals(ve.value))));
-diff --git a/java/org/apache/el/lang/VariableMapperFactory.java b/java/org/apache/el/lang/VariableMapperFactory.java
-index 1a9409ebf8..26e20135a3 100644
---- a/java/org/apache/el/lang/VariableMapperFactory.java
-+++ b/java/org/apache/el/lang/VariableMapperFactory.java
-@@ -21,11 +21,27 @@ import jakarta.el.VariableMapper;
-
- import org.apache.el.util.MessageFactory;
-
-+/**
-+ * Factory for creating variable mappers that track variable resolutions.
-+ */
- public class VariableMapperFactory extends VariableMapper {
-
-+ /**
-+ * The target variable mapper to delegate to.
-+ */
- private final VariableMapper target;
-+ /**
-+ * The momento mapper that tracks resolved variables.
-+ */
- private VariableMapper momento;
-
-+ /**
-+ * Constructs a new VariableMapperFactory.
-+ *
-+ * @param target The target variable mapper to delegate to
-+ *
-+ * @throws NullPointerException if target is null
-+ */
- public VariableMapperFactory(VariableMapper target) {
- if (target == null) {
- throw new NullPointerException(MessageFactory.get("error.noVariableMapperTarget"));
-@@ -33,6 +49,11 @@ public class VariableMapperFactory extends VariableMapper {
- this.target = target;
- }
-
-+ /**
-+ * Returns the momento mapper containing all resolved variables.
-+ *
-+ * @return the momento mapper, or {@code null} if no variables have been resolved
-+ */
- public VariableMapper create() {
- return this.momento;
- }
-diff --git a/java/org/apache/el/lang/VariableMapperImpl.java b/java/org/apache/el/lang/VariableMapperImpl.java
-index e22adb4408..a2b8bb1d06 100644
---- a/java/org/apache/el/lang/VariableMapperImpl.java
-+++ b/java/org/apache/el/lang/VariableMapperImpl.java
-@@ -27,6 +27,9 @@ import java.util.Map;
- import jakarta.el.ValueExpression;
- import jakarta.el.VariableMapper;
-
-+/**
-+ * Implementation of VariableMapper that stores variables in a map.
-+ */
- public class VariableMapperImpl extends VariableMapper implements Externalizable {
-
- @Serial
-@@ -34,6 +37,9 @@ public class VariableMapperImpl extends VariableMapper implements Externalizable
-
- private Map<String,ValueExpression> vars = new HashMap<>();
-
-+ /**
-+ * Constructs a new VariableMapperImpl for deserialization.
-+ */
- public VariableMapperImpl() {
- super();
- }
-diff --git a/java/org/apache/el/stream/Stream.java b/java/org/apache/el/stream/Stream.java
-index 3b3f32e31a..e605af2f28 100644
---- a/java/org/apache/el/stream/Stream.java
-+++ b/java/org/apache/el/stream/Stream.java
-@@ -32,16 +32,31 @@ import org.apache.el.lang.ELArithmetic;
- import org.apache.el.lang.ELSupport;
- import org.apache.el.util.MessageFactory;
-
-+/**
-+ * A stream of elements supporting sequential operations such as filter, map,
-+ * reduce, and various terminal operations.
-+ */
- public class Stream {
-
- private final Iterator<Object> iterator;
-
-
-+ /**
-+ * Constructs a new Stream from the given iterator.
-+ *
-+ * @param iterator the iterator providing the stream elements
-+ */
- public Stream(Iterator<Object> iterator) {
- this.iterator = iterator;
- }
-
-
-+ /**
-+ * Returns a stream consisting of the elements that match the given predicate.
-+ *
-+ * @param le the predicate to apply to each element
-+ * @return the new filtered stream
-+ */
- public Stream filter(final LambdaExpression le) {
- Iterator<Object> downStream = new OpIterator() {
- @Override
-@@ -60,6 +75,13 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns a stream consisting of the results of applying the given function
-+ * to the elements of this stream.
-+ *
-+ * @param le the function to apply to each element
-+ * @return the new mapped stream
-+ */
- public Stream map(final LambdaExpression le) {
- Iterator<Object> downStream = new OpIterator() {
- @Override
-@@ -75,6 +97,14 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns a stream consisting of the results of replacing each element of
-+ * this stream with the contents of a stream produced by applying the provided
-+ * function to each element.
-+ *
-+ * @param le the function to apply to each element which produces a new stream
-+ * @return the new flattened stream
-+ */
- public Stream flatMap(final LambdaExpression le) {
- Iterator<Object> downStream = new OpIterator() {
-
-@@ -99,6 +129,11 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns a stream consisting of the distinct elements of this stream.
-+ *
-+ * @return the new stream with distinct elements
-+ */
- public Stream distinct() {
- Iterator<Object> downStream = new OpIterator() {
-
-@@ -120,6 +155,12 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns a stream consisting of the elements of this stream, sorted
-+ * according to natural order.
-+ *
-+ * @return the new sorted stream
-+ */
- public Stream sorted() {
- Iterator<Object> downStream = new OpIterator() {
-
-@@ -150,6 +191,13 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns a stream consisting of the elements of this stream, sorted
-+ * according to the order induced by the provided comparator.
-+ *
-+ * @param le the comparator to determine sort order
-+ * @return the new sorted stream
-+ */
- public Stream sorted(final LambdaExpression le) {
- Iterator<Object> downStream = new OpIterator() {
-
-@@ -181,6 +229,12 @@ public class Stream {
- }
-
-
-+ /**
-+ * Performs an action for each element of this stream.
-+ *
-+ * @param le the action to perform for each element
-+ * @return null
-+ */
- public Object forEach(final LambdaExpression le) {
- while (iterator.hasNext()) {
- le.invoke(iterator.next());
-@@ -189,6 +243,13 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns a stream consisting of the elements of this stream, additionally
-+ * performing the provided action on each element as elements are consumed.
-+ *
-+ * @param le the action to perform on each element
-+ * @return the new stream
-+ */
- public Stream peek(final LambdaExpression le) {
- Iterator<Object> downStream = new OpIterator() {
- @Override
-@@ -205,20 +266,46 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns the underlying iterator for this stream.
-+ *
-+ * @return the underlying iterator
-+ */
- public Iterator<?> iterator() {
- return iterator;
- }
-
-
-+ /**
-+ * Returns a stream consisting of the first {@code count} elements of this stream.
-+ *
-+ * @param count the number of elements to limit to
-+ * @return the new limited stream
-+ */
- public Stream limit(final Number count) {
- return substream(Integer.valueOf(0), count);
- }
-
-
-+ /**
-+ * Returns a stream consisting of the elements of this stream from the
-+ * specified start position to the end.
-+ *
-+ * @param start the start position (inclusive)
-+ * @return the new substream
-+ */
- public Stream substream(final Number start) {
- return substream(start, Integer.valueOf(Integer.MAX_VALUE));
- }
-
-+ /**
-+ * Returns a stream consisting of the elements of this stream from the
-+ * specified start position up to, but not including, the specified end position.
-+ *
-+ * @param start the start position (inclusive)
-+ * @param end the end position (exclusive)
-+ * @return the new substream
-+ */
- public Stream substream(final Number start, final Number end) {
-
- Iterator<Object> downStream = new OpIterator() {
-@@ -244,6 +331,11 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns a list containing all the elements of this stream.
-+ *
-+ * @return the list of elements
-+ */
- public List<Object> toList() {
- List<Object> result = new ArrayList<>();
- while (iterator.hasNext()) {
-@@ -253,6 +345,11 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns an array containing all the elements of this stream.
-+ *
-+ * @return the array of elements
-+ */
- public Object[] toArray() {
- List<Object> result = new ArrayList<>();
- while (iterator.hasNext()) {
-@@ -262,6 +359,13 @@ public class Stream {
- }
-
-
-+ /**
-+ * Performs a reduction on the elements of this stream, using the provided
-+ * accumulator function. The first element is used as the initial value.
-+ *
-+ * @param le the accumulator function
-+ * @return an Optional describing the reduced value, or empty if this stream is empty
-+ */
- public Optional reduce(LambdaExpression le) {
- Object seed = null;
-
-@@ -277,6 +381,14 @@ public class Stream {
- }
-
-
-+ /**
-+ * Performs a reduction on the elements of this stream, using the provided
-+ * initial value and accumulator function.
-+ *
-+ * @param seed the initial value for the reduction
-+ * @param le the accumulator function
-+ * @return the result of the reduction
-+ */
- public Object reduce(Object seed, LambdaExpression le) {
- Object result = seed;
-
-@@ -288,26 +400,53 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns the maximum element of this stream according to natural order.
-+ *
-+ * @return an Optional describing the maximum element, or empty if this stream is empty
-+ */
- public Optional max() {
- return compare(true);
- }
-
-
-+ /**
-+ * Returns the maximum element of this stream according to the provided comparator.
-+ *
-+ * @param le the comparator to determine the maximum
-+ * @return an Optional describing the maximum element, or empty if this stream is empty
-+ */
- public Optional max(LambdaExpression le) {
- return compare(true, le);
- }
-
-
-+ /**
-+ * Returns the minimum element of this stream according to natural order.
-+ *
-+ * @return an Optional describing the minimum element, or empty if this stream is empty
-+ */
- public Optional min() {
- return compare(false);
- }
-
-
-+ /**
-+ * Returns the minimum element of this stream according to the provided comparator.
-+ *
-+ * @param le the comparator to determine the minimum
-+ * @return an Optional describing the minimum element, or empty if this stream is empty
-+ */
- public Optional min(LambdaExpression le) {
- return compare(false, le);
- }
-
-
-+ /**
-+ * Calculates the average of all numeric elements in the stream.
-+ *
-+ * @return an Optional containing the average, or empty if the stream is empty
-+ */
- public Optional average() {
- long count = 0;
- Number sum = Long.valueOf(0);
-@@ -325,6 +464,11 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns the sum of all numeric elements in the stream.
-+ *
-+ * @return the sum of all elements
-+ */
- public Number sum() {
- Number sum = Long.valueOf(0);
-
-@@ -336,6 +480,11 @@ public class Stream {
- }
-
-
-+ /**
-+ * Counts the number of elements in the stream.
-+ *
-+ * @return the number of elements
-+ */
- public Long count() {
- long count = 0;
-
-@@ -348,6 +497,12 @@ public class Stream {
- }
-
-
-+ /**
-+ * Checks if any element in the stream matches the given predicate.
-+ *
-+ * @param le the predicate lambda expression
-+ * @return an Optional containing true if any element matches, or empty if the stream is empty
-+ */
- public Optional anyMatch(LambdaExpression le) {
- if (!iterator.hasNext()) {
- return Optional.EMPTY;
-@@ -363,6 +518,12 @@ public class Stream {
- }
-
-
-+ /**
-+ * Checks if all elements in the stream match the given predicate.
-+ *
-+ * @param le the predicate lambda expression
-+ * @return an Optional containing true if all elements match, or empty if the stream is empty
-+ */
- public Optional allMatch(LambdaExpression le) {
- if (!iterator.hasNext()) {
- return Optional.EMPTY;
-@@ -378,6 +539,12 @@ public class Stream {
- }
-
-
-+ /**
-+ * Checks if no elements of this stream match the given predicate.
-+ *
-+ * @param le the predicate lambda expression
-+ * @return an Optional containing true if no elements match, or empty if the stream is empty
-+ */
- public Optional noneMatch(LambdaExpression le) {
- if (!iterator.hasNext()) {
- return Optional.EMPTY;
-@@ -393,6 +560,12 @@ public class Stream {
- }
-
-
-+ /**
-+ * Returns an Optional describing the first element of this stream,
-+ * or an empty Optional if the stream is empty.
-+ *
-+ * @return an Optional describing the first element of this stream
-+ */
- public Optional findFirst() {
- if (iterator.hasNext()) {
- return new Optional(iterator.next());
-diff --git a/java/org/apache/el/stream/StreamELResolverImpl.java b/java/org/apache/el/stream/StreamELResolverImpl.java
-index c4531b5680..97752d029f 100644
---- a/java/org/apache/el/stream/StreamELResolverImpl.java
-+++ b/java/org/apache/el/stream/StreamELResolverImpl.java
-@@ -24,8 +24,18 @@ import java.util.NoSuchElementException;
- import jakarta.el.ELContext;
- import jakarta.el.ELResolver;
-
-+/**
-+ * EL resolver that provides stream operations on arrays and collections
-+ * through the {@code .stream} method.
-+ */
- public class StreamELResolverImpl extends ELResolver {
-
-+ /**
-+ * Constructs a new StreamELResolverImpl.
-+ */
-+ public StreamELResolverImpl() {
-+ }
-+
- @Override
- public Object getValue(ELContext context, Object base, Object property) {
- return null;
-diff --git a/java/org/apache/el/util/Validation.java b/java/org/apache/el/util/Validation.java
-index 761428542a..94cc529fbe 100644
---- a/java/org/apache/el/util/Validation.java
-+++ b/java/org/apache/el/util/Validation.java
-@@ -16,6 +16,9 @@
- */
- package org.apache.el.util;
-
-+/**
-+ * Utility class for validation operations related to EL identifiers.
-+ */
- public class Validation {
-
- /*
-diff --git a/java/org/apache/jasper/TrimSpacesOption.java b/java/org/apache/jasper/TrimSpacesOption.java
-index 2890aa378f..8b10d79b93 100644
---- a/java/org/apache/jasper/TrimSpacesOption.java
-+++ b/java/org/apache/jasper/TrimSpacesOption.java
-@@ -16,9 +16,24 @@
- */
- package org.apache.jasper;
-
-+/**
-+ * Options for the trimDirectiveWhitespaces JSP attribute.
-+ */
- public enum TrimSpacesOption {
-+ /**
-+ * Equivalent to trimDirectiveWhitespaces="false".
-+ */
- FALSE,
-+ /**
-+ * Equivalent to trimDirectiveWhitespaces="true".
-+ */
- TRUE,
-+ /**
-+ * Trim whitespace around directives and scriptlet elements.
-+ */
- SINGLE,
-+ /**
-+ * Trim whitespace around directives, scriptlet elements, and template text.
-+ */
- EXTENDED
- }
-diff --git a/java/org/apache/jasper/compiler/StringInterpreterFactory.java b/java/org/apache/jasper/compiler/StringInterpreterFactory.java
-index 45c637dab6..4f32f8df64 100644
---- a/java/org/apache/jasper/compiler/StringInterpreterFactory.java
-+++ b/java/org/apache/jasper/compiler/StringInterpreterFactory.java
-@@ -28,6 +28,9 @@ import jakarta.servlet.ServletContext;
- */
- public class StringInterpreterFactory {
-
-+ /**
-+ * The name used for the StringInterpreter ServletContext attribute and init parameter.
-+ */
- public static final String STRING_INTERPRETER_CLASS_NAME = StringInterpreter.class.getName();
-
- private static final StringInterpreter DEFAULT_INSTANCE = new DefaultStringInterpreter();
-@@ -85,8 +88,17 @@ public class StringInterpreterFactory {
- }
-
-
-+ /**
-+ * Default implementation of StringInterpreter that handles standard type conversions.
-+ */
- public static class DefaultStringInterpreter implements StringInterpreter {
-
-+ /**
-+ * Constructs a new DefaultStringInterpreter.
-+ */
-+ public DefaultStringInterpreter() {
-+ }
-+
- @Override
- public String convertString(Class<?> c, String s, String attrName, Class<?> propEditorClass,
- boolean isNamedAttribute) {
-diff --git a/java/org/apache/jasper/compiler/TagConstants.java b/java/org/apache/jasper/compiler/TagConstants.java
-index 2633d37744..16a99e36fd 100644
---- a/java/org/apache/jasper/compiler/TagConstants.java
-+++ b/java/org/apache/jasper/compiler/TagConstants.java
-@@ -16,91 +16,263 @@
- */
- package org.apache.jasper.compiler;
-
-+/**
-+ * Constants for JSP tag action names and URIs used during compilation.
-+ */
- public interface TagConstants {
-
-+ /**
-+ * The standard JSP namespace URI.
-+ */
- String JSP_URI = "http://java.sun.com/JSP/Page";
-
-+ /**
-+ * Prefix for directive action names.
-+ */
- String DIRECTIVE_ACTION = "directive.";
-
-+ /**
-+ * Internal name for the root action.
-+ */
- String ROOT_ACTION = "root";
-+
-+ /**
-+ * JSP namespace name for the root action.
-+ */
- String JSP_ROOT_ACTION = "jsp:root";
-
-+ /**
-+ * Internal name for the page directive action.
-+ */
- String PAGE_DIRECTIVE_ACTION = "directive.page";
-+
-+ /**
-+ * JSP namespace name for the page directive action.
-+ */
- String JSP_PAGE_DIRECTIVE_ACTION = "jsp:directive.page";
-
-+ /**
-+ * Internal name for the include directive action.
-+ */
- String INCLUDE_DIRECTIVE_ACTION = "directive.include";
-+
-+ /**
-+ * JSP namespace name for the include directive action.
-+ */
- String JSP_INCLUDE_DIRECTIVE_ACTION = "jsp:directive.include";
-
-+ /**
-+ * Internal name for the declaration action.
-+ */
- String DECLARATION_ACTION = "declaration";
-+
-+ /**
-+ * JSP namespace name for the declaration action.
-+ */
- String JSP_DECLARATION_ACTION = "jsp:declaration";
-
-+ /**
-+ * Internal name for the scriptlet action.
-+ */
- String SCRIPTLET_ACTION = "scriptlet";
-+
-+ /**
-+ * JSP namespace name for the scriptlet action.
-+ */
- String JSP_SCRIPTLET_ACTION = "jsp:scriptlet";
-
-+ /**
-+ * Internal name for the expression action.
-+ */
- String EXPRESSION_ACTION = "expression";
-+
-+ /**
-+ * JSP namespace name for the expression action.
-+ */
- String JSP_EXPRESSION_ACTION = "jsp:expression";
-
-+ /**
-+ * Internal name for the useBean action.
-+ */
- String USE_BEAN_ACTION = "useBean";
-+
-+ /**
-+ * JSP namespace name for the useBean action.
-+ */
- String JSP_USE_BEAN_ACTION = "jsp:useBean";
-
-+ /**
-+ * Internal name for the setProperty action.
-+ */
- String SET_PROPERTY_ACTION = "setProperty";
-+
-+ /**
-+ * JSP namespace name for the setProperty action.
-+ */
- String JSP_SET_PROPERTY_ACTION = "jsp:setProperty";
-
-+ /**
-+ * Internal name for the getProperty action.
-+ */
- String GET_PROPERTY_ACTION = "getProperty";
-+
-+ /**
-+ * JSP namespace name for the getProperty action.
-+ */
- String JSP_GET_PROPERTY_ACTION = "jsp:getProperty";
-
-+ /**
-+ * Internal name for the include action.
-+ */
- String INCLUDE_ACTION = "include";
-+
-+ /**
-+ * JSP namespace name for the include action.
-+ */
- String JSP_INCLUDE_ACTION = "jsp:include";
-
-+ /**
-+ * Internal name for the forward action.
-+ */
- String FORWARD_ACTION = "forward";
-+
-+ /**
-+ * JSP namespace name for the forward action.
-+ */
- String JSP_FORWARD_ACTION = "jsp:forward";
-
-+ /**
-+ * Internal name for the param action.
-+ */
- String PARAM_ACTION = "param";
-+
-+ /**
-+ * JSP namespace name for the param action.
-+ */
- String JSP_PARAM_ACTION = "jsp:param";
-
-+ /**
-+ * Internal name for the text action.
-+ */
- String TEXT_ACTION = "text";
-+
-+ /**
-+ * JSP namespace name for the text action.
-+ */
- String JSP_TEXT_ACTION = "jsp:text";
-+
-+ /**
-+ * Closing tag for the text action.
-+ */
- String JSP_TEXT_ACTION_END = "</jsp:text>";
-
-+ /**
-+ * Internal name for the attribute action.
-+ */
- String ATTRIBUTE_ACTION = "attribute";
-+
-+ /**
-+ * JSP namespace name for the attribute action.
-+ */
- String JSP_ATTRIBUTE_ACTION = "jsp:attribute";
-
-+ /**
-+ * Internal name for the body action.
-+ */
- String BODY_ACTION = "body";
-+
-+ /**
-+ * JSP namespace name for the body action.
-+ */
- String JSP_BODY_ACTION = "jsp:body";
-
-+ /**
-+ * Internal name for the element action.
-+ */
- String ELEMENT_ACTION = "element";
-+
-+ /**
-+ * JSP namespace name for the element action.
-+ */
- String JSP_ELEMENT_ACTION = "jsp:element";
-
-+ /**
-+ * Internal name for the output action.
-+ */
- String OUTPUT_ACTION = "output";
-+
-+ /**
-+ * JSP namespace name for the output action.
-+ */
- String JSP_OUTPUT_ACTION = "jsp:output";
-
-+ /**
-+ * Internal name for the taglib directive action.
-+ */
- String TAGLIB_DIRECTIVE_ACTION = "taglib";
-+
-+ /**
-+ * JSP namespace name for the taglib directive action.
-+ */
- String JSP_TAGLIB_DIRECTIVE_ACTION = "jsp:taglib";
-
-- /*
-- * Tag Files
-+ /**
-+ * Internal name for the invoke action.
- */
- String INVOKE_ACTION = "invoke";
-+
-+ /**
-+ * JSP namespace name for the invoke action.
-+ */
- String JSP_INVOKE_ACTION = "jsp:invoke";
-
-+ /**
-+ * Internal name for the doBody action.
-+ */
- String DOBODY_ACTION = "doBody";
-+
-+ /**
-+ * JSP namespace name for the doBody action.
-+ */
- String JSP_DOBODY_ACTION = "jsp:doBody";
-
-- /*
-- * Tag File Directives
-+ /**
-+ * Internal name for the tag directive action.
- */
- String TAG_DIRECTIVE_ACTION = "directive.tag";
-+
-+ /**
-+ * JSP namespace name for the tag directive action.
-+ */
- String JSP_TAG_DIRECTIVE_ACTION = "jsp:directive.tag";
-
-+ /**
-+ * Internal name for the attribute directive action.
-+ */
- String ATTRIBUTE_DIRECTIVE_ACTION = "directive.attribute";
-+
-+ /**
-+ * JSP namespace name for the attribute directive action.
-+ */
- String JSP_ATTRIBUTE_DIRECTIVE_ACTION = "jsp:directive.attribute";
-
-+ /**
-+ * Internal name for the variable directive action.
-+ */
- String VARIABLE_DIRECTIVE_ACTION = "directive.variable";
-+
-+ /**
-+ * JSP namespace name for the variable directive action.
-+ */
- String JSP_VARIABLE_DIRECTIVE_ACTION = "jsp:directive.variable";
-
-- /*
-- * Directive attributes
-+ /**
-+ * URI prefix for tag directory namespaces.
- */
- String URN_JSPTAGDIR = "urn:jsptagdir:";
-+
-+ /**
-+ * URI prefix for TLD namespaces.
-+ */
- String URN_JSPTLD = "urn:jsptld:";
- }
-diff --git a/java/org/apache/jasper/compiler/TagFileProcessor.java b/java/org/apache/jasper/compiler/TagFileProcessor.java
-index 80207e0467..ea50a5da0d 100644
---- a/java/org/apache/jasper/compiler/TagFileProcessor.java
-+++ b/java/org/apache/jasper/compiler/TagFileProcessor.java
-@@ -45,6 +45,12 @@ import org.apache.tomcat.util.descriptor.tld.TldResourcePath;
- */
- public class TagFileProcessor {
-
-+ /**
-+ * Constructs a new TagFileProcessor.
-+ */
-+ public TagFileProcessor() {
-+ }
-+
- private List<Compiler> tempVector;
-
- /**
-diff --git a/java/org/apache/jasper/compiler/TagPluginManager.java b/java/org/apache/jasper/compiler/TagPluginManager.java
-index 79a693aa41..ca75f4850a 100644
---- a/java/org/apache/jasper/compiler/TagPluginManager.java
-+++ b/java/org/apache/jasper/compiler/TagPluginManager.java
-@@ -42,10 +42,23 @@ public class TagPluginManager {
- private HashMap<String,TagPlugin> tagPlugins;
- private boolean initialized = false;
-
-+ /**
-+ * Creates a new TagPluginManager for the given servlet context.
-+ *
-+ * @param ctxt the servlet context
-+ */
- public TagPluginManager(ServletContext ctxt) {
- this.ctxt = ctxt;
- }
-
-+ /**
-+ * Applies tag plugin optimizations to the given page.
-+ *
-+ * @param page the page node tree
-+ * @param err the error dispatcher
-+ * @param pageInfo page information
-+ * @throws JasperException if an error occurs during optimization
-+ */
- public void apply(Node.Nodes page, ErrorDispatcher err, PageInfo pageInfo) throws JasperException {
-
- init(err);
-diff --git a/java/org/apache/jasper/compiler/TextOptimizer.java b/java/org/apache/jasper/compiler/TextOptimizer.java
-index 054f8d0ffc..389ffdbf2a 100644
---- a/java/org/apache/jasper/compiler/TextOptimizer.java
-+++ b/java/org/apache/jasper/compiler/TextOptimizer.java
-@@ -21,10 +21,16 @@ import org.apache.jasper.Options;
- import org.apache.jasper.TrimSpacesOption;
-
- /**
-- * Optimizes text in JSP pages.
-+ * Provides optimizations for text nodes in JSP pages.
- */
- public class TextOptimizer {
-
-+ /**
-+ * Constructs a new TextOptimizer. This utility class should not be instantiated.
-+ */
-+ public TextOptimizer() {
-+ }
-+
- /**
- * A visitor to concatenate contiguous template texts.
- */
-@@ -119,6 +125,14 @@ public class TextOptimizer {
-
- }
-
-+ /**
-+ * Concatenates contiguous text nodes in the given page to reduce the number of
-+ * write operations in the generated servlet code.
-+ *
-+ * @param compiler the JSP compiler
-+ * @param page the page node tree
-+ * @throws JasperException if an error occurs during optimization
-+ */
- public static void concatenate(Compiler compiler, Node.Nodes page) throws JasperException {
-
- TextCatVisitor v = new TextCatVisitor(compiler);
-diff --git a/java/org/apache/jasper/compiler/TldCache.java b/java/org/apache/jasper/compiler/TldCache.java
-index 818dcab299..1e1094d07c 100644
---- a/java/org/apache/jasper/compiler/TldCache.java
-+++ b/java/org/apache/jasper/compiler/TldCache.java
-@@ -40,14 +40,38 @@ import org.xml.sax.SAXException;
- */
- public class TldCache {
-
-+ /**
-+ * The ServletContext attribute name used to store the TldCache instance.
-+ */
- public static final String SERVLET_CONTEXT_ATTRIBUTE_NAME = TldCache.class.getName();
-
-+ /**
-+ * The servlet context associated with this cache.
-+ */
- private final ServletContext servletContext;
-+
-+ /**
-+ * Maps TLD URIs to their resource paths.
-+ */
- private final Map<String,TldResourcePath> uriTldResourcePathMap = new HashMap<>();
-+
-+ /**
-+ * Maps TLD resource paths to their cached tag library XML data.
-+ */
- private final Map<TldResourcePath,TaglibXmlCacheEntry> tldResourcePathTaglibXmlMap = new HashMap<>();
-+
-+ /**
-+ * The parser used to parse TLD files.
-+ */
- private final TldParser tldParser;
-
-
-+ /**
-+ * Returns the TldCache instance for the given servlet context.
-+ *
-+ * @param servletContext the servlet context
-+ * @return the TldCache instance
-+ */
- public static TldCache getInstance(ServletContext servletContext) {
- if (servletContext == null) {
- throw new IllegalArgumentException(
-@@ -57,6 +81,13 @@ public class TldCache {
- }
-
-
-+ /**
-+ * Creates a new TldCache.
-+ *
-+ * @param servletContext the servlet context
-+ * @param uriTldResourcePathMap the pre-scanned URI to resource path mappings
-+ * @param tldResourcePathTaglibXmlMap the pre-parsed TLD data
-+ */
- public TldCache(ServletContext servletContext, Map<String,TldResourcePath> uriTldResourcePathMap,
- Map<TldResourcePath,TaglibXml> tldResourcePathTaglibXmlMap) {
- this.servletContext = servletContext;
-@@ -81,11 +112,24 @@ public class TldCache {
- }
-
-
-+ /**
-+ * Returns the resource path for the given TLD URI.
-+ *
-+ * @param uri the TLD URI
-+ * @return the resource path, or null if not found
-+ */
- public TldResourcePath getTldResourcePath(String uri) {
- return uriTldResourcePathMap.get(uri);
- }
-
-
-+ /**
-+ * Returns the parsed tag library XML for the given resource path.
-+ *
-+ * @param tldResourcePath the TLD resource path
-+ * @return the parsed tag library XML, or null if not found
-+ * @throws JasperException if an error occurs during parsing
-+ */
- public TaglibXml getTaglibXml(TldResourcePath tldResourcePath) throws JasperException {
- TaglibXmlCacheEntry cacheEntry = tldResourcePathTaglibXmlMap.get(tldResourcePath);
- if (cacheEntry == null) {
-diff --git a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
-index 930130b01a..eff4786765 100644
---- a/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
-+++ b/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
-@@ -24,19 +24,24 @@ package org.apache.jasper.compiler.tagplugin;
-
- public interface TagPluginContext {
- /**
-- * @return true if the body of the tag is scriptless.
-+ * Checks whether the body of the current tag is scriptless.
-+ *
-+ * @return true if the body of the tag is scriptless
- */
- boolean isScriptless();
-
- /**
-- * @param attribute Name of the attribute
-+ * Checks whether the specified attribute is present in the current tag.
- *
-+ * @param attribute Name of the attribute
- * @return true if the attribute is specified in the tag
- */
- boolean isAttributeSpecified(String attribute);
-
- /**
-- * @return A unique temporary variable name that the plugin can use.
-+ * Generates a unique temporary variable name for use in generated code.
-+ *
-+ * @return A unique temporary variable name that the plugin can use
- */
- String getTemporaryVariableName();
-
-@@ -66,17 +71,19 @@ public interface TagPluginContext {
- void generateJavaSource(String s);
-
- /**
-- * @param attribute The attribute name
-+ * Checks whether the specified attribute has a translation-time constant value.
- *
-- * @return true if the attribute is specified and its value is a translation-time constant.
-+ * @param attribute The attribute name
-+ * @return true if the attribute is specified and its value is a translation-time constant
- */
- boolean isConstantAttribute(String attribute);
-
- /**
-- * @param attribute The attribute name
-+ * Returns the value of a constant attribute.
- *
-+ * @param attribute The attribute name
- * @return A string that is the value of a constant attribute. Undefined if the attribute is not a
-- * (translation-time) constant. null if the attribute is not specified.
-+ * (translation-time) constant. null if the attribute is not specified
- */
- String getConstantAttribute(String attribute);
-
-diff --git a/java/org/apache/jasper/optimizations/StringInterpreterEnum.java b/java/org/apache/jasper/optimizations/StringInterpreterEnum.java
-index b057cd499e..002b3ee284 100644
---- a/java/org/apache/jasper/optimizations/StringInterpreterEnum.java
-+++ b/java/org/apache/jasper/optimizations/StringInterpreterEnum.java
-@@ -26,6 +26,12 @@ import org.apache.juli.logging.LogFactory;
- */
- public class StringInterpreterEnum extends DefaultStringInterpreter {
-
-+ /**
-+ * Constructs a new StringInterpreterEnum.
-+ */
-+ public StringInterpreterEnum() {
-+ }
-+
- // Can't be static
- private final Log log = LogFactory.getLog(ELInterpreterTagSetters.class);
-
-diff --git a/java/org/apache/jasper/runtime/TagHandlerPool.java b/java/org/apache/jasper/runtime/TagHandlerPool.java
-index 00c2953a43..dcb6067bff 100644
---- a/java/org/apache/jasper/runtime/TagHandlerPool.java
-+++ b/java/org/apache/jasper/runtime/TagHandlerPool.java
-@@ -30,17 +30,48 @@ import org.apache.tomcat.InstanceManager;
- */
- public class TagHandlerPool {
-
-+ /**
-+ * The array of pooled tag handlers.
-+ */
- private Tag[] handlers;
-
-+ /**
-+ * Option name for the tag pool class name.
-+ */
- public static final String OPTION_TAGPOOL = "tagpoolClassName";
-+
-+ /**
-+ * Option name for the maximum pool size.
-+ */
- public static final String OPTION_MAXSIZE = "tagpoolMaxSize";
-+
-+ /**
-+ * Option name for using InstanceManager for tag creation.
-+ */
- public static final String OPTION_USEIMFORTAGS = "useInstanceManagerForTags";
-
- // index of next available tag handler
-+ /**
-+ * Index of the next available tag handler in the pool.
-+ */
- private int current;
-+
-+ /**
-+ * The instance manager used for tag handler creation.
-+ */
- protected InstanceManager instanceManager = null;
-+
-+ /**
-+ * Whether to use the instance manager for tag handler creation.
-+ */
- protected boolean useInstanceManagerForTags;
-
-+ /**
-+ * Creates or retrieves a TagHandlerPool for the given servlet configuration.
-+ *
-+ * @param config the servlet configuration
-+ * @return the tag handler pool instance
-+ */
- public static TagHandlerPool getTagHandlerPool(ServletConfig config) {
- TagHandlerPool result = null;
-
-@@ -61,6 +92,11 @@ public class TagHandlerPool {
- return result;
- }
-
-+ /**
-+ * Initializes this pool with settings from the given servlet configuration.
-+ *
-+ * @param config the servlet configuration
-+ */
- protected void init(ServletConfig config) {
- int maxSize = -1;
- String maxSizeS = getOption(config, OPTION_MAXSIZE, null);
-@@ -152,6 +188,15 @@ public class TagHandlerPool {
- }
-
-
-+ /**
-+ * Retrieves a configuration option from the given servlet config, falling back
-+ * to the servlet context init parameter, then to the default value.
-+ *
-+ * @param config the servlet configuration
-+ * @param name the option name
-+ * @param defaultV the default value if not found
-+ * @return the option value or the default
-+ */
- protected static String getOption(ServletConfig config, String name, String defaultV) {
- if (config == null) {
- return defaultV;
-diff --git a/java/org/apache/jasper/servlet/TldPreScanned.java b/java/org/apache/jasper/servlet/TldPreScanned.java
-index 5638862de9..d7dda9dfd9 100644
---- a/java/org/apache/jasper/servlet/TldPreScanned.java
-+++ b/java/org/apache/jasper/servlet/TldPreScanned.java
-@@ -25,10 +25,25 @@ import jakarta.servlet.ServletContext;
- import org.apache.jasper.compiler.Localizer;
- import org.apache.tomcat.util.descriptor.tld.TldResourcePath;
-
-+/**
-+ * TLD scanner that processes only pre-scanned TLD URLs, skipping JAR scanning.
-+ */
- public class TldPreScanned extends TldScanner {
-
-+ /**
-+ * The collection of pre-scanned TLD URLs.
-+ */
- private final Collection<URL> preScannedURLs;
-
-+ /**
-+ * Creates a new TldPreScanned scanner.
-+ *
-+ * @param context the servlet context
-+ * @param namespaceAware whether namespace processing is enabled
-+ * @param validation whether XML validation is enabled
-+ * @param blockExternal whether external entities should be blocked
-+ * @param preScannedTlds the collection of pre-scanned TLD URLs
-+ */
- public TldPreScanned(ServletContext context, boolean namespaceAware, boolean validation, boolean blockExternal,
- Collection<URL> preScannedTlds) {
- super(context, namespaceAware, validation, blockExternal);
-diff --git a/java/org/apache/jasper/servlet/TldScanner.java b/java/org/apache/jasper/servlet/TldScanner.java
-index 756b0bc00d..b4629758da 100644
---- a/java/org/apache/jasper/servlet/TldScanner.java
-+++ b/java/org/apache/jasper/servlet/TldScanner.java
-@@ -251,11 +251,25 @@ public class TldScanner {
- }
- }
-
-+ /**
-+ * Parses a TLD from the given resource path string.
-+ *
-+ * @param resourcePath the resource path
-+ * @throws IOException if an I/O error occurs
-+ * @throws SAXException if a parsing error occurs
-+ */
- protected void parseTld(String resourcePath) throws IOException, SAXException {
- TldResourcePath tldResourcePath = new TldResourcePath(context.getResource(resourcePath), resourcePath);
- parseTld(tldResourcePath);
- }
-
-+ /**
-+ * Parses a TLD from the given resource path.
-+ *
-+ * @param path the TLD resource path
-+ * @throws IOException if an I/O error occurs
-+ * @throws SAXException if a parsing error occurs
-+ */
- protected void parseTld(TldResourcePath path) throws IOException, SAXException {
- TaglibXml tld = tldParser.parse(path);
- String uri = tld.getUri();
-diff --git a/java/org/apache/jasper/tagplugins/jstl/Util.java b/java/org/apache/jasper/tagplugins/jstl/Util.java
-index 6185420291..77687bef46 100644
---- a/java/org/apache/jasper/tagplugins/jstl/Util.java
-+++ b/java/org/apache/jasper/tagplugins/jstl/Util.java
-@@ -42,8 +42,17 @@ import org.apache.jasper.compiler.Localizer;
-
- public class Util {
-
-+ /**
-+ * Constructs a new Util instance.
-+ */
-+ public Util() {
-+ }
-+
- private static final String VALID_SCHEME_CHAR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+.-";
-
-+ /**
-+ * The default character encoding used for URL operations.
-+ */
- public static final String DEFAULT_ENCODING = "ISO-8859-1";
-
- private static final int HIGHEST_SPECIAL = '>';
-@@ -172,6 +181,14 @@ public class Util {
- return Objects.requireNonNullElse(result, buffer);
- }
-
-+ /**
-+ * Escapes XML special characters in the given character array buffer.
-+ *
-+ * @param arrayBuffer The character array to escape
-+ * @param length The length of the buffer to process
-+ *
-+ * @return The escaped string, or {@code null} if no escaping was necessary
-+ */
- @SuppressWarnings("null") // escapedBuffer cannot be null
- public static String escapeXml(char[] arrayBuffer, int length) {
- int start = 0;
-@@ -280,6 +297,11 @@ public class Util {
- private int status = 200;
- private String charEncoding;
-
-+ /**
-+ * Constructs a new ImportResponseWrapper.
-+ *
-+ * @param arg0 The HttpServletResponse to wrap
-+ */
- public ImportResponseWrapper(HttpServletResponse arg0) {
- super(arg0);
- }
-@@ -322,14 +344,31 @@ public class Util {
- return status;
- }
-
-+ /**
-+ * Returns the character encoding of the response.
-+ *
-+ * @return the character encoding
-+ */
- public String getCharEncoding() {
- return this.charEncoding;
- }
-
-+ /**
-+ * Sets the character encoding of the response.
-+ *
-+ * @param ce The character encoding
-+ */
- public void setCharEncoding(String ce) {
- this.charEncoding = ce;
- }
-
-+ /**
-+ * Returns the response body as a string.
-+ *
-+ * @return the response body string
-+ *
-+ * @throws UnsupportedEncodingException If the character encoding is not supported
-+ */
- public String getString() throws UnsupportedEncodingException {
- if (isWriterUsed) {
- return sw.toString();
-diff --git a/java/org/apache/jasper/tagplugins/jstl/core/Url.java b/java/org/apache/jasper/tagplugins/jstl/core/Url.java
-index a771e969d4..83dec3392d 100644
---- a/java/org/apache/jasper/tagplugins/jstl/core/Url.java
-+++ b/java/org/apache/jasper/tagplugins/jstl/core/Url.java
-@@ -20,8 +20,17 @@ import org.apache.jasper.compiler.tagplugin.TagPlugin;
- import org.apache.jasper.compiler.tagplugin.TagPluginContext;
- import org.apache.jasper.tagplugins.jstl.Util;
-
-+/**
-+ * Tag plugin that optimizes JSTL <c:url> tag handling.
-+ */
- public class Url implements TagPlugin {
-
-+ /**
-+ * Constructs a new Url tag plugin.
-+ */
-+ public Url() {
-+ }
-+
- @Override
- public void doTag(TagPluginContext ctxt) {
-
-diff --git a/java/org/apache/jasper/tagplugins/jstl/core/When.java b/java/org/apache/jasper/tagplugins/jstl/core/When.java
-index 5bc75db74a..e8766fd609 100644
---- a/java/org/apache/jasper/tagplugins/jstl/core/When.java
-+++ b/java/org/apache/jasper/tagplugins/jstl/core/When.java
-@@ -19,8 +19,17 @@ package org.apache.jasper.tagplugins.jstl.core;
- import org.apache.jasper.compiler.tagplugin.TagPlugin;
- import org.apache.jasper.compiler.tagplugin.TagPluginContext;
-
-+/**
-+ * Tag plugin for the {@code <c:when>} JSTL tag.
-+ */
- public final class When implements TagPlugin {
-
-+ /**
-+ * Constructs a new When tag plugin.
-+ */
-+ public When() {
-+ }
-+
- @Override
- public void doTag(TagPluginContext ctxt) {
- // Get the parent context to determine if this is the first <c:when>
-diff --git a/java/org/apache/jasper/util/UniqueAttributesImpl.java b/java/org/apache/jasper/util/UniqueAttributesImpl.java
-index 49d1a2dc12..b7ba09e5c4 100644
---- a/java/org/apache/jasper/util/UniqueAttributesImpl.java
-+++ b/java/org/apache/jasper/util/UniqueAttributesImpl.java
-@@ -35,10 +35,18 @@ public class UniqueAttributesImpl extends AttributesImpl {
- private final boolean pageDirective;
- private final Set<String> qNames = new HashSet<>();
-
-+ /**
-+ * Constructs a new UniqueAttributesImpl for non-page directives.
-+ */
- public UniqueAttributesImpl() {
- this.pageDirective = false;
- }
-
-+ /**
-+ * Constructs a new UniqueAttributesImpl.
-+ *
-+ * @param pageDirective true if processing a page directive
-+ */
- public UniqueAttributesImpl(boolean pageDirective) {
- this.pageDirective = pageDirective;
- }
-diff --git a/java/org/apache/juli/VerbatimFormatter.java b/java/org/apache/juli/VerbatimFormatter.java
-index 2653b180cf..77739d2b11 100644
---- a/java/org/apache/juli/VerbatimFormatter.java
-+++ b/java/org/apache/juli/VerbatimFormatter.java
-@@ -26,6 +26,12 @@ import java.util.logging.LogRecord;
- */
- public class VerbatimFormatter extends Formatter {
-
-+ /**
-+ * Constructs a new VerbatimFormatter.
-+ */
-+ public VerbatimFormatter() {
-+ }
-+
- @Override
- public String format(LogRecord record) {
- // Timestamp + New line for next record
-diff --git a/java/org/apache/naming/StringManager.java b/java/org/apache/naming/StringManager.java
-index 1f425104df..b9c7293335 100644
---- a/java/org/apache/naming/StringManager.java
-+++ b/java/org/apache/naming/StringManager.java
-@@ -160,6 +160,12 @@ public class StringManager {
- }
-
-
-+ /**
-+ * Returns the StringManager for the package of the given class.
-+ *
-+ * @param clazz the class whose package's StringManager is requested
-+ * @return the StringManager for the specified class's package
-+ */
- public static StringManager getManager(Class<?> clazz) {
- return getManager(clazz.getPackage().getName());
- }
-diff --git a/java/org/apache/naming/factory/TransactionFactory.java b/java/org/apache/naming/factory/TransactionFactory.java
-index bb7ebc817b..bf35729f95 100644
---- a/java/org/apache/naming/factory/TransactionFactory.java
-+++ b/java/org/apache/naming/factory/TransactionFactory.java
-@@ -26,6 +26,12 @@ import org.apache.naming.TransactionRef;
- */
- public class TransactionFactory extends FactoryBase {
-
-+ /**
-+ * Constructs a new TransactionFactory.
-+ */
-+ public TransactionFactory() {
-+ }
-+
- @Override
- protected boolean isReferenceTypeSupported(Object obj) {
- return obj instanceof TransactionRef;
-diff --git a/java/org/apache/tomcat/buildutil/Txt2Html.java b/java/org/apache/tomcat/buildutil/Txt2Html.java
-index 13a8e5d8d6..d44335eae2 100644
---- a/java/org/apache/tomcat/buildutil/Txt2Html.java
-+++ b/java/org/apache/tomcat/buildutil/Txt2Html.java
-@@ -42,6 +42,12 @@ import org.apache.tools.ant.types.FileSet;
- */
- public class Txt2Html extends Task {
-
-+ /**
-+ * Constructs a new Txt2Html task.
-+ */
-+ public Txt2Html() {
-+ }
-+
- /** The directory to contain the resulting files */
- private File todir;
-
-diff --git a/java/org/apache/tomcat/buildutil/Utils.java b/java/org/apache/tomcat/buildutil/Utils.java
-index 357a87cadb..ba47745612 100644
---- a/java/org/apache/tomcat/buildutil/Utils.java
-+++ b/java/org/apache/tomcat/buildutil/Utils.java
-@@ -19,6 +19,9 @@ package org.apache.tomcat.buildutil;
- import java.io.IOException;
- import java.io.Writer;
-
-+/**
-+ * Utility class for build operations.
-+ */
- public class Utils {
-
- private Utils() {
-@@ -26,6 +29,13 @@ public class Utils {
- }
-
-
-+ /**
-+ * Writes the Apache License header to the given writer.
-+ *
-+ * @param w The writer to write the license to
-+ *
-+ * @throws IOException If an I/O error occurs
-+ */
- public static void insertLicense(Writer w) throws IOException {
- w.write("# Licensed to the Apache Software Foundation (ASF) under one or more");
- w.write(System.lineSeparator());
-diff --git a/java/org/apache/tomcat/buildutil/translate/Utils.java b/java/org/apache/tomcat/buildutil/translate/Utils.java
-index c93b956934..97716b4c2c 100644
---- a/java/org/apache/tomcat/buildutil/translate/Utils.java
-+++ b/java/org/apache/tomcat/buildutil/translate/Utils.java
-@@ -32,6 +32,9 @@ import java.util.Properties;
- import java.util.Set;
- import java.util.regex.Pattern;
-
-+/**
-+ * Utility class for translation operations.
-+ */
- public class Utils {
-
- private static final Pattern ESCAPE_LEADING_SPACE = Pattern.compile("^( )", Pattern.MULTILINE);
-diff --git a/java/org/apache/tomcat/util/buf/StringCache.java b/java/org/apache/tomcat/util/buf/StringCache.java
-index ff6d4c6c84..423de39eef 100644
---- a/java/org/apache/tomcat/util/buf/StringCache.java
-+++ b/java/org/apache/tomcat/util/buf/StringCache.java
-@@ -34,6 +34,11 @@ import org.apache.tomcat.util.res.StringManager;
- */
- public class StringCache {
-
-+ /**
-+ * Constructs a new StringCache with default settings.
-+ */
-+ public StringCache() {
-+ }
-
- private static final Log log = LogFactory.getLog(StringCache.class);
- private static final StringManager sm = StringManager.getManager(StringCache.class);
-@@ -48,16 +53,28 @@ public class StringCache {
- protected static boolean byteEnabled = Boolean.getBoolean("tomcat.util.buf.StringCache.byte.enabled");
-
-
-+ /**
-+ * Whether the char chunk string cache is enabled.
-+ */
- protected static boolean charEnabled = Boolean.getBoolean("tomcat.util.buf.StringCache.char.enabled");
-
-
-+ /**
-+ * Number of toString calls required before the cache is built.
-+ */
- protected static int trainThreshold =
- Integer.getInteger("tomcat.util.buf.StringCache.trainThreshold", 20000).intValue();
-
-
-+ /**
-+ * Maximum size of the string cache.
-+ */
- protected static int cacheSize = Integer.getInteger("tomcat.util.buf.StringCache.cacheSize", 200).intValue();
-
-
-+ /**
-+ * Maximum length of strings to cache.
-+ */
- protected static final int maxStringSize =
- Integer.getInteger("tomcat.util.buf.StringCache.maxStringSize", 128).intValue();
-
-@@ -114,7 +131,9 @@ public class StringCache {
-
-
- /**
-- * @return Returns the cacheSize.
-+ * Returns the maximum size of the string cache.
-+ *
-+ * @return the cache size
- */
- public int getCacheSize() {
- return cacheSize;
-@@ -122,7 +141,9 @@ public class StringCache {
-
-
- /**
-- * @param cacheSize The cacheSize to set.
-+ * Sets the maximum size of the string cache.
-+ *
-+ * @param cacheSize the cache size
- */
- public void setCacheSize(int cacheSize) {
- StringCache.cacheSize = cacheSize;
-@@ -130,7 +151,9 @@ public class StringCache {
-
-
- /**
-- * @return Returns the enabled.
-+ * Returns whether the byte chunk string cache is enabled.
-+ *
-+ * @return true if byte chunk caching is enabled
- */
- public boolean getByteEnabled() {
- return byteEnabled;
-@@ -138,7 +161,9 @@ public class StringCache {
-
-
- /**
-- * @param byteEnabled The enabled to set.
-+ * Sets whether the byte chunk string cache is enabled.
-+ *
-+ * @param byteEnabled true if byte chunk caching should be enabled
- */
- public void setByteEnabled(boolean byteEnabled) {
- StringCache.byteEnabled = byteEnabled;
-@@ -146,7 +171,9 @@ public class StringCache {
-
-
- /**
-- * @return Returns the enabled.
-+ * Returns whether the char chunk string cache is enabled.
-+ *
-+ * @return true if char chunk caching is enabled
- */
- public boolean getCharEnabled() {
- return charEnabled;
-@@ -154,7 +181,9 @@ public class StringCache {
-
-
- /**
-- * @param charEnabled The enabled to set.
-+ * Sets whether the char chunk string cache is enabled.
-+ *
-+ * @param charEnabled true if char chunk caching should be enabled
- */
- public void setCharEnabled(boolean charEnabled) {
- StringCache.charEnabled = charEnabled;
-@@ -162,7 +191,9 @@ public class StringCache {
-
-
- /**
-- * @return Returns the trainThreshold.
-+ * Returns the number of toString calls required before the cache is built.
-+ *
-+ * @return the training threshold
- */
- public int getTrainThreshold() {
- return trainThreshold;
-@@ -170,7 +201,9 @@ public class StringCache {
-
-
- /**
-- * @param trainThreshold The trainThreshold to set.
-+ * Sets the number of toString calls required before the cache is built.
-+ *
-+ * @param trainThreshold the training threshold
- */
- public void setTrainThreshold(int trainThreshold) {
- StringCache.trainThreshold = trainThreshold;
-@@ -178,7 +211,9 @@ public class StringCache {
-
-
- /**
-- * @return Returns the accessCount.
-+ * Returns the total number of cache lookups performed.
-+ *
-+ * @return the access count
- */
- public int getAccessCount() {
- return accessCount;
-@@ -186,7 +221,9 @@ public class StringCache {
-
-
- /**
-- * @return Returns the hitCount.
-+ * Returns the number of cache hits.
-+ *
-+ * @return the hit count
- */
- public int getHitCount() {
- return hitCount;
-@@ -196,6 +233,9 @@ public class StringCache {
- // -------------------------------------------------- Public Static Methods
-
-
-+ /**
-+ * Resets all cache statistics and clears the cache.
-+ */
- public void reset() {
- hitCount = 0;
- accessCount = 0;
-@@ -210,6 +250,12 @@ public class StringCache {
- }
-
-
-+ /**
-+ * Converts the given ByteChunk to a String using the cache.
-+ *
-+ * @param bc the ByteChunk to convert
-+ * @return the resulting String
-+ */
- public static String toString(ByteChunk bc) {
- try {
- return toString(bc, CodingErrorAction.REPLACE, CodingErrorAction.REPLACE);
-@@ -220,6 +266,16 @@ public class StringCache {
- }
-
-
-+ /**
-+ * Converts the given ByteChunk to a String using the cache, with the specified
-+ * error handling actions.
-+ *
-+ * @param bc the ByteChunk to convert
-+ * @param malformedInputAction action for malformed input
-+ * @param unmappableCharacterAction action for unmappable characters
-+ * @return the resulting String
-+ * @throws CharacterCodingException if a coding error occurs
-+ */
- public static String toString(ByteChunk bc, CodingErrorAction malformedInputAction,
- CodingErrorAction unmappableCharacterAction) throws CharacterCodingException {
-
-@@ -328,6 +384,12 @@ public class StringCache {
- }
-
-
-+ /**
-+ * Converts the given CharChunk to a String using the cache.
-+ *
-+ * @param cc the CharChunk to convert
-+ * @return the resulting String
-+ */
- public static String toString(CharChunk cc) {
-
- // If the cache is null, then either caching is disabled, or we're
-@@ -652,8 +714,17 @@ public class StringCache {
-
- // -------------------------------------------------- ByteEntry Inner Class
-
-+ /**
-+ * Cache entry for byte chunk to String mapping.
-+ */
- protected static class ByteEntry {
-
-+ /**
-+ * Constructs a new ByteEntry.
-+ */
-+ public ByteEntry() {
-+ }
-+
- private byte[] name = null;
- private Charset charset = null;
- private CodingErrorAction malformedInputAction = null;
-@@ -692,8 +763,17 @@ public class StringCache {
- // -------------------------------------------------- CharEntry Inner Class
... 5883 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org