Author: markt Date: Mon Jun 19 19:48:29 2017 New Revision: 1799267 URL: http://svn.apache.org/viewvc?rev=1799267&view=rev Log: Refactor to reduce the need to deprecate code in 8.5.x
Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java tomcat/trunk/java/org/apache/coyote/Response.java Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=1799267&r1=1799266&r2=1799267&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Mon Jun 19 19:48:29 2017 @@ -552,7 +552,7 @@ public class Response implements HttpSer */ @Override public String getCharacterEncoding() { - String charset = getCoyoteResponse().getCharsetName(); + String charset = getCoyoteResponse().getCharacterEncoding(); if (charset != null) { return charset; } Modified: tomcat/trunk/java/org/apache/coyote/Response.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Response.java?rev=1799267&r1=1799266&r2=1799267&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/Response.java (original) +++ tomcat/trunk/java/org/apache/coyote/Response.java Mon Jun 19 19:48:29 2017 @@ -115,7 +115,7 @@ public final class Response { // Retain the original name used to set the charset so exactly that name is // used in the ContentType header. Some (arguably non-specification // compliant) user agents are very particular - String charsetName = null; + String characterEncoding = null; long contentLength = -1; private Locale locale = DEFAULT_LOCALE; @@ -419,21 +419,21 @@ public final class Response { * Overrides the character encoding used in the body of the response. This * method must be called prior to writing output using getWriter(). * - * @param charsetName The name of character encoding. + * @param characterEncoding The name of character encoding. * * @throws UnsupportedEncodingException If the specified name is not * recognised */ - public void setCharset(String charsetName) throws UnsupportedEncodingException { + public void setCharset(String characterEncoding) throws UnsupportedEncodingException { if (isCommitted()) { return; } - if (charsetName == null) { + if (characterEncoding == null) { return; } - this.charset = B2CConverter.getCharset(charsetName); - this.charsetName = charsetName; + this.charset = B2CConverter.getCharset(characterEncoding); + this.characterEncoding = characterEncoding; } @@ -442,8 +442,8 @@ public final class Response { } - public String getCharsetName() { - return charsetName; + public String getCharacterEncoding() { + return characterEncoding; } @@ -502,7 +502,7 @@ public final class Response { if (ret != null && charset != null) { - ret = ret + ";charset=" + charsetName; + ret = ret + ";charset=" + characterEncoding; } return ret; @@ -547,7 +547,7 @@ public final class Response { contentLanguage = null; locale = DEFAULT_LOCALE; charset = null; - charsetName = null; + characterEncoding = null; contentLength = -1; status = 200; message = null; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org