Skip to content

Commit 2d2a4d2

Browse files
committed
Javadoc
1 parent bbff10d commit 2d2a4d2

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ public Builder setLenient(final boolean lenient) {
210210
private static final Pattern CHARSET_PATTERN = Pattern.compile("charset=[\"']?([.[^; \"']]*)[\"']?");
211211

212212
/**
213-
* Pattern capturing the encoding of the "xml" processing instruction.
213+
* Pattern capturing the encoding of the <a href="https://www.w3.org/TR/REC-xml/#sec-pi">{@code 'xml'} processing instruction</a>.
214214
* <p>
215-
* See also the <a href="https://www.w3.org/TR/2008/REC-xml-20081126/#NT-EncName">XML specification</a>.
215+
* See also the <a href="https://www.w3.org/TR/2008/REC-xml-20081126/#NT-EncName">NT-EncName</a> XML specification.
216216
* </p>
217217
* <p>
218218
* Note the documented pattern is:
@@ -221,8 +221,8 @@ public Builder setLenient(final boolean lenient) {
221221
* EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
222222
* </pre>
223223
* <p>
224-
* However this does not match all the aliases that are supported by Java.
225-
* For example, '437', 'ISO_8859-1:1987' and 'ebcdic-de-273+euro'.
224+
* However this does not match all the aliases that are supported by Java. For example, {@code '437'}, {@code 'ISO_8859-1:1987'} and
225+
* {@code 'ebcdic-de-273+euro'}.
226226
* </p>
227227
*/
228228
public static final Pattern ENCODING_PATTERN = Pattern.compile(
@@ -285,11 +285,7 @@ static String getContentTypeMime(final String httpContentType) {
285285
String mime = null;
286286
if (httpContentType != null) {
287287
final int i = httpContentType.indexOf(";");
288-
if (i >= 0) {
289-
mime = httpContentType.substring(0, i);
290-
} else {
291-
mime = httpContentType;
292-
}
288+
mime = i >= 0 ? httpContentType.substring(0, i) : httpContentType;
293289
mime = mime.trim();
294290
}
295291
return mime;

0 commit comments

Comments
 (0)