This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 195de0f474 Deprecate unnecessary constructor
195de0f474 is described below
commit 195de0f474b4e5135b816e76f264611d69491774
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jun 2 21:57:05 2026 +0100
Deprecate unnecessary constructor
---
java/org/apache/catalina/connector/CoyoteAdapter.java | 2 +-
java/org/apache/tomcat/util/buf/B2CConverter.java | 3 +++
test/org/apache/tomcat/util/buf/TestB2CConverter.java | 2 ++
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 90b80dee5e..b36eed5a31 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -1059,7 +1059,7 @@ public class CoyoteAdapter implements Adapter {
B2CConverter conv = request.getURIConverter();
if (conv == null) {
- conv = new B2CConverter(charset, false);
+ conv = new B2CConverter(charset);
request.setURIConverter(conv);
} else {
conv.recycle();
diff --git a/java/org/apache/tomcat/util/buf/B2CConverter.java
b/java/org/apache/tomcat/util/buf/B2CConverter.java
index ce3c761bef..1eae1e900b 100644
--- a/java/org/apache/tomcat/util/buf/B2CConverter.java
+++ b/java/org/apache/tomcat/util/buf/B2CConverter.java
@@ -94,7 +94,10 @@ public class B2CConverter {
*
* @param charset the charset to use for decoding
* @param replaceOnError if {@code true}, replace malformed/unmappable
input; otherwise report errors
+ *
+ * @deprecated Unused. Will be removed in Tomcat 12 onwards. Use {@link
B2CConverter#B2CConverter(Charset)}
*/
+ @Deprecated
public B2CConverter(Charset charset, boolean replaceOnError) {
byte[] left = new byte[LEFTOVER_SIZE];
leftovers = ByteBuffer.wrap(left);
diff --git a/test/org/apache/tomcat/util/buf/TestB2CConverter.java
b/test/org/apache/tomcat/util/buf/TestB2CConverter.java
index a5e83fcfa6..da65b65cdb 100644
--- a/test/org/apache/tomcat/util/buf/TestB2CConverter.java
+++ b/test/org/apache/tomcat/util/buf/TestB2CConverter.java
@@ -245,6 +245,7 @@ public class TestB2CConverter {
@Test
public void testLeftoverChunkMalformed() throws Exception {
+ @SuppressWarnings("deprecation")
B2CConverter conv = new B2CConverter(StandardCharsets.UTF_8, true);
ByteChunk bc = new ByteChunk();
CharChunk cc = new CharChunk();
@@ -263,6 +264,7 @@ public class TestB2CConverter {
@Test
public void testLeftoverChunkMalformedAtEnd() throws Exception {
+ @SuppressWarnings("deprecation")
B2CConverter conv = new B2CConverter(StandardCharsets.UTF_8, true);
ByteChunk bc = new ByteChunk();
CharChunk cc = new CharChunk();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]