[
https://issues.apache.org/jira/browse/HDDS-15348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze updated HDDS-15348:
------------------------------
Target Version/s: 2.2.0
Priority: Blocker (was: Major)
> OmMultipartPartKeyCodec should not use UTF8.decode(..)
> ------------------------------------------------------
>
> Key: HDDS-15348
> URL: https://issues.apache.org/jira/browse/HDDS-15348
> Project: Apache Ozone
> Issue Type: Bug
> Components: OM
> Reporter: Tsz-wo Sze
> Priority: Blocker
>
> We should use StringCodec since UTF_8.decode(..) below uses
> CodingErrorAction.REPLACE. When there is an error, it will silently replace
> characters and cause unexpected behavior.
> When there is an error, the correct behavior is to throw an exception.
> ```java
> // java.nio.charset.Charset.java
> public final CharBuffer decode(ByteBuffer bb) {
> try {
> return ThreadLocalCoders.decoderFor(this)
> .onMalformedInput(CodingErrorAction.REPLACE)
> .onUnmappableCharacter(CodingErrorAction.REPLACE)
> .decode(bb);
> } catch (CharacterCodingException x) {
> throw new Error(x); // Can't happen
> }
> }
> ```
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]