Skip to content

Commit ec9c918

Browse files
author
Niall Pemberton
committed
Minor formatting changes
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1004878 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4b7b166 commit ec9c918

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/main/java/org/apache/commons/io/input/XmlStreamReader.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,14 @@ public XmlStreamReader(InputStream is, String httpContentType,
367367
*/
368368
private String doLenientDetection(String httpContentType, InputStream is,
369369
XmlStreamReaderException ex) throws IOException {
370-
if (httpContentType != null) {
371-
if (httpContentType.startsWith("text/html")) {
372-
httpContentType = httpContentType.substring("text/html"
373-
.length());
374-
httpContentType = "text/xml" + httpContentType;
375-
try {
376-
return calculateHttpEncoding(httpContentType, ex.getBomEncoding(),
377-
ex.getXmlGuessEncoding(), ex.getXmlEncoding(), true);
378-
} catch (XmlStreamReaderException ex2) {
379-
ex = ex2;
380-
}
370+
if (httpContentType != null && httpContentType.startsWith("text/html")) {
371+
httpContentType = httpContentType.substring("text/html".length());
372+
httpContentType = "text/xml" + httpContentType;
373+
try {
374+
return calculateHttpEncoding(httpContentType, ex.getBomEncoding(),
375+
ex.getXmlGuessEncoding(), ex.getXmlEncoding(), true);
376+
} catch (XmlStreamReaderException ex2) {
377+
ex = ex2;
381378
}
382379
}
383380
String encoding = ex.getXmlEncoding();

0 commit comments

Comments
 (0)