Summary: | Request setCharacterEncoding has unused code | ||
---|---|---|---|
Product: | Tomcat 8 | Reporter: | Anthony Whitford <anthony> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | trivial | ||
Priority: | P2 | ||
Version: | 8.0.x-trunk | ||
Target Milestone: | ---- | ||
Hardware: | Macintosh | ||
OS: | Mac OS X 10.1 | ||
Attachments: | This patch removes the unused buffer. |
Hi, Thanks for the report and the patch. The fix is available in trunk, 8.0.x (for 8.0.29 onwards) and 7.0.x (for 7.0.66 onwards) Regards, Violeta (In reply to Anthony Whitford from comment #0) > The 'buffer' variable is unused and can be removed. (I suspect it is a > remnant of some past code.) Thanks for noting. As a historic reference: the code that used those variables was removed in r1140463 in a followup to r1138019 (bug 51400). |
Created attachment 33212 [details] This patch removes the unused buffer. The 'buffer' variable is unused and can be removed. (I suspect it is a remnant of some past code.) @Override public void setCharacterEncoding(String enc) throws UnsupportedEncodingException { if (usingReader) { return; } // Ensure that the specified encoding is valid byte buffer[] = new byte[1]; buffer[0] = (byte) 'a'; // Confirm that the encoding name is valid B2CConverter.getCharset(enc); // Save the validated encoding coyoteRequest.setCharacterEncoding(enc); }