You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/06/08 12:58:35 UTC

[tomcat] branch 8.5.x updated: Fix BZ 66627 - restore documented behaviour of MessageBytes.getType()

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 4aed0be935 Fix BZ 66627 - restore documented behaviour of MessageBytes.getType()
4aed0be935 is described below

commit 4aed0be935e475c25852aaa8f858605b5ec96ceb
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jun 8 13:58:09 2023 +0100

    Fix BZ 66627 - restore documented behaviour of MessageBytes.getType()
---
 java/org/apache/tomcat/util/buf/MessageBytes.java |  4 ----
 webapps/docs/changelog.xml                        | 10 ++++++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/MessageBytes.java b/java/org/apache/tomcat/util/buf/MessageBytes.java
index 76ebee4c1b..df0a0dea1f 100644
--- a/java/org/apache/tomcat/util/buf/MessageBytes.java
+++ b/java/org/apache/tomcat/util/buf/MessageBytes.java
@@ -170,11 +170,9 @@ public final class MessageBytes implements Cloneable, Serializable {
                 // No conversion required
                 break;
             case T_BYTES:
-                type = T_STR;
                 strValue = byteC.toString();
                 break;
             case T_CHARS:
-                type = T_STR;
                 strValue = charC.toString();
                 break;
         }
@@ -272,7 +270,6 @@ public final class MessageBytes implements Cloneable, Serializable {
         }
 
         byteC.setBytes(bb.array(), bb.arrayOffset(), bb.limit());
-        type = T_BYTES;
     }
 
 
@@ -316,7 +313,6 @@ public final class MessageBytes implements Cloneable, Serializable {
                 toString();
                 //$FALL-THROUGH$
             case T_STR: {
-                type = T_CHARS;
                 char cc[] = strValue.toCharArray();
                 charC.setChars(cc, 0, cc.length);
             }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0dbe05d39c..ce1d7a9719 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,16 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        <bug>66627</bug>: Restore the documented behaviour of
+        <code>MessageBytes.getType()</code> that it returns the type of the
+        original content rather than reflecting the most recent conversion.
+        (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="WebSocket">
     <changelog>
       <fix>


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