[ 
https://issues.apache.org/jira/browse/HDDS-15348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jheng-Sing Chen reassigned HDDS-15348:
--------------------------------------

    Assignee: Jheng-Sing Chen

> 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
>            Assignee: Jheng-Sing Chen
>            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.
> {code}
> // 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
>         }
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to