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

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

commit cd82fdc68525e58667188ae3534e69b202d30c35
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 7c619a3508..e85708051f 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -1062,7 +1062,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 bf7b5bb3e1..06b4da7825 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]

Reply via email to