(tomcat) branch main updated: Review c71512e2 - Align Javadoc. Make other setters consistent.

[email protected] Mon, 03 Aug 2026 08:04:04 +0000
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <178574424416.1085609.2500890966927744354@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

markt-asf 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 5b5a3d2add Review c71512e2 - Align Javadoc. Make other setters consistent.
5b5a3d2add is described below

commit 5b5a3d2add2c2a2512cde359ad816d1d0979fd41
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Aug 3 09:03:39 2026 +0100

    Review c71512e2 - Align Javadoc. Make other setters consistent.
---
 .../apache/coyote/http11/upgrade/UpgradeGroupInfo.java  | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java b/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java
index 03999b9eda..1cec52aa64 100644
--- a/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java
+++ b/java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java
@@ -103,7 +103,7 @@ public class UpgradeGroupInfo extends BaseModelMBean {
      * Resets the bytes received counter.
      *
      * @param bytesReceived the value to restore (0 to reset completely,
-     *        non-zero values are added to the dead counter)
+     *        positive values are added to the bytes received counter)
      */
     public void setBytesReceived(long bytesReceived) {
         deadBytesReceived.reset();
@@ -132,11 +132,12 @@ public class UpgradeGroupInfo extends BaseModelMBean {
     /**
      * Resets the bytes sent counter.
      *
-     * @param bytesSent the new value (ignored, used for MBean reset)
+     * @param bytesSent the value to restore (0 to reset completely,
+     *        positive values are added to the bytes sent counter)
      */
     public void setBytesSent(long bytesSent) {
         deadBytesSent.reset();
-        if (bytesSent != 0) {
+        if (bytesSent > 0) {
             deadBytesSent.add(bytesSent);
         }
         for (UpgradeInfo ui : upgradeInfos) {
@@ -161,11 +162,12 @@ public class UpgradeGroupInfo extends BaseModelMBean {
     /**
      * Resets the messages received counter.
      *
-     * @param msgsReceived the new value (ignored, used for MBean reset)
+     * @param msgsReceived the value to restore (0 to reset completely,
+     *        positive values are added to the messages received counter)
      */
     public void setMsgsReceived(long msgsReceived) {
         deadMsgsReceived.reset();
-        if (msgsReceived != 0) {
+        if (msgsReceived > 0) {
             deadMsgsReceived.add(msgsReceived);
         }
         for (UpgradeInfo ui : upgradeInfos) {
@@ -190,11 +192,12 @@ public class UpgradeGroupInfo extends BaseModelMBean {
     /**
      * Resets the messages sent counter.
      *
-     * @param msgsSent the new value (ignored, used for MBean reset)
+     * @param msgsSent the value to restore (0 to reset completely,
+     *        positive values are added to the message sent counter)
      */
     public void setMsgsSent(long msgsSent) {
         deadMsgsSent.reset();
-        if (msgsSent != 0) {
+        if (msgsSent > 0) {
             deadMsgsSent.add(msgsSent);
         }
         for (UpgradeInfo ui : upgradeInfos) {