Skip to content

Commit

Permalink
Fix BZ 66627 - restore documented behaviour of MessageBytes.getType()
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Jun 8, 2023
1 parent 414be86 commit 897931b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions java/org/apache/tomcat/util/buf/MessageBytes.java
Expand Up @@ -169,11 +169,9 @@ public String toString() {
// No conversion required
break;
case T_BYTES:
type = T_STR;
strValue = byteC.toString();
break;
case T_CHARS:
type = T_STR;
strValue = charC.toString();
break;
}
Expand Down Expand Up @@ -272,7 +270,6 @@ public void toBytes() {
}

byteC.setBytes(bb.array(), bb.arrayOffset(), bb.limit());
type = T_BYTES;
}


Expand All @@ -294,7 +291,6 @@ public void toChars() {
toString();
//$FALL-THROUGH$
case T_STR: {
type = T_CHARS;
char cc[] = strValue.toCharArray();
charC.setChars(cc, 0, cc.length);
}
Expand Down
10 changes: 10 additions & 0 deletions webapps/docs/changelog.xml
Expand Up @@ -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>
Expand Down

0 comments on commit 897931b

Please sign in to comment.