-
Bug
-
Resolution: Fixed
-
P4
-
8u31
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084006 | emb-9 | Ivan Gerasimov | P4 | Resolved | Fixed | team |
The API documentation for CharsetEncoder.replaceWith() gives the following
information for the "newReplacement" parameter:
newReplacement - The new replacement; must not be null, must have
non-zero length, must not be longer than the value returned by the
maxBytesPerChar method, and must be legal
http://docs.oracle.com/javase/7/docs/api/java/nio/charset/CharsetEncoder.html#replaceWith(byte[])
The equivalent section of documentation for CharsetDecoder.replaceWith()
looks like this:
newReplacement - The new replacement; must not be null and must have
non-zero length
http://docs.oracle.com/javase/7/docs/api/java/nio/charset/CharsetDecoder.html#replaceWith(java.lang.String)
Note that the part about the maximum length of the parameter is missing.
The implementation reveals that the length of newReplacement is checked
against the value returned by CharsetDecoder.maxCharsPerByte(). Therefore
we would expect the documentation to read as follows:
newReplacement - The new replacement; must not be null, must have
non-zero length, must not be longer than the value returned by the
maxCharsPerByte method, and must be legal
information for the "newReplacement" parameter:
newReplacement - The new replacement; must not be null, must have
non-zero length, must not be longer than the value returned by the
maxBytesPerChar method, and must be legal
http://docs.oracle.com/javase/7/docs/api/java/nio/charset/CharsetEncoder.html#replaceWith(byte[])
The equivalent section of documentation for CharsetDecoder.replaceWith()
looks like this:
newReplacement - The new replacement; must not be null and must have
non-zero length
http://docs.oracle.com/javase/7/docs/api/java/nio/charset/CharsetDecoder.html#replaceWith(java.lang.String)
Note that the part about the maximum length of the parameter is missing.
The implementation reveals that the length of newReplacement is checked
against the value returned by CharsetDecoder.maxCharsPerByte(). Therefore
we would expect the documentation to read as follows:
newReplacement - The new replacement; must not be null, must have
non-zero length, must not be longer than the value returned by the
maxCharsPerByte method, and must be legal
- backported by
-
JDK-8084006 (cs) Inconsistent docs for CharsetDecoder.replaceWith and CharsetEncoder.replaceWith
-
- Resolved
-
- relates to
-
JDK-8016217 More javadoc warnings
-
- Resolved
-