File tree Expand file tree Collapse file tree
java/org/apache/xml/serializer
resources/org/apache/xml/serializer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636/**
3737 * Provides information about encodings. Depends on the Java runtime
3838 * to provides writers for the different encodings.
39+ *
40+ * NOTE: When a Java or MIME names appears more than once in the
41+ * encodings.properties table, priority is given to the first instance
42+ * seen. For example, MIME name ISO-8859-1 will be mapped to Java name
43+ * ISO8859-1, even though the file includes synonyms such as ISO8859_1
44+ * and 8859-1.
3945 * <p>
4046 * This class is not a public API. It is only public because it
4147 * is used outside of this package.
@@ -369,9 +375,9 @@ private static EncodingInfo[] loadEncodingInfo()
369375 mimeName = st .nextToken ();
370376 EncodingInfo ei = new EncodingInfo (mimeName , javaName , highChar );
371377 encodingInfo_list .add (ei );
372- _encodingTableKeyMime .put (mimeName .toUpperCase (), ei );
378+ _encodingTableKeyMime .putIfAbsent (mimeName .toUpperCase (), ei );
373379 if (first )
374- _encodingTableKeyJava .put (javaName .toUpperCase (), ei );
380+ _encodingTableKeyJava .putIfAbsent (javaName .toUpperCase (), ei );
375381 }
376382 }
377383 }
Original file line number Diff line number Diff line change 3737# Higher values above this char might be in the encoding, although in the
3838# case of this particular encoding there are no higher chars.
3939#
40+ # NOTE: When a Java or MIME names appears more than once in this
41+ # table, priority is given to the first instance seen. For example,
42+ # MIME name ISO-8859-1 will be mapped to Java name ISO8859-1.
4043#
4144# <JAVA name encoding>, <PREFERRED name MIME>
4245#
You can’t perform that action at this time.
0 commit comments