@@ -465,12 +465,10 @@ private void doHttpStream(InputStream is, String httpContentType,
465465 boolean lenient ) throws IOException {
466466 BOMInputStream bom = new BOMInputStream (new BufferedInputStream (is , BUFFER_SIZE ), false , BOMS );
467467 BOMInputStream pis = new BOMInputStream (bom , true , XML_GUESS_BYTES );
468- String cTMime = getContentTypeMime (httpContentType );
469- String cTEnc = getContentTypeEncoding (httpContentType );
470468 String bomEnc = bom .getBOMCharsetName ();
471469 String xmlGuessEnc = pis .getBOMCharsetName ();
472470 String xmlEnc = getXmlProlog (pis , xmlGuessEnc );
473- this .encoding = calculateHttpEncoding (cTMime , cTEnc , bomEnc ,
471+ this .encoding = calculateHttpEncoding (httpContentType , bomEnc ,
474472 xmlGuessEnc , xmlEnc , lenient );
475473 this .reader = new InputStreamReader (is , encoding );
476474 }
@@ -529,8 +527,7 @@ private String calculateRawEncoding(String bomEnc, String xmlGuessEnc,
529527 /**
530528 * Calculate the HTTP encoding.
531529 *
532- * @param cTMime Mime Content Type
533- * @param cTEnc the content type encoding
530+ * @param httpContentType The HTTP content type
534531 * @param bomEnc BOM encoding
535532 * @param xmlGuessEnc XML Guess encoding
536533 * @param xmlEnc XML encoding
@@ -539,9 +536,11 @@ private String calculateRawEncoding(String bomEnc, String xmlGuessEnc,
539536 * @return the HTTP encoding
540537 * @throws IOException thrown if there is a problem reading the stream.
541538 */
542- private String calculateHttpEncoding (String cTMime , String cTEnc ,
539+ private String calculateHttpEncoding (String httpContentType ,
543540 String bomEnc , String xmlGuessEnc , String xmlEnc ,
544541 boolean lenient ) throws IOException {
542+ String cTMime = getContentTypeMime (httpContentType );
543+ String cTEnc = getContentTypeEncoding (httpContentType );
545544 String encoding ;
546545 if (lenient & xmlEnc != null ) {
547546 encoding = xmlEnc ;
0 commit comments